* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(135deg, #f34c0f 0%, #f1a935 9%, #e8a322 18%, #d5ea35 28%, #501cde 39%, #6385d8 50%, #6bbaf3 60%, #d5ea35 70%, #e8a322 80%, #f1a935 90%, #f34c0f 100%);
    font-family: 'Arial', sans-serif;
    color: #fff;
    flex-direction: column;
    animation: gradientAnimation 10s ease infinite;
}

@keyframes gradientAnimation {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

h1 {
    margin-bottom: 10px;
    font-size: 3em;
    color: #ffffff;
    text-shadow: 4px 4px 4px rgba(14, 13, 13, 0.962);
    letter-spacing: 2px;
}

.timer,
.score {
    margin-bottom: 20px;
    font-size: 1.7em;
    color: #18141f; /* Deep Purple for better contrast */
    text-shadow: 2px 2px 4px rgba(227, 231, 30, 0.7);
    font-weight: bold;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 columns */
    grid-template-rows: repeat(3, 1fr);    /* 3 rows */
    gap: 10px;
    width: 640px; /* Fixed width for desktop */
    height: 640px; /* Fixed height for desktop */
}

.memory-card {
    position: relative;
    width: 100%;
    height: 100%;
    transform: scale(1);
    transform-style: preserve-3d;
    transition: transform 0.5s;
    border-radius: 10px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
}

.memory-card.flip {
    transform: rotateY(180deg);
}

.memory-card img {
    width: 100%;
    height: 100%;
    position: absolute;
    backface-visibility: hidden;
    border-radius: 5px;
}

.front-face {
    transform: rotateY(180deg);
}

.back-face {
    background-color: #f39c12;
    background-image: url('img/js-badge.svg');
    background-size: cover;
    border-radius: 10px;
}
