/* A small non-interactive sky band, never a full-screen animated canvas. */
.night-sky {
    position:absolute; z-index:1; left:6%; right:6%; top:95px; height:118px;
    overflow:hidden; pointer-events:none; contain:layout paint;
}
.orchard-v2-world > .night-sky { top:88px; height:118px; }
.night-sky > span { position:absolute; display:block; opacity:0; pointer-events:none; }
.night-sky-star { width:27px; height:27px; background:center/contain no-repeat; filter:brightness(2.1) drop-shadow(0 0 1px #fff3b0); }
.night-sky-star:nth-child(1) { left:10%; top:18%; }
.night-sky-star:nth-child(2) { left:29%; top:42%; width:22px; height:22px; }
.night-sky-star:nth-child(3) { left:46%; top:12%; width:24px; height:24px; }
.night-sky-star:nth-child(4) { left:63%; top:48%; }
.night-sky-star:nth-child(5) { left:82%; top:40%; width:21px; height:21px; }
.night-sky.is-active > .night-sky-star {
    background-image:url('../images/farm/night-sparkle-v1.png');
    animation:night-sky-twinkle 16s ease-in-out infinite;
}
/* Equal periods keep phases apart indefinitely; spatial order is not a chase. */
.night-sky.is-active > .night-sky-star:nth-child(2) { animation-delay:-6.4s; }
.night-sky.is-active > .night-sky-star:nth-child(3) { animation-delay:-12.8s; }
.night-sky.is-active > .night-sky-star:nth-child(4) { animation-delay:-3.2s; }
.night-sky.is-active > .night-sky-star:nth-child(5) { animation-delay:-9.6s; }
.night-sky-meteor { width:14px; height:70px; transform-origin:center; background:center/contain no-repeat; filter:brightness(1.8); }
.night-sky.is-active > .night-sky-meteor.is-flying {
    background-image:url('../images/farm/night-meteor-v1.png');
    animation:night-sky-shoot .95s linear both;
}
@keyframes night-sky-twinkle {
    /* 2.56s rise, .64s hold, 3.2s fall; always keep the resting glimmer. */
    0%,40%,100% { opacity:.35; transform:scale(.85); filter:brightness(2.1) drop-shadow(0 0 1px #fff3b0); }
    16%,20% { opacity:1; transform:scale(1.35); filter:brightness(2.8) drop-shadow(0 0 2px #fffce5) drop-shadow(0 0 4px #ffe9a680); }
}
@keyframes night-sky-shoot {
    /* The texture's bright head is at the top; turn the head toward bottom-right. */
    0% { opacity:0; transform:translate(0,-16px) rotate(132deg); }
    12%,78% { opacity:1; }
    100% { opacity:0; transform:translate(76px,52px) rotate(132deg); }
}
html:not([data-home-theme="night"]) .night-sky { display:none; }
@media (prefers-reduced-motion:reduce) {
    .night-sky { display:none; }
    .night-sky > span { animation:none !important; }
}
