:root {
    /* Tema base global (pode ser alterado dinamicamente via JS). */
    --primary: #00d4ff;
    --neon-border: #00e5ff;
    --neon-gold: #ffd700;
    --font-ui: 'Oxanium', 'Orbitron', sans-serif;
    --font-title: 'Audiowide', 'Orbitron', sans-serif;
    --bg: #050a10;
    --panel: rgba(10, 20, 30, 0.95);
    --text: #f0f0f0;
    --bg-img: none;
    --hud-width: 300px;
    --hud-right: 20px;
    --hud-gap: 12px;
    --score-panel-height: 220px;
    --ranking-btn-height: 54px;
    --music-player-height: 92px;
    /* Imagem dinâmica */
}

body {
    /* Fundo com sobreposição escura para manter contraste do conteúdo. */
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-ui);
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    transition: all 1s ease;
    overflow-x: hidden;
    overflow-y: hidden;
    padding: 20px calc(var(--hud-width) + var(--hud-right) + 20px) 20px 20px;
    box-sizing: border-box;
    background-image: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), var(--bg-img);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

h1,
h2,
h3,
h4,
h5,
h6,
.top15-title,
.score-label,
#portal-msg,
#main-title,
#modal-title,
#fb-modal-title,
#ranking-modal-title {
    font-family: var(--font-title) !important;
    letter-spacing: 0.4px;
}

button,
input,
select,
textarea,
label,
.opt-btn,
.multi-opt,
.drag-card,
.combo-box,
.score-player,
.top15-name,
.top15-score,
.top15-time {
    font-family: var(--font-ui);
}

/* Container principal da aplicação. */
#game-container {
    width: min(1100px, 100%);
    box-sizing: border-box;
    background: rgba(10, 20, 30, 0.30);
    padding: 30px;
    border-radius: 20px;
    border: 2px solid var(--neon-border);
    box-shadow: 0 0 14px rgba(0, 229, 255, 0.55), inset 0 0 18px rgba(0, 120, 170, 0.28);
    backdrop-filter: blur(10px);
    text-align: center;
    position: relative;
    z-index: 10;
    max-height: calc(100vh - 40px);
    overflow: hidden;
}

.hidden {
    /* Classe utilitária para ocultar blocos de interface. */
    display: none !important;
}

#quiz-screen {
    position: relative;
}

.question-counter {
    position: absolute;
    right: 10px;
    bottom: 8px;
    font-size: 0.82rem;
    color: var(--primary);
    letter-spacing: 0.9px;
    font-family: var(--font-title);
    opacity: 0.95;
    pointer-events: none;
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.45);
}

.streak-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 88;
    pointer-events: none;
    border-radius: inherit;
}

.streak-overlay.show {
    animation: streakOverlayIn 260ms ease forwards;
}

.streak-overlay.hide {
    animation: streakOverlayOut 260ms ease forwards;
}

@keyframes streakOverlayIn {
    from { background: rgba(0, 0, 0, 0); }
    to   { background: rgba(0, 0, 0, 0.88); }
}

@keyframes streakOverlayOut {
    from { background: rgba(0, 0, 0, 0.88); }
    to   { background: rgba(0, 0, 0, 0); }
}

.streak-popup {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.86);
    z-index: 90;
    min-width: 320px;
    text-align: center;
    pointer-events: none;
    padding: 18px 24px;
    border-radius: 18px;
    border: 2px solid rgba(255, 213, 120, 0.95);
    background: radial-gradient(circle at 50% 20%, rgba(255, 201, 92, 0.2), rgba(28, 12, 0, 0.94) 55%);
    box-shadow: 0 0 28px rgba(255, 166, 0, 0.52), inset 0 0 18px rgba(255, 225, 160, 0.24);
    opacity: 0;
}

.streak-popup.show {
    animation: streakPopIn 260ms cubic-bezier(0.2, 0.9, 0.2, 1) forwards, streakPulse 900ms ease-in-out 280ms;
}

.streak-popup.hide {
    animation: streakPopOut 260ms ease-in forwards;
}

.streak-popup-title {
    font-family: var(--font-title);
    font-size: 0.95rem;
    letter-spacing: 2px;
    color: #ffd98a;
    opacity: 0.92;
}

.streak-popup-value {
    font-family: var(--font-title);
    font-size: 3.1rem;
    line-height: 1;
    color: #fff3ce;
    text-shadow: 0 0 12px rgba(255, 210, 100, 0.72);
    margin: 3px 0;
}

.streak-popup-multiplier {
    display: inline-block;
    margin-top: 4px;
    font-family: var(--font-title);
    font-size: 1.25rem;
    color: #111;
    background: linear-gradient(90deg, #ffd05f, #ff9f2f);
    border-radius: 999px;
    padding: 3px 14px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    box-shadow: 0 0 14px rgba(255, 175, 68, 0.6);
}

.streak-popup-desc {
    margin-top: 10px;
    font-size: 0.72rem;
    letter-spacing: 0.5px;
    color: rgba(255, 220, 150, 0.7);
    font-style: italic;
}

@keyframes streakPopIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.7);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes streakPopOut {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -56%) scale(0.86);
    }
}

@keyframes streakPulse {
    0%,
    100% {
        box-shadow: 0 0 28px rgba(255, 166, 0, 0.52), inset 0 0 18px rgba(255, 225, 160, 0.24);
    }
    50% {
        box-shadow: 0 0 36px rgba(255, 188, 84, 0.74), inset 0 0 24px rgba(255, 235, 180, 0.34);
    }
}

/* Estrutura visual da roleta. */
.wheel-container {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 10px auto;
    border: 10px solid var(--neon-border);
    border-radius: 50%;
    box-shadow: 0 0 26px rgba(0, 229, 255, 0.65);
    overflow: visible;
}

.wheel-marker {
    /* Marcador fixo que indica o resultado da roleta. */
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 35px solid #ff0000;
    z-index: 60;
}

#wheel {
    /* Disco da roleta que recebe transform: rotate(...) via JS. */
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    transition: transform 0.8s cubic-bezier(0.2, 0, 0, 1);
    border: 2px solid #000;
}

.wheel-seg {
    /* Segmento individual criado dinamicamente para cada tema. */
    position: absolute;
    width: 50%;
    height: 50%;
    transform-origin: 100% 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: 'Orbitron';
    font-weight: bold;
    font-size: 0.7rem;
}

.stext {
    /* Rótulo textual posicionado dentro de cada segmento. */
    position: absolute;
    transform: rotate(45deg);
    width: 100px;
    text-align: center;
    left: 35px;
    top: 60px;
    text-shadow: 2px 2px 4px #000;
}

/* Grid do mini-jogo Sokoban. */
#sokoban-grid {
    display: grid;
    grid-template-columns: repeat(11, 35px);
    grid-template-rows: repeat(11, 35px);
    gap: 2px;
    margin: 15px auto;
    width: 407px;
    background: #222;
    border: 4px solid var(--primary);
}

#sokoban-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: fixed;
    inset: 0;
    z-index: 3550;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(1px);
}

#slot-machine-modal,
#pacman-bonus-modal,
#enduro-bonus-modal,
#mario-bonus-modal,
#space-bonus-modal,
#trex-bonus-modal,
#snake-bonus-modal,
#memory-bonus-modal,
#lordehero-bonus-modal,
#frogger-bonus-modal,
#tetris-bonus-modal,
#game2048-bonus-modal,
#flappybird-bonus-modal,
#arkanoid-bonus-modal,
#asteroids-bonus-modal,
#minesweeper-bonus-modal {
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(1px);
}

.sokoban-bonus-container,
.slot-machine-container,
.pacman-bonus-container,
.enduro-bonus-container,
.trex-bonus-container {
    width: min(920px, 95vw);
    max-height: 95vh;
    overflow-y: auto;
    border-radius: 22px;
    padding: 18px 20px 16px;
    text-align: center;
    background: linear-gradient(155deg, #070b1e, #101b3a);
    border: 2px solid #00d4ff;
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.35), inset 0 0 28px rgba(0, 70, 130, 0.26);
}

.sokoban-bonus-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sokoban-hud {
    margin: 4px 0 10px;
    padding: 6px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 215, 120, 0.6);
    background: rgba(22, 10, 6, 0.55);
    color: #ffef9f;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    letter-spacing: 0.6px;
}

#sokoban-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 15px;
    gap: 10px;
}

.tile {
    /* Célula base do tabuleiro. */
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    font-family: 'Orbitron';
}

.t-wall {
    /* Parede: célula bloqueada. */
    background: #333;
}

.t-target {
    /* Alvo: posição final das caixas. */
    background: rgba(0, 212, 255, 0.2);
    border: 1px inset var(--primary);
}

.t-box {
    /* Caixa móvel do Sokoban. */
    background: var(--primary);
    color: #000;
    border-radius: 5px;
    font-family: 'Orbitron';
    z-index: 5;
    font-size: 14px;
}

.t-box-ok {
    /* Caixa corretamente posicionada em um alvo. */
    background: #2ecc71 !important;
    color: white;
}

/* Área da questão de arrastar e soltar. */
.drag-area {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 15px 0;
}

.drag-pool {
    /* Reservatório dos itens arrastáveis em duas colunas. */
    display: grid;
    grid-template-columns: 1fr 1fr;
    justify-content: center;
    gap: 10px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.drop-zones {
    /* Grade com zonas de destino das definições. */
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    text-align: left;
}

.drop-box {
    /* Bloco contendo rótulo e zona de drop. */
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed var(--primary);
    padding: 10px;
    border-radius: 8px;
    font-size: 0.9rem;
}

.target-zone {
    /* Área que recebe um item arrastado. */
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    min-height: 45px;
    margin-top: 5px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.target-zone.over {
    /* Estado visual durante hover de drag. */
    border-color: #fff;
    background: rgba(0, 212, 255, 0.2);
}

.target-zone.filled {
    /* Estado visual quando zona está preenchida corretamente. */
    background: #2ecc71;
    border-style: solid;
}

.drag-card {
    /* Cartão arrastável individual. */
    background: var(--primary);
    color: #000;
    padding: 6px 10px;
    border-radius: 5px;
    cursor: grab;
    font-weight: bold;
    font-family: 'Orbitron';
    font-size: 0.8rem;
    width: auto;
    box-sizing: border-box;
    text-align: center;
    flex: none;
}

.correct-answer-box {
    margin-top: 8px;
    color: #d9d9d9;
}

.feedback-title {
    display: block;
    font-size: 1.05rem;
    margin-bottom: 10px;
}

.feedback-tip-frame {
    margin-top: 10px;
    padding: 13px 15px;
    border-radius: 12px;
    border: 1px solid rgba(239, 182, 58, 0.62);
    background:
        linear-gradient(96deg, rgba(229, 158, 35, 0.13), rgba(8, 31, 37, 0.22) 48%, rgba(3, 18, 24, 0.32) 100%),
        rgba(5, 9, 13, 0.94);
    box-shadow:
        inset 0 0 0 1px rgba(255, 220, 140, 0.16),
        0 0 18px rgba(212, 162, 56, 0.16);
    text-align: center;
}

.feedback-tip-label {
    display: block;
    margin-bottom: 6px;
    color: #f1c261;
    font-size: 0.82rem;
    letter-spacing: 0.65px;
    text-transform: uppercase;
    font-family: var(--font-title);
#val-btn {
    margin-top: 50px !important;
}
    text-shadow: 0 0 8px rgba(227, 173, 66, 0.26);
}

.feedback-tip-text {
    color: #f0e5cf;
    font-size: 1rem;
    line-height: 1.5;
    font-weight: 600;
    text-align: center;
}

.feedback-inline-status {
    display: block;
    margin-bottom: 8px;
    color: #ff8f8f;
    font-weight: 700;
}

.feedback-inline-status-success {
    color: #2ecc71;
}

.feedback-inline-status-partial {
    color: #ffd166;
}

.correct-answer-box {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(0, 212, 255, 0.35);
    background: rgba(10, 26, 34, 0.75);
    text-align: center;
}

.feedback-answer-inside {
    margin-top: 12px;
}

.drag-correct-grid {
    margin-top: 6px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 10px;
}

.drag-correct-item {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 6px;
    align-items: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 5px 8px;
    font-size: 0.82rem;
}

/* Botões de ação reutilizados em toda a aplicação. */
.opt-btn {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid var(--neon-border);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.25);
    color: white;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    width: 100%;
    margin-top: 8px;
    font-size: 1rem;
}

.opt-btn:hover {
    /* Destaque visual no hover. */
    background: var(--primary);
    color: #000;
    font-weight: bold;
}

.opt-btn:disabled {
    cursor: not-allowed;
}

/* Botões da roleta — mesmo estilo do botão "Entrar com Google". */
#spin-btn,
#stop-btn {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 16px 28px;
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    font-weight: 800;
    color: #ffffff !important;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    cursor: pointer;
    transition: all 200ms ease;
    letter-spacing: 0.5px;
    margin-top: 12px;
}

#spin-btn {
    background: linear-gradient(135deg, #8342f4, #357ae8) !important;
    box-shadow: 0 4px 20px rgba(66, 133, 244, 0.5);
}

#stop-btn {
    background: linear-gradient(135deg, #e53935, #b71c1c) !important;
    box-shadow: 0 4px 20px rgba(229, 57, 53, 0.5);
}

#spin-btn:hover,
#stop-btn:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.6);
    color: #ffffff !important;
    font-weight: 800;
}

#spin-btn:hover {
    background: linear-gradient(135deg, #357ae8, #2d5fc7) !important;
    box-shadow: 0 6px 30px rgba(66, 133, 244, 0.7);
}

#stop-btn:hover {
    background: linear-gradient(135deg, #ef5350, #c62828) !important;
    box-shadow: 0 6px 30px rgba(229, 57, 53, 0.7);
}

#spin-btn:active,
#stop-btn:active {
    transform: translateY(0);
}

#spin-btn:active {
    box-shadow: 0 2px 10px rgba(66, 133, 244, 0.5);
}

#stop-btn:active {
    box-shadow: 0 2px 10px rgba(229, 57, 53, 0.5);
}

#spin-btn.hidden,
#stop-btn.hidden {
    display: none !important;
}

.locked-option {
    opacity: 0.45 !important;
    filter: grayscale(1);
    pointer-events: none !important;
    cursor: not-allowed !important;
}

.locked-option.is-correct {
    opacity: 1 !important;
    filter: none;
    border: 2px solid #2ecc71 !important;
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.65);
}

/* Drag: respostas erradas ficam cinza e corretas ficam verdes (borda + fundo). */
#drag-drop-container .target-zone.locked-option {
    background: rgba(120, 130, 140, 0.28) !important;
}

#drag-drop-container .target-zone.locked-option.is-correct {
    background: rgba(46, 204, 113, 0.42) !important;
    border-color: #2ecc71 !important;
}

#drag-drop-container .drag-card.locked-option.is-correct {
    background: #2ecc71 !important;
    color: #062014 !important;
    border: 2px solid #a7f4c9 !important;
}

.locked-field {
    opacity: 0.55;
    filter: grayscale(1);
    pointer-events: none;
}

.locked-field.is-correct {
    opacity: 1;
    filter: none;
    border-color: #2ecc71;
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.65);
}

#p-name-input {
    /* Campo principal para identificação do jogador. */
    padding: 15px;
    width: 80%;
    font-size: 2rem;
    text-align: center;
    border-radius: 10px;
    background: #000;
    color: #fff;
    border: 2px solid var(--neon-border);
    font-family: var(--font-title);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.45);
}

#start-screen {
    --start-entry-width: min(86%, 940px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    height: 100%;
}

#start-screen > p {
    margin: 0;
}

#start-screen .start-motivation-card {
    width: var(--start-entry-width);
    max-width: 100%;
    margin: 0 auto;
    padding: 30px;
    box-sizing: border-box;
    border-radius: 10px;
    border: 2px solid #ffd700;
    background: linear-gradient(135deg, rgba(36, 24, 0, 0.3), rgba(12, 8, 0, 0.1));
    box-shadow: 0 0 18px rgba(255, 215, 0, 0.48), inset 0 0 14px rgba(255, 215, 0, 0.18);
    text-align: left;
}

#start-screen .start-motivation-text {
    margin: 0;
    font-size: clamp(0.98rem, 1.25vw, 1.12rem);
    line-height: 1.5;
    color: #fff2c2;
    text-shadow: 0 0 9px rgba(255, 215, 0, 0.32);
    text-align: center;
}

#start-screen .start-knowledge {
    margin-top: 10px;
}

#start-screen .start-knowledge-title {
    margin: 0 0 8px;
    font-size: clamp(0.95rem, 1.1vw, 1.05rem);
    color: #8feeff;
    font-weight: 700;
    letter-spacing: 0.3px;
}

#start-screen .start-knowledge-list {
    margin: 0;
    padding-left: 20px;
    display: grid;
    gap: 6px;
}

#start-screen .start-knowledge-list li {
    color: #f2f8ff;
    font-size: clamp(0.98rem, 1.35vw, 1rem);
    line-height: 1.4;
}

#start-screen .start-knowledge-list li strong {
    color: #ffd98a;
}

@media (max-width: 900px) {
    #start-screen {
        --start-entry-width: min(90vw, 940px);
    }

    #start-screen .start-motivation-card,
    #start-screen .start-action-group {
        width: var(--start-entry-width);
    }

    #start-screen #p-name-input {
        width: 100%;
    }

    #start-screen .start-motivation-card {
        padding: 24px 20px;
    }

    #start-screen .start-motivation-text {
        font-size: 0.94rem;
    }

    #start-screen .start-knowledge-title {
        font-size: 0.92rem;
    }

    #start-screen .start-knowledge-list li {
        font-size: 0.9rem;
    }
}

@media (max-width: 640px) {
    #start-screen {
        --start-entry-width: min(92vw, 940px);
    }

    #start-screen .start-motivation-card,
    #start-screen .start-action-group {
        width: var(--start-entry-width);
    }

    #start-screen #p-name-input {
        width: 100%;
    }

    #start-screen .start-motivation-card {
        padding: 18px 14px;
    }

    #start-screen .start-motivation-text {
        font-size: 0.88rem;
        line-height: 1.45;
    }

    #start-screen .start-knowledge-title {
        font-size: 0.86rem;
    }

    #start-screen .start-knowledge-list {
        gap: 4px;
    }

    #start-screen .start-knowledge-list li {
        font-size: 0.84rem;
        line-height: 1.35;
    }
}

@media (max-width: 420px) {
    #start-screen {
        --start-entry-width: min(94vw, 940px);
    }

    #start-screen .start-motivation-card,
    #start-screen .start-action-group {
        width: var(--start-entry-width);
    }

    #start-screen #p-name-input {
        width: 100%;
    }

    #start-screen .start-motivation-text {
        font-size: 0.82rem;
    }

    #start-screen .start-knowledge-title {
        font-size: 0.8rem;
    }

    #start-screen .start-knowledge-list li {
        font-size: 0.78rem;
    }
}

.start-action-group {
    width: var(--start-entry-width);
    max-width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;    
    gap: 24px;
}

#start-screen #p-name-input {
    width: 100%;
    box-sizing: border-box;
    margin: 0;
}

#start-screen #btn-google-login,
#start-screen #btn-start {
    width: 100% !important;
    max-width: 100%;
}

#start-screen .auth-status {
    width: 100%;
    margin: -6px 0 2px;
    text-align: center;
    font-size: clamp(0.78rem, 0.95vw, 0.9rem);
    color: #d8f0ff;
    opacity: 0.96;
}

#start-screen #btn-start {
    margin: 0;
    padding: 16px 24px !important;
    min-height: 60px;
    border-radius: 12px !important;
    font-size: clamp(0.95rem, 1.05vw, 1.05rem) !important;
    font-weight: 800 !important;
    letter-spacing: 0.5px;
    color: #ffffff !important;
    background: linear-gradient(135deg, #8342f4, #357ae8) !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 4px 20px rgba(66, 133, 244, 0.5) !important;
    transition: all 200ms ease;
}

#start-screen #btn-start:hover:not(:disabled) {
    background: linear-gradient(135deg, #357ae8, #2d5fc7) !important;
    box-shadow: 0 6px 30px rgba(66, 133, 244, 0.7) !important;
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.6) !important;
}

#start-screen #btn-start:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(66, 133, 244, 0.5) !important;
}

#start-screen #btn-start:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.firework {
    /* Partícula circular base. */
    position: fixed;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    pointer-events: none;
    animation: explode 1s ease-out forwards;
    z-index: 9999;
}

.fw-star {
    /* Partícula em forma de losango. */
    border-radius: 2px;
    transform-origin: center;
    width: 8px;
    height: 8px;
    rotate: 45deg;
}

.fw-bar {
    /* Partícula alongada estilo traço. */
    border-radius: 2px;
    width: 4px;
    height: 14px;
}

@keyframes explode {
    /* Parte do centro, expande e desaparece. */
    0% {
        transform: scale(1);
        opacity: 1;
    }
    60% {
        opacity: 0.9;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(20);
        opacity: 0;
    }
}

.lightning-flash {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1600;
    background:
        radial-gradient(circle at 50% 22%,
            rgba(255, 255, 255, 0.6),
            rgba(255, 255, 255, 0.18) 24%,
            rgba(255, 255, 255, 0) 58%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1920 1080' preserveAspectRatio='none'%3E%3Cdefs%3E%3Cfilter id='g'%3E%3CfeGaussianBlur stdDeviation='6' result='b'/%3E%3CfeMerge%3E%3CfeMergeNode in='b'/%3E%3CfeMergeNode in='SourceGraphic'/%3E%3C/feMerge%3E%3C/filter%3E%3ClinearGradient id='lg' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0%25' stop-color='%23ffffff' stop-opacity='0.98'/%3E%3Cstop offset='100%25' stop-color='%238ad8ff' stop-opacity='0.85'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M980 80 L900 380 L1010 380 L880 760 L1080 430 L975 430 L1080 140 Z' fill='url(%23lg)' filter='url(%23g)'/%3E%3Cpath d='M680 130 L620 330 L700 330 L600 590 L760 360 L680 360 L760 170 Z' fill='url(%23lg)' opacity='0.65' filter='url(%23g)'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: cover, cover;
    background-position: center, center;
    mix-blend-mode: screen;
    animation: lightningFlash 0.48s ease-out forwards;
}

@keyframes lightningFlash {
    0% {
        opacity: 0;
    }
    12% {
        opacity: 0.9;
    }
    28% {
        opacity: 0.22;
    }
    46% {
        opacity: 0.75;
    }
    100% {
        opacity: 0;
    }
}

.multi-opt {
    /* Opção de resposta para questões de múltipla seleção. */
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
}

.combo-box {
    /* Select customizado para questões do tipo combo. */
    background: #000;
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 5px;
    border-radius: 5px;
    font-family: 'Orbitron';
    cursor: pointer;
}

/* ================================
   PAINEL DE PONTUAÇÃO E ANIMAÇÕES
   ================================ */

.score-panel {
    /* Painel da coluna direita (mesma largura do ranking). */
    position: fixed;
    top: 20px;
    right: var(--hud-right);
    z-index: 1000;
    width: var(--hud-width);
    background: rgba(0, 0, 0, 0.30);
    border: 3px solid var(--neon-gold);
    border-radius: 15px;
    padding: 15px 25px;
    box-sizing: border-box;
    height: var(--score-panel-height);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.58), inset 0 0 18px rgba(255, 215, 0, 0.2);
    backdrop-filter: blur(10px);
}

.top15-panel {
    /* Ranking na mesma coluna direita e mesma largura do painel de pontos. */
    position: fixed;
    top: calc(20px + var(--score-panel-height) + var(--hud-gap));
    right: var(--hud-right);
    z-index: 1000;
    width: var(--hud-width);
    max-height: calc(100vh - (20px + var(--score-panel-height) + var(--hud-gap)) - (20px + var(--music-player-height) + var(--hud-gap) + var(--ranking-btn-height) + var(--hud-gap)));
    overflow: hidden;
    background: rgba(0, 0, 0, 0.30);
    border: 2px solid rgba(255, 215, 0, 0.9);
    border-radius: 14px;
    box-shadow: 0 0 22px rgba(255, 215, 0, 0.5), inset 0 0 16px rgba(255, 215, 0, 0.18);
    backdrop-filter: blur(10px);
    padding: 10px 12px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.top15-title {
    margin: 0 0 10px 0;
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    color: #ffd700;
    text-align: center;
    letter-spacing: 1px;
}

.top15-head,
.top15-row {
    display: grid;
    grid-template-columns: 24px 1fr 56px 62px;
    align-items: center;
    gap: 8px;
}

.top15-head {
    color: #00d4ff;
    font-weight: 700;
    font-size: 0.75rem;
    padding: 6px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    text-transform: uppercase;
}

.top15-head span:nth-child(1) {
    text-align: center;
}

.top15-head span:nth-child(3),
.top15-head span:nth-child(4) {
    text-align: right;
}

.top15-body {
    margin-top: 6px;
    overflow-y: auto;
    padding-right: 0;
    padding-bottom: 8px;
    flex: 1;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.top15-body::-webkit-scrollbar {
    display: none;
}

.top15-row {
    padding: 7px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.82rem;
}

.top15-row:last-child {
    border-bottom: none;
}

.top15-row.is-podium {
    background: rgba(255, 215, 0, 0.08);
}

.top15-pos {
    color: #ffd700;
    font-weight: 700;
    text-align: center;
}

.top15-name {
    color: #f3f3f3;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top15-medal {
    font-size: 0.9rem;
    line-height: 1;
    flex: 0 0 auto;
}

.top15-score {
    color: #2ecc71;
    font-weight: 700;
    text-align: right;
}

.top15-time {
    color: #ffef9f;
    font-weight: 700;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.top15-empty {
    color: #c7c7c7;
    font-size: 0.85rem;
    text-align: center;
    margin: 12px 0;
}

.ranking-hud-btn {
    position: fixed;
    right: var(--hud-right);
    bottom: calc(20px + var(--music-player-height) + var(--hud-gap));
    width: var(--hud-width);
    min-height: var(--ranking-btn-height);
    z-index: 1000;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.95), rgba(0, 160, 224, 0.95));
    color: #00141b;
    font-weight: 800;
    letter-spacing: 0.7px;
    border: 1px solid rgba(120, 236, 255, 0.95);
    box-shadow: 0 0 16px rgba(0, 212, 255, 0.5), inset 0 0 10px rgba(255, 255, 255, 0.2);
}

.ranking-hud-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.65), inset 0 0 10px rgba(255, 255, 255, 0.3);
}

.music-player {
    position: fixed;
    right: var(--hud-right);
    bottom: 20px;
    width: var(--hud-width);
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid var(--neon-border);
    border-radius: 12px;
    box-shadow: 0 0 14px rgba(0, 229, 255, 0.35), inset 0 0 10px rgba(0, 100, 120, 0.22);
    padding: 10px 12px;
    box-sizing: border-box;
    z-index: 1000;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
        "label toggle"
        "volume volume";
    gap: 8px;
    align-items: center;
}

.music-label {
    grid-area: label;
    color: #ffef9f;
    font-size: 0.78rem;
    letter-spacing: 0.8px;
    font-family: var(--font-title);
}

.music-toggle-btn {
    grid-area: toggle;
    border: 1px solid var(--neon-border);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.9);
    color: #d8f8ff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 6px 10px;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.25);
}

.music-toggle-btn.is-off {
    border-color: #ff6b6b;
    color: #ffd0d0;
    box-shadow: 0 0 10px rgba(255, 80, 80, 0.25);
}

.music-volume {
    grid-area: volume;
    width: 100%;
    accent-color: #00e5ff;
}

.music-volume::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(0, 229, 255, 0.45), rgba(0, 229, 255, 0.9));
}

.music-volume::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    margin-top: -5px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.85);
    background: #f5ffff;
    box-shadow: 0 0 0 2px rgba(0, 229, 255, 0.32);
}

.music-volume::-moz-range-track {
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(0, 229, 255, 0.45), rgba(0, 229, 255, 0.9));
}

.music-volume::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.85);
    background: #f5ffff;
    box-shadow: 0 0 0 2px rgba(0, 229, 255, 0.32);
}

/* ── Painel lateral de regras ───────────────────────────────── */
.rules-panel {
    position: fixed;
    left: -290px;
    top: 0;
    width: 280px;
    height: 100%;
    z-index: 1500;
    background: rgba(5, 12, 24, 0.97);
    border-right: 2px solid rgba(0, 229, 255, 0.55);
    box-shadow: 4px 0 28px rgba(0, 212, 255, 0.28);
    transition: left 380ms cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.rules-panel.open {
    left: 0;
}

.rules-panel-inner {
    padding: 28px 20px 20px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,229,255,0.3) transparent;
}

.rules-panel-title {
    font-family: var(--font-title) !important;
    font-size: 1rem;
    letter-spacing: 2px;
    color: var(--primary);
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.6);
    margin: 0 0 4px;
    text-align: center;
}

.rules-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rules-list li {
    font-size: 0.8rem;
    line-height: 1.5;
    color: #d8f0ff;
    border-left: 2px solid rgba(0, 229, 255, 0.35);
    padding-left: 10px;
}

.rules-list li strong {
    color: #39ff14;
    text-shadow: 0 0 8px rgba(57, 255, 20, 0.5);
}

.rules-panel-footer {
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid rgba(0, 229, 255, 0.2);
    font-size: 0.72rem;
    color: rgba(200, 220, 240, 0.6);
    text-align: center;
    line-height: 1.7;
    letter-spacing: 0.4px;
}

.rules-panel-footer strong {
    color: #39ff14;
    text-shadow: 0 0 8px rgba(57, 255, 20, 0.5);
    display: block;
    font-size: 0.82rem;
}

/* Botão de alternância (seta) */
.rules-toggle-btn {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1501;
    width: 28px;
    height: 64px;
    background: rgba(0, 30, 50, 0.92);
    border: 2px solid rgba(0, 229, 255, 0.6);
    border-left: none;
    border-radius: 0 10px 10px 0;
    color: var(--primary);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 3px 0 14px rgba(0, 212, 255, 0.35);
    transition: left 380ms cubic-bezier(0.4, 0, 0.2, 1), background 200ms, color 200ms;
    padding: 0;
    line-height: 1;
}

.rules-toggle-btn.open {
    left: 280px;
}

.rules-toggle-btn .rules-arrow {
    display: inline-block;
    transition: transform 380ms cubic-bezier(0.4, 0, 0.2, 1);
}

.rules-toggle-btn.open .rules-arrow {
    transform: rotate(180deg);
}

.rules-toggle-btn:hover {
    background: rgba(0, 60, 90, 0.95);
    color: #fff;
    box-shadow: 3px 0 20px rgba(0, 212, 255, 0.55);
}
/* ───────────────────────────────────────────────────────────── */

@media (min-width: 1201px) {
    body {
        align-items: flex-start;
        padding-top: 0;
        overflow: hidden;
    }

    #game-container {
        margin-top: 50px;
        height: calc(100vh - 70px);
        max-height: none;
        overflow: hidden;
        padding: 20px 24px;
    }

    #start-screen,
    #portal-screen,
    #sokoban-screen,
    #quiz-screen {
        height: 100%;
        overflow: hidden;
    }

    #sokoban-title {
        margin: 4px 0 8px;
    }

    #sokoban-grid {
        margin: 8px auto;
        transform: scale(0.9);
        transform-origin: top center;
    }

    #btn-giveup-sokoban {
        margin-top: 8px !important;
    }

    #quiz-screen {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        width: 100%;
        margin: 0 auto;
    }

    #quiz-screen.is-drag-question {
        overflow-y: auto;
        padding-right: 4px;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    #quiz-screen.is-drag-question::-webkit-scrollbar {
        display: none;
    }

    #quiz-screen.is-drag-question.drag-feedback-visible {
        --drag-feedback-scale: 0.9;
        overflow-y: auto;
        transform: none;
    }

    #quiz-screen:not(.is-drag-question) {
        overflow-y: auto;
        padding-right: 4px;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    #quiz-screen:not(.is-drag-question)::-webkit-scrollbar {
        display: none;
    }

    #quiz-screen.is-drag-question #q-txt {
        margin-bottom: 12px !important;
        font-size: clamp(1.1rem, 2.1vh, 1.45rem) !important;
        line-height: 1.35 !important;
    }

    #quiz-screen.is-drag-question #drag-drop-container {
        flex: none;
        min-height: auto;
        display: flex;
        width: 100%;
    }

    #quiz-screen.is-drag-question .drag-area {
        min-height: auto;
        display: grid;
        grid-template-rows: auto auto;
        gap: 8px !important;
        width: 100%;
    }

    #quiz-screen.is-drag-question .drag-pool {
        padding: 8px;
        gap: 8px;
    }

    #quiz-screen.is-drag-question .drag-pool .drag-card {
        padding: 10px 8px !important;
        font-size: 0.92rem !important;
        line-height: 1.25;
    }

    #quiz-screen.is-drag-question .drop-zones {
        gap: 8px;
    }

    #quiz-screen.is-drag-question .drop-box {
        padding: 10px !important;
        font-size: 0.92rem !important;
    }

    #quiz-screen.is-drag-question .target-zone {
        min-height: 48px !important;
    }

    #quiz-screen.is-drag-question #val-btn {
        margin-top: 50px !important;
    }

    #quiz-screen.is-drag-question #next-btn {
        margin-top: 24px !important;
    }

    #quiz-screen.is-drag-question #fb-area {
        margin-top: 24px !important;
        margin-bottom: 24px !important;
        max-height: none;
        overflow: visible;
        width: 100%;
    }

    #quiz-screen.is-drag-question #fb-area.has-feedback {
        margin-top: 24px !important;
        margin-bottom: 24px !important;
    }

    #quiz-screen.is-drag-question.drag-feedback-visible #fb-area,
    #quiz-screen.is-drag-question.drag-feedback-visible #fb-area.has-feedback {
        margin-top: 10px !important;
        margin-bottom: 10px !important;
    }

    #quiz-screen.is-drag-question.drag-feedback-visible #next-btn {
        margin-top: 8px !important;
        padding: 11px 10px !important;
        font-size: 0.88rem !important;
    }

    #quiz-screen.is-drag-question.drag-feedback-visible #q-txt {
        margin-bottom: 8px !important;
        font-size: clamp(0.98rem, 1.7vh, 1.2rem) !important;
    }

    #quiz-screen.is-drag-question.drag-feedback-visible .drag-pool,
    #quiz-screen.is-drag-question.drag-feedback-visible .drop-zones {
        gap: 6px;
    }

    #quiz-screen.is-drag-question.drag-feedback-visible .drag-pool {
        padding: 6px;
    }

    #quiz-screen.is-drag-question.drag-feedback-visible .drag-pool .drag-card {
        padding: 8px 6px !important;
        font-size: 0.84rem !important;
    }

    #quiz-screen.is-drag-question.drag-feedback-visible .drop-box {
        padding: 7px !important;
        font-size: 0.78rem !important;
    }

    #quiz-screen.is-drag-question.drag-feedback-visible .target-zone {
        min-height: 36px !important;
    }

    #quiz-screen.is-drag-question.drag-feedback-visible .drag-correct-grid {
        gap: 4px 6px;
    }

    #quiz-screen.is-drag-question.drag-feedback-visible .drag-correct-item {
        padding: 4px 6px;
        font-size: 0.74rem;
    }

    #quiz-screen:not(.is-drag-question) #q-txt {
        margin-bottom: 12px !important;
        font-size: clamp(1.05rem, 2vh, 1.35rem) !important;
        line-height: 1.35 !important;
    }

    #quiz-screen:not(.is-drag-question) #opts {
        gap: 12px !important;
    }

    #quiz-screen:not(.is-drag-question) #opts .opt-btn {
        padding: 14px 10px !important;
        font-size: 0.98rem !important;
        line-height: 1.25;
    }

    #quiz-screen:not(.is-drag-question) #fb-area {
        margin-top: 10px !important;
        font-size: 1rem !important;
        line-height: 1.4;
        max-height: none;
        overflow: visible;
        padding: 0;
    }

    #quiz-screen:not(.is-drag-question) #val-btn,
    #quiz-screen:not(.is-drag-question) #next-btn {
        margin-top: 14px !important;
        padding: 14px 12px !important;
        font-size: 1rem !important;
    }

    #quiz-screen:not(.is-drag-question) #val-btn {
        margin-top: 50px !important;
    }

    #opts {
        width: 100% !important;
        max-width: none !important;
    }

    .score-panel {
        top: 50px;
    }

    .top15-panel {
        top: calc(50px + var(--score-panel-height) + var(--hud-gap));
        max-height: calc(100vh - (50px + var(--score-panel-height) + var(--hud-gap)) - (20px + var(--music-player-height) + var(--hud-gap) + var(--ranking-btn-height) + var(--hud-gap)));
    }
}

@media (min-width: 1201px) and (max-height: 900px) {
    #quiz-screen.is-drag-question.drag-feedback-visible {
        overflow-y: auto;
    }

    #quiz-screen.is-drag-question #q-txt {
        font-size: 1.05rem !important;
        margin-bottom: 10px !important;
    }

    #quiz-screen.is-drag-question .drag-pool .drag-card {
        padding: 9px 7px !important;
        font-size: 0.88rem !important;
    }

    #quiz-screen.is-drag-question .drop-box {
        padding: 8px !important;
        font-size: 0.86rem !important;
    }

    #quiz-screen.is-drag-question .target-zone {
        min-height: 42px !important;
    }

    #quiz-screen.is-drag-question #fb-area,
    #quiz-screen.is-drag-question #fb-area.has-feedback {
        margin-top: 18px !important;
        margin-bottom: 18px !important;
    }

    #quiz-screen.is-drag-question #next-btn {
        margin-top: 18px !important;
    }

    #quiz-screen:not(.is-drag-question) #q-txt {
        font-size: 1rem !important;
        margin-bottom: 8px !important;
    }

    #quiz-screen:not(.is-drag-question) #opts {
        gap: 9px !important;
    }

    #quiz-screen:not(.is-drag-question) #opts .opt-btn {
        padding: 11px 8px !important;
        font-size: 0.9rem !important;
    }

    #quiz-screen:not(.is-drag-question) #fb-area {
        margin-top: 6px !important;
        font-size: 0.92rem !important;
        max-height: none;
        overflow: visible;
        padding: 0;
    }

    #quiz-screen:not(.is-drag-question) #val-btn,
    #quiz-screen:not(.is-drag-question) #next-btn {
        margin-top: 10px !important;
        padding: 11px 10px !important;
        font-size: 0.92rem !important;
    }

    #quiz-screen:not(.is-drag-question) #val-btn {
        margin-top: 50px !important;
    }
}

@media (max-width: 820px) {
    #quiz-screen.is-drag-question.drag-feedback-visible {
        overflow-y: auto;
    }

    #quiz-screen.is-drag-question #fb-area,
    #quiz-screen.is-drag-question #fb-area.has-feedback {
        margin-top: 18px !important;
        margin-bottom: 18px !important;
    }

    #quiz-screen.is-drag-question #next-btn {
        margin-top: 18px !important;
    }
}

@media (max-width: 420px) {
    #quiz-screen.is-drag-question.drag-feedback-visible {
        overflow-y: auto;
    }

    #quiz-screen.is-drag-question #q-txt {
        font-size: 0.98rem !important;
        margin-bottom: 8px !important;
    }

    #quiz-screen.is-drag-question .drop-box {
        padding: 8px !important;
        font-size: 0.82rem !important;
    }

    #quiz-screen.is-drag-question .target-zone {
        min-height: 40px !important;
    }

    #quiz-screen.is-drag-question #fb-area,
    #quiz-screen.is-drag-question #fb-area.has-feedback {
        margin-top: 14px !important;
        margin-bottom: 14px !important;
    }

    #quiz-screen.is-drag-question #next-btn {
        margin-top: 14px !important;
    }
}

@media (max-width: 1200px) {
    body {
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        overflow-y: auto;
        padding: 20px 16px;
    }

    #game-container {
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
        max-height: none;
        padding: 20px;
    }

    .score-panel,
    .top15-panel,
    .ranking-hud-btn,
    .music-player {
        position: static;
        width: min(100%, 560px);
        margin-left: auto;
        margin-right: auto;
    }

    .score-panel {
        margin-bottom: var(--hud-gap);
    }

    .top15-panel {
        max-height: 280px;
        margin-bottom: var(--hud-gap);
    }

    .ranking-hud-btn {
        margin-bottom: var(--hud-gap);
    }

    .music-player {
        margin-bottom: var(--hud-gap);
    }
}

@media (max-width: 820px) {
    #opts {
        grid-template-columns: 1fr !important;
    }

    .score-meta {
        flex-wrap: wrap;
        justify-content: center;
    }

    .score-player {
        max-width: 180px;
    }

    .drag-pool,
    .drag-correct-grid {
        grid-template-columns: 1fr;
    }
}

.score-display {
    /* Container do conteúdo do painel. */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.score-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.score-label {
    /* Rótulo "PONTOS". */
    font-size: 0.9rem;
    color: #ffd700;
    font-weight: bold;
    font-family: 'Orbitron';
    letter-spacing: 1px;
}

.score-player {
    font-size: 1rem;
    color: #00d4ff;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.5px;
}

.score-value {
    /* Número de pontos. */
    font-size: 2rem;
    font-weight: 900;
    color: #ffd700;
    font-family: 'Orbitron';
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
    transition: transform 0.1s ease;
}

.timer-display {
    margin-top: 6px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.86rem;
    color: #00d4ff;
    letter-spacing: 0.8px;
    font-weight: 700;
}

.total-time-display {
    margin-top: 2px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.78rem;
    color: #ffef9f;
    letter-spacing: 0.8px;
    font-weight: 700;
}

/* ─── Timer por questão (painel de pontos) ───────────────────── */
.q-timer-display {
    margin-top: 4px;
    font-family: 'Orbitron', sans-serif;
    font-size: 2.2rem;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #00d4ff;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    white-space: nowrap;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid rgba(0, 212, 255, 0.35);
    background: rgba(0, 0, 0, 0.28);
    transition: color 0.4s ease, border-color 0.4s ease;
}

.q-timer-icon {
    font-size: 1.05em;
    line-height: 1;
}

.q-timer-value {
    font-size: 1em;
    line-height: 1;
}

.q-timer-display.q-timer-warning {
    color: #ff8c00;
    border-color: rgba(255, 140, 0, 0.55);
    animation: qTimerWarnPulse 0.55s ease-in-out infinite alternate;
}

.q-timer-display.q-timer-danger {
    color: #ff3333;
    border-color: rgba(255, 50, 50, 0.6);
    animation: qTimerDangerPulse 0.32s ease-in-out infinite alternate;
}

@keyframes qTimerWarnPulse {
    from { box-shadow: 0 0 4px rgba(255, 140, 0, 0.3); }
    to   { box-shadow: 0 0 14px rgba(255, 140, 0, 0.85); }
}

@keyframes qTimerDangerPulse {
    from { box-shadow: 0 0 6px rgba(255, 50, 50, 0.4); }
    to   { box-shadow: 0 0 20px rgba(255, 50, 50, 1.0); }
}

/* ─── Overlay de texto no centro da tela de questão ─────────── */
.q-time-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-title);
    font-size: 4.5rem;
    font-weight: bold;
    letter-spacing: 3px;
    text-align: center;
    pointer-events: none;
    z-index: 200;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.85);
    background: transparent;
    border: none;
    opacity: 0;
    white-space: nowrap;
}

.q-time-overlay.q-timer-pop {
    animation: qTimerPop 4s ease-out forwards;
}

.q-time-overlay.q-timer-expired {
    animation: qTimerExpiredPop 4s cubic-bezier(0.2, 0.9, 0.2, 1) forwards;
}

@keyframes qTimerPop {
    0%   { opacity: 0;   transform: translate(-50%, -50%) scale(0.45); }
    8%   { opacity: 1;   transform: translate(-50%, -50%) scale(1.22); }
    16%  { opacity: 1;   transform: translate(-50%, -50%) scale(1.0);  }
    88%  { opacity: 1;   transform: translate(-50%, -50%) scale(1.0);  }
    100% { opacity: 0;   transform: translate(-50%, -68%) scale(0.88); }
}

@keyframes qTimerExpiredPop {
    0%   { opacity: 0;   transform: translate(-50%, -50%) scale(0.45); text-shadow: 0 0 10px rgba(0,0,0,0.85); }
    8%   { opacity: 1;   transform: translate(-50%, -50%) scale(1.28); text-shadow: 0 0 10px rgba(0,0,0,0.85), 0 0 26px rgba(255, 50, 50, 0.95); }
    16%  { opacity: 1;   transform: translate(-50%, -50%) scale(1.02); text-shadow: 0 0 10px rgba(0,0,0,0.85), 0 0 24px rgba(255, 50, 50, 0.85); }
    88%  { opacity: 1;   transform: translate(-50%, -50%) scale(1.0);  text-shadow: 0 0 10px rgba(0,0,0,0.85), 0 0 28px rgba(255, 80, 80, 0.9); }
    100% { opacity: 0;   transform: translate(-50%, -64%) scale(0.94); text-shadow: 0 0 10px rgba(0,0,0,0.85); }
}

.score-pulse {
    /* Animação de pulsação ao ganhar pontos. */
    animation: scorePulse 0.4s ease-out;
}

.score-penalty-pulse {
    /* Pulsação de penalidade ao perder pontos. */
    animation: scorePenaltyPulse 0.45s ease-out;
    color: #ff6b6b;
    text-shadow: 0 0 10px rgba(255, 60, 60, 0.9);
}

@keyframes scorePulse {
    /* Escala e rebote ao ganhar pontos. */
    0% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.3);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes scorePenaltyPulse {
    0% {
        transform: scale(1);
    }
    30% {
        transform: scale(1.22) translateY(-2px);
    }
    55% {
        transform: scale(0.94);
    }
    100% {
        transform: scale(1);
    }
}

.score-delta-badge {
    position: absolute;
    top: 8px;
    right: -12px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    pointer-events: none;
    animation: scoreDeltaFloat 0.9s ease-out forwards;
}

.score-delta-badge.negative {
    color: #ff5b5b;
    text-shadow: 0 0 10px rgba(255, 80, 80, 0.85);
}

@keyframes scoreDeltaFloat {
    0% {
        opacity: 0;
        transform: translateY(6px) scale(0.9);
    }
    20% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-26px) scale(1.05);
    }
}

/* Container para animação das moedas. */
.coins-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 999;
}

.coin {
    /* Moeda individual que cai. */
    position: fixed;
    width: 60px;
    height: 60px;
    background: #ffd700;
    border-radius: 50%;
    box-shadow: inset -2px -2px 5px rgba(0, 0, 0, 0.3),
                inset 2px 2px 5px rgba(255, 255, 255, 0.3),
                0 0 10px rgba(255, 215, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    pointer-events: none;
}

.coin::before {
    /* Caractere de moeda dentro. */
    content: '💰';
    font-size: 40px;
}

@keyframes coinFall {
    /* Moedas caem e desaparecem. */
    0% {
        opacity: 1;
        transform: translateY(0) rotateY(0deg) rotateX(0deg);
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(600px) rotateY(180deg) rotateX(180deg);
    }
}

@keyframes coinRotate {
    /* Rotação contínua da moeda. */
    0% {
        transform: rotateY(0deg) rotateZ(0deg);
    }
    100% {
        transform: rotateY(360deg) rotateZ(360deg);
    }
}

/* ================================
   ESTILOS PARA TABELA DE RANKING
   ================================ */

/* ── Logo no painel lateral de regras ── */
.rules-panel-logo-wrap {
    width: 100%;
    margin-top: 4px;
    margin-bottom: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    user-select: none;
    overflow: hidden;
}

.rules-panel-logo {
    display: block;
    width: min(92%, 240px);
    max-height: 180px;
    height: auto;
    object-fit: contain;
    opacity: 0.88;
    filter: saturate(1.05) brightness(1.03);
    -webkit-mask-image: radial-gradient(
        ellipse 72% 66% at 50% 52%,
        rgba(0, 0, 0, 1) 34%,
        rgba(0, 0, 0, 0.7) 60%,
        transparent 100%
    );
    mask-image: radial-gradient(
        ellipse 72% 66% at 50% 52%,
        rgba(0, 0, 0, 1) 34%,
        rgba(0, 0, 0, 0.7) 60%,
        transparent 100%
    );
}

/* ── Tabela de ranking ── */
#ranking-list table {
    /* Tabela de ranking com estilo premium */
    font-family: var(--font-ui), monospace;
    letter-spacing: 0.5px;
}

.ranking-modal-card {
    /* O card ocupa o espaço disponível deixando 20px de gap + altura do botão (~52px) */
    min-height: 0;
    max-height: calc(100vh - 40px - 20px - 52px);
    flex-shrink: 1;
}

.ranking-modal-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 0;
    /* Scrollbar invisível — o conteúdo rola mas sem track visível */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.ranking-modal-body::-webkit-scrollbar {
    display: none;
}

#intro-modal > div,
#feedback-modal > div,
#ranking-modal > div,
.drag-pool,
.drop-box,
.target-zone,
.multi-opt,
.combo-box,
#sokoban-grid,
#ranking-list table,
#ranking-list th,
#ranking-list td {
    border-color: var(--neon-border) !important;
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.22);
}

#ranking-list th {
    /* Headers da tabela */
    background: linear-gradient(135deg, rgba(255,215,0,0.2), rgba(0,212,255,0.2));
    padding: 15px 10px;
    text-align: left;
    border-bottom: 2px solid gold;
    font-size: 0.95rem;
}

#ranking-list td {
    /* Células da tabela */
    padding: 12px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

#ranking-list tr:hover {
    /* Destaque ao passar mouse */
    background: rgba(255,215,0,0.05);
}

#ranking-list tr:first-of-type {
    /* Primeira posição com destaque especial */
    background: rgba(255,215,0,0.15);
}

@media (max-width: 768px) {
    .ranking-modal-card {
        padding: 22px 16px;
        max-height: calc(100vh - 40px - 20px - 52px);
    }
}

.ranking-cert-link {
    border: 1px solid #00d4ff;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: #9fefff;
    font-size: 0.72rem;
    font-family: var(--font-ui), monospace;
    font-weight: 700;
    letter-spacing: 0.4px;
    padding: 6px 10px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.ranking-cert-link:hover {
    color: #fff;
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.6);
    transform: translateY(-1px);
}

/* Ranking global: layout responsivo para mobile */
#ranking-modal {
    box-sizing: border-box;
}

#ranking-list {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

#ranking-list .ranking-table {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    table-layout: fixed;
    box-sizing: border-box;
}

@media (max-width: 900px) {
    #ranking-modal {
        padding: 12px !important;
        gap: 12px !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        overflow-y: auto;
        overflow-x: hidden;
    }

    #ranking-modal .ranking-modal-card {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto;
        padding: 16px 12px !important;
        border-radius: 14px !important;
        max-height: none;
        min-height: 0;
        box-sizing: border-box;
    }

    #ranking-modal-title {
        margin-bottom: 10px !important;
        font-size: clamp(1.1rem, 5.2vw, 1.4rem) !important;
    }

    #ranking-list {
        overflow-x: hidden;
        overflow-y: auto;
        min-height: 0;
    }

    #ranking-list .ranking-table {
        border-collapse: separate !important;
        border-spacing: 0 8px;
    }

    #ranking-list .ranking-table tr:first-child {
        display: none;
    }

    #ranking-list .ranking-table tr {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px 12px;
        padding: 10px 10px;
        border: 1px solid rgba(0, 229, 255, 0.28);
        border-radius: 10px;
        background: rgba(7, 18, 30, 0.9);
        box-shadow: 0 0 10px rgba(0, 229, 255, 0.18);
    }

    #ranking-list .ranking-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
        width: 100%;
        min-width: 0;
        padding: 0 !important;
        border: 0 !important;
        font-size: 0.88rem;
        box-shadow: none !important;
        text-align: right !important;
    }

    #ranking-list .ranking-table td::before {
        content: attr(data-label);
        font-size: 0.72rem;
        color: #9fefff;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        flex-shrink: 0;
    }

    #ranking-list .ranking-table td[data-label="Certificado"] {
        grid-column: 1 / -1;
    }

    #ranking-list .ranking-table td[data-label="Certificado"] .ranking-cert-link {
        width: 100%;
        margin-top: 2px;
    }

    #ranking-modal-close {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0;
    }
}

@media (max-width: 480px) {
    #ranking-modal {
        padding: 10px !important;
    }

    #ranking-modal .ranking-modal-card {
        padding: 14px 10px !important;
    }

    #ranking-list .ranking-table td {
        font-size: 0.82rem;
    }

    #ranking-list .ranking-table td::before {
        font-size: 0.68rem;
    }

    #ranking-list .ranking-table tr {
        gap: 6px 10px;
        padding: 9px;
    }
}

.certificate-paper {
    width: min(940px, 94vw);
    max-height: calc(100vh - 24px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(circle at 15% 20%, rgba(255, 215, 0, 0.22), transparent 35%),
        radial-gradient(circle at 80% 0%, rgba(0, 212, 255, 0.2), transparent 30%),
        linear-gradient(165deg, #1e1504 0%, #100c03 45%, #0b0a08 100%);
    border: 3px solid #d8b548;
    border-radius: 16px;
    padding: clamp(14px, 2.4vh, 30px);
    box-shadow: 0 0 35px rgba(216, 181, 72, 0.45), inset 0 0 30px rgba(0, 0, 0, 0.45);
    color: #f8e8bb;
}

#certificate-modal {
    padding: 10px;
    box-sizing: border-box;
    overflow: hidden;
}

#certificate-content {
    flex: 1 1 auto;
    overflow: hidden;
}

.certificate-title {
    text-align: center;
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1.5rem, 3vw, 2.3rem);
    color: #ffd86a;
    letter-spacing: 1.6px;
    text-transform: uppercase;
}

.certificate-subtitle {
    text-align: center;
    margin-top: 6px;
    margin-bottom: 18px;
    font-family: 'Audiowide', sans-serif;
    color: #9fefff;
    letter-spacing: 1px;
}

.certificate-text {
    text-align: center;
    margin: 8px 0;
    color: #f8e8bb;
}

.certificate-player {
    text-align: center;
    margin: 8px 0;
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1.4rem, 3.4vw, 2rem);
    color: #ffffff;
    text-transform: uppercase;
    text-shadow: 0 0 16px rgba(255, 215, 105, 0.42);
}

.certificate-metrics {
    margin: 20px auto 18px auto;
    max-width: 760px;
    display: grid;
    gap: 8px;
    text-align: left;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(216, 181, 72, 0.5);
    border-radius: 12px;
    padding: 14px 16px;
}

.certificate-metrics div {
    display: flex;
    justify-content: flex-start;
    gap: 14px;
}

.certificate-metrics span {
    color: #d4bd74;
}

.certificate-medal-wrap {
    margin: 14px 0 12px 0;
    text-align: center;
}

.certificate-medal-icon {
    font-size: clamp(4rem, 10vw, 7rem);
    line-height: 1;
    filter: drop-shadow(0 0 14px rgba(255, 215, 0, 0.55));
}

.certificate-medal-label {
    margin-top: 8px;
    font-family: 'Orbitron', sans-serif;
    color: #ffe18c;
    font-size: clamp(1rem, 2.2vw, 1.35rem);
    letter-spacing: 1px;
}

.certificate-areas-title {
    margin-top: 0;
    margin-bottom: 8px;
    font-family: 'Orbitron', sans-serif;
    color: #9fefff;
    text-align: left;
}

.certificate-areas-box {
    margin: 16px auto 0 auto;
    max-width: 760px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(216, 181, 72, 0.5);
    border-radius: 12px;
    padding: 14px 16px;
    text-align: left;
}

.certificate-areas-list {
    margin: 0;
    padding-left: 20px;
    display: grid;
    gap: 8px;
    color: #f4f4f4;
}

.certificate-areas-list li strong {
    color: #ffd86a;
}

.certificate-signature-block {
    margin-top: 34px;
    margin-bottom: 0;
    text-align: center;
}

.certificate-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: clamp(10px, 1.6vh, 20px);
    flex-wrap: wrap;
}

.certificate-print-btn,
.certificate-close-btn {
    margin-top: 0;
    width: 280px;
    max-width: 100%;
    display: block;
}

.certificate-print-btn {
    background: #00d4ff;
    color: #001218;
    font-weight: 800;
}

.certificate-signature-name,
.certificate-signature-role,
.certificate-signature-org {
    margin: 6px 0;
    color: #c7ebff;
}

.certificate-signature-name {
    font-family: 'Audiowide', sans-serif;
    font-size: clamp(0.95rem, 2vw, 1.15rem);
}

.certificate-signature-role,
.certificate-signature-org {
    font-family: var(--font-ui), monospace;
    font-size: clamp(0.82rem, 1.6vw, 0.95rem);
    letter-spacing: 0.4px;
}

.certificate-signature-line {
    width: min(420px, 80%);
    height: 1px;
    margin: 8px auto;
    background: linear-gradient(90deg, transparent, rgba(216, 181, 72, 0.9), transparent);
}

.certificate-close-btn {
    background: #d8b548;
    color: #000;
    font-weight: 800;
}

@media (max-height: 900px) {
    .certificate-title {
        font-size: clamp(1.35rem, 2.6vw, 1.95rem);
    }

    .certificate-text {
        margin: 4px 0;
    }

    .certificate-player {
        margin: 4px 0;
        font-size: clamp(1.25rem, 3vw, 1.75rem);
    }

    .certificate-metrics {
        margin: 12px auto 10px auto;
        gap: 6px;
        padding: 10px 12px;
    }

    .certificate-medal-wrap {
        margin: 8px 0 8px 0;
    }

    .certificate-medal-icon {
        font-size: clamp(3.2rem, 8vw, 5rem);
    }

    .certificate-medal-label {
        margin-top: 4px;
        font-size: clamp(0.94rem, 1.9vw, 1.12rem);
    }

    .certificate-areas-box {
        margin: 10px auto 0 auto;
        padding: 10px 12px;
    }

    .certificate-areas-list {
        gap: 4px;
        font-size: 0.94rem;
    }

    .certificate-signature-block {
        margin-top: 14px;
    }

    .certificate-signature-name,
    .certificate-signature-role,
    .certificate-signature-org {
        margin: 4px 0;
    }

    .certificate-signature-line {
        margin: 5px auto;
    }
}

@media print {
    @page {
        size: A4 landscape;
        margin: 0;
    }

    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    html,
    body {
        margin: 0 !important;
        padding: 0 !important;
        height: auto !important;
        overflow: hidden !important;
        background: #000 !important;
    }

    body > * {
        display: none !important;
    }

    #certificate-modal {
        display: flex !important;
        position: fixed !important;
        inset: 0 !important;
        width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
        padding: 7mm 8mm !important;
        box-sizing: border-box !important;
        background: rgba(0, 0, 0, 0.88) !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        page-break-after: avoid !important;
    }

    .certificate-paper {
        width: min(920px, 92vw) !important;
        min-height: 0 !important;
        max-height: calc(100vh - 14mm) !important;
        height: auto !important;
        margin: auto !important;
        padding: clamp(14px, 2.4vh, 30px) !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
        border: 3px solid #d8b548 !important;
        border-radius: 16px !important;
        box-shadow: 0 0 35px rgba(216, 181, 72, 0.45), inset 0 0 30px rgba(0, 0, 0, 0.45) !important;
        color: #f8e8bb !important;
        background:
            radial-gradient(circle at 15% 20%, rgba(255, 215, 0, 0.22), transparent 35%),
            radial-gradient(circle at 80% 0%, rgba(0, 212, 255, 0.2), transparent 30%),
            linear-gradient(165deg, #1e1504 0%, #100c03 45%, #0b0a08 100%) !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        page-break-after: avoid !important;
    }

    .certificate-title {
        font-size: clamp(1.4rem, 2.7vw, 2.1rem) !important;
    }

    .certificate-text,
    .certificate-player {
        margin: 5px 0 !important;
    }

    .certificate-metrics {
        margin: 14px auto 12px auto !important;
    }

    .certificate-areas-box {
        margin-top: 12px !important;
    }

    .certificate-signature-block {
        margin-top: 18px !important;
    }

    .certificate-actions {
        display: none !important;
    }
}

/* ================================
   ESTILOS PARA CAÇA NÍQUEL
   ================================ */

/* Fundo do modal: roxo/magenta escuro com spots de luz como no referencial */
#slot-machine-modal {
    background: rgba(0, 0, 0, 0.82);
}

.slot-machine-container {
    position: relative;
    text-align: center;
    z-index: 1;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.slot-machine-container::-webkit-scrollbar {
    display: none;
}

/* Lens flare esquerda */
.slot-machine-container::before {
    content: '';
    position: absolute;
    top: 2%;
    left: -6%;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, rgba(255,255,255,0.5) 0%, rgba(210,140,255,0.25) 38%, transparent 68%);
    pointer-events: none;
    z-index: 0;
    filter: blur(5px);
}

/* Lens flare direita */
.slot-machine-container::after {
    content: '';
    position: absolute;
    top: 2%;
    right: -6%;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, rgba(255,255,255,0.5) 0%, rgba(255,140,220,0.25) 38%, transparent 68%);
    pointer-events: none;
    z-index: 0;
    filter: blur(5px);
}

.slot-title {
    color: #fff;
    font-family: 'Audiowide', sans-serif;
    font-size: 2rem;
    margin: 0 0 16px 0;
    letter-spacing: 2px;
    text-shadow: 0 0 20px rgba(255,255,255,0.9), 0 0 40px rgba(200,100,255,0.7);
    position: relative;
    z-index: 1;
    animation: slotTitleGlow 2s ease-in-out infinite;
}

@keyframes slotTitleGlow {
    0%, 100% { text-shadow: 0 0 20px rgba(255,255,255,0.9), 0 0 40px rgba(200,100,255,0.7); }
    50%       { text-shadow: 0 0 30px rgba(255,255,255,1), 0 0 70px rgba(255,150,255,1); }
}

/* Body que envolve setas + reels */
.slot-machine-body {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

/* Setas da payline */
.slot-payline-arrow {
    display: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #ffd700;
    font-size: 1.4rem;
    text-shadow: 0 0 14px gold, 0 0 28px rgba(255,215,0,0.6);
    z-index: 10;
    pointer-events: none;
    animation: paylineArrowPulse 1.2s ease-in-out infinite;
}
.slot-payline-arrow-l { left: 0; }
.slot-payline-arrow-r { right: 0; }
@keyframes paylineArrowPulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.35; }
}

.slot-reels-wrapper {
    display: flex;
    flex-direction: row;
    gap: 10px;
    padding: 20px 38px;
    background: linear-gradient(to bottom, #0c0022 0%, #1a0240 50%, #0c0022 100%);
    border: 2px solid rgba(180, 100, 255, 0.5);
    border-radius: 20px;
    justify-content: center;
    align-items: center;
    position: relative;
    box-shadow: inset 0 0 60px rgba(100, 0, 200, 0.25), 0 0 30px rgba(120, 0, 220, 0.3);
    overflow: hidden;
}

/* Linha dourada da payline */
.slot-reels-wrapper::before {
    display: none;
    content: '';
    position: absolute;
    top: 50%;
    left: 20px;
    right: 20px;
    height: 3px;
    background: linear-gradient(to right, transparent 0%, #ffd700 12%, #ffd700 88%, transparent 100%);
    transform: translateY(-50%);
    z-index: 20;
    pointer-events: none;
    box-shadow: 0 0 10px rgba(255,215,0,0.9), 0 0 22px rgba(255,215,0,0.4);
}

/* === REEL === */
.slot-reel {
    width: 148px;
    height: 360px;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
    background:
        radial-gradient(ellipse at 50% 50%, rgba(255,255,255,0.70) 0%, rgba(255,255,255,0) 62%),
        linear-gradient(
            to right,
            #7a7a7a 0%,
            #d6d6d6 8%,
            #ffffff 24%,
            #f7f7f7 50%,
            #ffffff 76%,
            #d6d6d6 92%,
            #7a7a7a 100%
        );
    background-size: 100% 100%, 100% 100%;
    background-position: center center, center center;
    perspective: 1100px;
    transform-style: preserve-3d;
    box-shadow:
        -12px 0 20px rgba(0,0,0,0.60),
        12px 0 20px rgba(0,0,0,0.60),
        inset -4px 0 8px rgba(0,0,0,0.12),
        inset 4px 0 8px rgba(0,0,0,0.12),
        0 0 0 2px rgba(210,210,210,0.6);
}

.slot-reel.spinning {
    background-size: 170% 100%, 120% 100%;
    animation: reelCylinderSweep var(--spin-cyl-speed, 280ms) linear infinite;
    box-shadow:
        -12px 0 20px rgba(0,0,0,0.60),
        12px 0 20px rgba(0,0,0,0.60),
        inset -4px 0 8px rgba(0,0,0,0.12),
        inset 4px 0 8px rgba(0,0,0,0.12),
        0 0 24px rgba(200,160,255,0.55);
}

    .slot-reel.fx-active {
        box-shadow:
        -16px 0 24px rgba(0,0,0,0.66),
        16px 0 24px rgba(0,0,0,0.66),
        inset -14px 0 22px rgba(0,0,0,0.20),
        inset 14px 0 22px rgba(0,0,0,0.20),
        inset 0 0 38px rgba(255,255,255,0.20),
        0 0 20px rgba(186,145,255,0.42);
    }

@keyframes reelCylinderSweep {
    0% {
        background-position: 8% 0, 50% 0;
    }
    50% {
        background-position: 92% 0, 50% 0;
    }
    100% {
        background-position: 8% 0, 50% 0;
    }
}

/* Degradê top/bottom do reel para profundidade cilíndrica */
.slot-reel::before,
.slot-reel::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 88px;
    pointer-events: none;
    z-index: 10;
}
.slot-reel::before {
    top: 0;
    background: linear-gradient(to bottom, rgba(175,155,210,0.80) 0%, rgba(175,155,210,0.08) 65%, transparent 100%);
}
.slot-reel::after {
    bottom: 0;
    background: linear-gradient(to top, rgba(175,155,210,0.80) 0%, rgba(175,155,210,0.08) 65%, transparent 100%);
}

.slot-track {
    display: flex;
    flex-direction: column;
    will-change: transform;
    transform: translateY(0);
    transform-style: preserve-3d;
    backface-visibility: hidden;
}

/* Célula de símbolo */
.slot-symbol {
    width: 100%;
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 4.4rem;
    flex-shrink: 0;
    min-height: 120px;
    max-height: 120px;
    box-sizing: border-box;
    background: #fff;
    border-bottom: 1px solid #dedede;
    position: relative;
    transform: translateZ(0);
    backface-visibility: hidden;
    will-change: transform, filter, opacity;
}

/* BAR — 3 barras empilhadas escuras */
.slot-symbol.bar {
    background: #181818;
    font-size: 0;
    gap: 4px;
    border-bottom: 1px solid #2a2a2a;
}
.slot-symbol.bar span {
    display: block;
    font-size: 0.8rem;
    font-weight: 900;
    letter-spacing: 4px;
    background: linear-gradient(to bottom, #2e2e2e, #101010);
    border: 1px solid #4a4a4a;
    border-radius: 4px;
    padding: 3px 14px;
    width: 84px;
    text-align: center;
    color: #e8e8e8;
    text-shadow: 0 1px 0 rgba(255,255,255,0.12);
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.08), 0 2px 4px rgba(0,0,0,0.6);
    font-family: 'Audiowide', 'Impact', Arial, sans-serif;
}

/* 7 — sete vermelho estilo casino */
.slot-symbol.seven {
    background: #fff;
    font-family: 'Impact', 'Arial Black', sans-serif;
    font-size: 5.8rem;
    font-weight: 900;
    color: #cc0000;
    line-height: 1;
    text-shadow:
        4px 4px 0 #7a0000,
        -1px -1px 0 #ff5555,
        0 0 22px rgba(255, 0, 0, 0.5);
    border-bottom: 1px solid #dedede;
}

/* Blur suave durante giro */
.slot-reel.spinning .slot-track {
    filter: saturate(1.08);
}

.slot-reel.spinning .slot-symbol {
    transform-origin: center center;
}

/* Flash dourado nos reels ao ganhar */
.slot-reel.reel-win {
    animation: reelWinGlow 0.35s ease-in-out 6;
}
@keyframes reelWinGlow {
    0%, 100% { box-shadow: -12px 0 20px rgba(0,0,0,0.55), 12px 0 20px rgba(0,0,0,0.55); }
    50%       { box-shadow: 0 0 50px rgba(255,215,0,1), 0 0 100px rgba(255,255,100,0.7); }
}

/* Flash da linha dourada ao ganhar */
.slot-reels-wrapper.payline-win::before {
    animation: none;
}
@keyframes paylineWin {
    0%, 100% { background: linear-gradient(to right, transparent, #ffd700, #ffd700, transparent); height: 3px; }
    50%       { background: linear-gradient(to right, transparent, #fff, #fff, transparent); height: 5px; box-shadow: 0 0 30px rgba(255,255,255,1); }
}

.slot-result {
    background: rgba(0, 0, 0, 0.65);
    border: 2px solid #ffd700;
    border-radius: 12px;
    padding: 16px 22px;
    margin: 14px 0 6px 0;
    font-size: 1.3rem;
    color: #ffd700;
    text-shadow: 0 0 12px rgba(255,215,0,0.9);
    font-weight: bold;
    font-family: 'Orbitron', sans-serif;
    animation: resultPop 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    z-index: 1;
}
@keyframes resultPop {
    0%   { opacity: 0; transform: scale(0.5); }
    70%  { transform: scale(1.07); }
    100% { opacity: 1; transform: scale(1); }
}

.slot-result.jackpot {
    background: linear-gradient(135deg, rgba(255,215,0,0.22), rgba(255,107,0,0.22));
    border-color: #ffd700;
    animation: jackpotFlash 0.4s infinite, resultPop 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
@keyframes jackpotFlash {
    0%, 100% { box-shadow: 0 0 14px rgba(255,215,0,0.6); }
    50%       { box-shadow: 0 0 55px rgba(255,215,0,1), 0 0 110px rgba(255,255,100,0.6); }
}

.slot-buttons {
    display: flex;
    gap: 14px;
    justify-content: center;
    margin-top: 12px;
    position: relative;
    z-index: 1;
}

.slot-btn-spin {
    flex: 1;
    padding: 15px 20px;
    font-size: 1.1rem;
    font-family: 'Audiowide', sans-serif;
    font-weight: bold;
    border-radius: 12px;
    border: 2px solid #bb5500;
    background: linear-gradient(to bottom, #ff8c00 0%, #cc4400 100%);
    color: #fff;
    cursor: pointer;
    transition: all 0.18s ease;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    box-shadow: 0 5px 0 #882200, 0 7px 14px rgba(0,0,0,0.45);
}
.slot-btn-spin:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 7px 0 #882200, 0 10px 18px rgba(0,0,0,0.45); }
.slot-btn-spin:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 #882200; }
.slot-btn-spin:disabled { opacity: 0.5; cursor: not-allowed; }

.slot-btn-close {
    padding: 15px 22px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 12px;
    border: 2px solid #444;
    background: linear-gradient(to bottom, #555, #333);
    color: #ccc;
    cursor: pointer;
    transition: all 0.18s ease;
    box-shadow: 0 4px 0 #111, 0 6px 12px rgba(0,0,0,0.4);
}
.slot-btn-close:hover { background: linear-gradient(to bottom, #666, #444); transform: translateY(-2px); }

.slot-summary-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slot-summary-card {
    width: min(640px, 92vw);
    background: linear-gradient(135deg, #111a34, #1a2748);
    border: 3px solid #00e5ff;
    border-radius: 18px;
    box-shadow: 0 0 26px rgba(0, 229, 255, 0.35);
    padding: 24px;
}

.slot-summary-title {
    margin: 0 0 14px;
    text-align: center;
    color: #ffd700;
    font-family: var(--font-title);
}

.slot-summary-list {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
}

.slot-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255, 107, 0, 0.7);
    border-radius: 10px;
    padding: 10px 12px;
    background: rgba(255, 107, 0, 0.12);
    font-weight: 700;
    color: #f8f2cf;
}

.slot-summary-row strong {
    color: #ffd700;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
}

.slot-summary-total {
    text-align: center;
    border: 2px solid #ffd700;
    border-radius: 12px;
    padding: 12px;
    font-size: 1.3rem;
    font-weight: 800;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.45);
}

/* ================================
   BONUS ESPECIAL - PACMAN STYLE
   ================================ */

#pacman-bonus-modal {
    background: rgba(0, 0, 0, 0.82);
}

.pacman-bonus-container {
    background: linear-gradient(145deg, #070b1e, #0d1534);
}

.pacman-title {
    margin: 0;
    color: #f6f8ff;
    text-shadow: 0 0 14px rgba(0, 212, 255, 0.8);
}

.pacman-subtitle {
    margin: 8px 0 10px;
    color: #d8e5ff;
    font-size: 0.95rem;
}

.pacman-subtitle strong {
    color: #ffd700;
}

.pacman-hud {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    color: #ffef9f;
}

.pacman-board-wrap,
.enduro-board-wrap,
.trex-board-wrap {
    min-height: 442px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.pacman-board-wrap {
    border-radius: 16px;
    border: 2px solid rgba(0, 212, 255, 0.45);
    padding: 10px;
    background: linear-gradient(180deg, #020512, #050a1c);
    box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.8);
}

#pacman-canvas {
    display: block;
    width: min(92vw, 420px);
    height: min(92vw, 420px);
    margin: 0 auto;
    border-radius: 10px;
    background: #01030c;
    image-rendering: crisp-edges;
}

.pacman-actions {
    margin-top: 12px;
    display: flex;
    justify-content: center;
}

@media (max-width: 700px) {
    .pacman-hud {
        font-size: 0.86rem;
    }

    .pacman-subtitle {
        font-size: 0.85rem;
    }

    .pacman-bonus-container {
        padding: 14px 12px 14px;
    }
}

.pacman-test-btn {
    background: linear-gradient(180deg, #1a3f85, #0f2b5a);
    border-color: #59c8ff;
    color: #dff8ff;
    box-shadow: 0 0 10px rgba(89, 200, 255, 0.45);
}

.pacman-test-btn:hover {
    filter: brightness(1.12);
}

.enduro-test-btn {
    background: linear-gradient(180deg, #8c3f19, #5a2a12);
    border-color: #ffb55a;
    color: #ffe9cc;
    box-shadow: 0 0 10px rgba(255, 181, 90, 0.45);
}

.enduro-test-btn:hover {
    filter: brightness(1.12);
}

.enduro-trophy-hero {
    font-size: 2rem;
    line-height: 1;
    margin: 6px 0 12px;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.55);
    animation: enduro-hero-pop 1.1s ease-in-out infinite alternate;
}

@keyframes enduro-hero-pop {
    from { transform: translateY(0) scale(1); }
    to { transform: translateY(-2px) scale(1.04); }
}

.enduro-victory-overlay {
    backdrop-filter: blur(3px);
}

.enduro-victory-card {
    max-width: 460px;
    border-color: #4ec9ff;
    box-shadow: 0 0 26px rgba(78, 201, 255, 0.4), inset 0 0 22px rgba(14, 58, 119, 0.35);
    background: linear-gradient(160deg, #0b1331, #10214a);
}

.enduro-victory-text {
    margin: 6px 0 14px;
    color: #e8f3ff;
    font-size: 1.02rem;
}

.enduro-victory-text strong {
    color: #ffe07a;
}

.enduro-victory-img {
    display: block;
    width: min(90%, 320px);
    margin: 0 auto;
    border-radius: 12px;
    border: 2px solid rgba(78, 201, 255, 0.55);
    box-shadow: 0 0 16px rgba(78, 201, 255, 0.35);
}

/* ================================
   BONUS ESPECIAL - ENDURO STYLE
   ================================ */

#enduro-bonus-modal {
    background: rgba(0, 0, 0, 0.82);
}

.enduro-bonus-container {
    background: linear-gradient(155deg, #080f24, #0f1e3f);
    border-color: #00b9ff;
}

.enduro-title {
    margin: 0;
    color: #f6f8ff;
    text-shadow: 0 0 14px rgba(0, 185, 255, 0.8);
}

.enduro-subtitle {
    margin: 8px 0 10px;
    color: #dbe8ff;
    font-size: 0.95rem;
}

.enduro-subtitle strong {
    color: #ffe182;
}

.enduro-hud {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    color: #ffef9f;
}

.enduro-board-wrap {
    border-radius: 16px;
    border: 2px solid rgba(0, 185, 255, 0.45);
    padding: 10px;
    background: linear-gradient(180deg, #01040f, #060d20);
    box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.8);
}

#enduro-canvas {
    display: block;
    width: min(92vw, 420px);
    height: min(92vw, 420px);
    margin: 0 auto;
    border-radius: 10px;
    background: #01030a;
    image-rendering: crisp-edges;
}

.enduro-actions {
    margin-top: 12px;
    display: flex;
    justify-content: center;
}

@media (max-width: 700px) {
    .enduro-hud {
        font-size: 0.82rem;
    }

    .enduro-subtitle {
        font-size: 0.84rem;
    }

    .enduro-bonus-container {
        padding: 14px 12px 14px;
    }
}

/* T-REX Bonus Game Styling */
.trex-bonus-container {
    background: linear-gradient(155deg, #2d2d2d, #1a1a1a);
    border: 3px solid #ffa500;
    box-shadow: 0 0 30px rgba(255, 165, 0, 0.4), inset 0 0 28px rgba(139, 69, 19, 0.25);
}

.trex-title {
    margin: 0;
    color: #ffeb3b;
    text-shadow: 0 0 14px rgba(255, 165, 0, 0.9);
    font-size: 1.6rem;
}

.trex-subtitle {
    margin: 8px 0 10px;
    color: #fff8dc;
    font-size: 0.95rem;
}

.trex-subtitle strong {
    color: #ffff00;
}

.trex-hud {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    color: #ffa500;
    font-size: 1.1rem;
}

.trex-board-wrap {
    border-radius: 16px;
    border: 3px solid rgba(255, 165, 0, 0.5);
    padding: 10px;
    background: linear-gradient(180deg, #1a1a1a, #0d0d0d);
    box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.8);
}

#trex-canvas {
    display: block;
    width: min(92vw, 800px);
    max-width: 800px;
    aspect-ratio: 8 / 3;
    height: auto;
    max-height: 300px;
    margin: 0 auto;
    border-radius: 10px;
    background: #f5f5f5;
    image-rendering: crisp-edges;
}

.trex-actions {
    margin-top: 12px;
    display: flex;
    justify-content: center;
}

.trex-test-btn {
    background: linear-gradient(135deg, #ff8c00, #ffa500);
    color: #000;
    font-weight: 900;
    border: 2px solid #ff6347;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 0.95rem;
    cursor: pointer;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    box-shadow: 0 4px 12px rgba(255, 140, 0, 0.4);
    transition: all 0.25s ease;
}

.trex-test-btn:hover {
    background: linear-gradient(135deg, #ff7700, #ff9500);
    box-shadow: 0 6px 18px rgba(255, 140, 0, 0.6);
    transform: translateY(-2px);
}

.sokoban-test-btn {
    background: linear-gradient(180deg, #2a4f2f, #1c3520);
    border-color: #8be083;
    color: #e9ffdf;
    box-shadow: 0 0 10px rgba(139, 224, 131, 0.4);
}

.sokoban-test-btn:hover {
    filter: brightness(1.12);
}

@media (max-width: 900px) {
    .pacman-board-wrap,
    .enduro-board-wrap,
    .trex-board-wrap {
        min-height: 310px;
    }

    .trex-hud {
        font-size: 0.85rem;
    }

    .trex-subtitle {
        font-size: 0.84rem;
    }

    .trex-bonus-container {
        padding: 14px 12px 14px;
    }

    #trex-canvas {
        width: min(92vw, 600px);
        max-width: 600px;
    }
}

/* ── MARIO BONUS GAME ─────────────────────────────────────────── */

.mario-bonus-container {
    background: linear-gradient(155deg, #1a2e5e, #0d1a3a);
    border: 3px solid #e52525;
    border-radius: 22px;
    padding: 20px 24px 18px;
    width: min(92vw, 860px);
    max-height: 96vh;
    overflow-y: auto;
    box-shadow: 0 0 30px rgba(229, 37, 37, 0.45), inset 0 0 28px rgba(0, 80, 180, 0.25);
}

.mario-title {
    margin: 0;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.6rem;
    color: #ffdd00;
    text-shadow: 0 0 14px rgba(255, 100, 0, 0.9);
    text-align: center;
}

.mario-subtitle {
    margin: 8px 0 10px;
    color: #fffde0;
    font-size: 0.95rem;
    text-align: center;
}

.mario-subtitle strong {
    color: #ffee00;
}

.mario-hud {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    color: #ffdd00;
    font-size: 1.1rem;
}

.mario-board-wrap {
    border-radius: 16px;
    border: 3px solid rgba(229, 37, 37, 0.5);
    padding: 10px;
    background: linear-gradient(180deg, #5c94fc, #3a6fcc);
    box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.5);
}

#mario-canvas {
    display: block;
    width: min(92vw, 800px);
    max-width: 800px;
    aspect-ratio: 8 / 3;
    height: auto;
    max-height: 300px;
    margin: 0 auto;
    border-radius: 10px;
    background: #5c94fc;
    image-rendering: crisp-edges;
}

.mario-actions {
    margin-top: 12px;
    display: flex;
    justify-content: center;
}

.mario-test-btn {
    background: linear-gradient(135deg, #e52525, #ff6600);
    color: #fff;
    font-weight: 900;
    border: 2px solid #cc0000;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 0.95rem;
    cursor: pointer;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.45);
    box-shadow: 0 4px 12px rgba(229, 37, 37, 0.4);
    transition: all 0.25s ease;
}

@media (max-width: 700px) {
    .mario-hud {
        font-size: 0.82rem;
    }

    .mario-subtitle {
        font-size: 0.84rem;
    }

    .mario-bonus-container {
        padding: 14px 12px 14px;
    }

    #mario-canvas {
        width: min(92vw, 600px);
        max-width: 600px;
    }
}

/* ── SPACE INVADERS BONUS ─────────────────────────────────────────────────── */

.space-bonus-container {
    background: linear-gradient(155deg, #000814, #001a2e);
    border: 2px solid #00d4ff;
    border-radius: 22px;
    padding: 20px 24px 18px;
    width: min(92vw, 860px);
    max-height: 96vh;
    overflow-y: auto;
    box-shadow: 0 0 40px rgba(0, 212, 255, 0.5), inset 0 0 30px rgba(0, 80, 160, 0.25);
}

.space-title {
    margin: 0;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.6rem;
    color: #00d4ff;
    text-shadow: 0 0 16px rgba(0, 212, 255, 0.9);
    text-align: center;
}

.space-subtitle {
    margin: 8px 0 10px;
    color: #cceeff;
    font-size: 0.95rem;
    text-align: center;
}

.space-subtitle strong {
    color: #00d4ff;
}

.space-hud {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    color: #00d4ff;
    font-size: 1.05rem;
}

.space-board-wrap {
    border-radius: 16px;
    border: 2px solid rgba(0, 212, 255, 0.4);
    padding: 8px;
    background: #000011;
    box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.7);
}

#space-canvas {
    display: block;
    width: min(92vw, 800px);
    max-width: 800px;
    aspect-ratio: 8 / 5;
    height: auto;
    margin: 0 auto;
    border-radius: 10px;
    background: #000011;
    image-rendering: crisp-edges;
}

.space-actions {
    margin-top: 12px;
    display: flex;
    justify-content: center;
}

.space-test-btn {
    background: linear-gradient(135deg, #004d80, #0099cc);
    color: #fff;
    font-weight: 900;
    border: 2px solid #00d4ff;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 0.95rem;
    cursor: pointer;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.45);
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.4);
    transition: all 0.25s ease;
}

@media (max-width: 700px) {
    .space-hud {
        font-size: 0.78rem;
    }

    .space-subtitle {
        font-size: 0.84rem;
    }

    .space-bonus-container {
        padding: 14px 12px 14px;
    }

    #space-canvas {
        width: min(92vw, 600px);
        max-width: 600px;
    }
}

/* ── SNAKE BONUS ────────────────────────────────────────────────────────────── */

.snake-bonus-container {
    background: rgba(0, 8, 0, 0.93);
    border: 2px solid #4ade80;
    border-radius: 22px;
    padding: 20px 24px 18px;
    width: min(92vw, 580px);
    max-height: 96vh;
    overflow-y: auto;
    box-shadow: 0 0 40px rgba(74, 222, 128, 0.55), inset 0 0 30px rgba(0, 60, 0, 0.3);
    text-align: center;
}

.snake-title {
    margin: 0 0 6px;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    color: #4ade80;
    text-shadow: 0 0 18px rgba(74, 222, 128, 0.9);
}

.snake-subtitle {
    margin: 0 0 10px;
    color: #bbf7d0;
    font-size: 0.92rem;
}

.snake-subtitle strong {
    color: #4ade80;
}

.snake-hud {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    color: #4ade80;
    font-size: 1rem;
}

.snake-board-wrap {
    border-radius: 14px;
    border: 2px solid rgba(74, 222, 128, 0.4);
    padding: 6px;
    background: #000;
    box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.8);
}

#snake-canvas {
    display: block;
    width: min(88vw, 500px);
    max-width: 500px;
    aspect-ratio: 1 / 1;
    height: auto;
    margin: 0 auto;
    border-radius: 10px;
    background: #000;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
}

.snake-actions {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.snake-controls {
    margin: 0;
    color: rgba(74, 222, 128, 0.6);
    font-size: 0.78rem;
}

@media (max-width: 700px) {
    .snake-hud {
        font-size: 0.78rem;
    }

    .snake-subtitle {
        font-size: 0.82rem;
    }

    .snake-bonus-container {
        padding: 12px 10px;
    }

    #snake-canvas {
        width: min(90vw, 400px);
        max-width: 400px;
    }
}

/* ── MEMORY BONUS ─────────────────────────────────────────────────────────── */

.memory-bonus-container {
    background: linear-gradient(155deg, #1a0f00, #2d1800);
    border: 2px solid #fbbf24;
    border-radius: 22px;
    padding: 14px 18px 12px;
    width: min(92vw, 620px);
    max-height: 92vh;
    overflow: hidden;
    box-shadow: 0 0 40px rgba(251, 191, 36, 0.5), inset 0 0 30px rgba(80, 40, 0, 0.3);
    text-align: center;
}

.memory-title {
    margin: 0 0 6px;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    color: #fbbf24;
    text-shadow: 0 0 18px rgba(251, 191, 36, 0.9);
}

.memory-subtitle {
    margin: 0 0 8px;
    color: #fde68a;
    font-size: 0.88rem;
}

.memory-subtitle strong {
    color: #fbbf24;
}

.memory-hud {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    color: #fbbf24;
    font-size: 0.95rem;
}

.memory-board-wrap {
    border-radius: 14px;
    border: 2px solid rgba(251, 191, 36, 0.35);
    padding: 10px;
    background: rgba(0, 0, 0, 0.5);
    box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.8);
}

#memory-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(96px, 128px));
    justify-content: center;
    gap: 10px;
}

.memory-card {
    aspect-ratio: 1 / 1;
    perspective: 600px;
    cursor: pointer;
}

.memory-card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 10px;
}

.memory-card.flipped .memory-card-inner,
.memory-card.matched .memory-card-inner {
    transform: rotateY(180deg);
}

.memory-card-front,
.memory-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 10px;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(251, 191, 36, 0.4);
}

.memory-card-front {
    background: #1a0f00;
    color: rgba(251, 191, 36, 0.5);
    font-size: 1.6rem;
}

.memory-card-back {
    background: linear-gradient(135deg, #92400e, #b45309);
    transform: rotateY(180deg);
    font-size: 2.4rem;
    border-color: #fbbf24;
}

.memory-card.matched .memory-card-back {
    background: linear-gradient(135deg, #065f46, #059669);
    border-color: #4ade80;
    box-shadow: 0 0 12px rgba(74, 222, 128, 0.6);
}

.memory-card:hover:not(.flipped):not(.matched) .memory-card-inner {
    transform: rotateY(10deg) scale(1.04);
}

.memory-card.wrong .memory-card-inner {
    animation: memory-shake 0.35s ease;
}

@keyframes memory-shake {
    0%, 100% { transform: rotateY(180deg) translateX(0); }
    25%       { transform: rotateY(180deg) translateX(-4px); }
    75%       { transform: rotateY(180deg) translateX(4px); }
}

.memory-actions {
    margin-top: 8px;
    display: flex;
    justify-content: center;
}

.memory-test-btn {
    background: linear-gradient(135deg, #92400e, #b45309);
    color: #fff;
    font-weight: 900;
    border: 2px solid #fbbf24;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 0.95rem;
    cursor: pointer;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.45);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.4);
    transition: all 0.25s ease;
}

@media (max-width: 700px) {
    .memory-hud {
        font-size: 0.74rem;
    }

    .memory-subtitle {
        font-size: 0.76rem;
    }

    .memory-bonus-container {
        padding: 10px 6px;
    }

    #memory-grid {
        grid-template-columns: repeat(4, minmax(64px, 84px));
        gap: 6px;
    }

    .memory-card-back {
        font-size: 1.6rem;
    }
}

/* ── LORDE HERO BONUS ─────────────────────────────────────────────────────── */

.lordehero-bonus-container {
    background: linear-gradient(155deg, #0e0e0e, #1d1d1d);
    border: 2px solid #00d9ff;
    border-radius: 22px;
    padding: 14px 16px 12px;
    width: min(94vw, 760px);
    max-height: 94vh;
    overflow: hidden;
    box-shadow: 0 0 38px rgba(0, 217, 255, 0.38), inset 0 0 24px rgba(0, 80, 120, 0.18);
    text-align: center;
}

.lordehero-title {
    margin: 0 0 6px;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.45rem;
    color: #8ff0ff;
    text-shadow: 0 0 16px rgba(0, 217, 255, 0.7);
}

.lordehero-subtitle {
    margin: 0 0 8px;
    color: #d4f8ff;
    font-size: 0.9rem;
}

.lordehero-subtitle strong {
    color: #00d9ff;
}

.lordehero-hud {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    color: #8ff0ff;
    font-size: 0.95rem;
}

.lordehero-board-wrap {
    border-radius: 14px;
    border: 2px solid rgba(0, 217, 255, 0.3);
    padding: 6px;
    background: rgba(0, 0, 0, 0.56);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
}

#lordehero-iframe {
    width: 100%;
    height: min(74vh, 640px);
    border: 0;
    display: block;
    border-radius: 10px;
    background: #111;
}

.lordehero-actions {
    margin-top: 8px;
    display: flex;
    justify-content: center;
}

.lordehero-test-btn {
    background: linear-gradient(135deg, #133b4f, #14617f);
    color: #fff;
    font-weight: 900;
    border: 2px solid #00d9ff;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 0.95rem;
    cursor: pointer;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.45);
    box-shadow: 0 4px 12px rgba(0, 217, 255, 0.32);
    transition: all 0.25s ease;
}

.frogger-test-btn {
    background: linear-gradient(135deg, #052e16, #166534);
    color: #fff;
    font-weight: 900;
    border: 2px solid #22c55e;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 0.95rem;
    cursor: pointer;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.45);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.35);
    transition: all 0.25s ease;
}

.tetris-test-btn {
    background: linear-gradient(135deg, #312e81, #1d4ed8);
    color: #fff;
    font-weight: 900;
    border: 2px solid #60a5fa;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 0.95rem;
    cursor: pointer;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.45);
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.32);
    transition: all 0.25s ease;
}

.game2048-test-btn {
    background: linear-gradient(135deg, #7c2d12, #ea580c);
    color: #fff7ed;
    font-weight: 900;
    border: 2px solid #fb923c;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 0.95rem;
    cursor: pointer;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.45);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.34);
    transition: all 0.25s ease;
}

.flappybird-test-btn {
    background: linear-gradient(135deg, #0f3d68, #0ea5e9);
    color: #f0f9ff;
    font-weight: 900;
    border: 2px solid #7dd3fc;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 0.95rem;
    cursor: pointer;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.45);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.34);
    transition: all 0.25s ease;
}

.arkanoid-test-btn {
    background: linear-gradient(135deg, #3f1f8a, #2563eb);
    color: #eff6ff;
    font-weight: 900;
    border: 2px solid #93c5fd;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 0.95rem;
    cursor: pointer;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.45);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.34);
    transition: all 0.25s ease;
}

.asteroids-test-btn {
    background: linear-gradient(135deg, #27272a, #0891b2);
    color: #ecfeff;
    font-weight: 900;
    border: 2px solid #67e8f9;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 0.95rem;
    cursor: pointer;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.45);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.34);
    transition: all 0.25s ease;
}

.minesweeper-test-btn {
    background: linear-gradient(135deg, #111827, #059669);
    color: #ecfdf5;
    font-weight: 900;
    border: 2px solid #6ee7b7;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 0.95rem;
    cursor: pointer;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.45);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.34);
    transition: all 0.25s ease;
}

@media (max-width: 700px) {
    .lordehero-title {
        font-size: 1.2rem;
    }

    .lordehero-subtitle {
        font-size: 0.78rem;
    }

    .lordehero-hud {
        font-size: 0.75rem;
    }

    #lordehero-iframe {
        height: min(70vh, 560px);
    }
}

/* ── Quiz screen: layout gamificado ── */
#era-tag {
    font-size: 1rem;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

#q-txt {
    font-size: 1.5rem !important;
    line-height: 1.5 !important;
    margin-bottom: 20px !important;
    overflow-wrap: anywhere;
    word-break: break-word;
}

#opts {
    gap: 12px !important;
    width: 100%;
    min-width: 0;
}

#fb-area {
    flex: none;
    margin-top: 12px !important;
    font-size: 1.25rem !important;
    line-height: 1.6;
    display: block;
    min-height: 0;
    max-height: 22vh;
    overflow-y: auto;
    width: 100%;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#fb-area::-webkit-scrollbar {
    display: none;
}

#fb-area:empty {
    display: none;
    margin-top: 0 !important;
    max-height: 0;
    overflow: hidden;
}

#quiz-screen #fb-area.has-feedback {
    margin-top: 20px !important;
    margin-bottom: 20px !important;
}

/* Botões de resposta: tamanho grande, estilo game */
#opts .opt-btn {
    padding: 20px 14px;
    font-size: 1.1rem;
    font-weight: 600;
    border: 2px solid var(--neon-border);
    border-radius: 12px;
    letter-spacing: 0.3px;
    line-height: 1.35;
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.28), inset 0 0 8px rgba(0, 229, 255, 0.07);
    transition: background 160ms, color 160ms, transform 100ms, box-shadow 160ms;
    margin-top: 0;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

#opts .opt-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 22px rgba(0, 229, 255, 0.6), inset 0 0 10px rgba(255, 255, 255, 0.12);
}

/* Botões Validar / Avançar */
#val-btn,
#next-btn {
    padding: 20px 16px !important;
    font-size: 1.2rem !important;
    letter-spacing: 1.5px !important;
    border: 2px solid var(--neon-border) !important;
    border-radius: 12px !important;
    margin-top: 16px !important;
    transition: background 160ms, color 160ms, transform 100ms, box-shadow 160ms !important;
}

#val-btn {
    margin-top: 50px !important;
}

#next-btn:hover {
    transform: translateY(-2px);
}

/* Múltipla escolha (checkboxes) */
.multi-opt {
    padding: 16px 14px !important;
    font-size: 1.05rem !important;
    border: 2px solid rgba(0, 229, 255, 0.3) !important;
    border-radius: 12px !important;
    gap: 14px !important;
    transition: background 150ms, border-color 150ms;
    line-height: 1.4;
    margin-top: 0;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.multi-opt:hover {
    background: rgba(0, 229, 255, 0.1) !important;
    border-color: rgba(0, 229, 255, 0.6) !important;
}

.multi-opt input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

/* Combinação (combo/select) */
.combo-box {
    padding: 12px 14px !important;
    font-size: 1rem !important;
    border-radius: 10px !important;
    border: 2px solid var(--primary) !important;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

/* Drag cards */
.drag-card {
    padding: 14px 16px !important;
    font-size: 0.95rem !important;
    border-radius: 10px !important;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.35) !important;
}

/* Drop zone */
.target-zone {
    min-height: 56px !important;
    font-size: 1rem;
}

/* Área de drag-drop */
.drag-area {
    gap: 14px !important;
}

/* V ou F / grid de 1 coluna (questões não-grade) */
#opts.single-col {
    grid-template-columns: 1fr !important;
}


/* ── LOGIN MODAL ─────────────────────────────────────────────────────────── */

.login-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.login-modal-backdrop.hidden {
    display: none !important;
}

.login-modal-container {
    background: #000;
    border: 3px solid var(--neon-border);
    border-radius: 24px;
    padding: 48px 36px;
    width: min(92vw, 500px);
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 0 60px rgba(0, 229, 255, 0.7), inset 0 0 40px rgba(0, 100, 180, 0.3);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.login-modal-title {
    margin: 0;
    font-family: var(--font-title);
    font-size: clamp(2rem, 5vw, 3.2rem);
    color: var(--neon-gold);
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    letter-spacing: 1px;
}

.login-modal-subtitle {
    margin: 0;
    font-family: var(--font-ui);
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    color: rgba(240, 240, 240, 0.9);
    letter-spacing: 0.5px;
}

.btn-login-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    width: 100%;
    max-width: 320px;
    padding: 16px 24px;
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    font-weight: 800;
    color: #ffffff;
    background: linear-gradient(135deg, #8342f4, #357ae8);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    cursor: pointer;
    transition: all 200ms ease;
    box-shadow: 0 4px 20px rgba(66, 133, 244, 0.5);
    font-family: var(--font-ui);
    letter-spacing: 0.5px;
}

.btn-login-google:hover {
    background: linear-gradient(135deg, #357ae8, #2d5fc7);
    box-shadow: 0 6px 30px rgba(66, 133, 244, 0.7);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.6);
}

.btn-login-google:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(66, 133, 244, 0.5);
}

.google-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.login-modal-logo {
    width: min(200px, 80%);
    height: auto;
    margin-top: 16px;
    
}

/* Esconder elementos até autenticação */
.auth-required-hidden {
    display: none !important;
}

/* Responsivo: tablets e mobile */
@media (max-width: 900px) {
    .login-modal-container {
        padding: 40px 28px;
        width: min(95vw, 420px);
    }

    .login-modal-title {
        font-size: clamp(1.8rem, 4.5vw, 2.8rem);
    }

    .login-modal-subtitle {
        font-size: clamp(0.95rem, 2.2vw, 1.2rem);
    }

    .btn-login-google {
        padding: 14px 20px;
        font-size: clamp(0.9rem, 1.8vw, 1rem);
        gap: 12px;
    }

    .google-icon {
        width: 22px;
        height: 22px;
    }

    .login-modal-logo {
        width: min(180px, 75%);
    }
}

@media (max-width: 640px) {
    .login-modal-container {
        padding: 32px 20px;
        width: 93vw;
    }

    .login-modal-title {
        font-size: 1.6rem;
    }

    .login-modal-subtitle {
        font-size: 0.95rem;
    }

    .btn-login-google {
        padding: 12px 18px;
        font-size: 0.9rem;
        gap: 10px;
    }

    .google-icon {
        width: 20px;
        height: 20px;
    }

    .login-modal-logo {
        width: min(160px, 70%);
    }
}

@media (max-width: 420px) {
    .login-modal-container {
        padding: 28px 16px;
        width: 96vw;
        gap: 20px;
    }

    .login-modal-title {
        font-size: 1.4rem;
    }

    .login-modal-subtitle {
        font-size: 0.9rem;
    }

    .btn-login-google {
        padding: 12px 16px;
        font-size: 0.85rem;
        gap: 10px;
    }

    .google-icon {
        width: 18px;
        height: 18px;
    }

    .login-modal-logo {
        width: min(140px, 65%);
    }
}

/* ── Drag-drop responsivo: ocupa toda a div ── */
#drag-drop-container {
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.drag-area {
    width: 100% !important;
    box-sizing: border-box;
    min-width: 0;
}

.drag-pool {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: 100% !important;
    box-sizing: border-box;
    min-width: 0;
}

.drag-pool .drag-card {
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 18px 12px !important;
    font-size: 1.05rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: grab;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
}

.drop-zones {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: 100% !important;
    box-sizing: border-box;
    min-width: 0;
}

.drop-box {
    width: 100% !important;
    box-sizing: border-box !important;
    font-size: 1rem !important;
    padding: 14px !important;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.drop-box > span {
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
}

.target-zone {
    width: 100% !important;
    box-sizing: border-box !important;
    min-height: 64px !important;
    flex: 1;
    min-width: 0;
}

.target-zone .drag-card {
    width: 100% !important;
    box-sizing: border-box !important;
}

@media (max-width: 820px) {
    .drop-zones {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 420px) {
    .drag-area {
        gap: 10px !important;
    }

    .drag-pool {
        gap: 8px;
        padding: 8px;
    }

    .drag-pool .drag-card {
        padding: 12px 8px !important;
        font-size: 0.9rem !important;
        line-height: 1.3;
    }

    .drop-box {
        padding: 10px !important;
        font-size: 0.88rem !important;
    }

    .target-zone {
        min-height: 52px !important;
    }
}


/* ── Combo-box: tamanho proporcional (revert) ── */
.combo-box {
    padding: 5px 8px !important;
    font-size: 0.9rem !important;
    width: auto !important;
    max-width: 100% !important;
    display: inline-block !important;
}

/* ── Botões de ação: verde fixo ── */
#val-btn,
#next-btn {
    background: #27ae60 !important;
    color: #fff !important;
}
#val-btn:hover,
#next-btn:hover {
    background: #2ecc71 !important;
    color: #fff !important;
}

/* ── Colunas laterais retráteis (esquerda e direita) ── */
:root {
    --left-panel-width: 280px;
    --right-panel-width: 324px;
}

body {
    padding: 20px 20px;
    transition: padding 380ms cubic-bezier(0.4, 0, 0.2, 1), background-image 1s ease;
}

body.left-panel-open {
    padding-left: calc(var(--left-panel-width) + 20px);
}

body.right-panel-open {
    padding-right: calc(var(--right-panel-width) + 20px);
}

#game-container,
#quiz-screen {
    transition: width 380ms cubic-bezier(0.4, 0, 0.2, 1), max-width 380ms cubic-bezier(0.4, 0, 0.2, 1), padding 380ms cubic-bezier(0.4, 0, 0.2, 1);
}

.rules-panel {
    width: var(--left-panel-width);
    left: calc(-1 * var(--left-panel-width) - 12px);
}

.rules-panel.open {
    left: 0;
}

.rules-toggle-btn.open {
    left: var(--left-panel-width);
}

.hud-right-panel {
    position: fixed;
    top: 0;
    right: calc(-1 * var(--right-panel-width) - 12px);
    width: var(--right-panel-width);
    height: 100%;
    z-index: 1500;
    background: rgba(5, 12, 24, 0.97);
    border-left: 2px solid rgba(255, 215, 0, 0.6);
    box-shadow: -4px 0 28px rgba(255, 215, 0, 0.22);
    transition: right 380ms cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.hud-right-panel.open {
    right: 0;
}

.hud-right-panel-inner {
    height: 100%;
    padding: 20px 14px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hud-right-toggle-btn {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1501;
    width: 28px;
    height: 64px;
    background: rgba(45, 36, 0, 0.92);
    border: 2px solid rgba(255, 215, 0, 0.75);
    border-right: none;
    border-radius: 10px 0 0 10px;
    color: #ffd700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: -3px 0 14px rgba(255, 215, 0, 0.3);
    transition: right 380ms cubic-bezier(0.4, 0, 0.2, 1), background 200ms, color 200ms;
    padding: 0;
    line-height: 1;
}

.hud-right-toggle-btn.open {
    right: var(--right-panel-width);
}

.hud-right-toggle-btn .hud-right-arrow {
    display: inline-block;
    transition: transform 380ms cubic-bezier(0.4, 0, 0.2, 1);
}

.hud-right-toggle-btn.open .hud-right-arrow {
    transform: rotate(180deg);
}

.hud-right-toggle-btn:hover {
    background: rgba(75, 60, 0, 0.95);
    color: #fff8d5;
    box-shadow: -3px 0 20px rgba(255, 215, 0, 0.45);
}

.column-hint-overlay {
    position: fixed;
    inset: 0;
    z-index: 1499;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 260ms ease, visibility 260ms ease;
}

.column-hint-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.column-hint-backdrop {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(8, 15, 24, 0.3) 0%, rgba(3, 7, 14, 0.76) 46%, rgba(0, 0, 0, 0.88) 100%);
    backdrop-filter: blur(4px);
}

.column-hint-close {
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    background: rgba(10, 18, 30, 0.96);
    color: #f6fbff;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.column-hint-close:hover {
    transform: translateX(-50%) scale(1.06);
    background: rgba(19, 30, 48, 0.98);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.42);
}

.column-hint-bubble {
    position: absolute;
    top: 50%;
    z-index: 2;
    width: min(280px, calc(100vw - 92px));
    padding: 18px 18px 16px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(12, 24, 39, 0.98), rgba(6, 13, 24, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.38);
    opacity: 0;
    line-height: 1.45;
}

.column-hint-bubble strong {
    display: block;
    margin-bottom: 8px;
    color: #ffffff;
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
}

.column-hint-bubble p {
    margin: 0;
    color: rgba(233, 241, 250, 0.92);
    font-size: 0.94rem;
}

.column-hint-kicker {
    display: inline-flex;
    margin-bottom: 10px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
}

.column-hint-bubble-left {
    left: 44px;
    transform: translate(-18px, -50%) scale(0.88);
}

.column-hint-bubble-right {
    right: 44px;
    transform: translate(18px, -50%) scale(0.88);
}

.column-hint-bubble-left .column-hint-kicker {
    background: rgba(0, 212, 255, 0.14);
    color: #88ecff;
}

.column-hint-bubble-right .column-hint-kicker {
    background: rgba(255, 215, 0, 0.14);
    color: #ffe37a;
}

.column-hint-bubble::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 18px;
    height: 18px;
    margin-top: -9px;
    background: inherit;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-right: 1px solid rgba(255, 255, 255, 0.12);
}

.column-hint-bubble-left::after {
    left: -9px;
    transform: rotate(-135deg);
}

.column-hint-bubble-right::after {
    right: -9px;
    transform: rotate(45deg);
}

.column-hint-overlay.active .column-hint-bubble-left {
    animation: columnHintBubbleLeft 420ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.column-hint-overlay.active .column-hint-bubble-right {
    animation: columnHintBubbleRight 420ms cubic-bezier(0.22, 1, 0.36, 1) 90ms forwards;
}

body.column-hints-active .rules-toggle-btn,
body.column-hints-active .hud-right-toggle-btn {
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08), 0 0 24px rgba(255, 255, 255, 0.22);
    animation: columnHintArrowPulse 1.25s ease-in-out infinite;
}

body.column-hints-active {
    overflow: hidden;
}

@keyframes columnHintBubbleLeft {
    from {
        opacity: 0;
        transform: translate(-18px, -50%) scale(0.88);
    }
    to {
        opacity: 1;
        transform: translate(0, -50%) scale(1);
    }
}

@keyframes columnHintBubbleRight {
    from {
        opacity: 0;
        transform: translate(18px, -50%) scale(0.88);
    }
    to {
        opacity: 1;
        transform: translate(0, -50%) scale(1);
    }
}

@keyframes columnHintArrowPulse {
    0%,
    100% {
        transform: translateY(-50%) scale(1);
    }
    50% {
        transform: translateY(-50%) scale(1.08);
    }
}

.hud-right-panel .score-panel,
.hud-right-panel .top15-panel,
.hud-right-panel .ranking-hud-btn,
.hud-right-panel .music-player {
    position: static;
    right: auto;
    top: auto;
    bottom: auto;
    width: 100%;
    margin: 0;
}

.hud-right-panel .score-panel {
    height: var(--score-panel-height);
}

.hud-right-panel .top15-panel {
    max-height: none;
    min-height: 220px;
    flex: 1;
}

@media (max-width: 1200px) {
    :root {
        --left-panel-width: min(72vw, 280px);
        --right-panel-width: min(82vw, 324px);
    }

    body.left-panel-open {
        padding-left: calc(var(--left-panel-width) + 16px);
    }

    body.right-panel-open {
        padding-right: calc(var(--right-panel-width) + 16px);
    }
}

@media (max-width: 900px) {
    body {
        padding: 16px 10px;
    }

    body.left-panel-open {
        padding-left: calc(var(--left-panel-width) + 10px);
    }

    body.right-panel-open {
        padding-right: calc(var(--right-panel-width) + 10px);
    }

    #game-container {
        padding: 16px;
    }

    .column-hint-close {
        top: 14px;
    }

    .column-hint-bubble {
        width: min(260px, calc(100vw - 82px));
    }

    .column-hint-bubble-left {
        top: calc(50% - 88px);
    }

    .column-hint-bubble-right {
        top: calc(50% + 88px);
    }
}

/* ── Ajuste final da moldura central: responsiva entre setas ── */
:root {
    --side-arrow-width: 28px;
    --screen-gap-to-arrow: 20px;
}

body {
    min-height: 100vh;
    height: 100vh;
    align-items: stretch;
    justify-content: center;
    padding-top: 20px;
    padding-bottom: 20px;
    padding-left: calc(var(--side-arrow-width) + var(--screen-gap-to-arrow));
    padding-right: calc(var(--side-arrow-width) + var(--screen-gap-to-arrow));
    box-sizing: border-box;
}

body.left-panel-open {
    padding-left: calc(var(--left-panel-width) + var(--side-arrow-width) + var(--screen-gap-to-arrow));
}

body.right-panel-open {
    padding-right: calc(var(--right-panel-width) + var(--side-arrow-width) + var(--screen-gap-to-arrow));
}

#game-container {
    width: 100%;
    max-width: none;
    height: calc(100vh - 40px);
    max-height: calc(100vh - 40px);
    margin: 0 auto;
}

@media (min-width: 1201px) {
    #game-container {
        margin-top: 0;
        height: calc(100vh - 40px);
        max-height: calc(100vh - 40px);
        padding: 20px 24px;
    }
}

@media (max-width: 900px) {
    body {
        padding-top: 12px;
        padding-bottom: 12px;
    }

    #game-container {
        height: calc(100vh - 24px);
        max-height: calc(100vh - 24px);
    }
}

/* ── Correções finais para mobile no fluxo do quiz ── */
@media (max-width: 900px) {
    body {
        min-height: 100dvh;
        height: auto;
        overflow-y: auto;
        overflow-x: hidden;
        align-items: flex-start;
        background-attachment: scroll;
        -webkit-overflow-scrolling: touch;
        padding-left: calc(var(--side-arrow-width) + 10px);
        padding-right: calc(var(--side-arrow-width) + 10px);
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }

    body.left-panel-open,
    body.right-panel-open {
        padding-left: calc(var(--side-arrow-width) + 10px);
        padding-right: calc(var(--side-arrow-width) + 10px);
    }

    #game-container {
        height: auto;
        min-height: calc(100dvh - 24px);
        max-height: none;
        overflow: visible;
        padding: 14px;
    }

    #start-screen,
    #portal-screen,
    #quiz-screen {
        height: auto;
        max-height: none;
        min-height: 0;
        overflow: visible;
    }

    #quiz-screen,
    #quiz-screen.is-drag-question,
    #quiz-screen.is-drag-question.drag-feedback-visible,
    #quiz-screen:not(.is-drag-question) {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        overflow: visible;
        padding-right: 0;
        padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
    }

    #era-tag {
        margin-bottom: 4px !important;
    }

    #q-txt,
    #quiz-screen.is-drag-question #q-txt,
    #quiz-screen:not(.is-drag-question) #q-txt {
        font-size: clamp(1rem, 4.8vw, 1.2rem) !important;
        line-height: 1.45 !important;
        margin-bottom: 4px !important;
    }

    #opts,
    #quiz-screen:not(.is-drag-question) #opts {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    #opts .opt-btn,
    .multi-opt {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box !important;
    }

    .multi-opt {
        align-items: flex-start;
    }

    .multi-opt span {
        flex: 1;
        min-width: 0;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    #drag-drop-container,
    #quiz-screen.is-drag-question #drag-drop-container {
        width: 100%;
    }

    .drag-pool,
    .drop-zones,
    #quiz-screen.is-drag-question .drag-pool,
    #quiz-screen.is-drag-question .drop-zones {
        grid-template-columns: 1fr !important;
    }

    #fb-area,
    #quiz-screen.is-drag-question #fb-area,
    #quiz-screen:not(.is-drag-question) #fb-area {
        max-height: none;
        overflow: visible;
        font-size: 1rem !important;
        line-height: 1.5;
        margin-top: 8px !important;
        margin-bottom: 6px !important;
        padding-bottom: 4px;
    }

    #quiz-screen #fb-area.has-feedback,
    #quiz-screen.is-drag-question #fb-area.has-feedback {
        margin-top: 12px !important;
        margin-bottom: 6px !important;
    }

    #val-btn,
    #next-btn,
    #quiz-screen.is-drag-question #val-btn,
    #quiz-screen.is-drag-question #next-btn,
    #quiz-screen:not(.is-drag-question) #val-btn,
    #quiz-screen:not(.is-drag-question) #next-btn {
        position: sticky;
        bottom: calc(8px + env(safe-area-inset-bottom, 0px));
        z-index: 30;
        width: 100%;
        margin-top: 10px !important;
        margin-bottom: 0 !important;
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.34), 0 0 0 1px rgba(0, 229, 255, 0.16);
    }

    .question-counter {
        position: static;
        align-self: flex-end;
        margin-top: 2px;
    }
}

@media (max-width: 480px) {
    body {
        padding-left: calc(var(--side-arrow-width) + 8px);
        padding-right: calc(var(--side-arrow-width) + 8px);
    }

    body.left-panel-open,
    body.right-panel-open {
        padding-left: calc(var(--side-arrow-width) + 8px);
        padding-right: calc(var(--side-arrow-width) + 8px);
    }

    #game-container {
        padding: 12px;
        border-radius: 14px;
    }

    #val-btn,
    #next-btn {
        padding: 16px 14px !important;
        font-size: 1rem !important;
        letter-spacing: 1px !important;
    }
}

@media (max-width: 380px) {
    #opts {
        gap: 8px !important;
    }

    #opts .opt-btn,
    .multi-opt {
        padding: 12px 10px !important;
        border-width: 1px !important;
        border-radius: 10px !important;
        font-size: 0.96rem !important;
        line-height: 1.35;
    }

    .multi-opt {
        gap: 10px !important;
    }

    .multi-opt input[type="checkbox"] {
        width: 18px;
        height: 18px;
    }
}

/* ── Painéis laterais: refinamento mobile (score, top-15 e como jogar) ── */
@media (max-width: 900px) {
    .hud-right-panel {
        width: min(92vw, 340px);
    }

    .hud-right-panel-inner {
        padding: 14px 10px;
        gap: 10px;
    }

    .hud-right-panel .score-panel,
    .score-panel {
        width: 100%;
        height: auto;
        min-height: 172px;
        padding: 12px 10px;
        border-width: 2px;
        box-sizing: border-box;
    }

    .score-display {
        gap: 4px;
    }

    .score-meta {
        gap: 6px;
        justify-content: center;
        flex-wrap: wrap;
    }

    .score-player {
        max-width: 170px;
        font-size: 0.9rem;
    }

    .score-label {
        font-size: 0.78rem;
    }

    .score-value {
        font-size: clamp(1.5rem, 6.3vw, 1.9rem);
    }

    .timer-display {
        font-size: 0.78rem;
    }

    .total-time-display {
        font-size: 0.72rem;
    }

    .q-timer-display {
        font-size: clamp(1.2rem, 5.2vw, 1.55rem);
        gap: 7px;
        padding: 5px 9px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .hud-right-panel .top15-panel,
    .top15-panel {
        width: 100%;
        min-height: 0;
        max-height: min(42dvh, 340px);
        padding: 8px 8px 10px;
        box-sizing: border-box;
    }

    .hud-right-panel .ranking-hud-btn,
    .ranking-hud-btn {
        width: 100%;
        max-width: 100%;
        min-height: 46px;
        margin: 0;
        padding: 10px 8px;
        font-size: 0.82rem;
        letter-spacing: 0.45px;
        line-height: 1.2;
        border-radius: 10px;
        box-sizing: border-box;
        white-space: normal;
    }

    .hud-right-panel .music-player,
    .music-player {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        padding: 9px 8px;
        gap: 6px;
        border-width: 2px;
        border-radius: 10px;
        box-sizing: border-box;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "label toggle"
            "volume volume";
    }

    .music-label {
        font-size: 0.72rem;
        letter-spacing: 0.6px;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .music-toggle-btn {
        font-size: 0.68rem;
        padding: 5px 8px;
        min-width: 94px;
        justify-self: end;
    }

    .music-volume {
        width: 100%;
        min-width: 0;
        height: 28px;
        padding: 6px 0;
        -webkit-appearance: none;
        appearance: none;
        touch-action: pan-y;
    }

    .music-volume::-webkit-slider-runnable-track {
        height: 6px;
    }

    .music-volume::-webkit-slider-thumb {
        width: 20px;
        height: 20px;
        margin-top: -7px;
    }

    .music-volume::-moz-range-track {
        height: 6px;
    }

    .music-volume::-moz-range-thumb {
        width: 20px;
        height: 20px;
    }

    .top15-title {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }

    .top15-head,
    .top15-row {
        grid-template-columns: 20px minmax(0, 1fr) 64px 52px;
        gap: 6px;
        width: 100%;
        min-width: 0;
    }

    .top15-head {
        font-size: 0.68rem;
        padding: 5px 2px;
    }

    .top15-row {
        padding: 7px 2px;
        font-size: 0.76rem;
    }

    .top15-name {
        min-width: 0;
        font-size: 0.74rem;
    }

    .top15-score,
    .top15-time {
        font-size: 0.74rem;
    }

    .rules-panel {
        width: min(92vw, 340px);
        left: calc(-1 * min(92vw, 340px) - 12px);
    }

    .rules-toggle-btn.open {
        left: min(92vw, 340px);
    }

    .rules-panel-inner {
        padding: 18px 12px 14px;
        gap: 10px;
    }

    .rules-panel-title {
        font-size: 0.9rem;
        letter-spacing: 1.2px;
    }

    .rules-list {
        gap: 8px;
    }

    .rules-list li {
        font-size: 0.74rem;
        line-height: 1.4;
        padding-left: 8px;
    }

    .rules-panel-footer {
        font-size: 0.68rem;
        line-height: 1.55;
        padding-top: 12px;
    }
}

@media (max-width: 480px) {
    .hud-right-panel {
        width: min(94vw, 320px);
    }

    .hud-right-panel .score-panel,
    .score-panel {
        min-height: 162px;
        padding: 10px 8px;
    }

    .top15-head,
    .top15-row {
        grid-template-columns: 18px minmax(0, 1fr) 56px 48px;
        gap: 5px;
    }

    .top15-head {
        font-size: 0.64rem;
    }

    .top15-row,
    .top15-name,
    .top15-score,
    .top15-time {
        font-size: 0.7rem;
    }

    .rules-panel {
        width: min(94vw, 320px);
        left: calc(-1 * min(94vw, 320px) - 10px);
    }

    .hud-right-panel .ranking-hud-btn,
    .ranking-hud-btn {
        min-height: 44px;
        padding: 9px 7px;
        font-size: 0.76rem;
        letter-spacing: 0.35px;
    }

    .rules-toggle-btn.open {
        left: min(94vw, 320px);
    }

    .rules-panel-inner {
        padding: 16px 10px 12px;
    }

    .rules-list li {
        font-size: 0.7rem;
    }

    .hud-right-panel .music-player,
    .music-player {
        padding: 8px 7px;
        gap: 5px;
    }

    .music-label {
        font-size: 0.68rem;
    }

    .music-toggle-btn {
        font-size: 0.64rem;
        min-width: 86px;
        padding: 5px 7px;
    }

    .music-volume {
        height: 30px;
        padding: 7px 0;
    }
}

/* ── Tema/modalidade: responsivo + neon ── */
#era-tag,
#main-title {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 0 12px 0 !important;
    padding: clamp(10px, 1.4vw, 16px) clamp(12px, 2vw, 24px) !important;
    border-radius: 10px !important;
    border: 2px solid var(--primary) !important;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0.32)) !important;
    box-shadow: 0 0 14px color-mix(in srgb, var(--primary) 60%, transparent), inset 0 0 16px color-mix(in srgb, var(--primary) 28%, transparent) !important;
    color: #f8feff !important;
    text-align: center !important;
    font-family: var(--font-title) !important;
    font-size: clamp(1rem, 1.15vw, 1.35rem) !important;
    letter-spacing: 1.4px !important;
    text-transform: uppercase;
    line-height: 1.3;
    white-space: normal;
}

@media (max-width: 820px) {
    #era-tag,
    #main-title {
        font-size: clamp(0.92rem, 3.2vw, 1.12rem) !important;
        letter-spacing: 0.9px !important;
    }
}

/* ── FROGGER BONUS ─────────────────────────────────────────────────────────── */

.frogger-bonus-container {
    background: rgba(0, 12, 4, 0.95);
    border: 2px solid #22c55e;
    border-radius: 22px;
    padding: 20px 24px 18px;
    width: min(92vw, 580px);
    max-height: 96vh;
    overflow-y: auto;
    box-shadow: 0 0 40px rgba(34, 197, 94, 0.55), inset 0 0 30px rgba(0, 60, 20, 0.3);
    text-align: center;
}

.frogger-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    color: #22c55e;
    text-shadow: 0 0 18px rgba(34, 197, 94, 0.9);
    margin: 0 0 6px;
}

.frogger-subtitle {
    color: #bbf7d0;
    font-size: 0.92rem;
    margin: 0 0 10px;
}

.frogger-subtitle strong {
    color: #22c55e;
}

.frogger-hud {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    color: #22c55e;
    font-size: 1rem;
}

.frogger-board-wrap {
    border-radius: 14px;
    border: 2px solid rgba(34, 197, 94, 0.4);
    padding: 6px;
    background: #000;
    box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.8);
}

#frogger-canvas {
    display: block;
    width: min(88vw, 500px);
    max-width: 500px;
    aspect-ratio: 1 / 1;
    height: auto;
    margin: 0 auto;
    border-radius: 10px;
    background: #000;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
}

.frogger-actions {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.frogger-controls {
    margin: 0;
    color: rgba(34, 197, 94, 0.6);
    font-size: 0.78rem;
}

@media (max-width: 700px) {
    .frogger-hud {
        font-size: 0.78rem;
    }

    .frogger-subtitle {
        font-size: 0.82rem;
    }

    .frogger-bonus-container {
        padding: 12px 10px;
    }

    #frogger-canvas {
        width: min(90vw, 400px);
        max-width: 400px;
    }
}

/* ── TETRIS BONUS ──────────────────────────────────────────────────────────── */

.tetris-bonus-container {
    background: rgba(7, 14, 35, 0.95);
    border: 2px solid #60a5fa;
    border-radius: 22px;
    padding: 18px 20px 16px;
    width: min(94vw, 640px);
    max-height: 96vh;
    overflow-y: auto;
    box-shadow: 0 0 40px rgba(59, 130, 246, 0.45), inset 0 0 28px rgba(12, 36, 90, 0.35);
    text-align: center;
}

.tetris-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    color: #93c5fd;
    text-shadow: 0 0 18px rgba(96, 165, 250, 0.9);
    margin: 0 0 6px;
}

.tetris-subtitle {
    color: #dbeafe;
    font-size: 0.9rem;
    margin: 0 0 10px;
}

.tetris-subtitle strong {
    color: #60a5fa;
}

.tetris-hud {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    color: #93c5fd;
    font-size: 0.95rem;
}

.tetris-board-wrap {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 10px;
    border-radius: 14px;
    border: 2px solid rgba(96, 165, 250, 0.4);
    padding: 8px;
    background: #020617;
    box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.8);
}

#tetris-canvas,
#tetris-next-canvas {
    display: block;
    background: #000;
    border-radius: 8px;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
}

#tetris-canvas {
    width: min(52vw, 300px);
    max-width: 300px;
    height: auto;
    aspect-ratio: 1 / 2;
}

#tetris-next-canvas {
    width: min(24vw, 120px);
    max-width: 120px;
    height: auto;
    aspect-ratio: 1 / 1;
}

.tetris-actions {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.tetris-controls {
    margin: 0;
    color: rgba(147, 197, 253, 0.7);
    font-size: 0.78rem;
}

@media (max-width: 700px) {
    .tetris-hud {
        font-size: 0.74rem;
        gap: 6px;
    }

    .tetris-subtitle {
        font-size: 0.8rem;
    }

    .tetris-bonus-container {
        padding: 12px 10px;
    }

    .tetris-board-wrap {
        gap: 6px;
        padding: 6px;
    }

    #tetris-canvas {
        width: min(60vw, 240px);
        max-width: 240px;
    }

    #tetris-next-canvas {
        width: min(24vw, 92px);
        max-width: 92px;
    }
}

/* ── 2048 BONUS ───────────────────────────────────────────────────────────── */

.game2048-bonus-container {
    background: linear-gradient(155deg, #23110a, #3d1f13);
    border: 2px solid #fb923c;
    border-radius: 22px;
    padding: 18px 20px 16px;
    width: min(92vw, 560px);
    max-height: 96vh;
    overflow-y: auto;
    box-shadow: 0 0 36px rgba(249, 115, 22, 0.42), inset 0 0 26px rgba(120, 53, 15, 0.34);
    text-align: center;
}

.game2048-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    color: #fdba74;
    text-shadow: 0 0 18px rgba(251, 146, 60, 0.85);
    margin: 0 0 6px;
}

.game2048-subtitle {
    color: #ffedd5;
    font-size: 0.9rem;
    margin: 0 0 10px;
}

.game2048-subtitle strong {
    color: #fb923c;
}

.game2048-hud {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    color: #fdba74;
    font-size: 0.95rem;
}

.game2048-board-wrap {
    border-radius: 14px;
    border: 2px solid rgba(251, 146, 60, 0.35);
    padding: 10px;
    background: rgba(0, 0, 0, 0.35);
    box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.75);
}

#game2048-board {
    display: grid;
    grid-template-columns: repeat(4, minmax(60px, 92px));
    grid-template-rows: repeat(4, minmax(60px, 92px));
    justify-content: center;
    gap: 8px;
}

.game2048-cell {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Orbitron', sans-serif;
    font-weight: 800;
    font-size: 1.25rem;
    background: rgba(255, 237, 213, 0.12);
    color: #fff7ed;
    border: 1px solid rgba(255, 237, 213, 0.12);
    transition: transform 0.14s ease, background 0.14s ease, color 0.14s ease;
}

.game2048-cell.is-empty {
    color: transparent;
    background: rgba(255, 237, 213, 0.09);
}

.game2048-actions {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.game2048-controls {
    margin: 0;
    color: rgba(255, 237, 213, 0.7);
    font-size: 0.78rem;
}

@media (max-width: 700px) {
    .game2048-hud {
        font-size: 0.76rem;
        gap: 6px;
    }

    .game2048-subtitle {
        font-size: 0.8rem;
    }

    .game2048-bonus-container {
        padding: 12px 10px;
    }

    #game2048-board {
        grid-template-columns: repeat(4, minmax(52px, 72px));
        grid-template-rows: repeat(4, minmax(52px, 72px));
        gap: 6px;
    }

    .game2048-cell {
        font-size: 1rem;
    }
}

/* ── FLAPPY BIRD BONUS ───────────────────────────────────────────────────── */

.flappybird-bonus-container {
    background:
        radial-gradient(circle at top, rgba(125, 211, 252, 0.18), transparent 38%),
        linear-gradient(180deg, #082f49 0%, #0c4a6e 54%, #0f766e 100%);
    border: 2px solid #7dd3fc;
    border-radius: 22px;
    padding: 18px 20px 16px;
    width: min(92vw, 560px);
    max-height: min(96dvh, 820px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 38px rgba(56, 189, 248, 0.42), inset 0 0 26px rgba(8, 47, 73, 0.42);
    text-align: center;
}

.flappybird-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    color: #e0f2fe;
    text-shadow: 0 0 18px rgba(125, 211, 252, 0.92);
    margin: 0 0 6px;
}

.flappybird-subtitle {
    color: #e0f2fe;
    font-size: 0.9rem;
    margin: 0 0 10px;
}

.flappybird-subtitle strong {
    color: #7dd3fc;
}

.flappybird-hud {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    color: #e0f2fe;
    font-size: 0.95rem;
}

.flappybird-board-wrap {
    border-radius: 14px;
    border: 2px solid rgba(125, 211, 252, 0.35);
    padding: 8px;
    margin-top: 2px;
    background: rgba(2, 6, 23, 0.5);
    box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.7);
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#flappybird-canvas {
    display: block;
    width: auto;
    max-width: 420px;
    height: min(58dvh, 640px);
    max-height: 100%;
    aspect-ratio: 21 / 32;
    margin: 0 auto;
    border-radius: 10px;
    background: linear-gradient(180deg, #38bdf8 0%, #7dd3fc 40%, #67e8f9 100%);
}

.flappybird-actions {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.flappybird-controls {
    margin: 0;
    color: rgba(224, 242, 254, 0.8);
    font-size: 0.78rem;
}

@media (max-width: 700px) {
    .flappybird-hud {
        font-size: 0.76rem;
        gap: 6px;
    }

    .flappybird-subtitle {
        font-size: 0.8rem;
    }

    .flappybird-bonus-container {
        padding: 12px 10px;
        max-height: 96dvh;
    }

    #flappybird-canvas {
        width: auto;
        max-width: 360px;
        height: min(52dvh, 520px);
    }
}

/* ── ARKANOID BONUS ──────────────────────────────────────────────────────── */

.arkanoid-bonus-container {
    background:
        radial-gradient(circle at top, rgba(147, 197, 253, 0.2), transparent 40%),
        linear-gradient(180deg, #0f172a 0%, #1e1b4b 52%, #0f172a 100%);
    border: 2px solid #93c5fd;
    border-radius: 22px;
    padding: 18px 20px 16px;
    width: min(94vw, 760px);
    max-height: 96vh;
    overflow-y: auto;
    box-shadow: 0 0 40px rgba(59, 130, 246, 0.42), inset 0 0 28px rgba(30, 27, 75, 0.4);
    text-align: center;
}

.arkanoid-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    color: #dbeafe;
    text-shadow: 0 0 18px rgba(147, 197, 253, 0.9);
    margin: 0 0 6px;
}

.arkanoid-subtitle {
    color: #dbeafe;
    font-size: 0.9rem;
    margin: 0 0 10px;
}

.arkanoid-subtitle strong {
    color: #93c5fd;
}

.arkanoid-hud {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    color: #dbeafe;
    font-size: 0.95rem;
}

.arkanoid-board-wrap {
    border-radius: 14px;
    border: 2px solid rgba(147, 197, 253, 0.38);
    padding: 8px;
    background: rgba(2, 6, 23, 0.62);
    box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.72);
}

#arkanoid-canvas {
    display: block;
    width: min(90vw, 640px);
    max-width: 640px;
    aspect-ratio: 64 / 42;
    height: auto;
    margin: 0 auto;
    border-radius: 10px;
    background: linear-gradient(180deg, #1d4ed8 0%, #1e293b 75%);
}

.arkanoid-actions {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.arkanoid-controls {
    margin: 0;
    color: rgba(219, 234, 254, 0.82);
    font-size: 0.78rem;
}

@media (max-width: 700px) {
    .arkanoid-hud {
        font-size: 0.74rem;
        gap: 6px;
    }

    .arkanoid-subtitle {
        font-size: 0.8rem;
    }

    .arkanoid-bonus-container {
        padding: 12px 10px;
    }

    #arkanoid-canvas {
        width: min(90vw, 520px);
        max-width: 520px;
    }
}

/* ── ASTEROIDS BONUS ─────────────────────────────────────────────────────── */

.asteroids-bonus-container {
    background:
        radial-gradient(circle at top, rgba(103, 232, 249, 0.2), transparent 36%),
        linear-gradient(180deg, #020617 0%, #0f172a 56%, #111827 100%);
    border: 2px solid #67e8f9;
    border-radius: 22px;
    padding: 18px 20px 16px;
    width: min(92vw, 700px);
    max-height: 96vh;
    overflow-y: auto;
    box-shadow: 0 0 42px rgba(6, 182, 212, 0.3), inset 0 0 30px rgba(15, 23, 42, 0.55);
    text-align: center;
}

.asteroids-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    color: #cffafe;
    text-shadow: 0 0 18px rgba(103, 232, 249, 0.84);
    margin: 0 0 6px;
}

.asteroids-subtitle {
    color: #cffafe;
    font-size: 0.9rem;
    margin: 0 0 10px;
}

.asteroids-subtitle strong {
    color: #67e8f9;
}

.asteroids-hud {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    color: #cffafe;
    font-size: 0.95rem;
}

.asteroids-board-wrap {
    border-radius: 14px;
    border: 2px solid rgba(103, 232, 249, 0.35);
    padding: 8px;
    background: rgba(2, 6, 23, 0.72);
    box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.74);
}

#asteroids-canvas {
    display: block;
    width: min(88vw, 560px);
    max-width: 560px;
    aspect-ratio: 1 / 1;
    height: auto;
    margin: 0 auto;
    border-radius: 10px;
    background: radial-gradient(circle at 50% 30%, #0b1220, #020617 70%);
}

.asteroids-actions {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.asteroids-controls {
    margin: 0;
    color: rgba(207, 250, 254, 0.82);
    font-size: 0.78rem;
}

@media (max-width: 700px) {
    .asteroids-hud {
        font-size: 0.74rem;
        gap: 6px;
    }

    .asteroids-subtitle {
        font-size: 0.8rem;
    }

    .asteroids-bonus-container {
        padding: 12px 10px;
    }

    #asteroids-canvas {
        width: min(90vw, 460px);
        max-width: 460px;
    }
}

/* ── MINESWEEPER BONUS ──────────────────────────────────────────────────── */

.minesweeper-bonus-container {
    background:
        radial-gradient(circle at top, rgba(110, 231, 183, 0.18), transparent 35%),
        linear-gradient(180deg, #052e2b 0%, #0a1f1b 55%, #111827 100%);
    border: 2px solid #6ee7b7;
    border-radius: 22px;
    padding: 18px 20px 16px;
    width: min(92vw, 700px);
    max-height: 96vh;
    overflow-y: auto;
    box-shadow: 0 0 42px rgba(16, 185, 129, 0.3), inset 0 0 30px rgba(4, 120, 87, 0.2);
    text-align: center;
}

.minesweeper-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    color: #ecfdf5;
    text-shadow: 0 0 18px rgba(110, 231, 183, 0.75);
    margin: 0 0 6px;
}

.minesweeper-subtitle {
    color: #d1fae5;
    font-size: 0.9rem;
    margin: 0 0 10px;
}

.minesweeper-subtitle strong {
    color: #6ee7b7;
}

.minesweeper-hud {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    color: #ecfdf5;
    font-size: 0.95rem;
}

.minesweeper-board-wrap {
    border-radius: 14px;
    border: 2px solid rgba(110, 231, 183, 0.35);
    padding: 10px;
    background: rgba(6, 20, 17, 0.72);
    box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.65);
}

#minesweeper-board {
    width: min(88vw, 560px);
    max-width: 560px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
}

.minesweeper-cell {
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    border: 1px solid rgba(110, 231, 183, 0.22);
    background: linear-gradient(145deg, #1f2937, #111827);
    color: #ecfdf5;
    font-family: 'Orbitron', sans-serif;
    font-weight: 800;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
}

.minesweeper-cell:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 10px rgba(110, 231, 183, 0.22);
}

.minesweeper-cell.revealed {
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border-color: rgba(148, 163, 184, 0.28);
}

.minesweeper-cell.flagged {
    color: #facc15;
    border-color: rgba(250, 204, 21, 0.4);
}

.minesweeper-cell.mine {
    background: linear-gradient(145deg, #7f1d1d, #450a0a);
    border-color: rgba(248, 113, 113, 0.52);
    color: #fee2e2;
}

.minesweeper-cell[data-neighbors="1"] { color: #93c5fd; }
.minesweeper-cell[data-neighbors="2"] { color: #86efac; }
.minesweeper-cell[data-neighbors="3"] { color: #fca5a5; }
.minesweeper-cell[data-neighbors="4"] { color: #c4b5fd; }
.minesweeper-cell[data-neighbors="5"] { color: #fda4af; }
.minesweeper-cell[data-neighbors="6"] { color: #67e8f9; }
.minesweeper-cell[data-neighbors="7"] { color: #fde68a; }
.minesweeper-cell[data-neighbors="8"] { color: #d8b4fe; }

.minesweeper-actions {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.minesweeper-controls {
    margin: 0;
    color: rgba(209, 250, 229, 0.86);
    font-size: 0.78rem;
}

@media (max-width: 700px) {
    .minesweeper-hud {
        font-size: 0.74rem;
        gap: 6px;
    }

    .minesweeper-subtitle {
        font-size: 0.8rem;
    }

    .minesweeper-bonus-container {
        padding: 12px 10px;
    }

    #minesweeper-board {
        width: min(90vw, 460px);
        max-width: 460px;
        gap: 5px;
    }
}
