/* --- Shared Jeopardy Game Styles --- */
/* Colors driven by CSS custom properties set via template <style> block */

/* Streaks */
.streak-badge {
    font-size: 0.85em;
}

/* --- Dramatic Reveal --- */
.reveal-choice {
    padding: 14px 20px;
    margin-bottom: 8px;
    border-radius: 8px;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    transition: opacity 0.5s, outline 0.3s;
}
.reveal-choice .pick-names {
    margin-left: auto;
    font-size: 0.85rem;
    opacity: 0.9;
    font-weight: 700;
}
.reveal-correct {
    outline: 3px solid #27ae60;
    outline-offset: -3px;
}
.reveal-wrong {
    opacity: 0.4;
}

/* --- Daily Double --- */
.dd-splash {
    text-align: center;
    padding-top: 15vh;
}
.dd-title {
    font-size: 3rem;
    color: var(--theme-primary);
    text-shadow: 0 0 30px rgba(212, 160, 23, 0.5);
    animation: dd-pulse 0.6s ease-in-out 3;
    margin-bottom: 16px;
}
@keyframes dd-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}
.dd-info {
    font-size: 1.4rem;
    color: #aaa;
    margin-bottom: 12px;
}
.dd-sub {
    color: #666;
    font-size: 1.1rem;
    font-style: italic;
}

/* Wager buttons */
.wager-timer {
    height: 6px;
    background: #333;
    border-radius: 3px;
    margin-bottom: 20px;
    overflow: hidden;
}
#wager-timer-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--theme-primary), #e74c3c);
    border-radius: 3px;
    width: 100%;
    transition: width 0.1s linear;
}
.wager-btn {
    width: 48%;
    display: inline-block;
    margin: 4px 1%;
    padding: 16px;
    background: var(--theme-board-bg);
    color: var(--theme-primary);
    font-size: 1.2rem;
    font-weight: 700;
    border: 2px solid var(--theme-primary);
    border-radius: 8px;
    cursor: pointer;
}
.wager-btn:active { transform: scale(0.97); }
.wager-btn.selected { background: var(--theme-primary); color: #1a1a2e; }
.wager-btn:disabled { opacity: 0.5; cursor: default; transform: none; }
.wager-allin {
    width: 98%;
    background: #8b0000;
    border-color: #ff4444;
    color: #fff;
}
.wager-allin.selected { background: #ff4444; }
#wager-buttons { text-align: center; }

/* --- DISPLAY MODE (Desktop) --- */
.display-mode #app {
    width: 100%;
    max-width: 1200px;
    padding: 20px;
}

.display-mode #scores-bar {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.score-tag {
    padding: 8px 20px;
    background: #16213e;
    border: 2px solid var(--theme-primary);
    border-radius: 8px;
    font-size: 1.2rem;
    color: var(--theme-primary);
    font-weight: 600;
}

/* Jeopardy Board */
.board-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
    max-width: 1100px;
    margin: 0 auto;
}
.board-header {
    background: var(--theme-header-bg);
    color: var(--theme-primary);
    padding: 16px 8px;
    text-align: center;
    font-weight: 700;
    font-size: 0.95rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.board-cell {
    background: var(--theme-board-bg);
    color: var(--theme-primary);
    padding: 28px 8px;
    text-align: center;
    font-weight: 700;
    font-size: 1.6rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}
.board-cell:hover { background: var(--theme-board-hover); transform: scale(1.04); }
.board-cell.answered {
    background: #0d0d1a;
    color: transparent;
    cursor: default;
}
.board-cell.answered:hover { transform: none; background: #0d0d1a; }
.board-cell.disabled {
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
}
.picker-notice {
    text-align: center;
    color: var(--theme-primary);
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 12px;
    padding: 8px;
    background: rgba(212, 160, 23, 0.1);
    border-radius: 8px;
}

/* Display question */
.display-mode #question-screen {
    max-width: 900px;
    margin: 0 auto;
}
.display-mode #q-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
    font-size: 1.3rem;
}
.display-mode #q-category { color: var(--theme-primary); font-weight: 600; }
.display-mode #q-value { color: var(--theme-primary); font-weight: 700; font-size: 1.5rem; }
.display-mode #question-text {
    font-size: 1.8rem;
    text-align: center;
    line-height: 1.6;
    margin: 40px 0;
    padding: 0 20px;
}

/* Display choices (colored blocks) */
.display-choice {
    padding: 16px 20px;
    margin-bottom: 10px;
    border-radius: 8px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}
.choice-label {
    font-weight: 700;
    font-size: 1.4rem;
    min-width: 30px;
}

/* Choice colors */
.choice-red { background: #c0392b; }
.choice-blue { background: #2471a3; }
.choice-green { background: #1e8449; }
.choice-yellow { background: #b7950b; }

/* --- PLAYER MODE (Mobile-first, responsive) --- */
.player-mode #app {
    width: 100%;
    max-width: 600px;
    padding: 20px;
}

#join-btn {
    width: 100%;
    background: var(--theme-btn-bg);
    color: #1a1a2e;
}

/* Join screen room info */
.join-room-info {
    text-align: center;
    margin-bottom: 20px;
}
.join-room-code {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--theme-primary);
    letter-spacing: 0.2em;
}
.join-share-url {
    font-size: 0.85rem;
    color: #888;
    margin-top: 4px;
    word-break: break-all;
}

/* Host on TV link — hidden on mobile */
.tv-mode-link {
    display: none;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    margin-top: 16px;
    text-decoration: none;
    transition: color 0.2s;
}
.tv-mode-link:hover {
    color: var(--theme-primary);
    text-decoration: underline;
}
@media (min-width: 768px) {
    .tv-mode-link {
        display: block;
    }
}

/* Mobile board */
.player-mode #mobile-scores {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.player-mode .score-tag {
    font-size: 0.9rem;
    padding: 6px 12px;
}
.mobile-board-grid {
    gap: 3px !important;
}
.mobile-board-grid .board-header {
    padding: 10px 4px;
    font-size: 0.6rem;
    letter-spacing: 0;
}
.mobile-board-grid .board-cell {
    padding: 14px 4px;
    font-size: 1rem;
}

/* Player answer header */
.player-mode #answer-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    color: var(--theme-primary);
    font-weight: 600;
    font-size: 1.1rem;
}

/* Player question text */
.player-mode #a-question {
    font-size: 1.15rem;
    line-height: 1.5;
    margin-bottom: 16px;
}

/* Player choice buttons */
.choice-btn {
    width: 100%;
    padding: 18px 16px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 10px;
    color: #fff;
    text-align: left;
    transition: transform 0.1s, opacity 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.choice-btn:active { transform: scale(0.97); }
.choice-btn.selected { outline: 3px solid #fff; outline-offset: -3px; }
.choice-btn:disabled { opacity: 0.6; cursor: default; transform: none; }

.feedback.suspense {
    background: #16213e;
    color: var(--theme-primary);
    animation: dd-pulse 0.8s ease-in-out infinite;
}

.streak-display {
    font-size: 1.3rem;
    color: #ff6b35;
}

/* Board screen */
#board-screen {
    padding-top: 10px;
}

/* Daily double mobile */
.player-mode .dd-title {
    font-size: 2rem;
    margin-bottom: 12px;
}
.player-mode .dd-info {
    font-size: 1.1rem;
}

/* --- Item Buttons (Player) --- */
#item-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.item-btn {
    flex: 1;
    min-width: 120px;
    padding: 10px 12px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 2px solid;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
}
.item-btn:active { transform: scale(0.97); }
.screw-picker {
    position: relative;
    flex: 1;
    min-width: 120px;
}
.screw-btn {
    width: 100%;
    background: #4a1a1a;
    border-color: #e74c3c;
    color: #e74c3c;
}
.screw-list {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    margin-bottom: 4px;
    background: #2a0a0a;
    border: 2px solid #e74c3c;
    border-radius: 8px;
    overflow: hidden;
    max-height: 200px;
    overflow-y: auto;
    z-index: 10;
}
.screw-list.open { display: block; }
.screw-option {
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    border-bottom: 1px solid #4a1a1a;
    color: #e74c3c;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
}
.screw-option:last-child { border-bottom: none; }
.screw-option:active { background: #4a1a1a; }
.dd-btn {
    background: #1a3a4a;
    border-color: #3498db;
    color: #3498db;
}
.item-btn.used, .item-btn:disabled {
    opacity: 0.4;
    cursor: default;
    transform: none;
}
.screwed-alert {
    background: #4a1a1a;
    border: 2px solid #e74c3c;
    color: #e74c3c;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-weight: 700;
    font-size: 1.1rem;
    animation: dd-pulse 0.5s ease-in-out 3;
}
.screw-penalty {
    color: #e74c3c !important;
}

/* --- Item Alerts (Display) --- */
#item-alerts {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
}
.item-alert {
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 8px;
    animation: dd-pulse 0.5s ease-in-out 3;
}
.screw-alert {
    background: #4a1a1a;
    border: 2px solid #e74c3c;
    color: #e74c3c;
}
.dd-alert {
    background: #1a3a4a;
    border: 2px solid #3498db;
    color: #3498db;
}

/* --- Player Mode Desktop Enhancements --- */
@media (min-width: 768px) {
    .player-mode .mobile-board-grid {
        gap: 4px !important;
    }
    .player-mode .mobile-board-grid .board-header {
        padding: 14px 8px;
        font-size: 0.85rem;
    }
    .player-mode .mobile-board-grid .board-cell {
        padding: 24px 8px;
        font-size: 1.3rem;
    }
    .player-mode .choice-btn {
        padding: 20px 20px;
        font-size: 1.2rem;
    }
    .player-mode #a-question {
        font-size: 1.3rem;
    }
}

/* Display lobby join URL */
.room-code-display {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--theme-primary, #d4a017);
    margin-bottom: 8px;
}
#join-url {
    color: #aaa;
    font-size: 1rem;
}
