/* CSS-only shooting-star layer. Explicit markup keeps it above the app shell without touching React boot code. */
body::after {
  content: none !important;
}

.shooting-star-layer {
  position: fixed;
  inset: 0;
  z-index: 9999;
  overflow: hidden;
  pointer-events: none;
}

.shooting-star {
  position: absolute;
  display: block;
  left: -220px;
  width: 190px;
  height: 3px;
  border-radius: 999px;
  opacity: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(231, 200, 122, .08) 12%,
    rgba(231, 200, 122, .72) 58%,
    rgba(255, 255, 255, 1) 100%
  );
  box-shadow:
    34px 0 14px rgba(231, 200, 122, .42),
    82px 0 24px rgba(255, 255, 255, .30),
    142px 0 36px rgba(231, 200, 122, .22);
  filter: drop-shadow(0 0 6px rgba(255, 247, 214, .75));
  transform-origin: right center;
}

/* Bright head sits at the leading edge; the fading tail stays behind it. */
.shooting-star::after {
  content: '✦';
  position: absolute;
  right: -7px;
  top: 50%;
  color: #fff8dc;
  font-size: 13px;
  line-height: 1;
  text-shadow:
    0 0 5px rgba(255,255,255,.95),
    0 0 12px rgba(231,200,122,.95),
    0 0 24px rgba(231,200,122,.55);
  transform: translateY(-50%);
}

.shooting-star-a {
  top: 11vh;
  transform: rotate(20deg);
  animation: shooting-star-front 5.8s linear infinite;
}

.shooting-star-b {
  top: 34vh;
  width: 135px;
  height: 2px;
  filter: drop-shadow(0 0 4px rgba(255, 247, 214, .6));
  transform: rotate(16deg);
  animation: shooting-star-back 7.6s linear 2.4s infinite;
}

/*
  Keep travel vector and trail angle mathematically aligned:
  front: atan(52 / 142) ≈ 20deg
  back:  atan(39 / 136) ≈ 16deg
  Using vw for both axes keeps the angle consistent across device aspect ratios.
*/
@keyframes shooting-star-front {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(20deg) scaleX(.82);
  }
  4% {
    opacity: .35;
  }
  8%, 30% {
    opacity: 1;
  }
  38% {
    opacity: .35;
    transform: translate3d(142vw, 52vw, 0) rotate(20deg) scaleX(1.06);
  }
  42%, 100% {
    opacity: 0;
    transform: translate3d(142vw, 52vw, 0) rotate(20deg) scaleX(1.06);
  }
}

@keyframes shooting-star-back {
  0%, 18% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(16deg) scaleX(.78);
  }
  23%, 38% {
    opacity: .72;
  }
  46% {
    opacity: 0;
    transform: translate3d(136vw, 39vw, 0) rotate(16deg) scaleX(1.02);
  }
  100% {
    opacity: 0;
    transform: translate3d(136vw, 39vw, 0) rotate(16deg) scaleX(1.02);
  }
}

@media (max-width: 560px) {
  .shooting-star-a {
    top: 10vh;
    width: 165px;
  }

  .shooting-star-b {
    top: 31vh;
    width: 118px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .shooting-star {
    animation: none !important;
  }

  .shooting-star-a {
    left: auto;
    right: 7vw;
    top: 11vh;
    opacity: .58;
    transform: rotate(20deg) scaleX(.72);
  }

  .shooting-star-b {
    display: none;
  }
}
