/* style.css - Jogo da Memória OTIMIZADO (Pop-up de Cálculo) */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    background-color: #ecf0f1; 
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 10px;
    min-height: 100vh;
}

h3 {
    color: #2c3e50;
    margin-bottom: 10px;
}

#game-info {
    text-align: center;
    margin-bottom: 20px;
}

.memory-container {
    width: 100%;
    max-width: 420px; /* Largura máxima para mobile */
    padding: 10px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* ---------------------------------------------------- */
/* NOVO: ESTILOS PARA O CÁLCULO FLUTUANTE (Fase 1) */
/* ---------------------------------------------------- */

#math-puzzle-screen {
    width: 100%;
    max-width: 420px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

#single-math-card {
    /* Estilo da carta de cálculo única */
    background-color: #3498db; 
    color: white;
    flex-direction: column;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    min-width: 280px;
    height: 150px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: default;
}

.math-problem {
    font-size: 2em;
    margin: 5px 0;
    color: #ecf0f1;
    font-weight: bold;
}

.math-input {
    width: 80px;
    padding: 5px;
    text-align: center;
    font-size: 1.2em;
    border: none;
    border-radius: 3px;
    margin-right: 10px;
}

.check-btn {
    padding: 8px 15px;
    font-weight: bold;
    background-color: #2ecc71;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1em;
}

/* ---------------------------------------------------- */
/* FASE 2: ESTILOS DO TABULEIRO DE MEMÓRIA (4x5) */
/* ---------------------------------------------------- */

#memory-board {
    display: grid;
    /* Grid 4 colunas x 5 linhas (20 cartas) */
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(5, 1fr); 
    gap: 8px; 
    width: 100%;
    /* Proporção 4x5 */
    aspect-ratio: 4 / 5.5; 
    perspective: 1000px;
}

/* Estilo Básico de TODAS as cartas */
.card {
    background-color: transparent; 
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: transform 0.6s;
    height: 100%; 
    position: relative; 
    border: 3px solid #bdc3c7;
    transform-style: preserve-3d;
}

/* Configuração das Faces (Frente/Verso) */
.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden; 
    border-radius: 3px;
    background-size: cover;
    background-position: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.front-face {
    transform: rotateY(180deg); 
    background-color: white; 
}

.back-face {
    background-image: url('imagens/card_back.png');
    background-color: #34495e;
}

/* Efeito de virar (flip) */
.card.flip {
    transform: rotateY(180deg);
}

#reward-message {
    text-align: center;
    padding: 20px;
}

#start-memory-btn {
    padding: 10px 20px;
    font-size: 1.2em;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 15px;
}

.hidden { display: none !important; }

/* ---------------------------------------------------- */
/* NOVO: ESTILO DO OVERLAY INICIAL (Correção Mobile) */
/* ---------------------------------------------------- */

#initial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(44, 62, 80, 0.95); /* Azul escuro semi-transparente */
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 1.5em;
    z-index: 1000; /* Garante que fique acima de tudo */
    cursor: pointer;
    padding: 20px;
}