
body.scene-motion-paused .idle-glow,
body.scene-motion-paused .idle-motes,
body.scene-motion-paused .voyage-medal-ring,
body.scene-motion-paused .voyage-rank-claim,
body.scene-motion-paused .atlas-album-art,
body.scene-motion-paused .atlas-medal-ring,
body.scene-motion-paused .inbox-envelope,
body.scene-motion-paused .rank-star,
body.scene-motion-paused .profile-preview,
body.scene-motion-paused .league-mark,
body.scene-motion-paused .pearl-feature-stage,
body.scene-motion-paused .rush-meter-mark,
body.scene-motion-paused .sheet-title,
body.scene-motion-paused .refill-buy,
body.scene-motion-paused .deal-yes,
body.scene-motion-paused .refill-art,
body.scene-motion-paused .intro-coin,
body.scene-motion-paused .streak-pip,
body.scene-motion-paused .chest,
body.scene-motion-paused .express-choice-art,
body.scene-motion-paused .express-show-panel,
body.scene-motion-paused .ascent-show-panel,
body.scene-motion-paused .stampede-show-panel,
body.scene-motion-paused .aurora-show-panel,
body.scene-motion-paused .phoenix-show-panel,
body.scene-motion-paused .phoenix-pot-panel,
body.scene-motion-paused .phoenix-free-panel,
body.scene-motion-paused .mischief-wheel-panel,
body.scene-motion-paused .mischief-pick-panel,
body.scene-motion-paused .mischief-show-panel,
body.scene-motion-paused .auto-count,
body:has(> .level-up.show, > .pearl-open.show, > .bank-screen.open, > .pay.open) .idle-glow,
body:has(> .level-up.show, > .pearl-open.show, > .bank-screen.open, > .pay.open) .idle-motes {
  --idle-play: paused;
}

body.scene-motion-paused #app .plaque,
body.scene-motion-paused #app .lagoon-jackpot,
body.scene-motion-paused #app .stampede-jackpot,
body.scene-motion-paused #app .stampede-meter,
body.scene-motion-paused #app .aurora-jackpot,
body.scene-motion-paused #app .frontier-jackpot,
body.scene-motion-paused #app .express-jackpot,
body.scene-motion-paused #app .phoenix-jackpot,
body.scene-motion-paused #app .ascent-jackpot,
body.scene-motion-paused #app .mischief-jackpot,
body.scene-motion-paused #app .studio-jackpot,
body.scene-motion-paused #app .roof,
body.scene-motion-paused #app .spin-button,
body:has(> [aria-hidden="false"]:not(#app, #lobby, #planet-tip, #fx-layer)) #app .plaque,
body:has(> [aria-hidden="false"]:not(#app, #lobby, #planet-tip, #fx-layer)) #app .lagoon-jackpot,
body:has(> [aria-hidden="false"]:not(#app, #lobby, #planet-tip, #fx-layer)) #app .stampede-jackpot,
body:has(> [aria-hidden="false"]:not(#app, #lobby, #planet-tip, #fx-layer)) #app .stampede-meter,
body:has(> [aria-hidden="false"]:not(#app, #lobby, #planet-tip, #fx-layer)) #app .aurora-jackpot,
body:has(> [aria-hidden="false"]:not(#app, #lobby, #planet-tip, #fx-layer)) #app .frontier-jackpot,
body:has(> [aria-hidden="false"]:not(#app, #lobby, #planet-tip, #fx-layer)) #app .express-jackpot,
body:has(> [aria-hidden="false"]:not(#app, #lobby, #planet-tip, #fx-layer)) #app .phoenix-jackpot,
body:has(> [aria-hidden="false"]:not(#app, #lobby, #planet-tip, #fx-layer)) #app .ascent-jackpot,
body:has(> [aria-hidden="false"]:not(#app, #lobby, #planet-tip, #fx-layer)) #app .mischief-jackpot,
body:has(> [aria-hidden="false"]:not(#app, #lobby, #planet-tip, #fx-layer)) #app .studio-jackpot,
body:has(> [aria-hidden="false"]:not(#app, #lobby, #planet-tip, #fx-layer)) #app .roof,
body:has(> [aria-hidden="false"]:not(#app, #lobby, #planet-tip, #fx-layer)) #app .spin-button {
  --idle-play: paused;
}


.idle-ambient {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  --idle-glow-a: rgba(255, 206, 120, 0.34);
  --idle-glow-b: rgba(150, 120, 255, 0.3);
  --idle-mote: rgba(255, 244, 214, 0.95);
}

.idle-glow::before,
.idle-glow::after {
  content: "";
  position: absolute;
  width: 96%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--idle-glow-a), transparent);
  opacity: 0.5;
}

.idle-glow::before { left: -38%; top: -6%; }
.idle-glow::after { right: -42%; top: 36%; background: radial-gradient(closest-side, var(--idle-glow-b), transparent); }

.idle-motes {
  position: absolute;
  inset: 0;
  -webkit-mask-image: linear-gradient(180deg, #000, rgba(0, 0, 0, 0.8) 45%, rgba(0, 0, 0, 0.2));
  mask-image: linear-gradient(180deg, #000, rgba(0, 0, 0, 0.8) 45%, rgba(0, 0, 0, 0.2));
}

.idle-motes::before,
.idle-motes::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  opacity: 0.3;
}

.idle-motes::before {
  bottom: -220px;
  background-image:
    radial-gradient(circle at 12% 18%, var(--idle-mote) 0 1.4px, transparent 2.4px),
    radial-gradient(circle at 63% 9%, var(--idle-mote) 0 1px, transparent 2px),
    radial-gradient(circle at 38% 52%, var(--idle-mote) 0 1.6px, transparent 2.8px),
    radial-gradient(circle at 86% 44%, var(--idle-mote) 0 1.1px, transparent 2.1px),
    radial-gradient(circle at 22% 83%, var(--idle-mote) 0 1.2px, transparent 2.2px),
    radial-gradient(circle at 71% 76%, var(--idle-mote) 0 1.5px, transparent 2.6px);
  background-size: 180px 220px;
}

.idle-motes::after {
  bottom: -260px;
  background-image:
    radial-gradient(circle at 8% 62%, var(--idle-mote) 0 1.2px, transparent 2.2px),
    radial-gradient(circle at 47% 24%, var(--idle-mote) 0 1.7px, transparent 3px),
    radial-gradient(circle at 79% 13%, var(--idle-mote) 0 1px, transparent 2px),
    radial-gradient(circle at 58% 88%, var(--idle-mote) 0 1.4px, transparent 2.4px),
    radial-gradient(circle at 93% 71%, var(--idle-mote) 0 1.1px, transparent 2.1px),
    radial-gradient(circle at 30% 38%, var(--idle-mote) 0 0.9px, transparent 1.9px);
  background-size: 230px 260px;
}

.destination-screen.open .idle-glow::before {
  animation: idle-drift-a 17s ease-in-out infinite;
  animation-play-state: var(--idle-play, running);
}

.destination-screen.open .idle-glow::after {
  animation: idle-drift-b 23s ease-in-out -6s infinite;
  animation-play-state: var(--idle-play, running);
}

.destination-screen.open .idle-motes::before {
  animation: idle-rise-a 46s linear infinite, idle-twinkle 5.2s ease-in-out infinite;
  animation-play-state: var(--idle-play, running);
}

.destination-screen.open .idle-motes::after {
  animation: idle-rise-b 61s linear infinite, idle-twinkle 6.8s ease-in-out -3.4s infinite;
  animation-play-state: var(--idle-play, running);
}

#voyage-sheet .idle-ambient { --idle-glow-a: rgba(176, 120, 255, 0.42); --idle-glow-b: rgba(120, 255, 214, 0.24); --idle-mote: rgba(236, 228, 255, 0.95); }
#rush-sheet .idle-ambient { --idle-glow-a: rgba(80, 220, 230, 0.3); --idle-glow-b: rgba(120, 110, 255, 0.34); --idle-mote: rgba(220, 250, 255, 0.95); }
#atlas-sheet .idle-ambient { --idle-glow-a: rgba(255, 196, 110, 0.34); --idle-glow-b: rgba(255, 150, 80, 0.22); }
#inbox-sheet .idle-ambient { --idle-glow-a: rgba(255, 140, 190, 0.3); --idle-glow-b: rgba(255, 206, 120, 0.24); --idle-mote: rgba(255, 226, 240, 0.95); }
#rank-sheet .idle-ambient,
#profile-sheet .idle-ambient { --idle-glow-a: rgba(110, 170, 255, 0.34); --idle-glow-b: rgba(255, 212, 90, 0.24); }
#league-sheet .idle-ambient { --idle-glow-a: rgba(255, 206, 110, 0.34); --idle-glow-b: rgba(110, 170, 255, 0.26); }
#pearl-sheet .idle-ambient { --idle-glow-a: rgba(110, 220, 255, 0.32); --idle-glow-b: rgba(170, 120, 255, 0.26); --idle-mote: rgba(220, 246, 255, 0.95); }
#shop .idle-ambient { --idle-glow-a: rgba(255, 120, 170, 0.26); --idle-glow-b: rgba(255, 206, 120, 0.26); }


#voyage-sheet.open .voyage-medal-ring {
  animation: idle-float 4.4s ease-in-out var(--idle-delay, 0s) infinite;
  animation-play-state: var(--idle-play, running);
}

#voyage-sheet .voyage-medal:nth-child(3n + 2) { --idle-delay: -1.5s; }
#voyage-sheet .voyage-medal:nth-child(3n) { --idle-delay: -2.9s; }

#voyage-sheet .voyage-galaxy { padding-top: 10px; }

.voyage-medal.ready .voyage-medal-ring::after {
  content: "";
  position: absolute;
  inset: 14%;
  border-radius: 50%;
  box-shadow: inset 0 0 18px 4px var(--starlight);
  opacity: 0.3;
  pointer-events: none;
}

#voyage-sheet.open .voyage-medal.ready .voyage-medal-ring::after {
  animation: idle-breathe 2.6s ease-in-out infinite;
  animation-play-state: var(--idle-play, running);
}

.voyage-rank-claim {
  position: relative;
  overflow: hidden;
}

.voyage-rank-claim::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 32%, rgba(255, 255, 255, 0.5) 50%, transparent 68%);
  translate: -101% 0;
  pointer-events: none;
}

#voyage-sheet.open .voyage-rank-claim:not([hidden])::after {
  animation: idle-glint 3.6s ease-in-out 1.2s infinite;
  animation-play-state: var(--idle-play, running);
}

#atlas-sheet.open .atlas-album-art {
  animation: idle-sway 5.6s ease-in-out infinite;
  animation-play-state: var(--idle-play, running);
}

#atlas-sheet.open .atlas-medal:not(.complete) .atlas-medal-ring {
  animation: idle-float 4.6s ease-in-out var(--idle-delay, 0s) infinite;
  animation-play-state: var(--idle-play, running);
}

#atlas-sheet .atlas-medal:nth-child(3n + 2) { --idle-delay: -1.6s; }
#atlas-sheet .atlas-medal:nth-child(3n) { --idle-delay: -3.1s; }

#inbox-sheet.open .inbox-envelope {
  animation: idle-sway 4.8s ease-in-out infinite;
  animation-play-state: var(--idle-play, running);
}

/* The pseudo owns the glow: filtering its container clips the outset
   to a square in WebKit. Keep its negative layer local without a filter. */
#rank-sheet .rank-star {
  filter: none;
  isolation: isolate;
}

#rank-sheet .rank-star::after {
  content: "";
  position: absolute;
  inset: -18%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(closest-side, transparent 62%, rgba(255, 212, 90, 0.55) 78%, transparent);
  opacity: 0.35;
  pointer-events: none;
}

#rank-sheet.open .rank-star::after {
  animation: idle-breathe 3.6s ease-in-out infinite;
  animation-play-state: var(--idle-play, running);
}

#profile-sheet.open .profile-preview {
  animation: idle-float 4.2s ease-in-out infinite;
  animation-play-state: var(--idle-play, running);
}

#league-sheet.open .league-tier.current .league-mark {
  animation: idle-float 3.8s ease-in-out infinite;
  animation-play-state: var(--idle-play, running);
}

#pearl-sheet.open .pearl-feature-stage::before {
  animation: idle-breathe 3.2s ease-in-out infinite;
  animation-play-state: var(--idle-play, running);
}

#rush-sheet.open .rush-meter-mark {
  animation: idle-spark 3s ease-in-out infinite;
  animation-play-state: var(--idle-play, running);
}


.sheet:not(.destination-screen) .sheet-title::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 32%, rgba(255, 255, 255, 0.45) 50%, transparent 68%);
  translate: -101% 0;
  pointer-events: none;
}

.sheet.open:not(.destination-screen) .sheet-title::after {
  animation: idle-glint 5.2s ease-in-out 0.8s infinite;
  animation-play-state: var(--idle-play, running);
}

.deal-yes.intro-play {
  position: relative;
  overflow: hidden;
}

.deal-yes.intro-play::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 32%, rgba(255, 255, 255, 0.5) 50%, transparent 68%);
  translate: -101% 0;
  pointer-events: none;
}

.sheet.open .refill-buy::after,
.sheet.open .deal-yes.intro-play::after {
  animation: idle-glint 3.6s ease-in-out 2s infinite;
  animation-play-state: var(--idle-play, running);
}

.sheet.open .refill-art {
  animation: refill-bob 3.2s ease-in-out infinite;
  animation-play-state: var(--idle-play, running);
}

.intro-sheet.open .intro-coin {
  animation: idle-float 3.4s ease-in-out infinite;
  animation-play-state: var(--idle-play, running);
}

.streak-sheet.open .streak-pip.break {
  animation: idle-blink 1.8s ease-in-out 0.6s infinite;
  animation-play-state: var(--idle-play, running);
}


.deal.open .deal-chest:not(:disabled, .mine, .opening, .opened, .chosen) .chest::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 44%, #fff6d6 50%, transparent 56%);
  mix-blend-mode: screen;
  -webkit-mask: url("../art/ui/capsule.webp") center / 100% 100% no-repeat;
  mask: url("../art/ui/capsule.webp") center / 100% 100% no-repeat;
  opacity: 0;
  pointer-events: none;
  animation: idle-capsule 4.8s ease-in-out calc(-0.2s * var(--i)) infinite;
  animation-play-state: var(--idle-play, running);
}

body.scene-motion-paused #deal .deal-chest .chest::after { visibility: hidden; }
