/*
 * Better Sparkles™ (CSS)
 * © 2025 Popfan (https://gensakudan.com)
 *
 * Make sure to use this alongside the JS file!
*/

#sparkle-container {
    position: fixed;
    width: 100vw;
    height: 100vh;
    top: 0;
    left: 0;
    overflow: hidden;
    z-index: 1000;
    pointer-events: none;

    /* These variables can be tweaked as necessary */
    --sparkle-color: yellow;
    --animation-duration: 5s;

    /* These variables get overridden by the JS code */
    --animation-distance-y: 250px;
    --animation-distance-x: 0;
}

.sparkle {
    position: absolute;
    width: 5px;
    height: 5px;
    animation: var(--animation-duration) ease-out sparkle-animation;
}

.sparkle__horizontal, .sparkle__vertical {
    position: absolute;
    background-color: var(--sparkle-color);
}

.sparkle__horizontal {
    top: 2px;
    left: 0;
    width: 100%;
    height: 1px;
    animation: var(--animation-duration) linear sparkle-parts--horizontal;
}

.sparkle__vertical {
    top: 0;
    left: 2px;
    width: 1px;
    height: 100%;
    animation: var(--animation-duration) linear sparkle-parts--vertical;
}

@keyframes sparkle-animation {
    0% {
        translate: 0 0;
    }
    100% {
        translate: var(--animation-distance-x) var(--animation-distance-y);
    }
}

@keyframes sparkle-parts--horizontal {
    0% {
        left: 0;
        width: 100%;
    }
    100% {
        left: 2px;
        width: 0;
    }
}

@keyframes sparkle-parts--vertical {
    0% {
        top: 0;
        height: 100%;
    }
    100% {
        top: 2px;
        height: 0;
    }
}