:root {
    --bg-color: #0b0f19;
    --panel-color: rgba(10, 20, 40, 0.85);
    --accent-blue: #2563eb;
    --accent-red: #dc2626;
    --accent-gold: #f59e0b;
    --text-color: #f1f5f9;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--bg-color);
    font-family: 'Segoe UI', Roboto, sans-serif;
    color: var(--text-color);
    overflow: hidden;
    box-sizing: border-box;
}

.studio-background {
    position: relative;
    width: 100%;
    height: 100vh;
    background-image: url('../cenario/fundo.webp'); 
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    box-sizing: border-box;
    transition: background-image 0.3s ease;
}

/* TOPO: Painel CSS */
.game-header-css {
    width: 100%;
    max-width: 600px;
    padding: 12px 0;
    background: rgba(9, 15, 30, 0.9);
    border: 3px double #06b6d4;
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.4), inset 0 0 15px rgba(6, 182, 212, 0.2);
    text-align: center;
    z-index: 5;
}
.game-header-css h1 {
    margin: 0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 2.2rem;
    font-weight: 900;
    color: #06b6d4;
    text-transform: uppercase;
    letter-spacing: 4px;
    text-shadow: 0 0 10px rgba(6, 182, 212, 0.8);
}

.center-dashboard {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 5;
    margin-top: -5px;
}

.scoreboard-capsule {
    display: flex;
    gap: 40px;
    background: rgba(11, 22, 44, 0.9);
    padding: 8px 35px;
    border-radius: 20px;
    border: 2px solid #233554;
    box-shadow: 0 0 15px rgba(35, 53, 84, 0.5);
    margin-bottom: 8px;
    align-items: center;
}
.score-box { text-align: center; }
.score-box span { font-size: 0.7rem; color: #64748b; font-weight: bold; letter-spacing: 1px; display: block; text-transform: uppercase; }
.score-val { font-size: 1.8rem; font-weight: 900; margin-top: 2px; }
.score-val.blue { color: #3b82f6; text-shadow: 0 0 10px rgba(59, 130, 246, 0.6); }
.score-val.red { color: #ef4444; text-shadow: 0 0 10px rgba(239, 68, 68, 0.6); }

#cronometro {
    font-family: 'Courier New', Courier, monospace;
    font-size: 2.2rem;
    font-weight: 900;
    transition: color 0.2s, opacity 0.2s;
}

.turn-banner {
    background: linear-gradient(90deg, rgba(245,158,11,0) 0%, rgba(245,158,11,0.15) 20%, rgba(245,158,11,0.75) 50%, rgba(245,158,11,0.15) 80%, rgba(245,158,11,0) 100%);
    border-top: 1px solid var(--accent-gold);
    border-bottom: 1px solid var(--accent-gold);
    padding: 8px 40px;
    font-size: 1.15rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 2px 5px #000;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    min-width: 450px;
    text-align: center;
    transition: color 0.2s;
}

.turn-banner.victory-display {
    font-size: 1.6rem;
    padding: 15px 50px;
    border-top: 3px solid var(--accent-gold);
    border-bottom: 3px solid var(--accent-gold);
    background: linear-gradient(90deg, rgba(15,23,42,0) 0%, rgba(15,23,42,0.9) 25%, rgba(15,23,42,0.9) 75%, rgba(15,23,42,0) 100%);
    box-shadow: 0 0 25px rgba(245, 158, 11, 0.4);
    color: var(--accent-gold);
    text-shadow: 0 0 12px rgba(245, 158, 11, 0.6);
}

/* LATERAIS */
.podium-container {
    position: absolute;
    top: var(--podium-top, 52%); 
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 4;
    transition: top 0.4s ease-in-out, filter 0.4s ease-in-out, transform 0.4s ease-in-out;
    padding: 15px;
    border-radius: 20px;
}
.podium-left { left: 30px; }
.podium-right { right: 30px; }

.player-sprite {
    width: 320px;
    height: 320px;
    background-size: contain;
    background-repeat: no-repeat;
    transition: filter 0.4s ease-in-out, transform 0.4s ease-in-out;
}
.podium-left .player-sprite { background-image: url('../personagens/jogador_a.webp'); background-position: bottom left; }
.podium-right .player-sprite { background-image: url('../personagens/jogador_b.webp'); background-position: bottom right; }

.nametag-neon {
    background: rgba(15, 23, 42, 0.9);
    padding: 6px 20px;
    border-radius: 8px;
    font-weight: 900;
    font-size: 0.9rem;
    letter-spacing: 1.5px;
    margin-top: 10px;
    border: 1px solid #334155;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    text-transform: uppercase;
}
.podium-left .nametag-neon { color: #60a5fa; border-color: rgba(59, 130, 246, 0.3); }
.podium-right .nametag-neon { color: #f87171; border-color: rgba(239, 68, 68, 0.3); }

/* POWER-UPS NOS JOGADORES */
.team-powerups {
    position: absolute; /* Tira os botões do cálculo de altura */
    top: 100%; /* Pendura eles exatamente abaixo do nome do jogador */
    margin-top: 15px; 
    display: grid;
    grid-template-columns: 1fr 1fr; 
    gap: 8px;
    background: rgba(10, 15, 25, 0.9);
    padding: 10px;
    border-radius: 12px;
    border: 1px solid #1e293b;
    box-shadow: 0 6px 15px rgba(0,0,0,0.7);
    width: 100%;
    box-sizing: border-box;
    z-index: 10;
}
.btn-powerup {
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border: 1px solid #3b82f6;
    color: #e2e8f0;
    padding: 8px 4px;
    font-size: 0.75rem;
    font-weight: 900;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    box-shadow: 0 4px 6px rgba(0,0,0,0.4);
}
.btn-powerup.red-theme {
    border-color: #ef4444;
}

.btn-powerup:hover:not(:disabled) {
    background: var(--accent-blue);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.7);
}
.btn-powerup.red-theme:hover:not(:disabled) {
    background: var(--accent-red);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.7);
}

/* ESTADO DESLIGADO (Muito mais apagado para os alunos entenderem) */
.btn-powerup:disabled {
    background: #070a12 !important;
    color: #334155 !important;
    border-color: #0f172a !important;
    cursor: not-allowed;
    opacity: 0.25; /* Deixa bem transparente */
    filter: grayscale(100%); /* Tira toda a cor */
    box-shadow: inset 0 0 10px rgba(0,0,0,0.8) !important;
    transform: scale(0.95);
}

.podium-container.active-blue-turn .player-sprite { filter: drop-shadow(0 0 25px rgba(37, 99, 235, 0.9)) brightness(1.1); animation: pulse-blue 2s infinite alternate; }
.podium-container.active-red-turn .player-sprite { filter: drop-shadow(0 0 25px rgba(220, 38, 38, 0.9)) brightness(1.1); animation: pulse-red 2s infinite alternate; }

.podium-container.super-glow-blue .player-sprite { filter: drop-shadow(0 0 50px rgba(37, 99, 235, 1)) drop-shadow(0 0 15px #fff) brightness(1.25); transform: scale(1.05); animation: super-pulse-blue 1.5s infinite alternate; }
.podium-container.super-glow-blue .nametag-neon { border-color: #3b82f6; box-shadow: 0 0 25px #2563eb; background: #2563eb; color: #fff; }

.podium-container.super-glow-red .player-sprite { filter: drop-shadow(0 0 50px rgba(220, 38, 38, 1)) drop-shadow(0 0 15px #fff) brightness(1.25); transform: scale(1.05); animation: super-pulse-red 1.5s infinite alternate; }
.podium-container.super-glow-red .nametag-neon { border-color: #ef4444; box-shadow: 0 0 25px #dc2626; background: #dc2626; color: #fff; }

/* CENTRO: Roleta */
.wheel-center-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 6;
    margin-bottom: 10px;
}
.wheel-box {
    position: relative;
    width: 290px;
    height: 290px;
    margin-bottom: 12px;
}
.wheel-pointer {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 22px solid var(--accent-gold);
    z-index: 10;
    filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.8));
}
#wheelCanvas {
    border-radius: 50%;
    box-shadow: 0 0 35px rgba(0, 0, 0, 0.9);
}

#graficoEstatisticas {
    border-radius: 0; /* Garante que o gráfico fique plano e quadrado */
    box-shadow: none;
    background: transparent;
}

.action-buttons-holder { display: flex; gap: 10px; }

.btn-spin {
    background: linear-gradient(135deg, var(--accent-gold), #d97706);
    color: #000;
    font-size: 1.1rem;
    font-weight: 900;
    border: none;
    padding: 12px 35px;
    border-radius: 25px;
    cursor: pointer;
    box-shadow: 0 4px 0 #92400e, 0 6px 15px rgba(0,0,0,0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.btn-spin:disabled { background: #475569; box-shadow: none; color: #94a3b8; cursor: not-allowed; }
.btn-sortear { background: linear-gradient(135deg, #06b6d4, #0891b2); color: #fff; box-shadow: 0 4px 0 #0e7490, 0 6px 15px rgba(6, 182, 212, 0.4); }

/* TELA DE PERGUNTAS */
.game-questions-panel {
    display: none;
    background: rgba(13, 23, 42, 0.95);
    width: 90vw;
    max-width: 520px;
    padding: 20px;
    border-radius: 16px;
    border: 2px solid #233554;
    box-shadow: 0 0 30px rgba(35, 53, 84, 0.4);
    backdrop-filter: blur(8px);
    text-align: center;
    z-index: 10;
    margin-bottom: 20px;
}

.media-container {
    display: none;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-height: 160px;
    margin: 10px auto;
    overflow: hidden;
    border-radius: 10px;
    border: 2px solid #1e293b;
    background: #070a12;
}
.media-container img, .media-container video {
    max-width: 100%;
    max-height: 160px;
    object-fit: contain;
    display: none;
}

.dica-letra-box {
    display: none;
    background: rgba(245, 158, 11, 0.15);
    border: 2px dashed var(--accent-gold);
    color: var(--accent-gold);
    padding: 8px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1.1rem;
    margin: 10px auto;
    width: 90%;
}

.input-aluno-box {
    margin: 15px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
}
.input-aluno-box input {
    width: 90%;
    padding: 12px;
    border-radius: 8px;
    border: 2px solid #233554;
    background: #090f1d;
    color: #fff;
    font-size: 1.05rem;
    text-align: center;
    outline: none;
    transition: border-color 0.2s;
}
.input-aluno-box input:focus {
    border-color: #06b6d4;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
}

.clue-row {
    background: rgba(7, 10, 18, 0.9);
    padding: 14px 15px;
    margin: 10px 0;
    border-radius: 8px;
    border-left: 5px solid #1e293b;
    font-size: 1.1rem;
    text-align: left;
    transition: all 0.3s ease;
}
.clue-row.hidden .clue-text { visibility: hidden; }
.clue-row.hidden .clue-tag { color: #1f2937; }
.clue-row.active { border-left-color: var(--accent-gold); background: rgba(17, 24, 39, 0.95); }
.clue-row.revealed { border-left-color: var(--accent-blue); opacity: 0.4; }
.clue-tag { font-weight: bold; margin-right: 8px; color: #3b82f6; }
.clue-row.active .clue-tag { color: var(--accent-gold); }

/* BRILHO DO DOBRO DE PONTOS */
.clue-row.dobro-glow {
    border-color: var(--accent-gold);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.5), inset 0 0 10px rgba(245, 158, 11, 0.2);
    animation: gold-pulse 2s infinite alternate;
}
@keyframes gold-pulse {
    0% { box-shadow: 0 0 10px rgba(245, 158, 11, 0.3), inset 0 0 5px rgba(245, 158, 11, 0.1); }
    100% { box-shadow: 0 0 25px rgba(245, 158, 11, 0.7), inset 0 0 15px rgba(245, 158, 11, 0.3); }
}

.round-indicator { font-size: 1.1rem; margin-bottom: 5px; font-weight: bold; color: #94a3b8; }
.points-indicator { font-size: 1rem; margin-bottom: 12px; }
.points-value { color: var(--accent-gold); font-weight: 900; font-size: 1.4rem; }

.btn-control { color: white; border: none; padding: 11px 18px; font-size: 0.9rem; font-weight: bold; border-radius: 6px; cursor: pointer; transition: all 0.2s ease; }
.btn-blue { background-color: var(--accent-blue); box-shadow: 0 3px 0 #1d4ed8; }
.btn-red { background-color: var(--accent-red); box-shadow: 0 3px 0 #b91c1c; }
.btn-gray { background-color: #475569; box-shadow: 0 3px 0 #334155; }
.btn-control:disabled { background-color: #1e293b !important; box-shadow: none !important; color: #475569 !important; cursor: not-allowed !important; opacity: 0.3; }

.final-answer-box {
    display: none;
    background: #1e3a8a;
    color: #93c5fd;
    font-size: 1.5rem;
    font-weight: 900;
    padding: 10px;
    margin-top: 12px;
    border-radius: 6px;
    border: 2px dashed #3b82f6;
}

.controls-group { margin-top: 18px; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }

/* MODAIS FLUTUANTES (Estatísticas e Avisos) */
.stats-modal-panel {
    display: none;
    background: rgba(10, 18, 36, 0.98);
    width: 90vw;
    max-width: 500px;
    padding: 25px;
    border-radius: 16px;
    border: 3px solid var(--accent-gold);
    box-shadow: 0 0 40px rgba(245, 158, 11, 0.3);
    backdrop-filter: blur(12px);
    text-align: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
}
.stats-modal-panel h2 {
    color: var(--accent-gold);
    margin-top: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.chart-wrapper {
    position: relative;
    width: 100%;
    height: 250px; /* Isso impede o Chart.js de esmagar as bordas */
    background: rgba(2, 6, 23, 0.5);
    border-radius: 8px;
    padding: 10px;
    box-sizing: border-box;
    overflow: hidden; 
}

.custom-alert-box {
    border-color: #06b6d4;
    box-shadow: 0 0 40px rgba(6, 182, 212, 0.3);
    max-width: 400px;
}

@keyframes super-pulse-blue { 0% { filter: drop-shadow(0 0 25px #2563eb) drop-shadow(0 0 5px #fff); } 100% { filter: drop-shadow(0 0 60px #3b82f6) drop-shadow(0 0 20px #fff); } }
@keyframes super-pulse-red { 0% { filter: drop-shadow(0 0 25px #dc2626) drop-shadow(0 0 5px #fff); } 100% { filter: drop-shadow(0 0 60px #ef4444) drop-shadow(0 0 20px #fff); } }
@keyframes pulse-blue { 0% { filter: drop-shadow(0 0 15px rgba(37, 99, 235, 0.5)); } 100% { filter: drop-shadow(0 0 30px rgba(37, 99, 235, 0.9)); } }
@keyframes pulse-red { 0% { filter: drop-shadow(0 0 15px rgba(220, 38, 38, 0.5)); } 100% { filter: drop-shadow(0 0 30px rgba(220, 38, 38, 0.9)); } }
/* ========================================= */
/* BOTÕES DE CANTO (Sair e Tela Cheia)       */
/* ========================================= */
.corner-btn {
    position: absolute;
    top: 20px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid #334155;
    color: #cbd5e1;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    font-size: 1rem;
    transition: all 0.2s ease;
    backdrop-filter: blur(5px);
}
.corner-btn:hover {
    background: var(--accent-blue);
    color: #fff;
    border-color: #60a5fa;
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
}
.corner-btn i {
    font-size: 1.2rem;
}
.top-left { left: 20px; }
.top-right { right: 20px; padding: 10px; } /* O de tela cheia fica quadrado */

/* ==========================================================================
   BLINDAGEM MOBILE E OVERLAYS
   ========================================================================== */

/* Overlays de Rotação e Inicialização */
.rotate-device-overlay {
    display: none;
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: radial-gradient(circle at center, #14161f 0%, #050608 100%);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

@media screen and (orientation: portrait) {
    .rotate-device-overlay {
        display: flex !important;
    }
    #studio-bg, #start-battle-overlay {
        display: none !important;
    }
}

.rotate-device-box {
    text-align: center;
    max-width: 310px;
    width: 88vw;
    border: 2px solid var(--accent-gold);
    background: rgba(15, 23, 42, 0.96);
    border-radius: 14px;
    padding: 22px 18px;
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.25);
    margin: auto;
}

.rotate-device-icon {
    font-size: 2.8rem;
    margin-bottom: 10px;
    animation: rotatePhoneAnim 2s ease-in-out infinite;
    display: inline-block;
}

@keyframes rotatePhoneAnim {
    0%, 20% { transform: rotate(0deg); }
    50%, 70% { transform: rotate(90deg); }
    90%, 100% { transform: rotate(0deg); }
}

.rotate-device-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--accent-gold);
    letter-spacing: 1.5px;
    margin-bottom: 8px;
}

.rotate-device-desc {
    font-size: 0.82rem;
    color: #cbd5e1;
    line-height: 1.35;
}

/* Portão de Entrada em Tela Cheia */
.start-battle-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: rgba(5, 6, 8, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    box-sizing: border-box;
}

.start-battle-card {
    background: #0f172a;
    border: 1.5px solid var(--accent-gold);
    box-shadow: 0 0 35px rgba(245, 158, 11, 0.3);
    border-radius: 12px;
    padding: 14px 22px;
    text-align: center;
    max-width: 420px;
    width: 90vw;
    max-height: 90dvh;
    margin: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.start-icon { font-size: 1.8rem; margin-bottom: 2px; }
.start-title { font-size: 1.05rem; font-weight: 900; color: var(--accent-gold); letter-spacing: 1.2px; margin-bottom: 4px; }
.start-desc { font-size: 0.78rem; color: #cbd5e1; margin-bottom: 12px; line-height: 1.3; }
.start-fullscreen-btn {
    background: linear-gradient(135deg, var(--accent-gold), #d97706);
    color: #000;
    font-size: 0.85rem;
    font-weight: 900;
    border: none;
    border-radius: 6px;
    padding: 9px 20px;
    cursor: pointer;
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.35);
    width: 100%;
}

/* ==========================================================================
   REESTRUTURAÇÃO MOBILE LANDSCAPE (ALTURA <= 600px)
   ========================================================================== */
@media screen and (orientation: landscape) and (max-height: 600px) {

    /* 1. FUNDO E CONTENÇÃO GERAL */
    .studio-background {
        padding: 4px 0 !important;
        justify-content: space-evenly !important;
        overflow: hidden !important;
    }

    .corner-btn {
        top: 6px !important;
        padding: 4px 8px !important;
        font-size: 0.72rem !important;
    }
    .top-left { left: 8px !important; }
    .top-right { right: 8px !important; padding: 4px 6px !important; }

    /* 2. CABEÇALHO COMPACTO */
    .game-header-css {
        width: auto !important;
        max-width: 70vw !important;
        padding: 2px 16px !important;
        margin-bottom: 2px !important;
    }
    .game-header-css h1 {
        font-size: 0.95rem !important;
        letter-spacing: 2px !important;
    }

    /* 3. PAINEL CENTRAL (PLACAR E VEZ) */
    .center-dashboard {
        margin-top: 0 !important;
    }

    .scoreboard-capsule {
        padding: 2px 18px !important;
        gap: 18px !important;
        margin-bottom: 3px !important;
        border-radius: 12px !important;
    }
    .score-box span {
        font-size: 0.55rem !important;
    }
    .score-val {
        font-size: 1.15rem !important;
    }
    #cronometro {
        font-size: 1.15rem !important;
    }
    #timer-box {
        padding: 0 14px !important;
    }

    .turn-banner {
        font-size: 0.76rem !important;
        padding: 2px 16px !important;
        min-width: 250px !important;
    }
    .turn-banner.victory-display {
        font-size: 1.1rem !important;
        padding: 6px 25px !important;
    }

    /* 4. CIENTISTAS E BANCADAS LATERAIS REDIMENSIONADAS */
    .podium-container {
        top: 52% !important;
        padding: 0 !important;
    }
    .podium-left { left: 6px !important; }
    .podium-right { right: 6px !important; }

    .player-sprite {
        width: 140px !important;
        height: 140px !important;
    }

    .nametag-neon {
        font-size: 0.62rem !important;
        padding: 2px 8px !important;
        margin-top: 2px !important;
        letter-spacing: 0.8px !important;
    }

    .team-powerups {
        margin-top: 4px !important;
        padding: 4px !important;
        gap: 3px !important;
        border-radius: 6px !important;
    }
    .btn-powerup {
        padding: 3px 2px !important;
        font-size: 0.55rem !important;
        border-radius: 4px !important;
    }

    /* 5. ROLETA CENTRAL E BOTÕES DE AÇÃO TOTALMENTE VISÍVEIS */
    .wheel-center-zone {
        margin-bottom: 0 !important;
    }

    .wheel-box {
        width: 160px !important;
        height: 160px !important;
        margin-bottom: 6px !important;
    }

    #wheelCanvas {
        width: 100% !important;
        height: 100% !important;
    }

    .wheel-pointer {
        top: -8px !important;
        border-left-width: 8px !important;
        border-right-width: 8px !important;
        border-top-width: 14px !important;
    }

    .action-buttons-holder {
        gap: 6px !important;
    }

    .btn-spin {
        padding: 6px 18px !important;
        font-size: 0.78rem !important;
        border-radius: 16px !important;
        letter-spacing: 0.5px !important;
    }

    /* 6. TELA DE PERGUNTAS / PISTAS NO MOBILE */
    .game-questions-panel {
        width: 94vw !important;
        max-width: 500px !important;
        max-height: 94dvh !important;
        overflow-y: auto !important;
        padding: 8px 14px !important;
        margin-bottom: 0 !important;
        border-radius: 10px !important;
    }

    .round-indicator {
        font-size: 0.82rem !important;
        margin-bottom: 2px !important;
    }
    .points-indicator {
        font-size: 0.75rem !important;
        margin-bottom: 6px !important;
    }
    .points-value {
        font-size: 1rem !important;
    }

    .media-container {
        max-height: 75px !important;
        margin: 4px auto !important;
    }
    .media-container img, .media-container video {
        max-height: 75px !important;
    }

    .clue-row {
        padding: 5px 8px !important;
        margin: 4px 0 !important;
        font-size: 0.82rem !important;
    }
    .clue-tag {
        margin-right: 4px !important;
    }

    .final-answer-box {
        font-size: 1.05rem !important;
        padding: 5px !important;
        margin-top: 6px !important;
    }

    .dica-letra-box {
        font-size: 0.82rem !important;
        padding: 4px !important;
        margin: 4px auto !important;
    }

    .input-aluno-box {
        margin: 6px 0 !important;
        gap: 4px !important;
    }
    .input-aluno-box input {
        padding: 6px !important;
        font-size: 0.82rem !important;
    }

    .controls-group {
        margin-top: 6px !important;
        gap: 5px !important;
    }
    .btn-control {
        padding: 5px 10px !important;
        font-size: 0.74rem !important;
    }

    /* 7. MODAL DE ESTATÍSTICAS E CONFIRMAÇÃO */
    .stats-modal-panel {
        padding: 12px 18px !important;
        max-width: 440px !important;
        max-height: 92dvh !important;
        overflow-y: auto !important;
    }
    .stats-modal-panel h2 {
        font-size: 1.1rem !important;
        margin-bottom: 6px !important;
    }
    .chart-wrapper {
        height: 180px !important;
        padding: 4px !important;
    }
}

/* ==========================================================================
   MODAL DE PALPITE E AJUSTES DE FLUXO
   ========================================================================== */
.modal-palpite-box {
    border-color: #06b6d4 !important;
    box-shadow: 0 0 35px rgba(6, 182, 212, 0.4) !important;
    max-width: 440px !important;
    width: 90vw !important;
    padding: 18px 24px !important;
}

.palpite-input-wrapper {
    width: 100%;
}

.palpite-input-wrapper input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 8px;
    border: 2px solid #233554;
    background: #090f1d;
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
    text-align: center;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.palpite-input-wrapper input:focus {
    border-color: #06b6d4;
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.4);
}

/* BLINDAGEM MOBILE LANDSCAPE: FIXA O MODAL NO TOPO QUANDO O TECLADO SUBIR */
@media screen and (orientation: landscape) and (max-height: 600px) {
    .modal-palpite-box {
        top: 8px !important;
        transform: translateX(-50%) !important; /* Desloca apenas horizontalmente, mantendo fixado no topo */
        max-width: 480px !important;
        width: 94vw !important;
        padding: 10px 16px !important;
    }

    .modal-palpite-box h2 {
        font-size: 0.95rem !important;
        margin-bottom: 2px !important;
    }

    #palpite-subtitulo {
        font-size: 0.72rem !important;
        margin-bottom: 6px !important;
    }

    .palpite-input-wrapper input {
        padding: 7px 10px !important;
        font-size: 0.92rem !important;
    }

    .modal-palpite-box .btn-control {
        padding: 6px 12px !important;
        font-size: 0.76rem !important;
    }
}

/* =========================================================
   LOBBY PRÉ-JOGO E IDENTIFICAÇÃO RESPONSIVA (#player-setup-overlay)
   ========================================================= */
.player-setup-overlay {
    position: fixed;
    inset: 0;
    z-index: 100001;
    background: radial-gradient(circle at 50% 25%, rgba(15, 23, 42, 0.94) 0%, rgba(2, 6, 23, 0.98) 100%);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    overflow-y: auto;
    overflow-x: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.player-setup-modal {
    width: 100%;
    max-width: 960px;
    max-height: 94vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    background: rgba(15, 23, 42, 0.94);
    border: 2px solid rgba(0, 229, 255, 0.35);
    border-radius: 22px;
    padding: 22px 26px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85), 0 0 35px rgba(0, 229, 255, 0.14);
    color: #f8fafc;
}

.setup-header {
    text-align: center;
    margin-bottom: 18px;
}

.setup-mode-badge {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.setup-mode-badge.mode-turma {
    background: rgba(46, 213, 115, 0.14);
    color: #2ed573;
    border: 1px solid rgba(46, 213, 115, 0.4);
}

.setup-mode-badge.mode-1v1 {
    background: rgba(0, 229, 255, 0.14);
    color: #00e5ff;
    border: 1px solid rgba(0, 229, 255, 0.4);
}

.setup-main-title {
    font-size: clamp(1.15rem, 2.2vw, 1.6rem);
    font-weight: 900;
    letter-spacing: 1.5px;
    color: #ffffff;
    margin-bottom: 4px;
    text-shadow: 0 0 15px rgba(0, 229, 255, 0.35);
}

.setup-subtitle {
    font-size: 0.86rem;
    color: #94a3b8;
    max-width: 680px;
    margin: 0 auto;
    line-height: 1.4;
}

.setup-dupla-wrap,
.setup-1v1-wrap {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    min-width: 0;
}

.setup-teams-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
    width: 100%;
}

.setup-team-card {
    background: rgba(30, 41, 59, 0.65);
    border: 1.5px solid rgba(148, 163, 184, 0.22);
    border-radius: 16px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    overflow: hidden;
    box-sizing: border-box;
}

.setup-team-card.team-card-left {
    border-top: 3px solid #00e5ff;
}

.setup-team-card.team-card-right {
    border-top: 3px solid #ff4757;
}

.setup-1v1-card {
    max-width: 560px;
    width: 100%;
    margin: 0 auto;
    border-top: 3px solid #00e5ff;
}

.setup-team-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.setup-team-badge {
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 1px;
    padding: 4px 10px;
    border-radius: 8px;
    background: rgba(0, 229, 255, 0.14);
    color: #00e5ff;
    border: 1px solid rgba(0, 229, 255, 0.35);
}

.setup-team-badge.badge-right {
    background: rgba(255, 71, 87, 0.14);
    color: #ff4757;
    border-color: rgba(255, 71, 87, 0.35);
}

.setup-field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    width: 100%;
}

.setup-field-group label {
    font-size: 0.78rem;
    font-weight: 800;
    color: #cbd5e1;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.setup-text-input {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 14px;
    background: rgba(2, 6, 23, 0.85);
    border: 1.5px solid #334155;
    border-radius: 10px;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.setup-text-input:focus {
    border-color: #00e5ff;
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.3);
}

/* CARROSSEL HORIZONTAL ROLÁVEL DE MINIATURAS (miniatura/) */
.lobby-avatar-carousel {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 10px;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 6px 4px 12px 4px;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 229, 255, 0.45) rgba(2, 6, 23, 0.6);
}

.lobby-avatar-carousel::-webkit-scrollbar {
    height: 7px;
}

.lobby-avatar-carousel::-webkit-scrollbar-track {
    background: rgba(2, 6, 23, 0.6);
    border-radius: 8px;
}

.lobby-avatar-carousel::-webkit-scrollbar-thumb {
    background: rgba(0, 229, 255, 0.45);
    border-radius: 8px;
}

.lobby-avatar-carousel::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 229, 255, 0.75);
}

.lobby-avatar-card {
    flex: 0 0 106px;
    width: 106px;
    background: rgba(15, 23, 42, 0.9);
    border: 1.5px solid rgba(148, 163, 184, 0.22);
    border-radius: 12px;
    padding: 7px 6px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: all 0.18s ease;
    color: #cbd5e1;
    box-sizing: border-box;
}

.lobby-avatar-card:hover {
    border-color: rgba(0, 229, 255, 0.6);
    transform: translateY(-2px);
}

.lobby-avatar-card.selected {
    background: rgba(0, 229, 255, 0.16);
    border-color: #00e5ff;
    box-shadow: 0 0 14px rgba(0, 229, 255, 0.38);
    color: #ffffff;
}

.team-card-right .lobby-avatar-card.selected {
    background: rgba(255, 71, 87, 0.16);
    border-color: #ff4757;
    box-shadow: 0 0 14px rgba(255, 71, 87, 0.38);
}

.lobby-avatar-img-wrap {
    width: 100%;
    height: 76px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(2, 6, 23, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lobby-avatar-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.lobby-avatar-name {
    font-size: 0.72rem;
    font-weight: 800;
    text-align: center;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.setup-footer-actions {
    display: flex;
    justify-content: center;
}

.btn-setup-primary {
    width: 100%;
    max-width: 440px;
    padding: 14px 28px;
    border-radius: 14px;
    border: none;
    background: linear-gradient(135deg, #2ed573 0%, #10b981 100%);
    color: #020617;
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 10px 26px rgba(46, 213, 115, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-setup-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(46, 213, 115, 0.5);
}

.btn-setup-primary.btn-setup-1v1 {
    background: linear-gradient(135deg, #00e5ff 0%, #0284c7 100%);
    color: #ffffff;
    box-shadow: 0 10px 26px rgba(0, 229, 255, 0.35);
}

/* CARD DE ESPERA 1v1 */
.setup-waiting-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 28px 20px;
    background: rgba(2, 6, 23, 0.65);
    border: 1.5px dashed rgba(0, 229, 255, 0.45);
    border-radius: 18px;
    gap: 10px;
}

.waiting-pulse-ring {
    font-size: 2.6rem;
    animation: pulseRadar 1.6s infinite ease-in-out;
}

@keyframes pulseRadar {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.14); opacity: 0.75; }
}

.waiting-pin-pill {
    background: rgba(0, 229, 255, 0.14);
    border: 1px solid rgba(0, 229, 255, 0.4);
    color: #00e5ff;
    font-weight: 900;
    font-size: 0.9rem;
    padding: 4px 14px;
    border-radius: 999px;
    letter-spacing: 2px;
}

.waiting-title {
    font-size: 1.25rem;
    font-weight: 900;
    color: #ffffff;
}

.waiting-desc {
    font-size: 0.88rem;
    color: #94a3b8;
    max-width: 460px;
    line-height: 1.45;
}

/* AVISO VISUAL DE TRAVA DE TURNO EM 1v1 ("VEZ DE: [NOME DO ADVERSÁRIO]") */
.turn-lock-banner {
    margin-top: 8px;
    padding: 6px 18px;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.18);
    border: 1.5px solid #f59e0b;
    color: #fde68a;
    font-size: 0.82rem;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: 0 0 18px rgba(245, 158, 11, 0.35);
    pointer-events: auto;
}

/* RESPONSIVIDADE DO LOBBY (MOBILE PORTRAIT E LANDSCAPE) */
@media screen and (max-width: 820px) {
    .setup-teams-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .player-setup-modal {
        padding: 16px;
    }
}

@media screen and (orientation: landscape) and (max-height: 600px) {
    .player-setup-overlay {
        padding: 8px;
    }

    .player-setup-modal {
        padding: 12px 16px;
        max-height: 96vh;
    }

    .setup-header {
        margin-bottom: 8px;
    }

    .setup-main-title {
        font-size: 1.05rem;
    }

    .setup-subtitle {
        font-size: 0.72rem;
    }

    .setup-teams-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 10px;
    }

    .setup-team-card {
        padding: 10px 12px;
        gap: 6px;
    }

    .lobby-avatar-card {
        flex: 0 0 88px;
        width: 88px;
        padding: 5px;
    }

    .lobby-avatar-img-wrap {
        height: 54px;
    }

    .btn-setup-primary {
        padding: 9px 18px;
        font-size: 0.85rem;
    }
}

/* MODAL BONITO DE AVISO DE NOME OBRIGATÓRIO NO LOBBY */
.lobby-alert-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 25000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    animation: fadeInLobbyAlert 0.2s ease-out;
}

@keyframes fadeInLobbyAlert {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.lobby-alert-box {
    background: linear-gradient(145deg, #0f172a 0%, #090d16 100%);
    border: 2px solid #f59e0b;
    border-radius: 18px;
    padding: 26px 28px;
    max-width: 420px;
    width: 92%;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), 0 0 35px rgba(245, 158, 11, 0.25);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.lobby-alert-icon {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: rgba(245, 158, 11, 0.14);
    border: 1.5px solid rgba(245, 158, 11, 0.45);
    color: #fbbf24;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
    margin-bottom: 4px;
}

.lobby-alert-title {
    font-size: 1.15rem;
    font-weight: 900;
    color: #fef08a;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin: 0;
}

.lobby-alert-desc {
    font-size: 0.92rem;
    color: #cbd5e1;
    line-height: 1.5;
    margin: 4px 0 12px 0;
}

.lobby-alert-btn {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #050811;
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    font-size: 0.9rem;
    font-weight: 900;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    cursor: pointer;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.lobby-alert-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(245, 158, 11, 0.5);
}




/* ==========================================================================
   VITRINE PEDAGÓGICA - AVATARES BLOQUEADOS NO LOBBY DOS ALUNOS
   ========================================================================== */
.lobby-avatar-card.locked-avatar {
    opacity: 0.32 !important;
    filter: grayscale(70%) brightness(0.65) !important;
    cursor: pointer !important;
    position: relative;
}

.lobby-avatar-card.locked-avatar:hover {
    opacity: 0.55 !important;
    transform: scale(1.04) !important;
}

.lobby-avatar-img-wrap {
    position: relative;
}

/* Insígnia de Cadeado ou Coroa */
.avatar-lock-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 20px;
    height: 20px;
    background: #0f172a;
    border: 1px solid #ffc107;
    color: #ffc107;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    pointer-events: none;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
}

/* Toast discreto de notificação para o aluno */
.toast-aluno-bloqueado {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-30px);
    background: rgba(15, 23, 42, 0.96);
    border: 1px solid #ffc107;
    color: #f8fafc;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 100005;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.7);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast-aluno-bloqueado.visivel {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
