body {
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background-color: #f0f0f0;
}

#game {
    text-align: center;
}

#stats {
    margin: 20px 0;
    font-size: 1.2em;
}

#grid {
    display: grid;
    grid-template-columns: repeat(4, 100px);
    gap: 10px;
    justify-content: center;
}

.card {
    position: relative;
    width: 100px;
    height: 100px;
    perspective: 1000px;
    cursor: pointer;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.6s;
}

.card.flipped .card-inner {
    transform: rotateY(180deg);
}

.back, .front {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    border-radius: 8px;
}

.back {
    background-color: #4a90e2;
    color: white;
}

.front {
    background-color: #fff;
    border: 2px solid #333;
    transform: rotateY(180deg);
}

.matched .front {
    border-color: #2ecc71;
    background-color: #e0f7e9;
}