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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0a0e27;
    color: #fff;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    user-select: none;
    -webkit-user-select: none;
}

.screen {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    width: 100vw;
    padding: 20px;
    position: absolute;
    top: 0;
    left: 0;
}

.screen.active {
    display: flex;
}

/* Menu */
#screen-menu {
    background: radial-gradient(ellipse at center, #1a1a4e 0%, #0a0e27 70%);
}

.title {
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 900;
    background: linear-gradient(135deg, #ff6b35, #ffd700, #ff6b35);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s ease infinite;
    margin-bottom: 8px;
}

@keyframes shimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.subtitle {
    font-size: clamp(1rem, 3vw, 1.5rem);
    color: #8892b0;
    margin-bottom: 40px;
}

.btn {
    font-size: clamp(1.1rem, 3vw, 1.4rem);
    font-weight: 700;
    padding: 16px 48px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    margin: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
    min-width: 220px;
    touch-action: manipulation;
}

.btn:hover {
    transform: scale(1.05);
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: linear-gradient(135deg, #ff6b35, #ff8c42);
    color: #fff;
    box-shadow: 0 4px 20px rgba(255, 107, 53, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ccd6f6;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

/* Como Jogar */
#screen-how {
    background: radial-gradient(ellipse at center, #1a1a4e 0%, #0a0e27 70%);
}

#screen-how h2 {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    margin-bottom: 30px;
    color: #ffd700;
}

.how-content {
    max-width: 500px;
    text-align: left;
}

.how-content p {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    margin-bottom: 16px;
    line-height: 1.6;
}

/* Tela do Jogo */
#screen-game {
    padding: 0;
    flex-direction: column;
    background: #0a0e27;
}

#game-hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.5);
    width: 100%;
    font-size: clamp(0.9rem, 2.5vw, 1.2rem);
    z-index: 10;
    position: relative;
}

.hud-item {
    font-weight: 700;
}

.hud-streak {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #ff6b35, #ffd700);
    padding: 6px 24px;
    border-radius: 0 0 16px 16px;
    font-weight: 900;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    animation: pulse 0.6s ease infinite alternate;
    z-index: 11;
}

@keyframes pulse {
    from { transform: translateX(-50%) scale(1); }
    to { transform: translateX(-50%) scale(1.1); }
}

.hidden {
    display: none !important;
}

#game-canvas {
    flex: 1;
    width: 100%;
    display: block;
}

#game-question {
    padding: 20px;
    width: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
}

#question-text {
    text-align: center;
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    font-weight: 900;
    margin-bottom: 16px;
    letter-spacing: 2px;
}

#question-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    max-width: 500px;
    margin: 0 auto;
}

.option-btn {
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    font-weight: 800;
    padding: 16px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    cursor: pointer;
    transition: all 0.15s;
    touch-action: manipulation;
}

.option-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
}

.option-btn:active {
    transform: scale(0.95);
}

.option-btn.correct {
    background: rgba(76, 175, 80, 0.6);
    border-color: #4caf50;
    animation: pop 0.3s ease;
}

.option-btn.wrong {
    background: rgba(244, 67, 54, 0.6);
    border-color: #f44336;
    animation: shake 0.4s ease;
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

#game-feedback {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: clamp(2rem, 8vw, 4rem);
    font-weight: 900;
    z-index: 100;
    pointer-events: none;
    text-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
    animation: feedbackPop 0.6s ease forwards;
}

@keyframes feedbackPop {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1) translateY(-40px); }
}

/* Tela Final */
#screen-end {
    background: radial-gradient(ellipse at center, #1a1a4e 0%, #0a0e27 70%);
    text-align: center;
}

#screen-end h2 {
    font-size: clamp(2rem, 6vw, 3rem);
    margin-bottom: 16px;
}

#end-message {
    font-size: clamp(1rem, 3vw, 1.3rem);
    color: #8892b0;
    margin-bottom: 24px;
}

#end-stats {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    margin-bottom: 32px;
    line-height: 2;
}

/* Stars background via CSS */
.menu-stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.menu-stars::before,
.menu-stars::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: #fff;
    box-shadow:
        25vw 10vh 0 0 rgba(255,255,255,0.8),
        50vw 20vh 0 0 rgba(255,255,255,0.6),
        75vw 15vh 0 0 rgba(255,255,255,0.7),
        10vw 40vh 0 0 rgba(255,255,255,0.5),
        30vw 60vh 0 0 rgba(255,255,255,0.9),
        60vw 45vh 0 0 rgba(255,255,255,0.4),
        80vw 70vh 0 0 rgba(255,255,255,0.8),
        15vw 80vh 0 0 rgba(255,255,255,0.6),
        45vw 85vh 0 0 rgba(255,255,255,0.7),
        90vw 30vh 0 0 rgba(255,255,255,0.5),
        5vw 55vh 0 0 rgba(255,255,255,0.8),
        70vw 90vh 0 0 rgba(255,255,255,0.6),
        35vw 35vh 0 0 rgba(255,255,255,0.9),
        85vw 55vh 0 0 rgba(255,255,255,0.4),
        55vw 75vh 0 0 rgba(255,255,255,0.7);
    animation: twinkle 4s ease-in-out infinite alternate;
}

.menu-stars::after {
    width: 1px;
    height: 1px;
    box-shadow:
        20vw 25vh 0 0 rgba(255,255,255,0.5),
        40vw 50vh 0 0 rgba(255,255,255,0.7),
        65vw 30vh 0 0 rgba(255,255,255,0.4),
        85vw 80vh 0 0 rgba(255,255,255,0.6),
        12vw 65vh 0 0 rgba(255,255,255,0.8),
        55vw 10vh 0 0 rgba(255,255,255,0.5),
        78vw 45vh 0 0 rgba(255,255,255,0.7),
        33vw 90vh 0 0 rgba(255,255,255,0.4);
    animation-delay: 2s;
}

@keyframes twinkle {
    from { opacity: 0.6; }
    to { opacity: 1; }
}
