@import url('https://fonts.googleapis.com/css2?family=Libre+Franklin:wght@400;700;800&display=swap');

:root {
    --jeopardy-blue: #060CE9;
    --jeopardy-dark-blue: #040099;
    --jeopardy-yellow: #FFCC00;
    --jeopardy-gold: #D4AF37;
    --card-bg: #00008b;
    --card-text: #FFCC00;
    --jeopardy-font: 'Libre Franklin', 'Arial Narrow', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.jeopardy-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Setup Screen */
#setup-screen {
    max-width: 900px;
    margin: 50px auto;
}

/* Game Board */
.game-board {
    display: grid;
    /* grid-template-columns is set dynamically via JavaScript based on category count */
    grid-template-columns: repeat(var(--category-count, 6), 1fr);
    gap: 6px;
    margin-bottom: 20px;
}

.category-header {
    background: linear-gradient(180deg, var(--jeopardy-blue) 0%, var(--jeopardy-dark-blue) 100%);
    color: white;
    padding: 12px 5px;
    text-align: center;
    font-family: var(--jeopardy-font);
    font-weight: 800;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70px;
    border: 3px solid #000;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 2px 2px 5px rgba(0,0,0,0.4);
    word-break: break-word;
    font-size: 0.85rem;
    text-shadow: 2px 2px 3px rgba(0,0,0,0.5);
    letter-spacing: 1px;
}

.question-card {
    background: linear-gradient(180deg, var(--jeopardy-blue) 0%, var(--jeopardy-dark-blue) 100%);
    color: var(--jeopardy-yellow);
    font-family: var(--jeopardy-font);
    font-size: 1.8rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 80px;
    cursor: pointer;
    border: 3px solid #000;
    transition: all 0.15s ease;
    user-select: none;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 2px 2px 5px rgba(0,0,0,0.4);
}

.question-card:hover {
    background: linear-gradient(180deg, #0b12f5 0%, var(--jeopardy-blue) 100%);
    transform: scale(1.03);
    box-shadow: 0 0 15px rgba(255,204,0,0.4);
}

.question-card.played {
    background: linear-gradient(180deg, #333 0%, #222 100%);
    color: transparent;
    cursor: default;
    transform: none;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
}

.question-card.empty {
    background: linear-gradient(180deg, #1a1a2e 0%, #0a0a1a 100%);
    color: transparent;
    cursor: default;
    transform: none;
    box-shadow: none;
    opacity: 0.3;
}

/* Scoreboard */
.scoreboard {
    display: flex;
    justify-content: flex-start;
    gap: 20px;
    flex-wrap: nowrap;
    padding: 15px;
    margin-top: 20px;
    margin-bottom: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

/* Center when few teams */
.scoreboard:not(:empty) {
    justify-content: center;
}

/* Custom scrollbar for scoreboard */
.scoreboard::-webkit-scrollbar {
    height: 6px;
}

.scoreboard::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
    border-radius: 3px;
}

.scoreboard::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.3);
    border-radius: 3px;
}

.scoreboard::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.5);
}

.team-score-card {
    text-align: center;
    padding: 12px 25px;
    background: linear-gradient(180deg, var(--jeopardy-blue) 0%, var(--jeopardy-dark-blue) 100%);
    border: 3px solid var(--jeopardy-yellow);
    border-radius: 8px;
    flex-shrink: 0;
    min-width: 140px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.team-score-card .team-name {
    color: white;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 5px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.team-score-card.active {
    border-color: var(--jeopardy-gold);
    box-shadow: 0 0 20px rgba(255,204,0,0.5);
}

.team-score-card {
    position: relative;
}

.team-remove-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: #e74c3c;
    color: white;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.team-score-card:hover .team-remove-btn {
    opacity: 1;
}

.team-remove-btn:hover {
    background: #c0392b;
}

.score-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--jeopardy-yellow);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    transition: all 0.2s ease;
}

/* Editable inline elements */
.editable {
    cursor: text;
    border-radius: 4px;
    padding: 2px 6px;
    margin: -2px -6px;
    transition: background 0.2s ease;
}

.editable:hover {
    background: rgba(255,255,255,0.1);
}

.editable:focus {
    outline: none;
    background: rgba(255,255,255,0.2);
    box-shadow: 0 0 0 2px var(--jeopardy-yellow);
}

.team-name.editable:focus,
.score-value.editable:focus {
    color: white;
}

.modal-team-name.editable:focus,
.modal-team-score.editable:focus {
    background: rgba(0,0,0,0.3);
}

/* Modal Customization - AINULT mängu modal (mitte public-modal) */
#game-screen .modal-card,
.question-modal .modal-card {
    width: 85%;
    max-width: 1000px;
    height: 85vh;
    display: flex;
    flex-direction: column;
}

#game-screen .modal-card-body,
.question-modal .modal-card-body {
    display: flex;
    flex-direction: column;
    justify-content: safe center;
    align-items: center;
    background: linear-gradient(180deg, var(--jeopardy-blue) 0%, var(--jeopardy-dark-blue) 100%);
    color: white;
    text-align: center;
    padding: 20px 30px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) transparent;
}
#game-screen .modal-card-body::-webkit-scrollbar,
.question-modal .modal-card-body::-webkit-scrollbar {
    width: 6px;
}
#game-screen .modal-card-body::-webkit-scrollbar-track,
.question-modal .modal-card-body::-webkit-scrollbar-track {
    background: transparent;
}
#game-screen .modal-card-body::-webkit-scrollbar-thumb,
.question-modal .modal-card-body::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
}
#game-screen .modal-card-body::-webkit-scrollbar-thumb:hover,
.question-modal .modal-card-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
}

.question-text {
    font-family: var(--jeopardy-font);
    font-size: 2.2rem;
    margin-bottom: 1rem;
    font-weight: 800;
    text-transform: uppercase;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.6);
    line-height: 1.2;
    letter-spacing: 0.5px;
    white-space: pre-line;
}

.answer-text {
    font-family: var(--jeopardy-font);
    font-size: 2rem;
    color: var(--jeopardy-yellow);
    margin-bottom: 1rem;
    display: none;
    white-space: pre-line;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.6);
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Küsimuse meedia */
.question-media {
    margin-bottom: 20px;
    text-align: center;
    width: 100%;
}

.question-media-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.question-media-image:hover {
    transform: scale(1.02);
}

.question-media-audio {
    width: 100%;
    max-width: 400px;
}

.question-media-youtube {
    position: relative;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding-bottom: 315px; /* Fixed height instead of aspect ratio to avoid flex issues */
}

.question-media-youtube iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

.question-media-video {
    border-radius: 8px;
}

/* Täisekraan pildi modaal */
.fullscreen-image-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    cursor: pointer;
}

.fullscreen-image-modal img {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
}

.fullscreen-image-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    font-size: 2.5rem;
    line-height: 1;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.fullscreen-image-close:hover {
    background: rgba(255,255,255,0.3);
}

.modal-actions {
    width: 100%;
    padding: 10px 15px;
    background: #1a1a2e;
    flex-shrink: 0;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.4) transparent;
}
.modal-actions::-webkit-scrollbar {
    height: 6px;
}
.modal-actions::-webkit-scrollbar-track {
    background: transparent;
}
.modal-actions::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.4);
    border-radius: 3px;
}
.modal-actions::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.6);
}

.team-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: nowrap;
    width: max-content;
}

/* Modal team scoring layout */
.modal-team-scoring {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255,255,255,0.1);
    padding: 8px 12px;
    border-radius: 8px;
    min-width: 90px;
    flex-shrink: 0;
}

.modal-team-label {
    text-align: center;
    margin-bottom: 8px;
}

.modal-team-name {
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.modal-team-score {
    color: var(--jeopardy-yellow);
    font-size: 1.3rem;
    font-weight: bold;
}

/* List customization */
.list-item.is-active {
    background-color: #eff5fb;
    color: #363636;
}

/* Game screen header */
#game-screen .level {
    padding: 8px 15px;
    margin-bottom: 10px !important;
}

#game-screen #active-game-title {
    margin-bottom: 5px !important;
}

/* Dark mode game title */
[data-theme="dark"] #game-screen #active-game-title {
    color: #ffd700;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

:fullscreen #game-screen #active-game-title {
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    font-size: 1.1rem !important;
    margin-bottom: 2px !important;
    margin-top: 0 !important;
}

/* Round controls */
#round-controls {
    margin-top: 10px !important;
    margin-bottom: 0 !important;
}

#round-controls .button {
    border: 2px solid var(--jeopardy-yellow);
}

#round-controls .button.is-info {
    background: var(--jeopardy-blue);
    color: var(--jeopardy-yellow);
}

/* ========== FULLSCREEN MODE ========== */
:fullscreen .navbar {
    display: none !important;
}

:fullscreen body {
    background: linear-gradient(135deg, #0a0a1a 0%, #1a1a2e 50%, #0a0a1a 100%);
    overflow: hidden;
}

:fullscreen .container.is-fluid {
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 3px 8px;
    max-width: 100%;
    box-sizing: border-box;
}

:fullscreen #game-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

:fullscreen #game-screen .level {
    flex-shrink: 0;
    margin-bottom: 0 !important;
    padding: 2px 8px;
}

:fullscreen .scoreboard {
    flex-shrink: 0;
    padding: 3px 8px;
    margin-top: 3px;
    margin-bottom: 0;
    gap: 8px;
    background: transparent;
    order: 2;
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

:fullscreen .scoreboard::-webkit-scrollbar {
    height: 6px;
}

:fullscreen .scoreboard::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
}

:fullscreen .scoreboard::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
}

:fullscreen .scoreboard::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
}

:fullscreen .team-score-card {
    padding: 3px 12px;
    min-width: 80px;
}

:fullscreen .team-score-card .team-name {
    font-size: 0.8rem;
}

:fullscreen .score-value {
    font-size: 1.2rem;
}

:fullscreen .jeopardy-container {
    flex: 1;
    display: flex;
    align-items: stretch;
    justify-content: center;
    width: 100%;
    max-width: none;
    padding: 0;
    min-height: 0;
    order: 1;
    overflow: hidden;
}

:fullscreen #active-game-title {
    display: none;
}

:fullscreen #team-count-display {
    color: rgba(255,255,255,0.6);
}

:fullscreen .game-board {
    width: 100%;
    height: 100%;
    gap: 2px;
    margin-bottom: 0;
    /* Ensure grid columns are set from CSS variable in fullscreen too */
    grid-template-columns: repeat(var(--category-count, 6), 1fr);
    /* Auto rows - header row + question rows adapt to content */
    grid-template-rows: auto;
    grid-auto-rows: 1fr;
    align-content: start;
}

:fullscreen .category-header {
    font-size: clamp(0.6rem, 1.1vw, 0.95rem);
    padding: 4px 2px;
    line-height: 1.1;
}

:fullscreen .question-card {
    height: auto;
    font-size: clamp(2rem, 5.5vw, 5rem);
    min-height: 60px;
}

:fullscreen .question-card.played,
:fullscreen .question-card.empty {
    min-height: 60px;
}

:fullscreen #round-controls {
    flex-shrink: 0;
    margin-top: 3px !important;
    padding-bottom: 0;
}

:fullscreen #round-controls .button {
    padding: 0.2em 0.6em;
    font-size: 0.8rem;
}

/* Fullscreen modal adjustments */
:fullscreen .modal-card {
    width: 90%;
    max-width: none;
    height: 90vh;
}

/* When buzzer is active, make modal shorter to leave room for buzzer panel */
:fullscreen .modal-card.buzzer-active {
    height: 70vh;
    max-height: 70vh;
}

:fullscreen .modal-actions {
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.4) transparent;
}
:fullscreen .modal-actions::-webkit-scrollbar {
    height: 6px;
}
:fullscreen .modal-actions::-webkit-scrollbar-track {
    background: transparent;
}
:fullscreen .modal-actions::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.4);
    border-radius: 3px;
}

:fullscreen .question-text {
    font-size: clamp(1.5rem, 4vw, 3rem);
}

:fullscreen .answer-text {
    font-size: clamp(1.3rem, 3.5vw, 2.5rem);
}

/* Hide empty message nicely */
.scoreboard:empty::before {
    content: "Lisa võistkond alustamiseks →";
    color: rgba(0,0,0,0.4);
    font-style: italic;
}

:fullscreen .scoreboard:empty::before {
    color: rgba(255,255,255,0.5);
}

/* Dark mode scoreboard (custom component) */
[data-theme="dark"] .scoreboard:empty::before {
    color: rgba(255,255,255,0.5);
}

[data-theme="dark"] .scoreboard::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
}

[data-theme="dark"] .scoreboard::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
}

[data-theme="dark"] .scoreboard::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
}


/* Last correct team indicator */
.team-score-card.last-correct {
    border-color: #27ae60;
    box-shadow: 0 0 12px rgba(39, 174, 96, 0.4);
}

.chooser-indicator {
    font-size: 0.85em;
    cursor: default;
    user-select: none;
}

/* Better hover states */
.team-score-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
    cursor: pointer;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .game-board {
        gap: 3px;
    }
    
    .category-header {
        font-size: 0.7rem;
        padding: 8px 3px;
        min-height: 50px;
    }
    
    .question-card {
        font-size: 1.2rem;
        height: 60px;
    }
    
    .question-text {
        font-size: 1.5rem;
    }
    
    .answer-text {
        font-size: 1.3rem;
    }
}

/* Custom modal styling - AINULT mängu modal */
#game-screen .modal-card-head,
.question-modal .modal-card-head {
    background: #1a1a2e;
    border-bottom: none;
    flex-shrink: 0;
}

.modal-actions-top {
    padding: 8px 15px;
    justify-content: center;
}

.modal-actions-top .buttons {
    margin-bottom: 0;
}

#game-screen .modal-card-title,
.question-modal .modal-card-title {
    color: white;
}

#game-screen .modal-card-head .delete,
.question-modal .modal-card-head .delete {
    background: rgba(255,255,255,0.2);
}

#game-screen .modal-card-head .delete:hover,
.question-modal .modal-card-head .delete:hover {
    background: rgba(255,255,255,0.3);
}

#game-screen .modal-card-foot,
.question-modal .modal-card-foot {
    background: #1a1a2e;
    border-top: none;
}

/* Public modal - kasutab Bulma vaikestiile, dark mode automaatne */
.public-modal .modal-card {
    width: 90%;
    max-width: 400px;
    height: auto;
    margin: 0 auto;
}

.public-modal .modal-card-head {
    padding: 12px 16px;
}

.public-modal .modal-card-title {
    font-size: 1rem;
}

.public-modal .modal-card-body {
    padding: 16px;
    display: block;
}

.public-modal .modal-card-foot {
    padding: 12px 16px;
}

/* Simple confirm dialog */
.confirm-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px 25px;
    border-radius: 8px;
    text-align: center;
    max-width: 320px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    z-index: 10000;
}

.confirm-dialog p {
    margin-bottom: 15px;
    font-size: 1rem;
    color: #333;
}

.confirm-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.confirm-buttons .button {
    min-width: 60px;
}

/* Toast notification */
.toast-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    z-index: 10001;
    animation: toastSlideUp 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.toast-notification .icon {
    color: #4caf50;
    margin-right: 5px;
}

.toast-error {
    background: #d32f2f;
}

.toast-error .icon {
    color: #ffcdd2;
}

@keyframes toastSlideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Daily Double special styling - Silver theme */
.daily-double-alert .modal-card-body {
    background: linear-gradient(135deg, #8E9EAB 0%, #C9D6DF 50%, #8E9EAB 100%);
    color: #1a1a2e;
}

/* Daily Double Modal - Enhanced - Silver theme */
.daily-double-modal .daily-double-card {
    background: linear-gradient(135deg, #8E9EAB 0%, #C9D6DF 50%, #8E9EAB 100%);
    border-radius: 20px;
    max-width: 600px;
    margin: auto;
    box-shadow: 0 0 60px rgba(142, 158, 171, 0.6);
}

.daily-double-content {
    padding: 50px 40px;
    text-align: center;
    color: #1a1a2e;
}

.daily-double-star {
    font-size: 5rem;
    color: #1a1a2e;
    text-shadow: 0 0 20px rgba(0,0,0,0.2);
    animation: starPulse 1s ease-in-out infinite;
}

@keyframes starPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.daily-double-title {
    font-size: 3rem;
    font-weight: bold;
    margin: 20px 0 10px;
    text-transform: uppercase;
    letter-spacing: 5px;
}

.daily-double-subtitle {
    font-size: 1.2rem;
    opacity: 0.8;
    margin-bottom: 30px;
}

.daily-double-info {
    background: rgba(0,0,0,0.1);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
}

.daily-double-info p {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.daily-double-info .daily-double-hint {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 0;
}

.daily-double-continue {
    font-size: 1.2rem !important;
    padding: 15px 30px !important;
    background-color: #f0c040 !important;
    border-color: transparent !important;
    color: #1a1a2e !important;
    transition: all 0.2s ease !important;
}

.daily-double-continue:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

/* Daily Double Scores Panel */
.daily-double-scores {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.dd-score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0,0,0,0.12);
    padding: 8px 16px;
    border-radius: 8px;
    min-width: 90px;
}

.dd-score-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 2px;
}

.dd-score-value {
    font-size: 1.1rem;
    font-weight: bold;
    color: #060CE9;
}

/* Fullscreen Daily Double */
:fullscreen .daily-double-card {
    max-width: 800px;
}

:fullscreen .daily-double-star {
    font-size: 8rem;
}

:fullscreen .daily-double-title {
    font-size: 5rem;
}

:fullscreen .daily-double-subtitle {
    font-size: 1.8rem;
}

:fullscreen .daily-double-scores {
    gap: 14px;
    margin-bottom: 25px;
}

:fullscreen .dd-score-item {
    padding: 10px 20px;
    min-width: 110px;
}

:fullscreen .dd-score-name {
    font-size: 1rem;
}

:fullscreen .dd-score-value {
    font-size: 1.3rem;
}

:fullscreen .daily-double-info p {
    font-size: 1.4rem;
}

:fullscreen .daily-double-continue {
    font-size: 1.5rem !important;
    padding: 20px 40px !important;
}

/* Game list */
.game-list {
    display: flex;
    flex-direction: column;
}

.game-list-item {
    display: block;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: inherit;
    outline: none;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border-color, #eee);
    border-radius: 8px;
    background: var(--bg-card, #f9f9f9);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.game-list-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

[data-theme="dark"] .game-list-item {
    border-color: var(--border-color);
}

/* Game item layout */
.game-item-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.game-item-title {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.game-item-title strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.game-item-title .tag,
.game-item-title small {
    flex-shrink: 0;
    white-space: nowrap;
}

.game-item-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.8rem;
    color: var(--text-muted, #777);
}

.game-item-actions {
    display: flex;
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 4px;
}

.game-item-actions.buttons {
    gap: 4px;
}

.game-item-actions .button {
    margin-bottom: 0 !important;
    margin-right: 0 !important;
}

@media screen and (max-width: 768px) {
    #setup-screen {
        margin: 8px auto;
        padding: 1rem 0.75rem;
    }

    .container.is-fluid {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    .game-item-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }
    .game-item-title {
        width: 100%;
    }
    .game-item-title strong {
        white-space: normal;
        word-break: break-word;
    }
}

/* Input field in game screen - fullscreen only */
:fullscreen #game-screen .input {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.3);
    color: white;
}

:fullscreen #game-screen .input::placeholder {
    color: rgba(255,255,255,0.5);
}

:fullscreen #game-screen .input:focus {
    border-color: var(--jeopardy-yellow);
    box-shadow: 0 0 0 0.125em rgba(255,204,0,0.25);
}


/* Final Team Scores display (category/wager phases) */
.final-team-scores {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.final-team-score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(6, 12, 233, 0.15);
    padding: 8px 18px;
    border-radius: 8px;
    min-width: 90px;
}

:fullscreen .final-team-score-item {
    background: rgba(255,255,255,0.1);
}

.fts-name {
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0.8;
}

:fullscreen .fts-name {
    color: white;
}

.fts-value {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--jeopardy-blue);
}

:fullscreen .fts-value {
    color: var(--jeopardy-yellow);
}

.final-team-score-item.has-wagered {
    background: rgba(76, 175, 80, 0.2);
    border: 1px solid rgba(76, 175, 80, 0.4);
}

:fullscreen .final-team-score-item.has-wagered {
    background: rgba(76, 175, 80, 0.25);
}

.final-wager-excluded {
    opacity: 0.4;
}

.final-wager-excluded .final-team-score-item {
    background: rgba(100, 100, 100, 0.15);
}

/* Final Jeopardy special styling */
.final-container {
    padding: 40px;
}

.final-title {
    color: var(--jeopardy-blue);
}

.final-category {
    color: var(--jeopardy-dark-blue);
}

:fullscreen .final-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    max-width: none;
    width: 95%;
    padding: 0;
}

:fullscreen .final-title {
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

:fullscreen .final-category {
    color: var(--jeopardy-yellow);
}

:fullscreen .final-container .title {
    font-size: 3vw;
    margin-bottom: 2rem;
}

:fullscreen .final-container .button {
    font-size: 1.5vw;
    padding: 1em 2em;
}

/* Pulse animation for active round button */
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,204,0,0.4); }
    50% { box-shadow: 0 0 0 8px rgba(255,204,0,0); }
}

#round-controls .button.is-info {
    animation: pulse 2s infinite;
}

/* Better scroll handling in fullscreen */
:fullscreen {
    overflow: hidden;
}

:fullscreen * {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

:fullscreen *::-webkit-scrollbar {
    display: none;
}

/* Buzzer Panel */
.buzzer-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    padding: 15px;
    min-width: 280px;
    max-width: 350px;
    z-index: 1000;
}

.buzzer-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.buzzer-header strong {
    flex: 1;
    color: #333;
}

.buzzer-active-answerer {
    display: none;
    padding: 4px 12px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.4);
}

.buzzer-active-answerer.has-answerer {
    display: inline-block;
    animation: activeAnswererPulse 1.5s ease-in-out infinite;
}

@keyframes activeAnswererPulse {
    0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 2px 8px rgba(34, 197, 94, 0.4); }
    50% { opacity: 0.9; transform: scale(1.03); box-shadow: 0 4px 16px rgba(34, 197, 94, 0.6); }
}

/* Minimized panel grows when there's an active answerer */
.buzzer-panel.is-minimized.has-active-answerer {
    padding: 12px 16px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #22c55e;
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.3);
}

.buzzer-panel.is-minimized.has-active-answerer .buzzer-header {
    margin-bottom: 0;
}

.buzzer-panel.is-minimized.has-active-answerer .buzzer-header strong {
    color: white;
}

.buzzer-panel.is-minimized.has-active-answerer .buzzer-active-answerer {
    font-size: 1.2rem;
    padding: 6px 16px;
}

.buzzer-presses {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
}

.buzzer-press-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    background: #f5f5f5;
}

.buzzer-press-item.first {
    background: linear-gradient(135deg, #f1c40f 0%, #f39c12 100%);
    color: #333;
    font-weight: bold;
}

.buzzer-press-item .position {
    font-size: 1.2rem;
    font-weight: bold;
    min-width: 30px;
}

.buzzer-press-item .team-name {
    flex: 1;
}

.buzzer-press-item .time {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Buzzer Teams List v2.0 */
.buzzer-teams-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 150px;
    overflow-y: auto;
}

.buzzer-team-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    background: #f0f0f0;
    border-radius: 6px;
    font-size: 0.85rem;
}

.buzzer-team-item .team-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.buzzer-team-item .team-actions {
    display: flex;
    gap: 4px;
    margin-left: 8px;
}

.buzzer-team-item .team-actions .button {
    padding: 0 6px;
    height: 24px;
}

.buzzer-section-title {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Buzzer Links Modal */
.buzzer-links-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.buzzer-links-content {
    background: white;
    padding: 25px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

[data-theme="dark"] .buzzer-links-content {
    background: #2a2a3e;
    color: #e0e0e0;
}

[data-theme="dark"] .buzzer-links-content .label {
    color: #ccc;
}

[data-theme="dark"] .buzzer-links-content .input {
    background-color: #1e1e2e;
    color: #e0e0e0;
    border-color: #555;
}

[data-theme="dark"] .buzzer-links-content .title {
    color: #e0e0e0;
}

/* Buzzer Links List */
.buzzer-links-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 50vh;
    overflow-y: auto;
}

.buzzer-link-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.buzzer-link-name {
    font-weight: bold;
    font-size: 1.1rem;
    color: #333;
}

.buzzer-link-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* QR Code Modal */
.buzzer-qr-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.buzzer-qr-content {
    background: white;
    padding: 30px;
    border-radius: 16px;
    text-align: center;
    max-width: 350px;
}

.buzzer-qr-large {
    width: 250px;
    height: 250px;
    border-radius: 12px;
    background: white;
    padding: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

:fullscreen .buzzer-panel {
    bottom: 10px;
    top: auto;
    width: auto;
    min-width: 350px;
    max-width: 90%;
}

/* Buzzer active indicator */
#buzzer-toggle-btn.is-active {
    background: #27ae60 !important;
    color: white;
}

/* ============ FINAL JEOPARDY STYLES ============ */

.final-container {
    max-width: 1100px;
    width: 100%;
    padding: 40px;
}

.final-title {
    color: #FFD700 !important;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.final-category {
    color: white;
    background: linear-gradient(135deg, #060CE9 0%, #1a1a8e 100%);
    padding: 20px 40px;
    border-radius: 10px;
    display: inline-block;
}

.final-question-box {
    background: linear-gradient(135deg, #060CE9 0%, #1a1a8e 100%);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.final-question-box .title {
    color: white !important;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.final-timer {
    font-size: 5rem;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.final-timer .timer-value.is-danger {
    color: #e74c3c;
    animation: pulse-danger 0.5s infinite;
}

@keyframes pulse-danger {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.final-wager-inputs {
    background: rgba(0,0,0,0.2);
    padding: 20px;
    border-radius: 10px;
    max-width: 500px;
    margin: 0 auto;
}

.final-wager-inputs .label {
    color: white !important;
}

/* ============ FINAL REVEAL THREE-PANEL LAYOUT ============ */

.final-reveal-layout {
    display: flex;
    gap: 20px;
    width: 100%;
    max-width: 1200px;
    margin-top: 20px;
    min-height: 300px;
    text-align: left;
}

/* Left panel - pending teams */
.final-reveal-pending {
    flex: 0 0 200px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.final-reveal-pending h4 {
    color: rgba(255,255,255,0.6);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.pending-team-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(255,255,255,0.08);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.pending-team-item:hover {
    background: rgba(255,255,255,0.15);
    transform: translateX(4px);
}

.pending-team-item.is-active {
    background: linear-gradient(135deg, #060CE9, #1a1a8e);
    box-shadow: 0 2px 10px rgba(6, 12, 233, 0.4);
}

.pending-team-item .team-pts {
    color: #FFD700;
    font-weight: 600;
    font-size: 0.85rem;
}

/* Center panel - active team card */
.final-reveal-active {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.final-active-card {
    background: linear-gradient(135deg, #060CE9 0%, #1a1a8e 100%);
    border-radius: 15px;
    padding: 30px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
    color: white;
    text-align: center;
}

.final-active-card .team-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(255,255,255,0.2);
}

.final-active-card .team-name {
    font-size: 1.5rem;
    font-weight: bold;
}

.final-active-card .team-score {
    color: #FFD700;
    font-weight: bold;
    font-size: 1.3rem;
}

.final-active-card .wager {
    color: #FFD700;
    font-size: 1.2rem;
    margin-bottom: 12px;
}

.final-active-card .answer {
    background: rgba(255,255,255,0.1);
    padding: 14px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.final-active-card .manual-wager-field .label {
    color: white !important;
}

.final-active-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 500px;
    min-height: 200px;
    border: 2px dashed rgba(255,255,255,0.15);
    border-radius: 15px;
    color: rgba(255,255,255,0.3);
    font-size: 1.1rem;
}

/* Right panel - scored leaderboard */
.final-reveal-scored {
    flex: 0 0 250px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.final-reveal-scored h4 {
    color: rgba(255,255,255,0.6);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.scored-team-item {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background: rgba(255,255,255,0.08);
    border-radius: 8px;
    color: white;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    animation: scoreSlideIn 0.4s ease-out;
}

@keyframes scoreSlideIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

.scored-team-item .rank {
    font-weight: 700;
    min-width: 28px;
    color: rgba(255,255,255,0.5);
}

.scored-team-item .scored-name {
    flex: 1;
    font-weight: 600;
}

.scored-team-item .scored-pts {
    color: #FFD700;
    font-weight: 700;
}

.scored-team-item.first-place {
    background: linear-gradient(135deg, rgba(255,215,0,0.25), rgba(255,215,0,0.1));
}

.scored-team-item.first-place .rank {
    color: #FFD700;
}

/* All scored - finish button area */
.final-all-scored {
    text-align: center;
    margin-top: 20px;
    padding: 20px;
}

/* Mobile responsive */
@media screen and (max-width: 900px) {
    .final-reveal-layout {
        flex-direction: column;
        max-width: 100%;
    }
    .final-reveal-pending,
    .final-reveal-scored {
        flex: none;
        flex-direction: row;
        flex-wrap: wrap;
    }
    .pending-team-item,
    .scored-team-item {
        flex: 1 1 auto;
        min-width: 120px;
    }
}

/* Fullscreen adjustments */
:fullscreen .final-reveal-layout {
    max-width: 95vw;
    max-height: calc(100vh - 200px);
}

:fullscreen .final-active-card {
    max-width: 600px;
    padding: 40px;
}

:fullscreen .final-active-card .team-name {
    font-size: 2rem;
}

:fullscreen .final-active-card .team-score {
    font-size: 1.6rem;
}

:fullscreen .final-active-card .wager,
:fullscreen .final-active-card .answer {
    font-size: 1.3rem;
}

:fullscreen .final-container {
    padding: 20px;
}

:fullscreen .final-title {
    font-size: 2.5rem !important;
}

:fullscreen .final-timer {
    font-size: 8rem;
}

:fullscreen .final-question-box {
    padding: 60px;
}

:fullscreen .final-question-box .title {
    font-size: 2rem !important;
}

/* Final Leaderboard */
.final-leaderboard {
    max-width: 650px;
    width: 100%;
    margin: 0 auto;
    padding: 30px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.leaderboard-scroll {
    max-height: calc(100vh - 350px);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) transparent;
}

.leaderboard-scroll::-webkit-scrollbar {
    width: 6px;
}

.leaderboard-scroll::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}

.leaderboard-actions {
    padding-top: 10px;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    transition: transform 0.2s;
}

.leaderboard-item.first-place {
    background: linear-gradient(135deg, #ffd700 0%, #b8860b 100%);
    color: #1a1a2e;
    font-size: 1.3em;
    transform: scale(1.05);
}

.leaderboard-item.second-place {
    background: linear-gradient(135deg, #c0c0c0 0%, #808080 100%);
    color: #1a1a2e;
    font-size: 1.15em;
}

.leaderboard-item.third-place {
    background: linear-gradient(135deg, #cd7f32 0%, #8b4513 100%);
    color: #fff;
    font-size: 1.1em;
}

.leaderboard-medal {
    font-size: 1.5em;
    min-width: 50px;
    text-align: center;
}

.leaderboard-name {
    flex: 1;
    font-weight: bold;
    padding: 0 15px;
}

.leaderboard-score {
    font-weight: bold;
    font-size: 1.2em;
}

:fullscreen .final-leaderboard {
    max-width: 700px;
    padding: 20px 30px;
}

:fullscreen .leaderboard-scroll {
    max-height: calc(100vh - 300px);
}

:fullscreen .leaderboard-item {
    padding: 12px 20px;
    font-size: 1.1em;
}

:fullscreen .leaderboard-item.first-place {
    font-size: 1.6em;
}

:fullscreen .leaderboard-medal {
    font-size: 2em;
    min-width: 80px;
}

/* ========== 4K / LARGE SCREEN FULLSCREEN MODE ========== */
@media screen and (min-width: 2560px) {
    :fullscreen .category-header {
        font-size: clamp(1.1rem, 1.4vw, 1.8rem);
        padding: 13px 9px;
        letter-spacing: 1.2px;
    }
    
    :fullscreen .question-card {
        font-size: clamp(3.5rem, 6.5vw, 8rem);
    }
    
    :fullscreen .scoreboard {
        padding: 18px 22px;
        gap: 28px;
    }
    
    :fullscreen .team-score-card {
        padding: 13px 32px;
        min-width: 165px;
        border-width: 4px;
    }
    
    :fullscreen .team-score-card .team-name {
        font-size: 1.3rem;
    }
    
    :fullscreen .score-value {
        font-size: 2.2rem;
    }
    
    :fullscreen .question-text {
        font-size: clamp(2.8rem, 5.2vw, 5.5rem);
    }
    
    :fullscreen .answer-text {
        font-size: clamp(2.2rem, 4.2vw, 4.5rem);
    }
    
    :fullscreen #round-controls .button {
        padding: 0.55em 1.35em;
        font-size: 1.2rem;
    }
    
    :fullscreen .final-title {
        font-size: 4.5rem !important;
    }
    
    :fullscreen .final-category {
        font-size: 3.5rem !important;
    }
    
    :fullscreen .final-timer {
        font-size: 13rem;
    }
    
    :fullscreen .final-question-box {
        padding: 90px;
    }
    
    :fullscreen .final-question-box .title {
        font-size: 3.5rem !important;
    }
    
    :fullscreen .final-leaderboard {
        max-width: 800px;
        padding: 30px;
    }
    
    :fullscreen .leaderboard-item {
        padding: 16px 25px;
        font-size: 1.3em;
        border-radius: 12px;
    }
    
    :fullscreen .leaderboard-item.first-place {
        font-size: 2.5em;
    }
    
    :fullscreen .leaderboard-medal {
        font-size: 3.2em;
        min-width: 130px;
    }
    
    :fullscreen .buzzer-panel {
        font-size: 1.3rem;
    }
    
    :fullscreen .buzzer-presses .buzzer-press {
        padding: 13px 22px;
        font-size: 1.2rem;
    }
    
    :fullscreen .modal-card-head,
    :fullscreen .modal-card-foot {
        padding: 12px 25px;
    }
    
    :fullscreen .modal-card-body {
        padding: 20px 30px;
    }
    
    :fullscreen .team-score-btn {
        font-size: 1.5rem;
        padding: 22px 35px;
    }
}

/* Even larger screens (true 4K) */
@media screen and (min-width: 3800px) {
    :fullscreen .category-header {
        font-size: clamp(1.4rem, 1.65vw, 2.2rem);
        padding: 20px 13px;
    }
    
    :fullscreen .question-card {
        font-size: clamp(4.5rem, 7.5vw, 10rem);
    }
    
    :fullscreen .team-score-card {
        padding: 20px 45px;
        min-width: 225px;
        border-radius: 13px;
        border-width: 5px;
    }
    
    :fullscreen .team-score-card .team-name {
        font-size: 1.65rem;
    }
    
    :fullscreen .score-value {
        font-size: 2.8rem;
    }
    
    :fullscreen .question-text {
        font-size: clamp(3.5rem, 5.8vw, 6.5rem);
    }
    
    :fullscreen .answer-text {
        font-size: clamp(2.8rem, 4.8vw, 5.5rem);
    }
    
    :fullscreen #round-controls .button {
        padding: 0.7em 1.8em;
        font-size: 1.5rem;
    }
    
    :fullscreen .final-title {
        font-size: 5.5rem !important;
    }
    
    :fullscreen .final-timer {
        font-size: 18rem;
    }
    
    :fullscreen .final-leaderboard {
        max-width: 900px;
        padding: 40px;
    }
    
    :fullscreen .leaderboard-item {
        padding: 20px 30px;
        font-size: 1.5em;
    }
    
    :fullscreen .leaderboard-item.first-place {
        font-size: 3.2em;
    }
    
    :fullscreen .leaderboard-medal {
        font-size: 4.5em;
        min-width: 165px;
    }
    
    :fullscreen .team-score-btn {
        font-size: 2rem;
        padding: 28px 45px;
    }
}

/* ============ AVALIKUSTAMISE MODAAL ============ */

/* 
 * Avalikustamise ja muud modaalid kasutavad saidi vaikestiili,
 * mitte Kuldvillaku kuldset stiili
 */

/* Bulma 1.0.4 haldab modal, input, label, notification dark mode'i automaatselt */

/* ============ DARK MODE BUZZER PANEL ============ */
[data-theme="dark"] .buzzer-panel {
    background: #2a2a3e;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

[data-theme="dark"] .buzzer-panel .buzzer-header,
[data-theme="dark"] .buzzer-panel .buzzer-header strong {
    color: #e0e0e0;
}

[data-theme="dark"] .buzzer-section-title {
    color: #aaa !important;
}

[data-theme="dark"] .buzzer-team-item {
    background: #3a3a4e;
    color: #e0e0e0;
}

[data-theme="dark"] .buzzer-presses {
    background: #1e1e2e;
}

[data-theme="dark"] .buzzer-press,
[data-theme="dark"] .buzzer-press-item {
    background: #3a3a4e;
    color: #e0e0e0;
}

[data-theme="dark"] .buzzer-press-item.first {
    background: linear-gradient(135deg, #f1c40f 0%, #f39c12 100%);
    color: #333;
}

/* Buzzer panel lock status indicator - background color based */
.buzzer-panel.is-locked {
    border-left: 4px solid #f39c12;
}

.buzzer-panel.is-unlocked {
    border-left: 4px solid #27ae60;
}

/* Buzzer panel expanded state (when presses exist) */
.buzzer-panel.has-presses {
    min-width: 350px;
}

.buzzer-panel.has-presses .buzzer-presses {
    min-height: 60px;
}

/* ============ BUZZER PANEL COLLAPSE ============ */
.buzzer-panel.minimized .buzzer-content {
    display: none;
}

.buzzer-panel.minimized {
    min-width: auto;
    max-width: none;
}

.buzzer-minimize-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 6px;
    font-size: 0.85rem;
    color: #666;
    margin-left: auto;
}

.buzzer-minimize-btn:hover {
    color: #333;
}

[data-theme="dark"] .buzzer-minimize-btn {
    color: #aaa;
}

[data-theme="dark"] .buzzer-minimize-btn:hover {
    color: #fff;
}

[data-theme="dark"] .buzzer-panel .label {
    color: #ccc;
}

[data-theme="dark"] .buzzer-panel .input {
    background-color: #1e1e2e;
    color: #e0e0e0;
    border-color: #555;
}

[data-theme="dark"] .buzzer-panel .button.is-primary {
    color: #fff;
}

/* ============ FINAL REVEAL SCROLLABLE ============ */
/* Ensure final container with reveal layout scrolls in fullscreen */
:fullscreen .final-container.reveal-phase {
    justify-content: flex-start;
    overflow-y: auto;
    padding: 20px;
    max-height: 100vh;
}

:fullscreen .final-container.reveal-phase .final-title,
:fullscreen .final-container.reveal-phase #correct-answer-box {
    flex-shrink: 0;
}

/* ============ BUZZER PANEL MOBILE FIX ============ */
@media screen and (max-width: 400px) {
    .buzzer-panel {
        left: 10px;
        right: 10px;
        min-width: 0;
        max-width: none;
    }
    .buzzer-panel.has-presses {
        min-width: 0;
    }
}

/* ============ ROUND TIMER ============ */

.round-timer-inline {
    display: flex;
    align-items: center;
    gap: 0;
}

.round-timer-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--jeopardy-blue), var(--jeopardy-dark-blue));
    color: white;
    font-family: var(--jeopardy-font);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 1px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: background 0.3s ease;
    white-space: nowrap;
}

.round-timer-clickable {
    cursor: pointer;
    transition: opacity 0.2s;
}

.round-timer-clickable:hover {
    opacity: 0.7;
}

.round-timer-badge.is-warning {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: #1a1a2e;
}

.round-timer-badge.is-danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    animation: timerPulse 1s ease-in-out infinite;
}

.round-timer-badge.is-paused {
    background: linear-gradient(135deg, #636e72, #4a5568);
    color: rgba(255,255,255,0.85);
    animation: timerPauseBlink 1.5s ease-in-out infinite;
}

@keyframes timerPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes timerPauseBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

:fullscreen .round-timer-badge {
    font-size: 1.1rem;
    padding: 5px 16px;
}

[data-theme="dark"] .round-timer-badge {
    box-shadow: 0 2px 12px rgba(0,0,0,0.5);
}

/* ============ FULLSCREEN BUTTON VISIBILITY ============ */

:fullscreen #edit-game-btn {
    display: none !important;
}

/* ============ AI MÄNGU LOOMISE MODAAL ============ */
#ai-modal .modal-card {
    width: 92%;
    max-width: 720px;
}

#ai-modal .ai-step h4 {
    margin-bottom: 0.5rem;
}

/* Tume režiim: textarea ja code-element AI modaalis */
[data-theme="dark"] #ai-modal .modal-card-body .textarea {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] #ai-modal .modal-card-body .textarea::placeholder {
    color: var(--text-muted);
}

[data-theme="dark"] #ai-modal .modal-card-body code {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    padding: 1px 5px;
    border-radius: 3px;
}

[data-theme="dark"] #ai-modal .modal-card-body .checkbox {
    color: var(--text-primary);
}

/* Mobiili kohendused */
@media screen and (max-width: 600px) {
    #ai-modal .modal-card {
        width: 100%;
        max-width: 100%;
        margin: 0;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    #ai-modal .modal-card-body {
        padding: 1rem;
    }
}
