/* LUDIVAR'S REALM (user, 11-08: "rethink the black and yellow colors";
   the game is a fair board inside a god's playroom, "closer to a chess
   board", and "you should [feel] Ludivar's presence even when not on
   screen"). Night violet instead of black, his lilac instead of yellow;
   GOLD is kept for what gold means -- money, prizes, and his star. Board
   highlights and the two sides' colours carry information and stay. */
/* THE LETTERING (user, 11-08: "as good or better than balatro, sts"): a
   display serif with a little wonk for titles, names and big numbers --
   a god who never grew up, writing on a chessboard -- and a round, open
   sans for everything you read. "Serif" and "Sans" are the names every
   rule below already uses, so the whole game changes face here. */
@font-face { font-family: "Display"; src: url(/static/fonts/Fraunces.woff2?v=7112afe436) format("woff2"); font-weight: 300 900; font-display: swap; }
@font-face { font-family: "Sans"; src: url(/static/fonts/Nunito.woff2?v=7112afe436) format("woff2"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Mono"; src: url(/static/fonts/DejaVuSansMono.woff2?v=7112afe436) format("woff2"); font-display: swap; }

:root {
  --bg: #140f26; --panel: #201936; --panel-light: #2c2349; --panel-deep: #19132e;
  --panel-edge: #463a6e; --text: #f1e9d8; --dim: #a497bf; --accent: #b98cff;
  --gold: #f2c75c; --star: #fbd368; --floor-a: #1c1536; --floor-b: #241b45;
  --warn: #f0783c; --good: #78dc82; --bad: #e65a5a;
  --light-sq: #d0c4ac; --dark-sq: #806e5c; --frame: #403226;
  --select: #fadc5a; --move-dot: #5ac878; --capture: #e65a5a; --spawn: #6eaafa;
  --check: #c83c3c; --forced: #ff8c1e; --forced-tint: #6c3e1a; --threat: #f06e5a;
  --hanging: #faaa46; --last-from: #daba60; --last-to: #f6d66e; --shield: #46ebcd;
  --mine: #6cb0f6; --theirs: #e26060; --callout-bg: #100b1f;
  --palace: #b08e60; --river: #5684a8;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font-family: Sans, system-ui, sans-serif; font-size: 16px; line-height: 1.35; }
body { overscroll-behavior: none; touch-action: manipulation; }
#app { max-width: 720px; margin: 0 auto; padding: 22px 10px calc(16px + env(safe-area-inset-bottom)); }
h1, h2, .head { font-family: Sans, system-ui, sans-serif; font-weight: bold; margin: 0; }
h1 { color: var(--accent); font-size: 1.9rem; text-align: center; letter-spacing: .02em; font-variation-settings: "opsz" 144, "SOFT" 40, "WONK" 1;
  text-shadow: 0 0 22px rgba(185,140,255,.35); }
h2 { font-size: 1.15rem; }
button { font: inherit; font-weight: bold; color: var(--text); background: var(--panel-light);
  border: 2px solid var(--panel-edge); border-radius: 10px; padding: 10px 14px; cursor: pointer; }
button.primary { background: var(--accent); color: #1b1033; border-color: #8a5fd6; }
button.danger { background: #45213a; border-color: var(--bad); }
button:disabled { opacity: .45; cursor: default; }
/* the hand over what a click does something to (user, 11-03) */
.clickable { cursor: pointer; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.panel { background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 10px; padding: 10px; margin: 8px 0; }
.dim { color: var(--dim); }
.small { font-size: .85rem; }
#loading { text-align: center; padding: 40px 0; color: var(--dim); }
#error { background: #3a1e1e; border: 1px solid var(--bad); color: #ffdcdc; padding: 8px 10px;
  border-radius: 8px; margin: 8px 0; font-size: .85rem; white-space: pre-wrap; }

/* --- the battle -------------------------------------------------------- */
.topbar { display: flex; justify-content: space-between; align-items: baseline; padding: 2px 2px 6px; }
.topbar .title { font-family: Sans, system-ui, sans-serif; font-weight: bold; color: var(--accent); }
.clock { font-size: .85rem; }
.clock .n { font-weight: bold; font-family: Sans, system-ui, sans-serif; font-size: 1.2rem; padding: 2px 8px; border-radius: 50%; border: 3px solid var(--good); }
.clock.mid .n { border-color: var(--gold); } .clock.low .n { border-color: var(--warn); }
.clock.critical .n { border-color: var(--bad); color: var(--bad); }
.strip { display: flex; align-items: center; gap: 8px; padding: 4px 2px; font-size: .9rem; }
.strip .who { font-family: Sans, system-ui, sans-serif; font-weight: bold; }
.strip.them .who { color: var(--theirs); } .strip.you .who { color: var(--mine); }
.strip .fallen { color: var(--dim); font-size: .8rem; margin-left: auto; }
#board { display: block; width: 100%; touch-action: none; border-radius: 6px; }
.readout { margin-top: 8px; padding: 8px 10px; border-left: 4px solid var(--mine); background: var(--panel); border-radius: 6px; }
.readout.them { border-left-color: var(--theirs); }
.readout .t { font-family: Sans, system-ui, sans-serif; font-weight: bold; }
.readout .d { font-size: .85rem; }
.readout.must .d { color: var(--forced); } .readout.follow .d { color: var(--spawn); }
.readout.extra .d { color: var(--good); } .readout.free .d { color: var(--accent); }
.callout { min-height: 44px; margin-top: 6px; padding: 7px 10px; background: var(--callout-bg);
  border: 1px solid var(--panel-edge); border-radius: 8px; font-size: .85rem; display: flex; gap: 10px; align-items: center; }
.callout .ic { width: 28px; height: 28px; flex: none; }
.callout .ttl { font-weight: bold; } .callout.good .ttl { color: var(--good); } .callout.bad .ttl { color: var(--bad); }
.callout.info .ttl { color: var(--accent); }
.callout .hint { color: var(--dim); }
.callout.piece { flex-direction: column; align-items: stretch; gap: 4px; }
.callout.piece .head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.callout.piece .head button.small.info { margin-left: 0; flex: none; }
.tabs { display: flex; gap: 6px; margin-top: 8px; }
.tabs button { flex: 1; padding: 7px 4px; font-size: .85rem; border-radius: 8px; }
.tabs button.on { border-color: var(--accent); color: var(--accent); }
.tabs .badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--panel-deep); color: var(--text); font-size: .75rem; margin-left: 4px; }
.sheet { background: var(--panel-deep); border: 1px solid var(--panel-edge); border-radius: 8px; padding: 8px 10px; margin-top: 6px; min-height: 90px; max-height: 38vh; overflow-y: auto; font-size: .85rem; }
.sheet .log div { padding: 1px 0; white-space: pre-wrap; } .sheet .log .ev { color: var(--dim); }
.sheet .log .enemy { color: #e2a0a0; }
.rule { display: flex; gap: 10px; align-items: flex-start; padding: 5px 0; border-bottom: 1px solid #2c2c36; }
.rule .ic { width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--panel-light); }
.rule.good .ttl { color: var(--good); } .rule .ttl { font-weight: bold; }
.reward-row { display: flex; gap: 8px; align-items: flex-start; }
.reward-row .offers { flex: 1; min-width: 0; }
.reward-row .rails { position: sticky; top: 8px; }
.rail .slot.letgo.letgo { box-shadow: 0 0 0 3px var(--bad); }
.rail .slot.letgo canvas { opacity: .45; }
.rail .slot .x { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--bad); font-size: 1.5rem; font-weight: bold; text-shadow: 0 0 3px #000; pointer-events: none; }
.rule.fired .ic { box-shadow: 0 0 0 3px var(--accent); }
.rule .txt { color: var(--dim); font-size: .8rem; }
.sheet .side { font-family: Sans, system-ui, sans-serif; font-weight: bold; margin: 6px 0 2px; }
.sheet .side.them { color: var(--theirs); } .sheet .side.you { color: var(--mine); }
.tiles { display: flex; gap: 6px; flex-wrap: wrap; }
.tile { width: 54px; height: 62px; border-radius: 8px; background: var(--panel-light); border: 2px solid var(--panel-edge);
  display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: .7rem; position: relative; }
.tile.on { border-color: var(--select); box-shadow: 0 0 0 2px var(--select); }
.tile.off { opacity: .45; }
.tile canvas { width: 40px; height: 40px; }
.tile .n { position: absolute; top: 2px; right: 4px; font-weight: bold; }
.buttons { display: flex; gap: 8px; margin-top: 10px; justify-content: flex-end; flex-wrap: wrap; }
.ask { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; z-index: 10; }
.ask .card { background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 12px; padding: 16px; width: min(92vw, 360px); max-height: 90vh; max-height: 90dvh; overflow-y: auto; box-sizing: border-box; }
/* (11-11: a ten-coupon "Let one go" ran off both ends of a phone, its title and Cancel out of reach) */
.ask .card button { display: block; width: 100%; margin-top: 8px; }
.result { text-align: center; padding: 10px; }
.result .big { font-family: Sans, system-ui, sans-serif; font-size: 1.5rem; font-weight: bold; }
.result.won .big { color: var(--good); } .result.lost .big { color: var(--bad); }

/* --- the other screens ------------------------------------------------ */
.menu .start { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.bracket .fixture { display: flex; justify-content: space-between; padding: 3px 6px; border-radius: 6px; }
.bracket .fixture.you { background: var(--panel-light); }
.bracket .w { color: var(--good); } .bracket .l { color: var(--bad); }
.ludivar { display: flex; gap: 10px; align-items: flex-start; }
.ludivar :is(img, :where(ludi-face)) { width: 56px; height: 56px; border-radius: 50%; flex: none; }
.ludivar .bubble { background: #2e2a3c; border: 1px solid #5a4e7a; border-radius: 10px; padding: 8px 10px; font-size: .9rem; }
.ludivar .bubble > div + div { margin-top: 6px; }
.army { display: flex; gap: 4px; flex-wrap: wrap; }
.army .tile { width: 46px; height: 54px; }
.army .lives { font-size: .65rem; color: var(--bad); }
.card { background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 10px; padding: 10px; }
.skulls { color: var(--bad); letter-spacing: 2px; }
.lot { display: flex; gap: 6px; align-items: center; padding: 8px; border: 2px solid var(--panel-edge); border-radius: 10px; margin: 6px 0; background: var(--panel-light); }
.lot:active { border-color: var(--accent); }

/* --- phase 2: the run's screens ----------------------------------------- */
.center { text-align: center; }
.tiny { font-size: .72rem; }
.wide { width: 100%; }
.good { color: var(--good); } .bad { color: var(--bad); }
.msg { margin: 6px 0; padding: 6px 10px; background: #241c3e; border-left: 3px solid var(--accent); border-radius: 6px; font-size: .85rem; }
.runbar { display: flex; gap: 10px; align-items: baseline; padding: 4px 2px; font-size: .85rem; }
.runbar .div { font-family: Sans, system-ui, sans-serif; font-weight: bold; color: var(--accent); }
.runbar .gold { font-weight: bold; }
.gold::before { content: "●"; color: var(--gold); margin-right: 3px; }
.factions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.factions button.on { border-color: var(--accent); color: var(--accent); }
.factions button.locked { opacity: .5; }
.dossier .rule .ttl { font-size: .9rem; }
.starts { display: grid; gap: 6px; }
.start { padding: 8px; border: 2px solid var(--panel-edge); border-radius: 10px; background: var(--panel-light); }
.start.on { border-color: var(--accent); }
.buttons.left { justify-content: flex-start; }
.road .fixture { display: flex; gap: 10px; align-items: baseline; padding: 4px 6px; }
.road .rn { width: 34px; color: var(--dim); font-size: .75rem; }
.road .w { margin-left: auto; font-weight: bold; }
.road .won .w { color: var(--good); } .road .lost .w { color: var(--bad); } .road .next .w { color: var(--accent); }
.contender { padding: 6px 8px; border-bottom: 1px solid #2c2c36; }
.contender.you { background: var(--panel-light); border-radius: 6px; }
.contender.out { opacity: .5; }
.tree .fixture span.w { color: var(--good); } .tree .fixture span.l { color: var(--dim); text-decoration: line-through; }
#deploy { display: block; width: 100%; touch-action: none; border-radius: 6px; margin-top: 6px; }
.tile.bench { border-style: dashed; }
.tile.shelf { width: 74px; height: 92px; }
.tile.shelf .tiny { text-align: center; line-height: 1.05; max-height: 2.1em; overflow: hidden; }
.tile.shelf .price { color: var(--gold); font-weight: bold; font-size: .8rem; }
.tile.cant .price { color: var(--dim); }
.sheet.tall { max-height: none; }
.wager .row { justify-content: space-between; }
.opp .skulls { margin-left: auto; }
button.small { padding: 5px 9px; font-size: .8rem; border-radius: 8px; }
.lot.on { border-color: var(--accent); }

/* --- a wide, short screen (a foldable open, a landscape phone): the board
   on the left sized by height, the dock beside it (user, 10-15: "This is
   bad" -- the board filled the width and the controls fell off the screen) */
#app { max-width: 1100px; }
.battle .col.board > canvas, #deploy { margin: 0 auto; }
.battle.wide { display: grid; grid-template-columns: minmax(0, 52%) minmax(0, 1fr); gap: 14px; align-items: start; }
.battle.wide .col.dock { position: sticky; top: 8px; }
.battle.wide .sheet { max-height: 34vh; }
.tabs.rounds button { padding: 6px 2px; font-size: .75rem; }
.tree .fixture { display: flex; gap: 8px; padding: 4px 6px; border-bottom: 1px solid #2c2c36; }
.tree .fixture.you { background: var(--panel-light); border-radius: 6px; }
.tree .fixture span { flex: 1; } .tree .fixture span.dim { flex: 0; }
.tree .youname { color: var(--accent); font-weight: bold; }
.chart { overflow: auto; max-height: 62vh; border: 1px solid var(--panel-edge); border-radius: 10px; background: var(--panel); margin: 8px 0; -webkit-overflow-scrolling: touch; }
.chart svg { display: block; }

/* --- points (the desktop's POINTS LEFT panel) ------------------------------ */
.points { margin: 8px 0 4px; padding: 8px 12px; border-radius: 8px; border: 2px solid var(--good); background: #2a3230; }
.points.warn { border-color: var(--gold); background: #33283a; } .points.bad { border-color: var(--bad); background: #3a2a2a; }
.points .row { justify-content: space-between; align-items: baseline; }
.points .label { font-size: .75rem; font-weight: bold; letter-spacing: .5px; }
.points.good .label, .points.good .big { color: var(--good); } .points.warn .label, .points.warn .big { color: var(--gold); } .points.bad .label, .points.bad .big { color: var(--bad); }
.points .big { font-family: Sans, system-ui, sans-serif; font-size: 1.9rem; font-weight: bold; line-height: 1.1; }
.points .carry { font-size: .85rem; } .points .carry.bad { color: var(--bad); font-weight: bold; }
.points .bar { position: relative; height: 10px; border-radius: 4px; background: var(--panel-deep); border: 1px solid #5a5a6a; margin: 4px 0 6px; overflow: hidden; }
.points .bar .used { height: 100%; background: var(--mine); }
.points .bar .want { position: absolute; top: 0; height: 100%; background: var(--accent); }
.tile .cost { font-size: .8rem; font-weight: bold; color: var(--gold); }
.tile .cost.dim { color: var(--dim); font-weight: normal; }
.hint { margin: 4px 0; }

/* --- the explaining pictures ---------------------------------------------- */
.ask .card.explain { max-height: 90vh; overflow-y: auto; }
.chart-view .charts { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.chart-view .chartbox canvas { display: block; border-radius: 4px; }
.chart-view .after { flex: 1; min-width: 140px; }
.chart-view .accent { color: var(--accent); font-weight: bold; }
.chart-view .legend { margin-top: 6px; }
.chart-view .legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--move-dot); vertical-align: middle; }
.chart-view .legend .ring { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 3px solid var(--capture); vertical-align: middle; }
.tile.mini { width: 36px; height: 36px; }
.demo-view canvas { display: block; border-radius: 4px; margin-top: 6px; }
.demo-view .caption { margin-top: 6px; font-size: .9rem; min-height: 2.6em; }
.demo-view .event { min-height: 1.3em; }
.demo-view .controls { margin-top: 4px; }
.rule.tap { cursor: pointer; } .rule.tap:active { background: var(--panel-light); }
.lot .why { margin-left: auto; flex: none; }
.ask .card .demo-view .controls button, .ask .card .lot .why { display: inline-block; width: auto; margin: 0 6px 0 0; }
.demo-view .controls { gap: 6px; }
.strip { flex-wrap: wrap; }
.strip .pace { flex-basis: 100%; display: flex; gap: 6px; flex-wrap: wrap; }
/* --- the coupon COLUMNS (10-18, the desktop's rails: ui/hud._draw_coupon_rail)
   -- the board with YOUR coupons down a column at its right and THEIRS
   (red-edged) down the next, a square slot a coupon, a dot a free slot */
.fieldrow { display: flex; gap: 6px; align-items: stretch; }   /* not .arena: that is the market screen's root */
.fieldrow .boardslot { flex: 1 1 auto; min-width: 0; }
.rails { --slot: 34px; display: flex; gap: 4px; flex: none; }
.rail { width: calc(var(--slot) + 8px); padding: 4px 0; overflow: hidden; display: flex; flex-direction: column; align-items: center;
  justify-content: flex-start; gap: 3px; background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 10px; }
/* yours BLUER, theirs REDDER (user, 10-18): each column edged and tinted
   in its side's colour (YOU blue, THEM red), so the two read as two
   sides at a glance */
.rail.mine { border-color: var(--mine); border-width: 2px; background: #243040; }
.rail.mine .slot.free i { background: #1a2230; border-color: #3a5070; }
.rail.theirs { border-color: var(--theirs); border-width: 2px; background: #3a2428; }
.rail.theirs .slot.free i { background: #2a1a1e; border-color: #6a3a40; }
.rails .rail { gap: 3px; }
.rail .slot { width: var(--slot); height: var(--slot); flex: none; border-radius: 50%; position: relative; cursor: pointer; }
.rail .slot canvas { width: 100%; height: 100%; display: block; border-radius: 50%; }
.rail .slot.free { cursor: default; display: flex; align-items: center; justify-content: center; }
.rail .slot.free i { width: 5px; height: 5px; border-radius: 50%; background: var(--panel-deep); border: 1px solid #3c3c48; }
.rail .slot.uncommon { box-shadow: 0 0 0 2px var(--good); } .rail .slot.rare { box-shadow: 0 0 0 2px var(--accent); }
.rail .slot.legendary { box-shadow: 0 0 0 2px var(--warn); }
.rail .slot.fired { box-shadow: 0 0 0 3px var(--good), 0 0 14px 4px rgba(120, 220, 130, .7); animation: slot-glow 1200ms infinite alternate; }
@keyframes slot-glow { from { box-shadow: 0 0 0 3px var(--good), 0 0 8px 2px rgba(120, 220, 130, .45); } to { box-shadow: 0 0 0 3px var(--good), 0 0 16px 6px rgba(120, 220, 130, .85); } }
.rail .slot:active { transform: scale(.94); }
.chip { font-size: .72rem; padding: 2px 7px; border-radius: 8px; border: 1px solid; }
.chip.good { color: var(--good); border-color: #3a6a44; } .chip.bad { color: var(--bad); border-color: #6a3a3a; }
.chip.next { font-weight: bold; animation: chip-beat 900ms infinite alternate; }
.chip.good.next { background: #223a28; } .chip.bad.next { background: #3a2222; }
@keyframes chip-beat { from { opacity: .7; } to { opacity: 1; } }
.readout { position: relative; }
.readout .free { color: var(--good); margin-top: 2px; }
.readout .pips { position: absolute; top: 8px; right: 10px; display: flex; gap: 4px; }
.readout .pip { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--mine); }
.readout.them .pip { border-color: var(--theirs); }
.readout .pip.spent { background: #4a5a6a; border-color: #4a5a6a; }

/* --- the coupon cards ------------------------------------------------------ */
.coupon-card { background: var(--callout-bg); border: 2px solid var(--good); border-radius: 12px; padding: 10px 14px; width: min(92vw, 340px); text-align: center; box-shadow: 0 8px 30px rgba(0,0,0,.6); }
.coupon-card.theirs { border-color: var(--bad); }
.coupon-card .hd { font-size: .75rem; font-weight: bold; letter-spacing: 1px; color: var(--good); }
.coupon-card.theirs .hd { color: var(--bad); }
.coupon-card .nm { font-family: Sans, system-ui, sans-serif; font-weight: bold; font-size: 1.3rem; margin: 4px 0; }
.coupon-card .ln { font-size: .9rem; }
.coupon-card .ft { font-size: .72rem; color: var(--dim); margin-top: 8px; }
.col.board { position: relative; }
.col.board > .coupon-card.mine { position: absolute; left: 50%; top: 18%; transform: translateX(-50%); z-index: 5; }
.coupon-scrim { z-index: 20; }

/* the loading checklist and the waiting bar (10-15): what the page is
   waiting for, and what is left */
#loading { padding: 24px 16px; max-width: 420px; margin: 0 auto; }
#loading .load-title { font-family: Sans, system-ui, sans-serif; font-weight: bold; font-size: 1.3rem; color: var(--accent); }
#loading .load-sum { margin: 6px 0 10px; color: var(--text); }
#loading .load-list { list-style: none; padding: 0; margin: 0; font-size: .9rem; color: var(--dim); }
#loading .load-list li { padding: 2px 0; }
#loading .load-list li.done { color: var(--good, #7fd07f); }
#loading .kb { opacity: .6; font-size: .8rem; }
#waiting { position: fixed; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  max-width: calc(100vw - 32px); padding: 8px 14px; border-radius: 999px; z-index: 50;
  background: var(--panel-deep, #15151c); border: 1px solid var(--accent); color: var(--text);
  font-size: .85rem; box-shadow: 0 4px 16px rgba(0,0,0,.5); pointer-events: none; }
#loading .load-debug { margin-top: 14px; font-family: Mono, monospace; font-size: .7rem; color: var(--dim); text-align: left; word-break: break-word; }
#loading .load-debug .err { color: var(--bad); }
.readout .passnow { margin-top: 6px; }
.callout .cant { color: var(--hanging); font-size: .8rem; margin-top: 2px; }
.readout .packrow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.readout .packrow button.on { border-color: var(--accent); color: var(--accent); }

/* --- the full piece card (10-16): four tabs ---------------------------------- */
.callout button.small.info, .hint button.small.info { display: inline-block; width: auto; margin-left: 8px; vertical-align: middle; }
.piece-info .head-row { display: flex; gap: 10px; align-items: center; }
.piece-info .head-row h2 { margin: 0; }
.piece-info .tabs { margin: 8px 0 6px; } .piece-info .tabs button { padding: 6px 2px; font-size: .78rem; }
.piece-info .body { min-height: 120px; }
.piece-info .body .line { margin: 6px 0; } .piece-info .body .line.accent { color: var(--accent); }
.piece-info .body .side { font-family: Sans, system-ui, sans-serif; font-weight: bold; margin: 8px 0 2px; }
.piece-info .body .side.you { color: var(--mine); } .piece-info .body .side.them { color: var(--theirs); }
.piece-info .rule.on { background: var(--panel-light); border-radius: 6px; }
.piece-info .chartbox canvas { display: block; border-radius: 4px; margin: 0 auto; }
.piece-info .tiles.small { margin-bottom: 4px; }
.picked-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 6px 0 2px; padding: 6px 10px; border-radius: 8px; background: var(--panel); border: 1px solid var(--panel-edge); }
.picked-bar button.small.info { margin-left: 8px; width: auto; display: inline-block; flex: none; }
/* --- a RUN coupon's ledger demo (10-16) ----------------------------------- */
.ledger { margin-top: 6px; background: var(--panel-deep); border: 1px solid var(--panel-edge); border-radius: 8px; padding: 8px 10px; min-height: 120px; }
.ledger .lrow { display: flex; gap: 8px; align-items: center; padding: 3px 0; border-bottom: 1px solid #2c2c36; font-size: .85rem; }
.ledger .lrow .lab { flex: 1; color: var(--dim); } .ledger .lrow .val { font-weight: bold; text-align: right; }
.ledger .lrow.changed .val { color: var(--accent); animation: chip-beat 600ms 4 alternate; }
.ledger .lrow.changed .lab { color: var(--text); }
.ledger .tiny.dim { margin-top: 6px; }
.ledger .tiles.army .tile.mini { width: 36px; height: 48px; position: relative; }
.ledger .tiles.army .tile.mini .lives { font-size: .55rem; color: var(--bad); line-height: 1; }
.ledger .tiles.army .tile.mini .n { position: absolute; top: -2px; right: 0; font-size: .7rem; color: var(--accent); }
.ledger .tiles .tile.on { outline: 2px solid var(--accent); }
.ledger .shelf { display: flex; flex-wrap: wrap; gap: 4px; }
.ledger .shelf .it { font-size: .7rem; padding: 2px 6px; border: 1px solid var(--panel-edge); border-radius: 6px; display: inline-flex; align-items: center; gap: 3px; background: var(--panel); }
.ledger .shelf .it.sold { opacity: .45; text-decoration: line-through; }
.ledger .shelf .it.changed { border-color: var(--accent); color: var(--accent); }
/* --- Ludivar's toll (10-16): the clock ran out ------------------------------ */
.coupon-card.toll { width: min(94vw, 380px); border-color: var(--gold); }
.coupon-card.toll .who { display: flex; gap: 10px; align-items: center; text-align: left; }
.coupon-card.toll .who :is(img, :where(ludi-face)).ludivar { width: 64px; height: 64px; flex: none; }
.coupon-card.toll .hd { color: var(--gold); }
.coupon-card.toll .nm { font-size: 1.15rem; }
.coupon-card.toll .toss { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 8px 0 4px; }
.coupon-card.toll .coin { width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--gold); background: #4a3a14; color: var(--gold); font-size: 1.6rem; font-weight: bold; display: flex; align-items: center; justify-content: center; animation: coin-spin 180ms linear infinite; }
.coupon-card.toll .coin.landed { animation: none; }
.coupon-card.toll .coin.up { border-color: var(--theirs); color: var(--theirs); } .coupon-card.toll .coin.down { border-color: var(--mine); color: var(--mine); }
@keyframes coin-spin { from { transform: scaleX(1); } 50% { transform: scaleX(.15); } to { transform: scaleX(1); } }
.coupon-card.toll .die { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin: 6px 0 2px; }
.coupon-card.toll .face { border: 2px solid var(--panel-edge); border-radius: 6px; padding: 2px 0; background: var(--panel-deep); display: flex; flex-direction: column; align-items: center; opacity: .75; }
.coupon-card.toll .face.on { border-color: var(--gold); opacity: 1; background: #3a3220; }
.coupon-card.toll .face.dead { border-color: var(--bad); background: #3a2222; }
.coupon-card.toll .face.dead::after { content: "✕"; color: var(--bad); font-weight: bold; line-height: .9; }
.coupon-card.toll .coinbox { perspective: 300px; width: 52px; height: 52px; }
.coupon-card.toll .coin3d { position: relative; width: 52px; height: 52px; transform-style: preserve-3d; }
.coupon-card.toll .coin3d .side { position: absolute; inset: 0; border-radius: 50%; border: 3px solid var(--gold); background: radial-gradient(circle at 35% 30%, #8a6a24, #4a3a14); color: var(--gold); font-size: 1.7rem; font-weight: bold; display: flex; align-items: center; justify-content: center; backface-visibility: hidden; }
.coupon-card.toll .coin3d .side.down { transform: rotateX(180deg); }
.coupon-card.toll .coin3d.isup .side.up { border-color: var(--theirs); color: var(--theirs); }
.coupon-card.toll .coin3d.isdown .side.down { border-color: var(--mine); color: var(--mine); }
.coupon-card.toll .dierow { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 6px 0 2px; }
.coupon-card.toll .dierow.hidden, .coupon-card.toll .die.hidden { visibility: hidden; }
.coupon-card.toll .bigdie { position: relative; width: 58px; height: 58px; border-radius: 10px; background: #f3ead2; border: 2px solid #2a1e10; display: flex; align-items: center; justify-content: center; box-shadow: 0 3px 0 #2a1e10; }
.coupon-card.toll .bigdie .pip { position: absolute; right: 3px; bottom: 1px; font-size: .7rem; font-weight: bold; color: #2a1e10; }
.coupon-card.toll .lone { display: flex; justify-content: center; margin: 8px 0; }
/* LUDIVAR'S LINE (user, 11-21): the card's small map of the board, the line
   he marked lit, a dot a piece; and the pieces on it, faded like the board's */
.coupon-card.toll .linemap { display: grid; gap: 2px; width: min(46vw, 150px); margin: 10px auto 6px; }
.coupon-card.toll .linemap i { aspect-ratio: 1; border-radius: 2px; background: var(--panel-deep); border: 1px solid var(--panel-edge); position: relative; }
.coupon-card.toll .linemap i.off { visibility: hidden; }
.coupon-card.toll .linemap i.lit { background: rgba(190,160,255,.16); border: 1px dashed var(--accent); }
.coupon-card.toll .linemap i.mine::after, .coupon-card.toll .linemap i.theirs::after { content: ""; position: absolute; inset: 22%; border-radius: 50%; background: var(--mine); }
.coupon-card.toll .linemap i.theirs::after { background: var(--theirs); }
.coupon-card.toll .linemap i.lit.mine::after, .coupon-card.toll .linemap i.lit.theirs::after { opacity: .55; }
.coupon-card.toll .die.fadeline { display: flex; flex-wrap: wrap; justify-content: center; }
.coupon-card.toll .face.fading { opacity: .6; padding: 2px 4px; border-style: dashed; }
.coupon-card.toll .verdict { font-weight: bold; margin-top: 6px; min-height: 1.2em; }
.panel.bets .bet { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--panel-edge); }
.panel.bets .bet .what { flex: 1; min-width: 0; }
.panel.bets .bet button { flex: none; width: auto; }
.panel.bets .row.end { display: flex; justify-content: flex-end; margin-top: 6px; }
.panel.bets .row.end button { width: auto; }
/* the deploy screen's THEM strip: their reserve, always in view (10-25) */
.deploy-them .res { display: inline-flex; align-items: center; gap: 2px; cursor: pointer; }
.deploy-them .res b { font-size: .8rem; color: var(--theirs); }

/* THE CUP'S TIERS (user, 10-25: "Normal vs elite vs boss distinction isn't
   felt"): grey for a club, silver-violet for a NAME, gold for a champion --
   on the badge, the road, the market's card, the battle's bar, the walk-out */
:root { --club: #9696a2; --named: #b9a6ff; --champion: #fac850; }
.tier-badge { display: inline-block; font-size: .68rem; font-weight: bold; letter-spacing: .06em; padding: 1px 6px; border-radius: 4px; border: 1px solid; margin: 0 6px; white-space: nowrap; }
.tier-badge.club { color: var(--club); border-color: #5a5a66; }
.tier-badge.named { color: var(--named); border-color: var(--named); background: rgba(185,166,255,.10); }
.coupon-cat { display: inline-flex; align-items: center; gap: 4px; font-size: .68rem; font-weight: bold; letter-spacing: .04em; text-transform: uppercase; color: var(--dim); padding: 1px 6px 1px 2px; border-radius: 4px; border: 1px solid var(--panel-edge); background: var(--panel-deep); white-space: nowrap; vertical-align: middle; }
.coupon-cat canvas { flex: none; }
.coupon-cat-line { margin: 2px 0 4px; }
.tier-badge.champion { color: #1a1a20; background: var(--champion); border-color: var(--champion); }
.road .fixture .who { flex: 1; }
.road .fixture.tier-named .who { color: var(--named); }
.road .fixture.tier-champion .who { color: var(--champion); font-weight: bold; }
.card.opp.tier-named { border-color: var(--named); box-shadow: 0 0 0 1px rgba(185,166,255,.35), 0 0 18px rgba(185,166,255,.15); }
.card.opp.tier-champion { border: 2px solid var(--champion); box-shadow: 0 0 22px rgba(250,200,80,.25); }
.card.opp .round-name { font-size: .72rem; font-weight: bold; letter-spacing: .08em; color: var(--dim); margin-bottom: 2px; }
.card.opp.tier-champion .round-name { color: var(--champion); }
.card.opp.tier-named .round-name { color: var(--named); }
.beaten { margin-top: 2px; }
.battle .topbar.tier-named .title { color: var(--named); }
.battle .topbar.tier-champion .title { color: var(--champion); }

/* the walk-out */
.walkout-scrim { background: rgba(0,0,0,.78); }
.walkout { background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 14px; padding: 18px 16px 12px; width: min(92vw, 380px); text-align: center; animation: wo-in .35s ease-out; }
.walkout .wo-round { font-family: Sans, system-ui, sans-serif; font-weight: bold; letter-spacing: .08em; color: var(--dim); }
.walkout .wo-vs { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 14px 0 10px; }
.walkout .wo-vs .you { color: var(--accent); font-weight: bold; }
.walkout .wo-vs .vs { color: var(--dim); font-size: .8rem; font-style: italic; }
.walkout .wo-vs .them { font-family: Sans, system-ui, sans-serif; font-size: 1.5rem; font-weight: bold; }
.walkout .tier-badge { font-size: .8rem; margin-bottom: 8px; }
.walkout .wo-line { margin: 6px 0; }
.walkout .wo-host { justify-content: center; margin-top: 10px; text-align: left; }
.walkout .ft { margin-top: 10px; }
.walkout.tier-named { border: 2px solid var(--named); box-shadow: 0 0 30px rgba(185,166,255,.25); }
.walkout.tier-named .wo-round, .walkout.tier-named .wo-vs .them { color: var(--named); }
.walkout.tier-champion { border: 3px solid var(--champion); box-shadow: 0 0 46px rgba(185,140,255,.35); }
.walkout.tier-champion .wo-round, .walkout.tier-champion .wo-vs .them { color: var(--champion); }
.walkout.tier-champion .wo-vs .them { font-size: 1.9rem; }
.walkout.final { background: linear-gradient(180deg, #3a3018 0%, var(--panel) 55%); }
@keyframes wo-in { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* the cup won */
.ceremony { text-align: center; margin: 8px 0 4px; }
.ceremony .trophy { font-size: 4rem; line-height: 1.1; animation: wo-in .5s ease-out; }
.ceremony .cup-name { font-family: Sans, system-ui, sans-serif; font-size: 1.3rem; font-weight: bold; color: var(--champion); text-transform: uppercase; letter-spacing: .06em; }
.promoted { text-align: center; margin: 10px 0; padding: 10px; border: 1px dashed var(--champion); border-radius: 10px; }
.promoted .next-div { font-family: Sans, system-ui, sans-serif; font-size: 1.4rem; font-weight: bold; color: var(--accent); }

/* --- THE PROLOGUE (webui/intro.js; user, 11-04): a game won at home, then
   Ludivar snatches you for his tournament -------------------------------- */
.intro { position: fixed; inset: 0; z-index: 60; background: radial-gradient(ellipse at 50% 40%, #2a2436 0%, #0d0b14 75%);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 16px;
  transition: opacity .5s ease; overflow: hidden; }
.intro.gone { opacity: 0; pointer-events: none; }
.intro-skip { position: absolute; top: 12px; right: 12px; opacity: .8; }
.intro-stage { display: flex; flex-direction: column; align-items: center; gap: 10px;
  transition: transform 1s cubic-bezier(.55,0,.75,.2), opacity 1s ease; }
.intro-title { font-family: Sans, system-ui, sans-serif; color: var(--gold); letter-spacing: .3em; font-size: .9rem; opacity: .8;
  transition: font-size .5s ease, opacity .5s ease; }
.intro-title.big { font-size: 1.6rem; opacity: 1; letter-spacing: .12em; text-align: center; position: absolute; top: 45%; left: 0; right: 0;
  text-shadow: 0 0 24px rgba(250,200,80,.6); animation: introPop .5s ease-out; }
.intro-board { border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,.6); transition: box-shadow .6s ease; }
.intro-stage.won .intro-board { box-shadow: 0 0 0 3px var(--accent), 0 0 46px rgba(250,200,80,.55); }
.intro-caption { min-height: 4.1em; /* three lines: a caption that grew moved the board mid-scene (11-13) */ max-width: 420px; text-align: center; color: var(--text); font-size: .95rem; }
.intro.flicker .intro-stage, .intro.flicker .intro-caption { animation: introFlicker .9s steps(1) forwards; }
@keyframes introFlicker { 0% { filter: brightness(1); } 15% { filter: brightness(.25); } 25% { filter: brightness(1); }
  40% { filter: brightness(.15); } 55% { filter: brightness(.9); } 70%, 100% { filter: brightness(.55); } }
.intro-host { position: absolute; top: 4vh; left: 50%; display: flex; flex-direction: column; align-items: center; gap: 8px;
  width: min(92vw, 380px); transform: translate(-50%, -140%) rotate(-12deg);
  transition: transform .9s cubic-bezier(.2,1.5,.4,1); z-index: 2; }
.intro-host.in { transform: translate(-50%, 0) rotate(0deg); }
.intro-host.away { transition: transform .9s cubic-bezier(.6,-0.4,.8,.4); transform: translate(-50%, -160%) scale(.8) rotate(10deg); }
.intro-ludivar { width: 132px; height: 132px; filter: drop-shadow(0 0 22px rgba(138,43,226,.65)); }
.intro-bubble { background: #2e2a3c; border: 1px solid #5a4e7a; border-radius: 12px; padding: 10px 14px; text-align: center;
  font-size: 1rem; min-height: 1.4em; box-shadow: 0 6px 20px rgba(0,0,0,.5); }
.intro-bubble:empty { visibility: hidden; }
.intro-bubble.pop { animation: introPop .35s ease-out; }
.intro-bubble.gone { opacity: 0; transition: opacity .3s; }
@keyframes introPop { 0% { transform: scale(.85); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.intro.flicker .intro-stage.struggle { animation: introStruggle .32s ease-in-out infinite; filter: brightness(.55); }
@keyframes introStruggle { 0%, 100% { transform: translate(0, 0) rotate(0); }
  25% { transform: translate(-7px, -5px) rotate(-1.5deg); } 75% { transform: translate(7px, -9px) rotate(1.5deg); } }
.intro-bolt { position: fixed; z-index: 4; height: 5px; margin-top: -2px; transform-origin: 0 50%; pointer-events: none;
  border-radius: 3px; background: linear-gradient(90deg, #b47cff, #fff 60%, #e9d8ff);
  box-shadow: 0 0 12px #c79bff, 0 0 26px rgba(138,43,226,.8); opacity: 0; }
/* Ludivar destroys the champion's last pieces (webui/intro.js smite; user, 11-06) */
.intro-mark { position: fixed; z-index: 4; pointer-events: none; border-radius: 50%; transform: translate(-50%,-50%);
  border: 3px dashed #d9b8ff; box-shadow: 0 0 18px #b47cff, inset 0 0 14px rgba(180,124,255,.6); opacity: 0; }
.intro-lightning { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 5; pointer-events: none; overflow: visible; }
.intro-lightning polyline { fill: none; stroke-linejoin: round; stroke-linecap: round; }
.intro-lightning .glow { stroke: #b47cff; stroke-width: 14; opacity: .6; filter: blur(4px); }
.intro-lightning .core { stroke: #fff; stroke-width: 4.5; }
.intro-flash { position: fixed; z-index: 4; pointer-events: none; border-radius: 50%; transform: translate(-50%,-50%);
  background: radial-gradient(circle, #fff 0%, rgba(233,216,255,.9) 30%, rgba(180,124,255,0) 70%); }
.intro-shard { position: fixed; z-index: 4; pointer-events: none; filter: brightness(1.6) drop-shadow(0 0 6px #e9d8ff); }
.intro-spark { position: fixed; z-index: 4; pointer-events: none; width: 6px; height: 6px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 8px #e9d8ff, 0 0 16px #b47cff; }
.intro-smoke { position: fixed; z-index: 3; pointer-events: none; border-radius: 50%;
  background: radial-gradient(circle, rgba(70,60,90,.55) 0%, rgba(70,60,90,0) 70%); filter: blur(4px); }
/* the hands in a shogi prologue: his above the board, yours below */
.intro-hand { display: flex; flex-wrap: nowrap; justify-content: center; gap: 6px; min-height: 22px; margin: 4px 0; overflow: hidden; max-width: 100%; }
/* the count stands BESIDE its piece (user, 11-13: "Fix everything in the report" -- "×13" was printed over the icons) */
.intro-held { position: relative; display: inline-flex; align-items: center; gap: 1px; flex: none; }
.intro-held b { font-size: 12px; color: var(--text, #eee); text-shadow: 0 0 3px #000; }
.intro-plucked { position: fixed; z-index: 3; pointer-events: none; filter: drop-shadow(0 6px 10px rgba(0,0,0,.6)); }
@media (prefers-reduced-motion: reduce) {
  .intro-stage, .intro-host, .intro-host.away { transition-duration: .01s; }
  .intro.flicker .intro-stage, .intro.flicker .intro-caption { animation: none; }
  .intro.flicker .intro-stage.struggle { animation: none; }
}
.intro.flicker .intro-title:not(.big) { opacity: 0; }   /* his bubble takes its place */

/* a piece whose move depends on its square's colour: the Fanorona Stone (user, 11-05) */
.by-square { display: flex; gap: 12px; justify-content: center; margin: 4px 0 6px; }
.by-square-col { flex: 1; min-width: 0; border: 2px solid #4a4458; border-radius: 10px; padding: 6px; text-align: center; background: #26232f; }
.by-square-col.here { border-color: var(--accent); box-shadow: 0 0 14px rgba(185,140,255,.35); }
.by-square-ttl { font-weight: 700; font-size: .78rem; letter-spacing: .04em; color: var(--accent); display: flex; align-items: center; justify-content: center; gap: 6px; margin-bottom: 4px; }
.by-square-txt { font-size: .8rem; margin-top: 4px; font-weight: 600; }
.by-square-now { font-size: .72rem; color: var(--accent); margin-top: 2px; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 2px; border: 1px solid #000; }
.swatch.light { background: var(--light-sq); }
.swatch.dark { background: var(--dark-sq); }
.by-square-col canvas { max-width: 100%; height: auto !important; }

/* a piece card's category tags (user, 11-08): the coupon chips, wrapped */
.piece-cats { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }

/* --- the realm behind every screen (user, 11-08) ----------------------------
   A board left out under the night sky: a checkered floor running off to the
   horizon, stars above it. Faint on purpose: the panels and the board are
   the game; this is only where it is played. */
html { background: var(--bg); }
/* THE PAGE IS AS TALL AS WHAT YOU SEE (user, 11-14, a phone's market: "Can't
   see the top..."). 100vh on a phone is the screen with the address bar
   HIDDEN; with it showing, the body was that much taller than the window, so
   the page scrolled by the bar's height -- the top row cut off above, an
   empty band under Fight!. 100dvh is the window as it is now. */
body { background: transparent; min-height: 100vh; min-height: 100dvh; }
body::before, body::after { content: ""; position: fixed; left: 0; right: 0; z-index: -1; pointer-events: none; }
body::before { top: 0; height: 100%;
  background:
    radial-gradient(1px 1px at 12% 18%, #e9dcff 50%, transparent 51%),
    radial-gradient(1px 1px at 33% 8%, #fff4d6 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 58% 22%, #e9dcff 50%, transparent 51%),
    radial-gradient(1px 1px at 76% 12%, #fff4d6 50%, transparent 51%),
    radial-gradient(1px 1px at 91% 30%, #e9dcff 50%, transparent 51%),
    radial-gradient(1px 1px at 22% 38%, #fff4d6 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 84% 44%, #e9dcff 50%, transparent 51%),
    radial-gradient(1px 1px at 47% 41%, #fff4d6 50%, transparent 51%),
    radial-gradient(ellipse at 50% 0%, #2a1a52 0%, var(--bg) 60%);
  opacity: .85; }
body::after { bottom: 0; height: 46%; perspective: 340px; perspective-origin: 50% 0%;
  background: repeating-conic-gradient(var(--floor-a) 0 25%, var(--floor-b) 0 50%) 50% 0 / 44px 44px;
  transform-origin: 50% 0%; transform: perspective(340px) rotateX(58deg) scale(2.2, 1);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 55%);
          mask-image: linear-gradient(to bottom, transparent 0%, #000 55%); opacity: .9; }

/* HIS STAR (his left eye is a star in every mood): always up there, quiet.
   It glows when you win, dims when you lose, and twinkles when a coupon --
   one of his rules -- goes off. Never in the way, never a word. */
#lstar { position: fixed; top: calc(3px + env(safe-area-inset-top)); left: 50%; width: 16px; height: 16px; margin-left: -8px;
  z-index: -1; pointer-events: none; opacity: .55;
  filter: drop-shadow(0 0 4px rgba(251,211,104,.55)); transition: opacity 1.2s, filter 1.2s, transform 1.2s;
  animation: lstar-breathe 7s ease-in-out infinite; }
#lstar svg { width: 100%; height: 100%; display: block; }
#lstar.twinkle { animation: lstar-twinkle 900ms ease-out 1; }
#lstar.flare { opacity: 1; transform: scale(1.7) rotate(45deg);
  filter: drop-shadow(0 0 10px rgba(251,211,104,.95)) drop-shadow(0 0 24px rgba(185,140,255,.7)); animation: none; }
#lstar.dim { opacity: .18; transform: scale(.8); filter: none; animation: none; }
@keyframes lstar-breathe { 0%, 100% { opacity: .45; } 50% { opacity: .7; } }
@keyframes lstar-twinkle { 0% { opacity: .55; transform: scale(1) rotate(0); }
  35% { opacity: 1; transform: scale(1.5) rotate(30deg); filter: drop-shadow(0 0 9px rgba(251,211,104,.95)); }
  100% { opacity: .55; transform: scale(1) rotate(90deg); } }
@media (prefers-reduced-motion: reduce) { #lstar, #lstar.twinkle { animation: none; } }


/* =====================================================================
   THE MATERIAL (user, 11-08): every panel is an OBJECT on his table -- a
   lit top edge, a shadow under it, a little depth -- so the eye knows what
   can be picked up. Saturated colour is spent only on information: gold =
   money and prizes, green/red = good/bad for you, blue/red = yours/theirs.
   ===================================================================== */
:root { --edge-hi: rgba(255,255,255,.07); --edge-lo: rgba(0,0,0,.45); --lift: 0 6px 18px rgba(8,4,20,.45), 0 1px 0 var(--edge-hi) inset;
  --press: 0 2px 6px rgba(8,4,20,.5), 0 1px 0 var(--edge-hi) inset; }
.panel, .card, .sheet, .lot, .start, .tile, .points, .msg, .readout, .callout, .picked-bar, .ledger, .chart, .walkout, .ask .card, .coupon-card, .ludivar .bubble {
  background-image: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,0) 40%); box-shadow: var(--lift); }
.panel, .card { border-radius: 14px; padding: 12px 14px; }
.lot, .start, .tile { transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
.lot:hover, .start:hover, .tile.clickable:hover, .tile.shelf:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(8,4,20,.55), 0 1px 0 var(--edge-hi) inset; }
.lot:active, .start:active, .tile:active { transform: translateY(1px) scale(.99); box-shadow: var(--press); }
button { background-image: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,0)); box-shadow: 0 3px 0 rgba(0,0,0,.45), 0 1px 0 var(--edge-hi) inset;
  transition: transform .08s ease, box-shadow .08s ease, filter .12s ease; letter-spacing: .01em; }
button:hover:not(:disabled) { filter: brightness(1.08); }
button:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.45), 0 1px 0 var(--edge-hi) inset; }
button.primary { background-image: linear-gradient(180deg, #d2b3ff, #b98cff 55%, #a676f4); border-color: #7a52c8; box-shadow: 0 3px 0 #5f3ea8, 0 1px 0 rgba(255,255,255,.35) inset; text-shadow: 0 1px 0 rgba(255,255,255,.25); }
button.primary:active:not(:disabled) { box-shadow: 0 1px 0 #5f3ea8, 0 1px 0 rgba(255,255,255,.35) inset; }
button.danger { background-image: none; background: #3b1d33; color: #f0b8c0; }
.tabs button { box-shadow: none; background: var(--panel-deep); border-color: transparent; color: var(--dim); font-weight: 700; }
.tabs button.on { background: var(--panel-light); color: var(--text); border-color: var(--panel-edge); box-shadow: 0 1px 0 var(--edge-hi) inset; }
.tabs { background: var(--panel-deep); padding: 4px; border-radius: 12px; gap: 4px; border: 1px solid var(--panel-edge); }
/* section labels: small, spaced, quiet -- the content is the loud part */
.head.small, .sheet .side, .points .label, .card.opp .round-name, .walkout .wo-round, .tier-badge, .coupon-cat, .intro-title {
  font-family: Sans, sans-serif; text-transform: uppercase; letter-spacing: .12em; font-size: .7rem; font-weight: 800; }
.sheet .side { color: var(--dim); margin: 10px 0 4px; }
.sheet .side.them { color: var(--theirs); } .sheet .side.you { color: var(--mine); }
h2, .head:not(.small), .readout .t, .walkout .wo-vs .them, .coupon-card .nm, .points .big, .result .big, .ceremony .cup-name, .promoted .next-div, .topbar .title, .runbar .div, .strip .who, .lot b, .start .head {
  font-family: Sans, system-ui, sans-serif; font-variation-settings: "opsz" 48, "SOFT" 30, "WONK" 1; }
.head.small { font-family: Sans, sans-serif; }
.strip .who { font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; font-family: Sans, sans-serif; font-weight: 800; }
.topbar .title { font-size: 1.1rem; line-height: 1.15; }
/* gold is a COIN: every amount of gold reads as one */
.gold, .price, .tile .cost, .runbar .gold { font-family: Sans, system-ui, sans-serif; font-variation-settings: "opsz" 24, "SOFT" 60; font-weight: 800; }
.gold::before { content: ""; display: inline-block; width: .85em; height: .85em; border-radius: 50%; margin: 0 .3em -.08em 0;
  background: radial-gradient(circle at 35% 30%, #fff1b3, var(--gold) 45%, #b4852a 100%); box-shadow: 0 0 0 1px #6a4d14, 0 0 6px rgba(242,199,92,.5); }
/* LUDIVAR speaks in a real speech bubble, from his portrait */
.ludivar { align-items: center; margin: 8px 0; }
.ludivar :is(img, :where(ludi-face)) { width: 64px; height: 64px; border-radius: 50%; background: radial-gradient(circle, rgba(138,43,226,.35), transparent 70%); filter: drop-shadow(0 0 10px rgba(185,140,255,.45)); }
.ludivar .bubble { position: relative; background: #2b2247; border: 1px solid #5f4e8e; border-radius: 14px; padding: 10px 14px; font-size: .95rem; line-height: 1.35; flex: 1; }
.ludivar .bubble::before { content: ""; position: absolute; left: -9px; top: 22px; border: 8px solid transparent; border-right-color: #5f4e8e; border-left: 0; }
.ludivar .bubble::after { content: ""; position: absolute; left: -7px; top: 23px; border: 7px solid transparent; border-right-color: #2b2247; border-left: 0; }
/* the market's cards: a shelf of goods, each with its KIND's colour on top */
.tile.shelf { width: 80px; height: 104px; border-radius: 12px; padding-top: 6px; overflow: hidden; }
.tile.shelf::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--band, var(--panel-edge)); }
.tile.shelf .tiny { font-size: .68rem; font-weight: 700; line-height: 1.1; max-height: 2.2em; }
.tile.shelf .price { font-size: .9rem; }
.tile.shelf.cant { opacity: .7; } .tile.shelf.off { opacity: .35; }
.tile.shelf.rarity-uncommon { border-color: #4f8a5a; } .tile.shelf.rarity-rare { border-color: var(--accent); } .tile.shelf.rarity-boss { border-color: var(--gold); box-shadow: 0 0 14px rgba(242,199,92,.25), var(--lift); }
/* the coupon's family colour (the categories of run/coupon_categories.py) */
:root { --fam-chess: #e9d9a6; --fam-xiangqi: #e2553f; --fam-shogi: #d9a066; --fam-checkers: #c23b3b; --fam-neutral: #b98cff; --fam-boss: #f2c75c; }
.menu h1 { font-size: 2.4rem; margin-top: 6px; }
.menu .motto { text-align: center; font-family: Sans, system-ui, sans-serif; font-style: italic; color: var(--dim); margin: -2px 0 10px; font-size: 1rem; }
.menu .factions button { padding: 14px 10px; font-family: Sans, system-ui, sans-serif; font-size: 1rem; letter-spacing: .04em; }
.menu .start { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0; padding: 10px 12px; }
.menu .start .head { font-size: 1rem; }
.over h1 { font-size: 2.6rem; }
.over .ludivar :is(img, :where(ludi-face)) { width: 96px; height: 96px; }
.over .ludivar .bubble { font-size: 1.1rem; font-family: Sans, system-ui, sans-serif; font-variation-settings: "opsz" 24, "SOFT" 40; }
.over .ludivar .bubble::before { top: 36px; } .over .ludivar .bubble::after { top: 37px; }
.over .cause { text-align: center; color: var(--dim); margin: 0 0 8px; }
/* the battle's readout and hint: one voice each, no box inside a box */
.readout { border-left-width: 5px; border-radius: 10px; padding: 10px 12px; }
.callout { min-height: 40px; background: transparent; border-color: transparent; box-shadow: none; padding: 4px 6px; color: var(--dim); }
.callout.good, .callout.bad, .callout.info { background: var(--callout-bg); border-color: var(--panel-edge); box-shadow: var(--lift); }
.callout:empty { display: none; }
.points { border-radius: 12px; }
.topbar .title { display: flex; flex-direction: column; min-width: 0; }
.topbar .title .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .title .sub { font-family: Sans, sans-serif; font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.scoreboard { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0; }
.scoreboard .stat { background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 12px; padding: 10px 6px; text-align: center; box-shadow: var(--lift); }
.scoreboard .stat .n { font-family: Sans, system-ui, sans-serif; font-size: 1.6rem; font-weight: 800; line-height: 1; font-variation-settings: "opsz" 48, "SOFT" 40; }
.scoreboard .stat .l { font-size: .66rem; text-transform: uppercase; letter-spacing: .1em; color: var(--dim); margin-top: 4px; font-weight: 800; }
.scoreboard .stat.score .n { color: var(--gold); }
@media (max-width: 380px) { .scoreboard { grid-template-columns: repeat(2, 1fr); } }
.menu .start .head.small { font-family: Sans, system-ui, sans-serif; text-transform: none; letter-spacing: 0; font-size: 1.05rem; font-weight: 700; font-variation-settings: "opsz" 24, "SOFT" 40, "WONK" 1; }
.menu .start .tiles { flex-wrap: nowrap; gap: 2px; }
.menu .start .tiles canvas { width: 30px; height: 30px; }
.menu .factions button.on { background: linear-gradient(180deg, #3a2d62, #2c2349); }
.menu .dossier { padding: 12px 14px; }
.tabs .badge:empty { display: none; }
.tabs button { white-space: nowrap; padding: 8px 2px; }
/* a phone with no coupons on either side: no columns, the board takes the width */
.fieldrow .rails.empty { display: none; }
.market-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.market-cols .mcol.right { position: sticky; top: 8px; }
.market-cols .sheet.tall { max-height: 52vh; overflow-y: auto; }
/* a desktop battle: the board earns the width, the dock keeps what it needs */
.battle.wide { grid-template-columns: minmax(0, 60%) minmax(300px, 1fr); gap: 20px; }

/* --- MOTION (user, 11-08): the board takes a blow, the end stamps itself --- */
.fieldrow .boardslot { position: relative; }
/* an error line spans both columns: as the grid's first cell it took the board's and pushed the board off the side */
.battle.wide > #error, .battle.wide > .err { grid-column: 1 / -1; }
/* a board the window's height made narrower than its column sits in the middle of it, under the plates (11-10) */
.fieldrow .boardslot > #board { margin-left: auto; margin-right: auto; }
#board.jolt { animation: jolt .22s ease-out; }
#board.jolt-hard { animation: jolt-hard .42s ease-out; }
@keyframes jolt { 0% { transform: translate(0,0); } 30% { transform: translate(2px,-2px) rotate(.25deg); } 60% { transform: translate(-2px,1px) rotate(-.2deg); } 100% { transform: translate(0,0); } }
@keyframes jolt-hard { 0% { transform: translate(0,0); } 20% { transform: translate(4px,-3px) rotate(.5deg); } 40% { transform: translate(-4px,3px) rotate(-.5deg); } 60% { transform: translate(3px,1px); } 80% { transform: translate(-2px,-1px); } 100% { transform: translate(0,0); } }
.stamp { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; z-index: 6;
  text-align: center; animation: stamp-in .38s cubic-bezier(.2,1.6,.4,1); transition: opacity .7s ease; }
.stamp .word { font-family: Sans, system-ui, sans-serif; font-weight: 900; font-size: clamp(2.2rem, 12vw, 4.4rem); letter-spacing: .06em; line-height: 1;
  color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.6), 0 0 28px rgba(0,0,0,.8); transform: rotate(-6deg); padding: 6px 18px; border: 4px solid #fff; border-radius: 10px; background: rgba(20,10,40,.55); }
.stamp.won .word { color: #ffe9a8; border-color: #ffe9a8; text-shadow: 0 2px 0 rgba(90,60,0,.7), 0 0 30px rgba(242,199,92,.9); }
.stamp.lost .word { color: #ff9c9c; border-color: #ff9c9c; text-shadow: 0 2px 0 rgba(60,0,0,.7), 0 0 30px rgba(230,90,90,.9); }
.stamp .why { margin-top: 10px; font-weight: 800; color: #fff; text-shadow: 0 1px 2px #000, 0 0 10px #000; font-size: .95rem; max-width: 80%; }
.stamp.fade { opacity: 0; }
@keyframes stamp-in { 0% { transform: scale(2.4); opacity: 0; } 60% { opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
/* every screen arrives, it does not just appear */
#app > .menu, #app > .bracket, #app > .arena, #app > .reward, #app > .over { animation: screen-in .32s ease-out; }
@keyframes screen-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { #board.jolt, #board.jolt-hard, .stamp, #app > * { animation: none !important; } }
/* the speaker (webui/sound.js): always there, never in the way */
#sfx { position: fixed; bottom: calc(8px + env(safe-area-inset-bottom)); left: 8px; z-index: 40; width: 30px; height: 30px; padding: 0; border-radius: 50%;
  font-size: 14px; line-height: 1; background: rgba(32,25,54,.8); border: 1px solid var(--panel-edge); box-shadow: none; opacity: .7; }
#sfx { color: var(--text); display: flex; align-items: center; justify-content: center; }
#sfx .x { display: none; } #sfx.off .x { display: block; } #sfx.off .w { display: none; }
#sfx.off { opacity: .45; }
/* the speaker's outer wave: the score is on; one wave is sound only (11-11) */
#sfx .m { display: none; } #sfx.tune .m { display: block; }
#sfx:hover { opacity: 1; }
.intro #sfx { display: none; }
/* the market on a phone: slim points, a fight bar that stays put */
.points.slim { padding: 6px 12px; margin: 6px 0 2px; }
.points.slim .row { align-items: baseline; gap: 8px; flex-wrap: nowrap; }
.points.slim .big { font-size: 1.4rem; }
.points.slim .bar { margin: 4px 0 0; height: 7px; }
.points.slim .carry { margin-left: auto; }
/* buying points, beside the cap it raises (user, 11-29) */
.points .buy-dp { padding: 2px 8px; font-size: 0.8rem; white-space: nowrap; display: inline-flex; gap: 6px; align-items: baseline; }
.points .buy-dp .price { color: var(--gold, #f2c75c); font-weight: bold; }
.points .buy-dp.cant { opacity: 0.55; }
/* a phone's points box is a narrow column: the pill takes its own line
   under the number, inside the box */
@media (max-width: 700px) {
  .points.slim .row { flex-wrap: wrap; }
  .points .buy-dp { order: 9; flex-basis: 100%; justify-content: center; margin-top: 4px; }
}
.market-actions { position: sticky; bottom: 0; z-index: 5; margin: 10px -10px 0; padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(20,15,38,0), rgba(20,15,38,.92) 30%); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.market-actions .fight { padding: 12px 26px; font-size: 1.1rem; font-family: Sans, system-ui, sans-serif; letter-spacing: .04em; box-shadow: 0 3px 0 #5f3ea8, 0 0 22px rgba(185,140,255,.45), 0 1px 0 rgba(255,255,255,.35) inset; }
.market-cols .market-actions { position: static; margin: 10px 0 0; padding: 0; background: none; backdrop-filter: none; }
.road .fixture.ahead { opacity: .7; font-style: italic; }
.bracket h1 { font-size: 2.2rem; }
/* the logotype */
.menu .logo { display: flex; flex-direction: column; align-items: center; margin: 4px 0 2px; }
.menu .logo .crown { line-height: 0; margin-bottom: -6px; filter: drop-shadow(0 0 10px rgba(242,199,92,.5)); animation: crown-bob 5s ease-in-out infinite; }
.menu .logo h1 { font-size: clamp(2.4rem, 11vw, 3.4rem); font-weight: 900; letter-spacing: .04em; margin: 0;
  background: linear-gradient(180deg, #e6d1ff 0%, #b98cff 55%, #f2c75c 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: none; filter: drop-shadow(0 2px 0 rgba(40,20,80,.9)) drop-shadow(0 0 18px rgba(185,140,255,.35)); }
@keyframes crown-bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-3px) rotate(2deg); } }

/* =====================================================================
   V3 -- A TABLE OF REAL THINGS (user, 11-08: "It's still bad"). Panels are
   lacquered inlays: a dark outline, a hard edge under them, a gloss on top,
   a fill that stands off the night. Fewer boxes, bolder ones.
   ===================================================================== */
:root { --bg: #100a1e; --panel: #271c4a; --panel-light: #33265e; --panel-deep: #1b1336; --panel-edge: #0c0718;
  --text: #f5eedc; --dim: #b2a6cf; --floor-a: #170f30; --floor-b: #1f1540;
  --lift: 0 3px 0 #0c0718, 0 8px 18px rgba(0,0,0,.5), 0 1px 0 rgba(255,255,255,.12) inset;
  --press: 0 1px 0 #0c0718, 0 2px 6px rgba(0,0,0,.5), 0 1px 0 rgba(255,255,255,.12) inset; }
.panel, .card, .lot, .start, .tile, .points, .msg, .readout, .picked-bar, .ledger, .chart, .walkout, .ask .card, .coupon-card, .ludivar .bubble, .sheet, .callout.good, .callout.bad, .callout.info {
  border: 2px solid var(--panel-edge); border-radius: 12px;
  background-image: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,0) 35%); }
.tabs { border: 2px solid var(--panel-edge); box-shadow: 0 3px 0 #0c0718; }
button { border: 2px solid #0c0718; border-radius: 10px; box-shadow: 0 3px 0 #0c0718, 0 1px 0 rgba(255,255,255,.14) inset; }
button:active:not(:disabled) { box-shadow: 0 0 0 #0c0718, 0 1px 0 rgba(255,255,255,.14) inset; transform: translateY(3px); }
button.primary { border-color: #0c0718; box-shadow: 0 3px 0 #0c0718, 0 0 18px rgba(185,140,255,.35), 0 1px 0 rgba(255,255,255,.4) inset; }
button.danger { border-color: #0c0718; }
.ludivar .bubble::before { border-right-color: #0c0718; }
.ludivar .bubble { font-size: 1rem; }
.strip .who { font-size: .8rem; }
.rail { border: 2px solid var(--panel-edge); }
.rail.mine { border-color: var(--mine); } .rail.theirs { border-color: var(--theirs); }
/* the board owns the width of a phone */
@media (max-width: 599px) {
  .battle .fieldrow, .arena .fieldrow { margin-left: -10px; margin-right: -10px; }
  .battle .fieldrow .rails, .arena .fieldrow .rails { margin-right: 6px; }
  #board, #deploy { border-radius: 0; }
}
.card.opp .rule-line { color: var(--text); }
/* a named opponent: one line, three chips, the demo; the note behind a tap (11-11) */
.card.opp .opp-tell { color: var(--text); margin: 2px 0 6px; }
.card.opp .opp-chips { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-bottom: 8px; }
.card.opp .opp-chips:empty { display: none; }
.card.opp .opp-chips .chip { color: var(--named); border-color: rgba(185,166,255,.4); }
.card.opp .opp-note { margin-top: 8px; }
.card.opp .opp-note summary { color: var(--dim); font-size: var(--fs-s); cursor: pointer; padding: 6px 0; }
.card.opp .opp-note > div { overflow-wrap: anywhere; color: var(--dim); }
.card.opp .opp-rule { padding: 3px 0; }
.card.opp .opp-rule b { color: var(--text); font-weight: 600; }
.card.opp .rule-line::before { content: "— "; color: var(--dim); }
.points.slim .bodies { margin-left: auto; }
.points.slim .carry { margin-left: 8px; }

/* =====================================================================
   V4 -- AROUND THE BOARD (user, 11-08: "Everything around the board is
   bad"): two nameplates, a toolbar, drawers that open on demand. Nothing
   sits on screen saying a sentence the board already shows.
   ===================================================================== */
.topbar { padding: 0 2px 4px; align-items: center; }
.topbar .title { display: block; }
.topbar .title .sub { display: block; text-align: left; }
.plate { display: flex; align-items: center; gap: 10px; padding: 6px 10px; margin: 4px 0; border-radius: 12px;
  background: var(--panel); border: 2px solid var(--panel-edge); box-shadow: var(--lift); position: relative; }
.plate .emblem { position: relative; width: 44px; height: 44px; flex: none; display: flex; align-items: center; justify-content: center; }
.plate .emblem canvas { width: 40px; height: 40px; display: block; }
.plate .emblem .count { position: absolute; right: -4px; bottom: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
  font-size: .68rem; font-weight: 800; display: flex; align-items: center; justify-content: center; color: #fff; background: #3a2f63; border: 2px solid var(--panel-edge); font-family: Sans, sans-serif; }
.plate.them .emblem .count { background: #7a2a36; } .plate.you .emblem .count { background: #27507a; }
.plate .pl-body { min-width: 0; flex: 1; }
.plate .pl-name { font-family: Sans, system-ui, sans-serif; font-weight: 800; font-size: 1.1rem; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variation-settings: "opsz" 36, "SOFT" 30, "WONK" 1; }
.plate.them .pl-name { color: #ffb3b3; } .plate.you .pl-name { color: #a9cfff; }
.plate .pl-sub { font-size: .72rem; color: var(--dim); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; min-height: 1em; }
.plate .fallen { display: flex; gap: 2px; flex-wrap: wrap; justify-content: flex-end; max-width: 46%; }
.plate .fallen .lost { position: relative; opacity: .55; filter: grayscale(.6); }
.plate .fallen .lost canvas { width: 22px; height: 22px; display: block; }
.plate .fallen .lost i { position: absolute; right: -3px; bottom: -3px; font-style: normal; font-size: .6rem; font-weight: 800; color: var(--text); text-shadow: 0 0 3px #000; }
.plate .pace { flex-basis: 100%; display: flex; gap: 6px; flex-wrap: wrap; }
/* whose turn: the plate lights in its side's colour */
.plate.turn { border-color: var(--panel-edge); box-shadow: var(--lift), 0 0 0 2px rgba(255,255,255,.08); }
.plate.you.turn { box-shadow: 0 3px 0 #0c0718, 0 0 0 2px var(--mine), 0 0 22px rgba(108,176,246,.45); }
.plate.them.turn { box-shadow: 0 3px 0 #0c0718, 0 0 0 2px var(--theirs), 0 0 22px rgba(226,96,96,.4); }
.plate.them.turn .pl-sub { color: #ffb3b3; } .plate.you.turn .pl-sub { color: #a9cfff; }
.plate.turn .pl-sub { animation: chip-beat 1.1s infinite alternate; }
/* the toolbar: drawers left, deeds right */
.toolbar { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.toolbar .tabs.drawers { margin: 0; flex: 1; padding: 3px; gap: 2px; }
.toolbar .tabs.drawers button { padding: 7px 2px; font-size: .78rem; }
.toolbar .buttons.deeds { margin: 0; gap: 6px; flex: none; }
.toolbar .buttons.deeds button { padding: 8px 10px; font-size: .85rem; }
.toolbar .buttons.deeds button.primary { padding: 10px 18px; font-size: 1rem; }
.sheet { margin-top: 8px; }
/* the readout, when it has something to say, is a ribbon under the board */
.readout { margin-top: 6px; padding: 8px 12px; }
.readout .t { font-size: .95rem; }
@media (max-width: 599px) {
  .toolbar { flex-wrap: wrap; }
  .toolbar .tabs.drawers { flex-basis: 100%; }
  .toolbar .buttons.deeds { margin-left: auto; }
}
.plate { flex-wrap: wrap; }
.plate .pace:empty { display: none; }
.toolbar { flex-wrap: wrap; }
.toolbar .sheet { flex-basis: 100%; order: 3; margin-top: 2px; }
.toolbar .buttons.deeds { order: 2; }
@media (max-width: 599px) { .toolbar .buttons.deeds { margin-left: auto; } }

/* --- V5: LUDIVAR IS THE CLOCK; THE KIT ON THE PLATES ------------------------ */
.lclock { position: relative; width: 48px; height: 48px; display: block; padding: 0; border: 0; }
.lclock :is(img, :where(ludi-face)) { position: absolute; inset: 5px; width: 38px; height: 38px; border-radius: 50%; }
.lclock .ring { position: absolute; inset: 0; width: 48px; height: 48px; }
.lclock .ring .left { stroke: var(--good); transition: stroke-dasharray .6s ease, stroke .6s ease; }
.lclock.mid .ring .left { stroke: var(--gold); } .lclock.low .ring .left { stroke: var(--warn); }
.lclock.critical .ring .left { stroke: var(--bad); } .lclock.critical :is(img, :where(ludi-face)) { animation: chip-beat .7s infinite alternate; }
.lclock.still .ring .left { stroke: #5a5470; }
.lclock .n { position: absolute; right: -6px; bottom: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; font-size: .72rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center; color: #fff; background: #3a2f63; border: 2px solid var(--panel-edge); font-family: Sans, system-ui, sans-serif; }
.lclock.critical .n { background: #7a2a36; } .lclock.low .n { background: #7a4a1a; }
.topbar { align-items: center; padding-right: 4px; }
.pl-kit { flex-basis: 100%; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding-top: 6px; margin-top: 4px; border-top: 1px solid rgba(255,255,255,.07); }
.chip-c { width: 34px; height: 34px; border-radius: 50%; position: relative; cursor: pointer; flex: none;
  box-shadow: 0 2px 0 #0c0718, 0 0 0 2px var(--panel-edge); transition: transform .12s; }
/* THE TICKET FILLS ITS CIRCLE, whatever size the circle is: couponIcon sets
   the canvas's own width in its style (34px), which beat the plain 100% here,
   so a phone's 24px chip wore a 34px picture hanging out of its ring
   (report 20261122-171550-e0f814: "Coupons images don't fit the circle") */
.chip-c canvas { width: 100% !important; height: 100% !important; display: block; border-radius: 50%; }
.chip-c:hover { transform: translateY(-2px) scale(1.06); }
/* a coupon that COUNTS says how far it is, on its own chip: Many Talents 5/8, Blood Oath 2/3 (11-11, the panel) */
.chip-c .cnt, .rail .slot .cnt { position: absolute; right: -4px; bottom: -4px; padding: 0 3px; border-radius: 6px; background: #0c0718; color: #fff;
  font-size: 9px; line-height: 13px; font-weight: 700; pointer-events: none; box-shadow: 0 0 0 1px var(--panel-edge); }
.chip-c.uncommon { box-shadow: 0 2px 0 #0c0718, 0 0 0 2px var(--good); } .chip-c.rare { box-shadow: 0 2px 0 #0c0718, 0 0 0 2px var(--accent); }
.chip-c.boss { box-shadow: 0 2px 0 #0c0718, 0 0 0 2px var(--gold), 0 0 10px rgba(242,199,92,.5); }
.chip-c.fired { animation: chip-pop .9s ease-out 1, slot-glow 1.2s infinite alternate; }
@keyframes chip-pop { 0% { transform: scale(1); } 30% { transform: scale(1.5) rotate(-8deg); } 60% { transform: scale(.95); } 100% { transform: scale(1); } }
.stack-group { display: flex; align-items: center; gap: 4px; padding: 2px 6px 2px 4px; border-radius: 10px; background: rgba(0,0,0,.22); border: 1px solid rgba(255,255,255,.06); }
.stack-group .lbl { font-style: normal; font-size: .58rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); writing-mode: vertical-rl; transform: rotate(180deg); line-height: 1; }
.stack { position: relative; width: 30px; height: 30px; flex: none; border-radius: 50%; }
.stack canvas { width: 30px; height: 30px; display: block; }
.stack b { position: absolute; right: -5px; bottom: -4px; font-size: .62rem; font-weight: 800; color: #fff; background: #3a2f63; border: 1px solid var(--panel-edge); border-radius: 8px; padding: 0 4px; line-height: 1.2; }
.stack.can { cursor: pointer; box-shadow: 0 0 0 2px var(--spawn), 0 0 10px rgba(110,170,250,.5); }
.stack.can:hover { transform: translateY(-2px); }
.stack.on { box-shadow: 0 0 0 3px var(--select), 0 0 14px rgba(250,220,90,.7); }
.stack.off { opacity: .55; }

/* --- V5: HIS BETS AS CARDS; THE MARKET'S PLATES ----------------------------- */
.bets-table { margin: 6px 0 10px; }
.bet-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 420px) { .bet-cards { grid-template-columns: 1fr; } .bet-card { flex-direction: row; align-items: center; } .bet-card .bc-feat { flex: 1; } }
.bet-card { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 12px; border: 2px solid var(--panel-edge); cursor: pointer;
  background: linear-gradient(180deg, #3a2d62, #2a2150); box-shadow: var(--lift); transition: transform .12s, box-shadow .12s; position: relative; }
.bet-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; border-radius: 10px 10px 0 0; background: var(--gold); }
.bet-card:hover { transform: translateY(-3px) rotate(-.5deg); box-shadow: 0 10px 24px rgba(0,0,0,.55), 0 0 0 2px var(--gold); }
.bet-card:active { transform: translateY(1px); }
.bet-card .bc-title { font-family: Sans, system-ui, sans-serif; font-weight: 800; font-size: 1.05rem; font-variation-settings: "opsz" 36, "SOFT" 40, "WONK" 1; }
.bet-card .bc-feat { font-size: .85rem; color: var(--text); }
.bet-card .bc-odds { display: flex; align-items: center; gap: 6px; font-size: .95rem; }
.bet-card .bc-odds .arrow { color: var(--dim); }
.bet-card .bc-odds .prize { font-size: 1.15rem; }
.bet-card.cant { opacity: .55; cursor: default; }
.bet-card.cant:hover { transform: none; }
.bet-card .bc-cant { font-size: .7rem; color: var(--bad); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.bets-table .nobet { margin-top: 8px; opacity: .8; }
.army-head { justify-content: space-between; align-items: center; }
.army-head .mine-kit { flex-basis: auto; border: 0; padding: 0; margin: 0; }
.arena .plate.them { margin-bottom: 6px; }
/* the shelf's price as a coin tag */
.tile.shelf .price { background: rgba(0,0,0,.35); border-radius: 8px; padding: 1px 6px; margin-top: 2px; }
.card.opp .round-name { margin-bottom: 0; }
.card.opp > .row:empty { display: none; }
.card.opp .tier-badge { margin-left: 0; }
.lclock.glee :is(img, :where(ludi-face)) { animation: glee .9s ease-out 1; }
@keyframes glee { 0% { transform: scale(1); } 30% { transform: scale(1.45) rotate(-10deg); } 55% { transform: scale(1.2) rotate(8deg); } 100% { transform: scale(1); } }
.chart { background: linear-gradient(180deg, #1a1232, #130d26); border: 2px solid var(--panel-edge); box-shadow: var(--lift) inset; max-height: 66vh; }
.bracket .road { padding: 8px 12px; }
.bracket .runbar .div { display: none; }
/* coupons as a labelled row, wrapping, never jammed into a header */
.chip-row { margin: 8px 0 4px; }
.chip-row .chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; padding: 8px; border-radius: 12px; background: rgba(0,0,0,.22); border: 1px solid rgba(255,255,255,.06); }
.chip-row .chip-c { width: 36px; height: 36px; }
.stack-group.coupons { gap: 6px; flex-wrap: wrap; }
.army-head { margin-top: 10px; }
.stack.empty { border: 2px dashed rgba(255,255,255,.25); background: rgba(0,0,0,.2); }
.callout.piece .head canvas { width: 28px; height: 28px; flex: none; margin-right: 8px; }
.callout.piece .head { justify-content: flex-start; }
.callout.piece .head .ttl { flex: 1; }

/* --- what fired, on the board (user, 11-08) ------------------------------- */
/* THE PORTALS Snakes and Ladders leaves (user, 12-02): every pair marked on
   both its ends, always -- information, so it stays under reduced motion; only
   the one-shot pops below are feel */
.portals { position: absolute; pointer-events: none; z-index: 3; overflow: visible; }
.portals .portal-line { fill: none; stroke-linecap: round; stroke-dasharray: 2 7; opacity: .5; }
.portals text { font-family: Sans, system-ui, sans-serif; font-weight: 900; }
.portals .portal-tok { filter: drop-shadow(0 1px 2px rgba(0,0,0,.7)); }
.portals .portal-end.new .portal-tok { animation: portal-new .5s cubic-bezier(.2,1.6,.4,1) both; }
.portals .portal-end.used .portal-tok { animation: portal-used .6s ease-out both; }
.portals .portal-go { fill: none; stroke: #fff; stroke-linecap: round; opacity: .92; filter: drop-shadow(0 0 4px rgba(185,140,255,.9)); }
.portals .portal-go.some { stroke-dasharray: 9 7; }
.portals .portal-go-head { fill: #fff; filter: drop-shadow(0 0 4px rgba(185,140,255,.9)); }
.portals .portal-rest { fill: rgba(190,150,255,.2); stroke: #fff; stroke-dasharray: 6 5; }
.portals .portal-rest.same { stroke-dasharray: 2 5; }
@keyframes portal-new { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes portal-used { 0% { transform: scale(1); } 35% { transform: scale(1.9); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .portals .portal-end .portal-tok { animation: none !important; } }
.portal-chip { display: block; }
.fx { position: absolute; pointer-events: none; z-index: 4; }
.fx-ring { position: absolute; box-sizing: border-box; border-radius: 50%; }
.fx-ring.src { border: 4px solid #fff; box-shadow: 0 0 18px 4px rgba(255,255,255,.7); animation: fx-ring 1.9s ease-out forwards; }
.fx-ring.src.good { border-color: #8ff0a0; box-shadow: 0 0 18px 4px rgba(120,220,130,.75); }
.fx-ring.src.bad { border-color: #ff8f8f; box-shadow: 0 0 18px 4px rgba(230,90,90,.75); }
.fx-ring.hit { border-radius: 8px; border: 3px dashed rgba(255,255,255,.8); animation: fx-ring 1.9s ease-out forwards; }
.fx-ring.hit.good { border-color: #8ff0a0; } .fx-ring.hit.bad { border-color: #ff8f8f; }
@keyframes fx-ring { 0% { transform: scale(1.5); opacity: 0; } 15% { transform: scale(1); opacity: 1; } 75% { opacity: 1; } 100% { transform: scale(1.1); opacity: 0; } }
.fx-ring.lit { border: 4px solid var(--gold); box-shadow: 0 0 16px 4px rgba(242,199,92,.75); animation: fx-lit 1s ease-in-out infinite alternate; }
@keyframes fx-lit { from { transform: scale(.92); opacity: .65; } to { transform: scale(1.04); opacity: 1; } }
.fx-ticket { position: fixed; z-index: 70; pointer-events: none; filter: drop-shadow(0 6px 14px rgba(0,0,0,.55)) drop-shadow(0 0 12px rgba(185,140,255,.55)); will-change: transform, opacity; }
.rail .slot.jump { animation: slot-jump .6s cubic-bezier(.2,.9,.3,1.3) 1; }
@keyframes slot-jump { 0% { transform: scale(1); } 30% { transform: scale(1.28) rotate(-5deg); } 60% { transform: scale(.94) rotate(3deg); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .rail .slot.jump { animation: none; } }
.fx-pop { position: absolute; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 6px 10px; border-radius: 12px;
  background: rgba(24,16,48,.94); border: 2px solid #fff; box-shadow: 0 4px 0 #0c0718, 0 10px 24px rgba(0,0,0,.6); animation: fx-pop .35s cubic-bezier(.2,1.6,.4,1); transition: opacity .45s, transform .45s; }
.fx-pop b { font-family: Sans, system-ui, sans-serif; font-weight: 900; font-size: 1rem; letter-spacing: .03em; line-height: 1.1; }
.fx-pop span { font-size: .72rem; color: var(--text); line-height: 1.2; margin-top: 2px; }
.fx-pop.good { border-color: #8ff0a0; } .fx-pop.good b { color: #a9f5b6; }
.fx-pop.bad { border-color: #ff8f8f; } .fx-pop.bad b { color: #ffb3b3; }
.fx-pop.extra { border-color: var(--gold); } .fx-pop.extra b { color: #ffe9a8; }
.fx-pop.out { opacity: 0; transform: translateY(-14px); }
@keyframes fx-pop { from { transform: scale(.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.fx-banner { position: absolute; left: 0; right: 0; top: 38%; display: flex; flex-direction: column; align-items: center; padding: 10px 6px;
  background: linear-gradient(90deg, rgba(20,12,40,0), rgba(20,12,40,.92) 15%, rgba(20,12,40,.92) 85%, rgba(20,12,40,0));
  animation: fx-banner .4s cubic-bezier(.2,1.4,.4,1); transition: opacity .45s; }
.fx-banner b { font-family: Sans, system-ui, sans-serif; font-weight: 900; font-size: clamp(1.4rem, 7vw, 2.2rem); letter-spacing: .06em; color: #ffe9a8; text-shadow: 0 2px 0 rgba(0,0,0,.6), 0 0 22px rgba(242,199,92,.7); }
.fx-banner.theirs b { color: #ffb3b3; text-shadow: 0 2px 0 rgba(0,0,0,.6), 0 0 22px rgba(230,90,90,.6); }
.fx-banner span { font-weight: 800; font-size: .85rem; color: #fff; text-shadow: 0 1px 2px #000; }
.fx-banner.out { opacity: 0; }
@keyframes fx-banner { from { transform: scaleX(.2); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .fx-ring, .fx-pop, .fx-banner { animation: none !important; } }
.fx-ring.cat { border-radius: 8px; border: 3px solid rgba(242,199,92,.85); box-shadow: inset 0 0 14px rgba(242,199,92,.45); animation: fx-lit 1.2s ease-in-out infinite alternate; }
.fx-ring.cat.blocked { border-color: rgba(200,200,220,.5); border-style: dashed; box-shadow: none; animation: none; }
.fx-ring.cat.disc { border-radius: 50%; border-width: 4px; }
.fx-tag { position: absolute; width: 150px; text-align: center; font-size: .66rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 8px; background: rgba(20,12,40,.92); border: 1px solid var(--gold); color: #ffe9a8; }
.fx-tag.blocked { border-color: #6a6280; color: var(--dim); }
/* report 20261123-223049-27b62b: one line, and the ready tag is a button */
.fx-tag { width: auto; max-width: calc(100% - 4px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-tag.fire { pointer-events: auto; cursor: pointer; padding: 3px 8px; background: #3a2a10; box-shadow: 0 2px 0 #0c0718; }
.buttons.deeds button.report { background: transparent; border-color: rgba(255,255,255,.15); box-shadow: none; color: var(--dim); font-size: .75rem; padding: 6px 8px; }

/* =====================================================================
   YAEL'S PASS (11-08, a UI/UX designer's playtest: "the font isn't uniform,
   the text sizes are all over the place", "purple on purple, full of
   opacity, not accessible", "fit the screen, don't let the background move")
   ---------------------------------------------------------------------
   ONE typeface. Every rule above that says "Serif" now gets Nunito, heavy;
   the display serif is kept for the logo and nothing else.
   ONE size scale: 12 / 14 / 16 / 20 / 28.
   CONTRAST: panels stand off the night by a lighter fill and a visible
   edge; dim text is dim, never faint; nothing important is see-through.
   ===================================================================== */
:root { --bg: #120c22; --panel: #2a2050; --panel-light: #382c68; --panel-deep: #1d1638; --panel-edge: #4d3f86;
  --text: #fbf7ee; --dim: #cfc5e8; --floor-a: #150e2b; --floor-b: #1b1336;
  --fs-xs: .75rem; --fs-s: .875rem; --fs-m: 1rem; --fs-l: 1.25rem; --fs-xl: 1.75rem; }
@font-face { font-family: "Serif"; src: url(/static/fonts/Nunito.woff2?v=7112afe436) format("woff2"); font-weight: 400 900; font-display: swap; }
h1, h2, .head, .readout .t, .walkout .wo-vs .them, .coupon-card .nm, .points .big, .result .big, .ceremony .cup-name, .promoted .next-div,
.topbar .title, .runbar .div, .strip .who, .lot b, .start .head, .plate .pl-name, .bet-card .bc-title, .scoreboard .stat .n,
.menu .factions button, .gold, .price, .tile .cost, .fx-pop b, .fx-banner b, .stamp .word, .menu .start .head.small, .over .ludivar .bubble {
  font-family: Sans, system-ui, sans-serif !important; font-variation-settings: normal !important; font-style: normal; }
h1 { font-size: var(--fs-xl); font-weight: 900; }
h2, .head:not(.small), .plate .pl-name, .readout .t, .bet-card .bc-title, .lot b { font-size: var(--fs-l); font-weight: 800; }
.readout .t { font-size: var(--fs-m); }
.small, .readout .d, .callout, .sheet, .rule .txt, .bet-card .bc-feat, .card.opp .rule-line, .tile.shelf .tiny, .ludivar .bubble { font-size: var(--fs-s); }
.tiny, .dim.tiny, .pl-sub, .head.small, .sheet .side, .tier-badge, .coupon-cat, .plate .pl-sub, .stack-group .lbl, .scoreboard .stat .l { font-size: var(--fs-xs); }
.menu .logo h1 { font-family: Display, Georgia, serif !important; font-size: clamp(2.2rem, 10vw, 3rem); }
/* contrast: an edge you can see, no faint text, no ghosted controls */
.panel, .card, .lot, .start, .tile, .points, .msg, .readout, .picked-bar, .ledger, .chart, .walkout, .ask .card, .coupon-card, .ludivar .bubble, .sheet, .plate, .bet-card, .tabs {
  border-color: var(--panel-edge) !important; }
button { border-color: var(--panel-edge); background-color: var(--panel-light); color: var(--text); }
button:disabled { opacity: .55; }
.dim { color: var(--dim); }
.tile.off, .stack.off, .tile.shelf.off { opacity: .6; }
.tile.shelf.cant { opacity: 1; } .tile.shelf.cant .price { color: var(--dim); text-decoration: line-through; }
/* the background never moves: fixed to the LARGE viewport, so the phone's
   address bar sliding away does not drag it, and no rubber-band */
html, body { overscroll-behavior: none; }
body::before { height: 100lvh; } body::after { height: 46lvh; }
/* --- the menu fits one phone screen, Start pinned -------------------------- */
.menu .logo { margin: 0; }
.menu .logo .crown svg { width: 44px; height: 28px; }
.menu .motto { font-family: Sans, sans-serif; font-style: normal; font-size: var(--fs-s); color: var(--dim); margin: 2px 0 10px; text-align: center; }
.menu .factions { grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0 0 8px; }
.menu .factions button { padding: 10px 2px; font-size: var(--fs-s); font-weight: 800; letter-spacing: .02em; text-transform: none; }
.menu .factions button.locked { opacity: 1; color: var(--dim); background: var(--panel-deep); }
.menu .factions button .lock { display: block; font-size: .8rem; line-height: 1; margin-bottom: 2px; }
.menu .lock-why { font-size: var(--fs-s); color: var(--dim); text-align: center; margin: 0 0 8px; }
.menu .dossier { padding: 10px 12px; margin: 0 0 8px; }
.menu .dossier .row { gap: 10px; }
.menu .dossier .head { font-size: var(--fs-m); }
.menu .dossier .rule { padding: 6px 0 0; border: 0; }
.menu .dossier .rule .ttl { font-size: var(--fs-s); }
.menu .head.small { margin: 4px 0 6px; color: var(--dim); }
.menu .starts { gap: 6px; }
.menu .start { padding: 8px 12px; }
.menu .start .head.small { font-size: var(--fs-m); color: var(--text); margin: 0; letter-spacing: 0; text-transform: none; font-weight: 800; }
.menu-actions { position: sticky; bottom: 0; z-index: 5; margin: 10px -10px 0; padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(18,12,34,0), rgba(18,12,34,.95) 30%); justify-content: stretch; }
.menu-actions button { flex: 1; padding: 14px 10px; font-size: var(--fs-m); }
.menu-actions button.primary { flex: 2; font-size: var(--fs-l); }
/* 1 cup | 3 cups: one small two-state choice in the bar (11-11) */
.heat-pick { display: flex; align-items: center; gap: 8px; margin: 6px 0; padding: 4px; border-radius: 12px; background: var(--panel-deep); border: 1px solid var(--panel-edge); }
.heat-pick .heat-step { min-width: 44px; min-height: 44px; padding: 0; font-size: 20px; box-shadow: none; }
.heat-pick .heat-step:disabled { opacity: 0.35; }
.heat-pick .heat-text { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; text-align: center; }
.heat-pick .heat-text b { font-size: var(--fs-s); letter-spacing: 0.08em; }
.heat-pick .heat-text span { font-size: var(--fs-xs, 12px); color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.menu-actions .cups-pick { flex: 1.3; display: flex; padding: 3px; gap: 3px; border-radius: 12px; background: var(--panel-deep); border: 1px solid var(--panel-edge); }
.menu-actions .cups-pick button { flex: 1; padding: 6px 2px; font-size: var(--fs-s); white-space: nowrap; border-radius: 9px; box-shadow: none; background: none; border-color: transparent; color: var(--dim); min-width: 0; }
.menu-actions .cups-pick button.on { background: var(--panel-light); color: var(--text); border-color: var(--panel-edge); }
#sfx { bottom: auto; top: calc(6px + env(safe-area-inset-top)); left: auto; right: 8px; }

/* --- THE CHARACTER SELECT (Yael's reference, 11-08) ------------------------ */
.menu .logo h1 { font-size: clamp(1.8rem, 8.5vw, 2.4rem); }
.menu .logo .crown svg { width: 36px; height: 23px; }
.menu .motto { margin: 0 0 8px; }
.showcase { position: relative; height: 196px; border-radius: 18px; overflow: hidden; margin: 0 0 10px; border: 2px solid var(--panel-edge);
  box-shadow: 0 6px 22px rgba(0,0,0,.5); display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
/* each era its own backdrop: a sky, a horizon, a floor */
.showcase::before { content: ""; position: absolute; inset: 0; z-index: 0; }
.era-chess::before { background: radial-gradient(ellipse at 50% 30%, #5d4a8a 0%, transparent 60%), linear-gradient(180deg, #3b2f66 0%, #241a46 55%, #3a2a1c 56%, #5a4230 100%); }
.era-checkers::before { background: radial-gradient(ellipse at 50% 30%, #8a3a3a 0%, transparent 60%), linear-gradient(180deg, #4a1f2a 0%, #2a1420 55%, #1c1c1c 56%, #303030 100%); }
.era-shogi::before { background: radial-gradient(circle at 70% 26%, #f2c0a0 0 18px, transparent 19px), radial-gradient(ellipse at 50% 30%, #7a4a3a 0%, transparent 60%), linear-gradient(180deg, #4a2c3a 0%, #2a1a2a 55%, #6a4a2a 56%, #8a6a3a 100%); }
.era-xiangqi::before { background: radial-gradient(ellipse at 50% 30%, #8a2a2a 0%, transparent 60%), linear-gradient(180deg, #4a1a1a 0%, #2a1010 55%, #3a2a18 56%, #5a4426 100%); }
.showcase > * { position: relative; z-index: 1; }
.sc-hero { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); filter: drop-shadow(0 8px 14px rgba(0,0,0,.6)); }
.sc-hero canvas { width: 96px; height: 96px; }
.sc-army { display: flex; gap: 2px; justify-content: center; margin-bottom: 6px; filter: drop-shadow(0 4px 6px rgba(0,0,0,.6)); }
.sc-army canvas { width: 34px; height: 34px; }
.sc-text { width: 100%; text-align: center; padding: 6px 10px 8px; background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.55)); }
.sc-name { font-size: var(--fs-l); font-weight: 900; color: #fff; text-shadow: 0 2px 4px rgba(0,0,0,.7); }
.sc-era { font-size: var(--fs-xs); font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #ffe9a8; }
.sc-rule { position: absolute !important; top: 10px; right: 10px; padding: 5px 10px; font-size: var(--fs-xs); font-weight: 800; border-radius: 999px;
  background: rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.25); box-shadow: none; color: #fff; }
.pick-row { display: grid; gap: 8px; margin: 0 0 8px; }
.pick-row.factions { grid-template-columns: repeat(4, 1fr); }
.pick-row.starts { grid-template-columns: repeat(3, 1fr); }
.pick { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 8px 2px 6px;
  border-radius: 14px; background: var(--panel); border: 2px solid var(--panel-edge) !important; min-height: 76px; }
.pick canvas { width: 40px; height: 40px; }
.pick .pk-name { font-size: var(--fs-xs); font-weight: 800; color: var(--text); line-height: 1.1; text-align: center; }
.pick.on { border-color: var(--gold) !important; background: #3a2c62; box-shadow: 0 0 0 1px var(--gold), 0 0 16px rgba(242,199,92,.35), 0 3px 0 #0c0718; }
.pick .check { position: absolute; top: -7px; right: -7px; width: 20px; height: 20px; border-radius: 50%; background: var(--gold); color: #2a1a00;
  font-size: .72rem; display: flex; align-items: center; justify-content: center; border: 2px solid #0c0718; }
.pick.locked canvas { filter: grayscale(1) brightness(.55); }
.pick.locked .pk-name { color: var(--dim); }
.pick .lock { position: absolute; top: 4px; right: 6px; font-size: .75rem; }
.pick.army { min-height: 62px; padding: 8px 4px; }
.pick .pk-army { display: flex; flex-wrap: wrap; justify-content: center; gap: 1px; }
.pick .pk-army canvas { width: 22px; height: 22px; }
.menu .lock-why { margin: -2px 0 8px; }
.pick .lock { color: var(--dim); line-height: 0; }
#sfx { top: calc(2px + env(safe-area-inset-top)); right: auto; left: 50%; margin-left: -13px; width: 26px; height: 22px; border-radius: 8px; }
/* WCAG AA (Yael: "check it passes Google's colour standard"; chessmania-47's
   audit): red text lightened to pass on every panel; nothing "unavailable"
   is faded as a whole -- its text stays at --dim (6.8:1) and a strike, a
   lock or a grey sprite says it is out */
:root { --bad: #ff7676; --theirs: #ff7676; }
button:disabled { opacity: 1; color: var(--dim); background: var(--panel-deep); box-shadow: none; }
.contender.out, .ledger .shelf .it.sold { opacity: 1; color: var(--dim); }
.tile.off, .tile.shelf.off, .stack.off { opacity: 1; }
.tile.off canvas, .tile.shelf.off canvas, .stack.off canvas { filter: grayscale(1) brightness(.6); }
.tile.shelf.off .price { text-decoration: line-through; color: var(--dim); }

/* THE SHOWCASE IS WHAT IS SPECIAL (user, 11-08: "Remove the medieval Europe
   stuff. Use the full space to explain what's special about the faction"):
   no era backdrop, the royal and name, then the rules -- the box takes the
   room the phone has left and scrolls inside itself, never the page */
.showcase.special { height: clamp(150px, calc(100dvh - 428px), 380px); justify-content: flex-start; align-items: stretch;
  background: var(--panel); padding: 10px 12px 8px; }
.showcase.special::before { display: none; }
.sc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.sc-head canvas { width: 44px; height: 44px; flex: none; }
.showcase.special .sc-name { font-size: var(--fs-l); color: var(--text); text-shadow: none; }
.sc-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-right: 2px;
  /* a fade at the foot says there is more to scroll to */
  -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 18px), transparent); mask-image: linear-gradient(180deg, #000 calc(100% - 18px), transparent); padding-bottom: 14px; }
.sc-row { display: flex; gap: 8px; align-items: flex-start; font-size: var(--fs-xs); line-height: 1.3; color: var(--text); }
.sc-row canvas { flex: none; margin-top: 1px; }
.sc-row b { color: var(--gold); letter-spacing: .03em; }
.sc-row.king b { color: #9be7a3; }
.sc-row.tap { cursor: pointer; }

/* THE MARKET ON A PHONE (Yael, 11-08: "fit, don't let the screen scroll"):
   a fixed header, one row of tabs, a pane that scrolls inside itself, and
   Fight! fixed at the foot -- the page never scrolls */
.arena.phone { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; padding-bottom: 0; }
.arena.phone > .topbar, .arena.phone > .mtabs, .arena.phone > .msg { flex: none; }
.arena.phone > .mtabs { margin: 4px 0 6px; overflow-x: auto; flex-wrap: nowrap; }
.arena.phone > .mtabs button { flex: 1 0 auto; padding-left: 8px; padding-right: 8px; }
.arena.phone > .mpane { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding-bottom: 8px; }
.arena.phone > .mpane > .sheet.tall { max-height: none; margin-top: 0; }
.arena.phone > .market-actions { position: static; flex: none; margin: 0 -10px; }
.arena.phone > .mtabs button { font-size: var(--fs-xs); padding: 7px 6px; }
.arena.phone > .mtabs .badge { margin-left: 3px; }
.arena.phone .picked-bar { padding: 6px 10px; min-height: 0; }
.arena.phone .picked-bar .dim.small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arena.phone .plate.them { padding-top: 6px; padding-bottom: 6px; }
.arena.phone .picked-bar { display: flex; align-items: center; gap: 6px; }
.arena.phone .picked-bar > span:first-child { flex: 1; min-width: 0; }
.arena.phone .picked-bar .deeds { display: flex; gap: 4px; flex: none; }
.arena.phone .picked-bar .deeds button { padding: 5px 8px; font-size: var(--fs-xs); }

/* a demo shown BARE: the board only (the menu's showcase) */
.demo-view.bare .caption, .demo-view.bare .event, .demo-view.bare .controls, .demo-view.bare .hands { display: none; }

/* THE SHOWCASE SHOWS (user, 11-08: "visual and animations on clickable brief
   descriptions"): a looping board, the features as chips, one line */
.showcase.feat { height: auto; flex-direction: row; align-items: center; justify-content: flex-start; gap: 12px;
  padding: 10px; background: var(--panel); }
.showcase.feat::before { display: none; }
.sc-stage { flex: none; cursor: pointer; line-height: 0; border-radius: 10px; overflow: hidden; }
.sc-stage .demo-view canvas { display: block; border-radius: 8px; }
.sc-side { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; align-self: stretch; }
.showcase.feat .sc-head { display: flex; align-items: center; gap: 8px; margin: 0; }
.showcase.feat .sc-head canvas { width: 34px; height: 34px; }
.showcase.feat .sc-name { font-size: var(--fs-l); color: var(--text); text-shadow: none; }
.sc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sc-chip { padding: 6px 10px !important; font-size: var(--fs-xs) !important; font-weight: 800; border-radius: 999px !important; }
.sc-chip.on { background: var(--gold) !important; color: #2a1a00 !important; }
.sc-line { font-size: var(--fs-s); color: var(--text); line-height: 1.3; margin-top: auto; }
/* the showcase's four parts on a grid: beside the board on a tall screen,
   the chips under it on a short one */
.showcase.feat { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto 1fr auto;
  grid-template-areas: "stage head" "stage chips" "stage line"; column-gap: 12px; row-gap: 8px; align-items: start; }
.showcase.feat > .sc-stage { grid-area: stage; align-self: center; }
.showcase.feat > .sc-head { grid-area: head; }
.showcase.feat > .sc-chips { grid-area: chips; }
.showcase.feat > .sc-line { grid-area: line; margin: 0; }
@media (max-height: 680px) {
  .showcase.feat { grid-template-rows: auto 1fr; grid-template-areas: "stage head" "stage line" "chips chips"; }
  .sc-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  .sc-chip { padding: 5px 9px !important; flex: none; }
  .menu .motto { display: none; }
  .menu .logo h1 { font-size: 1.6rem; }
  .menu .logo .crown svg { width: 28px; height: 18px; }
  .pick-row.starts .pick canvas { width: 24px; height: 24px; }
  .pick-row.starts .pick { min-height: 64px; padding-top: 6px; padding-bottom: 4px; }
  .pick-row.factions .pick { min-height: 64px; }
}
/* his bets on a phone: three slim cards, so the board shows under them */
.arena.phone .bet-card { padding: 8px 10px; }
.arena.phone .bet-card .bc-title { font-size: var(--fs-m, 1rem); }
.arena.phone .bet-card .bc-feat { font-size: var(--fs-xs); margin: 2px 0; }
.arena.phone .bet-cards { gap: 6px; }
/* --- THE ENDING (webui/ending.js; user, 11-08/09) -------------------------- */
.ending { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  padding: 20px 16px; background: radial-gradient(ellipse at 50% 35%, #3a2466 0%, #120a24 70%); opacity: 0; transition: opacity .6s ease; }
.ending.in { opacity: 1; } .ending.gone { opacity: 0; }
.end-skip { position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 10px; }
.end-top { display: flex; flex-direction: column; align-items: center; gap: 10px; width: min(92vw, 420px); }
.end-host { width: 128px; height: 128px; filter: drop-shadow(0 0 26px rgba(185,140,255,.7)); animation: crown-bob 4s ease-in-out infinite; }
.end-bubble { min-height: 3.2em; text-align: center; font-size: var(--fs-l); font-weight: 800; color: #fff; background: #2b2247; border: 2px solid var(--panel-edge);
  border-radius: 16px; padding: 12px 16px; box-shadow: 0 6px 20px rgba(0,0,0,.5); }
.end-bubble:empty { visibility: hidden; }
.end-bubble.pop { animation: introPop .35s ease-out; }
/* the list of what is unique (user, 11-09): every item a title and a few
   words, the playing one gold; the list scrolls beside the board if long */
.showcase.feat { grid-template-areas: "stage head" "stage list"; grid-template-rows: auto 1fr; }
.showcase.feat > .sc-feats { grid-area: list; display: flex; flex-direction: column; gap: 4px; min-height: 0; overflow-y: auto; align-self: stretch; }
.sc-feat { display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 0; padding: 5px 8px !important;
  border-radius: 10px !important; background: var(--panel-light) !important; box-shadow: none !important; border: 1px solid transparent !important; }
.sc-feat b { font-size: var(--fs-xs); font-weight: 800; color: var(--text); }
.sc-feat span { font-size: var(--fs-xs); color: var(--dim); font-weight: 600; line-height: 1.2; }
.sc-feat.on { border-color: var(--gold) !important; background: #3a2c62 !important; }
.sc-feat.on b { color: var(--gold); }
@media (max-height: 680px) {
  .showcase.feat { grid-template-areas: "stage head" "stage list"; grid-template-rows: auto 1fr; }
  .sc-feat span { display: none; }
  .sc-feat.on span { display: block; }
}
/* compact: every title shown, the few words only under the one playing */
.sc-feat { padding: 4px 8px !important; }
.sc-feat span { display: none; }
.sc-feat.on span { display: block; }
@media (max-height: 680px) { .sc-feat { padding: 3px 8px !important; } .showcase.feat > .sc-feats { gap: 3px; } .showcase.feat .sc-head canvas { width: 28px; height: 28px; } }
/* the chest: a body, a dark inside, a pile, a lid on hinges at the back */
.chest { position: relative; width: 220px; height: 170px; filter: drop-shadow(0 14px 18px rgba(0,0,0,.6)); }
.chest-back { position: absolute; left: 8px; right: 8px; top: 52px; height: 30px; border-radius: 6px; background: #0a0604; }
.chest-pile { position: absolute; left: 0; right: 0; top: 30px; height: 70px; overflow: hidden; }
.chest-pile canvas.piled { position: absolute; width: 52px; height: 52px; }
.chest-body { position: absolute; left: 0; right: 0; bottom: 0; height: 120px; z-index: 2; }
.chest-body svg, .chest-lid svg { width: 100%; height: 100%; display: block; }
.chest-lid { position: absolute; left: 0; right: 0; top: 0; height: 70px; z-index: 3;
  transition: transform .55s cubic-bezier(.5,-0.2,.4,1.3); }
/* the lid swings up on its left hinge, and back down to shut */
.chest-lid { transform-origin: 3% 92%; }
.chest.open .chest-lid { transform: rotate(-82deg); }
.chest.shut .chest-lid { transform: none; }
canvas.tossed { position: absolute; left: 0; top: 0; width: 52px; height: 52px; z-index: 4; animation: toss .7s cubic-bezier(.3,0,.6,1) forwards; }
@keyframes toss {
  0% { transform: translate(var(--sx), var(--sy)) rotate(0) scale(.8); }
  45% { transform: translate(calc((var(--sx) + var(--ex)) / 2), calc(var(--ey) - 150px)) rotate(calc(var(--spin) / 2)) scale(1); }
  100% { transform: translate(var(--ex), var(--ey)) rotate(var(--spin)) scale(.95); } }
@media (prefers-reduced-motion: reduce) { .end-host, canvas.tossed { animation: none; } }
.end-host.yawn { animation: yawn 1.6s ease-in-out 1; }
@keyframes yawn { 0% { transform: scale(1); } 25% { transform: scaleX(.92) scaleY(1.12) rotate(-4deg); } 55% { transform: scaleX(.9) scaleY(1.16) rotate(-6deg); } 100% { transform: scale(1); } }
/* consistency (11-09): the board's slot is one size for every faction,
   the board centred in it; a long faction name never squeezes it; the
   starting-army tiles one height, so Start never moves */
.showcase.feat { grid-template-columns: auto minmax(0, 1fr); }
.sc-stage { display: flex; align-items: center; justify-content: center; flex: none; }
.showcase.feat .sc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.showcase.feat .sc-head { min-width: 0; }
.pick-row.starts .pick { height: 112px; min-height: 0; justify-content: flex-start; padding-top: 10px; }
@media (max-height: 680px) { .pick-row.starts .pick { height: 92px; padding-top: 6px; } }
.sc-feat { padding: 3px 8px !important; } .showcase.feat > .sc-feats { gap: 3px; }
.showcase.feat { overflow: hidden; }
/* A WIDE SCREEN keeps the menu's shape (user, 11-09: "ugly" -- on a laptop the
   menu stretched to 1600px: empty wide tiles, feature rows edge to edge, a
   small board in a big box). The menu is one centred column, phone-shaped,
   so every tile and the board keep their proportions. */
@media (min-width: 700px) {
  #app.menu { max-width: 560px; }
  #app.menu .showcase.feat .sc-stage canvas { max-width: 100%; }
}
@media (min-width: 700px) {
  #app.menu .pick-row.starts .pick { height: auto; min-height: 84px; justify-content: center; gap: 8px; padding: 12px 6px; }
  #app.menu .pick-row.starts .pick canvas { width: 30px; height: 30px; }
  #app.menu .menu-actions { background: none; margin: 10px 0 0; padding: 0; }
}
.menu .logo h1 { font-variation-settings: "opsz" 144, "SOFT" 0, "WONK" 0 !important; }
@media (max-width: 699px) {
  #app.menu .showcase.feat > .sc-stage { width: 150px; }
  #app.menu .showcase.feat > .sc-stage canvas { width: 150px !important; height: auto !important; }
}
/* the logo in the game's one typeface (Yael: "keep the font the same") */
.menu .logo h1 { font-family: Sans, system-ui, sans-serif !important; font-weight: 900; letter-spacing: .06em; }

/* the prologue's CHECKMATE stamp (user, 11-09: "exaggerate the checkmate") */
.intro-stamp { position: fixed; z-index: 6; pointer-events: none; white-space: nowrap;
  font-family: Display, Georgia, serif; font-weight: 900; font-size: clamp(2rem, 11vw, 3.4rem); letter-spacing: .04em;
  color: #ff5a5a; padding: 4px 18px; border: 5px solid #ff5a5a; border-radius: 12px;
  background: rgba(20, 6, 12, .55); text-shadow: 0 3px 0 #3a0a10, 0 0 18px rgba(255,90,90,.6); box-shadow: 0 0 24px rgba(255,90,90,.45); }

/* --- THE FEEL (user, 11-10: "Make my game feel top tier") -------------------
   Motion that answers the hand; nothing here carries information. */
#board { transition: filter .5s ease; }
#board.fallen { filter: grayscale(.85) brightness(.74); transition: filter 1.6s ease .3s; }   /* DEFEAT: the colour drains out of the board */
/* a screen's cards are dealt the first time it is drawn (app.js arrive) */
@keyframes deal-in { from { opacity: 0; transform: translateY(22px) rotate(-1.6deg) scale(.95); } 70% { opacity: 1; } to { opacity: 1; transform: none; } }
#app.dealt .lot, #app.dealt .bet-card { animation: deal-in .34s cubic-bezier(.2, .9, .3, 1.25) both; }
#app.dealt .lot:nth-child(2), #app.dealt .bet-card:nth-child(2) { animation-delay: .07s; }
#app.dealt .lot:nth-child(3), #app.dealt .bet-card:nth-child(3) { animation-delay: .14s; }
#app.dealt .lot:nth-child(4), #app.dealt .bet-card:nth-child(4) { animation-delay: .21s; }
#app.dealt .lot:nth-child(5) { animation-delay: .28s; }
#app.dealt .lot:nth-child(n+6) { animation-delay: .34s; }
/* a card rises to the pointer where there is one */
@media (hover: hover) {
  .lot, .bet-card { transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease; }
  .lot:hover, .bet-card:not(.cant):hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 8px 18px rgba(0,0,0,.35); }
}
/* the purse counting (app.js arrive): it swells while the number runs */
.gold.purse { display: inline-block; transition: transform .18s ease, text-shadow .18s ease; }
.gold.purse.up { transform: scale(1.28); text-shadow: 0 0 14px rgba(242,199,92,.9); }
.gold.purse.down { transform: scale(.9); }
@media (prefers-reduced-motion: reduce) { #app.dealt .lot, #app.dealt .bet-card { animation: none; } #board.fallen { transition: none; } }

/* --- THE LOOK IN MOTION (user, 11-10: "How about ui, visuals and animations")
   The realm is alive behind the game: stars that twinkle out of step, a glow
   that drifts, now and then a falling star, and the floor running slowly
   toward you. Still faint: it is where the game is played, not the game. */
body::after { display: none; }                    /* the floor is .realm .floor now */
.realm { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.realm i { position: absolute; display: block; }
.realm .floor { left: 0; right: 0; bottom: 0; height: 46%; height: 46lvh; opacity: .9;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 55%); mask-image: linear-gradient(to bottom, transparent 0%, #000 55%); }
.realm .floor b { position: absolute; left: 0; right: 0; top: -44px; bottom: 0;
  background: repeating-conic-gradient(var(--floor-a) 0 25%, var(--floor-b) 0 50%) 50% 0 / 44px 44px;
  transform-origin: 50% 44px; transform: perspective(340px) rotateX(58deg) scale(2.2, 1);
  animation: floor-run 18s linear infinite; will-change: transform; }
@keyframes floor-run { from { transform: perspective(340px) rotateX(58deg) scale(2.2, 1) translateY(0); }
                       to { transform: perspective(340px) rotateX(58deg) scale(2.2, 1) translateY(44px); } }
.realm .stars { inset: 0; }
.realm .stars.a { background:
    radial-gradient(1px 1px at 43% 62%, #fff4d6 50%, transparent 51%),
    radial-gradient(1px 1px at 85% 5%, #ffffff 50%, transparent 51%),
    radial-gradient(2px 2px at 14% 25%, #e9dcff 50%, transparent 51%),
    radial-gradient(1px 1px at 66% 15%, #e9dcff 50%, transparent 51%),
    radial-gradient(1px 1px at 57% 28%, #e9dcff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 13% 37%, #e9dcff 50%, transparent 51%),
    radial-gradient(1px 1px at 74% 9%, #ffffff 50%, transparent 51%),
    radial-gradient(1px 1px at 82% 39%, #ffffff 50%, transparent 51%),
    radial-gradient(1px 1px at 76% 27%, #e9dcff 50%, transparent 51%),
    radial-gradient(1px 1px at 7% 37%, #fff4d6 50%, transparent 51%),
    radial-gradient(2px 2px at 55% 11%, #e9dcff 50%, transparent 51%),
    radial-gradient(2px 2px at 75% 21%, #ffffff 50%, transparent 51%),
    radial-gradient(2px 2px at 25% 8%, #ffffff 50%, transparent 51%),
    radial-gradient(1px 1px at 83% 14%, #e9dcff 50%, transparent 51%),
    radial-gradient(1px 1px at 72% 47%, #ffffff 50%, transparent 51%),
    radial-gradient(1px 1px at 9% 41%, #fff4d6 50%, transparent 51%);
  animation: twinkle 4.3s ease-in-out infinite alternate; }
.realm .stars.b { background:
    radial-gradient(1.5px 1.5px at 89% 36%, #fff4d6 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 61% 39%, #fff4d6 50%, transparent 51%),
    radial-gradient(1px 1px at 40% 17%, #c9b3ff 50%, transparent 51%),
    radial-gradient(2px 2px at 33% 7%, #fff4d6 50%, transparent 51%),
    radial-gradient(1px 1px at 69% 33%, #c9b3ff 50%, transparent 51%),
    radial-gradient(2px 2px at 59% 20%, #e9dcff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 17% 34%, #e9dcff 50%, transparent 51%),
    radial-gradient(1px 1px at 98% 23%, #fff4d6 50%, transparent 51%),
    radial-gradient(1px 1px at 55% 4%, #c9b3ff 50%, transparent 51%),
    radial-gradient(1px 1px at 75% 52%, #fff4d6 50%, transparent 51%),
    radial-gradient(2px 2px at 90% 24%, #fff4d6 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 76% 53%, #e9dcff 50%, transparent 51%),
    radial-gradient(1px 1px at 13% 62%, #fff4d6 50%, transparent 51%),
    radial-gradient(1px 1px at 91% 44%, #e9dcff 50%, transparent 51%),
    radial-gradient(1px 1px at 95% 46%, #c9b3ff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 75% 45%, #fff4d6 50%, transparent 51%);
  animation: twinkle 6.1s ease-in-out -2s infinite alternate-reverse; }
@keyframes twinkle { from { opacity: .18; } to { opacity: .95; } }
.realm .glow { inset: -10%; background:
    radial-gradient(42% 30% at 28% 12%, rgba(185,140,255,.17), transparent 70%),
    radial-gradient(36% 26% at 76% 20%, rgba(255,120,200,.08), transparent 70%);
  animation: glow-drift 40s ease-in-out infinite alternate; will-change: transform; }
@keyframes glow-drift { from { transform: translate3d(-3%, -1%, 0) scale(1); } to { transform: translate3d(4%, 3%, 0) scale(1.12); } }
.realm .comet { top: 9%; left: -12%; width: 110px; height: 2px; border-radius: 2px; opacity: 0;
  background: linear-gradient(90deg, transparent, #fff4d6); transform: rotate(16deg);
  animation: comet 27s linear 6s infinite; }
@keyframes comet { 0% { opacity: 0; transform: translate3d(0, 0, 0) rotate(16deg); } 1% { opacity: .9; }
  5% { opacity: 0; transform: translate3d(135vw, 40vh, 0) rotate(16deg); } 100% { opacity: 0; transform: translate3d(135vw, 40vh, 0) rotate(16deg); } }

/* THE WALK-OUT is a duel card: two banners and a VS that lands */
.walkout { overflow: hidden; }
.walkout .wo-vs.duel { align-items: stretch; gap: 4px; margin: 14px -4px 12px; }
.wo-side { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; min-height: 60px; }
.wo-side canvas { width: 44px; height: 44px; flex: none; filter: drop-shadow(0 3px 5px rgba(0,0,0,.55)); }
.wo-side.mine { background: linear-gradient(90deg, rgba(96,165,255,.30), rgba(96,165,255,.03)); border-left: 4px solid var(--mine);
  justify-content: flex-start; animation: wo-left .44s cubic-bezier(.2, .9, .25, 1.15) both; }
.wo-side.foe { background: linear-gradient(270deg, rgba(255,96,96,.30), rgba(255,96,96,.03)); border-right: 4px solid var(--theirs);
  justify-content: flex-end; text-align: right; animation: wo-right .44s cubic-bezier(.2, .9, .25, 1.15) .08s both; }
.walkout .wo-vs.duel .you { font-size: 1.35rem; font-weight: 900; letter-spacing: .06em; color: #cfe3ff; }
.walkout .wo-vs.duel .them { font-size: 1.35rem; line-height: 1.1; }
.walkout .wo-vs.duel .vs { align-self: center; font-style: normal; font-weight: 900; font-size: 1.5rem; letter-spacing: .12em; color: #fff;
  text-shadow: 0 0 16px rgba(185,140,255,.95), 0 2px 0 rgba(0,0,0,.6); margin: -2px 0; animation: wo-clash .5s cubic-bezier(.2, 1.5, .4, 1) .3s both; }
@keyframes wo-left { from { transform: translateX(-110%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes wo-right { from { transform: translateX(110%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes wo-clash { from { transform: scale(3.2) rotate(-8deg); opacity: 0; } 60% { opacity: 1; } to { transform: none; opacity: 1; } }

/* the one button that goes on: a slow light crosses it */
button.primary:not(.intro-skip):not(.end-skip) { position: relative; overflow: hidden; }
button.primary:not(.intro-skip):not(.end-skip)::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 42%; pointer-events: none;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,.5), transparent);
  transform: translateX(-180%) skewX(-18deg); animation: sheen 5.2s ease-in-out 1.2s infinite; }
button.primary:disabled::after { display: none; }
@keyframes sheen { 0%, 68% { transform: translateX(-180%) skewX(-18deg); } 100% { transform: translateX(360%) skewX(-18deg); } }

/* your place in the draw breathes; whoever is thinking, shows it */
.slot-you { animation: slot-you 2.4s ease-in-out infinite; }
@keyframes slot-you { 0%, 100% { stroke-opacity: 1; stroke-width: 2.5px; } 50% { stroke-opacity: .5; stroke-width: 4px; } }
.plate.them.turn .pl-sub { animation: thinking 1s ease-in-out infinite alternate; }
@keyframes thinking { from { opacity: .45; } to { opacity: 1; } }
/* a long name on a shelf card breaks inside the card, never off its edges */
.tile.shelf .tiny { overflow-wrap: break-word; padding: 0 2px; }   /* a word breaks only when it alone is wider than the card */

@media (prefers-reduced-motion: reduce) {
  .realm .floor b, .realm .stars, .realm .glow, .realm .comet, .slot-you, .plate.them.turn .pl-sub,
  .wo-side, .walkout .wo-vs.duel .vs, button.primary::after { animation: none !important; }
  .realm .comet, button.primary::after { display: none; }
}

/* --- THE MARKET IS ONE PLACE on a phone (user, 11-10): the board stays, a
   dock of four doors under it, their details behind their plate ----------- */
.arena.phone > .mstage { flex: none; }
.arena.phone > .mstage .points.slim { margin: 4px 0 0; }
.arena.phone > .mstage .fieldrow { margin-top: 4px; }
.arena.phone > .dock { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; overflow: visible; }
.arena.phone > .dock button { display: flex; align-items: center; justify-content: center; gap: 5px; padding: 6px 4px; }
.arena.phone > .dock .dock-ic { display: inline-flex; }
.arena.phone > .dock button.on { color: #fff; }
.plate.them.opens { cursor: pointer; position: relative; padding-right: 26px; }
.plate.them.opens .more { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 1.5rem; line-height: 1; color: var(--dim); }
.them-card .card { max-height: 86vh; overflow-y: auto; width: min(94vw, 420px); max-width: 94vw; box-sizing: border-box; text-align: left; }
.them-card .card .rule-line, .them-card .card .small { overflow-wrap: anywhere; }
.them-card .card .opp { border: 0; box-shadow: none; background: none; padding: 0 0 6px; margin: 0; }
.them-card .card > button { width: 100%; margin-top: 8px; }

/* the key to the marks on a piece's rim (demo.js rimKey) */
.rim-key { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 4px; align-items: center; }
.rim-key .rk { display: inline-flex; align-items: center; gap: 4px; }
.ask.them-card { padding: 0 12px; box-sizing: border-box; }
.them-card .card { width: 100%; max-width: 420px; min-width: 0; overflow-x: hidden; }
.them-card .card .opp, .them-card .card .opp * { white-space: normal; overflow-wrap: anywhere; min-width: 0; }

/* --- SMARTER, NOT PRETTIER (user, 11-11) ---------------------------------- */
.more-wrap { position: relative; display: inline-flex; }
.more-btn { font-size: 1.3rem; line-height: 1; padding-left: 12px; padding-right: 12px; letter-spacing: .05em; }
.more-pop { position: absolute; bottom: calc(100% + 8px); right: 0; z-index: 30; display: flex; flex-direction: column; gap: 6px; padding: 8px;
  min-width: 170px; background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 12px; box-shadow: 0 10px 26px rgba(0,0,0,.55); }
.more-pop button { width: 100%; text-align: left; white-space: nowrap; }
.market-actions .more-wrap .more-pop { right: auto; left: 0; }
.deploy-ghost { position: fixed; z-index: 50; pointer-events: none; filter: drop-shadow(0 10px 10px rgba(0,0,0,.5)); }
/* the walk-out burns down by itself */
.walkout .wo-fuse { height: 3px; margin: 12px -16px -12px; background: var(--accent); transform-origin: 0 50%; animation: wo-fuse 3s linear both; opacity: .8; }
@keyframes wo-fuse { from { transform: scaleX(1); } to { transform: scaleX(0); } }
/* (11-11) a narrow phone: the faction's name sat in the thin column beside
   the board and read "Ch..." at 360px. Its emblem is the lit door just
   below, so the name takes that room */
@media (max-width: 420px) {
  .showcase.feat .sc-head canvas { display: none; }
  .showcase.feat .sc-name { font-size: 1.05rem; }
}
/* (11-11) the army rail's tiles hold a piece, its hearts and its cost: the
   fixed 62px box let the cost run out underneath on a phone */
.tiles > .tile { height: auto; min-height: 62px; padding: 3px 0 4px; box-sizing: border-box; }
.tiles > .tile .lives { line-height: 1; font-size: .7rem; }
.tiles > .tile .cost { line-height: 1.15; white-space: nowrap; }
.tiles > .tile.bench canvas { opacity: .6; }
/* the shelf's Reroll rides at the top of whatever scrolls it (11-11) */
.reroll-bar { position: sticky; top: 0; z-index: 4; margin: -4px -6px 4px; padding: 4px 6px; pointer-events: none; }
.reroll-bar > button { pointer-events: auto; box-shadow: 0 2px 10px rgba(0,0,0,.55); }
.arena.phone > .mpane > .sheet.tall { overflow: visible; }   /* so the Reroll sticks to the pane that scrolls */

/* =====================================================================
   THE BATTLE, AFTER THE PANEL (user, 11-11: "Fix according to their
   remarks"). Each block names the remark it answers.
   ===================================================================== */
/* "Fight 2's battle screen ... pushes Undo off the screen": on a phone the
   bar (Log, Rules, Undo, the menu) is fixed to the bottom of the window,
   above the home-bar inset; the page keeps that much room under it, so it
   lies over nothing. A drawer opens upward from it, over the board. */
@media (max-width: 599px) {
  #app.battle:not(.wide) { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
  .battle:not(.wide) .toolbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 8; margin: 0; flex-wrap: nowrap;
    padding: 6px 10px calc(6px + env(safe-area-inset-bottom)); background: rgba(18,12,36,.97); border-top: 2px solid var(--panel-edge); box-shadow: 0 -6px 18px rgba(0,0,0,.45); }
  .battle:not(.wide) .toolbar .tabs.drawers { flex-basis: auto; flex: 1; }
  .battle:not(.wide) .toolbar .tabs.drawers button { min-height: 40px; }
  .battle:not(.wide) .toolbar .buttons.deeds button { min-height: 40px; }
  .battle:not(.wide) .toolbar .sheet { position: fixed; left: 8px; right: 8px; bottom: calc(60px + env(safe-area-inset-bottom)); z-index: 9;
    margin: 0; max-height: 58vh; max-height: 58dvh; box-shadow: 0 -8px 26px rgba(0,0,0,.6); }
  body:has(.battle:not(.wide)) #waiting { bottom: calc(70px + env(safe-area-inset-bottom)); }
  /* ...and what the bar would hide on a short phone rides just above it:
     the callout (the piece you picked up, the rule that fired) sticks over
     your own plate, never over the board */
  .battle:not(.wide) .col.dock { display: contents; }
  .battle:not(.wide) .callout.info, .battle:not(.wide) .callout.good, .battle:not(.wide) .callout.bad, .battle:not(.wide) .callout.stay {
    position: sticky; bottom: calc(66px + env(safe-area-inset-bottom)); z-index: 7; background: var(--callout-bg); border-radius: 10px; }
  .battle:not(.wide) .callout.none { display: none; }
}
/* a SHORT phone (360x640): the plates and the top margin give the board's
   surroundings their 40 pixels back */
@media (max-width: 599px) and (max-height: 720px) {
  #app.battle:not(.wide) { padding-top: 6px; }
  .battle:not(.wide) .plate { padding: 3px 10px; margin: 2px 0; }
  .battle:not(.wide) .plate .emblem { width: 38px; height: 38px; }
  .battle:not(.wide) .plate .emblem canvas { width: 34px; height: 34px; }
  .battle:not(.wide) .topbar { padding-bottom: 0; }
  /* ...and the callout keeps to four short lines, so it never reaches the board */
  .battle:not(.wide) .callout { max-height: 104px; overflow: hidden; box-sizing: border-box; }
  .battle:not(.wide) .callout.piece .hint { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; line-clamp: 1; overflow: hidden; }
  .battle:not(.wide) .callout.piece { gap: 2px; }
}
/* the "?" on a picked-up piece: its finger-room grows AWAY from the piece (up
   and left), or on a small square it swallowed the tap that puts the piece down */
.battle .piece-q::after { inset: -8px 0 0 -8px; }
/* =====================================================================
   THE FIGHT, AFTER THE REPORT (user, 11-13: "Fix everything in the
   report"). Each block names the finding it answers.
   ===================================================================== */
/* ONE PLACE FOR A WORD: every dead tap, every refusal, the meaning of every
   mark. It floats over the page (nothing moves when it comes or goes),
   above a phone's bar and under a desktop's board, and leaves by itself */
.fight-note { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translate(-50%, 8px); z-index: 12;
  width: max-content; max-width: min(92vw, 440px); padding: 9px 14px; border-radius: 12px; background: #1b1233; border: 2px solid var(--accent);
  color: var(--text); font-size: .9rem; font-weight: 700; line-height: 1.3; text-align: center; box-shadow: 0 6px 22px rgba(0,0,0,.65);
  opacity: 0; pointer-events: none; transition: opacity .16s ease, transform .16s ease; }
.fight-note.show { opacity: 1; transform: translate(-50%, 0); }
.fight-note.no { border-color: var(--forced); }
/* a phone: over the bar at the foot, the one strip no tap is ever ABOUT (a
   word must not cover the token or the square it answers); a tap goes
   through it to the bar */
.battle:not(.wide) .fight-note { bottom: calc(7px + env(safe-area-inset-bottom)); min-height: 50px; display: flex; align-items: center; justify-content: center; width: calc(100vw - 16px); max-width: none; }
/* REFUSED: the thing tapped shakes its head */
@keyframes refused { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-4px); } 40% { transform: translateX(4px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
.battle .refused { animation: refused .36s ease-in-out 1 !important; }
.fx-ring.refused { border-radius: 10px; border: 3px solid var(--forced); background: rgba(255,140,30,.16); animation: refused .36s ease-in-out 1; }
@media (prefers-reduced-motion: reduce) { .battle .refused, .fx-ring.refused { animation: none !important; } .fight-note { transition: none; } }
/* the old banner above the header is never shown in a fight */
.battle > #error { display: none !important; }
/* NOTHING MOVES UNDER THE FINGER: a desktop's dock keeps the room of its
   turn ribbon and of its call-out whether or not they speak (picking a
   piece up used to move Undo by 50px) */
.battle.wide .col.dock .readout { display: block !important; min-height: 62px; }
.battle.wide .col.dock .callout { height: 104px; overflow-y: auto; align-items: flex-start; }
.battle.wide .col.dock .callout.none { display: flex; visibility: hidden; }
.battle .pl-kit { min-height: 40px; }
/* HOW TO WIN: on the walk-out card and on their plate */
.walkout .wo-goal { display: inline-flex; align-items: baseline; gap: 8px; margin: 2px 0 8px; padding: 5px 12px; border-radius: 999px; background: rgba(185,140,255,.14); border: 1px solid var(--accent); }
.walkout .wo-goal b { font-size: 1.05rem; color: #e9dcff; }
/* their name takes its second line instead of being cut */
.battle .plate.them .pl-name { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
/* the plate's small line: what is always true does not blink, only whose move it is */
.battle .plate.turn .pl-sub { animation: none; }
.battle .plate.turn .pl-sub .now { display: inline-block; animation: chip-beat 1.1s infinite alternate; }
.battle .plate.them .pl-sub .said { color: #e9dcff; }
.battle .plate .pl-sub .check-tag { display: inline-block; margin-right: 6px; padding: 0 7px; border-radius: 999px; background: var(--check); color: #fff; letter-spacing: .1em; }
.battle .plate.in-check { border-color: var(--check); }
@media (prefers-reduced-motion: reduce) { .battle .plate.turn .pl-sub .now { animation: none; } }
/* Ludivar without a clock: no ring, no number, only his face */
.lclock.still :is(img, :where(ludi-face)) { inset: 3px; width: 42px; height: 42px; }
/* THE LOG: each row is the piece, its squares, what it took */
.sheet .log .mv .sq { font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.sheet .log .mv:hover { background: var(--panel-light); }
.sheet .log .mv { min-height: 30px; }
/* ...and a phone's Log button says what they just did */
.battle .tabs.drawers button.says { display: flex; align-items: center; justify-content: flex-start; gap: 5px; padding: 4px 10px; text-align: left; overflow: hidden; font-size: .85rem; }
.battle .tabs.drawers button.says canvas { width: 22px; height: 22px; flex: none; }
.battle .tabs.drawers button.says .who { color: #ffb3b3; font-weight: 800; }
.battle .tabs.drawers button.says .open { margin-left: auto; padding-left: 8px; font-style: normal; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
/* LABELS A PERSON CAN READ: upright, 12px (they were 10px on their side) */
.battle .stack-group { position: relative; padding: 18px 8px 4px 6px; min-width: 78px; }
.battle .stack-group .lbl { position: absolute; left: 7px; top: 3px; writing-mode: horizontal-tb; transform: none; font-size: 12px; }
.battle .kitcols .kc-lbl, .battle .kitcols .kc-heads span, .battle .handtray .lbl { font-size: 12px; }
.battle .kitcols .kc-lbl { letter-spacing: .04em; }
.battle .plate .fallen .lost i, .battle .stack b, .battle .kitcols .rail.res .stack b { font-size: 12px; }
/* FINGER ROOM, 44px: what is drawn small is still hit large */
.battle .chip-c::after, .battle .stack::after, .battle .kitcols .rail .slot::after, .battle .packbar .pslot::after, .battle .bet-chip::after {
  content: ""; position: absolute; left: calc(50% - 22px); top: calc(50% - 22px); width: 44px; height: 44px; }
/* ...placed by offsets, never by a transform (report 20261129-171434-03c6c8:
   "I can't click his coupons"): a phone's touch targeting took the room where
   it stood BEFORE its translate(-50%, -50%), half a chip to the right, over
   the next chip, so a tap on Fork opened Cavalry Screen beside it, and every
   coupon in a row read its neighbour. In a plate's row a room is also only
   as wide as its chip and its share of the gap: no two overlap. */
.battle .pl-kit .chip-c::after, .battle .pl-kit .stack::after { left: -1px; right: -1px; width: auto; }
.battle .packbar .pslot { position: relative; overflow: visible; }
.callout .item-q { flex: 0 0 44px; width: 44px; height: 44px; margin-left: auto; padding: 0; border-radius: 50%; font-weight: 800; }
.ask .card .demo-view .controls button, .ask .card.explain .controls button { min-height: 44px; min-width: 44px; }
.ask .card.piece-info .tabs button { min-height: 44px; }
.intro-skip { min-height: 44px; min-width: 72px; }
/* THE PIECE CARD FITS THE SCREEN: it hangs 48px from the top, and its limit
   was the whole window less 24 -- the last board of a pawn's Promotes tab
   and Close ran off the foot of a phone. The body scrolls inside; the head,
   the tabs and Close stay put */
.ask > .card.explain.piece-info { max-height: calc(100vh - min(6vh, 48px) - 14px); max-height: calc(100dvh - min(6vh, 48px) - 14px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
@media (max-width: 599px) {
  #app.battle:not(.wide) { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .battle:not(.wide) .toolbar .tabs.drawers button, .battle:not(.wide) .toolbar .buttons.deeds button { min-height: 44px; min-width: 44px; }
  /* a held item is a thumb wide, an empty slot only a mark that there is room */
  .battle .packbar { gap: 4px; }
  .battle .packbar .pslot { width: 36px; height: 36px; }
  .battle .packbar .pslot canvas { width: 28px; height: 28px; }
  .battle .packbar .pslot.empty { width: 16px; height: 26px; border-radius: 6px; }
  .battle:not(.wide) .topbar .title .sub { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
  .battle:not(.wide) .topbar .title { min-width: 56px; }
  /* the call-out never runs under the bar: three lines, the rest is a tap away */
  .battle:not(.wide) .callout { max-height: 92px; overflow: hidden; }
}
/* THE REWARD: what the item does, under its name; going on is a button */
button.pay-item { color: var(--text); font: inherit; cursor: pointer; max-width: 260px; min-height: 44px; }
.coupon-card.pay .pay-item .txt { font-size: .85rem; line-height: 1.3; color: #cfc4e6; font-weight: 500; text-align: center; text-transform: none; letter-spacing: 0; }
.coupon-card.pay .pay-go { display: block; width: 100%; min-height: 46px; margin-top: 12px; font-size: 1.05rem; }
/* "The log speaks chess notation with letters": a move is its picture */
.sheet .log .mv { display: flex; align-items: center; gap: 4px; padding: 2px 4px; border-radius: 8px; cursor: pointer; min-height: 26px; }
.sheet .log .mv.them { background: rgba(226,96,96,.10); padding-left: 22px; }
.sheet .log .mv canvas { width: 22px; height: 22px; flex: none; }
.sheet .log .mv .arrow { font-style: normal; color: var(--dim); font-weight: 800; }
.sheet .log .mv:active { background: var(--panel-light); }
/* "Badges and numbers nobody explains": a tapped piece says what it wears */
.callout .mark { color: var(--text); font-size: var(--fs-s); }
.callout .mark b { color: var(--accent); margin-right: 2px; }
.plate .emblem { cursor: pointer; }
/* "A king-less army has no climax": its last three are counted in red */
.plate .emblem .count.last { background: var(--bad); border-color: #fff; transform: scale(1.25); animation: chip-beat .6s infinite alternate; }
.fx-banner.last b { font-size: clamp(1.8rem, 10vw, 3rem); }
/* "The piece card always has four tabs": the ones that are left are finger-sized */
.piece-info .tabs button { min-height: 40px; }
/* their coupon fires AGAIN: no card, its chip pulses red */
.chip-c.pulse { animation: chip-pulse .55s ease-out 3; }
@keyframes chip-pulse { 0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(230,90,90,.9); } 40% { transform: scale(1.35); box-shadow: 0 0 0 8px rgba(230,90,90,.35); } 100% { transform: scale(1); box-shadow: 0 0 0 12px rgba(230,90,90,0); } }
/* "Ludivar never reacts to how you play": a wince and a smirk beside the jump */
.lclock.wince :is(img, :where(ludi-face)) { animation: l-wince .9s ease-out 1; }
.lclock.smirk :is(img, :where(ludi-face)) { animation: l-smirk .9s ease-out 1; }
@keyframes l-wince { 0% { transform: none; } 18% { transform: scale(.78) translateY(3px); } 34% { transform: scale(.84) translate(-2px, 2px); } 50% { transform: scale(.84) translate(2px, 2px); } 100% { transform: none; } }
@keyframes l-smirk { 0% { transform: none; } 35% { transform: rotate(-12deg) scale(1.12); } 70% { transform: rotate(-8deg) scale(1.08); } 100% { transform: none; } }
/* "The capture clock is never introduced": his one line, once, by his face;
   and the ring beats at two and one */
.topbar { position: relative; }
.clock-say { position: absolute; right: 0; top: calc(100% + 2px); z-index: 7; max-width: 220px; padding: 7px 11px; border-radius: 12px 2px 12px 12px;
  background: #2b2247; border: 2px solid var(--accent); color: var(--text); font-size: var(--fs-s); font-weight: 700; box-shadow: 0 6px 16px rgba(0,0,0,.55);
  animation: fx-pop .35s cubic-bezier(.2,1.6,.4,1); transition: opacity .45s; cursor: pointer; }
.clock-say.out { opacity: 0; }
.lclock.critical .ring { animation: clock-beat .7s ease-in-out infinite alternate; }
@keyframes clock-beat { from { transform: scale(1); } to { transform: scale(1.14); } }
/* "The bet is invisible during the fight it is about": a ticket by the clock */
.topbar .title { flex: 1; min-width: 0; }
.bet-slot { flex: none; margin-right: 12px; display: flex; align-items: center; }
.bet-chip { position: relative; width: 44px; height: 34px; padding: 0; border: 0; background: none; box-shadow: none; color: #efe4ff; cursor: pointer; }
.bet-chip .half { position: absolute; top: 0; bottom: 0; width: 50%; background: linear-gradient(180deg, #7d5bc4, #5b3f99); border: 2px solid #c9b0ff; transition: transform .5s cubic-bezier(.3,1.5,.5,1), opacity .5s, filter .5s; }
.bet-chip .half.a { left: 0; border-right: 0; border-radius: 8px 0 0 8px; }
.bet-chip .half.b { right: 0; border-left: 0; border-radius: 0 8px 8px 0; }
.bet-chip .art { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; transition: opacity .4s; }
.bet-chip .art canvas { width: 24px; height: 24px; }
.bet-chip .aim { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; border: 2px dashed #efe4ff; box-sizing: border-box; }
.bet-chip .n { position: absolute; right: -6px; bottom: -6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; font-size: .68rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center; color: #fff; background: #3a2f63; border: 2px solid var(--panel-edge); font-family: Sans, system-ui, sans-serif; }
.bet-chip.safe .half { border-color: var(--good); }
.bet-chip.safe::after { content: ""; position: absolute; right: -5px; top: -5px; width: 14px; height: 14px; border-radius: 50%; background: var(--good); border: 2px solid #0c0718;
  clip-path: none; }
.bet-chip.torn .half { filter: grayscale(1) brightness(.6); }
.bet-chip.torn .half.a { transform: translateX(-3px) rotate(-11deg); border-right: 2px dashed #8a80a0; }
.bet-chip.torn .half.b { transform: translate(3px, 3px) rotate(9deg); border-left: 2px dashed #8a80a0; }
.bet-chip.torn .art { opacity: .25; }
.bet-chip.tearing { animation: bet-tear .5s ease-out 1; }
@keyframes bet-tear { 0% { transform: scale(1.25); } 30% { transform: scale(1.1) rotate(-6deg); } 60% { transform: rotate(5deg); } 100% { transform: none; } }
.bet-chip.paid .half { background: linear-gradient(180deg, #5a4a1c, #3a2f10); border-color: var(--gold); }
.bet-chip.paid { width: auto; min-width: 44px; }
.bet-chip.paid .art { position: relative; inset: auto; height: 100%; padding: 0 8px; }
.bet-chip.paid .art b { font-size: .8rem; font-weight: 900; color: var(--gold); white-space: nowrap; }
/* "...grows a tray, a turn counter and an item row": the pack is chips on your plate */
.stack-group.pack button.item { padding: 4px 9px; font-size: var(--fs-xs); min-height: 30px; border-radius: 9px; }
.stack-group.pack button.item.on { border-color: var(--accent); color: var(--accent); }
.bet-chip.paying { animation: bet-pay .7s cubic-bezier(.2,1.5,.4,1) 1; }
@keyframes bet-pay { 0% { transform: rotateY(90deg) scale(1.3); } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .chip-c.pulse, .lclock.wince :is(img, :where(ludi-face)), .lclock.smirk :is(img, :where(ludi-face)), .lclock.critical .ring, .clock-say, .bet-chip.tearing, .bet-chip.paying, .plate .emblem .count.last { animation: none !important; }
  .bet-chip .half { transition: none; }
}

/* === THE MARKET AND THE FLOW BETWEEN FIGHTS (user, 11-11: "Fix according to
   their remarks"; docs/GAME_PANEL_2026_11_11.md) ============================ */
/* GOLD IS MONEY AND HIS STAR: what is merely CHOSEN is bright lilac */
.pick.on { border-color: #e9dcff !important; box-shadow: 0 0 0 1px #e9dcff, 0 0 16px rgba(185,140,255,.45), 0 3px 0 #0c0718; }
.pick .check { background: #e9dcff; color: #2a1a4d; }
.sc-chip.on { background: #e9dcff !important; color: #2a1a4d !important; }
.sc-feat.on { border-color: #e9dcff !important; } .sc-feat.on b { color: #e9dcff; }
.sc-row b { color: #e9dcff; } .sc-era { color: #e9dcff; }
.points.warn { border-color: var(--warn); } .points.warn .label, .points.warn .big { color: var(--warn); }
.intro-title { color: #e9dcff; text-shadow: none; } .intro-title.big { text-shadow: 0 0 24px rgba(185,140,255,.7); }
.intro-stage.won .intro-board { box-shadow: 0 0 0 3px var(--accent), 0 0 46px rgba(185,140,255,.6); }
.intro-stage.yours .intro-board { cursor: pointer; }
.promoted { border-color: var(--accent); }
/* HE is on the menu, and larger wherever he speaks */
.menu .logo .crown.host { filter: drop-shadow(0 0 12px rgba(185,140,255,.55)); margin-bottom: -2px; }
.menu .logo .crown.host :is(img, :where(ludi-face)) { width: 52px; height: 52px; display: block; }
@media (min-height: 760px) { .menu .logo .crown.host :is(img, :where(ludi-face)) { width: 96px; height: 96px; } }
@media (max-height: 680px) {
  .menu .logo { flex-direction: row; justify-content: center; gap: 8px; }
  .menu .logo .crown.host { margin: 0; } .menu .logo .crown.host :is(img, :where(ludi-face)) { width: 40px; height: 40px; }
}
.ludivar :is(img, :where(ludi-face)) { width: 72px; height: 72px; }
.bracket .ludivar :is(img, :where(ludi-face)) { width: 88px; height: 88px; }
.over .ludivar :is(img, :where(ludi-face)) { width: 112px; height: 112px; }
.over .ludivar .bubble::before { top: 44px; } .over .ludivar .bubble::after { top: 45px; }
.ludivar .bubble { animation: bubble-pop .28s cubic-bezier(.2, .9, .3, 1.3); transform-origin: left center; }
@keyframes bubble-pop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
/* the game's own question */
.ask.sure { z-index: 60; }
.ask.sure .card { text-align: center; width: min(86vw, 300px); }
.ask.sure .sure-q { font-family: Sans, system-ui, sans-serif; font-weight: 800; font-size: var(--fs-l, 1.15rem); margin: 4px 0 8px; }
.ask.sure .card button { min-height: 46px; }
/* the cups */
.cup { display: inline-flex; line-height: 0; } .cup svg { display: block; }
.cup.ahead { opacity: .22; filter: grayscale(1); } .cup.next { opacity: .5; }
.cup.won { filter: drop-shadow(0 0 8px rgba(185,140,255,.6)); }
.cup-shelf { display: flex; justify-content: center; align-items: flex-end; gap: 10px; margin: 2px 0 6px; }
.cup-path { display: flex; align-items: center; gap: 5px; padding: 4px 0 8px; }
.cup-path .pip { flex: 1; height: 8px; border-radius: 4px; background: var(--panel-deep); border: 1px solid var(--panel-edge); box-sizing: border-box; }
.cup-path .pip.won { background: var(--good); border-color: transparent; }
.cup-path .pip.lost { background: var(--bad); border-color: transparent; }
.cup-path .pip.next { background: #e9dcff; border-color: transparent; box-shadow: 0 0 10px rgba(233,220,255,.7); }
.cup-path .pip.ahead.tier-named { border-color: var(--named); } .cup-path .pip.ahead.tier-champion { border-color: var(--champion); }
.cup-path .cup { flex: none; margin-left: 4px; }
.bracket .road .fixture .rn { width: auto; min-width: 30px; }
.bracket .buttons { align-items: center; } .bracket .buttons .primary { flex: 1; min-height: 48px; }
.bracket .buttons .small { min-height: 44px; }
/* a cup won: it arrives */
.ceremony .cup-stage { position: relative; display: inline-block; }
.ceremony .cup-glow { position: absolute; inset: -30%; border-radius: 50%; z-index: -1; background: radial-gradient(circle, rgba(185,140,255,.5), rgba(185,140,255,0) 65%); }
.ceremony .cup-name { color: #e9dcff; }
.ceremony.arrive .cup { animation: cup-drop .75s cubic-bezier(.3, 1.5, .5, 1) both; }
.ceremony.arrive .cup-glow { animation: cup-glow 1.6s ease-out .4s both; }
.ceremony.arrive .cup-name { animation: bubble-pop .4s ease-out .65s both; }
@keyframes cup-drop { 0% { transform: translateY(-140px) scale(.6) rotate(-14deg); opacity: 0; } 55% { transform: translateY(0) scale(1.12, .9) rotate(3deg); opacity: 1; } 75% { transform: translateY(-10px) scale(.97, 1.04); } 100% { transform: none; } }
@keyframes cup-glow { 0% { transform: scale(.3); opacity: 0; } 30% { transform: scale(1.5); opacity: 1; } 100% { transform: scale(1); opacity: .8; } }
/* losing: what did it, and Again */
.over .killed { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0 0 6px; }
.over .killed .cause { margin: 0; text-align: left; color: var(--text); font-size: var(--fs-s, .9rem); }
.over .killed .tap { flex: none; border-radius: 12px; background: #2a1420; border: 2px solid var(--bad); padding: 2px; line-height: 0; }
.over .chip-row { justify-content: center; }
.over .over-actions { position: sticky; bottom: 0; z-index: 5; margin: 10px -10px 0; padding: 10px 10px calc(10px + env(safe-area-inset-bottom)); flex-wrap: nowrap;
  background: linear-gradient(180deg, rgba(20,13,38,0), rgba(20,13,38,.96) 28%); }
.over .over-actions button { flex: 1; min-height: 52px; font-size: var(--fs-m, 1rem); }
.over .over-actions button.again { flex: 2; font-size: var(--fs-l, 1.15rem); }
/* "No bet" is a whole button at the foot of the bets */
.bet-actions .nobet { flex: 1; min-height: 50px; font-size: var(--fs-m, 1rem); }
/* the shelf gets the screen while you shop: the board folds to a strip */
.arena.phone.shopping > .mstage { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; align-items: center; }
.arena.phone.shopping > .mstage > .plate { grid-column: 1 / -1; }
.arena.phone.shopping > .mstage > .fieldrow { grid-column: 1; margin: 4px 0 0; }
.arena.phone.shopping > .mstage > .strip-side { grid-column: 2; min-width: 0; display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.arena.phone.shopping > .mstage > .strip-side .points { margin: 0; }
.arena.phone.shopping > .mstage > .strip-side .pl-kit { margin: 0; padding: 0; border: 0; overflow-x: auto; flex-wrap: nowrap; }
/* ...and their coupons stay ONE row in it, scrolled sideways: wrapping, eight
   of them in that narrow kit stood one per line, the stage grew 480px tall and
   the shelf was left a sliver with its prices cut off (report
   20261126-161501-d98448, a phone: "Terrible design") */
.arena.phone.shopping > .mstage > .strip-side .pl-kit > .stack-group { flex: none; flex-wrap: nowrap; }
.arena.phone.shopping > .mstage .rails { display: none; }
.arena.phone.shopping > .mstage canvas#deploy { border-radius: 6px; cursor: pointer; box-shadow: 0 0 0 1px var(--panel-edge), 0 3px 0 #0c0718; }
.arena.phone.shopping > .mstage .points .bodies { display: none; }
/* the doors are a thumb tall */
.arena.phone > .dock button { min-height: 44px; position: relative; }
.arena.phone .picked-bar .deeds button { min-height: 40px; padding: 5px 10px; }
.tabs .badge.bench { background: none; border: 1px dashed var(--dim); color: var(--dim); }
.arena .got, .arena.phone > .dock button.got { animation: got .45s ease-out; }
@keyframes got { 0% { transform: scale(1); } 40% { transform: scale(1.14); filter: brightness(1.5); } 100% { transform: scale(1); } }
.buy-ghost { position: fixed; z-index: 55; pointer-events: none; filter: drop-shadow(0 8px 8px rgba(0,0,0,.5)); }
/* a word from the server is a toast, not a row */
.arena.phone > .msg.toast { position: fixed; left: 12px; right: 12px; bottom: calc(78px + env(safe-area-inset-bottom)); z-index: 30; margin: 0; pointer-events: none;
  box-shadow: 0 6px 18px rgba(0,0,0,.6); animation: toast 3.2s ease both; }
@keyframes toast { 0% { transform: translateY(8px); opacity: 0; } 8%, 85% { transform: none; opacity: 1; } 100% { opacity: 0; } }
/* the reroll is a bar, not a button afloat over the tiles */
.reroll-bar { pointer-events: auto; margin: -8px -10px 6px; padding: 6px 10px; background: var(--panel-deep); border-bottom: 1px solid var(--panel-edge); gap: 8px; }
.reroll-bar > button { min-height: 40px; padding: 6px 14px; box-shadow: 0 3px 0 rgba(0,0,0,.45); }
/* a price you cannot pay is dim, not struck (struck read as a sale) */
.tile.shelf.cant .price { text-decoration: none; opacity: .6; }
/* small targets get a thumb's reach without growing the art */
#sfx::after, .piece-q::after { content: ""; position: absolute; inset: -8px; }
.piece-q { overflow: visible; }
@media (prefers-reduced-motion: reduce) {
  .ludivar .bubble, .ceremony.arrive .cup, .ceremony.arrive .cup-glow, .ceremony.arrive .cup-name, .arena .got, .arena.phone > .msg.toast { animation: none !important; }
}
/* their name whole on a phone's market plate ("Juniper Hill Old Gu...", 11-11) */
.arena.phone .plate.them .pl-name { font-size: var(--fs-m, 1rem); white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
/* THE SHOP GETS MORE OF THE SCREEN (user, 11-11, on a phone: "the shop area
   is way too tiny"): while shopping the opponent's plate is one slim line,
   the folded board and the points sit low beside it, Reroll rides in the
   door row, and the shelf takes everything else */
.arena.phone.shopping > .mstage > .strip-side > .plate { padding: 2px 8px; margin: 0; gap: 8px; }
.arena.phone.shopping > .mstage > .strip-side { align-self: stretch; justify-content: space-between; margin-top: 2px; }
.arena.phone.shopping > .mstage .plate .emblem { width: 30px; height: 30px; }
.arena.phone.shopping > .mstage .plate .emblem canvas { width: 28px; height: 28px; }
.arena.phone.shopping > .mstage .plate .emblem .count { min-width: 15px; height: 15px; font-size: .62rem; right: -5px; bottom: -5px; }
.arena.phone.shopping > .mstage .plate .pl-name { font-size: .95rem; }
.arena.phone.shopping > .mstage .plate .pl-sub { display: none; }
.arena.phone.shopping > .mstage > .strip-side .points { padding: 4px 10px; }
.arena.phone.shopping > .mstage > .strip-side .points .big { font-size: 1.35rem; }
.arena.phone.shopping > .mstage > .strip-side .points .label { font-size: .62rem; }
.arena.phone > .dock:has(.dock-reroll) { grid-template-columns: repeat(4, minmax(0, 1fr)) auto; align-items: center; }
.arena.phone > .dock .dock-reroll { display: flex; gap: 4px; }
.arena.phone > .dock .dock-reroll button { min-height: 40px; padding: 4px 9px; font-size: .78rem; white-space: nowrap;
  background: var(--panel-light); border: 1px solid var(--panel-edge); border-radius: 10px; color: var(--text); font-weight: 800; box-shadow: 0 3px 0 rgba(0,0,0,.45); }
.arena.phone > .dock:has(.dock-reroll) button .badge { margin-left: 2px; }
.arena.phone.shopping > .market-actions { padding-top: 6px; padding-bottom: calc(6px + env(safe-area-inset-bottom)); }

/* --- THE MARKET, LESS SAID (user, 11-12: "too much stuff with high priority
   tends to be invisible while other stuff we ignore takes a lot of space") --- */
/* your bet: a gold chip in the top bar, a tap reads it */
.arena .topbar { display: flex; align-items: center; gap: 10px; }
.arena .topbar .title { flex: 1; }
.wager-chip { display: inline-flex; align-items: center; gap: 6px; width: auto; margin: 0; padding: 3px 10px 3px 6px; border-radius: 999px;
  background: linear-gradient(180deg, #4a3577, #33245a); border: 2px solid var(--gold, #f2c14e); color: #f4ecff; font-weight: 700; font-size: .82rem;
  box-shadow: 0 2px 0 #0c0718, 0 0 12px rgba(242,193,78,.25); cursor: pointer; white-space: nowrap; max-width: 46vw; }
.wager-chip .die { font-size: 1rem; line-height: 1; }
.wager-chip .bt { overflow: hidden; text-overflow: ellipsis; }
.wager-chip .gold { color: var(--gold, #f2c14e); }
/* toasts, both layouts: over the screen a moment, then gone */
.arena .toasts { position: fixed; left: 50%; top: 64px; transform: translateX(-50%); z-index: 40; display: flex; flex-direction: column; gap: 8px;
  align-items: center; pointer-events: none; width: min(92vw, 460px); }
.arena .toasts .msg.toast { margin: 0; font-size: .95rem; padding: 9px 16px; border-radius: 10px; border-left: 0; text-align: center;
  background: #2b2050; border: 2px solid var(--accent); box-shadow: 0 8px 22px rgba(0,0,0,.6); animation: toast 3.2s ease both; }
.arena .toasts .msg.toast.paid { border-color: var(--gold, #f2c14e); color: #ffe7a8; }
.arena .toasts .msg.toast.up { border-color: var(--gold, #f2c14e); font-size: 1.05rem; animation-duration: 3.6s; }
.arena .toasts .msg.toast.up .star { color: var(--gold, #f2c14e); display: inline-block; animation: up-star 900ms ease-out both; }
.arena .toasts .msg.toast.up .arrow { color: var(--gold, #f2c14e); }
.arena .toasts .msg.toast.up b { color: #ffe7a8; }
.arena.phone .toasts { top: auto; bottom: calc(78px + env(safe-area-inset-bottom)); }
@keyframes up-star { 0% { transform: scale(0) rotate(-90deg); } 60% { transform: scale(1.5) rotate(10deg); } 100% { transform: scale(1) rotate(0); } }
/* the burst on an upgraded piece: a gold ring opening, a star rising */
.up-burst { position: absolute; z-index: 6; pointer-events: none; }
.up-burst .ring { position: absolute; inset: 0; border-radius: 50%; border: 4px solid var(--gold, #f2c14e); box-shadow: 0 0 18px 6px rgba(242,193,78,.7);
  animation: up-ring 1.1s ease-out both; }
.up-burst .star { position: absolute; left: 0; right: 0; top: 10%; text-align: center; font-style: normal; font-size: 26px; color: var(--gold, #f2c14e);
  text-shadow: 0 0 8px rgba(242,193,78,.9), 0 2px 0 #0c0718; animation: up-rise 1.3s ease-out both; }
@keyframes up-ring { 0% { transform: scale(.4); opacity: 0; } 25% { opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }
@keyframes up-rise { 0% { transform: translateY(10px) scale(.3); opacity: 0; } 30% { transform: translateY(-6px) scale(1.4); opacity: 1; } 100% { transform: translateY(-34px) scale(1); opacity: 0; } }
.army-tray .tile.flash { animation: tile-flash 1.2s ease-out; }
@keyframes tile-flash { 0% { box-shadow: 0 0 0 0 rgba(242,193,78,0); } 30% { box-shadow: 0 0 0 3px var(--gold, #f2c14e), 0 0 18px 6px rgba(242,193,78,.7); transform: scale(1.08); } 100% { box-shadow: 0 0 0 0 rgba(242,193,78,0); transform: none; } }
/* the army as a tray of pieces: the piece, its hearts, its marks -- no words */
.army-head { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.pills { display: inline-flex; gap: 6px; }
.pill { width: auto; margin: 0; padding: 2px 10px; min-height: 0; font-size: .75rem; border-radius: 999px; line-height: 1.5; }
.army-tray { gap: 6px; }
.army-tray .tile.pc { width: 54px; min-width: 0; padding: 4px 2px 3px; position: relative; }
.army-tray .tile.pc .lives { font-size: .55rem; line-height: 1; letter-spacing: -1px; margin-top: 1px; }
.army-tray .tile.pc .n { font-size: .7rem; top: 1px; right: 3px; }
.army-tray .tile.pc .n.rest { left: 3px; right: auto; color: var(--dim); }
.army-tray .tile.pc .n.star { color: var(--gold, #f2c14e); }
/* its points to field, as the board's badge (report 20261123-194541-8fb965) */
.army-tray .tile.pc .cost { position: absolute; left: 1px; top: 27px; font-size: .62rem; font-weight: 800; line-height: 1; padding: 1px 3px; border-radius: 4px; background: rgba(20,20,26,.92); color: var(--accent); border: 1px solid var(--accent); pointer-events: none; }
.army-tray .tile.pc .n.up { color: #0c0718; background: var(--good); border-radius: 50%; width: 15px; height: 15px; line-height: 15px; text-align: center; font-size: .7rem; }
/* the piece in the hand and what it can do */
.picked-bar.none { display: none; }
.picked-bar.hint { background: none; border: 0; box-shadow: none; padding: 2px 0; }
.picked-bar.has { flex-wrap: wrap; }
.picked-bar .deeds { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.picked-bar .deeds button { width: auto; margin: 0; }
.picked-bar .deeds button.up { background: linear-gradient(180deg, #3f8a52, #2c6a3d); border-color: var(--good); color: #fff; }
/* reroll: a small key at the end of the tab row */
.arena .tabs .dock-reroll { display: inline-flex; gap: 6px; margin-left: auto; align-items: center; }
.arena .tabs .dock-reroll button { width: auto; margin: 0; padding: 4px 10px; font-size: .78rem; }
.arena .tabs { display: flex; align-items: center; }
/* your coupons, a column beside the board (theirs ride on their plate) */
.fieldrow .rails.mine-only .rail.theirs { display: none; }
@media (prefers-reduced-motion: reduce) {
  .arena .toasts .msg.toast, .up-burst .ring, .up-burst .star, .army-tray .tile.flash, .arena .toasts .msg.toast.up .star { animation: none !important; }
  .up-burst { display: none; }
}
.wager-chip .die canvas, .wager-chip .die .ic { width: 18px; height: 18px; display: block; }
.fieldrow .rails.mine-only { align-self: flex-start; }
.fieldrow .rails.mine-only .rail.mine { height: auto; }
.arena.phone .topbar .title { font-size: .95rem; }

/* BOTH KITS BESIDE THE BOARD (user, 11-13: "the enemy coupons should be next
   to ours displayed like in gambonanza. same for the reserves"): a desktop's
   two columns, YOU (blue) then THEM (red), coupons on top, reserves under
   them (C().kitColumns); the hands get trays over and under the board */
.fieldrow .rails:has(.kitcols) { align-self: flex-start; overflow-y: auto; overflow-x: hidden; }
.kitcols { display: flex; flex-direction: column; gap: 4px; }
.kitcols .kc-heads, .kitcols .kc-row { display: grid; grid-template-columns: repeat(2, calc(var(--slot) + 8px)); gap: 4px; }
.kitcols .kc-heads span { text-align: center; font-size: var(--fs-xs, 11px); font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.kitcols .kc-heads .mine { color: var(--mine); } .kitcols .kc-heads .theirs { color: var(--theirs); }
.kitcols .kc-lbl { font-style: normal; text-align: center; font-size: .58rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); margin-top: 2px; }
.kitcols .rail { height: auto; min-height: calc(var(--slot) + 8px); }
.kitcols .rail.res { gap: 8px; padding: 6px 0; }
.kitcols .rail.res .stack b { right: -7px; }
.kitcols .rail .slot.boss { box-shadow: 0 0 0 2px var(--gold), 0 0 10px rgba(242,199,92,.5); }
.handtray { display: flex; align-items: center; gap: 8px; height: 40px; margin: 3px 0; padding: 0 10px 0 6px; border-radius: 10px;
  background: rgba(0,0,0,.22); border: 2px solid var(--panel-edge); align-self: flex-start; }
.handtray.mine { border-color: var(--mine); background: #243040; }
.handtray.theirs { border-color: var(--theirs); background: #3a2428; }
.handtray.empty { visibility: hidden; }
.handtray .lbl { font-style: normal; font-size: .58rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.kitcols .rail .slot.pulse { animation: chip-pulse .55s ease-out 3; }
@media (prefers-reduced-motion: reduce) { .kitcols .rail .slot.pulse { animation: none; } }

/* THE SPEAKER IS A BUTTON YOU CAN SEE (user, 11-13: "the options screen on
   top right feels wrong, almost invisible" -- it was a 26x22 pill at 55%
   opacity): a full-strength round button with the panel's edge; in the
   window's top-right corner when the screen has a margin there, else over
   the middle of the top edge, where nothing of a phone's screens sits */
#sfx { opacity: .95; width: 34px; height: 30px; border-radius: 10px; margin-left: -17px; font-size: 16px;
  background: var(--panel); border: 2px solid var(--panel-edge); box-shadow: 0 2px 0 #0c0718, 0 0 10px rgba(185,140,255,.25); }
#sfx svg { width: 20px; height: 20px; }
#sfx.off { opacity: .8; }
#sfx:hover, #sfx:focus-visible { opacity: 1; border-color: var(--accent); }
@media (min-width: 1200px) {
  #sfx { left: auto; right: calc(14px + env(safe-area-inset-right)); top: calc(12px + env(safe-area-inset-top)); margin-left: 0;
    width: 42px; height: 42px; border-radius: 50%; }
  #sfx svg { width: 22px; height: 22px; }
}

/* HE PAYS YOU ON THE FIGHT SCREEN (battle.js payCard, user 11-13): his
   face, his line, your purse counting up as his coins land in it */
.coupon-card.pay { width: min(94vw, 420px); border-color: var(--gold); display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.coupon-card.pay .who { display: flex; gap: 12px; align-items: center; text-align: left; }
.coupon-card.pay .who :is(img, :where(ludi-face)).ludivar { width: 72px; height: 72px; flex: none; animation: pay-pop .45s cubic-bezier(.3,1.6,.5,1) 1; }
.coupon-card.pay .bubble { flex: 1; padding: 10px 12px; border-radius: 12px; background: var(--panel-deep); border: 1px solid var(--panel-edge); font-size: 1.02rem; line-height: 1.35; }
.pay-purse { align-self: center; display: flex; align-items: center; gap: 6px; padding: 6px 16px; border-radius: 999px; background: rgba(0,0,0,.3);
  border: 2px solid var(--gold); color: var(--gold); font-weight: 800; font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.pay-purse .coin-dot, .pay-coin { width: 18px; height: 18px; border-radius: 50%; display: inline-block;
  background: radial-gradient(circle at 35% 30%, #fff3b8 0 18%, #f2c75c 40%, #b8860b 100%); box-shadow: 0 0 0 1px #6b4b07; }
.pay-coin { position: fixed; z-index: 90; pointer-events: none; filter: drop-shadow(0 0 6px rgba(242,199,92,.8)); }
.pay-purse.bump { animation: pay-bump .22s ease-out 1; }
@keyframes pay-bump { 0% { transform: scale(1); } 40% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes pay-pop { from { transform: scale(.4) translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .coupon-card.pay .who :is(img, :where(ludi-face)).ludivar, .pay-purse.bump { animation: none; } }
/* the bet you take: picked, then off to the corner (screens.js betFlies) */
.bet-card.chosen { box-shadow: 0 0 0 3px var(--gold), 0 0 22px rgba(242,199,92,.6); transform: scale(1.04); transition: transform .2s, box-shadow .2s; }
.bet-card.passed { opacity: .35 !important; filter: grayscale(.6) brightness(.6); transition: opacity .25s, filter .25s; }
.bet-ghost { position: fixed; z-index: 80; margin: 0; pointer-events: none; transform-origin: 50% 50%;
  box-shadow: 0 0 0 3px var(--gold), 0 0 22px rgba(242,199,92,.6); }

.tile.shelf .tiny.long { font-size: .6rem; line-height: 1.05; max-height: 3.2em; }

/* THE NEXT FIGHT IS INTRODUCED (screens.js nextFightIntro, user 11-13):
   the bracket with your new step drawing in, then who they are */
.next-intro { position: fixed; inset: 0; z-index: 65; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: radial-gradient(ellipse at 50% 35%, rgba(42,30,80,.97), rgba(12,8,24,.98)); animation: ni-in .25s ease-out 1; cursor: pointer; }
.next-intro.out { opacity: 0; transition: opacity .25s; }
.ni-stage { width: min(900px, 100%); max-height: 100%; overflow: hidden; }
.ni-scene { display: flex; flex-direction: column; gap: 10px; animation: ni-scene .35s ease-out 1; }
.ni-head { font-size: clamp(1.3rem, 4vw, 1.9rem); font-weight: 900; letter-spacing: .06em; color: var(--accent); text-transform: uppercase; }
.ni-scene .chart { max-height: 46vh; }
.ni-skip { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 66; }
.them-scene { align-items: center; text-align: center; gap: 14px; }
.ni-kicker { font-size: .8rem; font-weight: 900; letter-spacing: .3em; color: var(--theirs); }
.ni-who { display: flex; align-items: center; gap: 14px; text-align: left; }
.ni-who canvas { width: 64px; height: 64px; animation: pay-pop .45s cubic-bezier(.3,1.6,.5,1) 1; }
.ni-name { font-size: clamp(1.5rem, 5vw, 2.4rem); font-weight: 900; color: #ffb3b3; line-height: 1.1; }
.ni-tell { font-size: 1.15rem; max-width: 640px; line-height: 1.4; }
.ni-army, .ni-coupons { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; }
.ni-army .stack, .ni-army .stack canvas { width: 34px; height: 34px; }
svg .fresh-road { stroke-dasharray: 240; stroke-dashoffset: 240; animation: ni-draw .7s ease-out .6s forwards; }
svg .fresh-road.late { animation-delay: 1.2s; }
svg .slot-you.fresh-you { animation: ni-glow 1.2s ease-in-out 1.6s 2; }
@keyframes ni-draw { to { stroke-dashoffset: 0; } }
@keyframes ni-glow { 0%, 100% { stroke-width: 2.5; } 50% { stroke-width: 6; filter: drop-shadow(0 0 6px #e9dcff); } }
@keyframes ni-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes ni-scene { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .next-intro, .ni-scene, .ni-who canvas, svg .slot-you.fresh-you { animation: none; }
  svg .fresh-road { animation: none; stroke-dashoffset: 0; }
}

/* THE PACK'S SLOTS in the top bar (C().packBar; user 11-13: "maybe do a sts
   like consumables area?"): a slot an item, an outline where one could go */
.topbar .pack-slot { display: inline-flex; margin: 0 auto 0 14px; }
.packbar { display: inline-flex; gap: 5px; align-items: center; padding: 3px 6px; border-radius: 12px; background: rgba(0,0,0,.25); border: 1px solid var(--panel-edge); }
.packbar .pslot { width: 32px; height: 32px; padding: 0; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  background: var(--panel); border: 2px solid var(--panel-edge); box-shadow: 0 2px 0 #0c0718; cursor: pointer; }
.packbar .pslot canvas { width: 26px; height: 26px; display: block; }
.packbar .pslot.empty { background: rgba(0,0,0,.2); border: 2px dashed rgba(255,255,255,.18); box-shadow: none; cursor: default; }
.packbar .pslot.can { border-color: var(--good); box-shadow: 0 2px 0 #0c0718, 0 0 8px rgba(120,220,130,.45); }
.packbar .pslot.on { border-color: var(--select, var(--gold)); box-shadow: 0 0 0 2px var(--gold), 0 0 12px rgba(242,199,92,.7); }
.packbar .pslot.new { animation: pslot-new .9s cubic-bezier(.3,1.6,.5,1) 1; }
@keyframes pslot-new { 0% { transform: scale(.3); } 60% { transform: scale(1.25); } 100% { transform: none; } }
@media (max-width: 599px) { .packbar { gap: 3px; padding: 2px 4px; } .packbar .pslot { width: 26px; height: 26px; } .packbar .pslot canvas { width: 20px; height: 20px; } .topbar .pack-slot { margin-left: 6px; } }
@media (prefers-reduced-motion: reduce) { .packbar .pslot.new { animation: none; } }
.toolbar .tabs.drawers:empty { display: none; }
.pay-items { display: flex; justify-content: center; gap: 14px; }
.pay-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 12px; border-radius: 12px; background: var(--panel-deep);
  border: 2px solid var(--good); animation: pay-pop .45s cubic-bezier(.3,1.6,.5,1) .3s both; }
.pay-item canvas { width: 48px; height: 48px; }
.pay-item b { font-size: .85rem; }
.pay-fly { position: fixed; z-index: 90; pointer-events: none; transform-origin: 0 0; filter: drop-shadow(0 0 8px rgba(120,220,130,.8)); }
@media (prefers-reduced-motion: reduce) { .pay-item { animation: none; } }
/* a refusal, over every layout (app.js render) */
#error-toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 75;
  width: max-content; max-width: min(92vw, 560px); padding: 10px 14px; border-radius: 12px; background: #3a1e1e; border: 2px solid var(--bad);
  color: #ffdcdc; font-weight: 600; box-shadow: 0 10px 28px rgba(0,0,0,.6); animation: float-in .18s ease-out 1; cursor: pointer; }

/* the "?" on the army tile in your hand: its card, with what you can do (screens.js pieceDeeds) */
.tile.pc { position: relative; }
.tile-q { position: absolute; top: -7px; left: -7px; z-index: 3; width: 24px; height: 24px; padding: 0; border-radius: 50%;
  font: bold 15px/20px sans-serif; text-align: center; color: #140f26; background: #e9dcff; border: 2px solid #0c0718; box-shadow: 0 2px 0 #0c0718; }
.arena.phone .picked-bar.none, .arena .picked-bar.none { display: none; }
@keyframes float-in { from { opacity: 0; transform: translateX(-50%) translateY(-4px); } to { opacity: 1; transform: translateX(-50%); } }

/* CLOSE TO NO SCROLLING (user, 11-13: "The design on phone must make it so
   the head sticks to the top. In fact there should be close to no scrolling
   in the game in general"):
   - a piece's card keeps its head (picture, name, tags) and its foot (the
     buttons) where they are; only the middle scrolls, if anything does */
.ask .card.piece-info { display: flex; flex-direction: column; overflow: hidden; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); }
.ask .card.piece-info > * { flex: none; }
.ask .card.piece-info > .body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
/*   - a phone's bets are two lines each: the feat and its title, the odds */
@media (max-width: 599px) {
  .arena .bet-cards { grid-template-columns: 1fr; gap: 6px; }
  .arena .bet-card { display: grid; grid-template-columns: 1fr auto; column-gap: 10px; row-gap: 2px; align-items: center; padding: 7px 12px 6px; text-align: left; }
  .arena .bet-card .bc-title { grid-column: 1; grid-row: 1; font-size: .98rem; text-align: left; }
  .arena .bet-card .bc-feat { grid-column: 1 / -1; grid-row: 2; font-size: .8rem; text-align: left; }
  .arena .bet-card .bc-odds { grid-column: 2; grid-row: 1; justify-content: flex-end; font-size: .85rem; }
  .arena .bet-card .bc-odds .prize { font-size: 1rem; }
  .arena .bet-card .bc-cant { grid-column: 1 / -1; }
}
body:has(> .ask) #sfx, body:has(> .next-intro) #sfx { display: none; }   /* a card or a scene open: the speaker waits (it sat on the card's head) */
/* the card hangs from the top, so its head stays put as the tabs change its height (11-13) */
.ask:has(> .card.piece-info) { align-items: flex-start; padding-top: calc(min(6vh, 48px) + env(safe-area-inset-top)); }
/* the bracket's key in the market's top bar: lilac, not gold (gold is money) */
.wager-chip.draw-chip { border-color: var(--named, #b9a6ff); box-shadow: 0 2px 0 #0c0718; padding: 3px 10px; }
/* a narrow phone's bar has no room for the shop's sign beside the pack, the
   bracket's key and the purse (it wrapped over the pack): the sign goes */
@media (max-width: 479px) { .arena.phone .topbar .title { display: none; } .arena.phone .topbar .pack-slot { margin-left: 0; } }

/* A PHONE'S MARKET NEVER MOVES (user, 11-13: "I shouldn't be able to do
   that" -- the page could be dragged: the top bar, with the pack's slots
   added, ran 41px past a 412px screen and pushed the purse off it): the
   top bar packs tight -- the bet chip its die and prize, the slots smaller
   -- and the page itself is pinned to the screen; only a pane scrolls */
@media (max-width: 599px) {
  .arena.phone .topbar { flex-wrap: nowrap; gap: 4px; min-width: 0; }
  .arena.phone .topbar > * { flex-shrink: 1; min-width: 0; }
  .arena.phone .topbar .purse { flex: none; white-space: nowrap; }
  .arena.phone .topbar .pack-slot { margin: 0; flex: 0 1 auto; overflow: hidden; }
  .arena.phone .packbar { gap: 2px; padding: 2px 3px; }
  .arena.phone .packbar .pslot { width: 22px; height: 22px; border-radius: 7px; border-width: 1.5px; }
  .arena.phone .packbar .pslot canvas { width: 17px; height: 17px; }
  .arena.phone .wager-chip { padding: 2px 8px 2px 5px; gap: 4px; font-size: .85rem; flex: none; }
  .arena.phone .wager-chip .bt { display: none; }
  .arena.phone .topbar button:not(.wager-chip):not(.pslot) { padding: 4px 9px; font-size: .8rem; flex: none; }
}
html:has(.arena.phone), html:has(.arena.phone) body, html:has(.battle:not(.wide)), html:has(.battle:not(.wide)) body { overflow: hidden; overscroll-behavior: none; }
/* the bet and the draw as SYMBOLS (screens.js betMark, user 11-13); the
   speaker floats over the middle of a phone's top edge, so a phone's top
   bar starts just under it instead of beneath it */
.wager-chip .die svg { display: block; }
.draw-chip { padding: 3px 9px; }
.draw-chip svg { display: block; }
@media (max-width: 599px) { .arena.phone > .topbar, .battle:not(.wide) .topbar { margin-top: 24px; } }

/* --- "FIX EVERYTHING IN THE REPORT" (user, 11-13): the market, the bets, the
   menu, the bracket, the coupon pick, the knock-out ------------------------ */
/* a word over the screen for a moment (app.js pageToast): no row moves for it */
.page-toast { position: fixed; left: 50%; bottom: calc(150px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 76; max-width: min(92vw, 520px);
  padding: 10px 16px; border-radius: 10px; background: var(--panel); border: 2px solid var(--accent); color: var(--text); font-size: .92rem; font-weight: 700;
  text-align: center; box-shadow: 0 8px 24px rgba(0,0,0,.6); animation: toast-in .18s ease-out both; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (prefers-reduced-motion: reduce) { .page-toast { animation: none; } }
#app.crashed { max-width: 420px; margin: 18vh auto 0; text-align: center; padding: 0 16px; }
#app.crashed p { font-size: 1rem; margin-bottom: 14px; }

/* THE PHONE'S MARKET: four named doors at the foot, always four, always there */
.arena.phone > .dock { margin: 4px 0 0; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.arena.phone > .dock button { flex-direction: column; gap: 1px; height: 56px; min-height: 56px; padding: 4px 2px; }
.arena.phone > .dock .dock-word { font-size: .72rem; line-height: 1.15; letter-spacing: .02em; }
.arena.phone > .dock .badge { position: absolute; top: 3px; left: calc(50% + 8px); margin: 0; }
.arena.phone > .dock .bench-note { font-size: .6rem; line-height: 1; color: #e9dcff; border: 1px dashed #b98cff; border-radius: 6px; padding: 1px 4px; white-space: nowrap; }
.arena.phone > .dock button:has(.bench-note) .dock-ic svg { width: 15px; height: 15px; }
.arena.phone > .mpane { padding-top: 4px; }
/* Reroll: the shelf's own bar, stuck to the top of the pane */
.arena.phone .reroll-bar { margin: -8px -10px 6px; padding: 4px 8px; justify-content: flex-end; }
.arena.phone .reroll-bar > button { min-height: 44px; }
/* a desktop's four tabs keep their width when Reroll joins the row */
.market-cols .tabs > button { flex: 0 0 auto; min-width: 96px; }

/* a benched piece says so */
.tile.pc .bench-word { font-size: .56rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; line-height: 1; color: #e9dcff; margin-top: 2px; }
/* the Buy card: it will not fit */
.wont-fit { margin-top: 5px; padding: 5px 9px; border-radius: 7px; border-left: 3px solid var(--accent); background: rgba(185,140,255,.14); color: #f1e6ff; font-weight: 700; }

/* Fight! when the fight cannot start: it looks it, and says why beside it */
.market-actions { align-items: center; }
.market-actions .fight-why { flex: 1 1 0; min-width: 0; text-align: right; font-size: .78rem; font-weight: 700; color: var(--bad); line-height: 1.2;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.market-actions .fight.unready { background: var(--panel-light); background-image: none; color: var(--dim); box-shadow: 0 3px 0 #0c0718; text-shadow: none; }
.market-actions .fight.unready::after { display: none; }

/* HIS BETS: the three cards are the choices, "No bet" the quiet way out */
.bet-card { border-color: #8a5fd6; background: linear-gradient(180deg, #3d2f6c, #2b2150); box-shadow: 0 3px 0 #0c0718, 0 0 16px rgba(185,140,255,.22); }
.bet-card .bc-odds { flex-wrap: wrap; gap: 3px 5px; }
.bet-card .bc-odds .w { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--dim); }
.bet-card .bc-odds .w.gain { color: var(--good); letter-spacing: 0; font-size: .78rem; }
.bet-actions { justify-content: center; }
.bet-actions .nobet.quiet { flex: 0 1 auto; min-width: 180px; min-height: 44px; padding: 8px 28px; font-size: .9rem; opacity: 1;
  background: transparent; background-image: none; color: var(--dim); border-color: var(--panel-edge); box-shadow: none; }
.arena.phone > .bet-actions { padding-top: 6px; padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
/* a desktop: the fight on the left, whole; his ask and the bets beside it */
.market-cols.betting { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.market-cols.betting .bet-cards { grid-template-columns: 1fr; gap: 10px; }
.market-cols.betting .bet-card { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding: 14px 16px; }
.market-cols.betting .bet-card .bc-title { flex: 1 1 auto; }
.market-cols.betting .bet-card .bc-feat { flex: 1 1 100%; order: 3; font-size: .95rem; }
.market-cols.betting .bet-actions { justify-content: flex-end; }
.market-cols.betting .hint { margin-top: 8px; }

/* TOUCH TARGETS on these screens: the picture may stay small, the finger gets 44 px */
@media (pointer: coarse), (max-width: 899px) {
  .arena .army-head { min-height: 44px; }
  .arena .pill { position: relative; }
  .arena .pill::after { content: ""; position: absolute; inset: -9px -3px; }
  .arena.phone .topbar .wager-chip, .arena.phone .topbar .pslot { position: relative; overflow: visible; }
  .arena.phone .topbar .wager-chip::after, .arena.phone .topbar .pslot::after { content: ""; position: absolute; left: -3px; right: -3px; top: -11px; bottom: -11px; }
  .arena.phone .topbar .pack-slot, .arena.phone .topbar .packbar { overflow: visible; }
  .arena .rule button.small, .arena .sheet .rule button { min-height: 44px; padding-left: 14px; padding-right: 14px; }
  .arena .market-actions .more-btn { min-width: 44px; }
  .piece-q::after { inset: -9px; }
}
/* (the doors and Fight! stand the same on every door: one padding, shop or army) */
.arena.phone > .market-actions, .arena.phone.shopping > .market-actions { padding-top: 6px; padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
.arena.phone > .dock { padding: 3px; }
.arena.phone > .dock button { height: 54px; min-height: 54px; overflow: hidden; }
.arena.phone > .dock .bench-note { margin-top: 1px; }
.arena.phone > .dock button:has(.bench-note) .dock-word { font-size: .66rem; }
/* the market's word floats over the pane, clear of the doors under it */
.arena.phone .toasts { bottom: calc(140px + env(safe-area-inset-bottom)); }
/* a phone's bet card: its name, the feat, then what goes down and what comes back */
@media (max-width: 599px) {
  .arena .bet-card .bc-odds { grid-column: 1 / -1; grid-row: 3; justify-content: flex-start; flex-wrap: nowrap; }
}
/* PLACING: their plate and your points share one row, and the board gets the rest */
.arena.phone:not(.shopping) > .mstage:has(> .points) { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); column-gap: 8px; align-items: stretch; }
.arena.phone:not(.shopping) > .mstage:has(> .points) > .plate { grid-column: 1; grid-row: 1; margin-bottom: 0; }
.arena.phone:not(.shopping) > .mstage:has(> .points) > .points { grid-column: 2; grid-row: 1; margin: 4px 0 0; padding: 4px 10px; }
.arena.phone:not(.shopping) > .mstage:has(> .points) > .points .bodies { display: none; }
.arena.phone:not(.shopping) > .mstage:has(> .points) > .fieldrow { grid-column: 1 / -1; grid-row: 2; justify-content: center; }
@media (max-height: 700px) { .arena.phone .picked-bar.hint { display: none; } }
.arena.phone:not(.shopping) > .mstage:has(> .points) { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.arena.phone:not(.shopping) > .mstage:has(> .points) > .plate .pl-name { font-size: .92rem; overflow-wrap: anywhere; }
.arena.phone:not(.shopping) > .mstage:has(> .points) > .points .label { font-size: .5rem; letter-spacing: .04em; }
.arena.phone:not(.shopping) > .mstage:has(> .points) > .points .big { font-size: 1.3rem; }

/* THE BRACKET: the draw is a window that fits; a desktop stands it beside your road */
.chart.windowed { max-height: none; overflow-x: auto; overflow-y: hidden; overscroll-behavior: contain; }
.draw-pager { display: flex; align-items: stretch; gap: 8px; margin: 8px 0 0; }
/* each stepper is ONE pill: chevron, word, chevron (user, 11-14: "the arrows in the brackets page are terribly designed") */
.draw-pager .pg-step { display: flex; align-items: center; height: 44px; border-radius: 22px; background: rgba(255,255,255,.05); border: 1px solid rgba(190,160,255,.28); overflow: hidden; }
.draw-pager .pg-step.rounds { flex: 1; min-width: 0; }
.draw-pager .pg-step.fixtures { flex: none; }
.draw-pager .pg { width: 44px; min-width: 44px; height: 44px; padding: 0; margin: 0; flex: none; display: flex; align-items: center; justify-content: center; background: none; border: 0; border-radius: 0; box-shadow: none; color: var(--accent, #c9a6ff); cursor: pointer; }
.draw-pager .pg:active:not(:disabled) { background: rgba(190,160,255,.18); }
.draw-pager .pg:disabled { opacity: .22; cursor: default; }
.draw-pager .pg-ic { display: flex; }
.draw-pager .pg-word { flex: 1; font-size: .78rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--text, #efe8ff); text-align: center; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.draw-pager .pg-step.fixtures .pg-word { min-width: 3.2em; font-variant-numeric: tabular-nums; }
.tier-badge[title] { cursor: help; }
@media (max-width: 899px) { html:has(#app.bracket), html:has(#app.bracket) body { overscroll-behavior: none; } }
@media (min-width: 900px) {
  #app.bracket.wide { max-width: 1320px; }
  .bracket-cols { display: grid; grid-template-columns: minmax(340px, 420px) minmax(0, 1fr); gap: 22px; align-items: start; }
  .bracket-cols .bcol.right .draw-pager { margin-top: 0; }
  .bracket.wide .ludivar .bubble { font-size: 1rem; }
  .bracket.wide .fixture { font-size: 1.05rem; padding: 8px 6px; }
  .bracket.wide .buttons .primary { flex: 1; min-height: 52px; font-size: 1.05rem; }
}

/* THE COUPON PICK: three tickets, his face, one way out */
.reward.tickets .ludivar { margin: 0 0 8px; align-items: center; }
.reward .lot.ticket { align-items: center; gap: 12px; padding: 10px 12px; }
.reward .lot.ticket .cicon { flex: none; filter: drop-shadow(0 3px 0 rgba(0,0,0,.45)); }
.reward .lot.ticket .tk-body { flex: 1; min-width: 0; }
.reward .lot.ticket .tk-body b { font-size: 1.1rem; }
.reward .lot.ticket .tk-text { font-size: .92rem; line-height: 1.3; color: var(--text); margin-top: 2px; }
.reward .lot .why { min-width: 44px; min-height: 44px; align-self: center; }
.reward .panel.loot { margin: 0 0 8px; padding: 6px 10px; }
.reward .buttons { justify-content: center; }
button.quiet { background: transparent; background-image: none; color: var(--dim); border-color: var(--panel-edge); box-shadow: none; min-height: 44px; padding: 8px 24px; }
@media (max-height: 700px) {
  .reward.tickets h1 { font-size: 1.3rem; margin: 0 0 4px; }
  .reward.tickets .ludivar :is(img, :where(ludi-face)) { width: 40px; height: 40px; }
  .reward .lot.ticket { padding: 6px 10px; margin: 4px 0; }
  .reward .lot.ticket .tk-text { font-size: .82rem; line-height: 1.2; }
  .reward .lot.ticket .tk-body b { font-size: 1rem; }
}
@media (min-width: 900px) {
  #app.reward.tickets { max-width: 760px; }
  .reward .lot.ticket .tk-text { font-size: 1rem; }
}

/* THE KNOCK-OUT: what the run opened is the news; a lost bet is one line */
.over .unlocked-news { margin: 8px 0; padding: 10px 14px; border-radius: 12px; border: 2px solid var(--good); background: rgba(120,220,130,.10); text-align: center; }
.over .unlocked-news .un-head { font-size: .72rem; font-weight: 900; letter-spacing: .14em; color: var(--good); }
.over .unlocked-news .un-what { font-size: 1.15rem; font-weight: 800; color: var(--text); line-height: 1.25; }
.over .bet-lost { text-align: center; margin: 0 0 6px; font-size: .9rem; color: var(--dim); }

/* THE MENU: the premise leads, the rules are the small print; a desktop uses its room */
.menu .motto.premise { display: block; font-size: 1rem; font-weight: 800; color: #e9dcff; letter-spacing: .01em; margin: 2px 0 8px; text-align: center; }
.menu .sc-feat span { font-size: .7rem; font-weight: 500; opacity: .85; }
@media (max-height: 680px) { .menu .motto.premise { font-size: .85rem; margin: 0 0 4px; } }
@media (min-width: 900px) {
  #app.menu { max-width: 820px; }
  #app.menu .motto.premise { font-size: 1.25rem; margin: 4px 0 14px; }
  #app.menu .pick .pk-name { font-size: 1rem; }
  #app.menu .pick-row.factions .pick { min-height: 104px; }
  #app.menu .pick-row.factions .pick canvas { width: 56px !important; height: 56px !important; }
  #app.menu .pick-row.starts .pick { min-height: 104px; }
  #app.menu .pick-row.starts .pick canvas { width: 34px !important; height: 34px !important; }
  #app.menu .sc-feat b { font-size: 1rem; }
  #app.menu .sc-feat span { font-size: .875rem; }
  #app.menu .showcase .sc-name { font-size: 1.5rem; }
  #app.menu .menu-actions button { font-size: 1.05rem; min-height: 56px; }
  #app.menu .menu-actions .cups-pick button { font-size: .95rem; }
  #app.menu .panel.small, #app.menu .panel.small .dim, #app.menu p.small { font-size: .9rem; }
  #app.menu .heat-pick .heat-text span { font-size: .875rem; }
}
@media (max-width: 599px) {
  .draw-pager .pg-word { font-size: .68rem; letter-spacing: 0; }
  .reward.tickets h1 { margin-top: 14px; }
  .page-toast { bottom: auto; top: 44%; }
  .menu .sc-feat { position: relative; }
  .menu .sc-feat::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 44px; transform: translateY(-50%); }
  .tier-badge[title] { position: relative; }
  .tier-badge[title]::after { content: ""; position: absolute; inset: -12px -4px; }
  .bracket .chart.windowed { margin: 4px 0 0; }
  .bracket .draw-pager { margin-top: 4px; }
}
@media (max-width: 380px) { .over h1 { font-size: 2.1rem; } }
@media (max-height: 700px) {
  .arena.phone > .mpane > .ludivar { align-items: center; margin: 2px 0 4px; }
  .arena.phone > .mpane > .ludivar :is(img, :where(ludi-face)) { width: 34px; height: 34px; }
  .arena.phone > .mpane > .ludivar .bubble { padding: 4px 10px; font-size: .78rem; }
  .arena.phone .bet-card { padding: 5px 10px 4px; }
  .arena.phone .reroll-bar { padding: 2px 8px; margin-bottom: 4px; }
}
@media (max-width: 380px) {
  .arena.phone:not(.shopping) > .mstage:has(> .points) { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
  .arena.phone:not(.shopping) > .mstage:has(> .points) > .points .label { display: none; }
}
.market-actions { align-items: stretch; }
.market-actions .fight-why { align-self: center; }
/* where your royal would be safe (screens.js askSafe; user, 11-22) */
.fight-why .safe-hint { color: var(--good); }
@media (max-width: 599px) { .page-toast { top: 30%; } }
/* A PHONE WEIGHING A BET SEES THE BOARD WHOLE (user, 11-14: "Can't see
   pieces on the board well enough. Also, why are there scrollable areas.
   Too many tiny parts"): their plate is one slim row over the board, the
   board is as wide as the phone allows, and each bet is ONE slim row --
   what it asks on the left, one gold key on the right that says the stake
   and the prize -- so the three fit under it and nothing scrolls */
.arena.phone.betting > .mstage { display: block; }
.arena.phone.betting > .mstage > .plate { margin: 0 0 4px; padding: 4px 10px; }
.arena.phone.betting > .mstage > .plate .pl-sub { display: none; }
.arena.phone.betting > .mstage > .fieldrow { justify-content: center; margin: 0; }
.arena.phone.betting > .mpane { overflow: visible; padding-bottom: 0; }
.arena.phone.betting .ludivar { margin: 4px 0; }
.arena.phone.betting .bets-table { margin: 0; }
.arena.phone.betting .bet-cards { gap: 6px; }
.arena.phone.betting .bet-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; row-gap: 0; align-items: center; padding: 5px 8px 5px 12px; }
.arena.phone.betting .bet-card .bc-title { grid-column: 1; grid-row: 1; font-size: .95rem; line-height: 1.15; }
.arena.phone.betting .bet-card .bc-feat { grid-column: 1; grid-row: 2; font-size: .82rem; line-height: 1.2; margin: 0; }
.arena.phone.betting .bet-card .bc-odds { grid-column: 2; grid-row: 1 / span 2; display: flex; flex-direction: column; align-items: stretch; gap: 0; }
.arena.phone.betting .bet-card .bc-odds .w, .arena.phone.betting .bet-card .bc-odds .prize { display: none; }
.arena.phone.betting .bet-card .bc-go { display: flex; flex-direction: column; align-items: center; padding: 3px 10px; border-radius: 10px; line-height: 1.1; }
.bet-card .bc-go small { display: none; }
.arena.phone.betting .bet-card .bc-go small { display: block; font-size: .7rem; font-weight: 700; opacity: .85; }
.arena.phone.betting .bet-card .bc-cant { grid-column: 1 / -1; }
.arena.phone.betting > .mstage .plate .emblem { width: 30px; height: 30px; }
.arena.phone.betting > .mstage .plate .emblem canvas { width: 28px; height: 28px; }
.arena.phone.betting > .mstage .plate .emblem .count { min-width: 15px; height: 15px; font-size: .62rem; right: -5px; bottom: -5px; }
.arena.phone.betting > .bet-actions { padding-top: 4px; padding-bottom: 4px; }
/* the bets say what he asks, so his line gives its row to the board */
.arena.phone.betting > .mpane > .ludivar { display: none; }
/* THEIR COUPONS ARE BIG ENOUGH TO SEE (user, 11-14: "The enemy coupons
   size were the issue"): 24px tickets drawn at 34 overlapped into a smear;
   on the bet screen each is a whole 40px ticket, side by side */
.arena.phone.betting .mstage .plate .pl-kit { gap: 8px; padding-top: 4px; }
.arena.phone.betting .mstage .plate .pl-kit .stack-group { gap: 6px; }
.arena.phone.betting .mstage .plate .pl-kit .chip-c { width: 40px; height: 40px; }
.arena.phone.betting .mstage .plate .pl-kit .chip-c canvas { width: 100% !important; height: 100% !important; }
.arena.phone.betting .mstage .plate .pl-kit .stack, .arena.phone.betting .mstage .plate .pl-kit .stack canvas { width: 34px; height: 34px; }
.arena.phone.betting .mstage .plate .pl-kit .stack b { font-size: .7rem; }

/* A PHONE'S BOARD GETS THE ROOM (user, 11-14: "Board too small"): their
   reserve in the nameplate is one thin row of small tokens under the name,
   not a labelled block -- the block made the plate, and the points beside
   it, twice as tall, and the board paid for it (298px -> 202px) */
@media (max-width: 599px) {
  .arena.phone .mstage .plate .pl-kit { padding-top: 2px; margin-top: 2px; border-top: 0; gap: 4px; }
  .arena.phone .mstage .plate .pl-kit .stack-group { padding: 0; background: none; border: 0; gap: 3px; }
  .arena.phone .mstage .plate .pl-kit .stack-group .lbl { display: none; }
  .arena.phone .mstage .plate .pl-kit .stack, .arena.phone .mstage .plate .pl-kit .stack canvas { width: 22px; height: 22px; }
  .arena.phone .mstage .plate .pl-kit .chip-c { width: 24px; height: 24px; }
  .arena.phone .mstage .plate .pl-kit .stack b { font-size: .55rem; right: -6px; bottom: -5px; }
}
/* ...and seven of your pieces fit one row of the army tray, not six and a
   second row (11-14: the second row came out of the board's height) */
@media (max-width: 599px) {
  .arena.phone .army-tray { gap: 5px; }
  .arena.phone .army-tray .tile.pc { width: 48px; padding: 3px 1px 2px; }
  .arena.phone .army-tray .tile.pc canvas { width: 36px; height: 36px; }
}

/* THE REWARD SCREEN FITS A PHONE (user, 11-14: "I can scroll here,
   everything should fit"): three coupons, the rail of the ones you hold, his
   line and what the fight left -- each a little tighter, so no scrolling */
@media (max-width: 599px) {
  #app.reward h1 { font-size: 1.5rem; margin: 2px 0 4px; }
  #app.reward .ludivar :is(img, :where(ludi-face)) { width: 48px; height: 48px; }
  #app.reward .ludivar .bubble { padding: 7px 10px; font-size: .9rem; }
  #app.reward .loot { padding: 6px 10px; font-size: .82rem; line-height: 1.3; margin: 6px 0; }
  #app.reward .offers { gap: 6px; }
  #app.reward .lot.ticket { padding: 8px 8px; gap: 8px; min-height: 0; }
  #app.reward .lot.ticket .cicon { width: 52px !important; height: 52px !important; flex: none; }
  #app.reward .lot.ticket .tk-body b { font-size: 1rem; }
  #app.reward .lot.ticket .coupon-cat-line { margin: 1px 0 2px; }
  #app.reward .lot.ticket .coupon-cat { font-size: .62rem; padding: 1px 5px; }
  #app.reward .lot.ticket .tk-text { font-size: .8rem; line-height: 1.25; }
  #app.reward .lot.ticket .why { width: 34px; min-width: 34px; padding: 6px 0; flex: none; }
  #app.reward .reward-row .rails .rail { --slot: 30px; }
}

/* THE FIGHT'S NAMEPLATES ON A PHONE, NO EMPTY ROOM (user, 11-14: "the 'the
   small kingdom' and 'you' bubbles are too big and have way too much empty
   space for no reason"). The kit (coupons, reserve, hand) was a row of its
   own under a rule, under a name that left most of its line empty: a plate
   was 135px for a name and one hand token. The kit now sits beside the name
   when it fits and wraps under it only when it does not, with no rule and
   no reserved height. */
.battle:not(.wide) .plate { row-gap: 4px; padding-top: 4px; padding-bottom: 4px; }
.battle:not(.wide) .plate .pl-body { flex: 1 1 110px; }
.battle:not(.wide) .plate .pl-kit { flex: 0 1 auto; margin: 0 0 0 auto; padding: 0; border-top: 0;
  min-height: 0; justify-content: flex-end; }
.battle:not(.wide) .plate .pl-kit .stack-group { padding-top: 16px; padding-bottom: 3px; }

/* ...and with a full kit they still wrapped to three lines (user, 11-14:
   "Why are the 2 player windows this big??" -- six coupons, a reserve and a
   hand made your plate 172px at 412 wide): on a phone the tokens are 26px
   and each group's word sits inline before its tokens, not on a line above
   (12px still, and every token keeps a 44px tap area) */
@media (max-width: 599px) {
  .battle:not(.wide) .plate .pl-kit { gap: 4px; row-gap: 3px; }
  .battle:not(.wide) .plate .pl-kit .stack-group { position: relative; padding: 2px 5px; gap: 3px; align-items: center; }
  /* the group's word, inline before its tokens, at a legible 12px */
  .battle:not(.wide) .plate .pl-kit .stack-group .lbl { position: static; transform: none; writing-mode: horizontal-tb;
    font-size: 12px; letter-spacing: .04em; margin-right: 2px; }
  /* a 26px token keeps a 44px place to tap */
  .battle:not(.wide) .plate .pl-kit .chip-c::after, .battle:not(.wide) .plate .pl-kit .stack::after {
    content: ""; position: absolute; inset: -9px; }
  .battle:not(.wide) .plate .pl-kit .chip-c { width: 26px; height: 26px; }
  .battle:not(.wide) .plate .pl-kit .stack, .battle:not(.wide) .plate .pl-kit .stack canvas { width: 26px; height: 26px; }
  .battle:not(.wide) .plate .pl-kit .stack b, .battle:not(.wide) .plate .pl-kit .chip-c .cnt { font-size: .55rem; right: -6px; bottom: -5px; }
  .battle:not(.wide) .plate .emblem { transform: scale(.85); }
  /* ...and the kit is ONE row under the name, scrolled sideways when it is
     long: ten coupons and a reserve wrapped to three lines, the two plates
     took 283px and the board, which gives way to them (battle.js fit), was
     cut to 304px of a 411px phone (report 20261126-164544-1ff31c: "Make the
     board bigger. Many things are unnecessarily big") */
  .battle:not(.wide) .plate .pl-kit { flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; justify-content: flex-start;
    scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .battle:not(.wide) .plate .pl-kit::-webkit-scrollbar { display: none; }
  .battle:not(.wide) .plate .pl-kit > * { flex: none; }
  .battle:not(.wide) .plate .pl-kit .stack-group { flex-wrap: nowrap; }
  /* ...and a row too long for the plate drops its words so the hand shows
     (battle.js fitKit, report 20261128-093914-ed5c0d: "Can't see my full
     hand"); still too long, it fades at the edge it scrolls past */
  .battle:not(.wide) .plate .pl-kit.tight1 .stack-group.coupons .lbl,
  .battle:not(.wide) .plate .pl-kit.tight2 .stack-group .lbl { display: none; }
  .battle:not(.wide) .plate .pl-kit.tight2 .stack-group { min-width: 0; }
  .battle:not(.wide) .plate .pl-kit.more { -webkit-mask-image: linear-gradient(to right, #000 85%, transparent);
    mask-image: linear-gradient(to right, #000 85%, transparent); }
}

/* FORCED CAPTURE over the board for two seconds (battle.js forcedBanner,
   user 11-14) */
.forced-banner { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 60; pointer-events: none;
  padding: 10px 22px; border-radius: 12px; background: rgba(28,14,4,.88); border: 3px solid var(--forced, #ff8c1e);
  color: var(--forced, #ff8c1e); font-weight: 900; font-size: clamp(1.1rem, 6vw, 1.8rem); letter-spacing: .08em; white-space: nowrap;
  box-shadow: 0 0 24px rgba(255,140,30,.55); animation: forced-banner 2s ease-in-out forwards; }
@keyframes forced-banner { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.7); } 12% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
  20% { transform: translate(-50%, -50%) scale(1); } 85% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .forced-banner { animation: none; } }

/* 11-14, the Krug and Fan reviews */
.bet-card .bc-go { padding: 5px 12px; border-radius: 999px; background: var(--gold); color: #2a1c05; font-weight: 800; font-size: .85rem; white-space: nowrap; box-shadow: 0 2px 0 rgba(0,0,0,.35); }
.bet-card.cant .bc-go { background: var(--panel-edge); color: var(--dim); box-shadow: none; }
.mtabs.dock button.hollow { opacity: .42; }
.packbar.bare .pslot.empty { visibility: hidden; }
.pick-row.factions > .pick:only-child { display: none; }   /* one army to pick is no choice: a first visit shows none (11-14) */

/* 11-14, the re-reviews */
.pack-slot.none .packbar { visibility: hidden; }
/* a newcomer with gold unspent: the shelf breathes until something is bought (the Fan re-review: nothing made the player buy once) */
@keyframes shelf-nudge { 0%, 100% { box-shadow: 0 0 0 0 rgba(242,199,92,0); } 50% { box-shadow: 0 0 0 3px rgba(242,199,92,.55); } }
.arena.first-market.unbought .tile.shelf { animation: shelf-nudge 1.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .arena.first-market.unbought .tile.shelf { animation: none; } }

/* the coupons at work on a piece (11-20): blue yours, red theirs */
.mark.coupon-mine b { color: #3d9bff; }
.mark.coupon-theirs b { color: #ff4d5e; }

/* THE REPORT FLAG (webui/report.js, user 11-21): the speaker's twin, just
   right of it -- over the middle of a phone's top edge, in the corner of a
   wide window; a dot when an answer is waiting under it */
#flag { position: fixed; z-index: 40; top: calc(2px + env(safe-area-inset-top)); left: 50%; margin-left: 23px;
  width: 34px; height: 30px; padding: 0; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  color: var(--text); background: var(--panel); border: 2px solid var(--panel-edge); opacity: .95;
  box-shadow: 0 2px 0 #0c0718, 0 0 10px rgba(185,140,255,.25); }
#flag svg { width: 18px; height: 18px; }
#flag:hover, #flag:focus-visible { opacity: 1; border-color: var(--accent); }
#flag::after { content: ""; position: absolute; inset: -8px; }
#flag.news::before { content: ""; position: absolute; top: -4px; right: -4px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 2px var(--panel), 0 0 8px var(--accent); }
#flag.busy { opacity: .5; pointer-events: none; }
@media (min-width: 1200px) {
  #flag { left: auto; margin-left: 0; right: calc(64px + env(safe-area-inset-right)); top: calc(12px + env(safe-area-inset-top));
    width: 42px; height: 42px; border-radius: 50%; }
  #flag svg { width: 20px; height: 20px; }
}
body:has(> .ask) #flag, body:has(> .next-intro) #flag { display: none; }
.ask.report-card { z-index: 80; }
.ask.report-card .card { width: min(94vw, 440px); }
.ask.report-card h3 { margin: 0 0 8px; }
.ask.report-card .shot { display: block; width: 100%; max-height: 38vh; object-fit: contain; border-radius: 8px; border: 1px solid var(--panel-edge); background: #000; }
.ask.report-card textarea { display: block; width: 100%; box-sizing: border-box; margin-top: 10px; padding: 8px; border-radius: 8px;
  border: 2px solid var(--panel-edge); background: var(--panel-deep); color: var(--text); font: inherit; font-size: 16px; resize: vertical; }
.ask.report-card textarea:focus { outline: none; border-color: var(--accent); }
.ask.report-card .said { min-height: 1.2em; margin-top: 6px; }
.ask.report-card .past h4 { margin: 14px 0 6px; color: var(--dim); font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; }
.ask.report-card .past-row { padding: 8px 0; border-top: 1px solid var(--panel-edge); font-size: .9rem; }
.ask.report-card .past-row .q { color: var(--dim); }
.ask.report-card .past-row .a { margin-top: 3px; }
.ask.report-card .past-row.done .a { color: var(--text); }

/* THREE SAVES (webui/saves.js, user 11-28): the flag's twin, right of it */
#saves { position: fixed; z-index: 40; top: calc(2px + env(safe-area-inset-top)); left: 50%; margin-left: 63px;
  width: 34px; height: 30px; padding: 0; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  color: var(--text); background: var(--panel); border: 2px solid var(--panel-edge); opacity: .95;
  box-shadow: 0 2px 0 #0c0718, 0 0 10px rgba(185,140,255,.25); }
#saves svg { width: 18px; height: 18px; }
#saves:hover, #saves:focus-visible { opacity: 1; border-color: var(--accent); }
#saves::after { content: ""; position: absolute; inset: -6px; }
@media (min-width: 1200px) {
  #saves { left: auto; margin-left: 0; right: calc(114px + env(safe-area-inset-right)); top: calc(12px + env(safe-area-inset-top));
    width: 42px; height: 42px; border-radius: 50%; }
  #saves svg { width: 20px; height: 20px; }
}
body:has(> .ask) #saves, body:has(> .next-intro) #saves { display: none; }
.ask.saves-card { z-index: 80; } .ask.saves-sure { z-index: 85; }
.ask.saves-card .card { width: min(94vw, 460px); }
.ask.saves-card h3 { margin: 0 0 10px; }
.saves-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.save-row { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: rgba(255,255,255,.04); border: 2px solid var(--panel-edge); text-align: left; }
.save-row.on { border-color: var(--accent); }
.save-row.empty { border-style: dashed; }
.save-text { flex: 1; min-width: 0; }
.save-name { font-weight: 800; font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; color: var(--dim); }
.save-row.on .save-name { color: var(--accent); }
.save-what { font-weight: 700; overflow-wrap: anywhere; }
.save-btns { display: flex; gap: 6px; flex-shrink: 0; }
.save-btns button { margin: 0; padding: 8px 12px; min-width: 0; width: auto; }
@media (max-width: 520px) { .save-row { flex-direction: column; align-items: stretch; } .save-btns button { flex: 1; } }
.save-crest { flex-shrink: 0; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; }
.save-crest.plus { border-radius: 50%; border: 2px dashed var(--panel-edge); color: var(--dim); font-size: 1.6rem; font-weight: 800; }
.save-pips { display: flex; gap: 4px; margin: 5px 0 3px; }
.save-pips i { width: 14px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.14); }
.save-pips i.won { background: var(--accent); }
.save-pips i.now { background: #fff; box-shadow: 0 0 6px var(--accent); }
.save-facts { font-size: .78rem; line-height: 1.3; }
.save-btns .bin { padding: 8px 10px; }
@media (max-width: 520px) { .save-row { flex-direction: row; flex-wrap: wrap; align-items: center; } .save-text { flex: 1 1 60%; } .save-btns { flex: 1 1 100%; } .save-btns .bin { flex: 0 0 auto; } }
.saves-strip { display: flex; gap: 6px; width: 100%; max-width: 460px; margin: 4px auto 10px; }
.save-tab { flex: 1; min-width: 0; margin: 0; padding: 6px 4px; display: flex; flex-direction: column; align-items: center; gap: 1px; border-radius: 10px;
  background: var(--panel); border: 2px solid var(--panel-edge); color: var(--text); }
.save-tab b { font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; }
.save-tab span { font-size: .7rem; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; text-transform: capitalize; }
.save-tab.on { border-color: var(--accent); box-shadow: 0 0 10px rgba(185,140,255,.35); }
.save-tab.on b { color: var(--accent); }
.save-tab.empty:not(.on) { border-style: dashed; opacity: .8; }
.ask.saves-card .save-btns .primary { flex: 1 1 auto; width: auto; }
.ask.saves-card .save-btns .bin { flex: 0 0 46px; width: 46px; }

/* THE LIBRARY (user, 11-29: "make a library for all pieces and coupons
   accessible through the menu"; webui/library.js): one tall sheet, its head,
   tabs, search and filter chips fixed, the shelves scrolling under them */
.library-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin: 8px 0 0; padding: 9px 12px; font-size: var(--fs-s, .9rem); color: var(--dim); background: var(--panel-deep); }
.library-btn:hover, .library-btn:focus-visible { color: var(--text); border-color: var(--accent); }
.library-btn svg { flex: none; }
.ask.library { align-items: stretch; padding: calc(10px + env(safe-area-inset-top)) 8px calc(10px + env(safe-area-inset-bottom)); box-sizing: border-box; }
.ask.library > .card { width: min(100%, 720px); max-height: none; margin: 0 auto; display: flex; flex-direction: column; overflow: hidden; padding: 12px; }
.ask.library > .card > * { flex: none; }
.ask.library > .card > .body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin-top: 6px; padding-right: 2px; }
.ask.library .lib-head { display: flex; align-items: center; justify-content: space-between; }
.ask.library .lib-head h2 { letter-spacing: .08em; color: var(--accent); }
.ask.library .card button.lib-x { display: inline-block; width: 44px; height: 40px; margin: 0; padding: 0; }
.ask.library .tabs button { display: inline-block; width: auto; margin: 0; min-height: 44px; }
.ask.library .lib-search { display: block; width: 100%; margin-top: 8px; padding: 9px 12px; font: inherit; color: var(--text); background: var(--panel-deep); border: 2px solid var(--panel-edge); border-radius: 10px; }
.ask.library .lib-search:focus { outline: none; border-color: var(--accent); }
.ask.library .lib-chips { display: flex; gap: 6px; margin-top: 8px; padding-bottom: 4px; overflow-x: auto; scrollbar-width: none; }
.ask.library .lib-chips::-webkit-scrollbar { display: none; }
.ask.library .card .lib-chips button { display: inline-block; flex: none; width: auto; margin: 0; white-space: nowrap; color: var(--dim); background: var(--panel-deep); box-shadow: none; min-height: 34px; }
.ask.library .card .lib-chips button.on { color: var(--text); background: var(--panel-light); border-color: var(--accent); }
.ask.library .lib-group { margin: 12px 0 6px; }
.ask.library .lib-group:first-child { margin-top: 2px; }
.ask.library .lib-none { padding: 24px 0; text-align: center; }
.ask.library .tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; }
.ask.library .tile.lib-piece { width: auto; height: auto; min-height: 84px; padding: 6px 2px 5px; display: flex; flex-direction: column; align-items: center; cursor: pointer; }
.ask.library .tile.lib-piece canvas { width: 44px; height: 44px; }
.ask.library .tile.lib-piece .tiny { text-align: center; line-height: 1.1; margin-top: 3px; font-weight: 700; overflow-wrap: anywhere; }
.ask.library .tile.lib-piece:hover { border-color: var(--accent); }
.ask.library .lib-coupon { align-items: center; padding: 7px 4px 7px 8px; border-left: 3px solid var(--rar, #8f84b3); border-radius: 4px; }
.ask.library .lib-coupon:hover { background: var(--panel-light); }
.ask.library .lib-coupon .cicon { flex: none; }
.ask.library .lib-coupon .txt { font-size: var(--fs-s, .85rem); }
.ask.library .lib-rarity { font-size: var(--fs-xs, .68rem); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--rar, #8f84b3); margin-left: 4px; }
.ask.library .rarity-common { --rar: #8f84b3; } .ask.library .rarity-uncommon { --rar: #5fb37a; }
.ask.library .rarity-rare { --rar: #b98cff; } .ask.library .rarity-legendary { --rar: #f2c75c; }

/* A CHOICE, DRAWN (user, 11-29: "Replace these text windows ... with
   something more visual"): tiles of pictures, a word under each */
.ask.choose { background: rgba(0,0,0,.45); }
.ask .card.choose-card { width: auto; max-width: 94vw; padding: 14px 14px 12px; position: relative; overflow: visible; }
.ask .choices { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.ask .card .choice { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 112px; margin: 0;
  padding: 10px 6px 8px; border-radius: 12px; background: var(--panel-edge); border: 2px solid transparent; }
.ask .card .choice:hover, .ask .card .choice:focus-visible { border-color: var(--accent); }
.ask .card .choice .word { font-weight: bold; font-size: .95rem; line-height: 1.1; }
.ask .card .x-close { position: absolute; top: -12px; right: -12px; width: 32px; height: 32px; margin: 0; padding: 0;
  border-radius: 50%; display: grid; place-items: center; font-size: 1rem; }

/* the catalyst tags, under the board and never on it (user, 11-29) */
.cat-strip { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; min-height: 26px; margin: 6px 0 0; }
/* (line-height: the stage's board slot sets 0 for its canvas, and the tag's
   words rose out of its box, cut in half -- 12-01) */
.cat-strip .fx-tag { position: static; max-width: 100%; line-height: 1.5; align-self: center; }

/* the menu's Library and Discord side by side (user, 11-29) */
.menu-links { display: flex; gap: 8px; margin: 8px 0 0; }
.menu-links .library-btn { flex: 1; margin: 0; width: auto; }
a.library-btn { border: 2px solid var(--panel-edge); border-radius: 10px; font-weight: bold; text-decoration: none; box-sizing: border-box; }
.discord-btn:hover, .discord-btn:focus-visible { color: #fff; border-color: #5865f2; }

/* THE STAGE (user, 11-30: "the game design isn't great now. make it like
   this", a mockup): the battle in three columns -- your turn and your army
   on the left, the fight's name, the board and Ludivar's line in the middle,
   Ludivar (the clock) and their army on the right. webui/battle.js build(). */
#app.battle.stage, #app:has(> .battle.stage) { max-width: none; }
#app.battle.wide.stage { max-width: 1500px; padding: 10px 14px; }
.battle.wide.stage { display: grid; grid-template-columns: minmax(190px, 270px) minmax(0, 1fr) minmax(190px, 270px); grid-template-rows: auto 1fr; gap: 10px 16px; align-items: stretch;
  min-height: calc(100dvh - 20px); background: linear-gradient(180deg, rgba(40,28,78,.55), rgba(20,14,40,.55)); border: 1px solid var(--panel-edge);
  border-radius: 22px; padding: 14px 18px; box-sizing: border-box; }
.battle.wide.stage > .col { min-width: 0; display: flex; flex-direction: column; }
.battle.wide.stage .col.board { align-items: center; }
.battle.wide.stage .stagebar { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; width: 100%; margin: 0; padding: 0 160px 0 0 !important; box-sizing: border-box; padding: 0; background: none; border: 0; box-shadow: none; min-height: 40px; }
.battle.wide.stage .stagebar .crumb { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.battle.wide.stage .stagebar .title { font-family: Display, Georgia, serif; font-weight: 800; font-size: clamp(1.2rem, 2.4vw, 1.9rem); color: var(--gold); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; padding: 0 12px; }
.battle.wide.stage .stagebar .pack-slot:empty, .battle.wide.stage .stagebar .bet-slot:empty { display: none; }
.battle.wide.stage > .col.side, .battle.wide.stage > .col.board { grid-row: 2; }
.battle.wide.stage .stagebar.tier-named .title { color: var(--named); } .battle.wide.stage .stagebar.tier-champion .title { color: var(--champion); }
.battle.wide.stage .stagebar .bar-right { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.battle.wide.stage .stagebar .purse { font-family: Display, Georgia, serif; font-weight: 700; font-size: 1.15rem; color: var(--gold); white-space: nowrap; }
.battle.wide.stage .stagebar .purse::before { content: "\25CF"; font-size: .8em; margin-right: 6px; }
.battle.wide.stage .boardslot { position: relative; padding: 6px; border: 3px solid #c9a35a; border-radius: 12px; background: #1b1336; box-shadow: 0 10px 30px rgba(0,0,0,.45); line-height: 0; }
.battle.wide.stage .quote { margin-top: 10px; font-family: Display, Georgia, serif; font-style: italic; font-size: 1.02rem; color: #efe3c4; text-align: center; min-height: 1.4em; max-width: 90%; }
.battle.wide.stage .quote.fresh { animation: quote-in .5s ease-out 1; }
@keyframes quote-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
/* the left column: whose turn, the tools, your army, and at its foot the history and Undo */
.battle.wide.stage .readout { display: block !important; text-align: center; background: none; border: 0; box-shadow: none; padding: 4px 0 8px; min-height: 0; }
.battle.wide.stage .readout .t { font-family: Display, Georgia, serif; font-weight: 800; font-size: clamp(1.3rem, 2.2vw, 1.9rem); letter-spacing: .02em; color: var(--mine); }
.battle.wide.stage .readout.them .t { color: var(--theirs); }
.battle.wide.stage .readout .t .turn-no { display: block; font-family: Sans, system-ui, sans-serif; font-size: .82rem; font-weight: 600; letter-spacing: 0; color: var(--dim); margin-top: 2px; }
.battle.wide.stage .readout .d { font-size: .82rem; color: var(--dim); margin-top: 4px; }
.battle.wide.stage .st-tools { display: flex; gap: 8px; margin: 2px 0 12px; }
.battle.wide.stage .st-tools button { flex: 1; font-size: .78rem; padding: 7px 4px; font-weight: 600; }
.battle.wide.stage .st-tools button.on { border-color: var(--accent); }
.battle.wide.stage .army-h { font-weight: 800; letter-spacing: .1em; font-size: .95rem; padding-bottom: 6px; border-bottom: 1px solid var(--panel-edge); margin-bottom: 8px; }
.battle.wide.stage .army-h.you { color: var(--mine); } .battle.wide.stage .army-h.them { color: var(--theirs); }
.battle.wide.stage .st-army .ak-h { display: flex; justify-content: space-between; align-items: baseline; font-size: .7rem; letter-spacing: .14em; color: var(--dim); margin: 8px 0 5px; }
.battle.wide.stage .st-army .ak-h b { color: var(--text); letter-spacing: 0; font-weight: 600; }
.battle.wide.stage .st-army .ak-coupons { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
.battle.wide.stage .st-army .ak-coupons .slot { position: relative; aspect-ratio: 1; border-radius: 7px; border: 2px solid var(--panel-edge); background: var(--panel-deep); display: flex; align-items: center; justify-content: center; cursor: pointer; overflow: hidden; }
.battle.wide.stage .st-army .ak-coupons .slot canvas { width: 100%; height: 100%; }
.battle.wide.stage .st-army .ak-coupons .slot.free { border-style: dashed; opacity: .45; cursor: default; }
.battle.wide.stage .st-army .ak-coupons .slot.uncommon { border-color: #5fb37a; } .battle.wide.stage .st-army .ak-coupons .slot.rare { border-color: #b98cff; }
.battle.wide.stage .st-army .ak-coupons .slot.legendary, .battle.wide.stage .st-army .ak-coupons .slot.boss { border-color: var(--gold); }
.battle.wide.stage .st-army .ak-coupons .slot.fired { box-shadow: 0 0 0 2px var(--good), 0 0 12px var(--good); }
.battle.wide.stage .st-army .ak-coupons .slot .cnt { position: absolute; right: 2px; bottom: 1px; font-size: 10px; background: rgba(0,0,0,.6); border-radius: 6px; padding: 0 3px; }
.battle.wide.stage .st-army .ak-tokens { display: flex; flex-wrap: wrap; gap: 5px; padding: 6px; border-radius: 10px; border: 1px solid var(--panel-edge); background: rgba(20,14,40,.55); min-height: 46px; }
.battle.wide.stage .st-army .ak-tokens.hand { border-color: #c9a35a; background: rgba(90,68,32,.25); }
.battle.wide.stage .st-army .ak-tokens .stack { position: relative; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 50%; cursor: pointer; }
.battle.wide.stage .st-army .ak-tokens .stack canvas { width: 34px !important; height: 34px !important; }
.battle.wide.stage .st-army .ak-tokens .stack.on { box-shadow: 0 0 0 3px var(--select); }
.battle.wide.stage .st-army .ak-tokens .stack.off canvas { filter: grayscale(.6) brightness(.75); }
.battle.wide.stage .st-army .ak-tokens .stack b { position: absolute; right: -2px; bottom: -2px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--gold); color: #2a1c0a; font-size: 10px; display: flex; align-items: center; justify-content: center; padding: 0 3px; }
.battle.wide.stage .st-army .ak-none { font-size: .75rem; color: var(--dim); align-self: center; padding-left: 4px; }
.battle.wide.stage .plate { margin: 8px 0 0; padding: 4px 8px; min-height: 0; background: none; border: 0; box-shadow: none; }
.battle.wide.stage .plate .emblem, .battle.wide.stage .plate .pl-name { display: none; }
.battle.wide.stage .plate .pl-sub { font-size: .78rem; }
.battle.wide.stage .plate .pl-kit { display: none !important; }
.battle.wide.stage .callout { margin-top: 8px; height: auto !important; max-height: 120px; overflow-y: auto; }
.battle.wide.stage .callout.none { display: none !important; }
.battle.wide.stage .col.side.mine .toolbar { position: relative; margin-top: auto; padding-top: 10px; background: none; border: 0; box-shadow: none; }
.battle.wide.stage .toolbar .tabs.drawers { background: none; border: 0; padding: 0; justify-content: center; }
.battle.wide.stage .toolbar .linkish { background: none; border: 0; box-shadow: none; color: var(--dim); font-weight: 600; font-size: .85rem; padding: 4px 6px; flex: none; }
.battle.wide.stage .toolbar .linkish:hover, .battle.wide.stage .toolbar .linkish.on { color: var(--text); }
.battle.wide.stage .toolbar .buttons.deeds { justify-content: center; gap: 6px; margin-top: 4px; }
.battle.wide.stage .toolbar .sheet { position: absolute; left: 0; right: 0; bottom: 100%; max-height: 50vh; overflow-y: auto; z-index: 20; background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 12px; padding: 8px; box-shadow: 0 -8px 24px rgba(0,0,0,.5); }
/* the right column: Ludivar, big, with the turns left beside him */
.battle.wide.stage .lud { display: flex; justify-content: center; padding: 6px 0 14px; }
.battle.wide.stage .lclock { width: clamp(110px, 12vw, 170px); height: clamp(110px, 12vw, 170px); }
.battle.wide.stage .lclock :is(img, :where(ludi-face)) { inset: 10%; width: 80%; height: 80%; }
.battle.wide.stage .lclock .ring { width: 100%; height: 100%; }
.battle.wide.stage .lclock .n { right: -18%; top: 30%; bottom: auto; background: none !important; border: 0 !important; box-shadow: none !important; font-family: Display, Georgia, serif; font-size: 2rem; color: var(--gold); height: auto; }
.battle.wide.stage .lclock .n-lbl { position: absolute; right: -22%; top: 62%; font-style: normal; font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); width: 4.5em; text-align: center; line-height: 1.1; }
.battle.wide.stage .clock-say { display: none; }
/* short windows (a phone on its side): everything a size smaller */
@media (max-height: 520px) {
  #app.battle.wide.stage { padding: 4px 6px; }
  .battle.wide.stage { padding: 8px 10px; gap: 10px; border-radius: 14px; grid-template-columns: minmax(150px, 210px) minmax(0, 1fr) minmax(150px, 210px); }
  .battle.wide.stage .stagebar { margin-bottom: 4px; min-height: 28px; }
  .battle.wide.stage .stagebar .crumb { font-size: .62rem; }
  .battle.wide.stage .readout .t { font-size: 1.05rem; } .battle.wide.stage .readout .d { display: none; }
  .battle.wide.stage .st-tools { margin-bottom: 6px; } .battle.wide.stage .st-tools button { padding: 4px 2px; font-size: .68rem; }
  .battle.wide.stage .lclock { width: 84px; height: 84px; } .battle.wide.stage .lclock .n { font-size: 1.4rem; }
  .battle.wide.stage .lud { padding: 0 0 6px; }
  .battle.wide.stage .quote { margin-top: 4px; font-size: .85rem; }
  .battle.wide.stage .st-army .ak-tokens .stack { width: 32px; height: 32px; } .battle.wide.stage .st-army .ak-tokens .stack canvas { width: 28px !important; height: 28px !important; }
}
/* the corner buttons sit top-right over the stage, at every width */
body:has(.battle.stage) #sfx, body:has(.battle.stage) #flag, body:has(.battle.stage) #saves {
  position: fixed; top: calc(8px + env(safe-area-inset-top)); left: auto; bottom: auto; margin: 0; width: 36px; height: 36px; border-radius: 50%; }
body:has(.battle.stage) #sfx { right: calc(12px + env(safe-area-inset-right)); }
body:has(.battle.stage) #flag { right: calc(54px + env(safe-area-inset-right)); }
body:has(.battle.stage) #saves { right: calc(96px + env(safe-area-inset-right)); }
.battle.wide.stage .stagebar { padding-right: 140px !important; }
/* a side column never pushes the page: it scrolls in its own room, the
   history and Undo kept at its foot */
.battle.wide.stage > .col.side { max-height: calc(100dvh - 86px); overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; }
.battle.wide.stage .col.side.mine .toolbar { position: sticky; bottom: 0; background: linear-gradient(180deg, rgba(28,20,54,0), rgba(28,20,54,.95) 30%); }
@media (max-height: 520px) {
  .battle.wide.stage > .col.side { max-height: calc(100dvh - 58px); }
  .battle.wide.stage .stagebar .title { font-size: 1.05rem; }
  .battle.wide.stage .st-army .ak-coupons { gap: 3px; }
  .battle.wide.stage .st-army .ak-h { margin: 4px 0 3px; }
  .battle.wide.stage .army-h { font-size: .8rem; margin-bottom: 4px; padding-bottom: 3px; }
  .battle.wide.stage .st-army .ak-tokens { min-height: 36px; padding: 3px; }
  .battle.wide.stage .plate { margin-top: 2px; padding: 0 4px; } .battle.wide.stage .callout { max-height: 70px; font-size: .78rem; }
  body:has(.battle.stage) #sfx, body:has(.battle.stage) #flag, body:has(.battle.stage) #saves { width: 30px; height: 30px; top: 4px; }
  body:has(.battle.stage) #flag { right: 46px; } body:has(.battle.stage) #saves { right: 80px; }
  .battle.wide.stage .stagebar { padding-right: 116px !important; }
}
.battle.wide.stage > .col.side > * { flex-shrink: 0; }

/* PLAY IT ON ITS SIDE (user, 11-30: "for phones ask the player to play
   horizontally"): a touch screen held upright and too narrow for the stage
   is covered by a card asking to turn it; turned, the card is gone */
#turn-phone { display: none; }
@media (orientation: portrait) and (max-width: 760px) and (pointer: coarse) {
  #turn-phone { display: flex; position: fixed; inset: 0; z-index: 1000; align-items: center; justify-content: center;
    background: radial-gradient(circle at 50% 40%, #2c2152, #120c22 70%); color: var(--text); text-align: center; padding: 24px; }
  #turn-phone .tp-card { display: flex; flex-direction: column; align-items: center; gap: 10px; }
  #turn-phone b { font-family: Display, Georgia, serif; font-size: 1.5rem; color: var(--gold); }
  #turn-phone span { color: var(--dim); }
  #turn-phone .tp-phone { transform-origin: 32px 30px; animation: tp-turn 2.4s ease-in-out infinite; }
  body:has(#turn-phone) #sfx, body:has(#turn-phone) #flag, body:has(#turn-phone) #saves { visibility: hidden; }
}
@keyframes tp-turn { 0%, 30% { transform: rotate(0); } 55%, 85% { transform: rotate(-90deg); } 100% { transform: rotate(0); } }
.battle.wide.stage .col.side.mine .toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; }
.battle.wide.stage .toolbar .buttons.deeds { margin-top: 0; }

/* THE MARKET ON THE STAGE (user, 11-30: "make ludivar's market like this",
   a mockup): the next opponent and the board left, Ludivar and his recruits
   in the middle, the coupons for sale right; your army, coupons, points and
   the arena's door in a band along the foot. webui/screens.js stageMarket */
#app.arena.stage { max-width: 1500px; padding: 10px 14px; display: flex; flex-direction: column; min-height: calc(100dvh - 20px); box-sizing: border-box;
  background: linear-gradient(180deg, rgba(40,28,78,.55), rgba(20,14,40,.55)); border: 1px solid var(--panel-edge); border-radius: 22px; }
.arena.stage .stagebar { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; padding: 0 140px 0 4px !important; margin: 0 0 6px;
  background: none; border: 0; box-shadow: none; min-height: 40px; }
.arena.stage .stagebar .crumb { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arena.stage .stagebar .title { font-family: Display, Georgia, serif; font-weight: 800; font-size: clamp(1.3rem, 2.6vw, 2rem); color: var(--gold); text-transform: none; letter-spacing: 0; text-align: center; }
.arena.stage .stagebar .bar-right { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.arena.stage .stagebar .purse { font-family: Display, Georgia, serif; font-weight: 700; font-size: 1.35rem; color: var(--gold); }
.arena.stage .stagebar .purse::before { content: "\25CF"; font-size: .75em; margin-right: 6px; }
.arena.stage .stagebar .pack-slot.bare { display: none; }
.arena.stage .market-stage { flex: 1; display: grid; grid-template-columns: minmax(200px, 26%) minmax(0, 1fr) minmax(200px, 25%); gap: 18px; align-items: start; min-height: 0; }
.arena.stage .mcol { min-width: 0; display: flex; flex-direction: column; }
.arena.stage .next-h { color: #ff9a9a; font-weight: 800; letter-spacing: .1em; font-size: .9rem; }
.arena.stage .next-name { font-size: 1.05rem; margin: 2px 0 4px; }
.arena.stage .next-name.tier-named { color: var(--named); } .arena.stage .next-name.tier-champion { color: var(--champion); }
.arena.stage .next-tell { font-size: .78rem; color: var(--dim); margin-bottom: 6px; }
.arena.stage .sleft .boardslot { line-height: 0; display: flex; justify-content: center; }
.arena.stage .linkish { background: none; border: 0; box-shadow: none; color: var(--dim); font-weight: 600; font-size: .85rem; padding: 6px; }
.arena.stage .linkish:hover { color: var(--text); }
.arena.stage .smid { align-items: stretch; }
.arena.stage .smid .lud { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-bottom: 8px; }
.arena.stage .smid .lud :is(img, :where(ludi-face)) { width: clamp(70px, 9vw, 120px); height: auto; filter: drop-shadow(0 0 14px rgba(242,199,92,.35)); }
.arena.stage .smid .quote { font-family: Display, Georgia, serif; font-style: italic; color: #efe3c4; text-align: center; font-size: 1rem; max-width: 92%; }
.arena.stage .sec-h { font-size: .74rem; letter-spacing: .14em; color: var(--dim); margin: 8px 0 6px; display: flex; align-items: center; gap: 8px; }
.arena.stage .sec-h.you { color: var(--mine); }
.arena.stage .sec-h .pills { margin-left: auto; display: flex; gap: 6px; }
.arena.stage .recruits { display: flex; gap: 10px; justify-content: space-around; flex-wrap: wrap; padding: 12px 10px; border: 1px solid #6a5a3a; border-radius: 12px; background: rgba(20,14,40,.5); }
.arena.stage .recruit { display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; min-width: 64px; padding: 4px; border-radius: 10px; }
.arena.stage .recruit:hover { background: rgba(255,255,255,.05); }
.arena.stage .recruit .rc-token { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle, rgba(108,176,246,.25), rgba(0,0,0,0) 70%); }
.arena.stage .recruit .rc-token canvas { width: 56px !important; height: 56px !important; }
.arena.stage .recruit .rc-name { font-size: .8rem; text-align: center; max-width: 88px; line-height: 1.1; }
.arena.stage .recruit .rc-price, .arena.stage .fs-price { color: var(--gold); font-weight: 800; font-size: 1rem; }
.arena.stage .recruit.off, .arena.stage .fs-item.off { opacity: .4; }
.arena.stage .recruit.cant .rc-price, .arena.stage .fs-item.cant .fs-price { color: var(--dim); }
.arena.stage .mkeys { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.arena.stage .mkeys button { background: transparent; border: 1px solid #6a5a3a; font-weight: 600; padding: 10px 4px; }
.arena.stage .mkeys button:hover { border-color: var(--gold); }
.arena.stage .mkeys button.dimmed { opacity: .55; }
.arena.stage .mkeys .gamble-on { display: inline-flex; align-items: center; gap: 4px; }
.arena.stage .ransom { margin-top: 8px; }
.arena.stage .forsale { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.arena.stage .fs-item { display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; }
.arena.stage .fs-card { width: 100%; aspect-ratio: 1.08; border-radius: 8px; border: 2px solid #c9a35a; background: linear-gradient(160deg, #3d2f6b, #231848);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 6px; box-sizing: border-box; box-shadow: 0 6px 16px rgba(0,0,0,.4); }
.arena.stage .fs-card.rarity-uncommon { background: linear-gradient(160deg, #2f5a4e, #173229); }
.arena.stage .fs-card.rarity-rare { background: linear-gradient(160deg, #5a3c96, #2c1a55); }
.arena.stage .fs-card.rarity-legendary { background: linear-gradient(160deg, #7a5a2a, #3a2810); border-color: var(--gold); }
.arena.stage .fs-card canvas { width: 52% !important; height: auto !important; aspect-ratio: 1; }
.arena.stage .fs-card .fs-name { font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; text-align: center; line-height: 1.1; color: #f1e9d8; }
.arena.stage .fs-item:hover .fs-card { border-color: var(--gold); transform: translateY(-2px); }
.arena.stage .council .lot { display: flex; gap: 8px; align-items: center; padding: 6px; border-radius: 8px; cursor: pointer; }
.arena.stage .council .lot.on { box-shadow: 0 0 0 2px var(--gold); }
.arena.stage .market-band { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; border-top: 1px solid #8a6f3a; margin-top: 12px; padding-top: 8px; }
.arena.stage .army-tray { display: flex; flex-wrap: wrap; gap: 6px; }
.arena.stage .army-tray .tile.pc { width: 46px; min-height: 46px; height: auto; border-radius: 50%; background: none; border: 0; padding: 0; }
.arena.stage .army-tray .tile.pc.on { box-shadow: 0 0 0 3px var(--select); }
.arena.stage .band-points { margin-top: 8px; color: var(--mine); font-size: .9rem; display: flex; align-items: center; gap: 10px; }
.arena.stage .band-points.bad { color: var(--bad); }
.arena.stage .my-coupons { display: flex; flex-wrap: wrap; gap: 6px; }
.arena.stage .mc-slot { width: 38px; height: 46px; border-radius: 4px; border: 1px solid #c9a35a; display: flex; align-items: center; justify-content: center; cursor: pointer; background: #2a2050; }
.arena.stage .mc-slot.free { border: 1px dashed var(--panel-edge); background: none; cursor: default; }
.arena.stage .mc-slot canvas { width: 34px !important; height: 34px !important; }
.arena.stage .band-go { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.arena.stage .enter { font-family: Display, Georgia, serif; font-weight: 900; font-size: 1.25rem; letter-spacing: .03em; padding: 10px 22px; color: #2a1c0a;
  background: linear-gradient(180deg, #f6d27a, #e2b14e); border: 2px solid #b8883a; border-radius: 10px; box-shadow: 0 4px 0 #8a6224, 0 8px 18px rgba(0,0,0,.4); }
.arena.stage .enter:hover { filter: brightness(1.06); }
.arena.stage .enter.unready { filter: grayscale(.5) brightness(.8); }
.arena.stage .fight-why { font-size: .78rem; color: var(--warn); text-align: right; margin-top: 4px; }
body:has(.arena.stage) #sfx, body:has(.arena.stage) #flag, body:has(.arena.stage) #saves {
  position: fixed; top: calc(8px + env(safe-area-inset-top)); left: auto; bottom: auto; margin: 0; width: 36px; height: 36px; border-radius: 50%; }
body:has(.arena.stage) #sfx { right: calc(12px + env(safe-area-inset-right)); }
body:has(.arena.stage) #flag { right: calc(54px + env(safe-area-inset-right)); }
body:has(.arena.stage) #saves { right: calc(96px + env(safe-area-inset-right)); }
@media (max-height: 520px) {
  #app.arena.stage { padding: 4px 8px; border-radius: 14px; }
  .arena.stage .stagebar { min-height: 28px; margin-bottom: 2px; padding-right: 116px !important; }
  .arena.stage .stagebar .title { font-size: 1.1rem; } .arena.stage .stagebar .purse { font-size: 1rem; }
  .arena.stage .market-stage { gap: 10px; grid-template-columns: minmax(150px, 24%) minmax(0, 1fr) minmax(150px, 24%); }
  .arena.stage .smid .lud { flex-direction: row; margin-bottom: 2px; } .arena.stage .smid .lud :is(img, :where(ludi-face)) { width: 46px; }
  .arena.stage .smid .quote { font-size: .8rem; text-align: left; }
  .arena.stage .sec-h { margin: 3px 0 3px; font-size: .62rem; }
  .arena.stage .recruits { padding: 4px; gap: 4px; } .arena.stage .recruit { min-width: 52px; }
  .arena.stage .recruit .rc-token { width: 42px; height: 42px; } .arena.stage .recruit .rc-token canvas { width: 38px !important; height: 38px !important; }
  .arena.stage .recruit .rc-name { font-size: .64rem; } .arena.stage .recruit .rc-price { font-size: .8rem; }
  .arena.stage .mkeys { margin-top: 6px; gap: 6px; } .arena.stage .mkeys button { padding: 5px 2px; font-size: .74rem; }
  .arena.stage .forsale { gap: 6px; } .arena.stage .fs-card { aspect-ratio: 1.15; } .arena.stage .fs-card canvas { width: 46% !important; }
  .arena.stage .fs-price { font-size: .8rem; }
  .arena.stage .next-h { font-size: .7rem; } .arena.stage .next-name { font-size: .85rem; margin: 0 0 2px; } .arena.stage .next-tell { display: none; }
  .arena.stage .market-band { margin-top: 4px; padding-top: 4px; gap: 10px; }
  .arena.stage .army-tray .tile.pc { width: 34px; min-height: 34px; } .arena.stage .army-tray .tile.pc canvas { width: 30px !important; height: 30px !important; }
  .arena.stage .mc-slot { width: 26px; height: 32px; } .arena.stage .mc-slot canvas { width: 24px !important; height: 24px !important; }
  .arena.stage .enter { font-size: .95rem; padding: 6px 12px; } .arena.stage .band-go { margin-top: 4px; }
  .arena.stage .band-points { margin-top: 3px; font-size: .75rem; }
  .arena.stage .sleft .linkish + .tiny { display: none; }
  body:has(.arena.stage) #sfx, body:has(.arena.stage) #flag, body:has(.arena.stage) #saves { width: 30px; height: 30px; top: 4px; }
  body:has(.arena.stage) #flag { right: 46px; } body:has(.arena.stage) #saves { right: 80px; }
}
@media (max-height: 520px) {
  .arena.stage .market-band .pill, .arena.stage .buy-dp { padding: 2px 8px; font-size: .7rem; min-height: 0; }
  .arena.stage .sleft .linkish { padding: 2px; font-size: .75rem; }
  .arena.stage .band-go button.small { padding: 4px 8px; }
  .arena.stage .army-tray .tile.pc .cost { font-size: 9px; }
}
.arena.stage .market-stage { align-items: center; }
.battle.wide.stage .stagebar .pack-slot:not(:has(.pslot:not(.empty))) { display: none; }

/* THE LOOK (user, 11-30: "aim for an overall design like this", a painted
   mockup -- "it's fully doable in svgs"): deep plum under everything, cream
   for what you read, gold for what you pay and press; chunky cream titles
   with a dark outline, gold ribbon tags, a speech bubble for Ludivar, keys
   with pictures, price tags hung on the coupons, a purple-and-cream board. */
:root { --plum-0: #1e0b29; --plum-1: #2b1238; --plum-2: #3d1a4e; --plum-3: #4f2463; --cream: #f7e8c6; --gold-1: #f4c04a; --gold-2: #d99a2b; --rose: #c58d9c;
  --light-sq: #eedcb3; --dark-sq: #7b5896; --frame: #2a1238; --frame-hi: #4a2360; --frame-lo: #24102f; }
body:has(#app.stage), body:has(.battle.stage) { background: radial-gradient(ellipse at 50% 30%, #4a1f5c 0%, #2e1240 55%, #1c0a26 100%); }
#app.arena.stage, .battle.wide.stage { background: radial-gradient(ellipse at 50% 20%, rgba(92,40,110,.55), rgba(40,16,54,.65) 70%); border: 1px solid rgba(244,192,74,.25); }
.chunky, .arena.stage .hero-title, .battle.wide.stage .stagebar .title, .battle.wide.stage .readout .t {
  font-family: Sans, system-ui, sans-serif; font-weight: 900; text-transform: uppercase; color: var(--cream); letter-spacing: .01em;
  text-shadow: 0 3px 0 #1e0b29, 2px 2px 0 #1e0b29, -2px 2px 0 #1e0b29, 2px -1px 0 #1e0b29, -2px -1px 0 #1e0b29; }
/* gold ribbon tags and lined section heads */
.arena.stage .tag, .battle.wide.stage .army-h { display: inline-block; align-self: flex-start; background: linear-gradient(180deg, #f8cf63, #e0a536); color: #2a1238;
  font-weight: 900; letter-spacing: .12em; padding: 4px 18px; clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 50%, 100% 100%, 0 100%, 10px 50%); border: 0; }
.arena.stage .sec-h { color: var(--cream); font-weight: 800; letter-spacing: .24em; font-size: .78rem; }
.arena.stage .sec-h.center { justify-content: center; }
.arena.stage .sec-h.line::before, .arena.stage .sec-h.line::after { content: ""; flex: 1; height: 2px; background: linear-gradient(90deg, rgba(244,192,74,0), var(--gold-1)); }
.arena.stage .sec-h.line::after { background: linear-gradient(90deg, var(--gold-1), rgba(244,192,74,0)); }
.arena.stage .sec-h.line { justify-content: center; }
/* the title bar */
.arena.stage .stagebar .crumb, .battle.wide.stage .stagebar .crumb { color: #c9a0e6; }
.arena.stage .stagebar .purse, .battle.wide.stage .stagebar .purse { color: var(--gold-1); font-family: Sans, system-ui, sans-serif; font-weight: 900; }
.arena.stage .stagebar .purse::before, .battle.wide.stage .stagebar .purse::before { color: var(--gold-1); }
/* LEFT: the framed opponent panel with its tag */
.arena.stage .sleft.framed { position: relative; border: 2px solid #c9a35a; border-radius: 16px; padding: 22px 12px 10px; background: rgba(30,11,41,.55); margin-top: 16px; }
.arena.stage .sleft.framed .tag { position: absolute; top: -15px; left: 18px; }
.arena.stage .next-name { font-weight: 800; font-size: 1.2rem; color: var(--cream); }
.arena.stage .linkish { display: inline-flex; align-items: center; gap: 6px; color: #e8d6f3; }
.arena.stage .linkish .kicon svg { width: 20px; height: 20px; color: var(--gold-1); }
/* MIDDLE: Ludivar, his rays, the title and his bubble */
.arena.stage .hero { display: flex; align-items: center; justify-content: center; gap: 4px; margin-bottom: 6px; }
.arena.stage .hero-face { position: relative; width: clamp(110px, 13vw, 190px); flex: none; }
.arena.stage .hero-face :is(img, :where(ludi-face)) { position: relative; width: 100%; height: auto; display: block; filter: drop-shadow(0 6px 10px rgba(0,0,0,.45)); }
.arena.stage .hero-face .rays { position: absolute; inset: -14%; }
.arena.stage .hero-face .rays svg { width: 100%; height: 100%; }
.arena.stage .hero-words { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-width: 0; }
.arena.stage .hero-title { font-size: clamp(1.8rem, 3.6vw, 3.4rem); line-height: .92; transform: rotate(-5deg); transform-origin: left center; }
.arena.stage .bubble { position: relative; background: var(--cream); color: #2a1238; font-family: Display, Georgia, serif; font-style: italic; font-weight: 600;
  font-size: clamp(.85rem, 1.25vw, 1.15rem); line-height: 1.2; padding: 10px 18px; max-width: 280px; transform: rotate(-4deg) skewX(-6deg);
  clip-path: polygon(3% 0, 100% 4%, 97% 100%, 0 92%); box-shadow: 0 6px 0 rgba(0,0,0,.25); }
.arena.stage .bubble::before { content: ""; position: absolute; left: -16px; top: 55%; border: 10px solid transparent; border-right: 16px solid var(--cream); }
.arena.stage .stagebar .title:empty { visibility: hidden; }
/* the recruits: big cream tokens, cream names, gold prices */
.arena.stage .recruits { border: 0; background: none; padding: 8px 0; }
.arena.stage .recruit .rc-token { width: 84px; height: 84px; background: none; }
.arena.stage .recruit .rc-token canvas { width: 80px !important; height: 80px !important; filter: drop-shadow(0 4px 6px rgba(0,0,0,.45)); }
.arena.stage .recruit .rc-name { color: var(--cream); font-size: .95rem; font-weight: 600; max-width: 110px; }
.arena.stage .recruit .rc-price { color: var(--gold-1); font-size: 1.35rem; font-weight: 900; text-shadow: 0 2px 0 #1e0b29; }
/* the four keys */
.arena.stage .mkeys button { display: flex; align-items: center; justify-content: center; gap: 8px; background: rgba(79,36,99,.75); border: 2px solid var(--rose);
  border-radius: 10px; color: var(--cream); font-weight: 700; font-size: 1rem; box-shadow: 0 3px 0 rgba(0,0,0,.35); }
.arena.stage .mkeys button:hover { border-color: var(--gold-1); background: rgba(95,44,118,.9); }
.arena.stage .mkeys .kicon { display: inline-flex; color: var(--cream); }
/* RIGHT: coupon cards with their price tags */
.arena.stage .sright { border-left: 2px solid rgba(201,163,90,.55); padding-left: 16px; }
.arena.stage .forsale { row-gap: 26px; }
.arena.stage .fs-card { position: relative; border: 3px solid var(--gold-1); border-radius: 10px; padding: 8px 6px 24px; box-shadow: 0 6px 0 rgba(0,0,0,.3); aspect-ratio: .86; }
.arena.stage .fs-card.rarity-common { background: linear-gradient(170deg, #2f6150, #1b3a30); }
.arena.stage .fs-card.rarity-uncommon { background: linear-gradient(170deg, #284f86, #16294d); }
.arena.stage .fs-card.rarity-rare { background: linear-gradient(170deg, #6a3596, #3b1a5a); }
.arena.stage .fs-card.rarity-legendary { background: linear-gradient(170deg, #8a2333, #4c0f1c); }
.arena.stage .fs-card canvas { width: 66% !important; }
.arena.stage .fs-card .fs-name { font-weight: 900; font-size: .78rem; letter-spacing: .02em; text-shadow: 0 2px 0 rgba(0,0,0,.5); }
.arena.stage .fs-card .fs-price { position: absolute; left: 50%; bottom: -16px; transform: translateX(-50%); background: linear-gradient(180deg, #f8cf63, #e0a536); color: #2a1238;
  font-weight: 900; font-size: 1.05rem; padding: 2px 16px; clip-path: polygon(10% 0, 90% 0, 100% 50%, 90% 100%, 10% 100%, 0 50%); white-space: nowrap; text-shadow: none; }
.arena.stage .fs-item.cant .fs-price { filter: grayscale(.7); }
/* THE BAND: gold rules, cream heads, the gold door */
.arena.stage .market-band { border-top: 2px solid rgba(201,163,90,.6); }
.arena.stage .band-coupons { border-left: 2px solid rgba(201,163,90,.5); padding-left: 16px; }
.arena.stage .sec-h.you { color: var(--cream); letter-spacing: .16em; }
.arena.stage .army-tray .tile.pc canvas { filter: drop-shadow(0 3px 4px rgba(0,0,0,.4)); }
.arena.stage .band-points { color: #e8d6f3; }
.arena.stage .mc-slot { border: 2px solid var(--gold-1); border-radius: 6px; background: var(--plum-3); }
.arena.stage .mc-slot.free { border: 2px dashed rgba(247,232,198,.35); }
.arena.stage .enter { font-family: Sans, system-ui, sans-serif; font-style: italic; font-weight: 900; font-size: 1.5rem; color: #2a1238; letter-spacing: .02em;
  padding: 10px 40px; transform: skewX(-8deg); border-radius: 8px; background: linear-gradient(180deg, #fbd76e, #e6a734); border: 3px solid #b9802a;
  box-shadow: 0 5px 0 #7a4e14, 0 10px 24px rgba(0,0,0,.45); }
.arena.stage .enter:hover { transform: skewX(-8deg) translateY(-1px); }
/* THE BATTLE, in the same hand */
.battle.wide.stage .stagebar .title { font-size: clamp(1.3rem, 2.6vw, 2.2rem); }
.battle.wide.stage .readout .t { color: var(--cream); }
.battle.wide.stage .readout.them .t { color: #ffb3b3; }
.battle.wide.stage .army-h { margin: 6px 0 8px; padding: 4px 18px; font-size: .82rem; }
.battle.wide.stage .army-h.them { align-self: flex-start; background: linear-gradient(180deg, #f39a9a, #d0605f); }
.battle.wide.stage .st-tools button { background: rgba(79,36,99,.75); border: 2px solid var(--rose); color: var(--cream); border-radius: 10px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.battle.wide.stage .st-tools button .kicon svg { width: 18px; height: 18px; }
.battle.wide.stage .st-army .ak-h { color: var(--cream); font-weight: 700; }
.battle.wide.stage .st-army .ak-coupons .slot { border-color: var(--gold-1); background: var(--plum-3); }
.battle.wide.stage .st-army .ak-coupons .slot.free { border-color: rgba(247,232,198,.3); background: none; }
.battle.wide.stage .st-army .ak-tokens { border-color: rgba(201,163,90,.5); background: rgba(30,11,41,.45); }
.battle.wide.stage .boardslot { border-color: var(--gold-1); background: var(--plum-1); }
.battle.wide.stage .quote { position: relative; background: var(--cream); color: #2a1238; font-weight: 600; padding: 6px 18px; transform: rotate(-1.5deg) skewX(-6deg);
  clip-path: polygon(2% 0, 100% 6%, 98% 100%, 0 90%); box-shadow: 0 4px 0 rgba(0,0,0,.25); }
.battle.wide.stage .lclock .n { color: var(--gold-1) !important; font-family: Sans, system-ui, sans-serif; font-weight: 900; text-shadow: 0 2px 0 #1e0b29; }
.battle.wide.stage .toolbar .linkish { color: #e8d6f3; }
@media (max-height: 520px) {
  .arena.stage .hero-face { width: 64px; } .arena.stage .hero-title { font-size: 1.2rem; } .arena.stage .bubble { font-size: .72rem; padding: 4px 10px; }
  .arena.stage .hero-words { gap: 4px; } .arena.stage .hero { margin-bottom: 0; }
  .arena.stage .recruit .rc-token { width: 46px; height: 46px; } .arena.stage .recruit .rc-token canvas { width: 42px !important; height: 42px !important; }
  .arena.stage .recruit .rc-name { font-size: .64rem; } .arena.stage .recruit .rc-price { font-size: .85rem; }
  .arena.stage .mkeys button { font-size: .72rem; gap: 4px; } .arena.stage .mkeys .kicon svg { width: 14px; height: 14px; }
  .arena.stage .forsale { row-gap: 16px; } .arena.stage .fs-card { aspect-ratio: 1.25; padding-bottom: 14px; } .arena.stage .fs-card canvas { width: 40% !important; }
  .arena.stage .fs-card .fs-name { font-size: .58rem; } .arena.stage .fs-card .fs-price { font-size: .75rem; bottom: -11px; padding: 1px 10px; }
  .arena.stage .sleft.framed { padding: 14px 6px 4px; margin-top: 10px; } .arena.stage .tag { font-size: .62rem; padding: 2px 12px; }
  .arena.stage .sleft.framed .tag { top: -10px; }
  .arena.stage .enter { font-size: 1rem; padding: 6px 18px; }
}
@media (max-height: 520px) {
  /* the whole name, on two lines if it must, never cut to "Tallowmere Checkers ..." (report
     20261201-155339-06db84, the designer, 12-01: "Hidden things unnecessarily") */
  .arena.stage .next-name { font-size: .85rem; line-height: 1.1; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .arena.stage .sleft .linkish { white-space: nowrap; font-size: .68rem; }
  .arena.stage .sleft .linkish .kicon svg { width: 14px; height: 14px; }
  .arena.stage .sec-h { letter-spacing: .1em; }
  .arena.stage .recruits { padding: 2px 0; }
  .arena.stage .hero-face { width: 52px; } .arena.stage .hero-title { font-size: 1rem; }
  .arena.stage .market-band .sec-h { margin: 1px 0; }
  .arena.stage .forsale { row-gap: 14px; } .arena.stage .fs-card { aspect-ratio: 1.45; }
}
.battle.wide.stage .army-h.you, .battle.wide.stage .army-h.them { color: #2a1238 !important; text-shadow: none; }
.battle.wide.stage .readout .t .turn-no { text-shadow: none; color: #d9c3ea; }
@media (max-height: 520px) {
  .battle.wide.stage .st-tools .kicon { display: none; }
  .battle.wide.stage .st-tools button { white-space: nowrap; font-size: .66rem; padding: 4px 2px; }
  .battle.wide.stage .army-h { font-size: .66rem; padding: 2px 12px; margin: 2px 0 4px; }
  .battle.wide.stage .readout .t { font-size: 1rem; }
}
.battle.wide.stage .toolbar .tabs.drawers { flex: 0 0 auto; width: auto; margin: 0; }
.battle.wide.stage .toolbar .buttons.deeds { flex: 0 0 auto; width: auto; }
@media (max-height: 520px) {
  .battle.wide.stage .toolbar .linkish { font-size: .72rem; padding: 2px 4px; }
  .battle.wide.stage .toolbar .buttons.deeds button { padding: 3px 8px; font-size: .72rem; min-height: 0; }
  .battle.wide.stage .col.side.mine .toolbar { padding-top: 4px; gap: 4px; }
}

/* THE PRE-FIGHT SCREEN (user, 11-30: "I should go to the pre fight screen
   to see my enemy's stuff and position things"): the battle's three columns
   around the setup board. webui/screens.js prefightStage */
.arena.stage.prefight .stagebar .title { font-family: Sans, system-ui, sans-serif; font-weight: 900; text-transform: uppercase; color: var(--cream);
  text-shadow: 0 3px 0 #1e0b29, 2px 2px 0 #1e0b29, -2px 2px 0 #1e0b29, 2px -1px 0 #1e0b29, -2px -1px 0 #1e0b29; font-size: clamp(1.3rem, 2.6vw, 2.2rem); }
/* (a fodder fight: no name in the bar -- the round reads in full, the bar is
   one slim line and the board takes the height; report 20261201-104200-d03e18) */
.arena.stage.prefight .stagebar.fodder { grid-template-columns: minmax(0, 1fr) auto; min-height: 0; }
.arena.stage.prefight .stagebar.fodder .crumb { overflow: visible; text-overflow: clip; }
.arena.stage .prefight-stage { flex: 1; display: grid; grid-template-columns: minmax(200px, 280px) minmax(0, 1fr) minmax(200px, 280px); gap: 16px; min-height: 0; }
.arena.stage .pcol { min-width: 0; display: flex; flex-direction: column; gap: 6px; max-height: calc(100dvh - 80px); overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; }
.arena.stage .pcol > * { flex-shrink: 0; }
.arena.stage .pcol.mid { align-items: center; overflow: visible; }
.arena.stage .pcol.mid .boardslot { line-height: 0; padding: 6px; border: 3px solid var(--gold-1); border-radius: 12px; background: var(--plum-1); box-shadow: 0 10px 30px rgba(0,0,0,.45); }
.arena.stage .tag.you { background: linear-gradient(180deg, #f8cf63, #e0a536); }
.arena.stage .tag.them { background: linear-gradient(180deg, #f39a9a, #d0605f); }
.arena.stage .pf-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .72rem; letter-spacing: .14em; color: var(--cream); font-weight: 700; margin-top: 4px; }
.arena.stage .pf-h .pills { display: flex; gap: 6px; }
.arena.stage .pf-points .row { display: flex; align-items: baseline; gap: 4px; color: #e8d6f3; font-size: .85rem; }
.arena.stage .pf-points b { font-size: 1.3rem; color: var(--cream); }
.arena.stage .pf-points .carry { color: var(--good); font-weight: 800; } .arena.stage .pf-points .carry.bad, .arena.stage .pf-points.bad b { color: var(--bad); }
.arena.stage .pf-points .bar { height: 8px; border-radius: 4px; background: rgba(0,0,0,.4); overflow: hidden; margin-top: 3px; }
.arena.stage .pf-points .bar .used { height: 100%; background: linear-gradient(90deg, #6cb0f6, #9fd0ff); }
.arena.stage .prefight-stage .army-tray { display: flex; flex-wrap: wrap; gap: 6px; }
.arena.stage .prefight-stage .army-tray .tile.pc { width: 50px; min-height: 50px; height: auto; border-radius: 50%; background: none; border: 0; padding: 0; position: relative; }
.arena.stage .prefight-stage .army-tray .tile.pc.on { box-shadow: 0 0 0 3px var(--select); }
.arena.stage .prefight-stage .ak-coupons { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
.arena.stage .prefight-stage .ak-coupons .slot { aspect-ratio: 1; border-radius: 7px; border: 2px solid var(--gold-1); background: var(--plum-3); display: flex; align-items: center; justify-content: center; cursor: pointer; overflow: hidden; }
.arena.stage .prefight-stage .ak-coupons .slot canvas { width: 100% !important; height: 100% !important; }
.arena.stage .prefight-stage .ak-coupons .slot.free { border: 2px dashed rgba(247,232,198,.3); background: none; cursor: default; }
.arena.stage .prefight-stage .ak-tokens { display: flex; flex-wrap: wrap; gap: 5px; padding: 6px; border-radius: 10px; border: 1px solid rgba(201,163,90,.5); background: rgba(30,11,41,.45); min-height: 44px; }
.arena.stage .prefight-stage .ak-tokens .stack { position: relative; width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.arena.stage .prefight-stage .ak-tokens .stack b { position: absolute; right: -2px; bottom: -2px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--gold-1); color: #2a1c0a; font-size: 10px; display: flex; align-items: center; justify-content: center; padding: 0 3px; }
.arena.stage .prefight-stage .ak-none { font-size: .75rem; color: var(--dim); align-self: center; padding-left: 4px; }
.arena.stage .pf-foot { margin-top: auto; display: flex; gap: 8px; padding-top: 8px; }
.arena.stage .pf-foot .back { flex: 1; background: rgba(79,36,99,.75); border: 2px solid var(--rose); color: var(--cream); border-radius: 10px; }
.arena.stage .pf-hint { font-size: .82rem; color: #e8d6f3; margin-top: 6px; }
.arena.stage .pf-go { margin-top: 8px; }
.arena.stage .pf-lud { display: flex; align-items: center; gap: 8px; }
.arena.stage .pf-lud :is(img, :where(ludi-face)) { width: 72px; height: auto; flex: none; }
.arena.stage .pf-lud .bubble { font-size: .85rem; padding: 6px 12px; max-width: none; transform: rotate(-2deg) skewX(-4deg); }
.arena.stage .pf-lud .bubble::before { left: -14px; }
/* the market's band: bigger army and coupons (user, 11-30: "in the shop you
   should increase the army and coupons sizes") */
.arena.stage .market-band .army-tray .tile.pc { width: 60px; min-height: 60px; }
.arena.stage .market-band .army-tray .tile.pc canvas { width: 52px !important; height: 52px !important; }
.arena.stage .market-band .army-tray { gap: 8px; }
.arena.stage .market-band .mc-slot { width: 52px; height: 64px; border-radius: 8px; }
.arena.stage .market-band .mc-slot canvas { width: 48px !important; height: 48px !important; }
.arena.stage .market-band .my-coupons { gap: 8px; }
.arena.stage .sleft canvas.tap { cursor: pointer; }
@media (max-height: 520px) {
  .arena.stage .prefight-stage { gap: 10px; grid-template-columns: minmax(160px, 220px) minmax(0, 1fr) minmax(160px, 220px); }
  .arena.stage .pcol { max-height: calc(100dvh - 44px); gap: 3px; }
  .arena.stage .prefight-stage .army-tray .tile.pc { width: 36px; min-height: 36px; } .arena.stage .prefight-stage .army-tray .tile.pc canvas { width: 32px !important; height: 32px !important; }
  .arena.stage .prefight-stage .ak-tokens { min-height: 34px; padding: 3px; } .arena.stage .prefight-stage .ak-tokens .stack { width: 32px; height: 32px; }
  .arena.stage .prefight-stage .ak-tokens .stack canvas { width: 30px !important; height: 30px !important; }
  .arena.stage .pf-lud :is(img, :where(ludi-face)) { width: 40px; } .arena.stage .pf-lud .bubble { font-size: .66rem; padding: 3px 8px; }
  .arena.stage .pf-hint { font-size: .66rem; margin-top: 2px; } .arena.stage .pf-go { margin-top: 3px; }
  .arena.stage .pf-points b { font-size: 1rem; } .arena.stage .pf-points .row { font-size: .7rem; }
  .arena.stage .pf-h { font-size: .58rem; margin-top: 2px; } .arena.stage .pf-foot .back, .arena.stage .pf-foot button { padding: 4px 6px; font-size: .7rem; }
  .arena.stage .market-band .army-tray .tile.pc { width: 40px; min-height: 40px; } .arena.stage .market-band .army-tray .tile.pc canvas { width: 36px !important; height: 36px !important; }
  .arena.stage .market-band .mc-slot { width: 32px; height: 40px; } .arena.stage .market-band .mc-slot canvas { width: 30px !important; height: 30px !important; }
}
.arena.stage .market-band .my-coupons { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; max-width: 620px; }
.arena.stage .market-band .mc-slot { width: auto; height: auto; aspect-ratio: .82; }
.arena.stage .market-band .mc-slot canvas { width: 88% !important; height: auto !important; aspect-ratio: 1; }
@media (max-height: 520px) { .arena.stage .market-band .my-coupons { gap: 3px; max-width: 360px; } }

/* THE LOOK, EVERYWHERE (user, 11-30, the bracket on a phone turned on its
   side, still in the old lilac: "Fix all this bullshit with the new design";
   then, of a first pass that only changed the colours: "The design isn't top
   tier like the ones I showed before"). The 11-30 mockup is a COMPOSITION:
   where you are in a quiet bar; Ludivar, big, with gold rays, beside the
   screen's title in chunky tilted cream and his words on a cream banner;
   panels in a gold frame under a ribbon tag; section heads between gold
   rules; cards in their rarity's colour; one gold door for the way on.
   webui/app.js puts ``look`` on every screen drawn in a landscape window
   that does not paint itself (the market, the pre-fight screen and the fight
   do); webui/screens.js builds those screens from hero(), framed(), lined().
   Upright phones keep their own layouts. */
html:has(#app.look) { --panel: #3a174a; --panel-light: #4f2463; --panel-deep: #1e0b29; --panel-edge: rgba(201,163,90,.55); --dim: #c9a0e6; --text: #f7e8c6; }
body:has(#app.look) { background: radial-gradient(ellipse at 50% 30%, #4a1f5c 0%, #2e1240 55%, #1c0a26 100%); }
#app.look { max-width: 1500px; padding: 12px 22px 16px; box-sizing: border-box; min-height: calc(100dvh - 20px); border-radius: 22px; display: flex; flex-direction: column;
  background: radial-gradient(ellipse at 50% 20%, rgba(92,40,110,.55), rgba(40,16,54,.65) 70%); border: 1px solid rgba(244,192,74,.25); }
/* the three corner keys, where the market keeps them */
body:has(#app.look) #sfx, body:has(#app.look) #flag, body:has(#app.look) #saves {
  position: fixed; top: calc(8px + env(safe-area-inset-top)); left: auto; bottom: auto; margin: 0; width: 36px; height: 36px; border-radius: 50%; }
body:has(#app.look) #sfx { right: calc(12px + env(safe-area-inset-right)); }
body:has(#app.look) #flag { right: calc(54px + env(safe-area-inset-right)); }
body:has(#app.look) #saves { right: calc(96px + env(safe-area-inset-right)); }
/* where you are: one quiet line in the corner */
#app.look .lookbar { min-height: 30px; display: flex; align-items: center; padding-right: 150px; }
#app.look .lookbar .crumb { font-size: .8rem; letter-spacing: .2em; text-transform: uppercase; color: #c9a0e6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* titles: chunky cream, a dark outline */
#app.look h1 { font-family: Sans, system-ui, sans-serif; font-weight: 900; text-transform: uppercase; color: var(--cream); letter-spacing: .01em;
  font-size: clamp(1.5rem, 3.4vw, 2.8rem); line-height: 1; margin: 2px 150px 8px; transform: rotate(-1.5deg);
  text-shadow: 0 3px 0 #1e0b29, 2px 2px 0 #1e0b29, -2px 2px 0 #1e0b29, 2px -1px 0 #1e0b29, -2px -1px 0 #1e0b29, 0 6px 0 rgba(0,0,0,.25); }
#app.look h2 { color: var(--cream); }
/* THE HERO: him, his rays, the title tilted beside him, his banner */
#app.look .hero { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 22px 0 8px; }
#app.look .hero-face { position: relative; width: clamp(120px, 13vw, 190px); flex: none; }
#app.look .hero-face :is(img, :where(ludi-face)) { position: relative; width: 100%; height: auto; display: block; filter: drop-shadow(0 8px 10px rgba(0,0,0,.45)); }
#app.look .hero-face .rays { position: absolute; inset: -14%; }
#app.look .hero-face .rays svg { width: 100%; height: 100%; }
#app.look .hero-words { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; min-width: 0; }
#app.look h1.hero-title { margin: 0; text-align: left; font-size: clamp(2rem, 4vw, 3.6rem); line-height: .92; transform: rotate(-5deg); transform-origin: left center; }
#app.look .hero .bubble { position: relative; background: var(--cream); color: #2a1238; font-family: Display, Georgia, serif; font-style: italic; font-weight: 600;
  font-size: clamp(.95rem, 1.35vw, 1.25rem); line-height: 1.2; padding: 10px 22px; max-width: 420px; transform: rotate(-4deg) skewX(-6deg);
  clip-path: polygon(3% 0, 100% 4%, 97% 100%, 0 92%); filter: drop-shadow(0 6px 0 rgba(0,0,0,.25)); border: 0; border-radius: 0; margin-left: 6px; }
#app.look .hero-sub { color: #e8d6f3; font-size: .95rem; margin-left: 6px; }
/* where he still speaks from a strip (the bets, a pick): no round crop, the same banner */
#app.look .ludivar { align-items: center; gap: 16px; margin: 4px 0 10px; }
#app.look .ludivar :is(img, :where(ludi-face)) { width: clamp(64px, 8vw, 110px); height: auto; border-radius: 0; background: none; filter: drop-shadow(0 6px 10px rgba(0,0,0,.45)); flex: none; }
#app.look .ludivar .bubble { flex: 0 1 auto; max-width: 520px; background: var(--cream); color: #2a1238; border: 0; border-radius: 0;
  font-family: Display, Georgia, serif; font-style: italic; font-weight: 600; font-size: clamp(.9rem, 1.25vw, 1.15rem); line-height: 1.2; padding: 10px 20px;
  transform: rotate(-2deg) skewX(-6deg); clip-path: polygon(2% 0, 100% 5%, 98% 100%, 0 92%); filter: drop-shadow(0 6px 0 rgba(0,0,0,.25)); }
#app.look .ludivar .bubble::before, #app.look .ludivar .bubble::after { display: none; }
/* a head between two gold rules; a panel in a gold frame under its ribbon */
#app.look .sec-h { display: flex; align-items: center; gap: 12px; color: var(--cream); font-weight: 800; letter-spacing: .24em; font-size: .8rem; text-transform: uppercase; margin: 10px 0 8px; }
#app.look .sec-h.line { justify-content: center; }
#app.look .sec-h.line::before, #app.look .sec-h.line::after { content: ""; flex: 1; height: 2px; background: linear-gradient(90deg, rgba(244,192,74,0), var(--gold-1)); }
#app.look .sec-h.line::after { background: linear-gradient(90deg, var(--gold-1), rgba(244,192,74,0)); }
#app.look .framed { position: relative; border: 2px solid #c9a35a; border-radius: 16px; padding: 24px 16px 12px; background: rgba(30,11,41,.55); margin-top: 18px; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
#app.look .framed > .tag { position: absolute; top: -15px; left: 18px; display: inline-block; background: linear-gradient(180deg, #f8cf63, #e0a536); color: #2a1238; font-weight: 900; letter-spacing: .12em;
  font-size: .85rem; padding: 4px 20px; clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 50%, 100% 100%, 0 100%, 10px 50%); }
#app.look .framed > .tag.them { background: linear-gradient(180deg, #f39a9a, #d0605f); }
#app.look .framed.them { border-color: #d98a8a; }
#app.look .nx { display: flex; align-items: center; gap: 14px; }
#app.look .nx-token { flex: none; line-height: 0; filter: drop-shadow(0 4px 6px rgba(0,0,0,.45)); }
#app.look .nx-name { font-weight: 800; font-size: 1.45rem; line-height: 1.1; color: var(--cream); }
#app.look .nx.tier-named .nx-name { color: var(--named); } #app.look .nx.tier-champion .nx-name { color: var(--gold-1); }
#app.look .nx-sub { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; color: #c9a0e6; }
#app.look .nx-why { margin-top: 4px; font-size: .85rem; color: #ffb3b3; }
/* the things you pick, the old panels, the plain keys */
#app.look .panel, #app.look .card { background: rgba(30,11,41,.55); border: 2px solid #c9a35a; border-radius: 16px; color: var(--cream); box-shadow: none; }
#app.look .lot, #app.look .bet-card, #app.look .start, #app.look .tile { background: linear-gradient(170deg, #4f2463, #33143f); border: 2px solid #c9a35a; border-radius: 12px; color: var(--cream);
  box-shadow: 0 5px 0 rgba(0,0,0,.3); }
#app.look .lot:hover, #app.look .bet-card:hover { border-color: var(--gold-1); filter: brightness(1.08); }
#app.look .dim { color: #c9a0e6; }
#app.look .gold, #app.look .price { color: var(--gold-1); }
#app.look button:not(.pg):not(.primary):not(.enter) { background: rgba(79,36,99,.75); border: 2px solid var(--rose); color: var(--cream); border-radius: 10px;
  box-shadow: 0 3px 0 rgba(0,0,0,.35); background-image: none; }
#app.look button:not(.pg):not(.primary):not(.enter):hover:not(:disabled) { border-color: var(--gold-1); background: rgba(95,44,118,.9); }
#app.look button.danger { border-color: #d0605f !important; }
#app.look .buttons { background: none; box-shadow: none; border: 0; }
/* THE GOLD DOOR: the one way on */
#app.look button.primary, #app.look button.enter { font-family: Sans, system-ui, sans-serif; font-style: italic; font-weight: 900; font-size: 1.5rem; color: #2a1238; letter-spacing: .02em; text-transform: uppercase;
  padding: 10px 44px; transform: skewX(-8deg); border-radius: 8px; background: linear-gradient(180deg, #fbd76e, #e6a734); border: 3px solid #b9802a;
  box-shadow: 0 5px 0 #7a4e14, 0 10px 24px rgba(0,0,0,.45); text-shadow: 0 1px 0 rgba(255,255,255,.35); }
#app.look .go .enter, #app.look .over-actions button.primary { flex: 0 0 auto; min-width: 240px; }
#app.look button.primary:hover:not(:disabled), #app.look button.enter:hover:not(:disabled) { transform: skewX(-8deg) translateY(-1px); filter: brightness(1.05); }
#app.look button.primary:disabled { filter: grayscale(.5) brightness(.8); }
#app.look .go { display: flex; justify-content: center; margin-top: 20px; }

/* THE BRACKET: who is next and your road, beside the draw */
.bracket.look .bracket-cols { flex: 1; display: grid; grid-template-columns: minmax(340px, 36%) minmax(0, 1fr); gap: 34px; align-items: center; }
.bracket.look .bcol { min-width: 0; }
.bracket.look .bcol.left .hero { justify-content: flex-start; margin-top: 0; }
.bracket.look h1.hero-title { font-size: clamp(1.7rem, 3.1vw, 2.9rem); white-space: nowrap; }
.bracket.look .cup-path { padding: 0; gap: 7px; }
.bracket.look .cup-path .pip { height: 10px; border-radius: 5px; background: rgba(0,0,0,.4); border: 1px solid rgba(201,163,90,.45); }
.bracket.look .cup-path .pip.next { background: var(--gold-1); border-color: transparent; box-shadow: 0 0 12px rgba(244,192,74,.75); }
.bracket.look .cup-path .pip.won { background: var(--good); border-color: transparent; } .bracket.look .cup-path .pip.lost { background: var(--bad); border-color: transparent; }
.bracket.look .framed .sec-h { margin: 14px 0 6px; font-size: .7rem; color: #c9a0e6; }
.bracket.look .cup-shelf { margin: 14px 0 0; gap: 14px; }
.bracket.look .draw-pager { margin: 0 0 8px; }
.bracket.look .draw-pager .pg-step { background: rgba(30,11,41,.55); border: 2px solid rgba(201,163,90,.55); }
.bracket.look .draw-pager .pg-word { color: var(--cream); letter-spacing: .14em; }
.bracket.look .draw-pager .pg { color: var(--gold-1); }
.bracket.look .chart { border: 2px solid #c9a35a; border-radius: 16px; background: rgba(30,11,41,.55); padding: 12px 14px; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.bracket.look .bcol.right > .card { margin: 0 0 8px; }

/* THE REWARDS AND THE PICKS: the offers stand side by side, as cards */
#app.reward.look { max-width: 1180px; }
#app.reward.look .offers { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; margin-top: 6px; width: 100%; align-self: stretch; }
#app.reward.look .sec-h.line { align-self: stretch; }
#app.reward.look .reward-row { align-items: stretch; gap: 16px; }
#app.reward.look .lot { margin: 0; cursor: pointer; }
#app.reward.look .lot.ticket { flex-direction: column; align-items: center; text-align: center; padding: 18px 14px 14px; position: relative; border: 3px solid var(--gold-1); border-radius: 12px;
  box-shadow: 0 6px 0 rgba(0,0,0,.3); background: linear-gradient(170deg, #2f6150, #1b3a30); }
#app.reward.look .lot.ticket.rarity-uncommon { background: linear-gradient(170deg, #284f86, #16294d); }
#app.reward.look .lot.ticket.rarity-rare { background: linear-gradient(170deg, #6a3596, #3b1a5a); }
#app.reward.look .lot.ticket.rarity-legendary { background: linear-gradient(170deg, #8a2333, #4c0f1c); }
#app.reward.look .lot.ticket:hover { transform: translateY(-3px); filter: brightness(1.08); }
#app.reward.look .lot.ticket > canvas { filter: drop-shadow(0 4px 6px rgba(0,0,0,.45)); }
#app.reward.look .lot.ticket .tk-body { color: #f1e9d8; font-size: .95rem; line-height: 1.3; }
#app.reward.look .lot.ticket .tk-body b { display: block; font-weight: 900; text-transform: uppercase; letter-spacing: .03em; font-size: 1.15rem; color: var(--cream); text-shadow: 0 2px 0 rgba(0,0,0,.5); margin: 6px 0 4px; }
/* (report 20261201-153920-36c3c9, the designer, 12-01: "Ugly. Not game of the year level at all" -- the "?" kept the
   44px min-width of the old list rows, so on the cards it was a stretched oval: it is a round chip; and in a short
   window the coupon's ticket was a 44px stamp lost on its card, so it takes the height the screen has to spare) */
/* (report 20261201-235826-ef97b0, the designer, 12-01: "Doesn't fit the screen" -- "SHOGI: THE HAND · DIVERSITY" ran
   past both edges of its card: a long category tag wraps inside the card) */
#app.reward.look .lot.ticket .coupon-cat { max-width: 100%; white-space: normal; text-align: center; }
#app.reward.look .lot.ticket .why { position: absolute; top: 8px; right: 8px; border-radius: 50% !important; width: 30px; height: 30px; padding: 0; min-height: 0; min-width: 0; }
#app.reward.look .offers.lots .lot { flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: center; text-align: center; padding: 22px 14px 16px; gap: 6px 4px; position: relative;
  border: 3px solid var(--gold-1); border-radius: 12px; background: linear-gradient(170deg, #284f86, #16294d); box-shadow: 0 6px 0 rgba(0,0,0,.3); }
#app.reward.look .offers.lots .lot:hover { transform: translateY(-3px); }
#app.reward.look .offers.lots .lot > canvas { width: 72px !important; height: 72px !important; filter: drop-shadow(0 4px 6px rgba(0,0,0,.45)); }
#app.reward.look .offers.lots .lot > div { flex: 0 0 100%; color: #f1e9d8; }
#app.reward.look .offers.lots .lot > div b { display: block; font-weight: 900; text-transform: uppercase; letter-spacing: .03em; font-size: 1.15rem; color: var(--cream); text-shadow: 0 2px 0 rgba(0,0,0,.5); }
#app.reward.look .offers.lots .lot > div .dim { color: #e8d6f3; font-size: .95rem; }
#app.reward.look .offers.lots .lot .why { position: absolute; top: 8px; right: 8px; border-radius: 50%; width: 30px; height: 30px; padding: 0; min-height: 0; min-width: 0; }
#app.reward.look .buttons { justify-content: center; margin-top: 18px; gap: 10px; }
#app.reward.look .panel.loot { text-align: center; border-width: 1px; }

/* THE END OF A RUN */
#app.over.look { max-width: 1180px; }
#app.over.look .framed.killer { align-self: center; min-width: 320px; }
#app.over.look .scoreboard { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
#app.over.look .scoreboard .stat { background: rgba(30,11,41,.55); border: 2px solid #c9a35a; border-radius: 14px; min-width: 150px; box-shadow: none; }
#app.over.look .scoreboard .stat .n { color: var(--gold-1); font-weight: 900; font-size: 2.2rem; text-shadow: 0 3px 0 #1e0b29; }
#app.over.look .scoreboard .stat .l { color: var(--cream); letter-spacing: .18em; }
#app.over.look .over-actions { justify-content: center; align-items: center; gap: 18px; margin-top: 22px; position: static; }
#app.over.look .over-actions button:not(.primary) { flex: 0 0 auto; padding: 10px 26px; }
#app.over.look .unlocked-news { align-self: center; min-width: 50%; }
#app.over.look > .small.good { text-align: center; color: var(--gold-1); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
#app.over.look .ceremony .cup-name { color: var(--cream); }

/* THE MENU */
#app.menu.look h1.hero-title { font-size: clamp(2.2rem, 5vw, 4.2rem); }

/* HIS BETS (webui/screens.js stageBets): who is next and the board, beside
   the hero and three cards with their stake on a gold tag */
#app.arena.look > .topbar { padding-right: 150px !important; background: none; border: 0; box-shadow: none; display: flex; align-items: center; justify-content: space-between; margin: 0; min-height: 34px; }
#app.arena.look > .topbar .bar-right { display: flex; align-items: center; gap: 10px; }
#app.arena.look > .topbar .purse { color: var(--gold-1); font-weight: 900; font-size: 1.35rem; }
#app.arena.look > .topbar .purse::before { content: "\25CF"; font-size: .75em; margin-right: 6px; }
#app.arena.look .bets-stage { flex: 1; display: grid; grid-template-columns: minmax(240px, 30%) minmax(0, 1fr); gap: 30px; align-items: center; min-height: 0; }
#app.arena.look .mcol { min-width: 0; display: flex; flex-direction: column; }
#app.arena.look .framed .boardslot { line-height: 0; display: flex; justify-content: center; margin-top: 10px; }
#app.arena.look .framed .boardslot canvas { max-width: 100%; height: auto !important; }
#app.arena.look .nx-sub.plain { text-transform: none; letter-spacing: 0; font-size: .85rem; color: #e8d6f3; }
#app.arena.look .skulls { color: #f39a9a; font-size: .8em; }
#app.arena.look .hero { margin: 0 0 4px; }
#app.arena.look .bet-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 6px 0 26px; }
#app.arena.look .bet-card { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 18px 14px 30px; border: 3px solid var(--gold-1); border-radius: 12px;
  background: linear-gradient(170deg, #6a3596, #3b1a5a); box-shadow: 0 6px 0 rgba(0,0,0,.3); cursor: pointer; }
#app.arena.look .bet-card:nth-child(3n+2) { background: linear-gradient(170deg, #284f86, #16294d); }
#app.arena.look .bet-card:nth-child(3n) { background: linear-gradient(170deg, #8a2333, #4c0f1c); }
#app.arena.look .bet-card::before { display: none; }
#app.arena.look .bet-card:hover { transform: translateY(-3px); filter: brightness(1.08); box-shadow: 0 9px 0 rgba(0,0,0,.3); }
#app.arena.look .bet-card .bc-title { font-weight: 900; text-transform: uppercase; letter-spacing: .03em; font-size: 1.2rem; color: var(--cream); text-shadow: 0 2px 0 rgba(0,0,0,.5); }
#app.arena.look .bet-card .bc-feat { font-size: .95rem; color: #f1e9d8; line-height: 1.3; flex: 1; }
#app.arena.look .bet-card .bc-win { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: #e8d6f3; }
#app.arena.look .bet-card .bc-win b { font-size: 1.35rem; letter-spacing: 0; text-shadow: 0 2px 0 #1e0b29; }
#app.arena.look .bet-card .bc-win .gain { color: var(--good); letter-spacing: 0; }
#app.arena.look .bet-card .bc-stake { position: absolute; left: 50%; bottom: -17px; transform: translateX(-50%); background: linear-gradient(180deg, #f8cf63, #e0a536); color: #2a1238;
  font-weight: 900; font-size: 1.05rem; padding: 4px 22px; clip-path: polygon(10% 0, 90% 0, 100% 50%, 90% 100%, 10% 100%, 0 50%); white-space: nowrap; }
#app.arena.look .bet-card.cant { opacity: .6; cursor: default; } #app.arena.look .bet-card.cant .bc-stake { filter: grayscale(.8); font-size: .8rem; }
#app.arena.look .go { margin-top: 0; }
#app.arena.look .go .nobet { padding: 8px 30px; opacity: 1; }

@media (max-height: 520px) {
  #app.look { padding: 2px 10px 6px; border-radius: 14px; }
  #app.look .lookbar { min-height: 22px; padding-right: 116px; } #app.look .lookbar .crumb { font-size: .62rem; }
  #app.look h1 { font-size: 1.25rem; margin: 2px 120px 2px; }
  body:has(#app.look) #sfx, body:has(#app.look) #flag, body:has(#app.look) #saves { width: 30px; height: 30px; top: 4px; }
  body:has(#app.look) #flag { right: 46px; } body:has(#app.look) #saves { right: 80px; }
  #app.look .hero { gap: 6px; margin: 12px 0 2px; } .bracket.look .bcol.left .hero { margin-top: 8px; } #app.look h1.hero-title { transform: rotate(-3deg); } #app.look .hero-face { width: 62px; }
  #app.look h1.hero-title { font-size: 1.35rem; } #app.look .hero-words { gap: 5px; }
  #app.look .hero .bubble { font-size: .74rem; padding: 4px 12px; max-width: 260px; } #app.look .hero-sub { font-size: .72rem; }
  #app.look .ludivar { gap: 10px; margin: 2px 0 4px; } #app.look .ludivar :is(img, :where(ludi-face)) { width: 48px; } #app.look .ludivar .bubble { font-size: .76rem; padding: 4px 12px; }
  #app.look .sec-h { margin: 3px 0 3px; font-size: .62rem; letter-spacing: .16em; }
  #app.look .framed { padding: 13px 10px 6px; margin-top: 10px; border-radius: 12px; }
  #app.look .framed > .tag { top: -10px; font-size: .62rem; padding: 2px 12px; }
  #app.look .nx { gap: 8px; } #app.look .nx-token canvas { width: 38px !important; height: 38px !important; }
  #app.look .nx-name { font-size: .95rem; } #app.look .nx-sub { font-size: .6rem; margin-top: 1px; }
  #app.look button.primary, #app.look button.enter { font-size: 1rem; padding: 5px 22px; }
  #app.look .go .enter, #app.look .over-actions button.primary { min-width: 150px; }
  #app.look .go { margin-top: 8px; }
  .bracket.look .bracket-cols { gap: 14px; grid-template-columns: minmax(250px, 34%) minmax(0, 1fr); align-items: start; }
  .bracket.look .cup-shelf { display: none; }
  .bracket.look .framed .sec-h { margin: 5px 0 3px; font-size: .56rem; } .bracket.look .cup-path .pip { height: 7px; }
  .bracket.look .draw-pager { margin-bottom: 4px; } .bracket.look .draw-pager .pg-step { height: 30px; }
  .bracket.look .chart { padding: 4px 8px; border-radius: 12px; }
  #app.reward.look .offers { gap: 10px; margin-top: 2px; } #app.reward.look .lot.ticket { padding: 6px 8px; border-width: 2px; }
  #app.reward.look .lot.ticket > canvas { width: clamp(44px, 18vh, 64px) !important; height: clamp(44px, 18vh, 64px) !important; }
  #app.reward.look .lot.ticket .tk-body { font-size: .72rem; line-height: 1.2; } #app.reward.look .lot.ticket .tk-body b { font-size: .8rem; margin: 2px 0; }
  #app.reward.look .lot.ticket .why, #app.reward.look .offers.lots .lot .why { top: 4px; right: 4px; width: 24px; height: 24px; }
  /* (report 20261201-235826-ef97b0, the designer at 873x325, 12-01: "Doesn't fit the screen" -- the rail of the coupons
     you hold stood its ten slots in one 379px column and stretched every card to its height, so the page was 542px
     tall: the cards keep their own height, their ticket and words a size smaller, and the rail folds into columns of five) */
  #app.reward.look .reward-row { align-items: flex-start; }
  #app.reward.look .hero { margin-top: 4px; } #app.reward.look .buttons { margin-top: 2px; } #app.reward.look .lot.ticket { padding: 4px 8px; }
  #app.reward.look .lot.ticket > canvas { width: clamp(32px, 12vh, 64px) !important; height: clamp(32px, 12vh, 64px) !important; }
  #app.reward.look .lot.ticket .tk-text { font-size: .72rem; line-height: 1.15; }
  #app.reward.look .reward-row .rail.mine { --slot: 26px !important; display: grid; grid-template-rows: repeat(5, var(--slot)); grid-auto-flow: column; gap: 3px; width: auto; padding: 3px; }
  #app.reward.look .offers.lots .lot { padding: 8px 8px 6px; border-width: 2px; gap: 2px; } #app.reward.look .offers.lots .lot > canvas { width: 40px !important; height: 40px !important; }
  #app.reward.look .offers.lots .lot > div b { font-size: .82rem; } #app.reward.look .offers.lots .lot > div .dim { font-size: .72rem; }
  #app.reward.look .panel.loot { padding: 2px 8px; margin: 2px 0; font-size: .72rem; }
  #app.reward.look .buttons { margin-top: 6px; } #app.reward.look .buttons button { padding: 3px 14px; min-height: 0; font-size: .78rem; }
  #app.over.look .unlocked-news { padding: 3px 12px; margin: 2px 0; font-size: .78rem; } #app.over.look .scoreboard { gap: 8px; }
  #app.over.look .scoreboard .stat { min-width: 110px; padding: 2px 8px; }
  #app.over.look .ceremony { margin: 0; display: flex; align-items: center; justify-content: center; gap: 10px; } #app.over.look .ceremony .cup-stage { zoom: .42; }
  #app.over.look .ceremony .cup-name { font-size: .9rem; } #app.over.look .ceremony .cup-shelf { display: none; }
  #app.over.look > .small.good { font-size: .66rem; } #app.over.look .sec-h.line { margin: 2px 0; } #app.over.look .scoreboard .stat .n { font-size: 1.3rem; }
  #app.over.look .over-actions { margin-top: 8px; } #app.over.look .over-actions button:not(.primary) { padding: 5px 16px; }
  /* A LOSS FITS A PHONE ON ITS SIDE (report 20261201-155558-ee6d6f, the designer, 12-01: "Not fitting on
     screen" -- at 873x325 it stood 444px tall, Menu and Again under the fold): two columns, Ludivar's word on
     the left beside the piece that did it and the bet, then the kit, and the score in one row with the doors */
  #app.over.lost.look { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); column-gap: 16px; row-gap: 0; align-content: start; }
  #app.over.lost.look > * { grid-column: 1 / -1; min-width: 0; }
  #app.over.lost.look > .hero { grid-column: 1; grid-row: span 3; justify-content: flex-start; margin: 8px 0 2px; } #app.over.lost.look .hero-words { min-width: 0; }
  #app.over.lost.look > .framed.killer, #app.over.lost.look > .bet-lost, #app.over.lost.look > .unlocked-news { grid-column: 2; justify-self: start; align-self: start; min-width: 0; }
  #app.over.lost.look > .framed.killer { margin-top: 18px; padding-right: 22px; } #app.over.lost.look > .bet-lost { margin: 4px 0 0; font-size: .78rem; }
  #app.over.lost.look > .chip-row { margin: 4px 0 0; } #app.over.lost.look > .chip-row .chips { margin-top: 0; padding: 5px; }
  #app.over.lost.look > .scoreboard { grid-column: 1; justify-content: flex-start; flex-wrap: nowrap; gap: 6px; margin: 6px 0 0; align-self: center; }
  #app.over.lost.look > .scoreboard .stat { flex: 1 1 0; min-width: 0; padding: 2px 6px; } #app.over.lost.look > .scoreboard .stat .l { font-size: .54rem; letter-spacing: .06em; line-height: 1.1; }
  #app.over.lost.look > .over-actions { grid-column: 2; margin: 6px 0 0; padding: 0; justify-content: flex-end; gap: 10px; align-self: center; }
  #app.over.lost.look > .over-actions button { min-height: 0; }
  #app.menu.look h1.hero-title { font-size: 1.6rem; }
  #app.arena.look > .topbar { padding-right: 116px !important; min-height: 24px; } #app.arena.look > .topbar .purse { font-size: 1rem; }
  #app.arena.look .bets-stage { gap: 14px; grid-template-columns: minmax(200px, 28%) minmax(0, 1fr); }
  #app.arena.look .framed .boardslot { margin-top: 4px; }
  #app.arena.look .bet-cards { gap: 10px; margin: 2px 0 16px; }
  #app.arena.look .bet-card { padding: 6px 8px 16px; gap: 3px; border-width: 2px; }
  #app.arena.look .bet-card .bc-title { font-size: .85rem; } #app.arena.look .bet-card .bc-feat { font-size: .72rem; line-height: 1.2; }
  #app.arena.look .bet-card .bc-win { font-size: .58rem; } #app.arena.look .bet-card .bc-win b { font-size: .95rem; }
  #app.arena.look .bet-card .bc-stake { font-size: .78rem; padding: 2px 14px; bottom: -12px; }
  #app.arena.look .go .nobet { padding: 3px 18px; min-height: 0; font-size: .8rem; }
}

/* THE MENU ON THE STAGE (webui/screens.js stageMenu): three columns over a band */
#app.menu.look .menu-stage { flex: 1; display: grid; grid-template-columns: minmax(230px, 27%) minmax(0, 1fr) minmax(200px, 22%); gap: 22px; align-items: center; min-height: 0; }
#app.menu.look .mcol { min-width: 0; display: flex; flex-direction: column; }
#app.menu.look .hero { margin: 14px 0 6px; }
#app.menu.look h1.hero-title { font-size: clamp(2rem, 4.4vw, 3.8rem); white-space: nowrap; }
#app.menu.look .framed.pickgame { margin-top: 16px; }
#app.menu.look .framed .sec-h { margin: 12px 0 6px; font-size: .7rem; color: #c9a0e6; }
#app.menu.look .pick-row { margin: 0; gap: 8px; }
#app.menu.look .pick-row.factions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#app.menu.look .pick-row.starts { grid-template-columns: 1fr; }
#app.menu.look .pick { background: rgba(79,36,99,.6); border: 2px solid rgba(201,163,90,.55) !important; border-radius: 12px; box-shadow: 0 3px 0 rgba(0,0,0,.3); min-height: 0; height: auto; padding: 8px 6px; }
#app.menu.look .pick.on { border-color: var(--gold-1) !important; background: #6a3183; box-shadow: 0 0 0 1px var(--gold-1), 0 0 16px rgba(244,192,74,.35), 0 3px 0 rgba(0,0,0,.3); }
#app.menu.look .pick .check { background: var(--gold-1); color: #2a1238; }
#app.menu.look .pick .pk-name { color: var(--cream); font-size: .9rem; }
#app.menu.look .pick canvas { width: 46px; height: 46px; filter: drop-shadow(0 3px 4px rgba(0,0,0,.4)); }
#app.menu.look .pick-row.starts .pick { flex-direction: column; align-items: flex-start; justify-content: center; gap: 6px; padding: 8px 12px; height: auto; min-height: 0; }
#app.menu.look .pick-row.starts .pick .pk-army { justify-content: flex-start; gap: 2px; }
#app.menu.look .pick-row.starts .pick .pk-army canvas { width: 28px !important; height: 28px !important; filter: none; }
#app.menu.look .showcase.feat { margin: 0; border: 2px solid #c9a35a; border-radius: 16px; background: rgba(30,11,41,.55); padding: 10px; height: auto !important; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
#app.menu.look .sc-feat { background: rgba(79,36,99,.6) !important; border: 2px solid transparent !important; border-radius: 10px !important; box-shadow: none !important; }
#app.menu.look .sc-feat.on { border-color: var(--gold-1) !important; background: #6a3183 !important; } #app.menu.look .sc-feat.on b { color: var(--gold-1); }
#app.menu.look .sc-feat span { color: #e8d6f3; }
#app.menu.look .sc-name { color: var(--cream); font-weight: 900; }
#app.menu.look button.primary.wide { align-self: center; margin: 0 0 6px; }
#app.menu.look .sright { border-left: 2px solid rgba(201,163,90,.55); padding-left: 18px; align-self: stretch; justify-content: center; }
#app.menu.look .saves-strip { flex-direction: column; margin: 0 0 12px; max-width: none; gap: 8px; }
#app.menu.look .saves-strip .save-tab { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 10px 12px; border-style: solid !important; }
#app.menu.look .saves-strip .save-tab.on { border-color: var(--gold-1) !important; background: #6a3183 !important; }
#app.menu.look .saves-strip .save-tab b { color: var(--cream); letter-spacing: .1em; }
#app.menu.look .saves-strip .save-tab span { color: #c9a0e6; }
#app.menu.look .menu-links { flex-direction: column; margin: 0; }
#app.menu.look .menu-links .library-btn { background: rgba(79,36,99,.75); border: 2px solid var(--rose); color: var(--cream); border-radius: 10px; box-shadow: 0 3px 0 rgba(0,0,0,.35); }
#app.menu.look .sright .panel { border-width: 1px; margin: 0; }
#app.menu.look .menu-band { display: flex; align-items: center; justify-content: space-between; gap: 18px; border-top: 2px solid rgba(201,163,90,.6); margin-top: 12px; padding-top: 10px; }
#app.menu.look .menu-band .heat-pick { flex: 0 1 380px; margin: 0; background: rgba(30,11,41,.55); border: 2px solid rgba(201,163,90,.55); }
#app.menu.look .menu-band .heat-text b { color: var(--gold-1); }
#app.menu.look .menu-actions { position: static; margin: 0; padding: 0; flex: 1; justify-content: flex-end; align-items: center; gap: 12px; flex-wrap: nowrap; }
#app.menu.look .menu-actions > button:not(.primary) { flex: 0 0 auto; padding: 10px 22px; }
#app.menu.look .menu-actions .cups-pick { flex: 0 0 auto; background: rgba(30,11,41,.55); border: 2px solid rgba(201,163,90,.55); border-radius: 12px; padding: 3px; }
#app.menu.look .menu-actions .cups-pick button.on { background: #6a3183 !important; border-color: var(--gold-1) !important; }
#app.menu.look .menu-actions button.primary { flex: 0 0 auto; min-width: 260px; }
@media (max-height: 520px) {
  #app.menu.look .menu-stage { gap: 10px; grid-template-columns: minmax(190px, 25%) minmax(0, 1fr) minmax(150px, 19%); }
  #app.menu.look .hero { margin: 8px 0 0; } #app.menu.look h1.hero-title { font-size: 1.5rem; }
  #app.menu.look .framed.pickgame { margin-top: 10px; } #app.menu.look .framed .sec-h { margin: 4px 0 3px; font-size: .56rem; }
  #app.menu.look .pick-row { gap: 4px; } #app.menu.look .pick { padding: 3px 4px; flex-direction: row; gap: 6px; justify-content: flex-start; border-width: 1px !important; }
  #app.menu.look .pick-row.factions .pick { min-height: 0 !important; height: auto !important; }
  #app.menu.look .pick-row.factions .pick canvas { width: 24px !important; height: 24px !important; } #app.menu.look .pick .pk-name { font-size: .68rem; }
  #app.menu.look .pick-row.starts .pick { padding: 2px 8px; gap: 1px; min-height: 0; flex-direction: row; align-items: center; justify-content: space-between; }
  #app.menu.look .pick-row.starts .pick .pk-army { flex-wrap: nowrap; gap: 0; } #app.menu.look .pick-row.starts .pick .pk-army canvas { width: 15px !important; height: 15px !important; }
  #app.menu.look .menu-stage { align-items: start; } #app.menu.look .sright { justify-content: flex-start; }
  #app.menu.look .pick .check { width: 14px; height: 14px; font-size: 9px; top: -5px; right: -5px; }
  #app.menu.look .showcase.feat { padding: 4px 6px; border-radius: 12px; }
  #app.menu.look .sright { padding-left: 10px; padding-top: 34px; }
  #app.menu.look .saves-strip .save-tab b, #app.menu.look .saves-strip .save-tab span { display: inline; width: auto; margin: 0; }
  #app.menu.look .sright .panel, #app.menu.look .sright .panel + p, #app.menu.look .sright > .sec-h:nth-of-type(n+2), #app.menu.look .sright > p { display: none; }
  #app.menu.look .hero { margin: 10px 0 0; } #app.menu.look .hero-face { width: 50px; } #app.menu.look h1.hero-title { font-size: 1.35rem; } #app.menu.look .sec-h.line { margin: 1px 0 2px; } #app.menu.look .saves-strip { gap: 4px; margin-bottom: 6px; }
  #app.menu.look .saves-strip .save-tab { padding: 3px 8px; font-size: .7rem; } #app.menu.look .menu-links { gap: 4px; }
  #app.menu.look .menu-links .library-btn { padding: 3px 8px; min-height: 0; font-size: .74rem; }
  #app.menu.look .menu-band { margin-top: 4px; padding-top: 4px; gap: 10px; }
  #app.menu.look .menu-band .heat-pick { padding: 1px; } #app.menu.look .heat-pick .heat-step { min-width: 30px; min-height: 28px; font-size: 15px; }
  #app.menu.look .menu-actions > button:not(.primary) { padding: 4px 12px; min-height: 0; font-size: .8rem; }
  #app.menu.look .menu-actions .cups-pick button { padding: 3px 10px; min-height: 0; font-size: .78rem; }
  #app.menu.look .menu-actions button.primary { min-width: 170px; min-height: 0; }
}

@media (max-height: 520px) and (min-width: 761px) {
  /* the games and the armies to open with are what this screen is for: they
     take the room the rule list can spare (report 20261201-233624-39a22b, a
     phone on its side, 873x325: "I can't see the factions and the packs to
     choose from. Too small") -- a wider left column, bigger names, emblems and
     pieces; an army too long for its row puts its pieces under its name */
  #app.menu.look .menu-stage { grid-template-columns: minmax(230px, 31%) minmax(0, 1fr) minmax(140px, 18%); }
  #app.menu.look .pick-row.factions .pick { padding: 5px 6px; }
  #app.menu.look .pick-row.factions .pick canvas { width: 30px !important; height: 30px !important; } #app.menu.look .pick .pk-name { font-size: .86rem; }
  #app.menu.look .pick-row.factions .pick .pk-name { font-size: .8rem; white-space: nowrap; }
  #app.menu.look .pick-row.starts { gap: 5px; }
  #app.menu.look .pick-row.starts .pick { padding: 4px 10px; flex-wrap: wrap; row-gap: 2px; }
  #app.menu.look .pick-row.starts .pick .pk-army { gap: 1px; } #app.menu.look .pick-row.starts .pick .pk-army canvas { width: 21px !important; height: 21px !important; }
  #app.menu.look .pick .check { width: 17px; height: 17px; font-size: 11px; }
}

/* THE CARDS THAT POP UP wear the look too (user, 11-30: "Then why did you
   stop"): a question, a rule's demo, a piece's card, the Library -- over any
   screen that lies on its side, the fight and the market included. The
   colours are set on the scrim itself, so what a card holds (tabs, tiles,
   rules) follows without touching the screen under it. (The fight's own
   cards -- the walk-out, a coupon firing -- keep their staging.) */
body:has(#app.look, #app.stage, .battle.stage) .ask:not(.coupon-scrim):not(.walkout-scrim) { --panel: #3a174a; --panel-light: #4f2463; --panel-deep: #1e0b29; --panel-edge: rgba(201,163,90,.55); --dim: #c9a0e6; --text: #f7e8c6;
  color: var(--text); background: rgba(22,7,30,.74); }
body:has(#app.look, #app.stage, .battle.stage) .ask:not(.coupon-scrim):not(.walkout-scrim) > .card { background: radial-gradient(ellipse at 50% 0%, #54236a, #2e1240 75%); border: 2px solid #c9a35a; border-radius: 18px; color: var(--cream);
  box-shadow: 0 18px 46px rgba(0,0,0,.6), 0 0 0 5px rgba(30,11,41,.55); }
body:has(#app.look, #app.stage, .battle.stage) .ask:not(.coupon-scrim):not(.walkout-scrim) > .card h2, body:has(#app.look, #app.stage, .battle.stage) .ask:not(.coupon-scrim):not(.walkout-scrim) > .card > .ttl,
body:has(#app.look, #app.stage, .battle.stage) .ask:not(.coupon-scrim):not(.walkout-scrim) .lib-head h2, body:has(#app.look, #app.stage, .battle.stage) .ask:not(.coupon-scrim):not(.walkout-scrim) .lib-head > :first-child {
  color: var(--cream); font-weight: 900; text-transform: uppercase; letter-spacing: .04em; text-shadow: 0 2px 0 #1e0b29; }
body:has(#app.look, #app.stage, .battle.stage) .ask:not(.coupon-scrim):not(.walkout-scrim) button:not(.primary):not(.pg) { background: rgba(79,36,99,.8); border: 2px solid var(--rose); color: var(--cream); border-radius: 10px;
  box-shadow: 0 3px 0 rgba(0,0,0,.35); background-image: none; }
body:has(#app.look, #app.stage, .battle.stage) .ask:not(.coupon-scrim):not(.walkout-scrim) button:not(.primary):not(.pg):hover:not(:disabled) { border-color: var(--gold-1); background: rgba(95,44,118,.95); }
body:has(#app.look, #app.stage, .battle.stage) .ask:not(.coupon-scrim):not(.walkout-scrim) button.on, body:has(#app.look, #app.stage, .battle.stage) .ask:not(.coupon-scrim):not(.walkout-scrim) .tabs button.on { background: #6a3183 !important; border-color: var(--gold-1) !important; color: var(--cream); }
body:has(#app.look, #app.stage, .battle.stage) .ask:not(.coupon-scrim):not(.walkout-scrim) button.primary { background: linear-gradient(180deg, #fbd76e, #e6a734); border: 2px solid #b9802a; color: #2a1238; font-weight: 900;
  box-shadow: 0 4px 0 #7a4e14; text-shadow: 0 1px 0 rgba(255,255,255,.35); }
body:has(#app.look, #app.stage, .battle.stage) .ask:not(.coupon-scrim):not(.walkout-scrim) button.danger { background: linear-gradient(180deg, #a9344a, #6d1a2b) !important; border-color: #f39a9a !important; color: #fff3f3; }
body:has(#app.look, #app.stage, .battle.stage) .ask:not(.coupon-scrim):not(.walkout-scrim) .tile, body:has(#app.look, #app.stage, .battle.stage) .ask:not(.coupon-scrim):not(.walkout-scrim) .rule { background: linear-gradient(170deg, #4f2463, #33143f); border: 2px solid rgba(201,163,90,.6); border-radius: 12px; color: var(--cream); }
body:has(#app.look, #app.stage, .battle.stage) .ask:not(.coupon-scrim):not(.walkout-scrim) .tile:hover, body:has(#app.look, #app.stage, .battle.stage) .ask:not(.coupon-scrim):not(.walkout-scrim) .rule.tap:hover { border-color: var(--gold-1); filter: brightness(1.08); }
body:has(#app.look, #app.stage, .battle.stage) .ask:not(.coupon-scrim):not(.walkout-scrim) input { background: rgba(30,11,41,.6); border: 2px solid rgba(201,163,90,.55); color: var(--cream); border-radius: 10px; }
body:has(#app.look, #app.stage, .battle.stage) .ask:not(.coupon-scrim):not(.walkout-scrim) input::placeholder { color: #c9a0e6; }
body:has(#app.look, #app.stage, .battle.stage) .ask:not(.coupon-scrim):not(.walkout-scrim) .dim { color: #c9a0e6; }
body:has(#app.look, #app.stage, .battle.stage) .ask:not(.coupon-scrim):not(.walkout-scrim) .lib-group { color: var(--cream); font-weight: 800; letter-spacing: .2em; text-transform: uppercase; font-size: .8rem; }

/* THE WALK-OUT before a fight, in the same hand: a plum card in a gold
   frame, the round between gold rules, VS in the chunky cream, what you must
   do on a gold ribbon (user, 11-30: "Then why did you stop"). Its plates, its
   timing and its tiers are untouched. */
body:has(.battle.stage) .walkout-scrim { background: rgba(22,7,30,.8); }
body:has(.battle.stage) .walkout { background: radial-gradient(ellipse at 50% 0%, #54236a, #2e1240 75%); border: 2px solid #c9a35a; border-radius: 18px;
  box-shadow: 0 18px 46px rgba(0,0,0,.6), 0 0 0 5px rgba(30,11,41,.55); color: var(--cream); width: min(92vw, 440px); padding: 20px 20px 14px; }
body:has(.battle.stage) .walkout .wo-round { display: flex; align-items: center; gap: 12px; color: var(--cream); letter-spacing: .22em; font-size: .78rem; text-transform: uppercase; }
body:has(.battle.stage) .walkout .wo-round::before, body:has(.battle.stage) .walkout .wo-round::after { content: ""; flex: 1; height: 2px; background: linear-gradient(90deg, rgba(244,192,74,0), var(--gold-1)); }
body:has(.battle.stage) .walkout .wo-round::after { background: linear-gradient(90deg, var(--gold-1), rgba(244,192,74,0)); }
body:has(.battle.stage) .walkout .wo-vs.duel .vs { color: var(--cream); font-size: 1.9rem; font-weight: 900; letter-spacing: .06em; transform: rotate(-4deg);
  text-shadow: 0 3px 0 #1e0b29, 2px 2px 0 #1e0b29, -2px 2px 0 #1e0b29, 2px -1px 0 #1e0b29, -2px -1px 0 #1e0b29; }
body:has(.battle.stage) .walkout .wo-goal { background: linear-gradient(180deg, #f8cf63, #e0a536); border: 0; border-radius: 0; padding: 5px 24px;
  clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 50%, 100% 100%, 0 100%, 10px 50%); }
body:has(.battle.stage) .walkout .wo-goal, body:has(.battle.stage) .walkout .wo-goal b { color: #2a1238; font-weight: 900; }
body:has(.battle.stage) .walkout .wo-fuse { background: var(--gold-1); }
body:has(.battle.stage) .walkout.tier-named { border-color: var(--named); } body:has(.battle.stage) .walkout.tier-champion { border-color: var(--gold-1); border-width: 3px; }
body:has(.battle.stage) .walkout.final { background: radial-gradient(ellipse at 50% 0%, #6b4a1c, #2e1240 75%); }
body:has(.battle.stage) .walkout button { background: rgba(79,36,99,.8); border: 2px solid var(--rose); color: var(--cream); background-image: none; }
body:has(.battle.stage) .walkout:not(.tier-named):not(.tier-champion) { border-color: #c9a35a !important; }

/* THE LOOK ON EVERY DEVICE (user, 11-30: "Is the design good for all
   devices"): measured on the live game at ten sizes, four were not -- a small
   phone on its side, a mid phone's and a tablet's squeezed menu, a tablet
   held upright, and a very large monitor where the bracket's title ran over
   the draw. */
/* the bracket's hero is sized by its own column, so it never crosses into the draw */
#app.bracket.look .bcol.left { container-type: inline-size; }
#app.bracket.look .bcol.left .hero-face { width: clamp(56px, 28cqw, 190px); }
#app.bracket.look .bcol.left h1.hero-title { font-size: clamp(1.15rem, 8cqw, 2.9rem); }
#app.bracket.look .bcol.left .hero .bubble { max-width: 58cqw; }
#app.look .framed > .tag { white-space: nowrap; }
/* a narrow window on its side: tighter columns, labels only in the rule list */
@media (max-width: 760px) and (orientation: landscape) {
  #app.menu.look .menu-stage { grid-template-columns: minmax(150px, 24%) minmax(0, 1fr) minmax(104px, 17%); gap: 8px; }
  #app.menu.look .sc-feat span { display: none !important; } #app.menu.look .sc-feat b { font-size: .7rem; }
  #app.menu.look .sc-feat { padding: 3px 6px !important; } #app.menu.look .showcase.feat { gap: 6px; }
  #app.menu.look .sc-name { font-size: .95rem !important; } #app.menu.look .showcase.feat .sc-head canvas { width: 24px; height: 24px; }
  #app.menu.look .saves-strip .save-tab span { display: none !important; } #app.menu.look .menu-links .library-btn span { font-size: .68rem; }
  #app.menu.look .pick-row.starts .pick .pk-army { display: none; } #app.menu.look .pick-row.starts .pick { justify-content: center; }
  #app.menu.look .pick-row.factions .pick canvas { width: 20px !important; height: 20px !important; } #app.menu.look .pick .pk-name { font-size: .62rem; }
  #app.menu.look h1.hero-title { font-size: 1.15rem; } #app.menu.look .hero .bubble { font-size: .66rem; padding: 3px 10px; }
  #app.menu.look .menu-actions button.primary { min-width: 130px; }
  .bracket.look .bracket-cols { grid-template-columns: minmax(200px, 38%) minmax(0, 1fr); gap: 10px; }
  #app.arena.look .bets-stage { grid-template-columns: minmax(150px, 26%) minmax(0, 1fr); gap: 10px; }
  #app.arena.look .bet-cards { gap: 6px; } #app.arena.look .bet-card .bc-feat { font-size: .64rem; } #app.arena.look .bet-card .bc-title { font-size: .74rem; }
  #app.arena.look .bet-card .bc-stake { font-size: .68rem; padding: 2px 10px; }
  #app.reward.look .offers { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  #app.reward.look .lot.ticket .tk-body { font-size: .64rem; } #app.reward.look .lot.ticket .tk-body b { font-size: .7rem; }
  #app.look h1.hero-title { font-size: 1.15rem; } #app.look .hero-face { width: 50px; }
  #app.menu.look .showcase.feat .sc-head { display: none; } #app.menu.look .sc-feat b { font-size: .62rem; line-height: 1.1; }
  #app.menu.look .menu-band { margin-top: 2px; padding-top: 3px; } #app.menu.look .menu-actions button.primary { font-size: .9rem; padding: 3px 16px; }
  #app.menu.look .hero { margin: 6px 0 0; } #app.menu.look .sec-h.center { margin: 0 0 2px; }
  #app.look .framed > .tag { font-size: .54rem; padding: 2px 10px; }
  #app.look .nx-name { font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } #app.look .nx-words { min-width: 0; }
}
/* a window taller than it is wide (a tablet held upright): the columns stack */
@media (orientation: portrait) {
  #app.menu.look .menu-stage { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); align-items: start; gap: 18px; }
  #app.menu.look .menu-stage > .smid { grid-column: 1 / -1; grid-row: 1; }
  #app.menu.look .menu-stage > .sright { border-left: 0; padding-left: 0; }
  #app.menu.look .menu-band { flex-wrap: wrap; justify-content: center; }
  #app.menu.look .menu-actions { justify-content: center; flex-wrap: wrap; }
  .bracket.look .bracket-cols { grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
  .bracket.look .bcol.left { max-width: 620px; width: 100%; margin: 0 auto; }
  #app.arena.look .bets-stage { grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
  #app.arena.look .bets-stage > .sleft { max-width: 520px; width: 100%; margin: 0 auto; order: 2; }
  #app.look { min-height: 0; }
}
/* a very large monitor: the stage grows with it instead of sitting small in the middle */
@media (min-width: 1900px) and (min-height: 1000px) {
  #app.look { max-width: 1760px; padding: 20px 34px 24px; font-size: 1.15rem; }
  #app.look .sec-h { font-size: .95rem; } #app.look .lookbar .crumb { font-size: .95rem; }
  #app.look .nx-name { font-size: 1.8rem; } #app.look .framed > .tag { font-size: 1rem; }
  #app.look button.primary, #app.look button.enter { font-size: 1.9rem; padding: 14px 56px; }
  #app.reward.look, #app.over.look { max-width: 1500px; } #app.bracket.look, #app.menu.look, #app.arena.look { max-width: 1760px; }
}
/* the market and the pre-fight screen at the same new sizes */
.arena.stage .tag { white-space: nowrap; }
@media (max-width: 700px) and (orientation: landscape) {
  .arena.stage .market-stage { grid-template-columns: minmax(120px, 23%) minmax(0, 1fr) minmax(128px, 25%); gap: 6px; }
  .arena.stage .hero .bubble, .arena.stage .next-tell, .arena.stage .sleft .tiny { display: none; }
  .arena.stage .hero-face { width: 40px; } .arena.stage .hero-title { font-size: .9rem; }
  .arena.stage .recruits { flex-wrap: nowrap; gap: 2px; padding: 0; } .arena.stage .recruit { min-width: 0; padding: 0; }
  .arena.stage .recruit .rc-token { width: 34px; height: 34px; } .arena.stage .recruit .rc-token canvas { width: 32px !important; height: 32px !important; }
  .arena.stage .recruit .rc-name { font-size: .54rem; max-width: 62px; } .arena.stage .recruit .rc-price { font-size: .74rem; }
  .arena.stage .mkeys { gap: 3px; margin-top: 3px; } .arena.stage .mkeys button { font-size: .58rem; padding: 3px 1px; gap: 2px; min-height: 0; } .arena.stage .mkeys .kicon { display: none; }
  .arena.stage .sec-h { font-size: .52rem; letter-spacing: .08em; margin: 2px 0; }
  .arena.stage .forsale { gap: 4px; row-gap: 12px; } .arena.stage .fs-card { aspect-ratio: 1.5; padding: 2px 2px 10px; border-width: 2px; }
  .arena.stage .fs-card canvas { width: 34% !important; } .arena.stage .fs-card .fs-name { font-size: .46rem; } .arena.stage .fs-card .fs-price { font-size: .64rem; padding: 0 8px; bottom: -9px; }
  .arena.stage .sright { padding-left: 6px; } .arena.stage .sleft.framed { padding: 12px 4px 2px; }
  .arena.stage .tag { font-size: .5rem; padding: 2px 9px; } .arena.stage .next-name { font-size: .7rem; }
  .arena.stage .sleft .linkish { font-size: .56rem; }
  .arena.stage .market-band { gap: 6px; margin-top: 2px; padding-top: 2px; }
  .arena.stage .market-band .army-tray { gap: 3px; } .arena.stage .market-band .army-tray .tile.pc { width: 30px; min-height: 30px; }
  .arena.stage .market-band .army-tray .tile.pc canvas { width: 27px !important; height: 27px !important; }
  .arena.stage .market-band .my-coupons { max-width: 220px; gap: 2px; }
  .arena.stage .enter { font-size: .8rem; padding: 4px 10px; white-space: nowrap; } .arena.stage .band-go { margin-top: 2px; gap: 4px; }
  .arena.stage .band-points { font-size: .62rem; margin-top: 1px; }
  .arena.stage .stagebar .crumb { font-size: .56rem; } .arena.stage .stagebar .purse { font-size: .85rem; }
}
@media (orientation: portrait) {
  .arena.stage .market-stage { grid-template-columns: minmax(170px, 27%) minmax(0, 1fr) minmax(150px, 25%); gap: 12px; }
  .arena.stage .mkeys { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .arena.stage .enter { font-size: 1.15rem; padding: 8px 18px; white-space: nowrap; }
  .arena.stage .next-name { font-size: 1rem; } .arena.stage .sec-h { letter-spacing: .14em; }
  .arena.stage .market-band { grid-template-columns: minmax(0, 1fr); } .arena.stage .band-coupons { border-left: 0; padding-left: 0; }
}
/* the fight and the pre-fight screen on a small phone on its side: the side
   columns give the board its room instead of running under it */
@media (max-width: 700px) and (orientation: landscape) {
  .battle.wide.stage { grid-template-columns: minmax(0, 146px) minmax(0, 1fr) minmax(0, 146px); gap: 2px 8px; }
  .battle.wide.stage > .col.side { overflow: hidden; }
  .battle.wide.stage .stagebar { padding-right: 112px !important; } .battle.wide.stage .stagebar .title { font-size: .95rem; } .battle.wide.stage .stagebar .crumb { font-size: .54rem; }
  .battle.wide.stage .stagebar .purse { font-size: .85rem; }
  .battle.wide.stage .readout { padding: 0 0 2px; } .battle.wide.stage .readout .t { font-size: .9rem; } .battle.wide.stage .readout .t .turn-no { font-size: .6rem; }
  .battle.wide.stage .st-tools { gap: 3px; margin: 0 0 4px; } .battle.wide.stage .st-tools button { font-size: .52rem; padding: 3px 1px; white-space: nowrap; min-height: 0; }
  .battle.wide.stage .army-h { font-size: .56rem; padding: 2px 10px; margin: 2px 0; }
  .battle.wide.stage .st-army .ak-h { font-size: .5rem; margin: 2px 0 2px; letter-spacing: .08em; }
  .battle.wide.stage .st-army .ak-coupons { gap: 2px; } .battle.wide.stage .st-army .ak-coupons .slot { border-width: 1px; border-radius: 4px; }
  .battle.wide.stage .st-army .ak-tokens { min-height: 28px; padding: 2px; } .battle.wide.stage .st-army .ak-tokens .stack { width: 26px; height: 26px; }
  .battle.wide.stage .st-army .ak-tokens .stack canvas { width: 24px !important; height: 24px !important; }
  .battle.wide.stage .quote { font-size: .6rem; padding: 2px 10px; margin-top: 3px; max-width: 100%; }
  .battle.wide.stage .boardslot { padding: 3px; border-width: 2px; }
  .arena.stage .prefight-stage { grid-template-columns: minmax(0, 150px) minmax(0, 1fr) minmax(0, 150px); gap: 6px; }
  .arena.stage .prefight-stage .pcol { overflow-x: hidden; }
  .arena.stage .prefight-stage .army-tray .tile.pc { width: 28px; min-height: 28px; } .arena.stage .prefight-stage .army-tray .tile.pc canvas { width: 26px !important; height: 26px !important; }
  .arena.stage .prefight-stage .army-tray { gap: 3px; } .arena.stage .prefight-stage .ak-coupons { gap: 2px; }
  .arena.stage .pf-h { font-size: .5rem; letter-spacing: .06em; } .arena.stage .pf-h .pills button { padding: 1px 6px; font-size: .56rem; min-height: 0; }
  .arena.stage .prefight-stage .linkish { font-size: .6rem; } .arena.stage .pf-lud :is(img, :where(ludi-face)) { width: 30px; } .arena.stage .pf-lud .bubble { display: none; }
  .arena.stage.prefight .stagebar .title { font-size: .95rem; }
  .arena.stage .sleft .boardslot canvas { max-width: 100%; height: auto !important; }
}

/* THE NEXT FIGHT'S INTRO, in the same hand (user, 11-30, a screenshot of it
   in the old lilac over the new bets screen: "What is this???"). It is an
   overlay of its own, so the look's parts are given to it here: an opaque
   plum stage (nothing shows through), the hero beside the draw, your road in
   a gold frame; then who is next, framed in rose. webui/screens.js
   nextFightIntro */
.next-intro.look { background: radial-gradient(ellipse at 50% 30%, #4a1f5c 0%, #2e1240 55%, #1c0a26 100%); color: var(--cream);
  --panel: #3a174a; --panel-light: #4f2463; --panel-deep: #1e0b29; --panel-edge: rgba(201,163,90,.55); --dim: #c9a0e6; --text: #f7e8c6; }
.next-intro.look .ni-stage { width: min(1240px, 100%); }
.next-intro.look .bracket-scene { display: grid; grid-template-columns: minmax(280px, 36%) minmax(0, 1fr); gap: 30px; align-items: center; }
.next-intro.look .ni-col { min-width: 0; display: flex; flex-direction: column; }
.next-intro.look .ni-col.left { container-type: inline-size; }
.next-intro.look .hero { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; }
.next-intro.look .hero-face { position: relative; width: clamp(56px, 28cqw, 190px); flex: none; }
.next-intro.look .hero-face :is(img, :where(ludi-face)) { position: relative; width: 100%; height: auto; display: block; filter: drop-shadow(0 8px 10px rgba(0,0,0,.45)); }
.next-intro.look .hero-face .rays { position: absolute; inset: -14%; } .next-intro.look .hero-face .rays svg { width: 100%; height: 100%; }
.next-intro.look .hero-words { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-width: 0; }
.next-intro.look h1.hero-title { margin: 0; text-align: left; font-family: Sans, system-ui, sans-serif; font-weight: 900; text-transform: uppercase; color: var(--cream); letter-spacing: .01em;
  font-size: clamp(1.15rem, 8cqw, 2.9rem); line-height: .92; white-space: nowrap; transform: rotate(-5deg); transform-origin: left center;
  text-shadow: 0 3px 0 #1e0b29, 2px 2px 0 #1e0b29, -2px 2px 0 #1e0b29, 2px -1px 0 #1e0b29, -2px -1px 0 #1e0b29, 0 6px 0 rgba(0,0,0,.25); }
.next-intro.look .hero-sub { color: #e8d6f3; font-size: .95rem; margin-left: 6px; text-transform: uppercase; letter-spacing: .16em; }
.next-intro.look .hero .bubble { position: relative; background: var(--cream); color: #2a1238; font-family: Display, Georgia, serif; font-style: italic; font-weight: 600;
  font-size: clamp(.95rem, 1.35vw, 1.25rem); line-height: 1.2; padding: 10px 22px; max-width: 58cqw; transform: rotate(-4deg) skewX(-6deg);
  clip-path: polygon(3% 0, 100% 4%, 97% 100%, 0 92%); filter: drop-shadow(0 6px 0 rgba(0,0,0,.25)); margin-left: 6px; }
.next-intro.look .sec-h { display: flex; align-items: center; gap: 12px; color: var(--cream); font-weight: 800; letter-spacing: .24em; font-size: .8rem; text-transform: uppercase; margin: 10px 0 8px; }
.next-intro.look .sec-h.line { justify-content: center; }
.next-intro.look .sec-h.line::before, .next-intro.look .sec-h.line::after { content: ""; flex: 1; height: 2px; background: linear-gradient(90deg, rgba(244,192,74,0), var(--gold-1)); }
.next-intro.look .sec-h.line::after { background: linear-gradient(90deg, var(--gold-1), rgba(244,192,74,0)); }
.next-intro.look .framed { position: relative; border: 2px solid #c9a35a; border-radius: 16px; padding: 24px 16px 14px; background: rgba(30,11,41,.55); margin-top: 18px; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.next-intro.look .framed > .tag { position: absolute; top: -15px; left: 18px; display: inline-block; white-space: nowrap; background: linear-gradient(180deg, #f8cf63, #e0a536); color: #2a1238; font-weight: 900;
  letter-spacing: .12em; font-size: .85rem; padding: 4px 20px; clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 50%, 100% 100%, 0 100%, 10px 50%); }
.next-intro.look .framed > .tag.them { background: linear-gradient(180deg, #f39a9a, #d0605f); } .next-intro.look .framed.them { border-color: #d98a8a; }
.next-intro.look .cup-path { padding: 0; gap: 7px; }
.next-intro.look .cup-path .pip { height: 10px; border-radius: 5px; background: rgba(0,0,0,.4); border: 1px solid rgba(201,163,90,.45); }
.next-intro.look .cup-path .pip.next { background: var(--gold-1); border-color: transparent; box-shadow: 0 0 12px rgba(244,192,74,.75); }
.next-intro.look .cup-path .pip.won { background: var(--good); border-color: transparent; } .next-intro.look .cup-path .pip.lost { background: var(--bad); border-color: transparent; }
.next-intro.look .chart { border: 2px solid #c9a35a; border-radius: 16px; background: rgba(30,11,41,.55); padding: 12px 14px; max-height: 62vh; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.next-intro.look .them-scene { align-items: center; }
.next-intro.look .them-scene .framed { width: min(680px, 100%); text-align: left; }
.next-intro.look .nx { display: flex; align-items: center; gap: 16px; }
.next-intro.look .nx-token { flex: none; line-height: 0; filter: drop-shadow(0 4px 6px rgba(0,0,0,.45)); } .next-intro.look .nx-token canvas { animation: pay-pop .45s cubic-bezier(.3,1.6,.5,1) 1; }
.next-intro.look .nx-name { font-weight: 900; font-size: clamp(1.4rem, 3.4vw, 2.2rem); line-height: 1.1; color: #ffd0d0; }
.next-intro.look .nx-sub { margin-top: 4px; font-size: .8rem; letter-spacing: .16em; text-transform: uppercase; color: #c9a0e6; }
.next-intro.look .skulls { color: #f39a9a; font-size: .7em; }
.next-intro.look .ni-tell { margin: 12px 0 4px; font-family: Display, Georgia, serif; font-style: italic; color: var(--cream); }
.next-intro.look .ni-army, .next-intro.look .ni-coupons { justify-content: flex-start; }
.next-intro.look .ni-army .stack, .next-intro.look .ni-army .stack canvas { width: 46px; height: 46px; }
.next-intro.look .them-scene .sec-h { margin: 12px 0 6px; font-size: .7rem; color: #c9a0e6; }
@media (max-height: 520px) {
  .next-intro.look { padding: 6px 10px; } .next-intro.look .bracket-scene { gap: 14px; grid-template-columns: minmax(220px, 34%) minmax(0, 1fr); }
  .next-intro.look .hero-words { gap: 5px; } .next-intro.look .hero .bubble { font-size: .74rem; padding: 4px 12px; } .next-intro.look .hero-sub { font-size: .62rem; }
  .next-intro.look .sec-h { margin: 3px 0; font-size: .62rem; letter-spacing: .16em; }
  .next-intro.look .framed { padding: 14px 10px 8px; margin-top: 10px; border-radius: 12px; } .next-intro.look .framed > .tag { top: -10px; font-size: .62rem; padding: 2px 12px; }
  .next-intro.look .chart { padding: 4px 8px; border-radius: 12px; max-height: 70vh; }
  .next-intro.look .nx-token canvas { width: 44px !important; height: 44px !important; } .next-intro.look .nx-name { font-size: 1.1rem; }
  .next-intro.look .ni-tell { margin: 4px 0 2px; font-size: .85rem; } .next-intro.look .them-scene .sec-h { margin: 4px 0 2px; }
  .next-intro.look .ni-army .stack, .next-intro.look .ni-army .stack canvas { width: 26px; height: 26px; }
}
@media (orientation: portrait) { .next-intro.look .bracket-scene { grid-template-columns: minmax(0, 1fr); gap: 14px; } }

/* THE PRE-FIGHT SCREEN AFTER ITS REVIEW (user, 11-30, a review of this
   screen on a phone: "The board is too small ... wasted horizontal space";
   "Ludivar is ridiculously small ... approximately three times his current
   size"; "Two artistic styles coexist ... The glossy purple Auto, Clear and
   Undo buttons belong to the old one. Unify them"). The board takes the
   height, the two armies stand against its frame, Ludivar is three times the
   size with his rays, and every plain key on the stage is the mockup's key:
   plum, a rose edge, cream words. */
.arena.stage .prefight-stage { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 18px; align-items: stretch; }
.arena.stage .prefight-stage > .pcol:first-child { justify-self: end; width: min(100%, 300px); }
.arena.stage .prefight-stage > .pcol:last-child { justify-self: start; width: min(100%, 300px); }
.arena.stage .prefight-stage .pcol.mid { justify-content: center; }
.arena.stage .prefight-stage .pf-hint { margin-top: auto; font-size: .8rem; color: #c9a0e6; }
.arena.stage .prefight-stage .pf-foot { margin-top: 8px; }
.arena.stage .prefight-stage .pf-go { margin-top: auto; padding-top: 10px; display: flex; flex-direction: column; align-items: stretch; }
.arena.stage .prefight-stage .pf-go .enter { width: 100%; padding-left: 10px; padding-right: 10px; }
.arena.stage .prefight-stage .fight-why { text-align: center; }
.arena.stage .pf-lud { display: flex; align-items: center; gap: 10px; margin: 2px 0 8px; }
.arena.stage .pf-lud .hero-face { position: relative; width: clamp(110px, 14vw, 216px); flex: none; }
.arena.stage .pf-lud .hero-face :is(img, :where(ludi-face)) { position: relative; width: 100%; height: auto; display: block; filter: drop-shadow(0 8px 10px rgba(0,0,0,.45)); }
.arena.stage .pf-lud .hero-face .rays { position: absolute; inset: -12%; } .arena.stage .pf-lud .hero-face .rays svg { width: 100%; height: 100%; }
.arena.stage .pf-lud .bubble { font-size: .9rem; padding: 8px 14px; }
/* ONE KIND OF KEY on the stage: the market, the pre-fight screen and the fight */
.arena.stage button.pill, .arena.stage button.small, .arena.stage .pf-foot button, .arena.stage .band-go > button:not(.enter), .arena.stage .band-go .more > button, .arena.stage .buy-dp,
.battle.wide.stage .toolbar button, .battle.wide.stage .st-tools button, .battle.wide.stage .buttons button:not(.primary) {
  background: rgba(79,36,99,.8); background-image: none; border: 2px solid var(--rose); color: var(--cream); border-radius: 10px; box-shadow: 0 3px 0 rgba(0,0,0,.35); font-weight: 700; text-shadow: none; }
.arena.stage button.pill:hover, .arena.stage button.small:hover, .arena.stage .pf-foot button:hover, .arena.stage .band-go > button:not(.enter):hover, .arena.stage .buy-dp:hover,
.battle.wide.stage .toolbar button:hover, .battle.wide.stage .st-tools button:hover, .battle.wide.stage .buttons button:not(.primary):hover { border-color: var(--gold-1); background: rgba(95,44,118,.95); }
.arena.stage .buy-dp .price { color: var(--gold-1); }
.battle.wide.stage .st-tools button.on { border-color: var(--gold-1); background: #6a3183; }
@media (max-height: 520px) {
  .arena.stage .prefight-stage { gap: 10px; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .arena.stage .prefight-stage > .pcol:first-child, .arena.stage .prefight-stage > .pcol:last-child { width: min(100%, 236px); }
  .arena.stage .pf-lud { margin: 0 0 2px; gap: 6px; } .arena.stage .pf-lud .hero-face { width: clamp(84px, 12.5vw, 120px); } .arena.stage .pf-lud :is(img, :where(ludi-face)) { width: 100%; }
  .arena.stage .pf-lud .bubble { display: block; font-size: .62rem; padding: 3px 8px; }
  .arena.stage .prefight-stage .pf-hint { font-size: .6rem; } .arena.stage .prefight-stage .pf-foot { margin-top: 3px; padding-top: 0; }
  .arena.stage .prefight-stage .pf-go { padding-top: 4px; }
}
@media (max-width: 700px) and (orientation: landscape) {
  .arena.stage .prefight-stage { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 6px; }
  .arena.stage .prefight-stage > .pcol:first-child, .arena.stage .prefight-stage > .pcol:last-child { width: min(100%, 150px); }
  .arena.stage .pf-lud .hero-face { width: 70px; } .arena.stage .pf-lud .bubble { display: none; }
  .arena.stage .prefight-stage .pf-hint { display: none; }
}
@media (orientation: portrait) { .arena.stage .prefight-stage { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); } }

/* the fight after the same review: Ludivar's clock is half again as big, and
   on a phone on its side the board has the height (webui/battle.js) */
.battle.wide.stage .lclock { width: clamp(150px, 16vw, 236px); height: clamp(150px, 16vw, 236px); }
.battle.wide.stage .lclock .n { font-size: 2.6rem; } .battle.wide.stage .lclock .n-lbl { font-size: .7rem; }
.arena.stage .pf-lud .hero-face { margin-left: 8%; }
@media (max-height: 520px) {
  .battle.wide.stage .lclock { width: 122px; height: 122px; } .battle.wide.stage .lclock .n { font-size: 1.7rem; }
  .battle.wide.stage .quote { margin-top: 4px; font-size: .8rem; padding: 3px 14px; }
}
@media (max-width: 700px) and (orientation: landscape) {
  .battle.wide.stage .lclock { width: 84px; height: 84px; } .battle.wide.stage .lclock .n { font-size: 1.2rem; }
  .battle.wide.stage .quote { font-size: .6rem; padding: 2px 10px; margin-top: 3px; }
}
/* he keeps his rays inside his column, with what he says under him; and on a
   short market he is as tall as the height lets him be */
.arena.stage .pf-lud { flex-direction: column; align-items: center; gap: 6px; }
.arena.stage .pf-lud .hero-face { width: min(clamp(110px, 14vw, 216px), 72%); margin: 0 auto; }
.arena.stage .pf-lud .bubble { align-self: stretch; text-align: center; max-width: none; }
.arena.stage .pf-lud .bubble::before { display: none; }
@media (max-height: 520px) {
  .arena.stage .pf-lud { flex-direction: row; align-items: center; } .arena.stage .pf-lud .hero-face { width: clamp(84px, 12.5vw, 120px); margin: 0 6% 0 8%; }
  .arena.stage .pf-lud .bubble { align-self: center; text-align: left; }
  .arena.stage .market-stage .hero-face { width: clamp(52px, 21vh, 96px); } .arena.stage .market-stage .hero-title { font-size: clamp(1rem, 5.4vh, 1.5rem); }
}
@media (max-width: 700px) and (orientation: landscape) {
  .arena.stage .pf-lud .hero-face { width: 70px; margin: 0 auto; }
  .arena.stage .market-stage .hero-face { width: 44px; } .arena.stage .market-stage .hero-title { font-size: .9rem; }
}

/* AFTER THE SECOND REVIEW (user, 12-01, of the pre-fight screen at 8/10):
   "Simplify the board frame ... One distinctive frame"; "Make Ludivar's
   yellow rays temporary. They should appear when he gets excited"; "Redesign
   the secondary buttons. Auto, Clear, Undo and the upper-right controls are
   the last major remnants of the web-app aesthetic"; "Improve the empty
   coupon slots ... much more subdued". (The pieces were flattened in
   webui/build_pieces.py, the board's grain and edge in webui/app.js.) */
/* ONE FRAME round the board: gold, straight on the squares' dark keyline */
.battle.wide.stage .boardslot, .arena.stage .pcol.mid .boardslot { padding: 0; border: 4px solid var(--gold-1); border-radius: 10px; background: none; overflow: hidden;
  box-shadow: 0 0 0 2px #1e0b29, 0 14px 34px rgba(0,0,0,.5); }
.battle.wide.stage .boardslot canvas, .arena.stage .pcol.mid .boardslot canvas { display: block; }
/* HIS RAYS burst out with an excited face and are gone with the rest */
.hero-face .rays { opacity: 0; transform: scale(.72); transition: opacity .25s, transform .25s; }
.hero-face.lit .rays { opacity: 1; transform: scale(1); animation: rays-pop .5s cubic-bezier(.3, 1.6, .5, 1) 1; }
@keyframes rays-pop { 0% { opacity: 0; transform: scale(.6) rotate(-8deg); } 60% { opacity: 1; transform: scale(1.12) rotate(3deg); } 100% { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .hero-face.lit .rays { animation: none; } }
/* THE KEYS: a cut-cornered plate, a rose rim thicker under it, capitals --
   something you press on a table, not a link on a page */
.arena.stage button.pill, .arena.stage button.small, .arena.stage .pf-foot button, .arena.stage .band-go > button:not(.enter), .arena.stage .buy-dp, .arena.stage .mkeys button,
.battle.wide.stage .toolbar button, .battle.wide.stage .st-tools button, .battle.wide.stage .buttons button:not(.primary),
#app.look button:not(.pg):not(.primary):not(.enter):not(.pick):not(.sc-feat):not(.save-tab):not(.why):not(.heat-step):not(.tap),
body:has(#app.look, #app.stage, .battle.stage) #sfx, body:has(#app.look, #app.stage, .battle.stage) #flag, body:has(#app.look, #app.stage, .battle.stage) #saves {
  position: relative; isolation: isolate; border: 0 !important; border-radius: 0 !important; background: var(--rose) !important; background-image: none !important; box-shadow: none !important;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  color: var(--cream); font-weight: 900; text-transform: uppercase; letter-spacing: .09em; text-shadow: 0 1px 0 rgba(0,0,0,.45); }
.arena.stage button.pill::before, .arena.stage button.small::before, .arena.stage .pf-foot button::before, .arena.stage .band-go > button:not(.enter)::before, .arena.stage .buy-dp::before, .arena.stage .mkeys button::before,
.battle.wide.stage .toolbar button::before, .battle.wide.stage .st-tools button::before, .battle.wide.stage .buttons button:not(.primary)::before,
#app.look button:not(.pg):not(.primary):not(.enter):not(.pick):not(.sc-feat):not(.save-tab):not(.why):not(.heat-step):not(.tap)::before,
body:has(#app.look, #app.stage, .battle.stage) #sfx::before, body:has(#app.look, #app.stage, .battle.stage) #flag::before, body:has(#app.look, #app.stage, .battle.stage) #saves::before {
  content: ""; position: absolute; inset: 2px 2px 5px 2px; z-index: -1; background: linear-gradient(180deg, #653080, #44204f);
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px); }
.arena.stage button.pill:hover, .arena.stage button.small:hover, .arena.stage .pf-foot button:hover, .arena.stage .band-go > button:not(.enter):hover, .arena.stage .buy-dp:hover, .arena.stage .mkeys button:hover,
.battle.wide.stage .toolbar button:hover, .battle.wide.stage .st-tools button:hover, .battle.wide.stage .buttons button:not(.primary):hover,
#app.look button:not(.pg):not(.primary):not(.enter):not(.pick):not(.sc-feat):not(.save-tab):not(.why):not(.heat-step):not(.tap):hover:not(:disabled),
body:has(#app.look, #app.stage, .battle.stage) #sfx:hover, body:has(#app.look, #app.stage, .battle.stage) #flag:hover, body:has(#app.look, #app.stage, .battle.stage) #saves:hover { background: var(--gold-1) !important; }
.arena.stage button.pill:active, .arena.stage button.small:active, .arena.stage .pf-foot button:active, .arena.stage .mkeys button:active, .battle.wide.stage .toolbar button:active, .battle.wide.stage .st-tools button:active { transform: translateY(2px); }
.battle.wide.stage .st-tools button.on { background: var(--gold-1) !important; } .battle.wide.stage .st-tools button.on::before { background: linear-gradient(180deg, #7a3a96, #57286b); }
.arena.stage .mkeys button.dimmed, .arena.stage .mkeys button:disabled { opacity: .55; }
.arena.stage button.pill, .arena.stage button.small, .arena.stage .pf-foot button { font-size: .72rem; padding: 6px 12px 8px; }
body:has(#app.look, #app.stage, .battle.stage) #sfx, body:has(#app.look, #app.stage, .battle.stage) #flag, body:has(#app.look, #app.stage, .battle.stage) #saves { opacity: 1; overflow: visible; }
body:has(#app.look, #app.stage, .battle.stage) #sfx svg, body:has(#app.look, #app.stage, .battle.stage) #flag svg, body:has(#app.look, #app.stage, .battle.stage) #saves svg { position: relative; top: -1px; }
/* AN EMPTY COUPON SLOT is a faint seat, not a dashed box: the coupons you win bring the colour */
.arena.stage .prefight-stage .ak-coupons .slot.free, .battle.wide.stage .st-army .ak-coupons .slot.free, .arena.stage .mc-slot.free {
  border: 0 !important; background: rgba(247,232,198,.045) !important; opacity: 1; box-shadow: inset 0 0 0 1px rgba(247,232,198,.05); }
body:has(#app.look, #app.stage, .battle.stage) #sfx, body:has(#app.look, #app.stage, .battle.stage) #flag, body:has(#app.look, #app.stage, .battle.stage) #saves { position: fixed !important; }
/* (a key's words stay on one line; his clock leaves room for its number) */
.battle.wide.stage .st-tools button, .arena.stage .mkeys button { white-space: nowrap; letter-spacing: .04em; }
.battle.wide.stage .st-tools button { font-size: .7rem; } .arena.stage .mkeys button { font-size: .86rem; }
.battle.wide.stage .lclock { margin-right: 15%; }
@media (max-height: 520px) { .arena.stage .mkeys button { font-size: .64rem; letter-spacing: .02em; } .battle.wide.stage .st-tools button { font-size: .54rem; letter-spacing: 0; }
  .arena.stage button.pill, .arena.stage button.small, .arena.stage .pf-foot button { font-size: .6rem; padding: 4px 8px 6px; } }
/* A LATE FIGHT (the same review: "I'd particularly like to see this screen
   during a late-game encounter, with both sides having ten coupons, numerous
   reserves"): staged with ten coupons a side and six reserves, their column
   ran off the foot and took the gold door with it. The door stays at the
   foot of the column whatever is above it, and he stands smaller when their
   kit is large. */
.arena.stage .prefight-stage .pf-go { position: sticky; bottom: 0; z-index: 2; padding-top: 8px; padding-bottom: 6px; background: linear-gradient(180deg, rgba(46,18,64,0), #2e1240 34%); }
.arena.stage .prefight-stage .pcol.busy .pf-lud .hero-face { width: min(clamp(84px, 9vw, 130px), 46%); }
.arena.stage .prefight-stage .pcol.busy .pf-lud { margin-bottom: 2px; }
@media (max-height: 520px) {
  .arena.stage .prefight-stage .pcol.busy .pf-lud .hero-face { width: 58px; margin: 0 4%; }
  .arena.stage .prefight-stage .pcol.busy .ak-tokens { min-height: 28px; padding: 2px; } .arena.stage .prefight-stage .pcol.busy .ak-tokens .stack { width: 26px; height: 26px; }
  .arena.stage .prefight-stage .pcol.busy .ak-tokens .stack canvas { width: 24px !important; height: 24px !important; }
  .arena.stage .prefight-stage .pcol.busy .linkish { font-size: .66rem; padding: 0; }
  .arena.stage .prefight-stage .pf-go { padding-top: 3px; padding-bottom: 2px; }
}
/* (the menu's second door out is a link, not a button: the same key) */
#app.menu.look .menu-links a.library-btn { position: relative; isolation: isolate; border: 0; border-radius: 0; background: var(--rose); box-shadow: none; text-decoration: none;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); color: var(--cream); font-weight: 900; text-transform: uppercase; letter-spacing: .09em; }
#app.menu.look .menu-links a.library-btn::before { content: ""; position: absolute; inset: 2px 2px 5px 2px; z-index: -1; background: linear-gradient(180deg, #653080, #44204f);
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px); }
#app.menu.look .menu-links a.library-btn:hover { background: var(--gold-1); }

/* AFTER THE THIRD REVIEW (user, 12-01, of the late-game staging): "Ludivar
   is too small again ... Double his size and center him horizontally above
   the enemy army"; "Enemy coupons are too small ... compressed into a single
   row of ten ... Give them equal visual readability". With a full kit under
   him he stands centred and as tall as the height allows, and their coupons
   are two rows of five, the size of yours. (The wood streaks went in
   webui/app.js, the studs in webui/build_pieces.py.) */
.arena.stage .prefight-stage .pcol.busy .pf-lud { flex-direction: column; align-items: center; margin: 0 0 4px; }
.arena.stage .prefight-stage .pcol.busy .pf-lud .hero-face { width: min(clamp(110px, 12vw, 190px), 64%); margin: 0 auto; }
.arena.stage .prefight-stage .pcol.busy .pf-lud .bubble { display: none; }
@media (max-height: 520px) {
  .arena.stage .prefight-stage .pcol.busy .pf-lud .hero-face { width: clamp(64px, 22vh, 104px); margin: 0 auto; }
  .arena.stage .prefight-stage .pcol.busy .pf-lud { margin: 0; }
  .arena.stage .prefight-stage .pcol.busy .ak-tokens { border: 0; padding: 0; background: none; min-height: 26px; gap: 3px; }
  .arena.stage .prefight-stage .pcol.busy { gap: 2px; }
  .arena.stage .prefight-stage .pcol.busy .ak-coupons { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
  .arena.stage .prefight-stage .pcol.busy .pf-h { margin-top: 1px; }
  .arena.stage .prefight-stage .pcol.busy .tag { margin: 0; }
}

/* THE STAGE'S PROPORTIONS (user, 12-01, a fourth review, of the pre-fight
   screen at 1920x1080: "the desktop layout has regressed ... Your main
   container appears to have a maximum width, while the board scales with the
   viewport height. Consequently, the side panels get squeezed even though
   there is unused space on both sides"; the target it gives: your panel 24%,
   the board 46%, their panel 24%, margins and gaps 6%). The stage is as wide
   as the window; the board's column is 48% of it (the board in it about
   46%), the two armies share the rest, and what they hold grows with them. */
#app.arena.stage, #app.battle.wide.stage { max-width: min(97vw, 2400px); }
.arena.stage .prefight-stage { grid-template-columns: minmax(0, 1fr) minmax(0, 48%) minmax(0, 1fr); gap: 2%; }
.arena.stage .prefight-stage > .pcol:first-child, .arena.stage .prefight-stage > .pcol:last-child { width: auto; justify-self: stretch; }
.arena.stage .prefight-stage .pcol.mid { align-items: center; justify-content: center; }
.battle.wide.stage { grid-template-columns: minmax(0, 1fr) minmax(0, 48%) minmax(0, 1fr); gap: 10px 2%; }
@media (min-width: 1000px) and (min-height: 521px) {
  /* what the two armies hold grows with their panels */
  .arena.stage .prefight-stage .army-tray { gap: clamp(6px, .6vw, 12px); }
  .arena.stage .prefight-stage .army-tray .tile.pc { width: clamp(50px, 4.3vw, 88px); min-height: 0; }
  .arena.stage .prefight-stage .army-tray .tile.pc canvas { width: 100% !important; height: auto !important; aspect-ratio: 1; }
  .arena.stage .prefight-stage .ak-coupons { gap: clamp(5px, .5vw, 10px); }
  .arena.stage .prefight-stage .ak-tokens { gap: clamp(5px, .6vw, 12px); padding: clamp(6px, .6vw, 12px); }
  .arena.stage .prefight-stage .ak-tokens .stack { width: clamp(42px, 3.5vw, 72px); height: clamp(42px, 3.5vw, 72px); }
  .arena.stage .prefight-stage .ak-tokens .stack canvas { width: 88% !important; height: 88% !important; }
  .arena.stage .pf-h { font-size: clamp(.72rem, .82vw, 1.05rem); margin-top: clamp(4px, .6vw, 12px); }
  .arena.stage .prefight-stage .tag { font-size: clamp(.85rem, 1vw, 1.3rem); padding: 4px clamp(18px, 1.6vw, 30px); }
  .arena.stage .pf-points .row { font-size: clamp(.85rem, .95vw, 1.2rem); } .arena.stage .pf-points b { font-size: clamp(1.3rem, 1.7vw, 2.2rem); }
  .arena.stage .pf-points .bar { height: clamp(8px, .6vw, 12px); border-radius: 6px; }
  .arena.stage .prefight-stage .pf-hint { font-size: clamp(.8rem, .85vw, 1.05rem); }
  .arena.stage .prefight-stage .linkish { font-size: clamp(.85rem, 1vw, 1.25rem); }
  .arena.stage .prefight-stage button.pill, .arena.stage .prefight-stage button.small, .arena.stage .prefight-stage .pf-foot button { font-size: clamp(.72rem, .8vw, 1rem); padding: clamp(6px, .5vw, 10px) clamp(12px, 1vw, 20px) clamp(8px, .6vw, 12px); }
  .arena.stage .prefight-stage .pf-go .enter { font-size: clamp(1.5rem, 1.9vw, 2.4rem); padding: clamp(10px, .9vw, 18px) 10px; }
  .arena.stage .pf-lud .hero-face { width: min(clamp(110px, 15vw, 320px), 70%); }
  .arena.stage .prefight-stage .pcol.busy .pf-lud .hero-face { width: min(clamp(110px, 11vw, 240px), 56%); }
  .arena.stage .pf-lud .bubble { font-size: clamp(.9rem, 1vw, 1.25rem); }
  .arena.stage.prefight .stagebar .title { font-size: clamp(1.3rem, 2.6vw, 3rem); }
  /* the fight */
  .battle.wide.stage .st-army .ak-coupons { gap: clamp(5px, .5vw, 10px); }
  .battle.wide.stage .st-army .ak-tokens { gap: clamp(5px, .6vw, 12px); padding: clamp(6px, .6vw, 12px); min-height: clamp(46px, 4vw, 84px); }
  .battle.wide.stage .st-army .ak-tokens .stack { width: clamp(40px, 3.4vw, 70px); height: clamp(40px, 3.4vw, 70px); }
  .battle.wide.stage .st-army .ak-tokens .stack canvas { width: 86% !important; height: 86% !important; }
  .battle.wide.stage .st-army .ak-h { font-size: clamp(.7rem, .8vw, 1.05rem); margin: clamp(8px, .7vw, 14px) 0 clamp(5px, .4vw, 9px); }
  .battle.wide.stage .army-h { font-size: clamp(.82rem, 1vw, 1.3rem); padding: 4px clamp(18px, 1.6vw, 30px); }
  .battle.wide.stage .readout .t { font-size: clamp(1.3rem, 2.3vw, 2.8rem); } .battle.wide.stage .readout .t .turn-no { font-size: clamp(.82rem, .95vw, 1.2rem); }
  .battle.wide.stage .readout .d { font-size: clamp(.82rem, .95vw, 1.15rem); }
  .battle.wide.stage .st-tools button { font-size: clamp(.7rem, .8vw, 1rem); padding: clamp(7px, .6vw, 12px) 4px clamp(9px, .7vw, 14px); }
  .battle.wide.stage .toolbar button { font-size: clamp(.8rem, .85vw, 1.05rem); }
  .battle.wide.stage .lclock { width: clamp(150px, 15vw, 300px); height: clamp(150px, 15vw, 300px); }
  .battle.wide.stage .lclock .n { font-size: clamp(2.6rem, 3.2vw, 4rem); } .battle.wide.stage .lclock .n-lbl { font-size: clamp(.7rem, .75vw, 1rem); }
  .battle.wide.stage .stagebar .title { font-size: clamp(1.3rem, 2.6vw, 3rem); }
  .battle.wide.stage .quote { font-size: clamp(1.02rem, 1.15vw, 1.5rem); }
}
@media (max-width: 700px) and (orientation: landscape) {
  .arena.stage .prefight-stage { grid-template-columns: minmax(0, 150px) minmax(0, 1fr) minmax(0, 150px); gap: 6px; }
  .battle.wide.stage { grid-template-columns: minmax(0, 146px) minmax(0, 1fr) minmax(0, 146px); gap: 2px 8px; }
}
.arena.stage .prefight-stage .pf-go .enter { width: calc(100% - 20px); margin: 0 10px; }
/* the market on the same wide stage: what it shows grows with the window */
@media (min-width: 1000px) and (min-height: 521px) {
  .arena.stage .market-stage { gap: 2%; }
  .arena.stage .market-stage .hero-face { width: clamp(110px, 13vw, 270px); }
  .arena.stage .market-stage .hero-title { font-size: clamp(1.8rem, 3.6vw, 4.6rem); }
  .arena.stage .market-stage .bubble { font-size: clamp(.85rem, 1.25vw, 1.6rem); max-width: clamp(280px, 22vw, 460px); padding: clamp(10px, .8vw, 16px) clamp(18px, 1.4vw, 28px); }
  .arena.stage .market-stage .sec-h { font-size: clamp(.78rem, .85vw, 1.1rem); }
  .arena.stage .recruit .rc-token { width: clamp(84px, 6.6vw, 140px); height: clamp(84px, 6.6vw, 140px); }
  .arena.stage .recruit .rc-token canvas { width: 96% !important; height: 96% !important; }
  .arena.stage .recruit .rc-name { font-size: clamp(.95rem, 1.05vw, 1.4rem); max-width: clamp(110px, 9vw, 190px); }
  .arena.stage .recruit .rc-price { font-size: clamp(1.35rem, 1.6vw, 2.1rem); }
  .arena.stage .mkeys { gap: clamp(10px, .8vw, 16px); margin-top: clamp(12px, 1.2vw, 26px); }
  .arena.stage .mkeys button { font-size: clamp(.86rem, .95vw, 1.25rem); padding: clamp(10px, .8vw, 16px) 4px clamp(12px, .9vw, 18px); }
  .arena.stage .fs-card .fs-name { font-size: clamp(.78rem, .9vw, 1.2rem); } .arena.stage .fs-card .fs-price { font-size: clamp(1.05rem, 1.2vw, 1.6rem); }
  .arena.stage .next-name { font-size: clamp(1.2rem, 1.4vw, 1.9rem); } .arena.stage .sleft.framed .tag { font-size: clamp(.85rem, .95vw, 1.2rem); }
  .arena.stage .sleft .linkish { font-size: clamp(.85rem, .95vw, 1.2rem); }
  .arena.stage .market-band .army-tray { gap: clamp(8px, .7vw, 14px); }
  .arena.stage .market-band .army-tray .tile.pc { width: clamp(60px, 4.4vw, 96px); min-height: 0; }
  .arena.stage .market-band .army-tray .tile.pc canvas { width: 88% !important; height: auto !important; aspect-ratio: 1; }
  .arena.stage .market-band .my-coupons { max-width: clamp(620px, 44vw, 980px); gap: clamp(6px, .5vw, 10px); }
  .arena.stage .market-band .sec-h { font-size: clamp(.78rem, .85vw, 1.1rem); }
  .arena.stage .band-points { font-size: clamp(.9rem, .95vw, 1.2rem); }
  .arena.stage .band-go .enter { font-size: clamp(1.5rem, 1.9vw, 2.4rem); padding: clamp(10px, .8vw, 16px) clamp(40px, 3vw, 64px); }
  .arena.stage .stagebar .crumb { font-size: clamp(.78rem, .8vw, 1.05rem); } .arena.stage .stagebar .purse { font-size: clamp(1.35rem, 1.5vw, 1.9rem); }
  .battle.wide.stage .stagebar .crumb { font-size: clamp(.78rem, .8vw, 1.05rem); } .battle.wide.stage .stagebar .purse { font-size: clamp(1.15rem, 1.5vw, 1.9rem); }
}

/* AFTER THE FIFTH REVIEW (user, 12-01, of the layout at 8.5/10: "stop
   changing the proportions"; the details it lists, and Ludivar "by another
   25%"). */
/* he is a quarter bigger before a fight, and he watches the pointer (webui/app.js) */
.arena.stage .pf-lud .hero-face { width: min(clamp(138px, 18.5vw, 400px), 82%); }
.arena.stage .prefight-stage .pcol.busy .pf-lud .hero-face { width: min(clamp(138px, 12.4vw, 280px), 60%); }
.hero-face :is(img, :where(ludi-face)), .battle.wide.stage .lclock :is(img, :where(ludi-face)) { transition: translate .35s cubic-bezier(.2, .7, .3, 1), rotate .35s cubic-bezier(.2, .7, .3, 1); }
@media (max-height: 520px) {
  .arena.stage .pf-lud .hero-face { width: clamp(104px, 15.5vw, 150px); }
  .arena.stage .prefight-stage .pcol.busy .pf-lud .hero-face { width: clamp(78px, 23vh, 112px); }
}
@media (max-width: 700px) and (orientation: landscape) { .arena.stage .pf-lud .hero-face, .arena.stage .prefight-stage .pcol.busy .pf-lud .hero-face { width: 76px; } }
/* "Back to Market unnecessarily wraps onto two lines" */
.arena.stage .pf-foot button { white-space: nowrap; }
.arena.stage .pf-foot .back-short { display: none; }
@media (max-width: 1100px) { .arena.stage .pf-foot .back-long { display: none; } .arena.stage .pf-foot .back-short { display: inline; } }
/* "The bench label overlaps the piece's point counter": the points sit on the
   token's shoulder, the word under it */
.arena.stage .army-tray .tile.pc { position: relative; }
.arena.stage .army-tray .tile.pc .cost { top: -2px; left: 0; }
.arena.stage .prefight-stage .army-tray { padding: 3px 0 0 2px; }
.arena.stage .army-tray .tile.pc .bench-word { margin-top: 3px; text-align: center; color: #c9a0e6; }
/* "Secondary buttons still have slightly excessive bevels": the rim is the same all round but a hair under */
.arena.stage button.pill::before, .arena.stage button.small::before, .arena.stage .pf-foot button::before, .arena.stage .band-go > button:not(.enter)::before, .arena.stage .buy-dp::before, .arena.stage .mkeys button::before,
.battle.wide.stage .toolbar button::before, .battle.wide.stage .st-tools button::before, .battle.wide.stage .buttons button:not(.primary)::before,
#app.look button:not(.pg):not(.primary):not(.enter):not(.pick):not(.sc-feat):not(.save-tab):not(.why):not(.heat-step):not(.tap)::before,
body:has(#app.look, #app.stage, .battle.stage) #sfx::before, body:has(#app.look, #app.stage, .battle.stage) #flag::before, body:has(#app.look, #app.stage, .battle.stage) #saves::before,
#app.menu.look .menu-links a.library-btn::before { inset: 2px 2px 3px 2px; background: #542766; }
/* "The outer border enclosing the entire interface is unnecessary" */
#app.arena.stage, #app.battle.wide.stage, .battle.wide.stage, #app.look { border: 0 !important; border-radius: 0; background: none !important; }
/* "stronger typographic hierarchy": a label is quiet, what it counts is not */
.arena.stage .pf-h, .battle.wide.stage .st-army .ak-h { color: #c9a0e6; font-weight: 700; }
.arena.stage .pf-h > span:first-child::first-line { color: #c9a0e6; }
.battle.wide.stage .st-army .ak-h b { color: var(--cream); font-weight: 900; }
.arena.stage .pf-points b { color: var(--gold-1); text-shadow: 0 2px 0 #1e0b29; }
.arena.stage .prefight-stage .pf-hint { font-style: italic; }

/* AFTER THE SIXTH REVIEW (user, 12-01, at 8.7/10: "I'd keep this layout and
   build the spectacle on top of it"). */
/* "a subtle, solid offset shadow underneath the board to give it physical
   presence. No wood texture or glossy effects": one flat shape, down and to the right */
.battle.wide.stage .boardslot, .arena.stage .pcol.mid .boardslot { box-shadow: 0 0 0 2px #1e0b29, 12px 14px 0 rgba(15,4,20,.6); }
.arena.stage .sleft .boardslot canvas { box-shadow: 6px 7px 0 rgba(15,4,20,.55); }
/* "The purple colors are slightly too uniform ... A little more contrast
   between these elements": the room is darker and cooler, the keys warmer
   (wine, not violet), a seat for a coupon is ink, so the board and the
   coupons are the brightest things in it */
body:has(#app.look), body:has(#app.stage), body:has(.battle.stage) { background: radial-gradient(ellipse at 50% 28%, #35153f 0%, #1f0d2a 55%, #12071a 100%) !important; }
.arena.stage button.pill::before, .arena.stage button.small::before, .arena.stage .pf-foot button::before, .arena.stage .band-go > button:not(.enter)::before, .arena.stage .buy-dp::before, .arena.stage .mkeys button::before,
.battle.wide.stage .toolbar button::before, .battle.wide.stage .st-tools button::before, .battle.wide.stage .buttons button:not(.primary)::before,
#app.look button:not(.pg):not(.primary):not(.enter):not(.pick):not(.sc-feat):not(.save-tab):not(.why):not(.heat-step):not(.tap)::before,
body:has(#app.look, #app.stage, .battle.stage) #sfx::before, body:has(#app.look, #app.stage, .battle.stage) #flag::before, body:has(#app.look, #app.stage, .battle.stage) #saves::before,
#app.menu.look .menu-links a.library-btn::before { background: #5c2148; }
.battle.wide.stage .st-tools button.on::before { background: #7c2f60; }
.arena.stage .prefight-stage .ak-coupons .slot.free, .battle.wide.stage .st-army .ak-coupons .slot.free, .arena.stage .mc-slot.free { background: rgba(10,3,14,.26) !important; box-shadow: inset 0 0 0 1px rgba(247,232,198,.05); }
.battle.wide.stage .toolbar { background: none !important; box-shadow: none !important; border: 0 !important; }
/* NOTHING ON TOP OF ANYTHING in a short window (user, 12-01, report
   20261201-115334-de5ca5: "Things are on top each other such that you can't
   click or see them"): at 873x325 the history/Pass/Undo bar, kept at the foot
   of a column that scrolls, lay see-through over the coupons -- it is backed
   again so the coupons pass UNDER it, and the bar's right end (items, wager,
   purse) never runs over the name: the name gives way, cut short */
.battle.wide.stage .col.side.mine .toolbar { background: linear-gradient(180deg, rgba(28,12,40,0), #1c0c28 10px) !important; z-index: 2; }
.battle.wide.stage .stagebar.fodder { grid-template-columns: minmax(0, 1fr) auto; }
.battle.wide.stage .stagebar.fodder .title { display: none; }
.battle.wide.stage .stagebar.fodder .crumb { overflow: visible; text-overflow: clip; }
@media (max-height: 520px) {
  .battle.wide.stage .stagebar:not(.fodder) { grid-template-columns: auto minmax(0, 1fr) auto; }
}
.arena.stage .prefight-stage .ak-tokens, .battle.wide.stage .st-army .ak-tokens { background: rgba(10,3,14,.4); border-color: rgba(201,163,90,.35); }
.arena.stage .prefight-stage .ak-coupons .slot:not(.free), .battle.wide.stage .st-army .ak-coupons .slot:not(.free) { background: #241a4a; }

/* THE VOID (user, 12-01: "Perhaps having it multiversal and cosmic would be
   better", with a review: "The interface communicates a polished fantasy
   board game, but not a multiversal tournament hosted by a cosmic entity ...
   I would change the environmental art direction without changing the
   layout"; "I wouldn't use a conventional galaxy background. Stars, nebulas
   and planets are generic shortcuts ... make the universe itself feel like an
   abstract game"; "barely noticeable during ordinary play").
   Behind every screen that lies on its side the room is gone: two endless
   game boards, one under the arena and one over it, run to a horizon in the
   dark and slide slowly toward you; loose squares turn in the space between.
   No stars. Each reality has its own board: a kingdom's checkers, the East's
   ruled lines, a magical faction's lozenges, and gold for Ludivar's own
   domain (html[data-realm], set by webui/app.js setRealm). CSS only, no
   pictures; still under reduced motion. */
html:has(#app.look, #app.stage, .battle.stage) { background: #0c0412; --void-glow: rgba(96,40,122,.5); --void-line: rgba(196,150,255,.5);
  --void-ink: rgba(247,232,198,.07); --void-cell: 72px; --void-pattern: repeating-conic-gradient(var(--void-ink) 0 25%, transparent 0 50%); }
html[data-realm="kingdom"]:has(#app.look, #app.stage, .battle.stage) { --void-glow: rgba(70,52,130,.5); --void-line: rgba(150,170,255,.5); --void-ink: rgba(214,222,255,.075); }
html[data-realm="east"]:has(#app.look, #app.stage, .battle.stage) { --void-glow: rgba(122,34,58,.5); --void-line: rgba(255,150,140,.5); --void-ink: rgba(255,170,150,.14); --void-cell: 64px;
  --void-pattern: linear-gradient(var(--void-ink) 2px, transparent 2px), linear-gradient(90deg, var(--void-ink) 2px, transparent 2px); }
html[data-realm="magic"]:has(#app.look, #app.stage, .battle.stage) { --void-glow: rgba(30,96,110,.5); --void-line: rgba(130,235,220,.5); --void-ink: rgba(150,240,225,.07); --void-cell: 84px;
  --void-pattern: repeating-conic-gradient(from 45deg, var(--void-ink) 0 25%, transparent 0 50%); }
html[data-realm="ludivar"]:has(#app.look, #app.stage, .battle.stage) { --void-glow: rgba(104,44,120,.52); --void-line: rgba(244,192,74,.55); --void-ink: rgba(244,192,74,.06); }
body:has(#app.look), body:has(#app.stage), body:has(.battle.stage) { background: none !important; }
html:has(#app.look, #app.stage, .battle.stage) .realm .stars, html:has(#app.look, #app.stage, .battle.stage) .realm .comet { display: none; }
html:has(#app.look, #app.stage, .battle.stage) .realm .glow { inset: 0; animation: none; transition: background 1.2s;
  background: radial-gradient(ellipse 70% 60% at 50% 50%, var(--void-glow) 0%, rgba(34,12,46,.42) 42%, rgba(12,4,18,0) 78%); }
/* the two endless boards are ONE STILL DRAWING made of shapes, built once by
   webui/app.js buildVoid (user, 12-01: "the game has become extremely slow
   now"; "don't ever use the canvas, only rendered components"): as two
   tilted, masked planes they cost the browser every frame anything else moved
   (measured: 60 frames a second without them, 23-32 with, 7 on a phone).
   NOTHING IN THE VOID LOOPS; it moves only in the moment he breaks the board. */
.realm svg.vb, .realm .horizon, .realm .drift { display: none; }
html:has(#app.look, #app.stage, .battle.stage) .realm svg.vb, html:has(#app.look, #app.stage, .battle.stage) .realm .horizon, html:has(#app.look, #app.stage, .battle.stage) .realm .drift { display: block; }
html:has(#app.look, #app.stage, .battle.stage) .realm svg.vb { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--void-ink); }
.realm svg.vb stop { stop-color: currentColor; }
.realm svg.vb g { display: none; } .realm svg.vb g.checks { display: inline; }
html[data-realm="east"] .realm svg.vb g.checks, html[data-realm="magic"] .realm svg.vb g.checks { display: none; }
html[data-realm="east"] .realm svg.vb g.lines, html[data-realm="magic"] .realm svg.vb g.lozenges { display: inline; }
html:has(#app.look, #app.stage, .battle.stage) .realm .floor { display: none; }
/* where they meet */
html:has(#app.look, #app.stage, .battle.stage) .realm .horizon { left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px; opacity: .42;
  background: linear-gradient(90deg, transparent, var(--void-line) 30%, var(--void-line) 70%, transparent); box-shadow: 0 0 46px 8px var(--void-glow); transition: background 1.2s; }
/* loose squares, turning in the space between */
html:has(#app.look, #app.stage, .battle.stage) .realm .drift { inset: 0; perspective: 900px; }
.realm .drift b { position: absolute; display: block; border: 2px solid var(--void-line); background: rgba(247,232,198,.025); opacity: .34; transform: rotateX(58deg) rotateZ(8deg); }
.realm .drift b:nth-child(1) { left: 5%; top: 16%; width: 54px; height: 54px; }
.realm .drift b:nth-child(2) { left: 91%; top: 22%; width: 82px; height: 82px; }
.realm .drift b:nth-child(3) { left: 2%; top: 70%; width: 104px; height: 104px; opacity: .22; }
.realm .drift b:nth-child(4) { left: 95%; top: 74%; width: 46px; height: 46px; }
.realm .drift b:nth-child(5) { left: 47%; top: 3%; width: 34px; height: 34px; opacity: .26; }
.realm .drift b:nth-child(6) { left: 58%; top: 93%; width: 62px; height: 62px; opacity: .26; }
.realm .drift b:nth-child(1) { transform: rotateX(58deg) rotateZ(8deg); }
.realm .drift b:nth-child(2) { transform: rotateX(24deg) rotateY(38deg) rotateZ(70deg); }
.realm .drift b:nth-child(3) { transform: rotateX(-44deg) rotateY(-20deg) rotateZ(150deg); }
.realm .drift b:nth-child(4) { transform: rotateX(40deg) rotateY(-30deg) rotateZ(30deg); }
.realm .drift b:nth-child(5) { transform: rotateX(62deg) rotateZ(-20deg); }
.realm .drift b:nth-child(6) { transform: rotateX(-30deg) rotateY(36deg) rotateZ(110deg); }
@keyframes void-turn { 0% { transform: translate3d(0, 0, 0) rotateX(58deg) rotateZ(8deg); } 50% { transform: translate3d(18px, -26px, 60px) rotateX(18deg) rotateY(42deg) rotateZ(96deg); }
  100% { transform: translate3d(-14px, 22px, -40px) rotateX(-48deg) rotateY(-24deg) rotateZ(190deg); } }
html[data-realm="magic"] .realm .drift b { border-radius: 0; rotate: 45deg; }
html[data-realm="east"] .realm .drift b { border-width: 0; background: none; box-shadow: inset 0 0 0 2px var(--void-line), inset 0 0 0 9px transparent, inset 0 0 0 11px var(--void-line); }
/* the arena hangs in it: nothing under the board but its own flat shadow and the dark */
html:has(#app.look, #app.stage, .battle.stage) .battle.wide.stage .boardslot, html:has(#app.look, #app.stage, .battle.stage) .arena.stage .pcol.mid .boardslot {
  box-shadow: 0 0 0 2px #1e0b29, 12px 14px 0 rgba(8,2,12,.62), 0 0 90px 10px var(--void-glow); }
/* WHEN HE BREAKS THE BOARD the void lurches with it (webui/battle.js collapse) */
html.void-quake .realm .horizon { animation: quake-line 1.4s ease-out 1; }
html.void-quake .realm .glow { animation: quake-glow 1.4s ease-out 1; }
html.void-quake .realm svg.vb { animation: void-rush 1.4s cubic-bezier(.1,.7,.3,1) 1; }
@keyframes void-rush { 0% { transform: scale(1); } 14% { transform: scale(1.14); } 100% { transform: scale(1); } }
html.void-quake .realm .drift b { animation: void-turn 1.4s ease-out 1; }
@keyframes quake-line { 0% { opacity: .42; height: 2px; } 12% { opacity: 1; height: 10px; background: linear-gradient(90deg, transparent, #f4c04a 20%, #fff6e0 50%, #f4c04a 80%, transparent); } 100% { opacity: .42; height: 2px; } }
@keyframes quake-glow { 0% { opacity: 1; } 14% { opacity: 1; filter: brightness(1.9) saturate(1.4); } 100% { opacity: 1; filter: none; } }
.battle.wide.stage .lclock.star-burst { animation: star-burst 1.4s cubic-bezier(.2, 1.4, .4, 1) 1; }
@keyframes star-burst { 0% { transform: scale(1); filter: none; } 16% { transform: scale(1.22) rotate(-4deg); filter: drop-shadow(0 0 26px #f4c04a) brightness(1.25); }
  40% { transform: scale(1.12) rotate(3deg); filter: drop-shadow(0 0 16px #f4c04a); } 100% { transform: scale(1); filter: none; } }
@media (prefers-reduced-motion: reduce) {
  .realm svg.vb, .realm .drift b, html.void-quake .realm .horizon, html.void-quake .realm .glow, .battle.wide.stage .lclock.star-burst { animation: none !important; }
}
/* (quiet enough to sit behind words: the line where the boards meet is a breath, and nothing twinkles) */
html:has(#app.look, #app.stage, .battle.stage) .realm .horizon { opacity: .2; }
html:has(#app.look, #app.stage, .battle.stage) body::before { display: none !important; }
html:has(#app.look, #app.stage, .battle.stage) { --void-ink: rgba(247,232,198,.058); }
.arena.stage .prefight-stage .ak-coupons .slot.free, .battle.wide.stage .st-army .ak-coupons .slot.free, .arena.stage .mc-slot.free { background: rgba(247,232,198,.035) !important; box-shadow: inset 0 0 0 1px rgba(247,232,198,.07); }
.arena.stage .prefight-stage .pf-go { background: none; }

/* A SHORT LANDSCAPE SCREEN (report 20261201-104055-033edf, a phone at 873x325:
   "I can just scroll down Ludivar.... also, when reporting screen too small.
   Use horizontal space"). The board is as tall as the height lets it be, so
   its column gives the two armies the width it cannot use; Ludivar stands
   BESIDE the enemy army instead of above it, so their column fits and he is
   never scrolled away; and the report card lays the picture beside the note,
   Send in sight. */
@media (max-height: 520px) and (orientation: landscape) {
  .arena.stage .prefight-stage { grid-template-columns: minmax(0, 1fr) minmax(0, calc(100vh - 36px)) minmax(0, 1fr); }
  .arena.stage .prefight-stage .pf-hint { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .arena.stage .prefight-stage > .pcol:first-child .ak-coupons { width: min(100%, 220px); }
  .ask.report-card .card { width: min(96vw, 900px); max-height: 94vh; overflow-y: auto; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); column-gap: 14px; align-content: start; }
  .ask.report-card .card > * { grid-column: 2; }
  .ask.report-card .card > :nth-child(2) { grid-column: 1; grid-row: 1 / span 6; align-self: start; }
  .ask.report-card .card > .shot { max-height: 86vh; }
  .ask.report-card textarea { margin-top: 0; }
}
/* (Ludivar beside their army only where the height is really short: with more
   of it he stands above, their coupons the size of yours) */
@media (max-height: 420px) and (orientation: landscape) {
  .arena.stage .prefight-stage > .pcol:last-child { display: grid; grid-template-columns: auto minmax(0, 1fr); align-content: start; column-gap: 8px; }
  .arena.stage .prefight-stage > .pcol:last-child > * { grid-column: 2; }
  .arena.stage .prefight-stage > .pcol:last-child > .pf-lud { grid-column: 1; grid-row: 1 / span 3; align-self: start; margin: 0; flex-direction: column; }
  .arena.stage .prefight-stage > .pcol:last-child > .pf-go { grid-column: 1 / -1; }
  .arena.stage .prefight-stage > .pcol:last-child .pf-lud .hero-face { width: clamp(64px, 26vh, 104px); margin: 0; }
  .arena.stage .prefight-stage > .pcol:last-child .pf-lud .bubble { display: none; }
  .arena.stage .prefight-stage > .pcol:last-child > .ak-coupons { grid-column: 1 / -1; width: min(100%, 220px); }
  .arena.stage .prefight-stage > .pcol:last-child > .linkish { grid-column: 1 / -1; font-size: .7rem; padding: 2px 0; }
}
/* A SHORT LANDSCAPE WINDOW LAYS AN INFO CARD SIDEWAYS (report
   20261201-104301-d415b6, the designer, 12-01: "The info pop ups don't fit on
   screen fully. I shouldn't have to scroll when so much space is available"):
   words and buttons in a column on the left, the picture (demo, chart, the
   piece card's tab) on the right, sized in demo.js to the window's height */
.ask .card.explain.sideways { display: flex; flex-direction: row; align-items: stretch; gap: 16px;
  width: auto; max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px);
  padding: 12px 14px; overflow: hidden; }
.ask .card.explain.sideways > .ex-words { flex: 0 1 280px; min-width: 180px; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; overscroll-behavior: contain; }
.ask .card.explain.sideways > .ex-words > h2 { margin: 0; }
.ask .card.explain.sideways > .ex-words > button { margin-top: auto; }
.ask .card.explain.sideways > .ex-words > button ~ button { margin-top: 0; }
.ask .card.explain.sideways > .ex-pic { flex: none; display: flex; flex-direction: column; justify-content: center; overflow-y: auto; }
.ask .card.explain.sideways > .ex-pic .demo-view, .ask .card.explain.sideways > .ex-pic .chart { margin: 0; }
.ask .card.piece-info.sideways > .body { flex: 0 1 auto; min-width: 220px; max-width: 360px; min-height: 0; overflow-y: auto; }
.ask .card.piece-info.sideways .tabs { margin: 4px 0; }
.ask:has(> .card.explain.sideways) { align-items: center; padding-top: 0; }
.ask .card.explain.sideways > .ex-pic .demo-view { display: grid; grid-template-columns: auto minmax(150px, 220px); grid-template-rows: auto auto auto auto; column-gap: 12px; align-items: start; }
.ask .card.explain.sideways > .ex-pic .demo-view > canvas { grid-column: 1; grid-row: 1 / 5; margin-top: 0; }
.ask .card.explain.sideways > .ex-pic .demo-view > :not(canvas) { grid-column: 2; }
.ask .card.explain.sideways > .ex-pic .demo-view > .caption { margin-top: 0; }
.ask .card.explain.sideways > .ex-pic .demo-view > .controls { align-self: end; flex-wrap: wrap; }

/* A PHONE ON ITS SIDE, THE FIGHT (user, 12-01, a screenshot of the fight on a
   phone at 873x325: "Awful"). battle.js phoneSide() sets .phone-side at 440px
   tall or less. Three columns, ONE row: the board is the full height; the
   left column is headed by the fight's name and purse, then the pack, the
   turn, your army, and a single row of tools at its foot; the right column is
   Ludivar (small, his count beside him, clear of the corner buttons), his line
   under him, then the enemy army. Nothing scrolls, nothing lies over another. */
#app:has(> .battle.phone-side), .battle.wide.stage.phone-side { margin: 0 !important; }
.battle.wide.stage.phone-side { box-sizing: border-box; height: 100dvh; padding: 3px 8px !important; border-radius: 0;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) !important;
  grid-template-rows: auto minmax(0, 1fr) !important; gap: 0 10px !important; overflow: hidden; }
.battle.wide.stage.phone-side > .topbar.stagebar { grid-column: 1 !important; grid-row: 1 !important;
  display: flex !important; flex-wrap: wrap; align-items: center; gap: 2px 6px; padding: 0 !important; margin: 0 !important; min-height: 0 !important; }
.battle.wide.stage.phone-side > .topbar .crumb { display: none; }
.battle.wide.stage.phone-side > .topbar .title { order: 1; flex: 1 1 calc(100% - 80px); min-width: 0; max-width: none; padding: 0; text-align: left; font-size: .95rem !important; line-height: 1.2; }
.battle.wide.stage.phone-side > .topbar .bar-right { order: 2; display: contents; }
.battle.wide.stage.phone-side > .topbar .purse { order: 1; font-size: .9rem; }
.battle.wide.stage.phone-side > .topbar .pack-slot { order: 3; flex: 0 1 auto; min-width: 0; }
.battle.wide.stage.phone-side > .topbar .bet-slot { order: 4; }
.battle.wide.stage.phone-side > .topbar .packbar { padding: 1px 3px; gap: 3px; }
.battle.wide.stage.phone-side > .topbar .pslot { width: 26px; height: 26px; min-width: 0; }
.battle.wide.stage.phone-side > .topbar .bet-chip { width: 34px; height: 26px; }
.battle.wide.stage.phone-side > .col.side.mine { grid-column: 1; grid-row: 2; }
.battle.wide.stage.phone-side > .col.board { grid-column: 2; grid-row: 1 / span 2; justify-content: center; }
.battle.wide.stage.phone-side > .col.side.theirs { grid-column: 3; grid-row: 1 / span 2; }
.battle.wide.stage.phone-side > .col.side { max-height: none !important; overflow: hidden !important; position: relative; }
.battle.wide.stage.phone-side .boardslot { padding: 4px; border-width: 3px; box-shadow: 0 6px 18px rgba(0,0,0,.45); }
/* the turn: two short lines, the free things one more; Pass is in the tool row */
.battle.wide.stage.phone-side .readout { padding: 2px 0 0 !important; text-align: left; position: relative; }
.battle.wide.stage.phone-side .readout .t { font-size: .9rem !important; line-height: 1.15; }
.battle.wide.stage.phone-side .readout .t .turn-no { font-size: .62rem !important; margin-top: 0; }
.battle.wide.stage.phone-side .readout .pips { top: 4px !important; right: 0 !important; }
.battle.wide.stage.phone-side .readout .passnow:not(.primary) { display: none; }
.battle.wide.stage.phone-side .readout .passnow.primary { margin-top: 2px; padding: 2px 10px; font-size: .75rem; }
.battle.wide.stage.phone-side .readout .free { font-size: .6rem; line-height: 1.2; margin-top: 1px; text-align: left; }
.battle.wide.stage.phone-side .army-h { font-size: .58rem !important; padding: 1px 10px !important; margin: 3px 0 1px !important; }
.battle.wide.stage.phone-side .st-army .ak-h { font-size: .52rem !important; margin: 2px 0 1px !important; }
.battle.wide.stage.phone-side .st-army .ak-coupons { grid-template-columns: repeat(5, minmax(0, 30px)) !important; gap: 3px !important; }
.battle.wide.stage.phone-side .st-army .ak-coupons .slot { border-width: 1.5px; border-radius: 5px; }
.battle.wide.stage.phone-side .st-army .ak-tokens { min-height: 0 !important; padding: 2px !important; gap: 3px; }
.battle.wide.stage.phone-side .st-army .ak-tokens .stack { width: 28px !important; height: 28px !important; }
.battle.wide.stage.phone-side .st-army .ak-tokens .stack canvas { width: 24px !important; height: 24px !important; }
.battle.wide.stage.phone-side .st-army .ak-none { font-size: .6rem; padding: 0 2px; }
.battle.wide.stage.phone-side .plate.you { display: none; }
.battle.wide.stage.phone-side .plate.them { margin: 0 !important; padding: 0 !important; }
.battle.wide.stage.phone-side .plate.them .pl-sub { font-size: .7rem; }
/* what a tapped piece says takes the room left under your army, its words
   shrunk to fit it (battle.js fitCallout); the tool row keeps the foot */
.battle.wide.stage.phone-side .callout:not(.none) { flex: 1 1 0 !important; flex-shrink: 1 !important; min-height: 0; max-height: none !important; margin: 4px 0 0 !important;
  overflow: hidden !important; font-size: .68rem; line-height: 1.25; padding: 4px 6px !important; }
.battle.wide.stage.phone-side .callout * { font-size: .68rem !important; }
.battle.wide.stage.phone-side .callout .head .ttl { font-size: .8rem !important; }
.battle.wide.stage.phone-side .callout .mark { margin: 1px 0 !important; }
/* the tool row: threats, rules, history, Pass, Undo, more -- one line */
.battle.wide.stage.phone-side .col.side.mine .toolbar { position: relative !important; margin: auto 0 2px !important; padding: 3px 0 0 !important;
  display: flex; flex-wrap: nowrap; justify-content: flex-start; gap: 3px !important; background: none !important; }
.battle.wide.stage.phone-side .toolbar .st-tools { display: flex; gap: 3px; margin: 0 !important; flex: none; }
.battle.wide.stage.phone-side .toolbar .st-tools button { flex: none; width: 26px; height: 24px; padding: 0 !important; min-height: 0; }
.battle.wide.stage.phone-side .toolbar .st-tools .lbl, .battle.wide.stage.phone-side .toolbar .st-tools button > :not(.kicon) { display: none; }
.battle.wide.stage.phone-side .toolbar .st-tools .kicon { display: inline-flex !important; }
.battle.wide.stage.phone-side .toolbar .st-tools .kicon svg { width: 15px; height: 15px; }
.battle.wide.stage.phone-side .toolbar .st-tools button { font-size: 0 !important; }
.battle.wide.stage.phone-side .toolbar .linkish { font-size: 0 !important; padding: 2px 4px !important; }
.battle.wide.stage.phone-side .toolbar .linkish::after { content: "Log"; font-size: .66rem; }
.battle.wide.stage.phone-side .toolbar .buttons.deeds { gap: 3px !important; flex-wrap: nowrap; }
.battle.wide.stage.phone-side .toolbar .buttons.deeds button { padding: 2px 7px !important; font-size: .66rem !important; min-height: 24px; }
.battle.wide.stage.phone-side .toolbar .sheet { bottom: 28px; max-height: calc(100dvh - 40px); }
/* Ludivar small, top left of his column (the save, flag and speaker sit at
   the window's top right), his count beside him, his line under him */
.battle.wide.stage.phone-side .lud { justify-content: flex-start !important; padding: 2px 0 0 !important; }
.battle.wide.stage.phone-side .lclock { width: 62px !important; height: 62px !important; }
.battle.wide.stage.phone-side .lclock .n { right: auto !important; left: 112% !important; top: 4% !important; font-size: 1.3rem !important; }
.battle.wide.stage.phone-side .lclock .n-lbl { right: auto !important; left: 112% !important; top: 52% !important; text-align: left !important; font-size: .55rem !important; }
.battle.wide.stage.phone-side .col.side.theirs > .quote { margin: 4px 0 2px; max-width: 100%; align-self: stretch; font-size: .72rem !important; line-height: 1.25; padding: 4px 10px !important; min-height: 0; }
/* (a narrow phone, 667 wide: a side column under 230px wraps the tool row in
   two, and Ludivar steps down under the corner buttons) */
.battle.wide.stage.phone-side > .col.side { container-type: inline-size; }
@container (max-width: 229px) {
  .battle.wide.stage.phone-side .col.side.mine .toolbar { flex-wrap: wrap !important; row-gap: 3px !important; }
  .battle.wide.stage.phone-side .lud { padding-top: 34px !important; }
}

/* THE STAGE, ANY SIZE (user, 12-01, "Awful", of a fight whose name ran under
   the pack and whose tool row lay over the piece card): the bar-right (pack,
   bet, purse) keeps its own width and the name gives way (ellipsis); the piece
   card takes the room left in your column and scrolls in it, and the tool row
   stands under it (held at the foot of a column that must scroll). */
.battle.wide.stage:not(.phone-side) .stagebar { grid-template-columns: minmax(0, 1fr) minmax(0, max-content) max-content; column-gap: 12px; }
.battle.wide.stage:not(.phone-side) .stagebar .title { max-width: none; }
.battle.wide.stage:not(.phone-side) .col.side.mine .callout:not(.none) { flex: 1 1 0 !important; min-height: 0; max-height: none !important; overflow: hidden !important; }
.battle.wide.stage:not(.phone-side) .col.side.mine .toolbar { position: relative !important; margin-top: auto; flex-shrink: 0; }
/* nothing scrolls (user, 12-01: "No scrolling either. All must fit."): a side
   column that would not fit makes the compact stage instead (battle.js fit) */
.battle.wide.stage > .col.side { overflow: hidden !important; position: relative; }
.battle.wide.stage .callout.fitted, .battle.wide.stage .callout.fitted * { font-size: var(--fit) !important; line-height: 1.25 !important; }
.battle.wide.stage .callout.over { position: absolute !important; left: 0; right: 0; top: auto; height: auto; flex: none !important; margin: 0 !important; z-index: 15; box-shadow: 0 8px 22px rgba(0,0,0,.6); }

/* HIS FACE IS REAL ELEMENTS, NOT A PICTURE FILE (user, 12-01: "the game is
   still extremely slow. don't ever use the canvas, only rendered components";
   webui/app.js ludi-face): the element stands exactly where the picture stood
   -- every rule above that sized or lit the picture names both -- and holds
   the face's own shapes. */
:where(ludi-face) { display: inline-block; width: 256px; aspect-ratio: 1; line-height: 0; }
ludi-face > svg { display: block; width: 100%; height: 100%; overflow: hidden; }
.hero-face ludi-face, .battle.wide.stage .lclock ludi-face { transition: translate .3s ease-out, rotate .3s ease-out; }   /* he leans toward the pointer in steps (app.js watch); this eases them */
/* a sideways card's buttons never squash (user, 12-01, a market coupon on a
   phone on its side: "This is very bad"): Buy was pressed to half its height
   in a 258px window; on such a window the card's words and buttons tighten */
.ask .card.explain.sideways > .ex-words > * { flex-shrink: 0; }
@media (max-height: 300px) {
  .ask .card.explain.sideways { padding-top: 10px; padding-bottom: 10px; }
  .ask .card.explain.sideways > .ex-words { gap: 4px; }
  .ask .card.explain.sideways > .ex-words > h2 { font-size: 1.05rem; }
  .ask .card.explain.sideways > .ex-words > .small { font-size: .78rem; line-height: 1.3; }
  .ask .card.explain.sideways > .ex-words > button { padding-top: 6px; padding-bottom: 6px; min-height: 0; font-size: .9rem; }
}

/* THE ABILITY BUTTONS (user, 12-01: "we must have buttons outside the board
   to activate abilities"): under the turn, one button a piece that can fire a
   power where it stands; pointing at one lights what it would hit */
.abil { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin: 2px 0 8px; }
.abil .abil-h { flex: 0 0 100%; font-size: .7rem; letter-spacing: .14em; font-weight: 700; color: var(--cream, #f7e8c6); }
.abil .abil-btn { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 0; min-height: 0; padding: 4px 10px; border-radius: 10px;
  border: 2px solid var(--gold-1, #e9b64a); background: linear-gradient(180deg, #6a2f86, #4a1f63); color: var(--cream, #f7e8c6); cursor: pointer; line-height: 1.15; text-align: left;
  box-shadow: 0 0 0 0 rgba(255,190,80,.6); animation: abil-ready 1.8s ease-in-out infinite; }
.abil .abil-btn b { font-size: .82rem; font-weight: 800; letter-spacing: .02em; }
.abil .abil-btn span { font-size: .66rem; opacity: .85; }
.abil .abil-btn.detonate { border-color: #ff9a3c; background: linear-gradient(180deg, #8a3a1c, #5c2010); }
.abil .abil-btn.sweep { border-color: #9fd3ff; }
.abil .abil-btn:hover { filter: brightness(1.15); }
@keyframes abil-ready { 50% { box-shadow: 0 0 0 3px rgba(255,190,80,.35); } }
@media (prefers-reduced-motion: reduce) { .abil .abil-btn { animation: none; } }
.fx-ring.abil { box-shadow: inset 0 0 0 3px #ffb347, inset 0 0 18px rgba(255,140,40,.65); border-radius: 6px; pointer-events: none; }
.fx-ring.abil.catalyst, .fx-ring.abil.sweep { box-shadow: inset 0 0 0 3px #9fd3ff, inset 0 0 16px rgba(120,190,255,.55); }
.battle.wide.stage .abil { flex-shrink: 0; }
.battle.wide.stage.phone-side .abil { margin: 2px 0 2px; gap: 3px; }
.battle.wide.stage.phone-side .abil .abil-h { font-size: .5rem; }
.battle.wide.stage.phone-side .abil .abil-btn { padding: 2px 7px; border-width: 1.5px; }
.battle.wide.stage.phone-side .abil .abil-btn b { font-size: .66rem; }
.battle.wide.stage.phone-side .abil .abil-btn span { font-size: .54rem; }
.battle.wide.stage .callout.hush { display: none !important; }
/* your coupon's card floats OVER the board on the stage, as it did beside it
   before (it sat under the board, widened its frame and ran off a phone's
   foot: user, 12-01, "All must fit") */
.battle.wide.stage .boardslot > .coupon-card { position: absolute; left: 50%; top: 18%; transform: translateX(-50%); z-index: 5; width: min(90%, 340px); line-height: normal; box-sizing: border-box; }
.battle.wide.stage.phone-side .boardslot > .coupon-card { padding: 6px 10px; }
.battle.wide.stage.phone-side .boardslot > .coupon-card .nm { font-size: 1rem; }
.battle.wide.stage.phone-side .boardslot > .coupon-card .ln { font-size: .75rem; }

/* THE MARKET FITS A PHONE ON ITS SIDE (report 20261201-152903-99d0f9, the
   designer, 12-01, the market in an 873x325 window: "Why am I scrolling
   here"): where the height is really short the band lies in one slim row --
   your army and its points side by side, your coupons and the door side by
   side, the two heads small -- and the next opponent's board takes only the
   height the page has left (screens.js sizeDeploy), so nothing scrolls */
@media (orientation: landscape) and (max-height: 420px) {
  .arena.stage .market-band { margin-top: 2px; padding-top: 2px; column-gap: 12px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); }
  .arena.stage .market-band .sec-h { font-size: .56rem; margin: 0; }
  .arena.stage .band-army { display: grid; grid-template-columns: minmax(0, auto) auto; column-gap: 8px; align-items: center; align-content: start; }
  .arena.stage .band-army > .sec-h { grid-column: 1 / -1; }
  .arena.stage .market-band .army-tray { flex-wrap: nowrap; gap: 4px; min-width: 0; overflow-x: auto; scrollbar-width: none; padding-top: 6px; margin-top: -6px; }   /* (a long army slides sideways in its row) */
  .arena.stage .market-band .army-tray .tile.pc { width: 32px; min-height: 32px; } .arena.stage .market-band .army-tray .tile.pc canvas { width: 30px !important; height: 30px !important; }
  .arena.stage .band-points { margin: 0; flex-direction: column; align-items: flex-start; gap: 2px; font-size: .64rem; line-height: 1.15; }
  .arena.stage .band-coupons { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; align-items: center; align-content: start; }
  .arena.stage .band-coupons > .sec-h { grid-column: 1 / -1; }
  .arena.stage .market-band .my-coupons { gap: 2px; max-width: none; }
  .arena.stage .band-go { margin: 0; display: grid; grid-template-columns: auto auto; gap: 3px 6px; align-items: center; }
  .arena.stage .band-go > * { grid-column: 1; }
  .arena.stage .band-go .enter { grid-column: 2; grid-row: 1 / span 2; font-size: .8rem; padding: 6px 10px; white-space: nowrap; }
  .arena.stage .band-go button.small, .arena.stage .band-go > :not(.enter) > button { padding: 1px 8px; font-size: .62rem; min-height: 0; }
  .arena.stage .hero-face { width: 42px; } .arena.stage .hero-title { font-size: .9rem; } .arena.stage .bubble { font-size: .64rem; padding: 2px 8px; }
  .arena.stage .smid .sec-h { margin: 1px 0; }
  .arena.stage .mkeys { margin-top: 3px; } .arena.stage .mkeys button { padding: 3px 2px; }
  .arena.stage .sleft.framed { padding-top: 12px; }
  .arena.stage .sleft .linkish { padding: 0 2px; }
}

/* AFTER THE VERDICT (user, 12-01: "Does this design look game of the year
   worthy?" -- answered no, with six things holding it back -- then
   "Implement your suggestions. Remember, it's a multiversal tournament,
   space, weird feel yet strategic and exciting"). The board's tiles, its
   corners and the chess set's eyes are drawn in webui/app.js and
   webui/build_pieces.py; nothing empty is drawn any more (webui/battle.js
   stageKit, webui/screens.js). Here: the words can be read, and a card that
   pops up is an object of the same world as the board. */
/* what you do not hold is one quiet line, not ten boxes */
.arena.stage .my-coupons .mc-none { grid-column: 1 / -1; font-size: .82rem; color: #c9a0e6; padding: 4px 0; white-space: nowrap; }
/* SMALL WORDS: no label under 10px on a phone or 12px on a desk, and the
   widest tracking pulled in -- capitals a quarter of an em apart at 8px
   were a row of dots */
.arena.stage .sec-h { letter-spacing: .16em; }
.battle.wide.stage .st-army .ak-h, .arena.stage .pf-h { letter-spacing: .1em; }
.battle.wide.stage .st-army .ak-h { font-size: max(.75rem, clamp(.7rem, .8vw, 1.05rem)); }
.battle.wide.stage.phone-side .st-army .ak-h { font-size: .64rem !important; letter-spacing: .06em; }
.battle.wide.stage.phone-side .army-h { font-size: .66rem !important; }
.battle.wide.stage.phone-side .abil .abil-h { font-size: .62rem; letter-spacing: .08em; }
.battle.wide.stage.phone-side .abil .abil-btn span { font-size: .62rem; }
.battle.wide.stage.phone-side .lclock .n-lbl { font-size: .62rem !important; }
@media (max-width: 700px) and (orientation: landscape) {
  .battle.wide.stage .stagebar .crumb { font-size: .62rem; } .battle.wide.stage .readout .t .turn-no { font-size: .66rem; }
  .battle.wide.stage .st-tools button { font-size: .62rem; } .battle.wide.stage .quote { font-size: .68rem; }
  .arena.stage .sec-h { font-size: .66rem; letter-spacing: .1em; }
}
/* A CARD THAT POPS UP is cut from the board's own stuff: the same gold
   frame on a dark keyline, the same flat shadow down and to the right (no
   soft glow), a flat plum ground, and its title ruled off in gold. */
body:has(#app.look, #app.stage, .battle.stage) .ask:not(.coupon-scrim):not(.walkout-scrim) { background: rgba(12,4,18,.8); }
body:has(#app.look, #app.stage, .battle.stage) .ask:not(.coupon-scrim):not(.walkout-scrim) > .card { background: #33143f; border: 3px solid var(--gold-1); border-radius: 10px;
  box-shadow: 0 0 0 2px #1e0b29, 10px 12px 0 rgba(8,2,12,.7); }
body:has(#app.look, #app.stage, .battle.stage) .ask:not(.coupon-scrim):not(.walkout-scrim) > .card > h2:first-child,
body:has(#app.look, #app.stage, .battle.stage) .ask:not(.coupon-scrim):not(.walkout-scrim) > .card > .ex-words > h2:first-child { padding-bottom: 6px; margin-bottom: 8px;
  border-bottom: 2px solid transparent; border-image: linear-gradient(90deg, var(--gold-1), rgba(244,192,74,0)) 1; }
/* it lands: set down from a little above, once (nothing loops) */
@media (prefers-reduced-motion: no-preference) {
  body:has(#app.look, #app.stage, .battle.stage) .ask:not(.coupon-scrim):not(.walkout-scrim) > .card { animation: card-land .22s cubic-bezier(.2, .9, .3, 1.25) 1; }
}
@keyframes card-land { 0% { transform: translateY(-14px) scale(.96); opacity: 0; } 100% { transform: none; opacity: 1; } }

/* THE LIBRARY STANDS OUT (report 20261201-233809-5d868e, user, 12-01:
   "Library barely visible"): on the menu its key was a dark wine button
   like Discord's, the same size and the darkest thing beside the saves. It
   is the menu's second door in, so it wears the gold rim, a bright plum
   face and gold letters; Discord (a door out) stays quiet. (:not(#_) outranks THE KEYS' long
   :not() chain, which paints every look button's rim rose.) */
#app.menu.look .menu-links button.library-btn:not(#_) { background: var(--gold-1) !important; color: var(--gold-1) !important; text-shadow: 0 2px 0 #1e0b29; }
#app.menu.look .menu-links button.library-btn:not(#_)::before { background: linear-gradient(180deg, #8a3fae, #5e2a7a) !important; }
#app.menu.look .menu-links button.library-btn:not(#_):hover, #app.menu.look .menu-links button.library-btn:not(#_):focus-visible { background: var(--cream) !important; color: var(--cream) !important; }
