/* ==========================================================================
   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: 100%;
    height: 100vh;
    display: flex;
    text-align: center;
    row-gap: 1em;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
}

/* Classe base para a logo */
.logo {
    width: 300px;
    height: auto;
}

/* Classe base para os botões laranja */
.btn-principal {
    background-color: #ff7a17;
    color: white;
    border: none;
    padding: 50px 200px;
    font-size: 2rem;
    font-weight: 500;
    border-radius: 100px;
    cursor: pointer;
    text-transform: uppercase;
    margin-top: 20px;
    transition: transform 0.2s, background-color 0.2s;
    display: flex;
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    align-items: flex-end;
    transition: all 0.3s ease-in-out;
    transform: scale(1);
    animation: fadeIn 1s ease-in 0.5s backwards;
}

.btn-principal svg{
    width: 40px;
    margin-right: 20px;
}

/* ==========================================================================
   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;
}


.intro-screen h1 {
    width: auto;
    color: var(--cor-texto);
    font-size: 170px;
    font-weight: 600;
    line-height: 1; /* Simplificado de 300px */
    margin: 0;
}

.intro-screen .subtitle {
    color: var(--cor-texto);
    font-size: 35px;
    font-weight: 400;
    margin-top: 40px;
}

.intro-screen .instruction-text {
    color: var(--cor-texto);
    font-size: 25px;
    font-weight: 400;
    margin-top: 50px;
}

#start-btn {
    background-color: #ff7a17;
    color: white;
    border: none;
    padding: 50px 200px;
    font-size: 2rem;
    font-weight: 500;
    border-radius: 100px;
    cursor: pointer;
    text-transform: uppercase;
    margin-top: 20px;
    transition: transform 0.2s, background-color 0.2s;
    display: flex;
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    align-items: flex-end;
    transition: all 0.3s ease-in-out;
    transform: scale(1);
    animation: fadeIn 1s ease-in 0.5s backwards;
}

#start-btn img{
    width: 40px;
    margin-right: 20px;
}


/* --- Tela 2: Jogo --- */

.game-screen {
        width: 100%;
    height: 100vh;
    overflow: hidden;
    position: relative;
    background-color: #FFFFFF;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 20px;
    box-sizing: border-box;
    align-content: center;
    justify-content: space-evenly;
}

.game-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

/* 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: 320px; /* Largura estimada com base no design */
}
        

 .timer-container {
    width: auto;
    height: auto;
    background-color: var(--cor-secundaria);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--cor-texto);
    font-weight: 800; /* ExtraBold */
    padding: 30px;
}

.timer-label {
    font-size: 50px;
    letter-spacing: 0.1em;
}

#timer-display {
    font-size: 80px;
    line-height: 1;
}

.cta-text {
    color: var(--cor-primaria);
    font-size: 50px;
    font-weight: 600;
}

/* ==========================================================================
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%;
    padding: 10px;
    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);
    color: var(--cor-texto);
}

.victory-screen .main-content,
.victory-screen .footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.victory-screen .trophy-icon {
    width: 550px;
    height: auto;
}

.victory-screen .victory-title {
    font-size: 120px;
    font-weight: 300;
    line-height: 1.1;
    text-transform: uppercase;
    margin-top: 50px;
    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: 30px;
    font-weight: 400;
}

.victory-screen .thank-you-text {
    font-size: 50px;
    font-weight: 600;
    text-transform: uppercase;
}

/* =======================================================
   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: 250px;
    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;
}