/* Theme background animations (js/theme-animations.js, docs/THEME-ANIMATION-V1.md).
   ONLY transform and opacity are animated here (a test checks the keyframes). Layers sit above the body background image and
   behind the game; the .ta-art box reproduces the "cover, centered" fit of the theme's background image from its reference size. */
/* Layer order while animations are drawn: body background image < this layer < the game. The layer is the body's first child (z-index 0);
   the game container is lifted above it. (A z-index:-1 layer would hide under the body background, and isolating the body makes its fixed background disappear.) */
#themeAnimations{position:fixed;inset:0;z-index:0;pointer-events:none;overflow:hidden;container-type:size}
body.theme-animated #game{position:relative;z-index:1}
#themeAnimations[hidden]{display:none}
.ta-art{position:absolute;left:50%;top:50%;width:max(100cqw,calc(100cqh*var(--ta-w)/var(--ta-h)));aspect-ratio:var(--ta-w)/var(--ta-h);transform:translate(-50%,-50%)}
.ta-layer,.ta-star{position:absolute;pointer-events:none}
.ta-star{border-radius:50%;animation:ta-twinkle var(--ta-dur,3s) ease-in-out var(--ta-delay,0s) infinite;will-change:opacity,transform}
@keyframes ta-twinkle{0%,100%{opacity:.15;transform:scale(.7)}50%{opacity:1;transform:scale(1.25)}}
.ta-drift,.ta-sweep,.ta-sheen{overflow:hidden}
.ta-drift-belt{position:absolute;left:0;top:0;width:200%;height:100%;background-size:50% 100%;background-repeat:repeat-x;animation:ta-drift var(--ta-dur,70s) linear infinite;will-change:transform}
@keyframes ta-drift{to{transform:translateX(-50%)}}
.ta-sweep-band{position:absolute;top:0;bottom:0;left:-140%;width:140%;animation:ta-sweep var(--ta-dur,48s) linear infinite;will-change:transform}
@keyframes ta-sweep{to{transform:translateX(171.43%)}}
.ta-sheen-bar{position:absolute;top:-10%;bottom:-10%;left:-60%;width:40%;animation:ta-sheen var(--ta-dur,16s) ease-in-out infinite;will-change:transform}
@keyframes ta-sheen{0%{transform:translateX(0)}55%,100%{transform:translateX(475%)}}
.ta-lamp{border-radius:6px;animation:ta-pulse var(--ta-dur,2.6s) ease-in-out infinite}
@keyframes ta-pulse{0%,100%{opacity:var(--ta-lo,.18)}50%{opacity:var(--ta-hi,.95)}}
.ta-spin{animation:ta-spin var(--ta-dur,30s) linear infinite;will-change:transform}
@keyframes ta-spin{to{transform:rotate(360deg)}}
/* the page is hidden: nothing runs */
.ta-paused *{animation-play-state:paused!important}
/* the system asks for less motion: nothing is shown or moves (the script also skips drawing) */
@media (prefers-reduced-motion:reduce){#themeAnimations{display:none}}
