* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Basic body styling */
body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(to bottom right, #1d3557, #457b9d, #a8dadc);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    flex-direction: column;
    gap: 20px;
}

/* Title styling */
h1 {
    text-align: center;
    font-size: 40px;
    font-weight: bold;
    color: #333;
}

/* Score Board */
#score-board {
    text-align: center;
    font-size: 18px;
    color: #e0d8d8;
    background-color: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 10px;
}

/* Game grid styling */
.grid {
    display: grid;
    grid-template-columns: repeat(4, 120px);
    grid-template-rows: repeat(4, 120px);
    gap: 10px;
    justify-content: center;
    align-items: center;
}

/* Card styling */
.card {
    width: 100px;
    height: 100px;
    background-color: #fff;
    perspective: 1000px;
    cursor: pointer;
}

/* Inner card styling */
.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.5s ease-in-out;
}

/* Front side of the card */
.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 30px;
    color: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* Back side of the card */
.card-back {
    background-color: #2ecc71;
    transform: rotateY(180deg);
}

/* Flipped card styling */
.card.flipped .card-inner {
    transform: rotateY(180deg);
}

/* Responsive adjustments */
@media (max-width: 500px) {
    .grid {
        grid-template-columns: repeat(2, 80px);
        grid-template-rows: repeat(2, 80px);
    }
}
