/* Soul splitter animations (splitter-fx.jsx). */
.sfx-root{position:fixed;inset:0;z-index:2147483000;display:grid;place-items:center;background:radial-gradient(circle at 50% 45%,rgba(20,12,32,.82),rgba(4,2,8,.94));backdrop-filter:blur(3px);animation:sfx-in .25s ease-out}
.sfx-root.is-leaving{opacity:0;transition:opacity .25s}
.sfx-stage{display:flex;flex-direction:column;align-items:center;gap:1.4rem;width:100%;padding:1rem;cursor:default;user-select:none}

/* roulette */
.sfx-wheel-wrap{position:relative;width:min(84vmin,620px);aspect-ratio:1}
.sfx-wheel{width:100%;height:100%;display:block;transition:transform 5.6s cubic-bezier(.1,.62,.08,1);filter:drop-shadow(0 0 30px rgba(217,164,65,.35)) drop-shadow(0 12px 30px rgba(0,0,0,.6))}
.sfx-wheel text{font-family:'Space Mono',ui-monospace,monospace;font-weight:700;letter-spacing:.02em}
.sfx-wheel .sfx-hit{font-weight:900;text-decoration:underline;text-underline-offset:3px}
.sfx-wheel g{transition:opacity .4s}
.sfx-wheel g.is-miss{opacity:.32}
.sfx-wheel g.is-hit path{animation:sfx-glow 1s ease-in-out infinite alternate}
.sfx-pointer{position:absolute;left:50%;top:-14px;z-index:2;width:34px;height:46px;margin-left:-17px;background:linear-gradient(#fff,#ffe9a0);clip-path:polygon(0 0,100% 0,50% 100%);filter:drop-shadow(0 3px 4px rgba(0,0,0,.6))}

/* slot reels */
.sfx-machine{max-width:min(94vw,980px);padding:1.4rem 1.6rem;border-radius:26px;background:linear-gradient(#ff6b7d,#d81b60 55%,#7a0f3a);box-shadow:inset 0 0 0 4px #ffd34a,inset 0 0 0 7px #a86a08,0 20px 50px rgba(0,0,0,.6)}
.sfx-reels{display:flex;flex-wrap:wrap;justify-content:center;gap:4px;padding:.7rem;border-radius:14px;background:#2a0718;box-shadow:inset 0 0 0 2px #ffd34a,inset 0 4px 14px rgba(0,0,0,.7);
  font:900 clamp(1.4rem,5vmin,3rem)/1 'Space Mono',ui-monospace,monospace;--cell:1.3em}
.sfx-fixed{display:grid;place-items:center;height:var(--cell);min-width:.5em;color:#ffd9e4}
.sfx-reel{position:relative;display:block;width:.9em;height:var(--cell);overflow:hidden;border-radius:6px;background:transparent;color:#ffd9e4;transition:box-shadow .3s,background .3s,color .3s}
.sfx-reel.is-on{background:linear-gradient(#bfc4cc,#fff 30%,#fff 70%,#bfc4cc);color:#7a0f3a}
.sfx-strip{display:block;transition-property:transform;transition-timing-function:cubic-bezier(.3,.05,.2,1)}
.sfx-strip em{display:grid;place-items:center;height:var(--cell);font-style:normal}
.sfx-reel.is-up{box-shadow:0 0 0 2px #39d98a,0 0 14px #39d98a}
.sfx-reel.is-down{box-shadow:0 0 0 2px #ff4f6a,0 0 14px #ff4f6a}
.sfx-mark{position:absolute;right:2px;top:1px;font-size:.32em;line-height:1}
.sfx-reel.is-up .sfx-mark{color:#16a34a}.sfx-reel.is-down .sfx-mark{color:#dc2626}.sfx-reel.is-same .sfx-mark{color:#9ca3af}

/* caption */
.sfx-caption{display:flex;flex-direction:column;align-items:center;gap:.4rem;min-height:6.5rem;color:#f4ebd3;text-align:center}
.sfx-caption small{font:600 .85rem/1.2 Inter,system-ui,sans-serif;letter-spacing:.08em;text-transform:uppercase;opacity:.75}
.sfx-result{padding:.35rem 1rem;border:2px solid;border-radius:999px;font:900 clamp(1.1rem,4vmin,2rem)/1.2 'Space Mono',ui-monospace,monospace;word-break:break-all;animation:sfx-pop .45s cubic-bezier(.2,1.6,.4,1)}

@keyframes sfx-in{from{opacity:0}}
@keyframes sfx-pop{from{transform:scale(.4);opacity:0}}
@keyframes sfx-glow{to{filter:brightness(1.35)}}
@media (prefers-reduced-motion:reduce){.sfx-wheel{transition-duration:1.2s}.sfx-strip{transition-duration:.6s!important}}

/* the verdict every splitter ends on */
.sfx-verdict{display:flex;flex-direction:column;align-items:center;gap:.45rem;max-width:min(92vw,760px)}
.sfx-from{font:700 clamp(.85rem,2.6vmin,1.1rem)/1.2 'Space Mono',ui-monospace,monospace;text-decoration:line-through;text-decoration-thickness:2px;opacity:.6;word-break:break-all;animation:sfx-fade .3s ease-out}
.sfx-from::after{content:' ↓';display:inline-block;text-decoration:none;margin-left:.2em}
.sfx-tags{display:flex;flex-wrap:wrap;justify-content:center;gap:.5rem;font:800 .8rem/1 Inter,system-ui,sans-serif;letter-spacing:.06em;text-transform:uppercase;animation:sfx-fade .4s .15s ease-out backwards}
.sfx-tags b{padding:.35rem .7rem;border:1px solid;border-radius:999px}
.sfx-tags b.is-up{animation:sfx-glow .7s ease-in-out 3 alternate}
.sfx-tags em{display:grid;place-items:center;padding:.35rem .7rem;border-radius:999px;background:#ffffff14;font-style:normal;color:#e9e1f5}
.sfx-tags em.is-up{background:#39d98a26;color:#5ff0a6}
.sfx-tags em.is-down{background:#ff4f6a26;color:#ff8597}

/* digit soul splitter: one reel, a slash across the machine */
.sfx-machine{position:relative}
.sfx-machine.is-knife{background:linear-gradient(#5b6474,#2b3140 60%,#151922);box-shadow:inset 0 0 0 4px #cfd6e2,inset 0 0 0 7px #6b7385,0 20px 50px rgba(0,0,0,.6)}
.sfx-machine.is-knife .sfx-reels{background:#0d1017;box-shadow:inset 0 0 0 2px #cfd6e2,inset 0 4px 14px rgba(0,0,0,.7)}
.sfx-machine.is-knife .sfx-fixed{color:#dfe6f2}
.sfx-machine.is-knife .sfx-reel{color:#dfe6f2}
.sfx-machine.is-knife .sfx-reel.is-on{color:#151922;box-shadow:0 0 0 2px #e6ecf5,0 0 18px #9fb4ff}
.sfx-slash{position:absolute;left:-4%;right:-4%;top:50%;z-index:2;height:4px;margin-top:-2px;border-radius:4px;background:linear-gradient(90deg,transparent,#fff 20%,#bcd0ff 80%,transparent);box-shadow:0 0 18px #bcd0ff;transform:rotate(-8deg) scaleX(0);transform-origin:left;pointer-events:none;animation:sfx-slash .5s .7s cubic-bezier(.6,0,.2,1) forwards}

@keyframes sfx-fade{from{opacity:0;transform:translateY(6px)}}
@keyframes sfx-slash{60%{transform:rotate(-8deg) scaleX(1);opacity:1}to{transform:rotate(-8deg) scaleX(1);opacity:0}}

/* the pause after a reveal (SplitterChoice) */
.bulk-next:has(.split-choice){width:min(25rem,calc(100vw - 24px));box-shadow:none}
.split-choice{display:flex;flex-direction:column;gap:6px;padding:8px;border-radius:16px;border:1px solid #b06bff55;background:linear-gradient(#1b1229f2,#120b1cf2);box-shadow:0 14px 40px -10px #000c,0 0 0 1px #0006;backdrop-filter:blur(8px);animation:split-in .28s cubic-bezier(.2,1.3,.4,1)}
.split-items{display:flex;flex-direction:column;gap:6px}
.split-item{display:grid;grid-template-columns:auto auto 1fr auto;align-items:center;gap:10px;padding:6px 12px 6px 8px;border-radius:11px;border:1px solid #b06bff40;background:#b06bff14;color:#f4ebff;text-align:left;cursor:pointer;transition:transform .12s,background .15s,border-color .15s,opacity .15s}
.split-item:hover:not(:disabled),.split-item:focus-visible{background:#b06bff2e;border-color:#c99bff;transform:translateX(2px);outline:none}
.split-item:active:not(:disabled){transform:scale(.98)}
.split-item:disabled{cursor:default}
.split-items:has(.is-using) .split-item:not(.is-using){opacity:.35}
.split-item.is-using{border-color:#e2c6ff;background:#b06bff38;animation:split-pulse 1s ease-in-out infinite alternate}
.split-name{display:flex;flex-direction:column;min-width:0;line-height:1.2}
.split-name b{font-size:14px;font-weight:800}
.split-name small{font-size:11.5px;opacity:.65;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.split-qty{font:700 12px/1 'Space Mono',ui-monospace,monospace;opacity:.7}
.split-choice kbd{display:grid;place-items:center;min-width:20px;height:20px;padding:0 5px;border-radius:5px;border:1px solid #ffffff30;border-bottom-width:2px;font:700 10.5px/1 'Space Mono',ui-monospace,monospace;color:#ffffffa0}
.split-skip{display:flex;align-items:center;justify-content:center;gap:10px;padding:11px;border-radius:11px;border:0;background:linear-gradient(#ffffff1c,#ffffff0c);color:#fff;font:900 1.05rem/1 Inter,system-ui,sans-serif;letter-spacing:.08em;text-transform:uppercase;cursor:pointer;transition:background .15s}
.split-skip:hover:not(:disabled){background:linear-gradient(#ffffff2c,#ffffff16)}
.split-skip:disabled{opacity:.4;cursor:default}
@keyframes split-in{from{opacity:0;transform:translateY(14px) scale(.97)}}
@keyframes split-pulse{to{box-shadow:0 0 18px -4px #c99bff}}
@media (prefers-reduced-motion:reduce){.split-choice,.sfx-slash{animation:none}.sfx-slash{transform:rotate(-8deg);opacity:.6}}

/* phones: one compact strip — icon + name chips in a row, a slim skip button */
@media (max-width:560px){
  .bulk-next:has(.split-choice){bottom:10px;width:calc(100vw - 16px)}
  .split-choice{flex-direction:row;align-items:stretch;gap:5px;padding:5px;border-radius:13px}
  .split-items{flex-direction:row;flex:1;min-width:0;gap:5px}
  .split-item{flex:1;min-width:0;grid-template-columns:1fr;justify-items:center;gap:2px;padding:5px 4px 4px;text-align:center;position:relative}
  .split-item:hover:not(:disabled),.split-item:focus-visible{transform:none}
  .split-item .ia{font-size:26px!important}
  .split-item kbd,.split-name small{display:none}
  .split-name{align-items:center}
  .split-name b{font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
  .split-qty{position:absolute;top:3px;right:4px;font-size:9.5px}
  .split-skip{flex:0 0 auto;padding:0 12px;font-size:.8rem;letter-spacing:.04em}
  .split-skip kbd{display:none}
}

/* ---------- digit morphs (morph-fx.jsx) */
.mf-stage{--a:#b07aff;--a2:#6af0ff}
.mf-horn{--a:#ff4a1a;--a2:#ffb040}.mf-gravity{--a:#7b6bff;--a2:#2a1a70}.mf-grind{--a:#ffb84a;--a2:#c9d0da}.mf-edge{--a:#e8d8ff;--a2:#6af0ff}.mf-bitflip{--a:#ff1f4f;--a2:#00ffe6}
.mf-panel{position:relative;max-width:min(94vw,980px);padding:1.6rem 2rem;border-radius:24px;background:radial-gradient(ellipse at 50% 120%,color-mix(in srgb,var(--a) 30%,transparent),transparent 70%),#0d0912;box-shadow:inset 0 0 0 2px color-mix(in srgb,var(--a) 60%,transparent),0 0 60px color-mix(in srgb,var(--a) 30%,transparent),0 20px 50px rgba(0,0,0,.6);overflow:visible}
.mf-aura{position:absolute;inset:-30px;border-radius:40px;pointer-events:none;background:radial-gradient(closest-side,color-mix(in srgb,var(--a) 22%,transparent),transparent);opacity:0;transition:opacity .5s}
.is-act .mf-aura{opacity:1;animation:mf-breathe 1s ease-in-out infinite alternate}
@keyframes mf-breathe{to{transform:scale(1.05)}}
.mf-row{position:relative;display:flex;flex-wrap:wrap;justify-content:center;font:900 clamp(2rem,7vw,4.2rem)/1.15 'Space Mono',ui-monospace,monospace;color:#f4ebff;letter-spacing:.02em}
.mf-row:has(.mf-ch:nth-child(16)){font-size:clamp(1.3rem,4vw,2.4rem)}
.mf-row:has(.mf-ch:nth-child(40)){font-size:clamp(.9rem,2.6vw,1.5rem)}
.mf-ch{position:relative;display:inline-grid;place-items:center;min-width:.62em}
.mf-ch>em{grid-area:1/1;font-style:normal}
.mf-row.is-final .mf-ch{animation:mf-land .5s cubic-bezier(.2,1.6,.4,1) calc(var(--i) * 18ms) both;text-shadow:0 0 .3em var(--a)}
@keyframes mf-land{from{transform:translateY(-.3em) scale(1.2);opacity:0}}
.mf-row.is-void .mf-ch{font-size:1.8em;color:#fff;text-shadow:0 0 .2em #000,0 0 .5em #b07aff,0 0 1.2em #6a55ff;animation:mf-void 1.6s ease-out both}
@keyframes mf-void{0%{transform:scale(.1) rotate(-90deg);opacity:0;filter:blur(8px)}60%{transform:scale(1.15) rotate(8deg);opacity:1;filter:none}100%{transform:none}}

/* horn: the digit burns, a 6 rises */
.mf-burn>em:last-child{opacity:0;color:#ffd04a;text-shadow:0 0 .2em #ff4a1a,0 0 .6em #ff2000}
.mf-burn.is-on>em:first-child{animation:mf-char 1s ease-in forwards}
.mf-burn.is-on>em:last-child{animation:mf-rise6 .8s cubic-bezier(.2,1.5,.4,1) .7s forwards}
@keyframes mf-char{30%{color:#ffb040;text-shadow:0 0 .3em #ff4a1a}100%{color:#200;opacity:0;transform:translateY(.2em) scale(.8);filter:blur(3px)}}
@keyframes mf-rise6{from{opacity:0;transform:translateY(.5em) scale(.6)}to{opacity:1;transform:none}}
.mf-fire{position:absolute;left:50%;bottom:-.1em;width:1em;height:1.3em;margin-left:-.5em;pointer-events:none;opacity:0}
.mf-burn.is-on .mf-fire{animation:mf-fade 1.5s ease-out forwards}
.mf-fire b{position:absolute;bottom:0;width:.34em;height:.7em;border-radius:50% 50% 40% 40%/70% 70% 30% 30%;background:radial-gradient(ellipse at 50% 80%,#fff3b0,#ffb040 35%,#ff4a1a 65%,transparent 72%);filter:blur(.02em);animation:mf-flame .45s ease-in-out infinite alternate;mix-blend-mode:screen}
.mf-fire b:nth-child(1){left:.05em}.mf-fire b:nth-child(2){left:.33em;height:1em;animation-delay:-.15s}.mf-fire b:nth-child(3){left:.6em;animation-delay:-.3s}.mf-fire b:nth-child(4){left:.2em;height:.5em;animation-delay:-.2s}.mf-fire b:nth-child(5){left:.48em;height:.55em;animation-delay:-.05s}
@keyframes mf-flame{to{transform:scaleY(1.25) translateY(-.06em) skewX(6deg)}}
@keyframes mf-fade{0%{opacity:0}15%{opacity:1}75%{opacity:1}100%{opacity:0}}
.mf-horn.is-act .mf-panel{animation:mf-quake .5s steps(2) 2}
@keyframes mf-quake{25%{transform:translate(2px,-1px)}50%{transform:translate(-2px,1px)}75%{transform:translate(1px,2px)}}

/* gravity: everything drops one step */
.mf-drop{overflow:hidden;height:1.15em}
.mf-drop>em{transition:transform .55s cubic-bezier(.6,0,.9,.5),opacity .4s}
.mf-drop>em:last-child{transform:translateY(-1.2em);opacity:0}
.mf-drop.is-on>em:first-child{transform:translateY(1.2em);opacity:0;transition-delay:calc(var(--i) * 25ms)}
.mf-drop.is-on>em:last-child{transform:none;opacity:1;transition:transform .7s cubic-bezier(.3,1.5,.5,1) calc(.45s + var(--i) * 25ms),opacity .3s calc(.45s + var(--i) * 25ms)}
.mf-gravity.is-act .mf-row{animation:mf-sink 1.7s ease-in-out}
@keyframes mf-sink{40%{transform:translateY(.12em) scaleY(.94)}70%{transform:translateY(-.03em)}}

/* grind: the digit is shredded */
.mf-grind.is-on>em{animation:mf-shred 1.1s ease-in forwards}
@keyframes mf-shred{0%,40%{transform:none}10%,30%{transform:translateX(-.04em) rotate(-4deg)}20%{transform:translateX(.04em) rotate(4deg)}60%{transform:scale(1.15,.6);opacity:1;filter:none}100%{transform:scale(.2,0) translateY(.5em);opacity:0;filter:blur(4px)}}
.mf-grind.is-on{animation:mf-close 1.5s ease-in forwards}
@keyframes mf-close{0%,70%{min-width:.62em;max-width:1em}100%{min-width:0;max-width:0}}
.mf-crumbs{position:absolute;left:50%;top:50%;pointer-events:none}
.mf-crumbs b{position:absolute;width:.09em;height:.09em;border-radius:.02em;background:var(--a);box-shadow:0 0 .1em var(--a);opacity:0}
.mf-crumbs b:nth-child(odd){background:#c9d0da}
.mf-grind.is-on .mf-crumbs b{animation:mf-crumb 1s cubic-bezier(.2,.6,.6,1) calc(.55s + var(--k) * 25ms) forwards}
@keyframes mf-crumb{0%{opacity:1;transform:none}100%{opacity:0;transform:translate(calc((var(--k) - 4.5) * .14em),1.6em) rotate(calc(var(--k) * 70deg))}}

/* edge: a rift opens, a digit steps out */
.mf-new{max-width:0;min-width:0;overflow:visible;transition:max-width .6s cubic-bezier(.3,1.4,.5,1) .5s,min-width .6s cubic-bezier(.3,1.4,.5,1) .5s}
.mf-new.is-on{max-width:1em;min-width:.62em}
.mf-new>em{opacity:0;transform:scale(0);color:#fff;text-shadow:0 0 .2em #fff,0 0 .5em var(--a2),0 0 1em #b07aff}
.mf-new.is-on>em{animation:mf-born .9s cubic-bezier(.2,1.6,.4,1) .6s forwards}
@keyframes mf-born{from{opacity:0;transform:scale(0) rotate(-40deg)}to{opacity:1;transform:none}}
.mf-rift{position:absolute;left:50%;top:-.25em;bottom:-.25em;width:.08em;margin-left:-.04em;border-radius:1em;background:linear-gradient(transparent,#fff 20%,#6af0ff 50%,#fff 80%,transparent);box-shadow:0 0 .3em #b07aff,0 0 .8em #6af0ff;transform:scaleY(0);opacity:0}
.mf-new.is-on .mf-rift{animation:mf-rift 1.5s ease-out forwards}
@keyframes mf-rift{0%{transform:scaleY(0);opacity:0}25%{transform:scaleY(1);opacity:1;width:.08em}55%{width:.7em;margin-left:-.35em;opacity:.8;filter:blur(2px)}100%{width:.9em;margin-left:-.45em;opacity:0}}

/* bitflip: binary, one bit breaks */
.mf-bitflip .mf-panel{background:repeating-linear-gradient(transparent 0 2px,rgba(0,0,0,.35) 2px 4px),#07020a}
.mf-row.is-bits{font-size:clamp(.9rem,3vw,1.7rem);letter-spacing:.08em;color:#ff3b6b;text-shadow:2px 0 rgba(0,255,230,.6),-2px 0 rgba(255,0,60,.6)}
.mf-bit{display:inline-grid;place-items:center;animation:mf-type .25s steps(1) calc(var(--i) * 12ms) both}
@keyframes mf-type{from{opacity:0}}
.mf-bit>em{grid-area:1/1;font-style:normal}
.mf-bit.is-hit{color:#fff;background:#ff1f4f;border-radius:3px;padding:0 .1em;box-shadow:0 0 12px #ff1f4f}
.mf-bit.is-hit>em:first-child{animation:mf-blink 1.6s steps(1) .5s forwards}
.mf-bit.is-hit>em:last-child{opacity:0;animation:mf-blink-in 1.6s steps(1) .5s forwards}
@keyframes mf-blink{0%,20%,40%{opacity:1}10%,30%,50%,100%{opacity:0}}
@keyframes mf-blink-in{0%,20%,40%{opacity:0}10%,30%,50%,100%{opacity:1}}
.mf-bitflip.is-act .mf-panel{animation:mf-glitch 2.6s steps(1)}
@keyframes mf-glitch{0%,100%{transform:none;filter:none}30%{transform:translateX(6px) skewX(-8deg);filter:hue-rotate(90deg)}31%{transform:none;filter:none}62%{transform:translate(-8px,2px);filter:invert(1)}63%{transform:none;filter:none}64%{transform:skewX(12deg)}65%{transform:none}}
@media (prefers-reduced-motion:reduce){.mf-stage *{animation-duration:.01ms!important;transition-duration:.01ms!important}}

/* compact item tiles in the after-roll pause */
.split-choice .split-items{display:grid;grid-template-columns:repeat(auto-fill,minmax(54px,1fr));gap:6px;flex-direction:initial}
.split-choice .split-item{position:relative;display:grid;place-items:center;grid-template-columns:none;height:56px;padding:0;border-radius:12px;transform:none}
.split-choice .split-item:hover:not(:disabled),.split-choice .split-item:focus-visible{transform:translateY(-2px);box-shadow:0 6px 14px -6px #b06bffaa}
.split-choice .split-item.is-grim{border-color:#ff4a1a55;background:radial-gradient(circle at 50% 120%,#ff4a1a30,#1a0806 70%)}
.split-choice .split-item.is-grim:hover:not(:disabled),.split-choice .split-item.is-grim:focus-visible{border-color:#ff7a4a;background:radial-gradient(circle at 50% 120%,#ff4a1a50,#1a0806 70%);box-shadow:0 6px 14px -6px #ff4a1aaa}
.split-choice .split-item kbd{position:absolute;left:3px;top:3px;min-width:15px;height:15px;padding:0 3px;font-size:9px;border-radius:4px}
.split-choice .split-qty{position:absolute;right:4px;bottom:3px;font-size:10px;opacity:.85;color:#fff;text-shadow:0 1px 2px #000}
.split-info{display:flex;align-items:baseline;gap:8px;min-height:20px;padding:0 4px;color:#f4ebff;line-height:1.25}
.split-info b{font-size:13px;font-weight:800;white-space:nowrap}
.split-info small{font-size:11.5px;opacity:.65;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
