body {
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f0f2f5;
    margin: 0;
}

h1 {
    color: #333;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* 5 columns */
    grid-gap: 12px;
    perspective: 1000px; /* For the 3D flip effect */
}

.card {
    width: 100px;
    height: 100px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s;
    cursor: pointer;
}

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

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden; /* Safari */
    backface-visibility: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 50px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.card-front {
    background-color: #ffffff;
    transform: rotateY(180deg);
}

.card-back {
    background-color: #6a0dad; /* Solid purple back */
    color: white;
}

/* Style for when a card is matched */
.card.is-matched {
    transform: rotateY(180deg); /* Keep it flipped */
    opacity: 0;
    transition: transform 0.6s, opacity 0.5s 0.3s; /* Delay disappearance */
    cursor: default;
}

.restart-btn {
    margin-top: 25px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    color: white;
    background-color: #007bff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.restart-btn:hover {
    background-color: #0056b3;
}

.game-info {
    margin-bottom: 15px;
    font-size: 1.2em;
    font-weight: bold;
}