/* === Memory Match Game Styles === */

.game-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.game-header h1 {
    margin-bottom: 0.25rem;
}

.game-header p {
    color: var(--text-secondary);
}

.game-controls {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.difficulty-selector {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.difficulty-btn {
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
}

.difficulty-btn.active {
    background-color: var(--accent);
    color: var(--accent-contrast);
    border-color: var(--accent);
}

.game-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-heading);
}

/* Board */
.memory-board {
    display: grid;
    gap: 0.75rem;
    max-width: 500px;
    margin: 0 auto;
    perspective: 1000px;
}

.memory-board[data-difficulty="easy"] {
    grid-template-columns: repeat(3, 1fr);
}

.memory-board[data-difficulty="medium"] {
    grid-template-columns: repeat(4, 1fr);
}

.memory-board[data-difficulty="hard"] {
    grid-template-columns: repeat(4, 1fr);
}

/* Card */
.memory-card {
    aspect-ratio: 1;
    cursor: pointer;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.4s ease;
    border-radius: 12px;
}

.memory-card.flipped,
.memory-card.matched {
    transform: rotateY(180deg);
}

.memory-card.matched {
    cursor: default;
}

.memory-card-face {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    backface-visibility: hidden;
    font-size: 2.5rem;
    font-weight: 700;
    user-select: none;
}

.memory-card-back {
    background: var(--accent);
    color: var(--accent-contrast);
    font-size: 1.5rem;
}

.memory-card-front {
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    transform: rotateY(180deg);
}

.memory-card.matched .memory-card-front {
    border-color: var(--accent);
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.1);
}

/* Win overlay */
.game-win {
    text-align: center;
    margin-top: 2rem;
    padding: 2rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
}

.game-win .feature-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.game-win h2 {
    margin-bottom: 0.5rem;
}

.game-win p {
    margin-bottom: 1.5rem;
}

/* Responsive */
@media (max-width: 480px) {
    .memory-board {
        gap: 0.5rem;
    }

    .memory-card-face {
        font-size: 1.75rem;
    }

    .game-stats {
        gap: 1rem;
    }

    .stat-value {
        font-size: 1.25rem;
    }
}