/* Container for the effect */
.shooting-stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
}

/* Base styles for a single shooting star */
.shooting-star {
    position: absolute;
    width: 150px; /* Width for the tail */
    height: 2px;
    background: linear-gradient(to right, white, rgba(255, 255, 255, 0));
    border-radius: 999px;
    filter: drop-shadow(0 0 6px white);
    transform-origin: 0 0;
    opacity: 0;
    
    /* Use a single, variable-driven animation */
    animation: shooting 3s linear infinite;
}

/* Keyframes now use variables */
@keyframes shooting {
    0% {
        transform: translateX(0) translateY(0) rotate(var(--angle));
        opacity: 1;
    }
    80% {
        opacity: 1;
    }
    100% {
        transform: translateX(var(--dx)) translateY(var(--dy)) rotate(var(--angle));
        opacity: 0;
    }
}

/* --- Individual Star Variations --- */
/* We use :nth-child to style each star uniquely */

.shooting-star:nth-child(1) {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
    animation-duration: 4.2s;
    /* Movement: down and right. Angle = atan2(40, 100) */
    --dx: 100vw;
    --dy: 40vh;
    --angle: 21.8deg;
}

.shooting-star:nth-child(2) {
    top: 50%;
    left: 30%;
    animation-delay: 1.2s;
    animation-duration: 3.5s;
    /* Movement: down and right. Angle = atan2(20, 120) */
    --dx: 120vw;
    --dy: 20vh;
    --angle: 9.5deg;
}

.shooting-star:nth-child(3) {
    top: 10%;
    left: 50%;
    animation-delay: 2.7s;
    animation-duration: 5.1s;
    /* Movement: down and left. Angle = atan2(50, -150) */
    --dx: -150vw;
    --dy: 50vh;
    --angle: -18.4deg;
}

.shooting-star:nth-child(4) {
    top: 15%;
    left: 70%;
    animation-delay: 4.1s;
    animation-duration: 4.5s;
    /* Movement: down and left. Angle = atan2(30, -90) */
    --dx: -90vw;
    --dy: 30vh;
    --angle: -18.4deg;
}

.shooting-star:nth-child(5) {
    top: 30%;
    left: 90%;
    animation-delay: 5.8s;
    animation-duration: 6s;
    /* Movement: down and left. Angle = atan2(25, -140) */
    --dx: -140vw;
    --dy: 25vh;
    --angle: -10.1deg;
}