* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --neon-blue: #00d4ff;
    --neon-green: #00ff88;
    --neon-red: #ff4466;
    --neon-yellow: #ffcc00;
    --bg-dark: #050a18;
    --bg-panel: rgba(0, 10, 40, 0.85);
}

body {
    background: var(--bg-dark);
    overflow: hidden;
    font-family: 'Inter', sans-serif;
    width: 100vw;
    height: 100vh;
}

/* ===== CANVAS ===== */
#game-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1;
}

#webcam {
    display: none;
}

#camera-preview {
    position: fixed;
    bottom: 16px;
    right: 16px;
    width: 220px;
    height: 140px;
    border: 2px solid var(--neon-blue);
    border-radius: 10px;
    z-index: 10;
    opacity: 0.8;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
    display: none;
}

/* ===== HUD ===== */
#hud {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 10;
    background: linear-gradient(to bottom, rgba(5,10,24,0.95), transparent);
    pointer-events: none;
}

#score-box, #score-meta-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 110px;
}

.hud-meta {
    font-family: 'Orbitron', monospace;
    font-size: 14px;
    font-weight: 700;
    color: rgba(255,255,255,0.6);
}

.hud-label {
    font-family: 'Orbitron', monospace;
    font-size: 11px;
    letter-spacing: 2px;
    color: var(--neon-blue);
    opacity: 0.8;
}

#score-value {
    font-family: 'Orbitron', monospace;
    font-size: 32px;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 20px var(--neon-blue), 0 0 40px var(--neon-blue);
    transition: transform 0.15s;
}

#score-value.bump {
    transform: scale(1.3);
}

#question-box {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

#question-text {
    font-family: 'Orbitron', monospace;
    font-size: clamp(28px, 5vw, 52px);
    font-weight: 900;
    color: #fff;
    text-shadow:
        0 0 10px var(--neon-yellow),
        0 0 30px var(--neon-yellow),
        0 0 60px rgba(255, 200, 0, 0.4);
    animation: questionPulse 2s ease-in-out infinite;
    letter-spacing: 4px;
}

@keyframes questionPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

#lives-display {
    display: flex;
    gap: 6px;
    font-size: 24px;
}

/* ===== TELAS DE INÍCIO / GAME OVER ===== */
#start-screen, #gameover-screen {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, rgba(0, 50, 120, 0.7) 0%, rgba(5, 10, 24, 0.95) 70%);
    backdrop-filter: blur(6px);
}

#gameover-screen {
    display: none;
}

.screen-content {
    text-align: center;
    max-width: 560px;
    padding: 48px 32px;
    background: rgba(0, 10, 40, 0.8);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 24px;
    box-shadow:
        0 0 60px rgba(0, 212, 255, 0.15),
        inset 0 0 40px rgba(0, 0, 0, 0.5);
}

.logo {
    font-size: 64px;
    margin-bottom: 16px;
    animation: floatLogo 3s ease-in-out infinite;
}

@keyframes floatLogo {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

.screen-content h1 {
    font-family: 'Orbitron', monospace;
    font-size: clamp(32px, 6vw, 52px);
    font-weight: 900;
    color: #fff;
    margin-bottom: 16px;
    line-height: 1.1;
    text-shadow: 0 0 30px var(--neon-blue);
}

.screen-content h1 span {
    color: var(--neon-yellow);
    text-shadow: 0 0 30px var(--neon-yellow);
}

.screen-content p {
    color: rgba(255,255,255,0.75);
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 24px;
}

.screen-content p strong {
    color: var(--neon-green);
}

#camera-status {
    font-size: 14px;
    color: var(--neon-blue);
    margin-bottom: 20px;
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

#options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 28px;
}

.toggle-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    cursor: pointer;
}

.toggle-label input[type="checkbox"] {
    width: 18px; height: 18px;
    accent-color: var(--neon-blue);
}

.toggle-label input[type="range"] {
    accent-color: var(--neon-yellow);
    width: 120px;
}

button {
    padding: 16px 48px;
    font-family: 'Orbitron', monospace;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #000;
    background: linear-gradient(135deg, var(--neon-blue), #0070ff);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.5);
}

button:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 0 50px rgba(0, 212, 255, 0.8);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #333;
    box-shadow: none;
    color: #999;
}

#final-score-text {
    font-family: 'Orbitron', monospace;
    font-size: 22px;
    color: var(--neon-yellow);
    margin-bottom: 24px;
    text-shadow: 0 0 20px var(--neon-yellow);
}
