/* ==========================================================================
   effects.css  -  ambient background + particles (hearts, sparkle
   trail, clouds, ghost emojis) and the keyframes they share.
   Everything animates transform / opacity only (GPU-friendly).
   ========================================================================== */

/* --- Falling hearts ------------------------------------------------------- */
#hearts-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.heart {
    position: absolute;
    color: #fff;
    opacity: 0.8;
    animation: fall linear infinite;
    text-shadow: 0 0 5px rgba(255, 182, 193, 0.8);
}

@keyframes fall {
    to {
        transform: translateY(100vh) rotate(360deg);
    }
}

/* --- Sparkle trail -------------------------------------------------------- */
.sparkle {
    position: absolute;
    pointer-events: none;
    width: 15px;
    height: 15px;
    background: radial-gradient(circle, #E1BEE7, #7E57C2);
    border-radius: 50%;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    animation: sparkle-fade 1s forwards;
    z-index: 100000;
}

@keyframes sparkle-fade {
    from {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }

    to {
        transform: scale(0) rotate(180deg);
        opacity: 0;
    }
}

/* --- Clouds / stars around the quiz -------------------------------------- */
.cloud {
    position: absolute;
    opacity: 0.8;
    z-index: 0;
    animation: floatCloud 10s ease-in-out infinite alternate;
    filter: drop-shadow(2px 2px 5px rgba(0, 0, 0, 0.1));
    pointer-events: none;
}

@keyframes floatCloud {
    to {
        transform: translateX(20px);
    }
}

/* --- Shared keyframes ----------------------------------------------------- */
@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.05);
        opacity: 1;
    }
}

@keyframes wiggle {

    0%,
    100% {
        transform: rotate(-3deg);
    }

    50% {
        transform: rotate(3deg);
    }
}

/* --- Slow machines ----------------------------------------------------------
   html.perf-lite is switched on by a quick frame-rate check (see index.html).
   The page looks the same, just with the always-on decoration held still. */
html.perf-lite .cloud,
html.perf-lite .ghost-emoji,
html.perf-lite .quiz-enhanced::before {
    animation: none;
}
