/* Контейнери для зірок */
.stars,
.shooting-stars {
    position: fixed; /* фіксуємо на екрані */
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none; /* щоб не блокувати кліки */
    z-index: -1;
}

/* Звичайна зірка */
.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    opacity: 0.8;
    animation: twinkle 2s infinite alternate;
}

@keyframes twinkle {
    0%   { opacity: 0.2; transform: scale(0.8); }
    50%  { opacity: 1; transform: scale(1.3); }
    100% { opacity: 0.3; transform: scale(1); }
}

/* --- Падаюча зоря --- */
.shooting-star {
    position: absolute;
    width: 2px;
    height: 80px; /* довжина хвоста задається в JS */
    opacity: 0;
    animation: shoot var(--duration, 1s) linear forwards;
    overflow: visible;
}

/* Хвіст зорі */
.shooting-star::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%) rotate(calc(var(--angle, 45deg) + 90deg));
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, white, transparent);
    border-radius: 50%;
}

/* ⚡ Спалах + голова зорі */
.shooting-star-flash {
    position: absolute;
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    box-shadow: 
        0 0 8px white,
        0 0 18px white,
        0 0 28px rgba(255,255,255,0.9);
    animation: flash 0.35s ease-out forwards;
    pointer-events: none;
}

/* Шлейф від голови зорі */
.shooting-star-flash::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 0;
    background: linear-gradient(to bottom, white, transparent);
    border-radius: 50%;
    animation: flash-tail 0.5s ease-out forwards;
    pointer-events: none;
}

@keyframes flash {
    0%   { transform: scale(0); opacity: 1; }
    50%  { transform: scale(1.8); opacity: 1; }
    100% { transform: scale(0.7); opacity: 0; }
}

@keyframes flash-tail {
    0%   { height: 0; opacity: 1; }
    50%  { height: 20px; opacity: 0.8; }
    100% { height: 40px; opacity: 0; }
}

/* Анімація руху */
@keyframes shoot {
    0% {
        opacity: 1;
        transform: translate(0,0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--x), var(--y)) scale(1);
    }
}
