/* World completion finales (js/finale.js). Overlay never takes clicks; transform/opacity only. */
.cs-finale{position:fixed;inset:0;z-index:60;pointer-events:none;overflow:hidden;contain:strict}
.cs-finale i{position:absolute;left:var(--x);top:var(--y);display:block;will-change:transform,opacity}
/* open vaults chime in sequence, in the world colour */
@keyframes fx-chime{0%,100%{box-shadow:none}40%{box-shadow:0 0 0 2px var(--arrow),0 0 34px -4px var(--arrow)}}
.cs-finale-on .vault{animation:fx-chime 1s ease calc(var(--vi,0) * .18s) 1}
.cs-finale-on .vault:nth-child(2){--vi:1}.cs-finale-on .vault:nth-child(3){--vi:2}.cs-finale-on .vault:nth-child(4){--vi:3}

/* Stock: crate pop, confetti and streamers burst from the bottom centre */
.fx-confetti{left:50vw!important;top:96vh!important;width:9px;height:14px;border-radius:2px;background:hsl(var(--h) 90% 60%);animation:fx-burst 2.8s cubic-bezier(.15,.8,.3,1) calc(var(--i)*12ms) both}
.fx-confetti:nth-child(3n){width:4px;height:26px;border-radius:4px}
.fx-confetti:nth-child(4n){border-radius:50%;width:11px;height:11px}
@keyframes fx-burst{0%{transform:translate(0,0) rotate(0);opacity:1}60%{opacity:1}100%{transform:translate(var(--dx),calc(var(--dy) + 30vh)) rotate(var(--rot));opacity:0}}

/* Health: gems sparkle in place, one after another */
.fx-gem{width:18px;height:18px;background:linear-gradient(135deg,#fff,hsl(var(--h) 85% 62%));clip-path:polygon(50% 0,100% 40%,50% 100%,0 40%);filter:drop-shadow(0 0 8px hsl(var(--h) 90% 65%));animation:fx-twinkle 1.6s ease calc(var(--i)*.14s) 2 both}
@keyframes fx-twinkle{0%,100%{transform:scale(0) rotate(0);opacity:0}45%{transform:scale(1.3) rotate(25deg);opacity:1}}

/* Seasonal: fireworks over the advent doors, then soft falling snow */
.fx-firework{width:6px;height:6px;border-radius:50%;color:hsl(calc(var(--i)*60) 95% 62%);top:calc(var(--y)*.6)!important;
 box-shadow:0 -40px 0 currentColor,28px -28px 0 currentColor,40px 0 0 currentColor,28px 28px 0 currentColor,0 40px 0 currentColor,-28px 28px 0 currentColor,-40px 0 0 currentColor,-28px -28px 0 currentColor;
 animation:fx-pop 1.3s ease-out calc(var(--i)*.35s) both}
@keyframes fx-pop{0%{transform:scale(.05);opacity:1}70%{opacity:1}100%{transform:scale(1.5);opacity:0}}
.fx-snow{top:-12px!important;width:7px;height:7px;border-radius:50%;background:#fff;box-shadow:0 0 6px #ffd6e0;animation:fx-fall 3.4s linear calc(var(--i)*.12s) both}
@keyframes fx-fall{0%{transform:translate(0,0);opacity:0}15%{opacity:1}100%{transform:translate(4vw,105vh);opacity:.2}}

/* Bookings: star-dust drifting up with an aura */
.fx-dust{top:auto!important;bottom:-10px;width:5px;height:5px;border-radius:50%;background:#ffe9a8;box-shadow:0 0 8px #c4a5ff,0 0 2px #fff;animation:fx-drift 3.2s ease-out calc(var(--i)*70ms) both}
.fx-dust:nth-child(even){background:#c4a5ff}
@keyframes fx-drift{0%{transform:translate(0,0) scale(.6);opacity:0}20%{opacity:1}100%{transform:translate(calc(var(--dx)*.3),-90vh) scale(1.2);opacity:0}}
.cs-finale-on[data-world=bookings] .vault{animation-name:fx-chime,fx-aura}
@keyframes fx-aura{50%{filter:drop-shadow(0 0 18px #a27bff)}}

/* Village: sunrise, fireflies and butterflies */
.fx-sun{left:50vw!important;top:auto!important;bottom:-60vh;width:120vw;height:120vh;margin-left:-60vw;border-radius:50%;background:radial-gradient(circle,rgba(255,214,102,.55),rgba(255,180,90,.18) 40%,transparent 65%);animation:fx-rise 3.6s ease-out both}
@keyframes fx-rise{0%{transform:translateY(40vh);opacity:0}40%{opacity:1}100%{transform:translateY(0);opacity:0}}
.fx-firefly{width:7px;height:7px;border-radius:50%;background:#e6ff7a;box-shadow:0 0 10px 3px rgba(214,255,90,.7);animation:fx-wander 3.4s ease-in-out calc(var(--i)*.1s) both}
@keyframes fx-wander{0%,100%{opacity:0;transform:translate(0,0)}25%{opacity:1;transform:translate(3vw,-2vh)}55%{opacity:.4;transform:translate(-2vw,-6vh)}80%{opacity:1;transform:translate(4vw,-9vh)}}
.fx-butterfly{width:22px;height:16px;animation:fx-flutter-path 3.6s ease-in-out calc(var(--i)*.25s) both}
.fx-butterfly::before,.fx-butterfly::after{content:"";position:absolute;top:0;width:11px;height:16px;background:hsl(calc(300 + var(--i)*25) 80% 70%);border-radius:60% 40% 50% 50%;animation:fx-flap .22s ease-in-out infinite alternate}
.fx-butterfly::before{left:0;transform-origin:100% 50%}.fx-butterfly::after{right:0;transform-origin:0 50%}
@keyframes fx-flap{to{transform:scaleX(.25)}}
@keyframes fx-flutter-path{0%{opacity:0;transform:translate(0,0)}15%{opacity:1}100%{opacity:0;transform:translate(18vw,-30vh)}}

/* Forecast: tiles tessellate in a rolling wave along the bottom */
.fx-tile{top:auto!important;bottom:4vh;left:calc(var(--i)*8.4vw)!important;width:min(7vw,52px);aspect-ratio:1;background:linear-gradient(135deg,#bcd4ff,#3b82f6);border:1px solid #fff6;animation:fx-wave 2.6s ease-in-out calc(var(--i)*90ms) both}
.fx-tile:nth-child(odd){clip-path:polygon(25% 0,75% 0,100% 50%,75% 100%,25% 100%,0 50%)}
@keyframes fx-wave{0%{transform:translateY(40px) rotateX(90deg);opacity:0}30%{transform:translateY(-30px) rotateX(0);opacity:1}60%{transform:translateY(0) rotate(60deg)}100%{transform:translateY(20px) rotate(120deg);opacity:0}}

/* Bespoke: jester cards shuffle and flourish, glitching then clean */
.fx-card{left:50vw!important;top:45vh!important;width:58px;height:84px;margin:-42px 0 0 -29px;border-radius:8px;border:2px solid #fff;background:repeating-conic-gradient(#ec4899 0 25%,#22d3ee 0 50%) 0 0/16px 16px;box-shadow:0 6px 18px rgba(0,0,0,.4);animation:fx-shuffle 2.8s cubic-bezier(.4,1.3,.5,1) calc(var(--i)*.06s) both}
@keyframes fx-shuffle{0%{transform:translateY(30vh) scale(.6);opacity:0;clip-path:inset(0 0 60% 0)}12%{clip-path:inset(40% 0 0 0);opacity:1}20%{clip-path:inset(0)}50%{transform:rotate(calc(var(--i)*14deg - 42deg)) translateY(-40px)}80%{transform:rotate(calc(var(--i)*14deg - 42deg)) translateY(-60px);opacity:1}100%{transform:rotate(calc(var(--i)*14deg - 42deg)) translateY(-90px);opacity:0}}

/* Rotas: runes ignite one by one around a ring */
.fx-rune{left:50vw!important;top:46vh!important;width:44px;height:44px;margin:-22px 0 0 -22px;display:grid!important;place-items:center;border-radius:50%;background:radial-gradient(circle,#3a2a1e,#1b1410);border:1.5px solid #f97316;box-shadow:0 0 18px -2px #f97316;transform:rotate(var(--a)) translateY(min(-30vw,-170px)) rotate(calc(-1*var(--a)));opacity:0;animation:fx-ignite 3s ease calc(var(--i)*.16s) both}

.fx-rune svg{width:26px;height:26px;fill:none;stroke:#ffcf99;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round;filter:drop-shadow(0 0 4px #f97316)}
@keyframes fx-ignite{0%{opacity:0;filter:brightness(.4)}25%{opacity:1;filter:brightness(1.8)}75%{opacity:1;filter:brightness(1)}100%{opacity:0}}

@media (max-width:760px){.fx-card{width:44px;height:64px;margin:-32px 0 0 -22px}.fx-rune{transform:rotate(var(--a)) translateY(-34vw) rotate(calc(-1*var(--a)))}}
@media (prefers-reduced-motion:reduce){.cs-finale{display:none}.cs-finale-on .vault{animation:none}}

/* Open-motion variety: each of the four objects lands its content differently (only while .revealing; never under reduced motion) */
@keyframes rv-burst{0%{transform:translateY(18px) scale(.94);opacity:0}60%{transform:translateY(-4px) scale(1.01);opacity:1}100%{transform:none}}
@keyframes rv-tip{0%{transform:rotate(-3deg) translateY(10px);transform-origin:0 0;opacity:0}100%{transform:none;opacity:1}}
@keyframes rv-slide{0%{transform:translateX(-28px);opacity:0}100%{transform:none;opacity:1}}
@keyframes rv-unfurl{0%{transform:scaleY(.6);transform-origin:50% 0;opacity:0}100%{transform:none;opacity:1}}
.vault.revealing:nth-child(1) .vault-body{animation:rv-burst .6s cubic-bezier(.2,.9,.3,1.2) both}
.vault.revealing:nth-child(2) .vault-body{animation:rv-tip .55s ease-out both}
.vault.revealing:nth-child(3) .vault-body{animation:rv-slide .5s ease-out both}
.vault.revealing:nth-child(4) .vault-body{animation:rv-unfurl .55s ease-out both}
/* lock motion variety while opening */
.vault.opening:nth-child(1) .lock{animation:lk-jump .5s ease-out}
.vault.opening:nth-child(2) .lock{animation:lk-tip .6s ease-in-out}
.vault.opening:nth-child(3) .lock{animation:lk-slide .55s ease-in-out}
.vault.opening:nth-child(4) .lock{animation:lk-squash .55s ease-in-out}
@keyframes lk-jump{40%{transform:translateY(-10px)}}
@keyframes lk-tip{50%{transform:rotate(-2.5deg)}}
@keyframes lk-slide{50%{transform:translateX(10px)}}
@keyframes lk-squash{40%{transform:scale(1.03,.94)}}
@media (prefers-reduced-motion:reduce){.vault.opening .lock{animation:none}}
/* anticipation: a brief spotlight hush before the trick */
.cs-finale:not(.go) i{visibility:hidden}
.fx-spot{position:absolute;inset:0;background:radial-gradient(ellipse at 50% 45%,transparent 30%,rgba(5,5,15,.45) 75%);animation:fx-hush 1.6s ease both}
@keyframes fx-hush{0%{opacity:0}22%{opacity:1}100%{opacity:0}}
/* gentle parallax on reveal objects (pointer devices; set by delight.js) */
.lock .obj{translate:calc(var(--tx,0)*7px) calc(var(--ty,0)*7px);transition:translate .25s ease-out}
.lock .lock-txt{translate:calc(var(--tx,0)*-2px) calc(var(--ty,0)*-2px);transition:translate .25s ease-out}
@media (prefers-reduced-motion:reduce){.lock .obj,.lock .lock-txt{translate:none}}
