* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100vh;
    width: 100vw;
    max-width: 100vw;
    overflow: hidden;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #001f3f;
    font-family: 'Arial', sans-serif;
    color: white;
    touch-action: manipulation;
}

/* Container principal com proporção fixa 9:16 */
#game-container {
    position: relative;
    width: 90vw;
    max-width: 720px;
    aspect-ratio: 9 / 16;
    background: #001f3f;
    overflow: hidden;
    border-radius: 20px;
    box-shadow: 0 0 50px rgba(0,0,0,0.8);
}

.tela, .popup {
    position: absolute;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    align-items: center;
    border-radius: 20px;
}

.tela.ativa {
    display: flex;
}

/* TELA INICIAL */
#tela-inicial {
    justify-content: center;
}

.container-inicial {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.logo-flutuante {
    width: 100%;
    max-width: 400px;
    animation: flutuar 4s ease-in-out infinite;
    margin-bottom: 60px;
}

@keyframes flutuar {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-30px); }
}

.botao-grande {
    padding: 18px 30px;
    font-size: 25px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
    transition: all 0.3s ease;
    min-width: 200px;
}

.botao-grande:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 15px 30px rgba(0, 123, 255, 0.5);
    background: #0056b3;
}

.botao-grande:active {
    transform: translateY(2px) scale(0.98);
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
    background: #004085;
}

@media (hover: none) {
    .botao-grande:active {
        transform: translateY(-4px) scale(1.05);
        box-shadow: 0 15px 30px rgba(0, 123, 255, 0.5);
        background: #0056b3;
    }
}

/* TELA DO JOGO */
.logo-topo {
    width: 100%;
    max-width: 400px;
    margin: 45px auto 30px;
}

#info-topo {
    width: 90%;
    max-width: 560px;
    margin: 25px auto 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 24px;
    font-weight: bold;
}

#pontuacao {
    background: #f16377;
    padding: 15px 20px;
    border-radius: 20px;
    font-size: 24px;
}

#barra-tempo {
    width: 260px;
    height: 24px;
    background: #333;
    border-radius: 20px;
    overflow: hidden;
}

#progresso-tempo {
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, #007bff, #00ffaa);
    border-radius: 20px;
    transition: width 0.1s linear;
}

#pergunta-atual {
    text-align: center;
    padding: 0 30px;
    font-size: 26px;
    font-weight: bold;
    margin: 15px 0 40px 0;
    line-height: 1.4;
    max-width: 90%;
    position: relative;
    z-index: 10;
}

/* GRID DE PALABRAS FIJAS */
#area-palavras {
    position: relative;
    width: 90%;
    max-width: 560px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    margin-top: 50px;
    pointer-events: all;
}

.palavra {
    position: relative;
    font-size: 22px;
    font-weight: bold;
    padding: 18px 10px;
    text-align: center;
    background: transparent;
    color: white;
    border-radius: 20px;
    cursor: pointer;
    user-select: none;
    border: 2px solid white;
    transition: all 0.25s ease;
}

.palavra:hover {
    transform: scale(1.05);
}

.palavra.acertou {
    background: linear-gradient(135deg, #28a745, #00ff88);
    border-color: #00ffaa;
    box-shadow: 0 0 25px #00ffaa;
}

.palavra.errou {
    background: linear-gradient(135deg, #dc3545, #ff6666);
    border-color: #ff0000;
    box-shadow: 0 0 25px #ff0000;
}


/* Popups */
.popup {
    background: rgba(0,0,0,0.9);
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.popup-conteudo {
    background: #001f3f;
    padding: 60px 40px;
    border-radius: 30px;
    text-align: center;
    box-shadow: 0 15px 40px rgba(0,0,0,0.8);
    max-width: 85%;
    border: 3px solid #007bff;
}

.popup-conteudo.vitoria {
    background: linear-gradient(135deg, #001a33, #002b55);
    border: 4px solid gold;
    box-shadow: 0 0 70px rgba(255,215,0,0.5);
}

.popup-conteudo h1 {
    font-size: 48px;
    margin-bottom: 25px;
}

.popup-conteudo.vitoria h1 {
    color: gold;
    font-size: 56px;
    text-shadow: 0 0 18px gold;
}

.popup-conteudo h2 {
    font-size: 38px;
    margin: 35px 0;
}

#confetti-canvas {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 1;
}