#hub-content .journey-hero,#hub-content .target-card{margin-bottom:24px!important}#hub-content .wardrobe-cards{margin-top:24px!important;margin-bottom:24px!important;gap:24px!important}#hub-content .perk-art{width:120px;height:120px;align-self:center;margin:12px auto 8px;display:block}#hub-content .wardrobe-cards article{padding:20px!important}#hub-content .wardrobe-cards article p{line-height:1.5}#hub-content .journey-road{gap:22px}#hub-content .card-grid{gap:22px}
.spell-credit-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(145px,1fr));gap:14px;max-height:410px;overflow:auto;padding:8px}.spell-credit-choice{display:flex;flex-direction:column;align-items:center;gap:8px;border:2px solid var(--rarity)!important;border-bottom:6px solid #21213b!important;background:linear-gradient(#4f5b85,#303657)!important;color:white;transition:transform .15s,filter .15s}.spell-credit-choice svg,.spell-credit-choice img{width:68px;height:68px}.spell-credit-choice[aria-pressed=true]{background:linear-gradient(#827348,#574533)!important;box-shadow:0 0 0 3px #ffe59b;transform:translateY(-3px)}.spell-credit-confirm{margin-top:18px;border:2px solid #9fafd2;border-radius:18px;padding:20px;background:#253553}.spell-credit-confirm button{width:100%;min-height:58px!important}.credit-success{padding:20px;background:#b9f6b4;color:#193a2c;border-radius:16px;font-size:22px;font-weight:bold;animation:loot-pop .55s both}
#chest-dialog{width:min(820px,96vw)!important;max-height:96svh!important;padding:22px!important;border:3px solid #c1a9ed!important;border-bottom:8px solid #60548b!important;border-radius:30px!important;overflow:auto;background:radial-gradient(ellipse at 50% 35%,#645a98,#252542 75%)!important}#chest-content{position:relative;text-align:center;isolation:isolate}#chest-content>h2{font-size:clamp(25px,4vw,38px);text-shadow:0 3px #21213b}#chest-content .chest-stage{position:relative;min-height:280px;display:flex;align-items:center;justify-content:center;flex-direction:column;isolation:isolate;perspective:700px;overflow:visible}#chest-content .chest-stage::before{content:'';position:absolute;width:310px;height:310px;border-radius:50%;background:repeating-conic-gradient(from 0deg,transparent 0 18deg,var(--reveal-color,#ffe59a) 19deg 22deg,transparent 23deg 40deg);opacity:.09;z-index:-1;animation:treasure-spin 28s linear infinite;pointer-events:none}#chest-content .treasure-icon{width:230px;height:220px;background-size:contain;animation:chest-anticipation 2.5s ease-in-out infinite;filter:drop-shadow(0 12px 14px #10112b88)}#chest-next{min-height:65px;font-size:22px!important;min-width:min(350px,85%);margin:18px 0 12px!important;border-bottom-width:7px!important}#chest-skip{display:block;margin:8px auto;min-height:44px}
#chest-content .chest-burst .treasure-icon{animation:seal-burst 1.25s ease-in both!important}#chest-content .chest-burst::before{animation:seal-rays 1.25s ease-in both}#chest-content .revealed-card{width:min(260px,70vw);height:240px;position:relative;display:flex;align-items:center;justify-content:center;border:3px solid var(--reveal-color);border-bottom:8px solid #26213c;border-radius:24px;background:radial-gradient(ellipse,#ffffff22,#252944);box-shadow:0 0 36px color-mix(in srgb,var(--reveal-color) 30%,transparent);animation:card-arrival .7s cubic-bezier(.2,.8,.2,1) both}#chest-content .revealed-card svg,#chest-content .revealed-card img,#chest-content .revealed-card canvas{width:180px!important;height:180px!important;object-fit:contain}#chest-content .revealed-card strong{position:absolute;right:-10px;bottom:-12px;padding:8px 16px;background:#fcdf95;color:#362c23;border:3px solid white;border-radius:15px;font-size:30px;animation:loot-pop .45s .35s both}#chest-content .copy-track{width:min(380px,85%);margin:12px auto;height:13px}#chest-content .reveal-name{font-size:24px;margin:12px 0 18px;animation:loot-pop .4s both}.loot-summary{width:100%}.loot-summary>div{margin:14px 0!important;padding:14px!important;gap:18px;animation:loot-pop .5s both}.loot-summary>div:nth-child(2){animation-delay:.08s}.loot-summary>div:nth-child(3){animation-delay:.16s}.loot-summary>div:nth-child(4){animation-delay:.24s}.loot-summary svg,.loot-summary img,.loot-summary canvas{width:84px!important;height:84px!important;object-fit:contain;flex-shrink:0}.loot-amount{animation:loot-pop .55s both}.chest-save-note{font-size:12px;opacity:.7}
@keyframes chest-anticipation{0%,70%,100%{transform:translateY(0) rotate(0)}78%{transform:translateY(-8px) rotate(-4deg)}85%{transform:translateY(-8px) rotate(4deg)}}@keyframes seal-burst{0%{transform:scale(1)}20%{transform:rotate(-7deg) scale(.95)}35%{transform:rotate(8deg) scale(1.04)}50%{transform:rotate(-10deg) scale(1.08)}65%{transform:rotate(9deg) scale(1.1);filter:brightness(1.2)}85%{transform:scale(1.18);filter:brightness(1.8)}100%{transform:scale(1.35) translateY(-20px);opacity:0;filter:brightness(2)}}@keyframes seal-rays{0%{opacity:.1;transform:scale(.6)}100%{opacity:.5;transform:scale(1.5) rotate(70deg)}}@keyframes card-arrival{0%{opacity:0;transform:translateY(55px) rotateY(-65deg) scale(.6)}65%{opacity:1;transform:translateY(-10px) rotateY(6deg) scale(1.05)}100%{transform:none}}@keyframes loot-pop{0%{opacity:0;transform:translateY(16px) scale(.88)}75%{opacity:1;transform:scale(1.035)}100%{transform:none}}@keyframes treasure-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){#chest-content *,#chest-content .chest-stage::before,.credit-success{animation:none!important}.spell-credit-choice{transition:none}}
.spell-credit-choice[aria-pressed=true]{color:#fff3c9!important}.spell-credit-choice[aria-pressed=true] small{color:#fff3c9!important}
#chest-next{display:block;margin:18px auto 12px!important}#chest-content .chest-stage.opened{overflow:visible}#chest-content .revealed-card>strong{z-index:3}#chest-dialog{box-sizing:border-box}

/* Contain animated rays and card transforms so they cannot move the dialog. */
#chest-dialog{height:min(820px,96svh)!important;overflow:hidden!important;overscroll-behavior:none;padding:clamp(10px,2vh,22px)!important}
#chest-content{height:100%;min-height:0;display:grid;grid-template-rows:auto auto minmax(0,1fr) auto auto auto;gap:6px;overflow:hidden}
#chest-content>h2{margin:4px 0!important;font-size:clamp(22px,4vh,38px)}
#chest-content>.chest-stage,#chest-content>.chest-stage.opened{min-height:0!important;overflow:clip!important;max-width:100%;padding:12px;box-sizing:border-box}
#chest-content .chest-stage::before{max-width:80%;max-height:90%}
#chest-content .chest-rays{pointer-events:none}
#chest-next{margin:4px auto!important;min-height:48px;padding:10px 24px!important;font-size:clamp(16px,2.8vh,22px)!important;max-width:100%}
#chest-skip{margin:0 auto!important;min-height:32px;padding:6px 15px}
#chest-content .chest-save-note{margin:2px 0!important;font-size:11px}
#chest-content .revealed-card{flex-shrink:1;min-height:0;height:clamp(90px,24vh,240px);width:clamp(100px,26vh,260px)}
#chest-content .revealed-card img,#chest-content .revealed-card svg,#chest-content .revealed-card canvas{width:75%!important;height:75%!important}
#chest-content .reveal-name{font-size:clamp(16px,2.8vh,24px);margin:4px 0 10px}
#chest-content .chest-stage>p{margin:12px 0 2px;font-size:13px}
#chest-content .loot-summary{max-height:100%;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#d0b0ff #292443}

/* Keep a quiet reveal when the browser requests less movement. No spins or zooms. */
@keyframes treasure-gentle-reveal{from{opacity:.25}to{opacity:1}}
@keyframes treasure-gentle-open{0%,65%{opacity:1}100%{opacity:.2}}
@media(prefers-reduced-motion:reduce){
 #chest-content .chest-burst .treasure-icon{animation:treasure-gentle-open 1.25s linear both!important}
 #chest-content .revealed-card,#chest-content .coin-art,#chest-content .loot-amount,#chest-content .loot-summary>div{animation:treasure-gentle-reveal .35s ease-out both!important}
}

#chest-dialog[data-chest-motion=full] .chest-burst .treasure-icon{animation:seal-burst 1.25s ease-in both!important}
#chest-dialog[data-chest-motion=full] .chest-burst::before{animation:seal-rays 1.25s ease-in both!important}
#chest-dialog[data-chest-motion=full] .revealed-card{animation:card-arrival .7s cubic-bezier(.2,.8,.2,1) both!important}
#chest-dialog[data-chest-motion=full] .revealed-card strong,#chest-dialog[data-chest-motion=full] .reveal-name,#chest-dialog[data-chest-motion=full] .loot-amount,#chest-dialog[data-chest-motion=full] .loot-summary>div{animation:loot-pop .45s both!important}
#chest-dialog[data-chest-motion=gentle] .chest-stage::before{animation:none!important}
#chest-dialog[data-chest-motion=gentle] .chest-burst .treasure-icon{animation:treasure-gentle-open 1.25s linear both!important}
#chest-dialog[data-chest-motion=gentle] .revealed-card,#chest-dialog[data-chest-motion=gentle] .loot-amount,#chest-dialog[data-chest-motion=gentle] .loot-summary>div{animation:treasure-gentle-reveal .35s ease-out both!important}
.chest-motion-toggle{font-size:11px!important;padding:3px 10px!important;margin-top:4px;min-height:24px}

/* Seal flash and a bounded, rarity-colored burst inside the reward stage. */
.chest-seal-flash{position:absolute;inset:0;z-index:30;border-radius:inherit;background:white;pointer-events:none;animation:chest-white-flash .6s ease-out both}
@keyframes chest-white-flash{0%,8%{opacity:.94}100%{opacity:0}}
.treasure-reveal-fx{position:absolute;inset:0;pointer-events:none;display:grid;place-items:center;z-index:0;color:var(--reveal-color,#ffe59a)}
.treasure-spark{position:absolute;font-style:normal;font-size:22px;filter:drop-shadow(0 0 7px currentColor);animation:treasure-spark-launch 1.3s var(--delay) ease-out both}
.treasure-rune{position:absolute;width:170px;height:170px;border:3px solid currentColor;border-radius:50%;box-shadow:0 0 20px currentColor,inset 0 0 14px currentColor;animation:treasure-rune-bloom 1.2s ease-out both}
@keyframes treasure-spark-launch{0%{opacity:0;transform:scale(.15)}18%{opacity:1}100%{opacity:0;transform:translate(var(--sx),var(--sy)) rotate(110deg) scale(.4)}}
@keyframes treasure-rune-bloom{0%{opacity:.9;transform:scale(.2) rotate(-40deg)}100%{opacity:0;transform:scale(1.7) rotate(25deg)}}
#chest-content .treasure-celebrate .revealed-card{animation:treasure-card-spring .85s cubic-bezier(.18,.8,.25,1) both;z-index:1}
#chest-content .treasure-celebrate .coin-art{animation:treasure-card-spring .85s cubic-bezier(.18,.8,.25,1) both}
#chest-content .treasure-celebrate .reveal-name{animation:loot-pop .45s .2s both}
#chest-content .treasure-celebrate .copy-track i{transform-origin:left;animation:treasure-fill .7s .25s both}
#chest-content .treasure-jackpot .revealed-card{box-shadow:0 0 48px color-mix(in srgb,var(--reveal-color) 65%,transparent)}
@keyframes treasure-card-spring{0%{opacity:0;transform:translateY(48px) rotate(-12deg) scale(.25)}45%{opacity:1;transform:translateY(-12px) rotate(5deg) scale(1.1)}70%{transform:translateY(4px) rotate(-2deg) scale(.97)}100%{transform:none}}
@keyframes treasure-fill{from{transform:scaleX(0)}to{transform:scaleX(1)}}
#chest-dialog[data-chest-motion=gentle] .chest-seal-flash{display:none}
#chest-dialog[data-chest-motion=gentle] .treasure-reveal-fx{display:none}
#chest-dialog[data-chest-motion=gentle] .treasure-celebrate .revealed-card,#chest-dialog[data-chest-motion=gentle] .treasure-celebrate .coin-art,#chest-dialog[data-chest-motion=gentle] .treasure-celebrate .copy-track i{animation:treasure-gentle-reveal .35s both!important}
@media(prefers-reduced-motion:reduce){.chest-seal-flash,.treasure-reveal-fx{display:none}#chest-content .treasure-celebrate .revealed-card,#chest-content .treasure-celebrate .coin-art,#chest-content .treasure-celebrate .copy-track i{animation:treasure-gentle-reveal .35s both!important}}

/* A living arcane engine surrounds the loot, within the existing mobile stage. */
.treasure-portal{position:absolute;inset:0;pointer-events:none;display:grid;place-items:center;color:var(--reveal-color,#ffe59a);z-index:-1;overflow:hidden;contain:layout paint}
.treasure-orbit{position:absolute;width:min(70%,300px);aspect-ratio:1;border-radius:50%;border:2px dashed currentColor;opacity:.6;animation:treasure-engine 6s linear infinite}
.treasure-orbit.orbit-1{width:min(85%,360px);border:7px double currentColor;opacity:.22;animation-direction:reverse;animation-duration:11s}
.treasure-orbit.orbit-2{width:min(52%,220px);border:0;background:repeating-conic-gradient(transparent 0deg 20deg,currentColor 21deg 25deg,transparent 26deg 45deg);opacity:.18;animation-duration:4s;filter:blur(2px)}
.treasure-orbit-rune{position:absolute;font:bold 23px Georgia;color:inherit;text-shadow:0 0 12px currentColor;animation:treasure-rune-orbit 5s var(--phase) linear infinite}
@keyframes treasure-engine{to{transform:rotate(360deg)}}
@keyframes treasure-rune-orbit{0%{transform:rotate(var(--orbit)) translateX(110px) rotate(0deg) scale(.7);opacity:.3}50%{opacity:1;scale:1.15}100%{transform:rotate(calc(var(--orbit) + 360deg)) translateX(110px) rotate(-360deg) scale(.7);opacity:.3}}
#chest-content .treasure-charging .treasure-icon{animation:treasure-chest-hover 1.65s ease-in-out infinite;position:relative;z-index:1}
@keyframes treasure-chest-hover{0%,100%{transform:translateY(4px) rotate(-3deg)}45%{transform:translateY(-14px) rotate(3deg)}55%{transform:translateY(-14px) rotate(-2deg)}65%{transform:translateY(-12px) rotate(2deg)}}
#chest-content .chest-burst .treasure-portal{animation:treasure-engine-overload 1.25s ease-in both}
@keyframes treasure-engine-overload{0%{transform:scale(1)}65%{transform:scale(.6) rotate(100deg);filter:brightness(2)}100%{transform:scale(1.8) rotate(190deg);filter:brightness(4);opacity:0}}
#chest-content .treasure-unleashed .revealed-card::before{content:'';position:absolute;inset:-4px;border-radius:inherit;border:3px solid var(--reveal-color);pointer-events:none;animation:treasure-card-aura 2s .7s ease-out infinite}
#chest-content .treasure-unleashed .revealed-card::after{content:'';position:absolute;inset:0;border-radius:inherit;background:linear-gradient(115deg,transparent 25%,#fff8 45%,transparent 65%);background-size:300% 100%;pointer-events:none;animation:treasure-card-sheen 2.4s .6s ease-in-out infinite}
#chest-content .treasure-unleashed .revealed-card>img,#chest-content .treasure-unleashed .revealed-card>svg,#chest-content .treasure-unleashed .revealed-card>canvas{animation:treasure-loot-dance 2s .85s ease-in-out infinite}
#chest-content .treasure-unleashed .coin-art{animation:treasure-card-spring .85s both,treasure-loot-dance 1.4s .85s ease-in-out infinite}
#chest-content .treasure-unleashed .revealed-card>strong{animation:loot-pop .5s .35s both,treasure-count-bop 2s 1s ease-in-out infinite}
@keyframes treasure-card-aura{0%{opacity:.7;transform:scale(1)}100%{opacity:0;transform:scale(1.13)}}
@keyframes treasure-card-sheen{0%,25%{background-position:140% 0}75%,100%{background-position:-40% 0}}
@keyframes treasure-loot-dance{0%,100%{transform:translateY(0) rotate(-3deg) scale(1)}50%{transform:translateY(-7px) rotate(3deg) scale(1.05)}}
@keyframes treasure-count-bop{0%,75%,100%{transform:scale(1)}85%{transform:scale(1.12) rotate(-4deg)}92%{transform:scale(.97) rotate(2deg)}}
#chest-dialog[data-chest-motion=gentle] .treasure-portal{display:none}
#chest-dialog[data-chest-motion=gentle] .treasure-unleashed *{animation:none!important}
#chest-dialog[data-chest-motion=gentle] .revealed-card::before,#chest-dialog[data-chest-motion=gentle] .revealed-card::after{display:none}
@media(prefers-reduced-motion:reduce){.treasure-portal{display:none}#chest-content .treasure-unleashed *,#chest-content .treasure-charging .treasure-icon{animation:none!important}#chest-content .revealed-card::before,#chest-content .revealed-card::after{display:none}}

/* First arrival: gather the magic before the player breaks the seal. */
#chest-dialog.treasure-popup-build{animation:treasure-popup-rise 1s cubic-bezier(.2,.8,.2,1) both}
#chest-dialog.treasure-popup-build .treasure-charging .treasure-icon{animation:treasure-popup-charge 1s ease-out both,treasure-chest-hover 1.65s 1s ease-in-out infinite}
#chest-dialog.treasure-popup-build .treasure-charging .treasure-portal{animation:treasure-popup-gather 1s ease-out both}
@keyframes treasure-popup-rise{0%{opacity:0;transform:translateY(28px) scale(.9)}65%{opacity:1;transform:translateY(-4px) scale(1.015)}100%{transform:none}}
@keyframes treasure-popup-charge{0%{transform:translateY(36px) scale(.55)}70%{transform:translateY(-14px) scale(1.08)}100%{transform:translateY(4px) rotate(-3deg)}}
@keyframes treasure-popup-gather{0%{opacity:0;transform:scale(1.8) rotate(-60deg)}70%{opacity:1;transform:scale(.8) rotate(15deg)}100%{transform:none}}
#chest-dialog[data-chest-motion=gentle].treasure-popup-build{animation:treasure-gentle-reveal .35s both}
#chest-dialog[data-chest-motion=gentle].treasure-popup-build .treasure-icon{animation:none!important}
@media(prefers-reduced-motion:reduce){#chest-dialog.treasure-popup-build{animation:treasure-gentle-reveal .35s both}#chest-dialog.treasure-popup-build .treasure-icon{animation:none!important}}

/* Full-screen treasure theatre, including short mobile landscape viewports. */
html body #chest-dialog.treasure-screen{position:fixed!important;inset:0!important;margin:0!important;box-sizing:border-box!important;width:100vw!important;height:100dvh!important;max-width:none!important;max-height:none!important;padding: max(12px,env(safe-area-inset-top)) max(18px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(18px,env(safe-area-inset-left))!important;border:0!important;border-radius:0!important;overflow:hidden!important;zoom:1!important;background:radial-gradient(ellipse at 50% 42%,#69468d 0,#30234f 45%,#11172e 100%)!important;isolation:isolate;animation:treasure-gentle-reveal .45s both!important}
#chest-dialog.treasure-screen::backdrop{background:#11172e}
html body #chest-dialog.treasure-screen #chest-content{position:relative;z-index:2;display:grid!important;grid-template-rows:auto auto minmax(0,1fr) auto auto auto!important;width:min(760px,78vw);height:100%!important;margin:auto;min-height:0!important;gap:5px;overflow:visible!important}
html body #chest-dialog.treasure-screen #chest-content>.chest-stage{position:relative;display:flex!important;flex-direction:column;align-items:center;justify-content:center;gap:6px!important;height:100%!important;min-height:0!important;max-height:100%!important;padding:12px!important;overflow:visible!important}
html body #chest-dialog.treasure-screen #chest-content>small{text-align:center;letter-spacing:.22em;color:#d9bef5}
html body #chest-dialog.treasure-screen #chest-content>h2{font-size:clamp(20px,4vh,38px)!important;margin:0!important}
html body #chest-dialog.treasure-screen .treasure-icon{width:clamp(100px,32vh,280px)!important;height:clamp(95px,30vh,265px)!important;flex:none!important}
html body #chest-dialog.treasure-screen .revealed-card{width:clamp(95px,25vh,240px)!important;height:clamp(90px,23vh,220px)!important;flex:none!important}
html body #chest-dialog.treasure-screen .revealed-card img,html body #chest-dialog.treasure-screen .revealed-card svg,html body #chest-dialog.treasure-screen .revealed-card canvas{width:75%!important;height:75%!important}
html body #chest-dialog.treasure-screen .reveal-name{font-size:clamp(14px,2.8vh,25px)!important;margin:0!important}
html body #chest-dialog.treasure-screen #chest-next{min-height:40px!important;min-width:min(310px,70vw);padding:8px 24px!important;margin:0 auto!important;font-size:clamp(16px,2.8vh,23px)!important}
html body #chest-dialog.treasure-screen #chest-skip{min-height:25px!important;margin:0 auto!important;padding:3px 12px!important}
html body #chest-dialog.treasure-screen .chest-save-note{font-size:10px!important;margin:0!important;line-height:1.1}
html body #chest-dialog.treasure-screen .chest-save-note br{display:none}
html body #chest-dialog.treasure-screen .chest-motion-toggle{font-size:10px;min-height:22px;padding:2px 8px;margin-left:8px}
html body #chest-dialog.treasure-screen .loot-summary{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px!important;max-height:100%!important;overflow:auto!important}
html body #chest-dialog.treasure-screen .loot-summary>div{margin:0!important;padding:8px!important}
.treasure-sky{position:absolute;inset:0;pointer-events:none;z-index:0;overflow:hidden;background:repeating-conic-gradient(from 10deg at 50% 43%,#ac87ee0d 0deg 12deg,transparent 12deg 28deg)}
.treasure-sky::before,.treasure-sky::after{content:'';position:absolute;left:10%;top:-45%;width:80%;aspect-ratio:1;border:2px solid #cfa2ff26;border-radius:45%;animation:treasure-engine 38s linear infinite}
.treasure-sky::after{left:30%;top:0;animation-direction:reverse;animation-duration:29s;border:28px double #cfa2ff12}
.treasure-sky i{position:absolute;left:var(--x);top:var(--y);width:4px;height:4px;border-radius:50%;background:#e5cbff;box-shadow:0 0 10px #dab5ff;animation:treasure-sky-drift 6s var(--d) ease-in-out infinite}
@keyframes treasure-sky-drift{0%,100%{transform:translateY(20px) scale(.3);opacity:.1}50%{transform:translateY(-25px) scale(1.1);opacity:.8}}
.treasure-wand{position:absolute;left:4vw;bottom:15vh;width:clamp(70px,14vw,180px);height:clamp(70px,14vw,180px);z-index:3;pointer-events:none;filter:drop-shadow(0 0 16px #b384ff88);animation:treasure-wand-idle 3s ease-in-out infinite}
.treasure-wand svg{width:100%;height:100%}
@keyframes treasure-wand-idle{50%{transform:translateY(-10px) rotate(-5deg)}}

@keyframes treasure-wand-cast{35%{transform:rotate(-18deg) translate(-6px,8px)}75%{transform:rotate(8deg) translate(8px,-6px);filter:brightness(1.8)}100%{transform:none}}
.treasure-wand-shot{position:absolute;left:0;top:0;z-index:5;width:20px;height:20px;border-radius:50%;pointer-events:none;background:#fff;box-shadow:0 0 12px 5px #e6d0ff,0 0 35px 12px #bfa3ff;animation:treasure-wand-flight .36s ease-in both}
@keyframes treasure-wand-flight{0%{opacity:0;transform:translate(var(--from-x),var(--from-y)) scale(.2)}20%{opacity:1}90%{opacity:1}100%{transform:translate(var(--to-x),var(--to-y)) scale(1.4);opacity:0}}
#chest-dialog[data-chest-motion=gentle] .treasure-sky *,#chest-dialog[data-chest-motion=gentle] .treasure-wand{animation:none!important}
#chest-dialog[data-chest-motion=gentle] .treasure-wand-shot{display:none}
@media(prefers-reduced-motion:reduce){.treasure-sky *,.treasure-sky::before,.treasure-sky::after,.treasure-wand{animation:none!important}.treasure-wand-shot{display:none}}
html body #chest-dialog.treasure-screen{color:#fff!important}

/* Local magic pulses replace the full-screen white flash. */
.chest-seal-flash{border-radius:50%;background:radial-gradient(ellipse,#fff0b8aa 0,#d2a4ff66 35%,transparent 70%);animation:treasure-soft-impact .65s ease-out both}
@keyframes treasure-soft-impact{0%{opacity:0}18%{opacity:.38}100%{opacity:0}}
.chest-fracture{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;opacity:0;overflow:visible}
.chest-fracture path{fill:none;stroke:#ffecaa;stroke-width:1.7;stroke-linejoin:round;stroke-linecap:round;stroke-dasharray:230;stroke-dashoffset:230;filter:drop-shadow(0 0 3px #ffce79)}
.chest-burst .chest-fracture{animation:treasure-crack-light 1.25s both}
.chest-burst .chest-fracture path{animation:treasure-crack-spread .65s .25s ease-out both}
@keyframes treasure-crack-light{0%,20%{opacity:0}40%,85%{opacity:1}100%{opacity:0}}
@keyframes treasure-crack-spread{to{stroke-dashoffset:0}}
.chest-fragments{position:absolute;inset:0;pointer-events:none;overflow:hidden;z-index:4}
.chest-fragments i{position:absolute;background-position:center;background-size:contain;background-repeat:no-repeat;animation:treasure-shard-flight .95s cubic-bezier(.15,.7,.3,1) both}
@keyframes treasure-shard-flight{0%{opacity:1;transform:translate(0,0) rotate(0)}65%{opacity:.7}100%{opacity:0;transform:translate(var(--dx),var(--dy)) rotate(var(--spin)) scale(.65)}}
#chest-content .treasure-unleashed .revealed-card::before{animation:treasure-soft-card-pulse 2.6s .6s ease-out infinite}
@keyframes treasure-soft-card-pulse{0%,100%{opacity:.08;transform:scale(1)}35%{opacity:.32;transform:scale(1.035)}75%{opacity:0;transform:scale(1.1)}}
#chest-dialog[data-chest-motion=gentle] .chest-fracture,#chest-dialog[data-chest-motion=gentle] .chest-fragments{display:none}
@media(prefers-reduced-motion:reduce){.chest-fracture,.chest-fragments{display:none}}
/* A concentrated lightning surge travels along the fractures just before rupture. */
.chest-burst .chest-fracture path{animation:treasure-crack-spread .65s .25s ease-out both,treasure-crack-surge .35s .75s ease-out both}
@keyframes treasure-crack-surge{0%{stroke:#ffecaa;stroke-width:1.7;filter:drop-shadow(0 0 3px #ffce79)}45%{stroke:#fff7d4;stroke-width:2.4;filter:drop-shadow(0 0 7px #ffc66a) drop-shadow(0 0 10px #c18aff)}100%{stroke:#ffe7a0;stroke-width:1.8;filter:drop-shadow(0 0 4px #ffc66a)}}
.treasure-card-chip{position:absolute;left:0;top:0;z-index:7;width:19px;height:25px;display:grid;place-items:center;background:linear-gradient(135deg,#fff2b6,#c09aff);border:2px solid white;border-radius:4px;color:#70439f;font:bold 15px system-ui;box-shadow:0 0 9px #deb5ff;pointer-events:none;animation:treasure-card-deposit .45s ease-in both}
@keyframes treasure-card-deposit{0%{opacity:0;transform:translate(var(--cx),var(--cy)) rotate(-15deg) scale(.6)}20%{opacity:1}85%{opacity:1}100%{opacity:0;transform:translate(var(--tx),var(--ty)) rotate(12deg) scale(.25)}}
#chest-content .copy-track.card-deposit{animation:treasure-bar-tick .25s ease-out}
@keyframes treasure-bar-tick{0%{box-shadow:0 0 12px #fdeec3}100%{box-shadow:0 0 0 transparent}}
@media(prefers-reduced-motion:reduce){.treasure-card-chip{display:none}#chest-content .copy-track.card-deposit{animation:none}}

/* Duplicate-card alchemy: a coin press, spinning spray, then a collected total. */
.duplicate-mint{position:absolute;inset:0;pointer-events:none;z-index:8;overflow:visible}
.duplicate-mint>*{position:absolute;left:var(--mint-x);top:var(--mint-y);box-sizing:border-box}
.duplicate-minting .revealed-card{animation:hex-dupe-card-melt 1.85s ease-in-out both!important}
.duplicate-sigil{width:190px;height:190px;margin:-95px;border:2px solid #ffe39c;border-radius:50%;box-shadow:0 0 25px #ffc75f55,inset 0 0 25px #c794ff55;animation:hex-dupe-sigil 1.6s ease-out both}
.duplicate-sigil:after{content:'✧  ✦  ✧';display:block;text-align:center;color:#fff0b1;letter-spacing:16px;line-height:190px}
.duplicate-hero-coin,.duplicate-flying-coin{display:grid;place-items:center;border-radius:50%;border:3px solid #fff0ae;background:radial-gradient(circle at 32% 25%,#fff2b5,#ffc44d 48%,#c67621 90%);color:#a55c18;text-shadow:0 1px #fff5b9;box-shadow:inset 0 0 0 4px #d5902c,0 5px 0 #93521d,0 0 24px #ffd77166;font-style:normal}
.duplicate-hero-coin{width:94px;height:94px;margin:-47px;font-size:55px;animation:hex-dupe-gold-form 1.65s cubic-bezier(.2,.8,.2,1) both}
.duplicate-flying-coin{width:28px;height:28px;margin:-14px;font-size:18px;border-width:2px;box-shadow:inset 0 0 0 2px #d5902c,0 3px #93521d,0 0 12px #ffda7977;animation:hex-dupe-coin-flight 1.15s var(--coin-delay) cubic-bezier(.2,.7,.3,1) both}
.duplicate-coin-total{width:260px;margin-left:-130px;text-align:center;color:#fff0a9;font:900 26px 'Trebuchet MS',sans-serif;text-shadow:0 3px #563126,0 0 18px #ffcf69;animation:hex-dupe-total 1.85s ease-out both}
@keyframes hex-dupe-card-melt{0%,10%{filter:brightness(1);opacity:1}25%{filter:brightness(1.8) sepia(.65);transform:scale(1.04);opacity:1}40%,80%{transform:scale(.85);opacity:.12}100%{filter:none;transform:none;opacity:1}}
@keyframes hex-dupe-sigil{0%{opacity:0;transform:scale(.5) rotate(-35deg)}30%{opacity:1}100%{opacity:0;transform:scale(1.6) rotate(65deg)}}
@keyframes hex-dupe-gold-form{0%,14%{opacity:0;transform:scale(.1) rotateY(90deg)}40%{opacity:1;transform:scale(1.15) rotateY(360deg)}65%{opacity:1;transform:scale(1) rotateY(720deg)}100%{opacity:0;transform:translateY(var(--mint-drop)) scale(.25) rotateY(1080deg)}}
@keyframes hex-dupe-coin-flight{0%,22%{opacity:0;transform:scale(.2)}40%{opacity:1;transform:translate(var(--coin-x),var(--coin-y)) rotateY(180deg) scale(1)}70%{opacity:1;transform:translate(var(--coin-x),var(--coin-y)) rotateY(540deg)}100%{opacity:0;transform:translate(0,var(--mint-drop)) rotateY(900deg) scale(.3)}}
@keyframes hex-dupe-total{0%,45%{opacity:0;transform:translateY(var(--mint-drop)) scale(.7)}65%,90%{opacity:1;transform:translateY(var(--mint-drop)) scale(1)}100%{opacity:0;transform:translateY(var(--mint-drop)) scale(1)}}
[data-chest-motion=gentle] .duplicate-minting .revealed-card{animation:none!important}
[data-chest-motion=gentle] .duplicate-sigil{display:none}
[data-chest-motion=gentle] .duplicate-hero-coin{animation:hex-dupe-gentle .45s both}
[data-chest-motion=gentle] .duplicate-coin-total{animation:none;transform:translateY(var(--mint-drop))}
@keyframes hex-dupe-gentle{from{opacity:0}to{opacity:1}}

/* Full seal-breaking sequence: charge, crack, release, treasure shower. */
.grand-chest-fx{position:absolute;inset:0;z-index:5;pointer-events:none;overflow:visible}
.grand-chest-fx>*{position:absolute;left:50%;top:50%;box-sizing:border-box}
.grand-charge-ring,.grand-shock-ring{width:240px;height:240px;margin:-120px;border:2px solid #ffe6a9;border-radius:50%;box-shadow:0 0 24px #ffc46055,inset 0 0 24px #c492ff55}
.grand-charge-ring{border-style:dashed;animation:hex-chest-charge-ring 1.15s ease-in both}
.grand-shock-ring{animation:hex-chest-shock .8s 1.12s ease-out both}
.grand-seal{margin:-32px;width:64px;height:64px;display:grid;place-items:center;font-size:60px;color:#fff1bc;text-shadow:0 0 15px #ffd578,0 0 30px #c080ff;animation:hex-chest-seal 1.3s ease-in both}
.grand-light-column{width:220px;height:320px;margin:-250px -110px;background:linear-gradient(0deg,#fff2b799,#e8c0ff44,transparent);clip-path:polygon(38% 100%,0 0,100% 0,62% 100%);transform-origin:50% 100%;animation:hex-chest-light 1s 1.08s ease-out both}
.grand-burst-coin{display:grid;place-items:center;width:26px;height:26px;margin:-13px;border:2px solid #fff1ac;border-radius:50%;background:linear-gradient(130deg,#fff0a0,#e5a332);box-shadow:inset 0 0 0 2px #c27a23,0 3px #825020,0 0 12px #ffd47666;color:#8e501e;font:bold 18px Georgia;animation:hex-chest-coin-shower 1s var(--burst-delay) ease-out both}
#chest-content .chest-burst .treasure-icon{animation:hex-chest-pressure 1.35s ease-in both!important}
#chest-content .chest-burst .chest-fracture{filter:drop-shadow(0 0 9px #ffe8a8);animation:hex-chest-crack 1.25s both!important}
@keyframes hex-chest-pressure{0%{transform:var(--chest-start-transform,translateY(4px) rotate(-3deg));filter:var(--chest-start-filter,none)}30%{transform:translateY(-8px) rotate(-2deg)}45%{transform:translateY(-11px) rotate(3deg)}60%{transform:translateY(-11px) rotate(-4deg);filter:brightness(1.1)}72%{transform:translateY(-12px) rotate(4deg)}82%{transform:translateY(-12px) scale(.95);filter:brightness(1.4)}90%{transform:translateY(-18px) scale(1.12);opacity:1}100%{transform:translateY(-22px) scale(1.2);opacity:0}}
@keyframes hex-chest-charge-ring{from{opacity:0;transform:scale(1.6) rotate(-100deg)}45%{opacity:.7}to{opacity:1;transform:scale(.55) rotate(90deg)}}
@keyframes hex-chest-shock{from{opacity:.9;transform:scale(.25)}to{opacity:0;transform:scale(2)}}
@keyframes hex-chest-seal{0%{opacity:0;transform:scale(.3)}45%,80%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(1.8)}}
@keyframes hex-chest-light{0%{opacity:0;transform:scaleY(.1)}25%{opacity:.8;transform:scaleY(1)}100%{opacity:0;transform:scaleY(1.2)}}
@keyframes hex-chest-crack{0%,30%{opacity:0}60%{opacity:.5}90%,100%{opacity:1}}
@keyframes hex-chest-coin-shower{0%{opacity:0;transform:scale(.2)}12%{opacity:1}55%{opacity:1;transform:translate(var(--burst-x),var(--burst-y)) rotateY(var(--burst-rotation)) scale(1)}100%{opacity:0;transform:translate(var(--burst-x),90px) rotateY(var(--burst-rotation)) scale(.4)}}
[data-chest-motion=gentle] .grand-chest-fx{display:none}
#chest-dialog[data-chest-motion=gentle] .chest-burst .treasure-icon{animation:hex-dupe-gentle .4s both!important}
@media(prefers-reduced-motion:reduce){.grand-chest-fx{display:none}#chest-content .chest-burst .treasure-icon{animation:hex-dupe-gentle .4s both!important}}
.duplicate-minting > p{visibility:hidden}
/* Cinematic pass: procedural light/metal replaces the flat seal and coin sprites. */
.treasure-cinema{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:12;border-radius:inherit}
#chest-dialog:not([data-chest-motion=gentle]) .duplicate-sigil,
#chest-dialog:not([data-chest-motion=gentle]) .duplicate-hero-coin,
#chest-dialog:not([data-chest-motion=gentle]) .duplicate-flying-coin{display:none}
.duplicate-minting .revealed-card{animation-duration:1.4s!important}
.duplicate-coin-total{animation-duration:1.4s;z-index:14;font-size:30px}
.chest-fragments i{animation:hex-chest-heavy-shard 1.7s cubic-bezier(.12,.6,.4,1) both}
@keyframes hex-chest-heavy-shard{0%{opacity:1;transform:translate(0,0) rotate(0)}40%{opacity:1;transform:translate(var(--dx),calc(var(--dy) - 65px)) rotate(var(--spin))}100%{opacity:0;transform:translate(calc(var(--dx) * 1.7),calc(var(--dy) + 130px)) rotate(calc(var(--spin) * 2.5)) scale(.45)}}
@media(prefers-reduced-motion:reduce){.treasure-cinema{display:none}}
#chest-dialog[data-chest-motion=full] .chest-burst::before,
#chest-content .duplicate-minting::before{display:none!important}
#chest-dialog[data-chest-motion=full] .chest-burst .treasure-icon{animation:hex-chest-pressure 1.25s ease-in both!important}
/* The casting mote sheds a curling wake instead of travelling as a static dot. */
.treasure-wand-shot::before,.treasure-wand-shot::after{content:'';position:absolute;right:8px;top:5px;width:58px;height:9px;border-radius:100%;transform-origin:right center;background:linear-gradient(90deg,transparent,#c08bff88,#fff3c6);animation:hex-cast-wake .18s ease-in-out infinite alternate}
.treasure-wand-shot::after{width:39px;top:12px;background:linear-gradient(90deg,transparent,#f5cf7d88,#fff4c9);animation-delay:-.09s}
@keyframes hex-cast-wake{from{transform:rotate(-18deg) scaleX(.7);opacity:.5}to{transform:rotate(18deg) scaleX(1.2);opacity:1}}
html body #chest-dialog.treasure-screen .treasure-unleashed .coin-art,
html body #chest-dialog.treasure-screen .treasure-unleashed .revealed-card{animation:hex-reward-settle .48s cubic-bezier(.22,.7,.3,1) both!important}
@keyframes hex-reward-settle{from{opacity:0;transform:translateY(10px) scale(.97)}to{opacity:1;transform:translateY(0) scale(1)}}
@keyframes treasure-wand-flight{0%{opacity:0;transform:translate(var(--from-x),var(--from-y)) scale(.15)}35%{opacity:.7}70%{opacity:1}100%{transform:translate(var(--to-x),var(--to-y)) scale(1);opacity:0}}
@media(prefers-reduced-motion:reduce){#chest-dialog[open]{view-transition-name:none}}
@media(prefers-reduced-motion:reduce){html body #chest-dialog.treasure-screen .treasure-unleashed .coin-art,html body #chest-dialog.treasure-screen .treasure-unleashed .revealed-card{animation:hex-treasure-in .2s ease-out both!important}}
html body #chest-dialog.treasure-screen .treasure-unleashed.duplicate-minting .revealed-card{animation:hex-dupe-card-melt 1.4s ease-in-out both!important}
@media(prefers-reduced-motion:reduce){html body #chest-dialog.treasure-screen .treasure-unleashed.duplicate-minting .revealed-card{animation:none!important}}
/* A physical seam carries every reward type through the same motion, without page fading. */
.treasure-reward-rift{position:absolute;pointer-events:none;z-index:16;transition:left .48s ease,top .48s ease,width .48s ease,height .48s ease}
.treasure-rift-seam{position:absolute;left:50%;top:5%;height:90%;width:4px;margin-left:-2px;border-radius:50%;background:linear-gradient(transparent,#d8baff 18%,#efffff 50%,#d8baff 82%,transparent);box-shadow:0 0 10px #bda0ff88;animation:hex-seam-gather .22s ease-in both}
@keyframes hex-seam-gather{from{transform:scaleY(.12) scaleX(.25)}to{transform:scaleY(1) scaleX(1)}}
.treasure-reward-rift.opening .treasure-rift-seam{left:0;width:100%;margin:0;box-sizing:border-box;background:none;border:2px solid #d9eaff;border-radius:50%;box-shadow:0 0 10px #bda0ff66;animation:hex-seam-unfold .5s cubic-bezier(.16,.8,.25,1) both}
@keyframes hex-seam-unfold{0%{transform:scaleX(.01);opacity:1}65%{opacity:.8}100%{transform:scaleX(1.15);opacity:0}}
.treasure-reward-rift>i{position:absolute;left:50%;top:50%;width:5px;height:12px;background:linear-gradient(135deg,#e2fdff,#b598ef88);clip-path:polygon(50% 0,100% 45%,50% 100%,0 55%);animation:hex-reward-gather .22s ease-in both}
@keyframes hex-reward-gather{from{transform:translate(var(--rx),var(--ry)) rotate(var(--turn)) scale(.7)}to{transform:translate(0,0) rotate(calc(var(--turn) + 75deg)) scale(.2)}}
.treasure-reward-rift.opening>i{animation:hex-reward-release .48s ease-out both}
@keyframes hex-reward-release{from{transform:translate(0,0) rotate(var(--turn)) scale(.2);opacity:1}to{transform:translate(var(--rx),var(--ry)) rotate(calc(var(--turn) + 90deg)) scale(.45);opacity:0}}
html body #chest-dialog.treasure-screen .treasure-unleashed .coin-art,
html body #chest-dialog.treasure-screen .treasure-unleashed .revealed-card{animation:none!important}
html body #chest-dialog.treasure-screen .treasure-unleashed.duplicate-minting .revealed-card{animation:hex-dupe-card-melt 1.4s ease-in-out both!important}
@media(prefers-reduced-motion:reduce){.treasure-reward-rift{display:none}html body #chest-dialog.treasure-screen .treasure-unleashed.duplicate-minting .revealed-card{animation:none!important}}

/* Keep first-arrival zoom on composited transform layers, with a steady prepainted glow. */
#chest-dialog .treasure-charging:not(.chest-burst) .treasure-icon{filter:drop-shadow(0 8px 12px #ffda7866);will-change:transform}
#chest-dialog.treasure-popup-build .treasure-portal{will-change:transform,opacity}
/* Readable card delivery: lift, bank, dive, then a lime impact. */
.treasure-card-flight,.treasure-card-impact,.treasure-card-spark,.treasure-card-gain{position:absolute;pointer-events:none;z-index:12}
.treasure-card-flight{width:32px;height:43px;margin:-22px 0 0 -16px;border:2px solid #fff5cf;border-radius:7px;background:linear-gradient(145deg,#eee0ff,#9866df 55%,#59308c);color:#fff6c7;display:grid;place-items:center;font:bold 24px system-ui;box-shadow:0 0 13px #cd9bff88,inset 0 0 0 3px #e6c7ff66;animation:card-bank-to-bar .44s linear both;will-change:transform}
.treasure-card-flight::after{content:'';position:absolute;inset:4px;border:1px solid #f9e8ff99;border-radius:3px}
@keyframes card-bank-to-bar{0%{opacity:0;transform:translate(var(--sx),var(--sy)) rotate(0deg) scale(.65)}20%{opacity:1;transform:translate(var(--mx),var(--my)) rotate(var(--lean)) scale(1.12)}55%{opacity:1;transform:translate(var(--bx),var(--by)) rotate(calc(var(--lean)*-1)) scale(1)}85%{opacity:1}100%{opacity:0;transform:translate(var(--tx),var(--ty)) rotate(0deg) scale(.18)}}
.treasure-card-impact{width:26px;height:26px;margin:-13px;border:3px solid #feeec5;border-radius:50%;box-shadow:0 0 12px #fcdc85,inset 0 0 8px #fde9b0;animation:card-impact-ring .45s ease-out both}
@keyframes card-impact-ring{0%{opacity:0;transform:scale(.25)}15%{opacity:1}100%{opacity:0;transform:scale(2.4,.9)}}
.treasure-card-spark{width:5px;height:10px;border-radius:3px;background:#fde7af;box-shadow:0 0 6px #fcdd87;animation:card-impact-spark .45s ease-out both}
@keyframes card-impact-spark{0%{opacity:0;transform:translate(0,0) scale(.4)}15%{opacity:1}100%{opacity:0;transform:translate(var(--dx),var(--dy)) rotate(100deg) scale(.1)}}
.treasure-card-gain{white-space:nowrap;font:bold 16px system-ui;color:#b4f9f4;text-shadow:0 2px 2px #281841,0 0 8px #72e3db66;animation:card-gain-rise .75s ease-out both}
@keyframes card-gain-rise{0%{opacity:0;transform:translate(-50%,8px) scale(.8)}22%{opacity:1;transform:translate(-50%,-7px) scale(1.12)}70%{opacity:1;transform:translate(-50%,-15px) scale(1)}100%{opacity:0;transform:translate(-50%,-22px)}}
@media(prefers-reduced-motion:reduce){.treasure-card-flight,.treasure-card-impact,.treasure-card-spark,.treasure-card-gain{display:none}}
/* Owner (Oct 10): every reward coin is the wallet coin, not a gold disc with a sparkle on it. */
html body #chest-content .coin-art,.duplicate-hero-coin,.duplicate-flying-coin{border:0;border-radius:0;background:url(/art/currency-coin.svg) center/contain no-repeat;box-shadow:none;color:transparent;text-shadow:none;font-size:0;filter:drop-shadow(0 6px 10px #0006) drop-shadow(0 0 26px #ffd98655)}
html body #chest-content .coin-art>*,.duplicate-hero-coin>*,.duplicate-flying-coin>*{display:none}
html body #chest-content .coin-art{width:150px;height:150px}
.duplicate-flying-coin{filter:drop-shadow(0 2px 3px #0006)}
