:root {
    --primary: #4a90e2;
    --secondary: #357abd;
    --text: #333;
    --light-bg: #f5f5f5;
    --white: #ffffff;
    --red: #e74c3c;
    --green: #2ecc71;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: linear-gradient(135deg, #4a90e2, #357abd);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.game-container {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.game-instructions {
    text-align: center;
    padding: 2rem;
}

.game-instructions h2 {
    color: var(--primary);
    font-size: 2rem;
    margin-bottom: 2rem;
}

.game-instructions ul {
    list-style: none;
    margin-bottom: 2rem;
}

.game-instructions li {
    margin: 1rem 0;
    font-size: 1.2rem;
    color: var(--text);
}

.start-btn {
    font-size: 1.5rem;
    padding: 1rem 3rem;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.start-btn:hover {
    background: var(--secondary);
}

.game-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    font-size: 1.2rem;
    color: var(--text);
}

.game-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin: 2rem 0;
}

.card {
    aspect-ratio: 1;
    background: var(--primary);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    color: var(--white);
    cursor: pointer;
    transition: transform 0.3s ease;
    user-select: none;
}

.card:hover {
    transform: scale(1.05);
}

.card.flipped {
    background: var(--secondary);
}

.card.matched {
    background: var(--green);
    cursor: default;
}

.game-over, .game-won {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--white);
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.game-over h2, .game-won h2 {
    color: var(--primary);
    margin-bottom: 1rem;
}

.game-over p, .game-won p {
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.hidden {
    display: none;
}

@media (max-width: 768px) {
    .game-board {
        grid-template-columns: repeat(3, 1fr);
    }

    .card {
        font-size: 1.5rem;
    }
}
