/* Pre-match versus intro (match-intro.js). Needs theme.css; reads tokens.css when present (fallbacks inline). Prefix mi-.
   Lit from the fire: each half is brightest on the cut and darkest in its outer corner, with a rim light on the cut.
   All sizes are container units of .mi, so a contained intro sizes to its stage, never the viewport. The script sets
   the measured sizes (--face, --col per roster, --count-fs, --cut, the busts); the values here are fallbacks. */
.mi{position:fixed;inset:0;z-index:50;overflow:hidden;background:#07040c;color:var(--ui-parchment,#fff3cd);font-family:var(--ui-body);pointer-events:auto;
 container:mi/size;--cut:12cqmin;--face:clamp(36px,min(13cqmin,8.2cqw),140px);--bust:46cqmin;--ink:#231a2e;
 --e-out:var(--cu-ease-out,cubic-bezier(.16,.84,.24,1));--e-in:var(--cu-ease-in,cubic-bezier(.5,0,.8,.4));--e-pop:var(--cu-ease-pop,cubic-bezier(.2,.9,.3,1.3));--e-slam:var(--cu-ease-slam,cubic-bezier(.5,1.8,.5,1))}
.mi.mi-contained{position:absolute}
.mi.mi-tall{--bust:66cqw}
.mi-tall .mi-roster{gap:1.2cqmin 1cqw}

/* before the cut: one black cover over both halves (no seam can leak), and a dithered heartbeat vignette */
.mi-cover{position:absolute;inset:0;z-index:2;background:#07040c;pointer-events:none}
.mi.slash .mi-cover{opacity:0;transition:opacity .25s .15s}
.mi-beat{position:absolute;inset:0;z-index:3;opacity:0;pointer-events:none;
 background:repeating-conic-gradient(#0000 0 25%,#ffffff07 0 50%) 0 0/2px 2px,radial-gradient(ellipse at center,#0000 30%,#5a0a1a 75%,#200008 100%)}
.mi.beat .mi-beat{animation:mi-beat .7s ease-out}
@keyframes mi-beat{0%{opacity:0;scale:1.08}8%{opacity:1;scale:1}22%{opacity:.35}32%{opacity:.9;scale:1.02}100%{opacity:0;scale:1}}
.mi.slash .mi-beat{display:none}

/* the fire behind the halves, seen through the cut once they part */
.mi-fire{position:absolute;inset:0;opacity:0;background:radial-gradient(ellipse at 50% 55%,#ffe2a3 0,#ffa45c 18%,#e0442a 42%,#5a0a1a 72%,#200008 100%)}
.mi.open .mi-fire{opacity:1;transition:opacity .2s}
.mi-flames{position:absolute;left:-10%;width:120%;bottom:-6%;height:80%;filter:drop-shadow(0 0 1.2cqmin #ffa45c)}
.mi-tongue{animation:mi-lick var(--d) ease-in-out var(--dl) infinite alternate}
.mi-tongue.l0{fill:#e0442a}.mi-tongue.l1{fill:#ffa45c;opacity:.9}.mi-tongue.l2{fill:#ffe2a3;opacity:.75}
@keyframes mi-lick{0%{transform:scale(.9,.75) skewX(-6deg)}50%{transform:scale(1.05,1.08) skewX(4deg)}100%{transform:scale(.95,1.2) skewX(-3deg)}}
.mi-embers i{position:absolute;bottom:-2cqmin;left:calc(var(--x,50) * 1%);width:.8cqmin;height:.8cqmin;background:#ffe2a3;box-shadow:0 0 1cqmin #ffa45c;animation:mi-ember 2.4s linear infinite}
.mi-embers i:nth-child(odd){width:.5cqmin;height:.5cqmin;background:#ffa45c}
@keyframes mi-ember{to{transform:translate(4cqmin,-110cqh) rotate(260deg);opacity:0}}

/* the two halves. --y1/--y2 (set by the script) are where the cut meets the right and left edges;
   the halves overlap by 1px on the cut so no anti-aliased hairline shows. */
.mi-half{position:absolute;inset:0;z-index:1;overflow:hidden;transition:transform .55s var(--e-out);will-change:transform}
.mi-tl{clip-path:polygon(0 0,100% 0,100% calc(var(--y1,0%) + 1px),0 calc(var(--y2,100%) + 1px));
 background:linear-gradient(var(--cut-deg,-32deg),#80eee2 50%,#2f97a0 57%,#155463 74%,#0b2530 100%)}
.mi-br{clip-path:polygon(100% calc(var(--y1,0%) - 1px),100% 100%,0 100%,0 calc(var(--y2,100%) - 1px));
 background:linear-gradient(var(--cut-deg,-32deg),#0b0816 0,#1b1730 22%,#3b2a5c 41%,#6a4fb0 50%)}
.mi.open .mi-tl{transform:translate(calc(var(--cut) * -1),calc(var(--cut) * -1))}
.mi.open .mi-br{transform:translate(var(--cut),var(--cut))}
.mi.mi-tall.open .mi-tl{transform:translateY(calc(var(--cut) * -1))}
.mi.mi-tall.open .mi-br{transform:translateY(var(--cut))}
/* rim light on the cut: a cream core, warm fire light on your side, violet on theirs */
.mi-rim{position:absolute;inset:0;pointer-events:none;z-index:3}
.mi-tl .mi-rim{background:linear-gradient(var(--cut-deg,-32deg),#0000 50%,#fff3cd 50%,#fff3cd calc(50% + .45cqmin),#ffa45c99 calc(50% + 1cqmin),#ffa45c00 calc(50% + 5cqmin))}
.mi-br .mi-rim{background:linear-gradient(var(--cut-deg,-32deg),#a98cff00 calc(50% - 5cqmin),#a98cffaa calc(50% - 1cqmin),#fff3cd calc(50% - .45cqmin),#fff3cd 50%,#0000 50%)}
.mi.hot .mi-rim{filter:brightness(1.35) saturate(1.3)}
/* anime focus lines, centred on each roster, flickering between two sets */
.mi-lines{position:absolute;inset:0;opacity:.16;pointer-events:none;--fx:24%;--fy:20%;
 background:repeating-conic-gradient(from var(--fa,0deg) at var(--fx) var(--fy),var(--lc,#fff) 0 1.2deg,#0000 1.2deg 7deg);
 -webkit-mask:radial-gradient(circle at var(--fx) var(--fy),#0000 16%,#000 58%);mask:radial-gradient(circle at var(--fx) var(--fy),#0000 16%,#000 58%)}
.mi-br .mi-lines{--fx:76%;--fy:80%;--lc:#a98cff;opacity:.22}
.mi-tall .mi-tl .mi-lines{--fx:50%;--fy:14%}.mi-tall .mi-br .mi-lines{--fx:50%;--fy:86%}
.mi.open .mi-lines{animation:mi-lines .36s linear infinite}
.mi-shard .mi-lines,.mi.show .mi-lines{animation:none!important}
@keyframes mi-lines{0%,49%{--fa:0deg}50%,100%{--fa:3.5deg}}

/* rosters: your team along the top-left edge, the shadows along the bottom-right edge */
.mi-team{position:absolute;z-index:2;display:flex;flex-direction:column;gap:1.4cqmin;opacity:0}
.mi-tl .mi-team{left:calc(var(--cut) + 4cqmin);top:calc(var(--cut) + 3cqmin);align-items:flex-start}
.mi-br .mi-team{right:calc(var(--cut) + 4cqmin);bottom:calc(var(--cut) + 3cqmin);align-items:flex-end;flex-direction:column-reverse}
.mi-tall .mi-tl .mi-team{left:4cqw;top:calc(var(--cut) + 3cqmin)}
.mi-tall .mi-br .mi-team{right:4cqw;bottom:calc(var(--cut) + 3cqmin)}
.mi.open .mi-team{opacity:1;transition:opacity .2s .15s}
.mi-label{display:flex;flex-direction:column;gap:8px}
.mi-label small{font:16px/1 var(--ui-label);letter-spacing:1px;text-transform:uppercase;color:#ffe2a3;text-shadow:2px 2px 0 var(--ink)}
.mi-label b{font:400 63px/1 var(--ui-display);color:#fff3cd;white-space:nowrap;
 text-shadow:2px 0 0 var(--ink),-2px 0 0 var(--ink),0 2px 0 var(--ink),0 -2px 0 var(--ink),2px 2px 0 var(--ink),-2px 2px 0 var(--ink),2px -2px 0 var(--ink),-2px -2px 0 var(--ink),0 5px 0 var(--ink)}
.mi-br .mi-label{align-items:flex-end}
.mi-br .mi-label small{color:#d9ccff}
.mi-br .mi-label b{color:#efe8ff}
/* one fixed column width per roster (the script sizes it from the longest word), so a long name wraps in place */
.mi-roster{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(var(--n,4),var(--col,auto));gap:1.6cqmin 1.4cqmin}
.mi-br .mi-roster{direction:rtl}
.mi-br .mi-p{direction:ltr}
/* only the face frame is skewed; names and stamps stay upright and are snapped to whole pixels by the script */
.mi-p{position:relative;min-width:0;display:flex;flex-direction:column;align-items:center;gap:round(.6cqmin,1px);transform:translateX(-30cqmin);opacity:0}
.mi-br .mi-p{transform:translateX(30cqmin)}
.mi.open .mi-p{transform:none;opacity:1;transition:transform .5s var(--e-out) calc(.2s + var(--i) * .07s),opacity .2s calc(.2s + var(--i) * .07s)}
.mi-face{display:block;width:round(var(--face),2px);aspect-ratio:1;transform:skewX(-8deg);background:radial-gradient(circle at 50% 60%,#fff3cd 0,#ffe2a3 40%,#2f97a0 41%,#155463 100%);border:3px solid var(--ink);
 box-shadow:inset 0 0 0 2px #80eee2,4px 4px 0 #07050faa;overflow:hidden}
.mi-br .mi-face{background:radial-gradient(circle at 50% 45%,#c9b8ff 0,#7a62c8 55%,#3b2a5c 100%);box-shadow:inset 0 0 0 2px #a98cff,4px 4px 0 #07050faa}
.mi-face>img{display:block;width:100%;height:100%;transform:skewX(8deg) scale(1.1)}
.mi-p.you .mi-face{border-color:var(--ink);box-shadow:inset 0 0 0 3px var(--ui-you,#ffe2a3),0 0 0 2px var(--ui-you,#ffe2a3),0 0 2.4cqmin #ffe2a399,4px 4px 0 #07050faa}
.mi.counting .mi-face>img{animation:mi-bob 1.4s linear calc(var(--i) * -.35s) infinite}
@keyframes mi-bob{0%,49%{translate:0 0}50%,100%{translate:0 -2px}}
.mi-name{box-sizing:border-box;max-width:100%;font:400 var(--cu-fs-label-min,12px)/14px var(--ui-body);letter-spacing:0;text-transform:none;text-align:center;padding:3px 4px;
 background:var(--ink);color:var(--ui-parchment,#fff3cd);unicode-bidi:isolate}
.mi-name>i{display:inline-block;max-width:100%;vertical-align:top;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-style:normal}
.mi-p.you .mi-name{background:var(--ui-you,#ffe2a3);color:var(--ink)}
.mi.mi-nonames .mi-name{display:none}
.mi-roster.mi-tight .mi-name{letter-spacing:0}
.mi.mi-measure .mi-name{display:block!important;max-width:none!important;white-space:nowrap;letter-spacing:1px!important}
.mi.mi-measure .mi-name>i{max-width:none!important}
/* READY: a gold tab on the face frame's top edge (it covers hair and sky, never the eyes or the mouth); small faces get
   a tick badge on the frame's top-right corner instead. Stamped cards sit above their neighbours. */
.mi-ready{position:absolute;z-index:3;left:calc(var(--face) * .14);right:0;top:-9px;margin:auto;width:fit-content;display:none;align-items:center;gap:4px;padding:3px 5px 3px 3px;white-space:nowrap;
 font:400 var(--cu-fs-label-min,12px)/12px var(--ui-body);letter-spacing:1px;text-transform:uppercase;color:var(--ink);background:linear-gradient(#ffe2a3 0 50%,#f4c67b 50%);border:2px solid var(--ink);box-shadow:inset 0 -2px 0 #b98a45,2px 2px 0 var(--ink)}
.mi-tick{width:12px;height:12px;color:#267e8a;flex:none}
.mi.mi-tiny .mi-ready{left:auto;right:calc(50% - var(--face) * .57 - 6px);top:-7px;margin:0;padding:0}
.mi.mi-tiny .mi-ready>span{display:none}
.mi-p.ready{z-index:2}
.mi-p.ready .mi-ready{display:flex;animation:mi-ready .26s var(--e-pop)}
.mi-p.ready .mi-face{animation:mi-lit .3s steps(2)}
@keyframes mi-ready{from{scale:1.8;opacity:0}to{scale:1;opacity:1}}
@keyframes mi-lit{0%{filter:brightness(1.6)}100%{filter:none}}

/* the leaders' cut-in busts, sliding along the cut, rim-lit from the fire, halftone on the shadow side */
/* placed by the script (--bl/--bt/--bs: under your roster, above theirs, faces clear of the cut, the digit and the VS) */
.mi-bust{position:absolute;z-index:1;left:var(--bl,12cqw);top:var(--bt,30cqh);width:var(--bs,var(--bust));aspect-ratio:1;pointer-events:none;opacity:0;--dir:1}
.mi-br .mi-bust{left:var(--bl,58cqw);top:var(--bt,24cqh);--dir:-1}
.mi-bust.mi-off{display:none}
.mi-bust-in{position:absolute;inset:0;will-change:translate;translate:calc(cos(var(--cut-deg,-32deg)) * 48cqmin * var(--dir)) calc(sin(var(--cut-deg,-32deg)) * 48cqmin * var(--dir))}
.mi-bust-in>img,.mi-bust-in>canvas{display:block;width:100%;height:100%}
.mi.busts .mi-bust{opacity:1;transition:opacity .16s}
.mi.busts .mi-bust-in{translate:0 0;transition:translate .5s var(--e-out)}

/* the sword slash: a white line drawn top-right to bottom-left, then a flash */
.mi-slash{position:absolute;inset:0;z-index:4;width:100%;height:100%;pointer-events:none;overflow:visible}
.mi-slash line{stroke:#fff;stroke-width:1.4cqmin;stroke-linecap:round;stroke-dasharray:1;stroke-dashoffset:1;filter:drop-shadow(0 0 1.6cqmin #fff) drop-shadow(0 0 4cqmin #ffe2a3)}
.mi.slash .mi-slash line{animation:mi-cut .7s cubic-bezier(.3,0,.1,1) forwards}
@keyframes mi-cut{0%{stroke-dashoffset:1}22%{stroke-dashoffset:0;stroke-width:1.4cqmin;opacity:1}55%{stroke-dashoffset:0;stroke-width:.9cqmin;opacity:1}100%{stroke-dashoffset:0;stroke-width:0;opacity:0}}
.mi-flash{position:absolute;inset:0;z-index:5;background:#fff8e0;opacity:0;pointer-events:none}
.mi.slash .mi-flash{animation:mi-flash .45s ease-out .12s}
.mi.zoom .mi-flash{animation:mi-flash .3s ease-out}
@keyframes mi-flash{0%{opacity:0}10%{opacity:.9}100%{opacity:0}}

/* VS: the pixel-slab wordmark slams in, then parks on the cut and breathes with the count */
.mi-vs{position:absolute;inset:0;z-index:6;display:grid;place-items:center;pointer-events:none}
.mi-vs svg{display:block;opacity:0;rotate:-10deg;filter:drop-shadow(0 0 3cqmin #ffa45caa) drop-shadow(1cqmin 1cqmin 0 #231a2ecc)}
.mi.vs .mi-vs svg{animation:mi-slam .32s var(--e-in) forwards,mi-shake .36s .32s steps(4)}
@keyframes mi-slam{from{opacity:0;scale:4}to{opacity:1;scale:1}}
@keyframes mi-shake{0%{translate:1cqmin -.8cqmin}25%{translate:-.9cqmin .6cqmin}50%{translate:.5cqmin .4cqmin}75%{translate:-.3cqmin -.2cqmin}100%{translate:0 0}}
.mi.vs.counting .mi-vs{animation:mi-park .45s var(--e-out) forwards}
.mi.vs.counting .mi-vs svg{opacity:1;animation:mi-breathe 1s linear infinite}
@keyframes mi-park{to{translate:var(--vx) var(--vy);scale:.42}}
@keyframes mi-breathe{0%,40%{scale:1.072}50%,100%{scale:1}}
.mi.vs:not(.counting,.mi-reduce) .mi-half{animation:mi-quake .35s .32s}
.mi.quake:not(.mi-reduce) .mi-half{animation:mi-quake .3s}
@keyframes mi-quake{25%{translate:.8cqmin -.6cqmin}50%{translate:-.7cqmin .5cqmin}75%{translate:.4cqmin .3cqmin}}
.mi.show .mi-vs{opacity:0;transition:opacity .2s}

/* countdown: banded fire digits with a thick ink stroke, standing on a dark well */
.mi-count{position:absolute;inset:0;z-index:7;display:grid;place-items:center;pointer-events:none}
.mi-count::before{content:"";position:absolute;inset:0;margin:auto;width:calc(var(--count-fs,315px) * 1.7);height:calc(var(--count-fs,315px) * 1.5);
 background:radial-gradient(closest-side,#200008d9,#200008a0 55%,#20000800);opacity:0;transition:opacity .3s}
.mi.counting .mi-count::before{opacity:1}
.mi.show .mi-count::before{opacity:0}
/* the well lives and dies with its digit: it never sits on screen empty between ticks */
.mi.counting .mi-count.pop::before{animation:mi-well var(--mi-step,1s) linear forwards}
.mi.show .mi-count.pop::before{animation:none;opacity:0}
@keyframes mi-well{0%{opacity:0}10%,90%{opacity:1}100%{opacity:0}}
.mi-digit{position:relative;display:grid;opacity:0}
.mi-digit>b,.mi-digit::before{grid-area:1/1;font:400 var(--count-fs,315px)/1 var(--ui-display)}
/* the ink case: a copy of the number (data-n) with no text alternative, so the number is announced once */
.mi-digit::before{content:attr(data-n);content:attr(data-n) / "";color:var(--ink);-webkit-text-stroke:2.4cqmin var(--ink);text-shadow:1.4cqmin 1.4cqmin 0 var(--ink)}
.mi-digit .fill{color:transparent;background:linear-gradient(#fff 0 42%,#ffe2a3 42% 68%,#ffa45c 68%);-webkit-background-clip:text;background-clip:text}
.mi-count.hot .mi-digit .fill{background-image:linear-gradient(#fff 0 42%,#ffe2a3 42% 68%,#e0442a 68%)}
.mi-count.hot::before{background:radial-gradient(closest-side,#3a0010e6,#3a0010a0 55%,#3a001000)}
.mi-count.pop .mi-digit{animation:mi-pop var(--mi-step,1s) linear forwards}
@keyframes mi-pop{0%{scale:1.9;opacity:0;animation-timing-function:var(--e-out)}12%{scale:.94;opacity:1}22%,90%{scale:1;opacity:1;animation-timing-function:var(--e-in)}100%{scale:1.12;opacity:0}}

/* It's showtime! runs along the cut; the rosters dim and the halves slam shut under it */
.mi-show{position:absolute;inset:0;z-index:8;display:grid;place-items:center;pointer-events:none}
.mi-show span{display:block;white-space:nowrap;font:400 105px/1 var(--ui-display);color:#fff3cd;opacity:0;rotate:var(--cut-deg,-32deg);
 text-shadow:3px 0 0 var(--ink),-3px 0 0 var(--ink),0 3px 0 var(--ink),0 -3px 0 var(--ink),3px 3px 0 var(--ink),-3px 3px 0 var(--ink),3px -3px 0 var(--ink),-3px -3px 0 var(--ink),0 8px 0 var(--ink),0 0 4cqmin #ffa45c}
.mi.show .mi-show span{animation:mi-slam2 .3s var(--e-slam) forwards}
@keyframes mi-slam2{0%{opacity:0;scale:2.2}60%{opacity:1;scale:.94}100%{opacity:1;scale:1}}
.mi.show .mi-team,.mi.show .mi-bust{opacity:.2;transition:opacity .18s}
.mi.show .mi-tl,.mi.show .mi-br,.mi.mi-tall.show .mi-tl,.mi.mi-tall.show .mi-br{transform:none;transition:transform .26s var(--e-in)}
/* the rosters stand still while their halves slam shut, which leaves the cut clear for the text */
.mi.show .mi-tl .mi-team{translate:calc(var(--cut) * -1) calc(var(--cut) * -1);transition:opacity .18s,translate .26s var(--e-in)}
.mi.show .mi-br .mi-team{translate:var(--cut) var(--cut);transition:opacity .18s,translate .26s var(--e-in)}
.mi.mi-tall.show .mi-tl .mi-team{translate:0 calc(var(--cut) * -1)}
.mi.mi-tall.show .mi-br .mi-team{translate:0 var(--cut)}
.mi-mode{position:absolute;z-index:6;left:4cqmin;bottom:4cqmin;padding:5px 8px;
 font:400 var(--cu-fs-label-min,12px)/12px var(--ui-body);letter-spacing:1px;text-transform:uppercase;color:#fff3cd;background:var(--ink);box-shadow:inset 0 0 0 1px #f4c67b66,2px 2px 0 #07050f;opacity:0}
.mi-tall .mi-mode{left:auto;bottom:auto;right:4cqw;top:4cqmin}
.mi.open .mi-mode{opacity:1;transition:opacity .3s .4s}
.mi.show .mi-mode{opacity:0;transition:opacity .15s}

/* the skip chip: keycaps on a scrim in the free corner on the cut (top-right), shown while the intro can be skipped and
   gone (150ms) the moment the count starts or a skip lands. Tall stages have one free corner above the rosters, so there
   the chip holds the mode chip's place until the count starts and the mode chip takes over; narrow ones show one key. */
.mi-skip{position:absolute;z-index:9;top:4cqmin;right:4cqmin;display:flex;align-items:center;padding:5px 8px;pointer-events:none;
 font:400 var(--cu-fs-label-min,12px)/12px var(--ui-body);letter-spacing:1px;text-transform:uppercase;color:#fff3cd;background:#120d22e6;border:2px solid var(--ink);
 box-shadow:inset 0 0 0 1px #f4c67b55,2px 2px 0 #07050f;text-shadow:1px 1px 0 var(--ink);opacity:0;transition:opacity .2s}
.mi-skip-k{display:flex;align-items:center;gap:6px}
.mi-skip-k>i{font-style:normal;color:#c9c3e6}
.mi-skip kbd{padding:1px 4px;font:400 var(--cu-fs-label-min,12px)/12px var(--ui-body);letter-spacing:1px;color:var(--ink);text-shadow:none;
 background:var(--cu-mat-parch-bg,linear-gradient(#fff8e0,#fff3cd 60%,#f3e2b8));border:2px solid var(--ink);box-shadow:0 2px 0 var(--ink)}
.mi-skip-t{display:none}
@media (hover:none){.mi-skip-k{display:none}.mi-skip-t{display:inline}}
.mi-tall .mi-skip{right:4cqw;top:4cqmin}
.mi-tall.mi-compact .mi-skip{top:calc(4cqmin + 28px)}
.mi.mi-tall.mi-skippable:not(.mi-compact,.counting,.skipped) .mi-mode{opacity:0;transition:opacity .15s}
@container mi (max-width:480px){.mi-skip .mi-k2{display:none}}
.mi.armed .mi-skip{opacity:1}
.mi.counting .mi-skip,.mi.skipped .mi-skip{opacity:0;transition:opacity .15s}

/* release: the halves shatter into four shards that fly out with a big fade-out zoom into the world */
.mi.zoom{animation:mi-zoom .9s cubic-bezier(.6,0,.9,.4) forwards;pointer-events:none}
@keyframes mi-zoom{0%{transform:scale(1);opacity:1;filter:blur(0)}100%{transform:scale(3.2);opacity:0;filter:blur(6px)}}
.mi-shard{opacity:0;transition:none;will-change:transform,opacity}
.mi.zoom .mi-shard{opacity:1;animation:mi-fly .8s var(--e-in) forwards}
.mi.zoom .mi-half:not(.mi-shard){opacity:0;transition:opacity .1s}
.mi-tl.s1{transform-origin:70% 12%;--fx2:6cqw;--fy2:-46cqh;--fr:-7deg}
.mi-tl.s2{transform-origin:12% 50%;--fx2:-46cqw;--fy2:6cqh;--fr:9deg}
.mi-br.s1{transform-origin:88% 50%;--fx2:46cqw;--fy2:-6cqh;--fr:-9deg}
.mi-br.s2{transform-origin:30% 88%;--fx2:-6cqw;--fy2:46cqh;--fr:7deg}
@keyframes mi-fly{to{translate:var(--fx2) var(--fy2);rotate:var(--fr)}}

/* compact and large stages: Jacquard steps one rung, never below 42; Silkscreen 8/16 */
@container mi (max-width:640px){
 .mi-label small{font-family:var(--ui-body);font-size:var(--cu-fs-label-min,12px)}
 .mi-label b{font-size:42px}
}
/* short landscape phones: no busts, a narrow parting; the rosters fade out under "It's showtime!" */
@container mi (max-height:420px){
 .mi-bust{display:none}
 .mi-label small{font-family:var(--ui-body);font-size:var(--cu-fs-label-min,12px)}
 .mi-label b{font-size:42px}
 .mi-label{gap:4px}
 .mi-team{gap:1.6cqmin}
 .mi-tl .mi-team{left:calc(var(--cut) + 3cqmin);top:calc(var(--cut) + 3cqmin)}
 .mi-br .mi-team{right:calc(var(--cut) + 3cqmin);bottom:calc(var(--cut) + 3cqmin)}
 .mi-roster{gap:2.4cqmin 1.2cqmin}
 .mi.show .mi-team{opacity:0}
}
@container mi (min-width:1500px) and (min-height:840px){
 .mi-label b{font-size:84px}
 .mi-name{font-size:16px;line-height:18px}
 .mi-skip,.mi-skip kbd,.mi-mode{font-size:16px;line-height:16px}
 .mi-ready{font-size:16px;line-height:16px;top:-13px}
}

/* compact countdown (playMatchIntro {compact:true}, the game's walkable pre-match count): once the versus card has
   played the halves slide off, the fire fades and the countdown runs as a big number top-centre (under the match HUD's
   top bar, --mh-top) over the live game, which keeps all pointer input; then "It's showtime!" and the zoom. Its pops
   start visible, so a late frame never blanks a number. */
.mi.mi-compact{--mi-top:calc(max(var(--mh-top,0px),env(safe-area-inset-top,0px)) + max(clamp(52px,10vmin,108px),var(--count-fs,147px) * .5 + 16px));
 --mi-top-tall:calc(max(var(--mh-top,0px),env(safe-area-inset-top,0px)) + 214px);transition:background-color .5s ease-out;transform-origin:50% var(--mi-top)}
.mi.mi-compact.counting{background-color:transparent;pointer-events:none}
.mi.mi-compact.counting :is(.mi-fire,.mi-mode){opacity:0;transition:opacity .5s ease-out}
.mi.mi-compact.counting .mi-tl:not(.mi-shard){transform:translate(-105%,-105%);transition:transform .6s cubic-bezier(.6,0,.3,1)}
.mi.mi-compact.counting .mi-br:not(.mi-shard){transform:translate(105%,105%);transition:transform .6s cubic-bezier(.6,0,.3,1)}
.mi.mi-compact.counting .mi-half{animation:none}
.mi.mi-compact .mi-shard{display:none}
.mi.mi-compact.vs.counting .mi-vs{animation:none;opacity:0;translate:0 -38cqh;scale:.12;transition:translate .5s cubic-bezier(.6,0,.3,1),scale .5s cubic-bezier(.6,0,.3,1),opacity .35s .15s}
.mi.mi-compact .mi-count{inset:auto 0;top:calc(var(--mi-top) - var(--count-fs,147px));height:calc(var(--count-fs,147px) * 2)}
.mi.mi-compact .mi-count::before{display:none}
.mi.mi-compact .mi-digit::before{-webkit-text-stroke:1.6cqmin var(--ink);text-shadow:1cqmin 1cqmin 0 var(--ink)}
.mi.mi-compact .mi-count.pop .mi-digit{animation:mi-cpop var(--mi-step,1s) cubic-bezier(.2,.9,.3,1) forwards}
@keyframes mi-cpop{0%{scale:1.4;opacity:1}16%{scale:.95}26%{scale:1}82%{opacity:1}100%{scale:.92;opacity:.75}}
.mi.mi-compact .mi-show{inset:auto 0;top:calc(var(--mi-top) - 120px);height:240px}
.mi.mi-compact .mi-show span{rotate:-6deg}
.mi.mi-compact.show .mi-show span{animation:mi-cslam .28s cubic-bezier(.5,0,.75,0) forwards}
@keyframes mi-cslam{0%{opacity:1;scale:1.8}100%{opacity:1;scale:1}}
/* the caption under the number and the host's flashing hint line (intro.hint(text)): labels on ink plates */
.mi-sub,.mi-hint{position:absolute;z-index:9;left:50%;transform:translateX(-50%);max-width:calc(100% - 32px);box-sizing:border-box;width:max-content;text-align:center;
 font:16px/16px var(--ui-label);letter-spacing:1px;text-transform:uppercase;text-shadow:2px 2px 0 var(--ink);pointer-events:none;opacity:0}
.mi-sub{top:calc(var(--mi-top) + var(--count-fs,147px) * .62);padding:6px 10px;color:#fff3cd;background:#120d22b3;box-shadow:inset 0 0 0 1px #f4c67b55}
.mi.counting:not(.show) .mi-sub{opacity:1;transition:opacity .4s .3s}
.mi-hint{top:calc(var(--mi-top) + var(--count-fs,147px) * .62 + 44px);padding:8px 12px;color:#ffe2a3;background:var(--ink);border:2px solid #e0442a;box-shadow:0 0 2cqmin #e0442a88,2px 2px 0 #07050f}
.mi-hint.on{animation:mi-hint 1.6s ease-out forwards}
@keyframes mi-hint{0%{opacity:1;transform:translateX(-50%) scale(1.25)}10%{opacity:1;transform:translateX(-50%) scale(1)}14%{transform:translateX(-52%)}18%{transform:translateX(-48%)}22%{transform:translateX(-50%)}75%{opacity:1}100%{opacity:0;transform:translateX(-50%)}}
.mi.show .mi-hint{display:none}
@container mi (max-width:480px){.mi-sub,.mi-hint{font-family:var(--ui-body);font-size:var(--cu-fs-label-min,12px);line-height:12px}}
/* portrait phones: the minimap, menu buttons and your card sit under the top bar, so the number drops below them (still
   above your crusader), the caption steps aside and the hint flashes just above the number. The media query covers the
   game's full-window overlay; the container query covers a contained stage. */
@media (max-aspect-ratio:3/4){.mi.mi-compact{--mi-top:var(--mi-top-tall)}}
@container mi (max-aspect-ratio:3/4){
 .mi.mi-compact>*{--mi-top:var(--mi-top-tall)}
 .mi-sub{display:none}
 .mi-hint{top:calc(var(--mi-top) - var(--count-fs,84px) * .62 - 44px)}
}
/* while the countdown holds the match, controls that would leave the castle or fight read as locked (battle-intro.js) */
body.mi-prematch :is(#launch,#fleet-enter,#fleet-seat,#chariot-enter,#battle-gate,#battle-fire,#battle-weapons button){filter:grayscale(.85) brightness(.8);opacity:.6}

/* reduced motion: every beat stays as a short fade; no travel, shake, scale, shards or zoom; the countdown runs */
.mi.mi-reduce .mi-tongue,.mi.mi-reduce .mi-embers i,.mi.mi-reduce .mi-lines,.mi.mi-reduce .mi-face>img,.mi.mi-reduce .mi-half,.mi.mi-reduce .mi-vs svg{animation:none}
.mi.mi-reduce .mi-embers{display:none}
.mi.mi-reduce.beat .mi-beat{animation:mi-beat-r .7s linear}
@keyframes mi-beat-r{0%{opacity:0}15%{opacity:.9}100%{opacity:0}}
.mi.mi-reduce .mi-flash{display:none}
.mi.mi-reduce.slash .mi-slash line{animation:mi-cut-r .6s linear forwards}
@keyframes mi-cut-r{0%{stroke-dashoffset:0;opacity:0}20%{stroke-dashoffset:0;opacity:1}100%{stroke-dashoffset:0;opacity:0}}
.mi.mi-reduce .mi-half{transition:none}
.mi.mi-reduce .mi-p{transform:none}
.mi.mi-reduce.open .mi-p{transition:opacity .2s}
.mi.mi-reduce .mi-bust-in{translate:0 0}
.mi.mi-reduce.busts .mi-bust-in{transition:none}
.mi.mi-reduce .mi-vs{translate:var(--vx) var(--vy);scale:.42}
.mi.mi-reduce.vs .mi-vs svg{animation:none;opacity:1;transition:opacity .2s}
.mi.mi-reduce.vs.counting .mi-vs{animation:none}
.mi.mi-reduce.vs.counting .mi-vs svg{animation:none}
.mi.mi-reduce .mi-count.pop .mi-digit{animation:mi-pop-r var(--mi-step,1s) linear forwards}
@keyframes mi-pop-r{0%{opacity:0}15%,88%{opacity:1}100%{opacity:0}}
.mi.mi-reduce .mi-p.ready .mi-ready{animation:mi-fade .18s linear}
.mi.mi-reduce .mi-p.ready .mi-face{animation:none}
@keyframes mi-fade{from{opacity:0}to{opacity:1}}
/* the halves stand parted from the start (the black cover hides them until the cut) and stay parted at showtime:
   no travel at all, only the text fades in */
.mi.mi-reduce .mi-tl,.mi.mi-reduce.show .mi-tl{transform:translate(calc(var(--cut) * -1),calc(var(--cut) * -1));transition:none}
.mi.mi-reduce .mi-br,.mi.mi-reduce.show .mi-br{transform:translate(var(--cut),var(--cut));transition:none}
.mi.mi-reduce.mi-tall .mi-tl,.mi.mi-reduce.mi-tall.show .mi-tl{transform:translateY(calc(var(--cut) * -1))}
.mi.mi-reduce.mi-tall .mi-br,.mi.mi-reduce.mi-tall.show .mi-br{transform:translateY(var(--cut))}
.mi.mi-reduce.show .mi-show span{animation:none;opacity:1;transition:opacity .2s}
.mi.mi-reduce.show .mi-half .mi-team{translate:none;transition:opacity .18s}
.mi.mi-reduce.zoom{animation:none;opacity:0;transition:opacity .2s}
.mi.mi-reduce .mi-shard{display:none}
.mi.mi-reduce.zoom .mi-half{opacity:1}
/* the compact count under reduced motion: the halves and the VS fade where they stand instead of sliding away */
.mi.mi-reduce.mi-compact.counting .mi-half:not(.mi-shard){opacity:0;transition:opacity .2s}
.mi.mi-reduce.mi-compact.counting .mi-tl:not(.mi-shard){transform:translate(calc(var(--cut) * -1),calc(var(--cut) * -1))}
.mi.mi-reduce.mi-compact.counting .mi-br:not(.mi-shard){transform:translate(var(--cut),var(--cut))}
.mi.mi-reduce.mi-compact.mi-tall.counting .mi-tl:not(.mi-shard){transform:translateY(calc(var(--cut) * -1))}
.mi.mi-reduce.mi-compact.mi-tall.counting .mi-br:not(.mi-shard){transform:translateY(var(--cut))}
.mi.mi-reduce.mi-compact.vs.counting .mi-vs{translate:var(--vx) var(--vy);scale:.42;opacity:0;transition:opacity .2s}
.mi.mi-reduce.mi-compact .mi-count.pop .mi-digit{animation:mi-cpop-r var(--mi-step,1s) linear forwards}
@keyframes mi-cpop-r{0%{opacity:0}12%,100%{opacity:1}}
.mi.mi-reduce.mi-compact.show .mi-show span{animation:none;opacity:1;transition:opacity .2s}
.mi.mi-reduce .mi-hint.on{animation:mi-hint-r 1.6s linear forwards}
@keyframes mi-hint-r{0%{opacity:0}10%,75%{opacity:1}100%{opacity:0}}
