/* Container for starry background */
#starry-background-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 200vw;  /* doubled width for seamless scroll */
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
    background: black;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    overflow: hidden;
    white-space: nowrap; /* prevent wrapping */
    animation: starFieldScroll 60s linear infinite;
}

/* Animation: scroll left by 50% (width of one star set) */
@keyframes starFieldScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-20vw); }
}

/* Star particles */
.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    opacity: 0.8;
    animation-name: twinkle, pulse;
    animation-iteration-count: infinite;
    animation-timing-function: ease-in-out, ease-in-out;
    animation-direction: alternate, alternate;
}
@keyframes twinkle {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 0.15; }
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

/* Ships base style */
.ship {
    position: absolute;
    width: 16px;
    height: 16px;
    background-size: contain;
    background-repeat: no-repeat;
    animation-timing-function: linear;
}
/* UFO */
.ship.ufo {
    background-image: url('https://static.newsi8.com/uploads/2025/09/ship1.png');
    animation-name: ufoFly;
    animation-duration: 50s;
    animation-iteration-count: infinite;
}
/* Star Trek Enterprise */
.ship.enterprise {
    background-image: url('https://static.newsi8.com/uploads/2025/09/ship2.png');
    animation-name: enterpriseFly;
    animation-duration: 65s;
    animation-iteration-count: infinite;
}
/* Death Star */
.ship.deathstar {
    background-image: url('https://static.newsi8.com/uploads/2025/09/ship3.png');
    animation-name: deathStarFly;
    animation-duration: 80s;
    animation-iteration-count: infinite;
}
@keyframes ufoFly {
  0% { top: 80%; left: -10%; transform: rotate(0deg) scale(1); opacity: 0.9; }
  25% { top: 45%; left: 20%; transform: rotate(10deg) scale(1.05); opacity: 1; }
  50% { top: 30%; left: 50%; transform: rotate(5deg) scale(1) ; opacity: 0.95; }
  75% { top: 55%; left: 80%; transform: rotate(-5deg) scale(1.03); opacity: 1; }
  100% { top: 80%; left: 110%; transform: rotate(0deg) scale(1); opacity: 0.9; }
}
@keyframes enterpriseFly {
  0% { top: 60%; left: 110%; transform: rotate(0deg) scale(1); opacity: 0.85; }
  20% { top: 40%; left: 80%; transform: rotate(8deg) scale(1.04); opacity: 0.95; }
  50% { top: 10%; left: 50%; transform: rotate(2deg) scale(1); opacity: 0.9; }
  80% { top: 30%; left: 20%; transform: rotate(-6deg) scale(1.06); opacity: 0.95; }
  100% { top: 60%; left: -10%; transform: rotate(0deg) scale(1); opacity: 0.85; }
}
@keyframes deathStarFly {
  0% { top: 10%; left: -10%; transform: rotate(0deg) scale(1); opacity: 0.8; }
  25% { top: 30%; left: 20%; transform: rotate(15deg) scale(1.1); opacity: 0.9; }
  50% { top: 50%; left: 50%; transform: rotate(5deg) scale(1); opacity: 0.85; }
  75% { top: 30%; left: 80%; transform: rotate(-5deg) scale(1.07); opacity: 0.9; }
  100% { top: 10%; left: 110%; transform: rotate(0deg) scale(1); opacity: 0.8; }
}

