* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #2c3e50;
    color: #ecf0f1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.game-container {
    max-width: 800px;
    width: 100%;
    text-align: center;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #f1c40f;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.score-container {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.game-grid {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.card {
    width: 80px;
    height: 120px;
    perspective: 1000px;
    cursor: pointer;
}

.card-inner {
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    position: relative;
}

.card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.card-front {
    background-color: #3498db;
    transform: rotateY(180deg);
}

.card-back {
    background-color: #e74c3c;
}

.card.matched {
    opacity: 0.6;
    cursor: default;
}

#restart-btn {
    background-color: #2ecc71;
    border: none;
    color: white;
    padding: 10px 20px;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s;
}

#restart-btn:hover {
    background-color: #27ae60;
}

@media (max-width: 600px) {
    .card {
        width: 60px;
        height: 90px;
    }

    .card-face {
        font-size: 1.5rem;
    }
}