/*MEMORY GAME */
/* Category selection */
.category-grid {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 20px 0;
}

.cat-option {
    padding: 20px;
    border: 2px solid #ddd;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 110px;
    background-color: rgba(46, 204, 113, 0.1);
}

.cat-option i {
    font-size: 2rem;
    margin-bottom: 10px;
}

input[type="radio"]:checked+.cat-option {
    border-color: #2ecc71;
    background-color: rgba(46, 204, 113, 0.1);
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Memory board */
.memory-board {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-auto-rows: 80px;
    gap: 12px;
    justify-content: center;
    margin: 20px auto;
}

/* Card cells */
.memory-board .cell {
    width: 80px;
    height: 80px;
    border-radius: 14px;
    font-size: 32px;
    font-weight: bold;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s;
    background: rgba(0, 0, 0, .15);
}


.memory-board .cell.flip {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    backface-visibility: hidden;
    border-radius: 14px;
}

.front {
    background: transparent;
    color: white;
    font-size: 26px;
}

.back {
    transform: rotateY(180deg);
    background: transparent;
}

.memory-board .cell.matched {
    box-shadow: 0 0 18px #22c55e;
    animation: pop 0.35s ease;
}

.card-img {
    width: 70%;
    height: 70%;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
}

@keyframes pop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.12);
    }

    100% {
        transform: scale(1);
    }
}

/* Stats (center) */
.stats-container {
    display: flex;
    gap: 12px;
    font-weight: 700;
}

/* Individual stats */
.stats {
    background: rgba(255, 255, 255, 0.12);
    padding: 6px 12px;
    border-radius: 12px;
}

/* Mobile: 3 columns x 6 rows */
@media (max-width: 600px) {
    .memory-board {
        grid-template-columns: repeat(3, 1fr);
        row-gap: 18px;
    }

    .memory-board .cell {
        width: 100%;
        height: 90px;
    }

}