* {
    user-select: none;
    box-sizing: border-box;
}

body {
    background: linear-gradient(145deg, #1a472a 0%, #0e2a1a 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    margin: 0;
    padding: 20px;
}

.container {
    background: rgba(255, 248, 225, 0.95);
    border-radius: 48px;
    padding: 20px 25px 30px;
    max-width: 750px;
    width: 100%;
    box-shadow: 0 25px 40px rgba(0,0,0,0.3);
    text-align: center;
}

h1 {
    margin: 0 0 10px 0;
    font-size: 2.2rem;
    color: #3c2a1f;
    letter-spacing: 2px;
}

.game-info {
    display: flex;
    justify-content: space-between;
    background: #ecd9b4;
    padding: 10px 20px;
    border-radius: 60px;
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 25px;
    color: #2d2b26;
}

.board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    justify-items: center;
    align-items: center;
    margin-bottom: 30px;
}

.card {
    aspect-ratio: 1 / 1;
    width: 100%;
    max-width: 110px;
    background: #ffcf9a;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 10px 0 #a5673f;
    transform: translateY(-3px);
}

.card.flipped, .card.matched {
    background: #fff3e0;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transform: translateY(2px);
    cursor: default;
}

.card.matched {
    background: #b9f6ca;
    cursor: default;
    filter: drop-shadow(0 0 6px #4caf50);
}

.card:active:not(.flipped):not(.matched) {
    transform: translateY(4px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

button {
    background: #ff914d;
    border: none;
    font-size: 1.2rem;
    font-weight: bold;
    padding: 12px 28px;
    border-radius: 40px;
    color: white;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 5px 0 #b4622a;
    letter-spacing: 1px;
}

button:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #b4622a;
}

.instructions {
    margin-top: 20px;
    font-size: 0.85rem;
    background: #f7e9d7;
    padding: 8px 15px;
    border-radius: 50px;
    color: #5a3e2b;
}

@media (max-width: 550px) {
    .board {
        gap: 8px;
    }
    .card {
        font-size: 1.8rem;
    }
    .game-info {
        font-size: 0.9rem;
    }
}