.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

.info-panel {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    font-size: 1.2rem;
    align-items: center;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    perspective: 1000px;
    max-width: 400px;
    /* Limit width */
    width: 100%;
}

@media (max-width: 400px) {
    .card {
        width: 100%;
        /* Auto fit */
        aspect-ratio: 1/1;
        height: auto;
    }
}

.card {
    width: 80px;
    height: 80px;
    background-color: transparent;
    cursor: pointer;
    position: relative;
}

.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-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: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    font-size: 2rem;
    font-weight: bold;
}

.card-front {
    background-color: #38B48B;
    color: white;
}

.card-back {
    background-color: #fff;
    color: #333;
    border: 2px solid #38B48B;
    transform: rotateY(180deg);
}

button#restartBtn {
    padding: 5px 15px;
    font-size: 1rem;
    background-color: #333;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.controls-hint {
    margin-top: 20px;
    color: #666;
}

.back-link {
    display: inline-block;
    margin-top: 20px;
}