* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: #fdfdfd; /* Fundo claro e limpo */
    background-image: linear-gradient(120deg, #f6d365 0%, #fda085 100%); /* Gradiente sutil */
    font-family: 'Poppins', sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    width: 100%;
    max-width: 600px;
    padding: 10px;
}

header {
    text-align: center;
    margin-bottom: 20px;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.score-panel {
    display: flex;
    justify-content: space-between;
    width: 300px;
    background: rgba(255, 255, 255, 0.8);
    padding: 10px 20px;
    border-radius: 20px;
    color: #333;
    font-weight: 600;
    margin: 10px auto;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.restart {
    cursor: pointer;
}

/* O Grid de Cartas */
.deck {
    width: 100%;
    background: rgba(255, 255, 255, 0.3);
    padding: 1rem;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 colunas */
    gap: 10px;
    list-style: none;
}

.card {
    aspect-ratio: 1 / 1; /* Mantém o quadrado */
    background: #2e3d49;
    font-size: 0;
    color: #ffffff;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 5px 2px 20px 0 rgba(46, 61, 73, 0.5);
    transition: 0.3s;
    user-select: none;
}

/* Efeito de virar e carta aberta */
.card.open, .card.show {
    background: #02ccba;
    font-size: 33px; /* Tamanho do emoji */
    cursor: default;
    transform: rotateY(180deg); /* Efeito 3D simples */
    animation: flip 0.5s;
}

.card.match {
    background: #1dd1a1; /* Verde sucesso */
    font-size: 33px;
    animation: rubberBand 0.8s;
}

/* Responsividade para Mobile */
@media (max-width: 450px) {
    .deck {
        grid-template-columns: repeat(4, 1fr);
        gap: 5px;
        padding: 0.5rem;
    }
    .card.open, .card.show, .card.match {
        font-size: 24px;
    }
    .score-panel {
        width: 100%;
        font-size: 14px;
    }
}

/* Espaço Adsense */
/*.adsense-container {*/
/*    margin-top: 20px;*/
/*    width: 100%;*/
/*    height: 100px;  Altura minima */
/*    background: rgba(0,0,0,0.05);*/
/*    display: flex;*/
/*    justify-content: center;*/
/*    align-items: center;*/
/*    border: 1px dashed #999;*/
/*}*/

.adsense-container {
    margin-top: 20px;
    width: 100%;
    min-height: 100px; /* Use min-height para ele crescer conforme o anúncio */
    display: flex;
    justify-content: center;
    align-items: center;
    /* Removido background e border para ficar limpo */
}

/* Modal Popup */
.hide { display: none; }
#popup {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}
.popup-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    width: 80%;
    max-width: 400px;
}
.popup-content button {
    background: #02ccba;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 15px;
}

/* Animações */
@keyframes flip {
    0% { transform: perspective(400px) rotateY(0); }
    100% { transform: perspective(400px) rotateY(180deg); }
}
@keyframes rubberBand {
    0% { transform: scale3d(1, 1, 1); }
    30% { transform: scale3d(1.25, 0.75, 1); }
    40% { transform: scale3d(0.75, 1.25, 1); }
    50% { transform: scale3d(1.15, 0.85, 1); }
    65% { transform: scale3d(0.95, 1.05, 1); }
    75% { transform: scale3d(1.05, 0.95, 1); }
    100% { transform: scale3d(1, 1, 1); }
}