/* The fight screen (src/combat-ui.js): the combat minigame's fight played in place of the card, its look ported from
 * combat/web/style.css (HANDOFF §5) and scoped under .fight-layer. The game's tokens (--night*, --line, --gold*, --parch,
 * --ink*, --muted, --text, --good, --bad, --radius, the fonts) come from src/style.css, so the zh-CN font swap applies here
 * too; only the fight's own tokens are defined. Generated selectors keep the bench's names: when the bench's look changes,
 * port the rule here. */
/* While a fight is on, the card is suspended: the deck (the card and the stack behind it) and the choices are hidden, and
 * the fight takes their place in the stage. The card's outcome follows when the fight ends. */
.stage.fighting { position: relative; }
.stage.fighting > .deck, .stage.fighting > .choices { display: none; }
.fight-layer {
  --line-2: rgba(233, 214, 160, .3); --hp: #e06a6a; --mana: #5fa8e8; --flux: #8a7fd6; --you: #f0d58c; --opp: #8fc9e8;
  --k-dmg: #ff9d90; --k-heal: #8fe39b; --k-mana: #8fc9f2; --k-guard: #e9d49c; --k-buff: #c9b9ff; --k-debuff: #f2a8d6; --k-gold: #f0d58c;
  position: relative; flex: 1 1 auto; width: 100%; min-height: 0; margin-top: 8px; display: flex; flex-direction: column; align-items: center;
  overflow-x: hidden; overflow-y: auto; container: fight / inline-size;
  font: 14px/1.4 var(--sans); color: var(--text); -webkit-font-smoothing: antialiased;
}
.fight-layer, .fight-layer * { box-sizing: border-box; }
.fight-layer [hidden] { display: none !important; }
.fight-layer .fight-note { margin: 0; padding: 5px 10px; border-radius: 10px; border: 1px solid rgba(255, 138, 128, .4); background: rgba(60, 20, 30, .55); color: #f3c9c3; font-size: 12.5px; }
.fight-layer .fight-loading { padding: 18px; text-align: center; color: var(--muted); font: italic 16px var(--serif); }
.fight-layer .result .fl-continue { margin-top: 10px; min-width: 160px; }
.fight-layer .pf svg.avatar { width: 100%; height: 100%; }
.fight-layer button,.fight-layer input,.fight-layer select{font:inherit;color:inherit}
.fight-layer button{cursor:pointer;border:1px solid var(--line);border-radius:12px;background:var(--night-3);padding:9px 14px;font-weight:600;transition:border-color .2s,background .2s,transform .12s}
.fight-layer button:hover:not(:disabled){border-color:var(--gold)}
.fight-layer button:disabled{opacity:.4;cursor:default}
.fight-layer :focus-visible{outline:2px solid var(--gold-2);outline-offset:2px}
.fight-layer .primary{background:linear-gradient(180deg,#e7c470,#c99a3a);color:#23190a;border-color:transparent}
.fight-layer .fine{font-size:11.5px;line-height:1.5;color:var(--muted)}
.fight-layer .link{background:none;border:0;padding:4px 0;color:var(--gold-2);font-weight:500;font-size:12px}
.fight-layer .fight-wrap{flex:none;width:100%;max-width:640px;display:flex;flex-direction:column}
.fight-layer .fight-body,.fight-layer .fight-main,.fight-layer .controls{display:flex;flex-direction:column;gap:8px;min-width:0}
.fight-layer .fight{position:relative;flex:none;display:flex;flex-direction:column;gap:8px}
.fight-layer .fight>*{flex:none}
.fight-layer .fighters{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.fight-layer .fighter{display:flex;gap:10px;align-items:center;min-width:0;padding:5px 10px;border-radius:14px;background:var(--night-2);border:1px solid var(--line)}
.fight-layer .fighter.opp{flex-direction:row-reverse;cursor:pointer}
.fight-layer .fighter.opp:hover{border-color:var(--line-2)}
.fight-layer .fighter.opp .fname{text-align:right}
.fight-layer .pf{position:relative;flex:none;width:48px;height:48px;border-radius:50%;overflow:hidden;border:2px solid var(--line-2);background:var(--night)}
.fight-layer .fighter.you .pf{border-color:rgba(240,213,140,.55)}
.fight-layer .fighter.opp .pf{border-color:rgba(143,201,232,.55)}
.fight-layer .pf img,.fight-layer .pf svg{display:block;width:100%;height:100%;object-fit:cover}
.fight-layer .pf.blank{border-style:dashed}
.fight-layer .pf-eye{position:absolute;right:-1px;bottom:-1px;width:20px;height:20px;border-radius:50%;background:var(--night-3);border:1px solid var(--line-2);display:grid;place-items:center;color:var(--opp)}
.fight-layer .pf-eye svg{width:12px;height:12px}
.fight-layer .fi{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}
.fight-layer .fname{display:flex;align-items:baseline;gap:6px;min-width:0}
.fight-layer .fighter.opp .fname{flex-direction:row-reverse}
.fight-layer .fname b{flex:0 1 auto;min-width:0;font:600 17px var(--display);line-height:1.1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.fight-layer .fighter.you .fname b{color:var(--you)}
.fight-layer .fighter.opp .fname b{color:var(--opp)}
.fight-layer .fname small{flex:none;font-size:11px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.fight-layer .fname small em{font-style:normal;color:var(--good)}
.fight-layer .bar{position:relative;display:grid;grid-template-columns:auto minmax(24px,1fr) auto;align-items:center;gap:6px}
.fight-layer .bnum{position:relative;min-width:62px;font-size:20px;font-weight:700;font-variant-numeric:tabular-nums;line-height:1.05;white-space:nowrap}
.fight-layer .bnum small{font-size:11px;font-weight:500;color:var(--muted)}
.fight-layer .bk{font-size:11px;margin-right:3px;vertical-align:2px}
.fight-layer .hp .bk{color:var(--hp)}
.fight-layer .mana .bk{color:var(--mana)}
.fight-layer .btrack{position:relative;height:9px;border-radius:5px;background:rgba(0,0,0,.35);overflow:hidden;box-shadow:inset 0 0 0 1px rgba(255,255,255,.06)}
.fight-layer .btrack i{position:absolute;left:0;top:0;bottom:0;display:block}
.fight-layer .btrack .fill{transition:width .45s cubic-bezier(.2,.8,.2,1)}
.fight-layer .btrack .trail{transition:width .7s ease .45s}
.fight-layer .btrack .flux{transition:width .45s,left .45s}
.fight-layer .hp .fill{background:linear-gradient(90deg,#b6463d,var(--hp))}
.fight-layer .hp .trail{background:#f3d3a8}
.fight-layer .mana .fill{background:linear-gradient(90deg,#3a7fb5,var(--mana))}
.fight-layer .mana .trail{background:#d7e9f3}
.fight-layer .mana .flux{background:repeating-linear-gradient(135deg,#8b7fd6 0 4px,#6d64b6 4px 8px);opacity:.85}
.fight-layer .hp .shield{background:linear-gradient(90deg,#c9a24a,var(--gold-2));opacity:.9;transition:width .45s,left .45s}
.fight-layer .bshield{font-size:11px;font-weight:700;color:var(--k-guard);font-variant-numeric:tabular-nums;min-width:28px;text-align:right}
.fight-layer .cx{flex:none;display:inline-flex;align-items:center;gap:1px;margin:0;align-self:center;padding:0 5px 0 2px;height:17px;border-radius:9px;vertical-align:2px;font:700 10.5px var(--sans);color:var(--k-heal);background:var(--night-3);border:1px solid var(--line)}
.fight-layer .cx .mini-icon{width:14px;height:14px}
.fight-layer .cx .mini-icon svg{width:12px;height:12px}
.fight-layer .fighter.you .cx .mini-icon{color:var(--you)}
.fight-layer .fighter.opp .cx .mini-icon{color:var(--opp)}
.fight-layer .bflux{font-size:11px;font-weight:600;color:#b9b0f2;font-variant-numeric:tabular-nums;min-width:28px;text-align:right}
.fight-layer .bflux.none{opacity:.35}
.fight-layer .bar>.bnum{position:static}
.fight-layer .delta{position:absolute;right:30px;top:-13px;font-size:13px;font-weight:700;pointer-events:none;animation:fl-floatUp 1.6s ease-out forwards;text-shadow:0 1px 3px #000}
.fight-layer .delta.neg{color:var(--bad)}
.fight-layer .delta.pos{color:var(--good)}
/* Mana's changes float in blue (lighter for a gain), apart from HP's red and green. */
.fight-layer .bar.mana .delta.neg{color:#6fa8e8}
.fight-layer .bar.mana .delta.pos{color:#a9dcff}
@keyframes fl-floatUp{0%{opacity:0;transform:translateY(6px)}15%{opacity:1}100%{opacity:0;transform:translateY(-22px)}}
.fight-layer .bar.drop .btrack{animation:fl-barDrop .5s ease}
.fight-layer .bar.rise .btrack{animation:fl-barRise .7s ease}
@keyframes fl-barDrop{30%{box-shadow:0 0 10px 2px var(--hp);transform:translateX(-2px)}60%{transform:translateX(2px)}}
@keyframes fl-barRise{40%{box-shadow:0 0 12px 2px #9fe0a7}}
@media (prefers-reduced-motion:reduce){.fight-layer .btrack i{transition:none!important}
.fight-layer .bar .btrack,.fight-layer .delta{animation:none!important}}
.fight-layer .intent{display:flex;gap:10px;align-items:center;padding:6px 10px;border-radius:12px;background:var(--night-3);border:1px solid var(--line)}
.fight-layer .intent .it{flex:1;min-width:0}
.fight-layer .intent b{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 8px;font-size:13.5px;font-weight:600}
.fight-layer .intent small{display:block;color:var(--muted);font-size:12px;line-height:1.3}
.fight-layer .intent .flavor{font:italic 14px/1.3 var(--serif);color:#d9cfe9}
.fight-layer .intent.hidden .it{display:flex;flex-wrap:wrap;align-items:baseline;gap:0 8px}
.fight-layer .intent.shown{cursor:pointer;border-color:rgba(143,201,232,.4)}
.fight-layer .intent.forced{border-color:var(--k-debuff)}
.fight-layer .intent.shown:hover{border-color:var(--opp)}
.fight-layer .it-more{color:var(--muted);display:flex}
.fight-layer .it-more svg{width:18px;height:18px}
.fight-layer .tele-icon{flex:none;width:36px;height:36px;display:grid;place-items:center;border-radius:10px;border:1px solid rgba(143,201,232,.45);background:var(--night-2);color:var(--opp)}
.fight-layer .tele-icon svg{width:26px;height:26px}
.fight-layer .tele-icon .bundle-icons{display:flex;flex-wrap:wrap;justify-content:center;max-width:32px}
.fight-layer .tele-icon .bundle-icons svg{width:13px;height:13px}
.fight-layer .hidden-move{color:var(--muted);border-style:dashed;border-color:var(--line-2)}
.fight-layer .eff{display:inline-flex;align-items:baseline;gap:3px;white-space:nowrap}
.fight-layer .eff b{font-size:15px;font-weight:700;font-variant-numeric:tabular-nums}
.fight-layer .eff small{font-size:10.5px;font-weight:500;opacity:.85}
.fight-layer .k-dmg .eff,.fight-layer .eff.k-dmg{color:var(--k-dmg)}
.fight-layer .k-heal .eff,.fight-layer .eff.k-heal{color:var(--k-heal)}
.fight-layer .k-mana .eff,.fight-layer .eff.k-mana{color:var(--k-mana)}
.fight-layer .k-guard .eff,.fight-layer .eff.k-guard{color:var(--k-guard)}
.fight-layer .k-buff .eff,.fight-layer .eff.k-buff{color:var(--k-buff)}
.fight-layer .k-debuff .eff,.fight-layer .eff.k-debuff{color:var(--k-debuff)}
.fight-layer .k-gold .eff,.fight-layer .eff.k-gold{color:var(--k-gold)}
.fight-layer .track{--cw:40px;--ch:28px;--lw:64px;--tk-bg:#13172f;padding:4px 8px 6px;border-radius:12px;background:var(--tk-bg);border:1px solid var(--line)}
.fight-layer .tk-scroll{overflow-x:auto;overflow-y:hidden;scrollbar-width:thin;scrollbar-color:var(--line-2) transparent;overscroll-behavior-x:contain}
.fight-layer .tk-row{display:flex;align-items:center;width:max-content;min-width:100%}
.fight-layer .tk-l{flex:0 0 var(--lw);width:var(--lw);margin-right:auto;overflow:hidden;position:sticky;left:0;z-index:2;align-self:stretch;display:flex;align-items:center;background:var(--tk-bg);padding-right:6px}
.fight-layer .tk-c{flex:none;width:var(--cw);height:22px;display:flex;align-items:center;justify-content:center;position:relative}
.fight-layer .tk-c.now{background:rgba(240,213,140,.07);box-shadow:inset 1px 0 0 var(--line-2),inset -1px 0 0 var(--line-2)}
.fight-layer .tk-head .tk-c.now{border-radius:8px 8px 0 0}
.fight-layer .tk-scroll>.tk-row:last-child .tk-c.now{border-radius:0 0 8px 8px}
.fight-layer .tk-c.past.on{background:rgba(255,255,255,.05)}
.fight-layer .tk-head{min-height:18px}
.fight-layer .tk-head .tk-c{height:18px}
.fight-layer .tk-head .tk-c>*{font-size:10.5px;font-weight:500;color:var(--muted);font-variant-numeric:tabular-nums;background:none;border:0;padding:0}
.fight-layer .tk-head .tk-c.now b{color:var(--gold-2);font-weight:700}
.fight-layer .tk-head .past.on button{color:var(--text)}
.fight-layer .tk-act .tk-c{height:var(--ch)}
.fight-layer .tk-who{min-width:0;font:600 15px var(--display);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.fight-layer .s0 .tk-who{color:var(--you)}
.fight-layer .s1 .tk-who{color:var(--opp)}
.fight-layer .tk-act .past .mini-icon{width:26px;height:26px;padding:0;border:0;border-radius:7px;background:none}
.fight-layer .tk-act .past .mini-icon svg{width:19px;height:19px}
.fight-layer .tk-act .past .mini-icon .bundle-icons svg{width:10px;height:10px}
.fight-layer .s0 .past .mini-icon{color:var(--you)}
.fight-layer .s1 .past .mini-icon{color:var(--opp)}
.fight-layer .tk-act .past .mini-icon:hover{background:var(--night-3)}
.fight-layer .slot{width:26px;height:26px;border-radius:8px;display:grid;place-items:center;font-size:12px;font-weight:600;color:var(--muted);border:1px dashed var(--line-2);background:none;padding:0}
.fight-layer .slot svg{width:18px;height:18px}
.fight-layer .slot .bundle-icons{display:flex}
.fight-layer .slot .bundle-icons svg{width:10px;height:10px}
.fight-layer .slot.open{border-color:var(--line);width:8px;height:8px;border-radius:50%;border-style:solid}
.fight-layer .slot.shows{border:1px solid rgba(143,201,232,.55);color:var(--opp);background:var(--night-2)}
.fight-layer .slot.shows:not(button) svg{width:15px;height:15px;opacity:.85}
.fight-layer .slot.forced{border:1px solid var(--k-debuff);color:var(--k-debuff)}
.fight-layer .slot.lost{border:1px solid rgba(143,201,232,.4);color:#bfe6ff;opacity:.8}
.fight-layer .slot.mine{border:1px solid rgba(240,213,140,.5);color:var(--you);font-size:10px}
.fight-layer .slot.now-you{border-style:solid;border-color:rgba(240,213,140,.5);color:var(--you);font-size:10px}
.fight-layer .slot.now-you:empty{border-style:dashed}
.fight-layer .slot.wait{font-size:14px}
.fight-layer .tk-eff{min-height:15px}
.fight-layer .tk-eff .tk-c{height:15px}
.fight-layer .tl-on{position:relative;display:block;width:100%;height:3px;background:var(--you);opacity:.8}
.fight-layer .s1 .tl-on{background:var(--opp)}
.fight-layer .tl-on.first{border-radius:2px 0 0 2px;margin-left:12px}
.fight-layer .tl-on.last{border-radius:0 2px 2px 0;margin-right:6px}
.fight-layer .tl-on.first.last{border-radius:2px}
.fight-layer .tl-on.open{background:linear-gradient(90deg,var(--you),transparent)}
.fight-layer .s1 .tl-on.open{background:linear-gradient(90deg,var(--opp),transparent)}
.fight-layer .tk-ico{display:inline-flex;width:15px;height:15px;align-items:center;justify-content:center;color:var(--you)}
.fight-layer .s1 .tk-ico{color:var(--opp)}
.fight-layer .tk-ico svg{width:13px;height:13px}
.fight-layer .tk-ico .bundle-icons svg{width:7px;height:7px}
.fight-layer .tl-on .tk-ico{position:absolute;left:-12px;top:50%;transform:translateY(-50%)}
.fight-layer .tl-hit{margin:auto;display:inline-flex;align-items:center;gap:1px;font-style:normal;color:var(--k-dmg);font-size:11px;font-weight:700;white-space:nowrap}
.fight-layer .tl-hit .tk-ico{color:var(--k-dmg)}
.fight-layer .hfull{display:flex;flex-direction:column;gap:4px;margin-top:5px;padding:6px 2px 0;border-top:1px solid var(--line)}
.fight-layer .hfull .link{align-self:flex-start}
.fight-layer .hx-full h4{margin:0 0 2px;font-size:11px;font-weight:600;color:var(--muted);letter-spacing:.04em;text-transform:uppercase}
.fight-layer .hx-full h4 small{text-transform:none;font-weight:400}
.fight-layer .hl{display:flex;gap:7px;align-items:flex-start}
.fight-layer .hl p{margin:0;font-size:13px;line-height:1.35}
.fight-layer .hl b{font-weight:600}
.fight-layer .hl.you b{color:var(--you)}
.fight-layer .hl.opp b{color:var(--opp)}
.fight-layer .hl .mini-icon{margin-top:1px;width:auto;min-width:20px}
.fight-layer .hl.you .mini-icon{color:var(--you)}
.fight-layer .hl.opp .mini-icon{color:var(--opp)}
.fight-layer .flavor{font:italic 14.5px/1.35 var(--serif);color:#e2d9ef}
.fight-layer .flavor.finish{display:block;margin:2px 0 0 27px;font-size:14px;color:var(--gold-2)}
.fight-layer .mini-icon{flex:none;display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;color:var(--text)}
.fight-layer .mini-icon svg{width:18px;height:18px}
.fight-layer .mini-icon .bundle-icons{display:inline-flex}
.fight-layer .mini-icon .bundle-icons svg{width:11px;height:11px}
.fight-layer .glyph{font-size:13px}
.fight-layer .action-state{font-size:12.5px;color:var(--gold-2)}
.fight-layer .acts{display:grid;grid-template-columns:repeat(auto-fill,minmax(80px,1fr));gap:6px}
.fight-layer .act{position:relative;aspect-ratio:1;min-width:0;padding:6px 5px 5px;border-radius:14px;background:var(--night-2);border:1px solid var(--line);display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:2px;text-align:center;font-weight:500}
.fight-layer .act:hover:not(:disabled){background:#1c2147}
.fight-layer .act.selected{border-color:var(--gold);background:#262c58;box-shadow:0 0 0 1px var(--gold),0 0 18px rgba(217,180,90,.25)}
.fight-layer .a-ico{position:relative;flex:1;display:flex;align-items:center;justify-content:center;min-height:0;color:var(--text)}
.fight-layer .a-ico svg{width:30px;height:30px}
.fight-layer .a-ico .bundle-icons{display:flex;gap:1px}
.fight-layer .a-ico .bundle-icons svg{width:17px;height:17px}
.fight-layer .a-name{font-size:11px;line-height:1.1;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.fight-layer .eff .lbl+.t::before{content:'· '}
.fight-layer .act .eff{line-height:1}
.fight-layer .act .lbl.same{display:none}
.fight-layer .act .lbl.same+.t::before{content:none}
.fight-layer .act .eff b{font-size:15px}
.fight-layer .act .eff small{font-size:10px}
.fight-layer .a-cost{position:absolute;top:4px;right:6px;display:flex;flex-direction:column;align-items:flex-end;gap:1px;font-variant-numeric:tabular-nums}
.fight-layer .a-cost b{font-size:14px;font-weight:700;line-height:1}
.fight-layer .c-mana{color:var(--k-mana)}
.fight-layer .c-mana::before{content:'';display:inline-block;width:6px;height:6px;margin-right:3px;vertical-align:2px;background:var(--k-mana);transform:rotate(45deg);border-radius:1px}
.fight-layer .c-hp{color:var(--k-dmg)}
.fight-layer .c-hp::before{content:'♥';font-size:9px;margin-right:2px;vertical-align:2px}
.fight-layer .commit-bar{display:flex;gap:10px;align-items:center;padding:6px 8px 6px 12px;border-radius:12px;background:var(--night-3);border:1px solid var(--line)}
.fight-layer .preview{flex:1;min-width:0;font-size:13px}
.fight-layer .preview b{font-weight:600}
.fight-layer .preview .price{color:var(--muted);font-size:12px}
.fight-layer .preview p{margin:3px 0 0;font-size:12.5px;line-height:1.35;color:#cfc6de}
.fight-layer .preview.hint{color:var(--muted)}
.fight-layer .fl-commit{flex:none;min-width:104px;padding:8px 14px;display:inline-flex;align-items:center;justify-content:center;gap:5px}
.fight-layer .control-icon{display:inline-flex}
.fight-layer .control-icon svg{width:15px;height:15px}
.fight-layer .result{padding:14px 16px;border-radius:14px;border:1px solid var(--gold);background:var(--night-3);text-align:center}
.fight-layer .result h2{margin:0;font:700 34px var(--display);color:var(--gold-2)}
.fight-layer .result.loss h2{color:var(--bad)}
.fight-layer .result.draw h2{color:var(--muted)}
.fight-layer .result>p{margin:2px 0 8px;color:var(--muted)}
.fight-layer .net-costs{display:flex;flex-wrap:wrap;justify-content:center;gap:6px 14px;font-size:13px;text-transform:capitalize}
.fight-layer .net-costs b{font-variant-numeric:tabular-nums}
.fight-layer .net-costs .neg{color:var(--bad)}
.fight-layer .net-costs .pos{color:var(--good)}
.fight-layer .sheet{position:fixed;inset:0;z-index:20;display:grid;place-items:center;padding:16px;background:rgba(6,8,20,.6);backdrop-filter:blur(3px)}
.fight-layer .sheet-card{width:min(560px,100%);max-height:88dvh;overflow:auto;padding:14px 16px;border-radius:var(--radius);background:var(--night-2);border:1px solid var(--line-2);box-shadow:0 20px 60px rgba(0,0,0,.6)}
.fight-layer .sh-head{display:flex;gap:12px;align-items:center;margin-bottom:8px}
.fight-layer .sh-head>div:not(.pf){flex:1;min-width:0}
.fight-layer .sh-head b{display:block;font:600 22px var(--display);color:var(--opp)}
.fight-layer .sh-head small{color:var(--muted);font-size:12px}
.fight-layer .sh-head .pf{width:52px;height:52px}
.fight-layer .close{width:32px;height:32px;padding:0;border-radius:50%;font-size:18px;line-height:1;background:var(--night-3)}
.fight-layer .sheet-intent .sh-head b{color:var(--opp)}
.fight-layer .sheet-card h4{margin:12px 0 6px;font-size:10.5px;letter-spacing:.12em;color:var(--muted);text-transform:uppercase}
.fight-layer .sheet-card>p{font-size:13.5px;line-height:1.45}
.fight-layer .sk{display:grid;grid-template-columns:repeat(3,1fr);gap:6px 14px}
.fight-layer .sk span{display:grid;grid-template-columns:1fr auto;gap:2px 6px;font-size:12px}
.fight-layer .sk small{color:var(--muted);text-transform:capitalize}
.fight-layer .sk i{grid-column:1;height:3px;border-radius:2px;background:linear-gradient(90deg,var(--opp) var(--w),rgba(255,255,255,.08) var(--w))}
.fight-layer .sk b{grid-row:1/3;grid-column:2;align-self:center}
.fight-layer .kit{list-style:none;margin:0;padding:0}
.fight-layer .kit li{display:flex;gap:9px;padding:7px 0;border-top:1px solid var(--line)}
.fight-layer .kit li .mini-icon{width:26px;height:26px;color:var(--opp)}
.fight-layer .kit li .mini-icon svg{width:24px;height:24px}
.fight-layer .kit b{font-weight:600}
.fight-layer .kit .price{color:var(--muted);font-size:12px}
.fight-layer .kit em{color:var(--bad);font-size:11.5px;font-style:normal}
.fight-layer .kit p{margin:2px 0 0;font-size:12.5px;line-height:1.35;color:#cfc6de}
.fight-layer .kit li.off{opacity:.55}
.fight-layer .recent{display:flex;flex-wrap:wrap;gap:4px}
@container fight (min-width:640px){.fight-layer .fight-wrap{max-width:980px}
.fight-layer .fight-body{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:10px;align-items:start}
.fight-layer .acts{grid-template-columns:repeat(5,1fr);gap:4px}
.fight-layer .act{border-radius:11px;padding:4px 3px 4px;gap:1px}
.fight-layer .act .a-ico svg{width:22px;height:22px}
.fight-layer .a-name{font-size:9px;letter-spacing:-.01em}
.fight-layer .act .eff b{font-size:13px}
.fight-layer .act .eff small{font-size:9px}
.fight-layer .a-cost{top:3px;right:4px}
.fight-layer .a-cost b{font-size:12px}
.fight-layer .track{--cw:34px}}
@container fight (min-width:840px){.fight-layer .fight-body{grid-template-columns:minmax(0,1fr) minmax(330px,420px);gap:12px}
.fight-layer .acts{grid-template-columns:repeat(5,1fr);gap:6px}
.fight-layer .act{border-radius:14px;padding:6px 5px 5px;gap:2px}
.fight-layer .act .a-ico svg{width:30px;height:30px}
.fight-layer .a-name{font-size:11px}
.fight-layer .act .eff b{font-size:15px}
.fight-layer .act .eff small{font-size:10px}
.fight-layer .a-cost{top:4px;right:6px}
.fight-layer .a-cost b{font-size:14px}
.fight-layer .track{--cw:40px}}
@media(max-width:600px){.fight-layer .fight{gap:6px}
.fight-layer .fighters{gap:5px}
.fight-layer .fighter{flex-direction:column;align-items:stretch;gap:4px;padding:6px}
.fight-layer .fighter.opp{flex-direction:column}
.fight-layer .fighter .pf{width:34px;height:34px;position:absolute;top:6px}
.fight-layer .fighter{position:relative}
.fight-layer .fighter.you .pf{left:6px}
.fight-layer .fighter.opp .pf{right:6px}
.fight-layer .pf-eye{width:14px;height:14px}
.fight-layer .pf-eye svg{width:9px;height:9px}
.fight-layer .fname{min-height:34px;flex-wrap:wrap;align-content:center;column-gap:4px}
.fight-layer .fighter.you .fname{padding-left:40px}
.fight-layer .fighter.opp .fname{padding-right:40px}
.fight-layer .fname b{font-size:14.5px}
.fight-layer .fname small{font-size:9.5px}
.fight-layer .bar{gap:4px}
.fight-layer .bnum{min-width:0;font-size:16px}
.fight-layer .bnum small{font-size:9px}
.fight-layer .bk{display:none}
.fight-layer .btrack{height:7px}
.fight-layer .bflux,.fight-layer .bshield{font-size:9.5px;min-width:0}
.fight-layer .bshield.none{display:none}
.fight-layer .intent{padding:4px 7px;gap:7px}
.fight-layer .tele-icon{width:28px;height:28px}
.fight-layer .tele-icon svg{width:20px;height:20px}
.fight-layer .intent b{font-size:12px}
.fight-layer .intent small{font-size:10.5px}
.fight-layer .intent .flavor{font-size:12.5px}
.fight-layer .track{--cw:27px;--ch:24px;padding:3px 5px 5px}
.fight-layer .track{--lw:42px}
.fight-layer .tk-l{padding-right:3px}
.fight-layer .tk-who{font-size:13px}
.fight-layer .tk-head .tk-c>*{font-size:9.5px}
.fight-layer .slot{width:22px;height:22px;border-radius:6px}
.fight-layer .slot svg{width:15px;height:15px}
.fight-layer .tk-act .past .mini-icon{width:22px;height:22px}
.fight-layer .tk-act .past .mini-icon svg{width:16px;height:16px}
.fight-layer .tl-hit{font-size:10px}
.fight-layer .hl p{font-size:11.5px}
.fight-layer .flavor{font-size:13px}
.fight-layer .hfull{gap:3px;margin-top:3px;padding-top:4px}
.fight-layer .acts{grid-template-columns:repeat(auto-fill,minmax(44px,1fr));gap:4px}
.fight-layer .act{border-radius:10px;padding:3px 2px 3px;gap:0}
.fight-layer .a-ico svg{width:22px;height:22px}
.fight-layer .a-ico .bundle-icons svg{width:12px;height:12px}
.fight-layer .a-name{display:none}
.fight-layer .act .eff b{font-size:12.5px}
.fight-layer .act .eff small{font-size:8.5px}
.fight-layer .act .eff.has-v .lbl{display:none}
.fight-layer .act .eff.has-v .lbl+.t::before{content:none}
.fight-layer .act .eff:not(.has-v) .lbl.same{display:inline}
.fight-layer .act .eff:not(.has-v) .lbl.same+.t::before{content:'· '}
.fight-layer .a-cost{top:2px;right:3px}
.fight-layer .a-cost b{font-size:11px}
.fight-layer .c-mana::before{width:5px;height:5px}
.fight-layer .c-hp::before{font-size:7px}
.fight-layer .acts.forced .a-name{display:block;font-size:8.5px}
.fight-layer .commit-bar{padding:5px 7px;gap:6px}
.fight-layer .preview{font-size:11.5px}
.fight-layer .preview p{font-size:10.5px;line-height:1.25}
.fight-layer .fl-commit{min-width:64px;padding:8px 8px;font-size:12px}
.fight-layer .result{padding:8px}
.fight-layer .result h2{font-size:26px}
.fight-layer .sheet{place-items:end center;padding:0}
.fight-layer .sheet-card{border-radius:var(--radius) var(--radius) 0 0;max-height:82dvh;padding:12px}
.fight-layer .sk{grid-template-columns:repeat(2,1fr)}}
@media(max-width:600px) and (max-height:700px){.fight-layer .hfull .flavor:not(.finish),.fight-layer .intent .flavor,.fight-layer .intent .it>small,.fight-layer .intent .eff small,.fight-layer .hx-full h4{display:none}
.fight-layer .intent b{font-size:12px}}
@media(max-width:600px) and (max-height:620px){.fight-layer .intent .it>small:not(.flavor){display:none}
.fight-layer .fname small{display:none}
.fight-layer .fname{min-height:24px}}
/* The feedback bar would sit over the fight's corner: it waits until the fight is over. */
body:has(.fight-layer) #fbBar { display: none; }
/* The engine's analysis (the "engine analysis" setting, a cheat): its toggle, the eval bar beside the fighters, each
 * action's score, the best move outlined, and the panel of top lines. Ported from combat/web/style.css, in the game's tokens. */
.fight-layer .eng-toggle{align-self:flex-start;padding:4px 10px;font-size:12px;font-weight:600;border-radius:999px;border-style:dashed;color:var(--muted);background:transparent}
.fight-layer .eng-toggle[aria-pressed="true"]{border-style:solid;border-color:rgba(159,224,167,.6);color:#9fe0a7;background:rgba(159,224,167,.08)}
.fight-layer .fighters.with-eval{grid-template-columns:14px 1fr 1fr}
.fight-layer .evalbar{position:relative;width:14px;background:var(--night);border:1px solid var(--line);border-radius:4px;overflow:hidden}
.fight-layer .evalbar i{position:absolute;left:0;right:0;bottom:0;background:var(--parch);transition:height .5s ease}
.fight-layer .evalbar span{position:absolute;left:0;right:0;bottom:3px;text-align:center;font-size:8px;font-weight:700;color:var(--ink);writing-mode:vertical-rl;transform:rotate(180deg)}
.fight-layer .engine{padding:8px 10px;background:var(--night-2);border:1px solid rgba(159,224,167,.3);border-radius:12px;font-size:12px}
.fight-layer .engine-head{display:block;font-size:12px;font-weight:600;color:#9fe0a7}
.fight-layer .lines{list-style:none;margin:6px 0 2px;padding:0}
.fight-layer .lines li{display:flex;gap:8px;align-items:center;padding:4px 0;border-top:1px solid var(--line)}
.fight-layer .lines .eval{flex:none;min-width:46px;text-align:center;font-weight:700;font-variant-numeric:tabular-nums;padding:2px 6px;border-radius:6px;background:var(--night-3)}
.fight-layer .lines li.best .eval{background:var(--parch);color:var(--ink)}
.fight-layer .lines .line{display:flex;flex-wrap:wrap;gap:4px;align-items:center}
.fight-layer .ply{display:inline-flex;align-items:center;gap:2px;padding:1px 6px 1px 2px;border-radius:10px;font-size:11px;background:var(--night-3)}
.fight-layer .ply.you{box-shadow:inset 0 0 0 1px rgba(240,213,140,.55)}
.fight-layer .ply.opp{box-shadow:inset 0 0 0 1px rgba(143,201,232,.55)}
.fight-layer .ply.end{padding:1px 8px;background:#3a2a2a;color:#f3d3a8}
.fight-layer .ply .mini-icon{width:18px;height:18px;display:inline-grid;place-items:center}
.fight-layer .ply .mini-icon svg{width:16px;height:16px}
.fight-layer .ply.you .mini-icon{color:var(--you)}
.fight-layer .ply.opp .mini-icon{color:var(--opp)}
.fight-layer .ply .bundle-icons svg{width:9px;height:9px}
.fight-layer .sep{color:var(--muted)}
.fight-layer .engine .fine{margin:4px 0 0;font-size:10.5px}
.fight-layer .act.best{outline:2px solid #9fe0a7;box-shadow:0 0 12px rgba(159,224,167,.45)}
.fight-layer .a-eval{position:absolute;top:4px;left:6px;font-size:9.5px;font-style:normal;color:var(--muted);font-variant-numeric:tabular-nums}
.fight-layer .act.best .a-eval{color:#9fe0a7}
@media(max-width:600px){.fight-layer .fighters.with-eval{grid-template-columns:10px 1fr 1fr}
.fight-layer .evalbar{width:10px}
.fight-layer .engine{padding:6px 8px;font-size:11px}
.fight-layer .lines li:nth-child(n+2){display:none}
.fight-layer .engine .fine{display:none}
.fight-layer .a-eval{top:2px;left:4px;font-size:8.5px}}
.fight-layer .engine-top{display:flex;align-items:center;gap:8px}
.fight-layer .engine-top .engine-head{margin-right:auto}
.fight-layer .eng-budget{width:auto;margin:0;padding:2px 6px;font-size:11px;background:var(--night);color:var(--text);border:1px solid var(--line);border-radius:6px}
/* A spell's level in the kit, on its action button (beside the icon). */
.fight-layer .a-lv{position:absolute;right:-12px;bottom:2px;padding:0 3px;border-radius:5px;font:700 9px/1.35 var(--serif);letter-spacing:.02em;color:var(--gold-2);background:var(--night);border:1px solid var(--line)}
@media(max-width:600px){.fight-layer .a-lv{right:-10px;font-size:8px}}
/* The entrance: for its first moments the fight lies over the card view (same place as in the flow: the stage's padding
 * plus the layer's margin) and its panels rise in one after another while the card and the choices recede; then
 * .fight-enter goes and the fight takes the card's place. Reduced motion skips it (src/combat-ui.js). */
.stage.fighting.fight-enter > .deck, .stage.fighting.fight-enter > .choices { display: flex; pointer-events: none; }
.stage.fighting.fight-enter > .deck { display: block; animation: fight-deck-out .55s ease forwards; }
.stage.fighting.fight-enter > .choices { animation: fight-fade-out .3s ease forwards; }
.stage.fight-enter > .fight-layer { position: absolute; top: 10px; left: 16px; right: 16px; bottom: 18px; width: auto; z-index: 5; }
.stage.fight-enter .fight-layer :is(.fight-note, .fighters > *, .fight-main > *, .controls > *) { animation: fight-rise .5s cubic-bezier(.2, .8, .25, 1) both; }
.stage.fight-enter .fight-layer .fighters > :nth-child(2) { animation-delay: .06s; }
.stage.fight-enter .fight-layer .fighters > :nth-child(3) { animation-delay: .12s; }
.stage.fight-enter .fight-layer .fight-main > * { animation-delay: .16s; }
.stage.fight-enter .fight-layer .controls > :nth-child(1) { animation-delay: .22s; }
.stage.fight-enter .fight-layer .controls > :nth-child(2) { animation-delay: .29s; }
.stage.fight-enter .fight-layer .controls > :nth-child(n+3) { animation-delay: .36s; }
@keyframes fight-rise { from { opacity: 0; transform: translateY(26px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes fight-deck-out { to { opacity: .12; transform: scale(.94); filter: blur(1.5px); } }
@keyframes fight-fade-out { to { opacity: 0; } }
