/* ==========================================================================
   1. ESTILOS GLOBAIS E VARIÁVEIS
   ========================================================================== */

@font-face {
  font-family: 'Poppins';
  src: url('/fonts/poppins/Poppins-Light.woff2') format('woff2'),
       url('/fonts/poppins/Poppins-Light.woff') format('woff'),
       url('/fonts/poppins/Poppins-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
}

@font-face {
  font-family: 'Poppins';
  src: url('/fonts/poppins/Poppins-Regular.woff2') format('woff2'),
       url('/fonts/poppins/Poppins-Regular.woff') format('woff'),
       url('/fonts/poppins/Poppins-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Poppins';
  src: url('/assets/fonts/poppins/Poppins-Medium.woff2') format('woff2'),
       url('/assets/fonts/poppins/Poppins-Medium.woff') format('woff'),
       url('/fonts/poppins/Poppins-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
}

@font-face {
  font-family: 'Poppins';
  src: url('/assets/fonts/poppins/Poppins-SemiBold.woff2') format('woff2'),
       url('/assets/fonts/poppins/Poppins-SemiBold.woff') format('woff'),
       url('/fonts/poppins/Poppins-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
}

@font-face {
  font-family: 'Poppins';
  src: url('/assets/fonts/poppins/Poppins-Bold.woff2') format('woff2'),
       url('/assets/fonts/poppins/Poppins-Bold.woff') format('woff'),
       url('/fonts/poppins/Poppins-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: 'Poppins';
  src: url('/assets/fonts/poppins/Poppins-ExtraBold.woff2') format('woff2'),
       url('/assets/fonts/poppins/Poppins-ExtraBold.woff') format('woff'),
       url('/fonts/poppins/Poppins-ExtraBold.ttf') format('truetype');
  font-weight: 800;
  font-style: normal;
}


:root {
    --cor-primaria: #0D66B0;
    --cor-secundaria: #FF7A17;
    --cor-texto: #FFFFFF;
    --cor-fundo-card: #EAF4FF;
    --font-principal: 'Poppins', sans-serif;
}

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Poppins', sans-serif;
    background-color: #000;
    overflow: hidden;
}

/* ==========================================================================
   2. COMPONENTES REUTILIZÁVEIS
   ========================================================================== */

/* Classe base para todas as telas principais */
.screen {
    width: 1920px;
    height: 3413px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    text-align: center;
}

/* Classe base para a logo */
.logo {
    width: 842px;
    height: auto;
}

/* Classe base para os botões laranja */
.btn-principal {
    width: 1000px;
    height: 250px;
    background-color: var(--cor-secundaria);
    border-radius: 200px;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    color: var(--cor-texto);
    font-size: 80px;
    font-weight: 700;
    text-transform: uppercase;
}

/* ==========================================================================
   3. ESTILOS ESPECÍFICOS POR PÁGINA
   ========================================================================== */

/* --- Tela 1: Introdução --- */

.intro-screen {
    background-image:
        linear-gradient(rgba(13, 102, 176, 0.92), rgba(13, 102, 176, 0.92)),
        url('../img/fundo_jogo_da_memoria.jpg'); /* ATUALIZE O CAMINHO DA IMAGEM */
    background-size: cover;
    background-position: center;
    justify-content: flex-start;
}

.intro-screen .header {
    margin-top: 298px;
    margin-bottom: 257px;
}

.intro-screen .main-content {
    margin-bottom: 555px;
}

.intro-screen h1 {
    width: 1369px;
    height: 600px;
    color: var(--cor-texto);
    font-size: 300px;
    font-weight: 600;
    line-height: 1; /* Simplificado de 300px */
    margin: 0;
}

.intro-screen .subtitle {
    color: var(--cor-texto);
    font-size: 50px;
    font-weight: 400;
    margin-top: 40px;
}

.intro-screen .instruction-text {
    color: var(--cor-texto);
    font-size: 50px;
    font-weight: 400;
    margin-top: 97px;
}

#start-btn {
    font-size: 3.5vh;
    font-weight: 700;
    padding: 2.5vh 10vh;
    border: none;
    border-radius: 50px;
    color: white;
    cursor: pointer;
    text-transform: uppercase;
    /* Botão com gradiente vibrante */
    border-radius: 200px;
    background: #FF7A17;    
    box-shadow: 0 10px 25px rgba(255, 122, 23, 0.4);
    transition: all 0.3s ease-in-out;
    transform: scale(1);
    animation: fadeIn 1s ease-in 0.5s backwards;
    display: flex;
    align-items: flex-end;
}

#start-btn img{
    margin-right: 40px;
}


/* --- Tela 2: Jogo --- */

        .game-screen {
            width: 1920px;
            height: 3413px;
            overflow: hidden;
            position: relative;
            background-color: #FFFFFF;
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 0 70px; /* Margens laterais exatas */
            box-sizing: border-box;
            
        }

        .game-header {
            width: 100%;
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-top: 46px; /* Distância do topo para a logo */

           
        }

/* Garante que os elementos do jogo fiquem acima da forma do rodapé */
.game-screen .game-header,
.game-screen .cta-text,
.game-screen .game-board {
    position: relative;
    z-index: 2;
}
        .header-logo {
            width: 730px; /* Largura estimada com base no design */
            margin-top: 30px;
        }
        

 .timer-container {
            width: 615px;
            height: 344px;
            background-color: var(--cor-secundaria);
            
            margin-top: 127px; /* 173px (topo tela) - 46px (topo logo) */
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            color: var(--cor-texto);
            font-weight: 800; /* ExtraBold */
        }

        .timer-label {
            font-size: 80px;
            letter-spacing: 0.1em;
        }
        
        #timer-display {
            font-size: 180px;
            line-height: 1;
        }

        .cta-text {
            color: var(--cor-primaria);
            font-size: 100px;
            font-weight: 600;
            margin-top: 70px;
            margin-bottom: 100px; /* Espaçamento estimado para o tabuleiro */
        }

       /* ==========================================================================
   SEÇÃO DO JOGO - CORRIGIDA E UNIFICADA
   ========================================================================== */

        #game-board {
            display: grid; /* Usando grid para um layout mais preciso */
            grid-template-columns: repeat(4, 1fr); /* 3 colunas de tamanho igual */
            grid-template-rows: repeat(4, auto);   /* 4 linhas com altura automática */
            gap: 30px; /* Espaço entre os cards */
            
            width: 100%;
            max-width: 1600px; /* Ajuste a largura máxima conforme necessário */
            margin: 50px auto; /* Centraliza o tabuleiro */
            padding: 20px;
            box-sizing: border-box;
            perspective: 1500px; /* Efeito de profundidade para a animação */
            z-index: 9999;
        }

        .memory-card {
            width: 100%; /* Ocupa 100% da célula do grid */
            aspect-ratio: 3 / 4; /* Proporção do card (largura / altura) */
            position: relative;
            cursor: pointer;
            transform-style: preserve-3d;
            transition: transform 0.6s;
        }

        .memory-card.flip {
            transform: rotateY(180deg);
        }

        /* IMPORTANTE: Nomes das classes corrigidos */
        .front-face,
        .back-face {
            width: 100%;
            height: 100%;
            position: absolute;
            backface-visibility: hidden; /* Esconde o verso do elemento */
            border-radius: 20px;
            display: flex;
            justify-content: center;
            align-items: center;
            box-shadow: 0 10px 20px rgba(0,0,0,0.1);
            object-fit: cover; /* Garante que a imagem preencha o card */
        }

        /* Verso do Card (o que aparece primeiro) */
        .back-face {
            background-color: var(--cor-fundo-card);
            /* Se a imagem de fundo estiver aqui, use background-image */
        }

        /* Frente do Card (a imagem do par) */
        .front-face {
            background-color: #FFF;
            transform: rotateY(180deg);
        }

        
        /* Container da forma do rodapé (regra alterada) */
        .bottom-shape {
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            z-index: 1; /* z-index menor para ficar atrás dos cards */
            line-height: 0; /* Remove espaço extra abaixo da imagem */
        }

        /* Nova regra para a imagem dentro do container */
        .bottom-shape img {
            width: 100%;
        }


/* --- Tela 3: Vitória --- */

.victory-screen {
    background-color: var(--cor-primaria);
    border-bottom: 50px solid var(--cor-secundaria);
    justify-content: space-between;
    padding: 298px 0 292px 0;
    color: var(--cor-texto);
}

.victory-screen .main-content,
.victory-screen .footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.victory-screen .logo {
    margin-bottom: 216px;
}

.victory-screen .trophy-icon {
    width: 550px;
    height: auto;
}

.victory-screen .victory-title {
    font-size: 220px;
    font-weight: 300;
    line-height: 1.1;
    text-transform: uppercase;
    margin-top: 100px;
    margin-bottom: 30px;
}

/* Para usar este estilo, coloque a parte do texto que quer em negrito dentro de uma tag <span> */
.victory-screen .victory-title span {
    font-weight: 800;
}

.victory-screen .victory-subtitle {
    font-size: 70px;
    font-weight: 400;
    margin-bottom: 250px;
}

.victory-screen .thank-you-text {
    font-size: 100px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 80px;
}

/* =======================================================
   ESTILOS DO OVERLAY DE CONTAGEM - GARANTA QUE ESTE BLOCO EXISTA
   ======================================================= */

#countdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(13, 102, 176, 0.95); /* Fundo azul semi-transparente */
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#countdown-text {
    font-size: 500px;
    font-weight: 800;
    color: var(--cor-texto);
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* A classe que o JavaScript manipula para esconder/mostrar */
#countdown-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

/* =======================================
   ESTILO CORRIGIDO PARA O BOTÃO VOLTAR
   ======================================= */

.btn-principal {
    /* 1. Alinha o ícone e o texto */
    display: flex;
    align-items: center; /* ESSENCIAL para o alinhamento vertical */
    justify-content: center;
    gap: 25px; /* Espaço entre o ícone e o texto "Voltar" */

    /* 2. Estilos visuais do botão */
    padding: 20px 60px;
    border: none;
    border-radius: 200px;
    cursor: pointer;
    background-color: #FF7A17; /* Sua cor secundária */
    color: white; /* Cor do texto */
    font-size: 80px;
    font-weight: 700;
}

/* 3. Define o tamanho do ícone SVG */
.btn-principal .btn-icon {
    width: 65px;  /* Largura do ícone */
    height: auto; /* Altura automática para manter a proporção */
}