body {
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    background: #020617;      
    user-select: none;  /* Impede seleção de texto/emojis */
    margin: 0;
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;

    background: #030712;      
    padding: 24px;
    border: 2px solid #22d3ee; 
    border-radius: 16px;
    box-shadow: 0 0 18px rgba(34, 211, 238, 0.35);

    max-width: 400px;
    width: 100%;
}

h2 {
    font-size: 2rem;
    color: #e5e7eb;
    text-transform: uppercase;
    letter-spacing: 0.15em; /*espaçamento entre as letras*/
    margin: 0;
}

.painel {
    width: 100%;
    padding: 12px 16px;

    display: flex;
    justify-content: space-between;
    align-items: center;

    background: #020617;
    border: 2px solid #7c3aed;   
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.35);

    font-size: 0.9rem;
}

#record,
#timer,
#movimentos,
.textPainel {
    color: #22d3ee;              
}

.reset {
    width: 100%;
    padding: 14px;

    background: #e5e7eb;
    color: #020617;

    border: none;
    border-radius: 10px;

    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;

    cursor: pointer;
    transition: 0.2s;
}

.reset:hover {
    background: #22d3ee;
}

.reset:focus {
    outline: none;
}

.ocultarBotao {
    display: none;
}

.game {
    width: 100%;
    max-width: 340px;

    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;

    perspective: 600px;
}

.item {
    aspect-ratio: 1 / 1;          /* Mantém quadrado perfeito */

    display: flex;
    align-items: center;
    justify-content: center;

    background: #7c3aed;        
    border: 1px solid #334155;
    border-radius: 12px;

    font-size: 2rem;
    cursor: pointer;

    transform: rotateY(180deg);
    transition: transform 0.25s;
}

/* Parte traseira da carta (fechada) */
.item::after {
    content: "";
    position: absolute;
    inset: 0;

    background: #111827;        
    border-radius: 12px;

    backface-visibility: hidden;
    transform: rotateY(0deg);
    transition: 0.25s;
}

/* Carta aberta */
.item.boxOpen {
    transform: rotateY(0deg);
}

/* Carta aberta ou combinada */
.boxOpen::after,
.boxMatch::after {
    transform: rotateY(180deg);
    background: #22c55e;      
}


/* RESPONSIVIDADE */
@media (max-width: 480px) {
    .container{
        height: 100vh;
        width: 100vw;
    }

    h2 {
        font-size: 1.5rem;
    }

    .game {
        /* Define 3 colunas iguais dentro de um CSS Grid. */
        grid-template-columns: repeat(4, 1fr);
        max-width: 300px;
    }

    .item {
        font-size: 3rem;
    }
    .painel{
        align-items: baseline;
        flex-direction: column;
        font-size: 1.5rem;
        gap: 14px;
    }
}

/* Tablets */
@media (max-width: 768px) {
    .container{
        height: 45em;
        width: 28em;
    }
    .game {
        max-width: 300px;
    }
    .painel{
        align-items: baseline;
        flex-direction: column;
        font-size: 1.5rem;
        gap: 14px;
    }
}