.game-container {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.score-board {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    font-weight: bold;
    background: #f0f0f0;
    padding: 10px;
    border-radius: 8px;
}

.game-area {
    position: relative;
    margin: 0 auto;
    width: 100%;
    max-width: 500px;
    aspect-ratio: 1;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    width: 100%;
    height: 100%;
    padding: 10px;
    background: #2c3e50;
    border-radius: 10px;
    box-sizing: border-box;
}

.card {
    background-color: transparent;
    perspective: 1000px;
    cursor: pointer;
    aspect-ratio: 1;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card.matched .card-inner {
    transform: rotateY(180deg);
}

.card.matched {
    cursor: default;
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    font-size: 4rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    user-select: none;
}

.card-front {
    background-color: #3498db;
    color: white;
}

.card-back {
    background-color: white;
    transform: rotateY(180deg);
    border: 2px solid #3498db;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    border-radius: 10px;
    z-index: 10;
}

.overlay.hidden {
    display: none;
}

.primary-btn {
    padding: 12px 24px;
    font-size: 1.2rem;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 20px;
}

.primary-btn:hover {
    background-color: #c0392b;
}

@media (max-width: 480px) {
    .grid-container {
        gap: 5px;
        padding: 5px;
    }

    .card-front,
    .card-back {
        font-size: 2.5rem;
    }
}