body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: linear-gradient(135deg, #07926C, #E9DC14, #9D96B7, #29272B, #E1E1E1);
    background-size: 400% 400%;
    animation: gradientShift 12s ease infinite;
    font-family: "Poppins", sans-serif;
    position: relative;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    align-content: center;
    min-height: 100vh;
}

/* full-screen white layer that will fade in */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    /* shorthand for top:0; right:0; bottom:0; left:0; */
    background: #fff;
    pointer-events: none;
    /* clicks still reach the cards */
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    z-index: 1;
    /* below the cards (we raise the cards below) */
}

/* when your JS adds the class, overlay becomes opaque */
body.in-game::before {
    opacity: 1;
    /* keep the gradient animation off if you had it on body */
    /* (optional) body animation can also be stopped by this:
     animation: none; */
}

/* ensure your cards appear above the overlay:
   setting position:relative does not change layout; it only creates a stacking context
   so z-index applies. This is safe and minimal. */
img {
    position: relative;
    z-index: 2;
}

/* keep the menu above the overlay while it's visible */
.menu-container {
    z-index: 3;
    /* your .menu-container is absolute so this works fine */
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.menu-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.85);
    border-radius: 20px;
    padding: 40px 60px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    animation: popIn 1s ease;
}

@keyframes popIn {
    0% {
        transform: translate(-50%, -50%) scale(0.7);
        opacity: 0;
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

h1 {
    margin-bottom: 20px;
    font-size: 2.5em;
    color: #29272B;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.2);
}

#btnStart {
    background: #07926C;
    color: white;
    font-size: 1.2em;
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

#btnStart:hover {
    background: #E9DC14;
    color: #29272B;
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
}

#btnStart:active {
    transform: translateY(1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

/* 🔒 Keep your card styles untouched */
img {
    height: 16.5em;
    width: 12.5em;
    padding: 30px;
    box-sizing: border-box;
}