/* Stage 21: light belongs to the scenery. No game geometry or hit area changes. */
.world-life { position:absolute;inset:0;overflow:hidden;pointer-events:none;contain:paint; }
.world-light,.world-reflection,.world-arrival,.world-motes { position:absolute;inset:0;pointer-events:none; }
.world-light,.world-reflection,.world-arrival { mix-blend-mode:screen; }
.world-light { opacity:.3;animation:world-breathe 13s ease-in-out infinite; }
.world-reflection { top:62%;opacity:.26;animation:world-floor 13s ease-in-out infinite; }
.world-arrival { opacity:0;background:radial-gradient(ellipse at 50% 36%,transparent 30%,var(--world-halo) 100%);animation:world-enter 1600ms ease-out both; }
.world-motes i { position:absolute;left:var(--mote-x);top:var(--mote-y);width:3px;height:3px;border-radius:50%;background:var(--world-dust);box-shadow:0 0 7px var(--world-dust);opacity:0;animation:world-drift var(--mote-duration) linear var(--mote-delay) infinite; }
.scene-frame[data-scene=gold] { --world-halo:#dda74266;--world-dust:#ffe3a0; }
.scene-frame[data-scene=gold] .world-light { background:linear-gradient(104deg,transparent 8%,#ffd89822 14%,transparent 20%,transparent 78%,#eec37d33 86%,transparent 91%),radial-gradient(ellipse 34% 28% at 50% 0%,#ffe9ba66,transparent 100%); }
.scene-frame[data-scene=gold] .world-reflection { background:linear-gradient(100deg,transparent 5%,#f9cd7b66 16%,transparent 24%,transparent 77%,#ffe4a277 86%,transparent 94%); }
.scene-frame[data-scene=blue] { --world-halo:#49d6f955;--world-dust:#bef7ff; }
.scene-frame[data-scene=blue] .world-light { background:radial-gradient(ellipse 34% 15% at 32% 13%,#56ffcd66,transparent 99%),radial-gradient(ellipse 36% 14% at 73% 24%,#5aaaff55,transparent 100%);animation:world-aurora 17s ease-in-out infinite; }
.scene-frame[data-scene=blue] .world-reflection { background:radial-gradient(ellipse 48% 44% at 36% 58%,#65e6fb66,transparent 100%),radial-gradient(ellipse 37% 30% at 72% 24%,#af8fff55,transparent 100%);animation-duration:17s; }
.scene-frame[data-scene=red] { --world-halo:#ff572d66;--world-dust:#ffb060; }
.scene-frame[data-scene=red] .world-light { background:radial-gradient(ellipse 24% 28% at 14% 36%,#ff5d2688,transparent 100%),radial-gradient(ellipse 24% 32% at 88% 37%,#ff542a88,transparent 100%);animation-duration:7s; }
.scene-frame[data-scene=red] .world-reflection { background:radial-gradient(ellipse 64% 65% at 50% 65%,#f8431666,transparent 100%),linear-gradient(110deg,transparent 20%,#ff9f4922 40%,transparent 64%);animation-duration:7s; }
.scene-frame[data-scene=red] .world-motes i { top:74%;width:2px;height:4px;animation-name:world-embers; }
.scene-frame[data-scene=abyss] { --world-halo:#118ce777;--world-dust:#9aefff; }
.scene-frame[data-scene=abyss] .world-light { background:conic-gradient(from 156deg at 44% -15%,transparent 0deg,#64dfff22 3deg,transparent 7deg,#70cbff33 13deg,transparent 17deg,#83eaff22 22deg,transparent 29deg);animation:world-caustics 19s ease-in-out infinite; }
.scene-frame[data-scene=abyss] .world-reflection { background:repeating-radial-gradient(ellipse at 50% -35%,transparent 0 8%,#7cd5ff44 9%,transparent 10% 19%);mask-image:linear-gradient(transparent,#000 35%,transparent);-webkit-mask-image:linear-gradient(transparent,#000 35%,transparent);animation-duration:19s; }
.scene-frame[data-scene=abyss] .world-motes i { width:5px;height:5px;border:1px solid #b5f4ff99;background:#8ae3ff11;box-shadow:inset 1px 1px #eaffff66;animation-name:world-bubbles; }
.scene-frame[data-scene=star] { --world-halo:#a898f988;--world-dust:#e3d1ff; }
.scene-frame[data-scene=star] .world-light { background:radial-gradient(ellipse 26% 23% at 50% 30%,#b586ee77,transparent 99%),radial-gradient(ellipse 30% 38% at 18% 30%,#62bcff55,transparent 100%),radial-gradient(ellipse 28% 30% at 84% 33%,#ffce8055,transparent 100%);animation:world-cosmos 12s ease-in-out infinite; }
.scene-frame[data-scene=star] .world-reflection { background:radial-gradient(ellipse 29% 65% at 50% 26%,#b99aff77,transparent 100%),radial-gradient(ellipse 24% 66% at 18% 55%,#73ccff77,transparent 100%),radial-gradient(ellipse 26% 65% at 82% 55%,#ffe6b477,transparent 100%);animation-duration:12s; }
.scene-frame[data-scene=star] .world-motes { top:0;bottom:48%; }
.scene-frame[data-scene=star] .world-motes i { animation-name:world-starlight; }
@keyframes world-breathe { 0%,100%{opacity:.24}50%{opacity:.62} }
@keyframes world-floor { 0%,100%{opacity:.18}50%{opacity:.42} }
@keyframes world-aurora { 0%,100%{opacity:.25;transform:translateX(-1%)}50%{opacity:.65;transform:translateX(1%)} }
@keyframes world-caustics { 0%,100%{opacity:.35;transform:translateX(-1.2%)}50%{opacity:.65;transform:translateX(1.2%)} }
@keyframes world-cosmos { 0%,100%{opacity:.3;transform:scale(1)}50%{opacity:.64;transform:scale(1.03)} }
@keyframes world-enter { 0%{opacity:0}25%{opacity:.6}100%{opacity:0} }
@keyframes world-drift { 0%{opacity:0;transform:translate(0,18px)}20%,65%{opacity:.5}100%{opacity:0;transform:translate(var(--mote-drift),-40px)} }
@keyframes world-embers { 0%{opacity:0;transform:translate(0,16px)}15%{opacity:.8}80%{opacity:.35}100%{opacity:0;transform:translate(var(--mote-drift),-150px)} }
@keyframes world-bubbles { 0%{opacity:0;transform:translate(0,60px)}20%,75%{opacity:.45}100%{opacity:0;transform:translate(var(--mote-drift),-110px)} }
@keyframes world-starlight { 0%,100%{opacity:.1;transform:scale(.6)}50%{opacity:.65;transform:scale(1)} }
/* Pause ambient work during play, hidden tabs and collection view. */
body:is([data-page-hidden=true],[data-spinning=true],[data-platform=atelier]) .world-life *,
body:is([data-page-hidden=true],[data-spinning=true],[data-platform=atelier]) .scene-tint { animation-play-state:paused!important; }
body[data-spinning=true] .world-arrival { display:none; }
body[data-motion=calm] .world-life * { animation:none!important; }
body[data-motion=calm] :is(.world-arrival,.world-motes) { display:none; }
@media(prefers-reduced-motion:reduce) { .world-life * { animation:none!important; } .world-arrival,.world-motes { display:none; } }
@media(max-width:700px) { .world-motes i:nth-child(n+5) { display:none; } .world-light { opacity:.26; } }
