/* Ensure the entire body and game are centered and responsive */
body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background-color: #f0f0f0;
}

/* Memory game container */
.memory-game {
    width: 615px;
    height: 615px;
    display: flex;
    flex-wrap: wrap;
    perspective: 1000px;
}

/* Memory card styling */
.memory-card {
    width: calc(25% - 10px); /* Ensures 4 cards per row */
    height: calc(25% - 10px);
    margin: 5px;
    position: relative;
    transform: scale(1);
    transform-style: preserve-3d;
    transition: transform 0.5s;
    cursor: pointer;
}

/* Flip effect when card is clicked */
.memory-card.flip {
    transform: rotateY(180deg);
}

/* Front and back face styles */
.memory-card .front-face,
.memory-card .back-face {
    width: 100%; /* Ensure full card size */
    height: 100%;
    position: absolute;
    backface-visibility: hidden;
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 28px;
    padding: 10px;
    box-sizing: border-box; /* Makes padding count inside size */
}

/* Styling for the front side of the card */
.front-face {
    background-color: #c4c4c4; /* Light gray color */
}

/* Styling for the back side of the card */
.back-face {
    background-color: #e0e0e0; /* A lighter shade of gray */
    color: black;
    transform: rotateY(180deg);
}

/* Ensure images inside back-face fill the entire card */
.back-face img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures image fully covers the card */
    border-radius: 5px; /* Ensure rounded corners for the image */
}
