/* W-129 (T11, D-148): the tower card (tower-card.js) and the boss's spoils (spoils.js).
   One frame per card: a single rim, in the rarity's colour when it has one. No studs, no inner panel, no rules between
   parts: the stage's tone and the spacing do that work. The model stands on the stage in a pool of light (tinted by the
   rarity), then the name, the type line, three numbers and one line. T10 owns Era III's look on top of this structure.
   Phone first; the laptop sizes are in the wide block at the foot (layout-pref.js points it at the Layout setting). */

/* Each era's card and table, from its existing card and tray colours. */
#game{--tc-face:#f1e4c6;--tc-stage:#e2d0a6;--tc-light:#fff8e2;--tc-edge:#a8916a;--tc-radius:10px;--tc-table:#2a231c;--tc-title:#f3e6c4;--tc-title-muted:#c4b28c;--tc-gold:#d9b775;--tc-better:#2f7a3d;--tc-worse:#a3392b}
#game[data-era="2"]{--tc-face:#dcd9c1;--tc-stage:#c9c6a9;--tc-light:#faf4dc;--tc-edge:#ae8c4a;--tc-radius:5px;--tc-table:#212b2c;--tc-title:#efe4c2;--tc-title-muted:#b3ad90;--tc-gold:#d9b875}
#game[data-era="3"]{--tc-face:#1f444d;--tc-stage:#14313a;--tc-light:#67d4d240;--tc-edge:#4f8a91;--tc-radius:3px;--tc-table:#0b1b22;--tc-title:#e3ece0;--tc-title-muted:#8fb3ad;--tc-gold:#4fb9bf;--tc-better:#7be0a0;--tc-worse:#ff8f80}
#game[data-era="4"]{--tc-face:#eef3ec;--tc-stage:#dbe5e0;--tc-light:#ffffff;--tc-edge:#8aabb4;--tc-radius:14px;--tc-table:#2a3e50;--tc-title:#eef4f2;--tc-title-muted:#a7bcc6;--tc-gold:#b9a6de}

/* ---- the card ---- */
.tower-card{--tc-rim:var(--rarity,var(--tc-edge));--tc-stage-h:100px;position:relative;display:flex;flex-direction:column;align-items:stretch;min-width:0;min-height:0;padding:0;margin:0;
  border:2px solid var(--tc-rim);border-radius:var(--tc-radius);background:var(--tc-face);color:var(--ink);text-align:center;overflow:hidden;
  box-shadow:0 12px 30px #0007,0 2px 0 #0003;transition:transform .16s ease,box-shadow .16s ease,opacity .2s}
.tower-card.rarity-rare{box-shadow:0 12px 30px #0007,0 2px 0 #0003,0 0 34px color-mix(in srgb,var(--rarity) 38%,transparent)}
.tower-card:hover:not(:disabled){transform:translateY(-4px);box-shadow:0 20px 38px #0008,0 0 0 1px var(--tc-rim)}
.tower-card.rarity-rare:hover:not(:disabled){box-shadow:0 20px 38px #0008,0 0 0 1px var(--tc-rim),0 0 42px color-mix(in srgb,var(--rarity) 50%,transparent)}
.tower-card:focus-visible{outline:3px solid var(--tc-gold);outline-offset:3px}
.tower-card:disabled{cursor:default}
.tower-card.passed{opacity:.42;filter:saturate(.45)}
.tower-card.chosen{--tc-rim:var(--tc-gold)}

/* The stage: the model, big, in a pool of light. */
.tc-stage{--tc-top:16px;position:relative;display:grid;place-items:center;height:var(--tc-stage-h);flex:none;
  background:radial-gradient(ellipse 58% 50% at 50% 62%,color-mix(in srgb,var(--rarity,var(--tc-light)) 30%,transparent),#0000 76%),
    radial-gradient(ellipse 72% 66% at 50% 56%,var(--tc-light),#0000 74%),var(--tc-stage)}
.tc-stage::after{content:'';position:absolute;left:24%;right:24%;bottom:9%;height:10%;border-radius:50%;background:radial-gradient(closest-side,#0000003d,#0000)}
#game .tower-card .tc-stage .tc-model{position:relative;z-index:1;width:100%;max-width:none;height:calc(100% - var(--tc-top) - 6px);max-height:none;margin-top:calc(var(--tc-top) - 6px);filter:drop-shadow(0 6px 5px #00000030)}/* over the old reward screen's .offer-art sizes */
/* Cost at the top left, rarity (or the card's state) at the top right, both inside the stage. */
.tc-cost{position:absolute;z-index:2;top:5px;left:5px;display:flex;align-items:center;gap:2px;padding:2px 6px 2px 3px;border-radius:999px;background:var(--tc-face);color:var(--ink);font-size:var(--fs-md);font-weight:800;line-height:1;box-shadow:0 1px 3px #0003}
.tc-cost .ui-icon{width:13px;height:15px}
.tc-corner{position:absolute;z-index:2;top:8px;right:7px;font-size:var(--fs-xs);line-height:1}
.tc-corner .rarity-mark{gap:6px;letter-spacing:.1em}
.tc-corner .rarity-mark{font-size:0;gap:0}/* the phone: the gem alone */
.tc-corner .rarity-gem{width:8px;height:8px}
.tc-state{display:inline-flex;align-items:center;gap:4px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.chosen .tc-state{color:var(--ink)}
.tc-corner .tc-state{font-size:0;gap:0}/* the phone: the chosen card's check alone; a passed card is dimmed, no words */
.tc-check{width:16px;height:16px}
.tc-note{position:absolute;z-index:2;top:calc(var(--tc-stage-h) - 26px);left:50%;translate:-50% 0;padding:2px 8px;border-radius:999px;background:#0000002e;color:var(--ink);font-size:var(--fs-xs);font-weight:700;white-space:nowrap}

/* The words: name, type line, numbers, one line. */
.tc-body{display:flex;flex-direction:column;align-items:center;gap:4px;padding:7px 5px 9px;flex:1}
/* Side by side, the cards share their rows (subgrid), so a name that wraps moves all three cards' rows together. */
.spoils-towers{grid-auto-rows:auto}
.spoils-towers>.tower-card{display:grid;grid-template-rows:subgrid;grid-row:span 5;row-gap:0}
.spoils-towers>.tower-card>.tc-body{display:contents}
.spoils-towers .tc-body>*{justify-self:center;align-self:center}
.spoils-towers .tc-body>.tc-name{padding:7px 5px 0;align-self:end}
.spoils-towers .tc-body>.card-face{margin-top:4px}
.spoils-towers .tc-body>.tc-stats{justify-self:stretch;width:auto;margin:5px 2px 0}
.spoils-towers .tc-body>.tc-line{padding:5px 5px 9px;align-self:start}
#game .tower-card .tc-name{font-size:var(--fs-base);font-weight:800;line-height:1.12;letter-spacing:-.01em;color:var(--ink);margin:0;text-wrap:balance}
#game .tc-body .card-face.face-line{margin:0;padding:0;background:none;font-size:var(--fs-sm);color:var(--muted);gap:5px}
.tc-body .card-face.face-line :is(.face-words,.face-sep){display:none}/* the phone: glyphs only */
.tc-body .card-face.face-line .face-reach{display:inline-grid}
/* The phone: the three numbers in one row, each a glyph and its value; the words are for a screen reader. */
.tc-stats{display:flex;justify-content:space-between;align-items:center;gap:4px;width:100%;margin:2px 0 1px;padding:0 3px}
.tc-stat{display:flex;flex-direction:column-reverse;align-items:center;min-width:0}
.tc-stat dd{margin:0;display:flex;align-items:center;justify-content:center;gap:2px;font-size:var(--fs-sm);font-weight:800;line-height:1.1;font-variant-numeric:tabular-nums;color:var(--ink);white-space:nowrap}
.tc-glyph{flex:none;width:10px;height:10px;color:var(--muted)}
.tc-stat dd small{font-size:.72em;font-weight:750;color:var(--muted)}
.tc-stat dd small.tc-glyph-says{display:none}/* the phone: the glyph says it */
.tc-stat dt{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;font-size:10.5px;font-weight:750;letter-spacing:.09em;text-transform:uppercase;color:var(--muted)}
.tc-range dd{gap:3px}
/* The range glyph is drawn to scale: every square the same size, so a longer reach is a bigger glyph. */
.range-glyph{--rg-cell:2px;width:calc(var(--rg-n) * var(--rg-cell));height:calc(var(--rg-n) * var(--rg-cell));flex:none}
.range-glyph .rg-off{fill:currentColor;opacity:.13}
.range-glyph .rg-on{fill:currentColor;opacity:.72}
.range-glyph .rg-own{fill:var(--rarity,var(--tc-edge))}
#game .tower-card .tc-line{margin:0;max-width:24ch;font-size:var(--fs-xs);line-height:1.35;color:var(--ink);text-wrap:balance}

/* ---- the boss's spoils: the open table, the fallen boss, the cards ---- */
html #game #screen[data-view="reward"]:has(>.spoils){display:flex;flex-direction:column;border:0;margin:0;padding:14px 10px;
  background:radial-gradient(ellipse 60% 46% at 50% 50%,color-mix(in srgb,var(--tc-light) 16%,transparent),#0000 72%),radial-gradient(ellipse at 50% 45%,#0000 45%,#0000005c),var(--tc-table)}
.spoils{--tc-w:minmax(0,1fr);--tc-gap:8px;display:flex;flex-direction:column;align-items:center;gap:12px;width:100%;margin:auto}
.spoils-head{display:flex;flex-direction:column;align-items:center;text-align:center}
.spoils-medallion{width:52px;height:52px;border-radius:50%;object-fit:cover;object-position:50% 15%;border:2px solid var(--tc-edge);box-shadow:0 0 0 4px #0000003a,0 8px 22px #0008;filter:saturate(.75)}
#game .spoils .spoils-head h1{margin:10px 0 0;font-size:var(--fs-4xl);font-weight:800;line-height:1.08;letter-spacing:-.01em;color:var(--tc-title);text-shadow:0 2px 10px #0006}
#game .spoils .spoils-prompt{margin:4px 0 0;font-size:var(--fs-sm);color:var(--tc-title-muted)}
.spoils-receipt{display:flex;justify-content:center;gap:16px;margin-top:8px;font-size:var(--fs-xs);font-weight:700;letter-spacing:.09em;text-transform:uppercase;color:var(--tc-title-muted)}
.spoils-receipt span{display:inline-flex;align-items:center;gap:5px}
.spoils-receipt b{font-size:var(--fs-lg);letter-spacing:0;color:var(--tc-title)}
.spoils-receipt .ui-icon{width:16px;height:16px}
.spoils-towers,.spoils-relics{display:grid;grid-template-columns:repeat(3,var(--tc-w));gap:var(--tc-gap);justify-content:center;width:100%}
.spoils-relics{grid-template-columns:1fr}

/* A relic: the same card, smaller and on its side: the icon on a round stage, then its name and what it does. */
.spoil-relic{position:relative;display:flex;align-items:center;gap:10px;min-width:0;min-height:0;margin:0;padding:6px 10px 6px 6px;text-align:left;
  border:1.5px solid color-mix(in srgb,var(--tc-edge) 75%,transparent);border-radius:var(--tc-radius);background:var(--tc-face);color:var(--ink);
  box-shadow:0 8px 20px #0006;transition:transform .16s ease,box-shadow .16s ease,opacity .2s}
.spoil-relic:hover:not(:disabled){transform:translateY(-3px);box-shadow:0 14px 28px #0008,0 0 0 1px var(--tc-edge)}
.spoil-relic:focus-visible{outline:3px solid var(--tc-gold);outline-offset:3px}
.spoil-relic.chosen{border-color:var(--tc-gold);box-shadow:0 8px 20px #0006,0 0 0 1px var(--tc-gold)}
.spoil-relic.passed{opacity:.42;filter:saturate(.45)}
.sr-stage{flex:none;display:grid;place-items:center;width:44px;height:44px;border-radius:50%;background:radial-gradient(circle at 50% 42%,var(--tc-light),var(--tc-stage) 74%)}
.sr-stage .sr-icon{width:36px;height:36px;object-fit:contain;filter:drop-shadow(0 3px 3px #0003)}
.sr-body{display:flex;flex-direction:column;gap:2px;min-width:0}
.sr-body small{display:inline-flex;align-items:center;gap:4px;font-size:10.5px;font-weight:750;letter-spacing:.09em;text-transform:uppercase;color:var(--muted)}
#game .spoil-relic h3{margin:0;font-size:var(--fs-lg);font-weight:800;line-height:1.15;color:var(--ink)}
#game .spoil-relic p{margin:0;font-size:var(--fs-sm);line-height:1.35;color:var(--muted)}
.spoils .spoils-continue{width:min(360px,100%);margin:4px auto 0}

/* The win: W-151 (#51) rec 7, the spoils rise whole (style.css .win-sequence); the medallion, receipt, cards and relics
   no longer arrive one by one. */
@media (prefers-reduced-motion:reduce){.tower-card,.spoil-relic{transition:none}}

/* ---- W-129 surface 1: an ordinary fight's towers to upgrade (the tiles), an elite's offers ---- */
.tc-kind{font-weight:800;letter-spacing:.1em;text-transform:uppercase;color:var(--muted)}
.tc-kind-more{display:none}/* the phone: "Item"; the laptop adds "· one use" */
.tc-emblem{position:relative;z-index:1;width:40%;height:56%;color:var(--tc-edge)}
.tc-strip{position:relative;z-index:1;display:flex;align-items:flex-end;justify-content:center;gap:2%;width:92%;height:70%;margin-top:8%}
.tc-strip .tc-strip-model{flex:1 1 0;min-width:0;height:100%;max-width:32%;filter:drop-shadow(0 4px 3px #00000030)}
.tc-strip b{align-self:center;font-size:var(--fs-md);font-weight:800;color:var(--muted)}
/* The tiles: a grid sized to the count (spoils.js upgradeGrid sets its columns and rows), shrinking to the table. */
.spoils.upgrades{flex:1 1 auto;min-height:0;justify-content:center;margin:0}
.victory-tiles{--tile-h:128px;display:grid;grid-template-columns:repeat(var(--cols-p),minmax(0,1fr));grid-template-rows:repeat(var(--rows-p),minmax(0,var(--tile-h)));gap:8px;width:100%;flex:0 1 auto;min-height:0;justify-content:center;align-content:center}
.tower-tile{min-height:0}
.tower-tile .tc-stage{--tc-top:10px;height:auto;flex:1 1 0;min-height:0}
.tc-tiers{position:absolute;z-index:2;top:7px;right:7px;display:flex;gap:4px}
.tc-tiers i{width:7px;height:7px;rotate:45deg;border:1.5px solid color-mix(in srgb,var(--rarity,var(--tc-edge)) 85%,transparent)}
.tc-tiers i.on{background:var(--rarity,var(--tc-edge))}
.tower-tile .tc-body{flex:none;padding:5px 4px 7px;gap:2px}
#game .tower-tile .tc-name{font-size:var(--fs-sm);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.tower-tile.mastered{opacity:.42;filter:saturate(.4)}
.tower-tile.selected{--tc-rim:var(--tc-gold);box-shadow:0 0 0 2px var(--tc-gold),0 12px 28px #0008}
.tower-tile.mastered.selected{opacity:.75}
.spoils .reward-skip{align-self:center;min-height:0;padding:6px 18px;border:1px solid color-mix(in srgb,var(--tc-title-muted) 50%,transparent);border-radius:999px;background:none;color:var(--tc-title-muted);font-size:var(--fs-sm);font-weight:700}
.spoils .reward-skip:hover{color:var(--tc-title);border-color:var(--tc-title-muted)}
/* W-151 (#51) rec 7: the tower tiles rise with the spoils (no staged deal). */

/* The tile's type line: on the phone, glyphs in the stage's corner (the tile is the model alone); on the laptop, under
   the name (the damage type in words, air and ground as their glyphs). */
.tc-type{position:absolute;z-index:2;top:4px;left:4px;display:flex}
#game .tc-type .card-face.face-line{margin:0;padding:1px 3px 1px 1px;gap:1px;border-radius:999px;background:color-mix(in srgb,var(--tc-face) 85%,transparent);box-shadow:none}
.tc-type .card-face.face-line :is(.face-words,.face-sep){display:none}
.tc-type .card-face.face-line .face-reach{display:inline-grid;width:11px;height:11px}
.tc-type .face-chip{width:12px;height:12px}
.tc-type .face-chip .face-glyph{width:9px;height:9px}
.tc-type .face-chip.face-reach .face-glyph{width:10px;height:10px}
.tower-tile .card-face .face-long{display:none}
/* The upgrade reward: the towers, and the picked tower's tree docked under them (beside them on the laptop); nothing
   covers the screen, so a tap on another tower swaps the tree and the towers stay in view to compare. */
.victory-upgrade{display:flex;flex-direction:column;gap:10px;width:100%;flex:1 1 auto;min-height:0}
.victory-upgrade .victory-tiles{--tile-h:58px;gap:6px;flex:none}
.victory-upgrade .tower-tile .tc-body{display:none}/* the phone: the model alone; the panel names the picked tower */
.victory-upgrade .tower-tile .tc-stage{--tc-top:4px}
.victory-upgrade .tc-tiers{top:4px;right:4px;gap:3px}
.victory-upgrade .tc-tiers i{width:5px;height:5px;border-width:1px}
.upgrade-panel{display:flex;flex-direction:column;gap:8px;flex:1 1 auto;min-height:0;padding:10px 12px 12px;border:2px solid var(--tc-edge);border-radius:var(--tc-radius);background:var(--tc-face);color:var(--ink);box-shadow:0 12px 30px #0007;text-align:left}
/* #160: the title block (name, tags, "Choose one of 3 branches") centred in the card, above the branch tiles. */
.up-head{display:flex;flex-direction:column;align-items:center;gap:2px;text-align:center}
.up-head>.card-face{justify-content:center}
#game .up-head .card-face.face-line{margin:0;padding:0;background:none;font-size:var(--fs-sm);color:var(--muted);gap:5px}
#game .up-head h2{margin:0;font-size:var(--fs-lg);font-weight:800;line-height:1.1;letter-spacing:-.01em;color:var(--ink)}
.up-head small{font-size:var(--fs-xs);color:var(--muted)}
/* The tiers the copy can take next: three tier Is side by side, or the one tier II (larger); each at its own model. */
.up-tree{display:grid;grid-template-columns:repeat(var(--n),minmax(0,1fr));gap:6px}
.up-tree[data-n="1"]{grid-template-columns:minmax(0,1fr)}
.up-option{--disc:62px;display:flex;flex-direction:column;align-items:center;gap:4px;min-width:0;min-height:0;padding:8px 4px 6px;border:0;border-radius:calc(var(--tc-radius) + 2px);background:color-mix(in srgb,var(--tc-stage) 60%,transparent);color:var(--ink);cursor:pointer;transition:background .14s ease}
.up-tree[data-n="1"] .up-option{--disc:80px;cursor:default}
.up-option.on{background:color-mix(in srgb,var(--branch) 24%,var(--tc-stage))}
.up-disc{position:relative;display:grid;place-items:center;flex:none;width:var(--disc);height:var(--disc);border:2px solid color-mix(in srgb,var(--branch) 75%,var(--tc-edge));border-radius:50%;
  background:radial-gradient(circle at 50% 40%,var(--tc-light),var(--tc-stage) 78%);box-shadow:0 2px 0 #0002;transition:transform .14s ease}
.up-disc .up-medal{width:88%;height:88%;min-width:0;min-height:0;object-fit:contain;filter:drop-shadow(0 3px 2px #00000030)}
.up-tier{position:absolute;top:-3px;right:-3px;min-width:17px;height:17px;padding:0 4px;border-radius:999px;background:var(--ink);color:var(--tc-face);font-family:Georgia,serif;font-size:10px;font-weight:800;line-height:17px}
.up-disc .tc-check{position:absolute;bottom:-3px;left:-3px;width:17px;height:17px;padding:2px;border-radius:50%;background:#2f6b3b;color:#fff}
.up-branch-name{font-size:var(--fs-sm);font-weight:800;color:var(--ink);white-space:nowrap}
.up-option.owned .up-disc{border-color:var(--tc-gold);box-shadow:0 0 0 2px color-mix(in srgb,var(--tc-gold) 45%,transparent)}
.up-option:not(.on):hover .up-disc{transform:scale(1.05)}
.up-option.on .up-disc{outline:3px solid var(--branch);outline-offset:2px}
.up-tree[data-n="1"] .up-option.on .up-disc{outline:0}
.up-option:focus-visible{outline:3px solid var(--tc-gold);outline-offset:2px}
/* The picked tier: what it does, what it changes, and the unlock. */
.up-detail{display:grid;grid-template-columns:minmax(0,5fr) minmax(0,6fr);grid-template-rows:minmax(0,1fr) auto;grid-template-areas:"about rows" "act act";gap:8px 14px;flex:1 1 auto;min-height:0}
.up-about{grid-area:about;display:flex;flex-direction:column;gap:4px;min-width:0}
.up-detail>.up-rows{grid-area:rows;align-self:start}
.up-detail>:is(.up-unlock,.up-status){grid-area:act}
#game .up-detail h3{margin:0;font-size:var(--fs-md);font-weight:800;line-height:1.15;color:var(--ink)}
.up-detail h3::before{content:'';display:inline-block;width:9px;height:9px;margin-right:7px;border-radius:50%;background:var(--branch);vertical-align:1px}
.up-lines{font-size:var(--fs-xs);color:var(--ink)}/* W-132: set like the rows beside it */
.up-rows{display:grid;gap:2px;margin:0}
.up-row{display:flex;justify-content:space-between;align-items:baseline;gap:8px;font-size:var(--fs-xs);line-height:1.35}
.up-row dt{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.up-row dt{color:var(--muted)}
.up-row dd{display:flex;align-items:center;gap:4px;margin:0;font-weight:800;font-variant-numeric:tabular-nums;white-space:nowrap}
.up-row s{text-decoration:none;color:var(--muted);font-weight:600}
.up-targets{display:inline-flex;gap:2px;vertical-align:middle}.up-targets .face-glyph{width:1.05em;height:1.05em;fill:currentColor}/* W-132: Targets as the type line's wing and boot */
.up-arrow{width:9px;height:9px;color:var(--muted)}
.up-reach{align-items:center}
.up-reach dd{gap:5px}
.up-range{--rg-cell:7px;width:min(calc(var(--rg-n) * var(--rg-cell)),66px);height:min(calc(var(--rg-slot,var(--rg-n)) * var(--rg-cell)),66px);margin-right:3px;flex:none}/* W-132: a slot as tall as the largest reach among the tiers shown, so the row keeps its height from branch to branch */
.up-range .rg-off{fill:currentColor;opacity:.1}
.up-range .rg-reach{fill:currentColor;opacity:.5}
.up-range .rg-added{fill:var(--tc-better)}
.up-range .rg-lost{fill:var(--tc-worse);opacity:.45}
.up-range .rg-tower{fill:var(--ink)}
.up-row.better b{color:var(--tc-better)}
.up-row.worse b{color:var(--tc-worse)}
#game .up-unlock{display:flex;flex-direction:column;align-items:center;gap:1px;align-self:end;margin:0;min-height:0;padding:8px 12px}
.up-unlock>.ui-icon{display:none}
.up-unlock small{display:inline-flex;align-items:center;gap:3px;font-size:var(--fs-xs);font-weight:600;opacity:.85}
.up-unlock small .ui-icon{width:10px;height:12px}
.up-status{display:flex;align-items:center;justify-content:center;gap:5px;align-self:end;margin:0;padding:9px;border-radius:999px;background:color-mix(in srgb,var(--tc-stage) 70%,transparent);font-size:var(--fs-sm);font-weight:700;color:var(--muted);text-align:center}
.up-status .tc-check{width:15px;height:15px;color:var(--tc-better)}
@media (prefers-reduced-motion:reduce){.up-option,.up-disc{transition:none}}

/* ---- W-129 surface 2: the start of a run, six towers dealt on the table (start-pick.js) ---- */
#game #start-pick:has(>.start-pick){padding:14px 10px;overflow:hidden;
  background:radial-gradient(ellipse 60% 46% at 50% 50%,color-mix(in srgb,var(--tc-light) 16%,transparent),#0000 72%),radial-gradient(ellipse at 50% 45%,#0000 45%,#0000005c),var(--tc-table)}
.start-pick{margin:auto}
.start-card{cursor:pointer}
/* #21 (the designer, 2026-10-01: "Make it more clear what cards have been picked"): a kept card stands up off the table
   in a thick gold frame, its face below the stage gold and its stage lit gold round the edge, with the gold Kept tag at
   the stage's foot (nothing covers the tower). */
.start-card.kept{--tc-rim:var(--tc-gold);transform:translateY(-10px);background:color-mix(in srgb,var(--tc-gold) 85%,var(--tc-face));
  box-shadow:0 0 0 3px var(--tc-gold),0 20px 38px #0009,0 0 34px color-mix(in srgb,var(--tc-gold) 55%,transparent)}
.start-card.kept .tc-stage{box-shadow:inset 0 0 0 2px var(--tc-gold),inset 0 -18px 26px -10px color-mix(in srgb,var(--tc-gold) 70%,transparent)}
.start-card .tc-kept{display:inline-flex;align-items:center;gap:4px;padding:3px 10px;background:var(--tc-gold);color:#2a2112;font-weight:800;letter-spacing:.07em;text-transform:uppercase;box-shadow:0 2px 8px #0006}
.start-card .tc-kept .tc-check{width:13px;height:13px}
.start-card.spare{opacity:.55;filter:saturate(.6)}
.start-foot{display:flex;align-items:center;justify-content:center;gap:14px;width:min(420px,100%)}
#game .start-foot .primary{flex:1;width:auto;margin:0}
.start-count{display:flex;gap:7px;flex:none;padding:0 2px}
.start-count i{width:9px;height:9px;rotate:45deg;border:1.5px solid var(--tc-gold);opacity:.75}
.start-count i.on{background:var(--tc-gold);opacity:1}
/* V013-TITLE-HANDOFF: the table comes up over the landed map, then the cards deal onto it (it was a cut from the map
   to the sheet, with the cards dealing in on the instant). */
#start-pick.dealing{animation:start-in .45s ease-out both}
@keyframes start-in{from{opacity:0}}
#start-pick.dealing .start-card{animation:deal-in .26s ease-out backwards;animation-delay:calc(.22s + var(--deal-delay,0ms))}
/* V013 (designer, 2026-09-30): a new run's pick comes first, dealt over the title's table (dimmed, not replaced), and
   fades off it as Keep sends the camera down to the map. */
#game #start-pick.on-table{top:0;z-index:32;background:radial-gradient(ellipse at 50% 45%,#0000 35%,#0009),#0d0b08b3}
#start-pick.leaving{animation:start-out .35s ease-in both;pointer-events:none}
@keyframes start-out{to{opacity:0}}
@media (prefers-reduced-motion:reduce){#start-pick.dealing,#start-pick.dealing .start-card,#start-pick.leaving{animation:none}.start-card.kept{transform:none}}

/* ---- W-129 surface 3: the shop's wares (shop-cards.js): the card, with a gold price strip at its foot ---- */
#screen:has(>.shop-cards){--shop-trim:0px}
#screen:has(>.shop-cards)>.site-scene{top:calc(-1 * var(--shop-trim))}
#screen:has(>.shop-cards)>.site-scene-spacer{margin-top:calc(-1 * var(--shop-trim))}
#screen:has(>.shop-cards)>.keeper-talk{margin-bottom:8px}
/* W-151 (#51) rec 4, "the shop fits the phone" (the designer: "I have to scroll on the shop page to exit"). Continue
   stands at the screen's foot, where Send wave is in a fight, and stays there if the wares ever scroll. A screen
   shorter than the shop needs (766 px of sheet under 98 px of HUD, Era II) gives up the painting's sky above the
   keeper, a pixel per pixel, down to its keeper: Safari's 780 px with its bars out shows all of it, Continue included. */
#screen:has(>.shop-cards){--shop-sky:70px}
#game[data-era="2"] #screen:has(>.shop-cards){--shop-sky:92px}
#game[data-era="3"] #screen:has(>.shop-cards){--shop-sky:86px}
#game[data-era="4"] #screen:has(>.shop-cards){--shop-sky:76px}
@media not all and (min-width:960px) and (min-height:600px) and (min-aspect-ratio:5/4){
  #screen:has(>.shop-cards){display:flex;flex-direction:column;--shop-trim:clamp(0px,calc(870px + var(--safe-top,env(safe-area-inset-top,0px)) + var(--safe-bottom,env(safe-area-inset-bottom,0px)) - 100dvh),var(--shop-sky))}
  #screen:has(>.shop-cards)>*{flex-shrink:0}
  #game #screen:has(>.shop-cards)>[data-site="leave"]{position:sticky;bottom:0;margin-top:auto;z-index:3;box-shadow:0 -10px 12px 2px var(--paper,#e6d7af)}
}
/* W-151 (#51) rec 3: a bought tower, spell or item flies off its ware (main.js flyWare), so its place is left empty. */
:is(.shop-card,.shop-detail).sold:is(.kind-tower,.kind-spell,.kind-item) .tc-model{visibility:hidden}
.tower-card.shop-card{cursor:pointer}
.shop-card[aria-disabled="true"],.shop-relic[aria-disabled="true"]{cursor:default}
.shop-card[aria-disabled="true"]:hover,.shop-relic[aria-disabled="true"]:hover,.shop-detail:hover{transform:none}
:is(.shop-cards,.shop-detail) .tc-price{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:1px 5px;flex:none;margin:0;padding:4px 8px;border:0;border-radius:0;
  background:color-mix(in srgb,var(--tc-gold) 30%,var(--tc-face));color:var(--ink);font:inherit;font-size:var(--fs-md);font-weight:800;line-height:1.1}
:is(.shop-cards,.shop-detail) .tc-price .ui-icon{width:16px;height:16px}
:is(.shop-cards,.shop-detail) .tc-price.dear b{color:var(--tc-worse)}
:is(.shop-cards,.shop-detail) .tc-price small{flex-basis:100%;font-size:var(--fs-xs);font-weight:700;color:var(--muted);text-align:center}
:is(.shop-cards,.shop-detail) .sold .tc-price,.shop-detail.sold .tc-buy{gap:4px;letter-spacing:.08em;text-transform:uppercase;font-size:var(--fs-xs);color:var(--muted)}
:is(.shop-cards,.shop-detail) .tc-check{width:13px;height:13px}
:is(.shop-cards,.shop-detail) :is(.sold,.short) .tc-price,.shop-detail:is(.sold,.short) .tc-buy{background:color-mix(in srgb,var(--tc-stage) 55%,var(--tc-face))}
:is(.shop-card,.shop-relic).short{opacity:.8}
:is(.shop-card,.shop-relic).sold{opacity:.5;filter:saturate(.45)}
.tc-emblem.tc-heart{color:#d85a4f}
:is(.shop-card,.shop-detail) .tc-relic{object-fit:contain}
#screen:has(>.shop-cards)>.shop-services{margin:8px 0 0}
#screen:has(>.shop-cards)>.shop-services+.primary{margin-top:8px}
.shop-cards~.shop-services .price{flex-direction:row;gap:3px}
/* The phone: the wares are tiles in one row, their model and price, and the tapped one (a gold rim) is the card under
   them, whose strip buys it. Four or five wares fit a row, so the stock never takes a third row of the screen. */
#game #screen .shop-cards{grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;margin-top:0}
#game #screen .shop-cards:has(>:nth-child(5)){grid-template-columns:repeat(5,minmax(0,1fr))}
.shop-cards>.tower-card{--tc-stage-h:58px}
.shop-cards>.tower-card>:is(.tc-body,.tc-cost,.tc-corner){display:none}
.shop-cards>.tower-card .tc-stage{--tc-top:6px}
.shop-cards .tc-price small{display:none}
.shop-cards .tc-price{flex-wrap:nowrap;gap:3px;padding:4px 2px}
.shop-cards .tc-price .ui-icon{width:14px;height:14px}
.shop-cards>.focus{--tc-rim:var(--tc-gold);translate:0 -3px}
.spoil-relic.shop-relic{flex-direction:column;align-items:stretch;gap:0;padding:0;overflow:hidden;cursor:pointer}
.shop-relic.focus{border-color:var(--tc-gold)}
.shop-relic .sr-body{display:none}
.shop-relic .sr-stage{width:auto;height:58px;border-radius:0}
.shop-relic .sr-stage .sr-icon{width:42px;height:42px}
.shop-detail{--tc-stage-h:124px;display:grid;grid-template-columns:40% minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto;margin-top:10px;cursor:default}
.shop-detail>.tc-stage{grid-area:1/1;height:100%;min-height:var(--tc-stage-h)}
#game .shop-detail>.tc-stage>.tc-model{position:absolute;inset:auto 0 6px;margin:0;height:calc(100% - 24px)}/* the stage's height, not the model's */
.shop-detail>.tc-stage>.tc-emblem{position:absolute;inset:0;margin:auto;width:40%;height:50%}
.shop-detail>.tc-body{grid-area:1/2;justify-content:center;padding:8px 8px 10px;gap:4px}
.shop-detail>.tc-corner{right:calc(60% + 7px)}
#game .shop-detail .tc-name{font-size:var(--fs-lg)}
#game .shop-detail .tc-line{font-size:var(--fs-sm);line-height:1.35}
.shop-detail .tc-stat dd{font-size:var(--fs-md)}
.shop-detail .tc-stats{padding:0 4px}
.shop-detail>.tc-buy{grid-area:2/1/3/3;min-height:42px;font-size:var(--fs-lg);cursor:pointer}
.shop-detail>.tc-buy:not(:disabled):active{filter:brightness(.95)}
.shop-detail>.tc-buy .ui-icon{width:18px;height:18px}
.shop-detail>.tc-buy small{flex-basis:auto;font-size:var(--fs-sm)}

/* ---- W-129 surface 4: the deck (ui-kit.js collection, deck-view.js) ---- */
/* The tiles, wherever the deck shows (the dialog, the laptop's side columns, the run's result): the card design, small. */
.deck-tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(76px,1fr));grid-auto-rows:var(--tile-h,108px);gap:6px}
.deck-tile{box-shadow:0 4px 10px #0005;font:inherit;cursor:default}
button.deck-tile{cursor:pointer}
.deck-tile .tc-stage{--tc-top:8px}
.deck-tile>.tc-body{padding:3px 3px 6px;gap:1px}
#game .deck-tile .tc-name{font-size:var(--fs-xs);line-height:1.2}
.deck-tile>.tc-body>.card-face{display:none}/* the phone: the type as glyphs in the corner */
.deck-tile .tc-cost{top:4px;left:4px;padding:1px 5px 1px 2px;font-size:var(--fs-sm)}
.deck-tile .tc-cost .ui-icon{width:10px;height:12px}
.deck-tile .tc-tiers{top:5px;right:5px;gap:3px}
.deck-tile .tc-tiers i{width:6px;height:6px}
/* Where a card is in the fight: a strip at its foot in the legend's colour; played or used it steps back. V013-DECK-HAND
   (designer, 2026-09-30, Cyber: "it says 4 in hand but there are Way more than 4 cards with a green border"): the rim is
   the card's rarity only, as on every other card; in hand no longer re-rims it, since the hand's green was the
   uncommon rim's green in every era. Superseded by V013-DECK-STATE below: every state rims, in hand in rose. */
.deck-tile::after{content:'';position:absolute;left:0;right:0;bottom:0;height:4px;background:var(--state,transparent)}
/* V013-DECK-STATE (designer, 2026-09-30: "lets not show raity as a boarder color here, lets make that boarder color match
   the staus"): in a fight the rim is where the card is, in the legend's colour; its tier marks still show its rarity. */
.deck-tile:not(.state-deck){--tc-rim:var(--state)}
.tower-card.deck-tile.rarity-rare:not(.state-deck){box-shadow:0 4px 10px #0005}
.deck-tile.state-discard{opacity:.72;filter:saturate(.5)}
.deck-tile.state-played .tc-model{filter:sepia(.35)}
.deck-tile.state-exhausted{opacity:.45;filter:grayscale(.85)}
.deck-tile.state-exhausted .tc-name{text-decoration:line-through}
.deck-tile.selected{--tc-rim:var(--tc-gold);box-shadow:0 0 0 2px var(--tc-gold),0 8px 18px #0007;opacity:1;filter:none}
.deck-belt-head{margin:0 0 6px;font-size:var(--fs-xs);font-weight:700;letter-spacing:.04em;color:var(--muted)}
/* The dialog: the belt, the legend and the tiles, then the tapped card. A tile keeps a card's shape; a bigger deck takes
   more columns and flatter tiles, so a deck of forty still needs no scrolling. */
#deck-dialog[open]{width:calc(100vw - 16px);max-width:none;max-height:calc(100dvh - 16px);padding:10px 12px 12px}
.deck-sheet{display:flex;flex-direction:column;gap:6px}
.deck-shelf{display:flex;flex-direction:column}
.deck-shelf>.deck-belt{flex:none;margin:0 0 8px}
.deck-shelf>.deck-belt .deck-tiles{grid-template-columns:repeat(5,minmax(0,1fr));grid-auto-rows:62px}
.deck-shelf>.deck-belt .tc-body{display:none}
.deck-shelf>.deck-legend{flex:none;margin:0 0 6px}
.deck-shelf>.deck-tiles{--cols:4;--tile-ar:4/5;grid-template-columns:repeat(var(--cols),minmax(0,1fr));grid-auto-rows:auto}
.deck-shelf>.deck-tiles>.deck-tile{aspect-ratio:var(--tile-ar)}
.deck-shelf>.deck-tiles>.deck-tile>.tc-body{display:none}/* the phone: the model, its type and tiers; the card below names it */
.deck-shelf>.deck-tiles>.deck-tile .tc-stage{--tc-top:14px}
.deck-shelf>.deck-tiles:has(>:nth-child(13)){--cols:5}
.deck-shelf>.deck-tiles:has(>:nth-child(21)){--cols:6;--tile-ar:5/6}
.deck-shelf>.deck-tiles:has(>:nth-child(21))>.deck-tile .tc-type{display:none}/* six across: the model and its tiers; the card below has the type */
.deck-shelf>.deck-tiles:has(>:nth-child(31)){--cols:7;--tile-ar:1}
/* The tapped card: on the phone its stage beside its words, as the shop's; what its branch does, and where it is, under it. */
.deck-focus{flex:none;display:flex;flex-direction:column;gap:6px}
.deck-focus-card{--tc-stage-h:128px;display:grid;grid-template-columns:38% minmax(0,1fr);box-shadow:0 8px 20px #0006}
.deck-focus-card>.tc-stage{grid-area:1/1;height:100%;min-height:var(--tc-stage-h)}
#game .deck-focus-card>.tc-stage>.tc-model{position:absolute;inset:auto 0 6px;margin:0;height:calc(100% - 22px)}
.deck-focus-card>.tc-body{grid-area:1/2;justify-content:center;padding:8px 8px 10px;gap:4px}
.deck-focus-card>.tc-corner{right:calc(62% + 7px)}
#game .deck-focus-card .tc-name{font-size:var(--fs-lg)}
#game .deck-focus-card .tc-line{font-size:var(--fs-sm);line-height:1.35}
.deck-focus-card .tc-stat dd{font-size:var(--fs-md)}
.deck-learned{display:flex;flex-direction:column;gap:3px;padding:6px 10px;border-left:3px solid var(--branch);border-radius:4px;background:color-mix(in srgb,var(--branch) 12%,var(--tc-face));color:var(--ink);font-size:var(--fs-xs);line-height:1.35}
.deck-learned .dl-tier{margin:0}
.deck-learned .dl-tier:not(:last-child){display:none}/* the phone: the tier it has (a tier II's words say what it adds to) */
.deck-learned .line-items{margin-top:2px}
.deck-use{margin:0;font-size:var(--fs-xs);line-height:1.35;color:var(--muted)}
.deck-foot{display:flex;flex-wrap:wrap;gap:4px 12px;margin:0;font-size:var(--fs-xs);font-weight:700;color:var(--muted)}
.deck-where{display:inline-flex;align-items:center;gap:5px;color:var(--ink)}
.deck-where i{width:10px;height:10px;border-radius:2px;background:var(--state)}
/* The laptop's side columns (the map, a fight) and the run's result: the tiles with their names, a fixed height. */
.side-panel .deck-tiles{grid-template-columns:repeat(auto-fill,minmax(104px,1fr));--tile-h:120px}
.result-collection .deck-tiles{grid-template-columns:repeat(auto-fill,minmax(104px,1fr));--tile-h:120px}

/* ---- W-129 surface 5: the hand (main.js renderBattle) ---- */
/* Each card is the card design, small: one rim (the rarity's colour when it has one), the model on a lit stage whose
   light is the card's kind (a tower warm, a spell cool), the mana at the top left, a tower's branch as a tag at the
   stage's foot, then the name and the type line; on the laptop a tower's three numbers under them. No frame art, inner
   rule or band. On the phone the cards share their rows (subgrid), so a name that wraps moves every card's rows and every
   model is the same size. The fan, the deal, the kinds' colours and the markup's hooks are as before. */
#hand{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,118px);grid-template-rows:minmax(0,1fr) auto auto auto;row-gap:0;column-gap:7px;justify-content:center;align-items:stretch}
#hand:is([data-count="1"],[data-count="2"],[data-count="3"]){grid-auto-columns:minmax(0,180px)}
#hand .card.uncommon{--rarity:var(--rarity-uncommon)}
#hand .card.rare{--rarity:var(--rarity-rare)}
#game #hand .card{--hc-rim:var(--rarity,var(--tc-edge));grid-row:1/-1;display:grid;grid-template-rows:subgrid;grid-template-columns:minmax(0,1fr);row-gap:0;justify-items:center;
  width:auto;max-width:none;min-width:0;height:auto;padding:0 0 6px;border:2px solid var(--hc-rim);border-radius:var(--tc-radius);background:var(--tc-face);color:var(--ink);overflow:hidden}
#game #hand .card::before{grid-area:1/1;position:static;align-self:stretch;justify-self:stretch;inset:auto;margin:0;border:0;clip-path:none;z-index:-1;
  background:radial-gradient(ellipse 62% 46% at 50% 66%,color-mix(in srgb,var(--rarity,var(--type-color)) 30%,transparent),#0000 78%),radial-gradient(ellipse 74% 66% at 50% 56%,var(--tc-light),#0000 74%),var(--tc-stage)}
/* #13 (the designer's iPhone 17 Pro Max): the model is placed out of flow in the stage's grid area, so its size comes
   from that area in every engine (both end lines given: out of flow, an auto line is the card's edge). In flow, Safari
   (WebKit 26) sized the SVG from its viewBox (140 px on a 160 px card at 440 × 956, against 103 px in Chrome) and it ran
   over the name. */
#game #hand .card>.piece-art{grid-area:1/1/2/2;position:absolute;top:8px;left:2px;width:calc(100% - 4px);height:calc(100% - 10px);min-height:0;margin:0;flex:none;filter:drop-shadow(0 5px 4px #00000030)}
/* W-165 (#93): the Mason's stone card's face is drawn in a box of its own (ui-kit.js stoneArt), so a block in its top
   corner would sit under the cost: it keeps the art cell's middle, below the cost, centred. The 10-26 notes (a small
   piece in a box three blocks a side): nearly the card's width, so a block is 13 px on a 63 px phone card (it was 10). */
#game #hand .card>.piece-art.stone-art{top:30px;left:5%;width:90%;height:calc(100% - 38px);filter:drop-shadow(0 3px 2px #00000030)}
#game #hand .card>.card-cost{top:4px;left:4px;z-index:2;width:auto;height:auto;display:flex;align-items:center;gap:2px;padding:2px 6px 2px 3px;border-radius:999px;background:var(--tc-face);color:var(--ink)!important;font-size:var(--fs-md);font-weight:800;line-height:1;box-shadow:0 1px 3px #0003}
#game #hand .card>.card-cost>.ui-icon{position:static;width:13px;height:15px;z-index:auto}
#hand .card-cost .ui-icon{color:#3f8fa3}
#game #hand .card.unaffordable>.card-cost{background:color-mix(in srgb,var(--tc-worse) 16%,var(--tc-face));color:var(--tc-worse)!important}
#game #hand .card.rare::after,#game #hand .card.uncommon::after{top:7px;right:7px;z-index:2}
#game #hand .card>.card-name{grid-area:2/1;align-self:center;display:block;min-height:0;margin:5px 4px 0;font-size:var(--fs-sm);font-weight:800;line-height:1.12;text-wrap:balance}
/* The type line: a tower's face (card-face.js: glyphs on the phone; on the laptop the card is its container, and a card
   wide enough gives the damage type in words), or the kind's word in its colour. (A container can't share its rows by
   subgrid, so the phone's cards aren't one.) The branch's tag leaves the line for the stage's foot. */
#game #hand .card[data-kind="tower"]>.card-kind{display:contents}
#game #hand .card>.card-kind>.card-face{grid-area:3/1;align-self:center;margin:3px 0 0;color:var(--muted)}
#game #hand .card:not([data-kind="tower"])>.card-kind{grid-area:3/1;align-self:center;margin:3px 0 0;padding:0;min-height:0;background:none;border:0;color:var(--type-color);font-size:var(--fs-xs);font-weight:800;letter-spacing:.08em;text-transform:uppercase}
#game #hand .card>.card-kind>.face-branch{grid-area:1/1;align-self:end;z-index:1;margin:0 0 4px;padding:1px 7px;border-radius:999px;background:color-mix(in srgb,var(--tc-face) 90%,transparent);color:var(--ink);font-size:var(--fs-xs);font-weight:800;line-height:1.35;white-space:nowrap;box-shadow:0 1px 2px #0002}
#game[data-era][data-neon-ui] #hand .card[data-kind]:not([data-kind="tower"])>.card-kind{box-shadow:none}/* Era III's neon ruled the band's top; the band is gone */
#hand .card-stats{display:none}/* the phone: too small; the laptop shows them */
/* W-152 (#52) Tactics (the designer, 2026-10-17: "a different name and card color"; "Orange"; "Dim what can't be played
   now, A corner mark"). A tactic's card is orange through: its face and stage, its rim (a rarity keeps its own), its
   word. Its corner mark is a bolt on orange; a spell's an hourglass in its blue. In planning a tactic can't be cast, so
   it dims (it can still be picked, to read it); in a wave it is bright. A rarity's gem steps left of the mark. */
#game #hand .card[data-kind="tactic"]{--hc-rim:var(--rarity,var(--type-color));background:color-mix(in srgb,var(--type-color) 20%,var(--tc-face))}
#game #hand .card[data-kind="tactic"]::before{background-color:color-mix(in srgb,var(--type-color) 24%,var(--tc-stage))}
#game #hand .card>.kind-mark{position:absolute;z-index:2;top:4px;right:4px;display:grid;place-items:center;width:20px;height:20px;border-radius:50%;background:var(--tc-face);color:var(--type-color);box-shadow:0 1px 3px #0003}
#game #hand .card>.kind-mark.mark-tactic{background:var(--type-color);color:#fff8ef}
#game #hand .card>.kind-mark svg{width:14px;height:14px}
#game #hand .card:is(.rare,.uncommon):has(>.kind-mark)::after{right:30px;top:11px}
/* A crowded phone hand (six cards or more, each too narrow for the cost and the mark side by side): the mark steps down
   to the picture's foot, so the cost stays clear, and the gem keeps its corner. */
@media not all and (min-width:960px) and (min-height:600px) and (min-aspect-ratio:5/4){
  #game #hand:not([data-count="1"],[data-count="2"],[data-count="3"],[data-count="4"],[data-count="5"]) .card>.kind-mark{grid-area:1/1/2/2;top:auto;bottom:3px;right:3px;width:17px;height:17px}
  #game #hand:not([data-count="1"],[data-count="2"],[data-count="3"],[data-count="4"],[data-count="5"]) .card>.kind-mark svg{width:12px;height:12px}
  #game #hand:not([data-count="1"],[data-count="2"],[data-count="3"],[data-count="4"],[data-count="5"]) .card:is(.rare,.uncommon):has(>.kind-mark)::after{right:7px;top:7px}
}
/* W-158 (#77) (the designer, 2026-10-20: "Gray out tower and spells cards that are too expensive to use the same way we
   gray out tactics when its not the right time to use them. So a greyed out card always means cannot be used right
   now."): a card the mana can't pay for dims the same way (its cost pill stays red, above, so the reason reads), and
   comes back the moment it can be paid for (main.js frame: hand-afford.js). It can still be picked, to read it. */
/* W-158 (#80): the dim is a filter, never an opacity: a greyed card stays as solid as its neighbours, so the hand's
   paper (Era II's brass rails) never shows through it (the designer: "I do not like how the era 2 backgrounds look
   especially with the grayed out cards"). */
#game #hand .card:is(.not-now,.unaffordable){filter:saturate(.4) brightness(.74) contrast(.94)}
#game #hand .card:is(.not-now,.unaffordable).selected{filter:saturate(.6) brightness(.86)}
.tower-card.kind-spell{--type-color:#337e9b}
.tower-card.kind-tactic{--type-color:#d4561a;background:color-mix(in srgb,var(--type-color) 14%,var(--tc-face))}
.tower-card.kind-tactic:not(.deck-tile){--tc-rim:var(--rarity,var(--type-color))}/* a deck tile's rim says where the card is */
.tower-card.kind-tactic .tc-stage{background-color:color-mix(in srgb,var(--type-color) 20%,var(--tc-stage))}
#game[data-era="3"][data-neon-ui] .tower-card.kind-spell{--type-color:#3de9f2}
#game[data-era="3"][data-neon-ui] .tower-card.kind-tactic{--type-color:#ff7a2e}
.tc-kind:is(.kind-spell,.kind-tactic){color:var(--type-color)}
.kind-mark-inline{display:inline-block;margin-right:4px;vertical-align:-.2em}
.kind-mark-inline svg{display:block;width:1.2em;height:1.2em}
.deck-tile>.tile-mark{position:absolute;z-index:2;top:4px;right:4px;display:grid;place-items:center;width:16px;height:16px;border-radius:50%;background:var(--tc-face);color:var(--type-color);box-shadow:0 1px 2px #0003}
.deck-tile>.tile-mark.mark-tactic{background:var(--type-color);color:#fff8ef}
.deck-tile>.tile-mark svg{width:11px;height:11px}
#game #hand .card.selected{--hc-rim:var(--tc-gold);outline:0;box-shadow:0 0 0 1px var(--tc-gold),0 6px 12px #0006}

/* ---- W-129 surface 6: the upgrade sheet (upgrade-sheet.js): the rest's, the forge's, an event's and an elite's unlock
   are the win's upgrade (the tiles, the tree docked beside them) on the same table, laid over the page under the HUD. */
#upgrade-sheet{position:absolute;left:0;right:0;top:44px;bottom:0;z-index:9;display:flex;flex-direction:column;padding:14px 10px;overflow:hidden;
  background:radial-gradient(ellipse 60% 46% at 50% 50%,color-mix(in srgb,var(--tc-light) 16%,transparent),#0000 72%),radial-gradient(ellipse at 50% 45%,#0000 45%,#0000005c),var(--tc-table)}
#upgrade-sheet .sheet-back{margin-top:2px}

/* ---- W-129 surface 7: a card's details (the ⓘ sheet, the laptop's docked card) and a placed tower's panel ---- */
/* The card design's parts on the details: the era's card face and one rim (no parchment or frame art), the model on a
   lit stage, the numbers as soft cells in the stage's tone (no bar down their side), then the rules and the actions as
   before. The markup is main.js's and tower-info.js's as it was; a minion's and the formation's sheets take the same
   face and rim. Era III's neon lights the rim as it lights the tower card (neon.css). */
#game[data-era] #overlay .info-card,#game #overlay .info-card{background:var(--tc-face);border:2px solid var(--tc-edge);border-radius:var(--tc-radius);box-shadow:0 12px 30px #0007,0 2px 0 #0003}
#game[data-era="3"][data-neon-ui] #overlay .info-card{box-shadow:0 12px 30px #000b,0 0 14px color-mix(in srgb,var(--tc-edge) 40%,transparent),inset 0 0 16px color-mix(in srgb,var(--tc-edge) 16%,transparent)}
#game .info-head>svg.info-art{--stage-light:var(--tc-light);width:92px;height:92px;padding:12px 6px 6px;box-sizing:border-box;border:0;border-radius:calc(var(--tc-radius) - 2px);object-fit:contain;filter:none;
  background:radial-gradient(ellipse 62% 46% at 50% 66%,color-mix(in srgb,var(--stage-light) 34%,transparent),#0000 78%),radial-gradient(ellipse 74% 66% at 50% 56%,var(--tc-light),#0000 74%),var(--tc-stage)}
#game .info-head>svg.info-art>image{filter:drop-shadow(0 5px 4px #00000030)}
#game :is(.info-card,.side-card) .combat-stats>div{padding:6px 9px 7px;border:0;border-radius:calc(var(--tc-radius) - 3px);background:color-mix(in srgb,var(--tc-stage) 62%,transparent)}
#game :is(.info-card,.side-card) .combat-stats dt{font-size:var(--fs-xs);font-weight:750;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
/* The placed tower's model (its turning viewer) stands on the stage across the top of the panel, the eye and the close
   button over its corners. */
#game #overlay .info-card .tower-info .tower-model{margin:-12px -12px 10px;border-radius:calc(var(--tc-radius) - 2px) calc(var(--tc-radius) - 2px) 0 0;
  background:radial-gradient(ellipse 58% 50% at 50% 64%,color-mix(in srgb,var(--tc-light) 30%,transparent),#0000 76%),radial-gradient(ellipse 72% 66% at 50% 56%,var(--tc-light),#0000 74%),var(--tc-stage)}
#game #overlay .info-card .tower-info .inspector-actions{background:var(--tc-face)}
/* The next tier (and why there is none) is a soft cell in the stage's tone too, no bar down its side. */
#game .info-card .tower-next{border:0;border-radius:calc(var(--tc-radius) - 3px);background:color-mix(in srgb,var(--tc-stage) 62%,transparent)}
#game .info-card .tower-next.tower-why{background:none;padding-inline:2px}
#game .info-card .tower-next.tower-note{background:color-mix(in srgb,var(--tc-gold) 34%,transparent)}
/* The laptop's docked card: the same card in the deck's column, its model larger. */
#game :is(#side-deck,#side-map-deck) .side-card{padding:14px;background:var(--tc-face);border:2px solid var(--tc-edge);border-radius:var(--tc-radius);box-shadow:0 8px 22px #0004}
#game .side-card .info-head>svg.info-art{flex:none;width:min(112px,40%);height:auto;aspect-ratio:1}
/* The words beside the model take the room that is left (no close button's gap here): the name wraps, and so does the
   type line, which rounds into a soft cell rather than running past the card's edge. */
#game :is(#side-deck,#side-map-deck) .side-card .info-head{padding-right:0}
#game :is(.side-card,.info-card) .info-head>div{flex:1 1 0;min-width:0}
#game .side-card .info-head h3{font-size:var(--fs-2xl);line-height:1.1;overflow-wrap:break-word}
#game .side-card .info-head .card-face.face-line{flex-wrap:wrap;row-gap:2px;white-space:normal;border-radius:10px}
#game .side-card .combat-stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin:4px 0 8px}/* two across, as the phone's */
@media (max-height:760px){#game :is(#side-deck,#side-map-deck) .side-card{padding:10px}#game .side-card .info-head>svg.info-art{width:84px;height:84px}}
@media (max-height:640px){#game :is(#side-deck,#side-map-deck) .side-card{padding:8px}#game .side-card .info-head>svg.info-art{width:64px;height:64px;padding:6px 4px 4px}#game .side-card .info-head h3{font-size:var(--fs-2xl)}#game .side-card .info-actions{margin-top:10px}}

/* ---- W-129 surface 8: the rest camp's and the forge's choices (screens.js siteScreen): cards of the design ---- */
/* Each choice is the card: its art on the lit stage, its name, what it does. They sit side by side (the shop's wares'
   row), a single one no wider than a card. The markup is siteScreen's as it was. */
#screen:is([data-view="rest"],[data-view="forge"])>.site-actions{--sc-stage-h:92px;display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,230px);justify-content:center;gap:8px}
#game #screen:is([data-view="rest"],[data-view="forge"]) .site-choice{display:flex;flex-direction:column;align-items:stretch;gap:0;min-height:0;margin:0;padding:0;
  border:2px solid var(--tc-edge);border-radius:var(--tc-radius);background:var(--tc-face);color:var(--ink);text-align:center;overflow:hidden;box-shadow:0 12px 30px #0007,0 2px 0 #0003;transition:transform .16s ease,box-shadow .16s ease}
#game #screen:is([data-view="rest"],[data-view="forge"]) .site-choice:hover:not(:disabled){transform:translateY(-4px);box-shadow:0 20px 38px #0008,0 0 0 1px var(--tc-edge)}
#game #screen:is([data-view="rest"],[data-view="forge"]) .site-choice:focus-visible{outline:3px solid var(--tc-gold);outline-offset:3px}
#game #screen:is([data-view="rest"],[data-view="forge"]) .site-choice:disabled{opacity:.5;filter:saturate(.45)}
#game #screen:is([data-view="rest"],[data-view="forge"]) .site-choice>svg:first-child{display:block;flex:none;width:100%;height:var(--sc-stage-h);max-width:none;margin:0;padding:12px 10px 6px;box-sizing:border-box;border:0;
  background:radial-gradient(ellipse 58% 50% at 50% 62%,color-mix(in srgb,var(--tc-light) 30%,transparent),#0000 76%),radial-gradient(ellipse 72% 66% at 50% 56%,var(--tc-light),#0000 74%),var(--tc-stage);filter:none}
#game #screen:is([data-view="rest"],[data-view="forge"]) .site-choice>svg.site-icon{padding:22px 10px 16px;color:#c7962f}/* the salvage: the coin */
#game #screen:is([data-view="rest"],[data-view="forge"]) .site-choice>div{display:flex;flex-direction:column;align-items:center;gap:3px;padding:8px 8px 10px}
#game #screen:is([data-view="rest"],[data-view="forge"]) .site-choice h3{margin:0;font-size:var(--fs-base);font-weight:800;line-height:1.15;color:var(--ink)}
#game #screen:is([data-view="rest"],[data-view="forge"]) .site-choice p{margin:0;font-size:var(--fs-xs);line-height:1.35;color:var(--muted);text-wrap:balance}

/* ---- W-129 surface 9: the belt is full (item-belt.js beltFullMarkup) ---- */
/* The new item and the belt's as cards on the table (the win's, the upgrade sheet's), the new one rimmed gold with
   "New" in its corner, each with "Leave behind" at its foot the way a shop ware carries its price. Two by two on the
   phone, four in a row on the laptop. */
#game #belt-full{padding:14px 10px;overflow:hidden;
  background:radial-gradient(ellipse 60% 46% at 50% 50%,color-mix(in srgb,var(--tc-light) 16%,transparent),#0000 72%),radial-gradient(ellipse at 50% 45%,#0000 45%,#0000005c),var(--tc-table)}
#game #belt-full>.belt-sheet{margin:auto;gap:12px}
.belt-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;width:100%}
.tower-card.belt-card{--tc-stage-h:84px;cursor:pointer}
.belt-card .tc-body{padding:6px 6px 8px}
.belt-card .tc-stage{--tc-top:24px}/* the art clears the corner's words */
#game .belt-card .tc-line{max-width:none;font-size:var(--fs-xs)}

/* V013-MINION-CARDS: the wave's minions (main.js wavePreview) as compact cards of this design, the size of the hand's
   cards on the right: the model on its stage, the count where a tower's cost sits, the name, health · armor · breach
   (a glyph and its number, the word under it) and the route line. One size on every layout, so #game-scoped. */
#game .tower-card.minion-card{--tc-stage-h:84px;box-shadow:0 6px 16px #0005}
#game .tower-card.minion-card:hover{transform:none;box-shadow:0 6px 16px #0005}
#game .minion-card .tc-stage{--tc-top:12px}
#game .minion-card .tc-body{gap:4px;padding:6px 4px 8px}
#game .tower-card.minion-card .tc-name{font-size:var(--fs-sm);line-height:1.15}
#game .minion-card .tc-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0;width:100%;margin:0;padding:0 2px}
/* A boss in its own wave's preview (the Goblin Hut's 1050; T4, #46): a four-digit value takes a line of its own, the
   other two below it, since three stats need about 104px of a phone card's 95 (T4 measured at 390 wide). */
#game .minion-card .tc-stats:has(.tc-long){grid-template-columns:1fr 1fr;row-gap:2px}
#game .minion-card .tc-stat.tc-long{grid-column:1/-1}
#game .minion-card .tc-stat{gap:1px}
#game .minion-card .tc-stat dd{height:auto;gap:2px;align-items:center;font-size:var(--fs-md);line-height:1.15}
#game .minion-card .tc-stat dd small{font-size:.7em}
/* #8 (W-138) Hardened: a health raised this wave is marked in red with a small up-arrow (the percent is on the card's line) */
#game .tower-card.minion-card .tc-stat.tc-boosted dd{color:#c0392b}
#game[data-era="3"][data-neon-ui] .minion-card .tc-stat.tc-boosted dd{color:#ff7a93}/* Era III's neon face is dark */
#game .minion-card .tc-stat dd small.tc-boost{color:inherit;font-size:.62em;margin-left:-1px}
#game .minion-card .tc-glyph{display:block;width:11px;height:11px}
/* The laptop names each number under the glyph (the phone's card is too narrow: the glyphs alone, as a tower card). */
@media (min-width:960px) and (min-height:600px) and (min-aspect-ratio:5/4){#game .minion-card .tc-stat dt{position:static;width:auto;height:auto;overflow:visible;clip-path:none;font-size:10px;font-weight:650;letter-spacing:0;text-transform:none}}
#game .tower-card.minion-card .tc-line{max-width:none;min-height:0;font-size:var(--fs-xs);line-height:1.3;color:var(--muted)}
.belt-leave{display:block;flex:none;padding:5px 8px;background:color-mix(in srgb,var(--tc-stage) 60%,var(--tc-face));font-size:var(--fs-xs);font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.belt-card:is(:hover,:focus-visible) .belt-leave{background:color-mix(in srgb,var(--tc-worse) 18%,var(--tc-face));color:var(--tc-worse)}
.belt-card.new .belt-leave{background:color-mix(in srgb,var(--tc-gold) 30%,var(--tc-face));color:var(--ink)}

/* ---- W-129 surface 10: the mastered pick and the card removal (mastery-flow.js masteryMarkup) ---- */
/* On the table like the upgrade sheet: the title centred, the Back button at its left. The three picks and a copy's
   other branches are cards side by side (the choice's glyph or model on the stage, its name, what it does). The deck
   to remove from and the towers to reforge are tiles (the art and the name) that grow columns with the deck, so the
   step fits one screen; the tapped card's whole text is the confirm step's card. The markup is masteryMarkup's as it
   was, so the shop's card removal, which shares it, takes the same look. */
#game #mastery-flow{padding:14px 10px;overflow:hidden;
  background:radial-gradient(ellipse 60% 46% at 50% 50%,color-mix(in srgb,var(--tc-light) 16%,transparent),#0000 72%),radial-gradient(ellipse at 50% 45%,#0000 45%,#0000005c),var(--tc-table)}
#game #mastery-flow>.uf-sheet{flex:1 1 auto;display:flex;flex-direction:column;justify-content:center;gap:12px;width:100%;max-width:none;height:auto;max-height:none;margin:0;padding:0;background:none;border:0;overflow:visible}
#game #mastery-flow .uf-head{position:relative;display:block;margin:0;padding:0 46px;border:0;text-align:center}
#game #mastery-flow .uf-head h1{margin:0;font-size:var(--fs-4xl);font-weight:800;line-height:1.08;color:var(--tc-title);text-shadow:0 2px 10px #0006}
#game #mastery-flow .uf-head p{margin:4px 0 0;font-size:var(--fs-sm);color:var(--tc-title-muted)}
#game #mastery-flow .uf-back{position:absolute;left:0;top:0;border-color:color-mix(in srgb,var(--tc-title-muted) 50%,transparent);background:none;color:var(--tc-title)}
#game #mastery-flow .mf-list{--mf-stage:84px;display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,210px);justify-content:center;gap:8px;width:100%;max-width:none;margin:0}
#game #mastery-flow .mf-card{display:flex;flex-direction:column;align-items:stretch;gap:0;min-height:0;padding:0;border:2px solid var(--tc-edge);border-radius:var(--tc-radius);background:var(--tc-face);color:var(--ink);text-align:center;overflow:hidden;
  box-shadow:0 12px 30px #0007,0 2px 0 #0003;transition:transform .16s ease,box-shadow .16s ease;filter:none;translate:none}
#game #mastery-flow .mf-card:not([disabled],.mf-confirm-card):is(:hover,:focus-visible){transform:translateY(-4px);box-shadow:0 20px 38px #0008,0 0 0 1px var(--tc-edge);filter:none}
#game #mastery-flow .mf-card[disabled]{opacity:.45;filter:saturate(.45)}
#game #mastery-flow .mf-card>:is(.mf-art,.mf-glyph){flex:none;display:grid;place-items:center;width:100%;height:var(--mf-stage);margin:0;padding:12px 8px 6px;box-sizing:border-box;border-radius:0;box-shadow:none;
  background:radial-gradient(ellipse 58% 50% at 50% 62%,color-mix(in srgb,var(--branch,var(--tc-light)) 30%,transparent),#0000 76%),radial-gradient(ellipse 72% 66% at 50% 56%,var(--tc-light),#0000 74%),var(--tc-stage)}
#game #mastery-flow .mf-glyph .ui-icon{width:38px;height:38px;color:#c7962f}
#game #mastery-flow .mf-card>div{display:flex;flex-direction:column;align-items:center;gap:3px;padding:8px 8px 10px}
#game #mastery-flow .mf-card strong{font-size:var(--fs-base);font-weight:800;line-height:1.15}
#game #mastery-flow .mf-card :is(small,p){margin:0;font-size:var(--fs-xs);line-height:1.35;color:var(--muted);text-wrap:balance}
#game #mastery-flow .mf-branch{border-left-width:2px}/* a branch's colour lights its stage, not a bar down its side */
/* The deck to remove from, the towers to reforge: tiles, the art and the name. */
#game #mastery-flow:is([data-step="remove"],[data-step="reforge"]) .mf-list{--mf-stage:62px;--mf-cols:4;grid-auto-flow:row;grid-template-columns:repeat(var(--mf-cols),minmax(0,1fr));grid-auto-columns:auto;gap:6px}
#game #mastery-flow:is([data-step="remove"],[data-step="reforge"]) .mf-list:has(>:nth-child(17)){--mf-cols:5;--mf-stage:54px}
#game #mastery-flow:is([data-step="remove"],[data-step="reforge"]) .mf-list:has(>:nth-child(26)){--mf-cols:6;--mf-stage:46px}
#game #mastery-flow:is([data-step="remove"],[data-step="reforge"]) .mf-card>div{padding:4px 3px 6px}
#game #mastery-flow:is([data-step="remove"],[data-step="reforge"]) .mf-card strong{font-size:var(--fs-xs);line-height:1.15}
#game #mastery-flow:is([data-step="remove"],[data-step="reforge"]) .mf-card :is(small,p){display:none}
#game #mastery-flow:is([data-step="remove"],[data-step="reforge"]) .mf-card>.mf-art{padding:8px 4px 3px}
/* The confirm step: the card whole (its stage beside its words on the phone), Keep it and Remove under it. */
#game #mastery-flow[data-step="confirm"] .mf-list{grid-auto-flow:row;grid-auto-columns:auto;grid-template-columns:minmax(0,440px)}
#game #mastery-flow .mf-confirm-card{display:grid;grid-template-columns:38% minmax(0,1fr);text-align:left}
#game #mastery-flow .mf-confirm-card>.mf-art{height:100%;min-height:120px}
#game #mastery-flow .mf-confirm-card>div{align-items:flex-start;justify-content:center;padding:10px 12px}
#game #mastery-flow .mf-confirm{margin:4px 0 0}

/* ---- W-129 surface 11: the run's end, Victory or Defeat (journey-ui.js resultScreen) ---- */
/* The win's table, not the framed page with its pennant: the medallion (the crown, or the opponent who ended the run),
   the title, how the run ended and its three numbers, then the deck as tiles, the road taken as its stops' pictures,
   and New run at the foot. The deck's rows shrink to fit the screen (each up to a tile's height), and a tile that gets
   short drops its type line, then its name; a bigger deck takes more columns. Nothing scrolls. */
html #game #screen:is([data-view="victory"],[data-view="defeat"]):has(>.run-result){display:flex;flex-direction:column;overflow:hidden;border:0;margin:0;padding:14px 10px;
  background:radial-gradient(ellipse 60% 46% at 50% 50%,color-mix(in srgb,var(--tc-light) 16%,transparent),#0000 72%),radial-gradient(ellipse at 50% 45%,#0000 45%,#0000005c),var(--tc-table)}
#game .run-result{flex:1 1 auto;min-height:0;justify-content:center;gap:10px;margin:0}
#game .run-result>*{flex:none}
.result-medal{display:grid;place-items:center;width:52px;height:52px;border-radius:50%;border:2px solid var(--tc-gold);
  background:radial-gradient(circle at 50% 40%,var(--tc-light),var(--tc-stage) 76%);box-shadow:0 0 0 4px #0000003a,0 8px 22px #0008}
.result-medal .ui-icon{width:30px;height:30px;color:var(--tc-gold)}
.run-result.lost .result-medal{border-color:var(--tc-edge);filter:saturate(.35)}
.run-result.lost .result-medal .ui-icon{color:var(--tc-title-muted)}
.run-result .spoils-head{animation:banner-drop .32s cubic-bezier(.2,.9,.3,1.1) both}
#game .run-result>.result-collection{flex:0 1 auto;display:flex;flex-direction:column;gap:6px;width:100%;max-width:1100px;min-height:0;margin:0}
#game #screen .run-result .collection-heading{flex:none;justify-content:center;gap:8px;margin:0;font-size:var(--fs-xs);font-weight:700;letter-spacing:.09em;text-transform:uppercase;color:var(--tc-title-muted)}
#game #screen .run-result .collection-heading h2{margin:0;font:inherit;color:var(--tc-title)}
#game #screen .run-result .collection-heading>span{font:inherit;color:inherit}
#game #screen .run-result .collection-heading>span::before{content:'· ';}
#game .run-result .deck-belt{flex:none;margin:0}
#game #screen .run-result .deck-belt-head{margin:0 0 4px;text-align:center;color:var(--tc-title-muted)}
#game .run-result .deck-belt .deck-tiles{grid-template-columns:repeat(auto-fit,minmax(0,60px));grid-auto-rows:54px;justify-content:center}
#game .run-result .deck-belt .tc-body{display:none}
#game .run-result .result-collection>.deck-tiles{--cols:4;--tile-h:108px;flex:0 1 auto;min-height:0;grid-template-columns:repeat(var(--cols),minmax(0,1fr));grid-auto-rows:minmax(0,var(--tile-h))}
#game .run-result .result-collection>.deck-tiles:has(>:nth-child(13)){--cols:5}
#game .run-result .result-collection>.deck-tiles:has(>:nth-child(21)){--cols:6}
#game .run-result .result-collection>.deck-tiles:has(>:nth-child(31)){--cols:7}
#game .run-result .result-collection>.deck-tiles>.deck-tile{container-type:size}
@container (max-height:100px){#game .run-result .deck-tile>.tc-body>.card-face{display:none}}
@container (max-height:76px){#game .run-result .deck-tile>.tc-body{display:none}}
@container (max-height:60px){#game .run-result .deck-tile>:is(.tc-type,.tc-tiers,.tc-cost){display:none}#game .run-result .deck-tile .tc-stage{--tc-top:3px}}
.result-road{display:flex;flex-wrap:wrap;justify-content:center;gap:4px;max-width:100%;margin:0;padding:0;list-style:none}
.result-road li{position:relative;display:block;flex:none}
.result-road li.new-era{margin-left:10px}
.result-road img{display:block;width:24px;height:24px;border-radius:50%;object-fit:cover;border:1.5px solid color-mix(in srgb,var(--tc-edge) 80%,transparent);box-shadow:0 2px 6px #0006}
#game .run-result .spoils-continue{margin:2px auto 0}
@media (prefers-reduced-motion:reduce){.run-result .spoils-head{animation:none}}

/* W-129's trial-tower rows in the Developer tab gave way to one switch and the board's tower picker (W-140, tower-picker.css). */

/* A narrow phone (375 wide): the three numbers in a card a third of the screen across, packed a little tighter. */
@media (max-width:380px){
  .tc-stats{gap:2px;padding:0 1px}
  .tc-stat dd{font-size:12.5px;gap:1px}
  .tc-glyph{width:9px;height:9px}
}

/* A short phone (an iPhone SE's 667): the same screen, packed tighter so it still needs no scrolling. */
@media (max-height:740px){
  html #game #screen[data-view="reward"]:has(>.spoils){padding:8px}
  .spoils{gap:8px}
  .spoils-medallion{width:40px;height:40px;box-shadow:0 0 0 3px #0000003a,0 6px 16px #0008}
  #game .spoils .spoils-head h1{margin-top:6px;font-size:var(--fs-3xl)}
  #game .spoils .spoils-prompt{margin-top:2px}
  .spoils-receipt{margin-top:4px}
  .spoils-receipt b{font-size:var(--fs-md)}
  .tower-card{--tc-stage-h:84px}
  .tc-body{padding:6px 6px 8px;gap:3px}
  .spoils-relics{gap:6px}
  .spoil-relic{padding:4px 8px 4px 4px;gap:8px}
  .sr-stage{width:36px;height:36px}.sr-stage .sr-icon{width:30px;height:30px}
  #game .spoil-relic h3{font-size:var(--fs-md)}
  #game .spoil-relic p{font-size:var(--fs-xs);line-height:1.3}
  /* The upgrade reward: the fight's receipt is title enough; smaller tiles and medals. */
  .spoils.upgrades .spoils-medallion{display:none}
  #game .spoils.upgrades .spoils-head h1{margin-top:0}
  .victory-upgrade{gap:8px}
  .victory-upgrade .victory-tiles{--tile-h:54px;gap:5px}
  .upgrade-panel{gap:6px;padding:8px 10px 10px}
  .up-option{--disc:46px;padding:5px 4px 4px;gap:2px}
  .up-tree[data-n="1"] .up-option{--disc:54px}
  .up-lines,.up-row{font-size:var(--fs-xs)}
  #game .up-unlock{padding:6px 10px}
  .up-range{--rg-cell:5px;width:min(calc(var(--rg-n) * var(--rg-cell)),48px);height:min(calc(var(--rg-slot,var(--rg-n)) * var(--rg-cell)),48px)}
  /* The deck on a short phone: flatter tiles and a shorter card. */
  .deck-shelf>.deck-tiles,.deck-shelf>.deck-tiles:has(>:nth-child(21)){--tile-ar:1}
  .deck-shelf>.deck-tiles:has(>:nth-child(21)){--tile-ar:6/5}
  .deck-shelf>.deck-tiles:has(>:nth-child(31)){--tile-ar:4/3}
  .deck-shelf>.deck-belt .deck-tiles{grid-auto-rows:50px}
  .deck-focus-card{--tc-stage-h:104px}
  /* The hand on a short phone: a smaller name, so the stage keeps its room. */
  #game #hand .card>.card-name{font-size:var(--fs-xs);margin-top:4px}
  /* The upgrade sheet on a short phone: under the shorter HUD, closer to the edges. */
  #upgrade-sheet{top:40px;padding:8px}
  /* The belt-full sheet on a short phone: a smaller stage. */
  #game #belt-full{top:40px;padding:8px}
  .tower-card.belt-card{--tc-stage-h:78px}
  .belt-card .tc-stage{--tc-top:20px}
  /* The mastered pick on a short phone: under the shorter HUD, smaller stages. */
  #game #mastery-flow{top:40px;padding:8px}
  #game #mastery-flow .mf-list{--mf-stage:66px}
  #game #mastery-flow:is([data-step="remove"],[data-step="reforge"]) .mf-list{--mf-stage:48px}
  /* The run's end on a short phone: a smaller medallion and title, the road in smaller stops. */
  html #game #screen:is([data-view="victory"],[data-view="defeat"]):has(>.run-result){padding:8px}
  #game .run-result{gap:8px}
  #game .run-result :is(.result-medal,.spoils-medallion){width:40px;height:40px}
  #game .run-result .result-medal .ui-icon{width:24px;height:24px}
  #game .run-result .deck-belt .deck-tiles{grid-auto-rows:46px}
  .result-road img{width:20px;height:20px}
  /* The shop on a short phone: the tiles and the tapped card give up their stage (the painting has already given up
     its sky, --shop-sky: W-151 above). */
  .shop-cards>.tower-card{--tc-stage-h:46px}
  .spoil-relic.shop-relic .sr-stage{height:46px}
  .shop-detail{--tc-stage-h:104px;margin-top:6px}
  #screen:has(>.shop-cards)>.keeper-talk{margin-bottom:6px}
  #screen:has(>.shop-cards)>.keeper-talk .keeper-line{font-size:var(--fs-md)}
  #screen:has(>.shop-cards)>.shop-services{margin-top:6px}
  #screen:has(>.shop-cards)>.shop-services+.primary{margin-top:6px}
  .shop-cards~.shop-services .shop-service{min-height:38px}
}
/* W-132: the upgrade reward on a phone with a big deck (three rows of tiles). Every branch now shows the tower's own
   rows, Targets among them (the short phone no longer hides the rows a branch leaves alone), so the screen makes room
   above them: the medal goes, the tiles are flatter and the rows closer, and still nothing scrolls. */
@media not all and (min-width:960px) and (min-height:600px) and (min-aspect-ratio:5/4){
  .spoils.upgrades:has(.victory-tiles>:nth-child(13)) .spoils-medallion{display:none}
  #game .spoils.upgrades:has(.victory-tiles>:nth-child(13)) .spoils-head h1{margin-top:0}
  .victory-upgrade .victory-tiles:has(>:nth-child(13)){--tile-h:50px}
  .victory-upgrade:has(.victory-tiles>:nth-child(13)) .up-row{line-height:1.2}
  @media (max-height:740px){
    .victory-upgrade .victory-tiles:has(>:nth-child(13)){--tile-h:42px;gap:4px}
    .victory-upgrade:has(.victory-tiles>:nth-child(13)) .up-rows:has(>:nth-child(6)) .up-range{--rg-cell:4px}
  }
}

/* ---- the laptop ---- */
@media (min-width:960px) and (min-height:600px) and (min-aspect-ratio:5/4){
  /* The spoils take the whole table under the HUD, not a framed page in the middle of it. */
  html #game #screen[data-view="reward"]:has(>.spoils){flex:1;width:100%;max-width:none;max-height:none;margin:0;padding:clamp(14px,2.6vh,28px) 28px}
  .spoils{--tc-w:minmax(0,300px);--tc-gap:clamp(14px,2vw,28px);gap:clamp(12px,2.6vh,26px)}
  .spoils-medallion{width:72px;height:72px;box-shadow:0 0 0 5px #0000003a,0 8px 22px #0008}
  #game .spoils .spoils-head h1{margin-top:12px;font-size:clamp(26px,2.6vw,36px)}
  #game .spoils .spoils-prompt{margin-top:6px;font-size:var(--fs-lg)}
  .spoils-receipt{gap:clamp(18px,2.4vw,30px);margin-top:10px}
  .spoils-relics{grid-template-columns:repeat(3,var(--tc-w))}

  .tower-card{--tc-stage-h:clamp(160px,26vh,232px)}
  .tc-stage{--tc-top:38px}
  .tc-cost{top:9px;left:9px;padding:3px 9px 3px 5px;font-size:var(--fs-xl)}
  .tc-cost .ui-icon{width:17px;height:19px}
  .tc-corner{top:12px;right:12px}
  .tc-corner .rarity-mark{font-size:var(--fs-xs);gap:6px}
  .tc-corner .tc-state{font-size:var(--fs-xs);gap:4px}
  .tc-note{top:calc(var(--tc-stage-h) - 30px);padding:3px 10px}
  .tc-body{gap:6px;padding:13px 16px 16px}
  #game .tower-card .tc-name{font-size:var(--fs-3xl);letter-spacing:-.005em}
  .tc-body .card-face.face-line :is(.face-words,.face-sep){display:inline}
  .tc-body .card-face.face-line .face-reach{display:none}
  /* The laptop: flex again (one-line names), the numbers under their words. */
  .spoils-towers>.tower-card{display:flex}
  .spoils-towers>.tower-card>.tc-body{display:flex}
  .spoils-towers .tc-body>:is(.tc-name,.tc-stats,.tc-line){padding:0;margin:0}
  .spoils-towers .tc-body>:is(.tc-name,.card-face,.tc-stats,.tc-line){align-self:center}
  .spoils-towers .tc-body>.card-face{margin-top:0}
  .spoils-towers .tc-body>.tc-stats{width:100%;margin:8px 0 4px}
  .tc-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0;margin:8px 0 4px}
  .tc-stat{gap:4px}
  .tc-stat dd{height:28px;gap:1px;align-items:baseline;font-size:22px;line-height:28px}
  .tc-stat dd small{font-size:13px}
  .tc-range dd{align-items:center}
  .tc-stat dt{position:static;width:auto;height:auto;overflow:visible;clip-path:none}
  .tc-glyph{display:none}
  .tc-stat dd small.tc-glyph-says{display:inline}
  .tc-range dd{gap:6px}
  .range-glyph{--rg-cell:3px}
  .tc-stat dd{height:28px}
  #game .tower-card .tc-line{min-height:2.7em;font-size:var(--fs-md)}

  .spoil-relic{gap:12px;padding:10px 14px 10px 10px}
  .victory-tiles{--tile-h:210px;grid-template-columns:repeat(var(--cols-l),minmax(0,200px));grid-template-rows:repeat(var(--rows-l),minmax(0,var(--tile-h)));gap:clamp(12px,1.6vw,20px)}
  .tower-tile .tc-stage{--tc-top:14px}
  .tower-tile .tc-body{padding:8px 10px 11px;gap:3px}
  #game .tower-tile .tc-name{font-size:var(--fs-lg)}
  .tc-tiers{top:11px;right:11px}
  .tc-tiers i{width:8px;height:8px}
  .tc-kind-more{display:inline}
  /* The start: the six in one row, dealt like a hand. The cards share their rows (a name that wraps moves all six
     together), and at this width the numbers are glyphs, as on the phone. */
  #game #start-pick:has(>.start-pick){padding:clamp(14px,2.6vh,28px) 28px}
  .start-cards{grid-template-columns:repeat(6,minmax(0,236px));gap:clamp(10px,1.4vw,24px)}
  .start-cards>.tower-card{display:grid}
  .start-cards>.tower-card>.tc-body{display:contents}
  .start-cards .tc-body>.tc-name{padding:12px 8px 0;align-self:end}
  .start-cards .tc-body>.card-face{margin-top:5px}
  .start-cards .tc-body>.tc-stats{width:auto;margin:9px 8px 0;justify-self:stretch}
  .start-cards .tc-body>.tc-line{padding:7px 10px 13px;align-self:start}
  #game .start-card .tc-name{font-size:clamp(16px,1.45vw,var(--fs-2xl))}
  .start-card .tc-stats{display:flex;justify-content:space-between;gap:4px;padding:0}
  .start-card .tc-stat dt{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
  .start-card .tc-glyph{display:inline;width:13px;height:13px}
  .start-card .tc-stat dd{height:auto;font-size:var(--fs-lg);line-height:1.2;gap:3px}
  .start-card .tc-stat dd small.tc-glyph-says{display:none}
  .start-card .range-glyph{--rg-cell:2.5px}
  .start-foot{width:min(460px,100%)}
  /* A narrower laptop window: smaller words, the rarity as its gem, the type as its glyphs. */
  @media (max-width:1300px){
    #game .start-card .tc-name{font-size:var(--fs-md)}
    .start-card .tc-corner .rarity-mark{font-size:0;gap:0}
    .start-card .card-face.face-line :is(.face-words,.face-sep){display:none}
    .start-card .card-face.face-line .face-reach{display:inline-grid}
    .start-card .tc-stat dd{font-size:var(--fs-md)}
    .start-card .tc-glyph{width:11px;height:11px}
    .start-card .range-glyph{--rg-cell:2px}
    #game .start-card .tc-line{font-size:var(--fs-xs)}
    .start-cards .tc-body>.tc-stats{margin:7px 6px 0}
    .start-cards .tc-body>.tc-line{padding:6px 7px 11px}
  }
  /* The shop: the painting a narrower column at the left, standing its full height; the keeper's line, the four wares in
     one row, then the services and Continue. The wares are a card each, their numbers glyphs as on the phone. */
  #screen:has(>.shop-cards){width:min(calc(100% - 28px),1400px);grid-template-columns:minmax(0,.8fr) minmax(0,1.6fr);column-gap:clamp(20px,2.4vw,32px)}
  #screen:has(>.shop-cards)>.site-scene{top:auto}
  #screen:has(>.shop-cards) .site-scene .site-motion{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:50% 0}/* the column's height, not the painting's */
  #game #screen:has(>.shop-cards) .site-scene-head h1{font-size:clamp(22px,2.1vw,var(--fs-6xl));text-wrap:balance;padding-inline:10px}
  #game #screen .shop-cards,#game #screen .shop-cards:has(>:nth-child(5)){grid-template-columns:repeat(4,minmax(0,1fr));gap:clamp(10px,1.1vw,16px)}
  .shop-detail{display:none}
  .shop-cards>.tower-card>.tc-body{display:flex}
  .shop-cards>.tower-card>.tc-cost{display:flex}
  .shop-cards>.tower-card>.tc-corner{display:block}
  .shop-cards .tc-price small{display:block}
  .shop-cards .tc-price{flex-wrap:wrap;gap:1px 5px}
  .shop-cards>.focus{--tc-rim:var(--rarity,var(--tc-edge));translate:none}
  .spoil-relic.shop-relic{grid-column:1/-1;flex-direction:row;align-items:center;gap:12px;padding:0 0 0 8px}
  .shop-relic.focus{border-color:color-mix(in srgb,var(--tc-edge) 75%,transparent)}
  .shop-relic .sr-body{display:flex;flex:1;padding-block:8px}
  .shop-relic .sr-stage{width:48px;height:48px;border-radius:50%}
  .shop-relic .sr-stage .sr-icon{width:40px;height:40px}
  .shop-relic .tc-price{align-self:stretch;flex-direction:column;flex-wrap:nowrap;min-width:84px;padding:4px 14px}
  .shop-relic .tc-price small{flex-basis:auto;max-width:110px}
  .tower-card.shop-card{--tc-stage-h:clamp(110px,25vh,230px)}
  .shop-cards>.tower-card .tc-stage{--tc-top:30px}
  .shop-card>.tc-body{padding:10px 8px 12px;gap:5px}
  #game .shop-card .tc-name{font-size:clamp(15px,1.3vw,var(--fs-xl))}
  .shop-card .tc-corner .rarity-mark{font-size:0;gap:0}
  .shop-card .card-face.face-line :is(.face-words,.face-sep){display:none}
  .shop-card .card-face.face-line .face-reach{display:inline-grid}
  .shop-card .tc-stats{display:flex;justify-content:space-between;gap:4px;padding:0 2px;margin:3px 0 0}
  .shop-card .tc-stat dt{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
  .shop-card .tc-glyph{display:inline;width:12px;height:12px}
  .shop-card .tc-stat dd{height:auto;font-size:var(--fs-lg);line-height:1.2;gap:3px}
  .shop-card .tc-stat dd small.tc-glyph-says{display:none}
  .shop-card .range-glyph{--rg-cell:2.5px}
  #game .shop-card .tc-line{min-height:0;font-size:var(--fs-sm);line-height:1.35}
  .shop-card .tc-price{padding:8px;font-size:var(--fs-lg)}
  .shop-card .tc-price .ui-icon{width:18px;height:18px}
  #screen:has(>.shop-cards)>.keeper-talk{margin:0 0 16px}
  #screen:has(>.shop-cards)>.shop-services{margin:14px 0 0}
  #screen:has(>.shop-cards)>.keeper-talk .keeper-line{font-size:var(--fs-lg)}
  .shop-cards~.shop-services .shop-service{min-height:44px}
  @media (max-height:700px){
    .tower-card.shop-card{--tc-stage-h:clamp(96px,20vh,140px)}
    .shop-cards>.tower-card .tc-stage{--tc-top:24px}
    #screen:has(>.shop-cards)>.keeper-talk{margin-bottom:10px}
    #screen:has(>.shop-cards)>.shop-services{margin-top:10px}
    /* Five wares (a relic from Era III): the cards' stage gives the plaque its row. */
    #screen:has(>.shop-cards .shop-relic) .tower-card.shop-card{--tc-stage-h:clamp(72px,12vh,110px)}
    #screen:has(>.shop-cards .shop-relic) .shop-cards>.tower-card .tc-stage{--tc-top:16px}
    #screen:has(>.shop-cards .shop-relic)>.keeper-talk{margin-bottom:6px}
    #screen:has(>.shop-cards .shop-relic)>.shop-services{margin-top:6px}
    #screen:has(>.shop-cards .shop-relic)>.shop-services+.primary{margin-top:6px}
    .spoil-relic.shop-relic .sr-body{padding-block:4px}
    #game .shop-card .tc-line{font-size:var(--fs-xs)}
    #game #screen:has(>.shop-cards .shop-relic) .shop-cards{row-gap:6px}
    #screen:has(>.shop-cards .shop-relic) .shop-card .tc-price{padding-block:6px}
    #screen:has(>.shop-cards .shop-relic) .shop-card .tc-corner:has(.tc-kind){display:none}/* the art says it; a rarity's gem stays */
  }
  /* The deck on the laptop: a sheet on the table, the tiles on the left with their names and types, the tapped card
     standing on the right. */
  #deck-dialog[open]{width:min(1320px,calc(100vw - 48px));max-height:calc(100dvh - 32px);padding:14px 22px 20px}
  .deck-sheet{display:grid;grid-template-columns:minmax(0,1fr) minmax(290px,340px);align-items:start;gap:10px 26px}
  .deck-shelf{grid-area:1/1}
  .deck-focus{grid-area:1/2;min-height:0;gap:10px}
  .deck-learned .dl-tier:not(:last-child){display:block}
  .deck-shelf>.deck-belt .deck-tiles{grid-template-columns:repeat(8,minmax(0,1fr));grid-auto-rows:96px}
  .deck-shelf>.deck-belt .tc-body{display:flex}
  .deck-shelf>.deck-tiles>.deck-tile>.tc-body{display:flex}
  .deck-shelf>.deck-tiles>.deck-tile .tc-stage{--tc-top:8px}
  .deck-shelf>.deck-tiles{--cols:5;--tile-ar:3/4;gap:10px}
  .deck-shelf>.deck-tiles:has(>:nth-child(11)){--cols:6}
  .deck-shelf>.deck-tiles:has(>:nth-child(19)){--cols:7;--tile-ar:10/11}
  .deck-shelf>.deck-tiles:has(>:nth-child(29)){--cols:8;--tile-ar:1}
  .deck-tile>.tc-body{padding:5px 5px 8px;gap:2px}
  #game .deck-tile .tc-name{font-size:var(--fs-sm)}
  .deck-tile>.tc-body>.card-face{display:inline-flex}
  #game .deck-tile .tc-body .card-face.face-line{font-size:var(--fs-xs);gap:3px}
  .deck-tile .tc-body .card-face .face-sep,.deck-tile .tc-body .card-face .face-reach-word{display:none}
  .deck-tile .tc-body .card-face .face-reach{display:inline-grid}
  .deck-tile .tc-tiers{top:7px;right:7px}
  .deck-focus-card{--tc-stage-h:clamp(150px,27vh,250px);display:flex;flex-direction:column}
  .deck-focus-card>.tc-stage{height:var(--tc-stage-h);min-height:0}
  #game .deck-focus-card>.tc-stage>.tc-model{position:relative;inset:auto;height:calc(100% - var(--tc-top) - 6px);margin-top:calc(var(--tc-top) - 6px)}
  .deck-focus-card>.tc-corner{right:12px}
  .deck-focus-card>.tc-body{padding:12px 14px 14px;gap:6px}
  #game .deck-focus-card .tc-name{font-size:var(--fs-2xl)}
  #game .deck-focus-card .tc-line{min-height:0;font-size:var(--fs-md)}
  .deck-focus-card .tc-stat dt{white-space:normal;letter-spacing:.05em;line-height:1.15;text-align:center;text-wrap:balance}/* "Nearby damage" in a 340 px card */
  .deck-focus-card .tc-stats{align-items:end;gap:6px}
  .deck-learned,.deck-use{font-size:var(--fs-sm)}
  .deck-foot{font-size:var(--fs-sm)}
  @media (max-height:700px){
    .deck-focus-card{--tc-stage-h:clamp(110px,19vh,150px)}
    .deck-shelf>.deck-belt .deck-tiles{grid-auto-rows:78px}
    .deck-learned,.deck-use{font-size:var(--fs-xs)}
    #game .deck-focus-card .tc-name{font-size:var(--fs-xl)}
  }
  /* The hand on the laptop: the 2×2 grid as before, each card its own rows; a tower's three numbers under its type
     line, each a glyph and its value, the range as its grid. */
  #hand{grid-auto-flow:row;grid-auto-columns:auto;grid-template-rows:none;gap:10px;justify-content:stretch}
  #game #hand .card{grid-row:auto;grid-template-rows:minmax(0,1fr) auto auto 21px;height:100%;container-type:inline-size}/* the numbers' row kept on a spell too, so the cards' stages match */
  #game #hand .card>.card-name{font-size:var(--fs-base);margin-top:6px}
  /* W-165 (#93) gate 7: the Mason's stone face. The phone's inset (below the cost badge, 72 % wide) left it a third of a
     tower's height in this card's shorter stage (an L 32 px tall); here it is 60 px wide in the middle, clear of the cost
     badge at the corner whatever its height, so it stands from the stage's top as a tower's model does. */
  #game #hand .card>.piece-art.stone-art{top:8px;left:calc(50% - 30px);width:60px;height:calc(100% - 12px)}
  #game #hand .card>.card-kind>.card-face{margin-top:3px}
  #game #hand .card>.card-stats{grid-area:4/1;display:flex;align-items:center;justify-content:center;gap:12px;margin:0 4px;font-size:var(--fs-sm);font-weight:800;line-height:1;color:var(--ink);font-variant-numeric:tabular-nums;white-space:nowrap}
  .hand-stat{display:inline-flex;align-items:center;gap:3px}
  .hand-stat .tc-glyph{display:block;width:11px;height:11px}
  .hand-stat small{font-size:.75em;font-weight:750;color:var(--muted)}
  .hand-stat .range-glyph{--rg-cell:2px;margin-right:1px}
  /* Five or more cards (a boss hand, the Field Satchel) take shorter rows, and with a tower open shorter still: the
     numbers give way to the model. */
  #game #hand:not([data-count="0"],[data-count="1"],[data-count="2"],[data-count="3"],[data-count="4"]) .card{grid-template-rows:minmax(0,1fr) auto auto 0}
  #game #hand:not([data-count="0"],[data-count="1"],[data-count="2"],[data-count="3"],[data-count="4"]) .card>.card-stats{display:none}

  /* The upgrade sheet on the laptop: the win's upgrade, the whole table under the HUD. */
  #upgrade-sheet{top:46px;padding:clamp(14px,2.6vh,28px) 28px}

  /* The rest and the forge on the laptop: the painting as before, the choices as cards side by side beside it. */
  #screen:is([data-view="rest"],[data-view="forge"])>.site-actions{--sc-stage-h:clamp(110px,17vh,160px);grid-auto-columns:minmax(0,240px);gap:14px}
  #game #screen:is([data-view="rest"],[data-view="forge"]) .site-choice h3{font-size:var(--fs-lg)}
  #game #screen:is([data-view="rest"],[data-view="forge"]) .site-choice p{font-size:var(--fs-sm)}
  #game #screen:is([data-view="rest"],[data-view="forge"]) .site-choice>div{padding:10px 12px 14px;gap:5px}

  /* The belt-full sheet on the laptop: the four in a row. */
  #game #belt-full{top:46px;padding:clamp(14px,2.6vh,28px) 28px}
  .belt-cards{grid-template-columns:repeat(4,minmax(0,280px));justify-content:center;gap:clamp(14px,2vw,28px)}
  .tower-card.belt-card{--tc-stage-h:clamp(130px,23vh,210px)}
  .belt-card .tc-body{padding:10px 10px 12px;gap:6px}
  #game .belt-card .tc-line{font-size:var(--fs-sm)}
  .belt-leave{padding:7px 10px;font-size:var(--fs-sm)}

  /* The mastered pick on the laptop: larger cards and tiles, the whole table under the HUD. */
  #game #mastery-flow{top:46px;padding:clamp(14px,2.6vh,28px) 28px}
  #game #mastery-flow .uf-head h1{font-size:clamp(26px,2.6vw,36px)}
  #game #mastery-flow .uf-head p{font-size:var(--fs-lg)}
  #game #mastery-flow .mf-list{--mf-stage:clamp(120px,20vh,190px);grid-auto-columns:minmax(0,300px);gap:clamp(14px,2vw,28px)}
  #game #mastery-flow .mf-card strong{font-size:var(--fs-lg)}
  #game #mastery-flow .mf-card :is(small,p){font-size:var(--fs-sm)}
  #game #mastery-flow .mf-card>div{padding:10px 12px 14px;gap:5px}
  #game #mastery-flow .mf-glyph .ui-icon{width:clamp(52px,8vh,76px);height:clamp(52px,8vh,76px)}
  #game #mastery-flow:is([data-step="remove"],[data-step="reforge"]) .mf-list{--mf-stage:clamp(80px,13vh,120px);--mf-cols:6;max-width:1100px;margin-inline:auto;gap:12px}
  #game #mastery-flow:is([data-step="remove"],[data-step="reforge"]) .mf-list:has(>:nth-child(19)){--mf-cols:8;--mf-stage:clamp(64px,10vh,96px)}
  #game #mastery-flow:is([data-step="remove"],[data-step="reforge"]) .mf-list:has(>:nth-child(33)){--mf-cols:10;--mf-stage:clamp(54px,8vh,80px)}
  #game #mastery-flow:is([data-step="remove"],[data-step="reforge"]) .mf-card strong{font-size:var(--fs-sm)}
  #game #mastery-flow[data-step="confirm"] .mf-list{grid-template-columns:minmax(0,300px)}
  #game #mastery-flow .mf-confirm-card{display:flex;text-align:center}
  #game #mastery-flow .mf-confirm-card>.mf-art{height:var(--mf-stage);min-height:0}
  #game #mastery-flow .mf-confirm-card>div{align-items:center}

  /* The run's end on the laptop: a bigger medallion and title, ten tiles a row (more for a deck past thirty). */
  html #game #screen:is([data-view="victory"],[data-view="defeat"]):has(>.run-result){flex:1;width:100%;max-width:none;max-height:none;margin:0;padding:clamp(14px,2.6vh,28px) 28px}
  #game .run-result{gap:clamp(10px,1.8vh,18px)}
  #game .run-result .result-medal{width:72px;height:72px}
  #game .run-result .result-medal .ui-icon{width:40px;height:40px}
  #game .run-result .deck-belt .deck-tiles{grid-template-columns:repeat(auto-fit,minmax(0,84px));grid-auto-rows:clamp(52px,8vh,76px)}
  #game .run-result .result-collection>.deck-tiles,#game .run-result .result-collection>.deck-tiles:is(:has(>:nth-child(13)),:has(>:nth-child(21))){--cols:10;--tile-h:132px;gap:8px}
  #game .run-result .result-collection>.deck-tiles:has(>:nth-child(31)){--cols:12}
  #game .run-result .result-collection>.deck-tiles:has(>:nth-child(37)){--cols:14}
  #game .run-result .deck-tile>.tc-body{padding:4px 4px 6px}
  #game .run-result .deck-tile .tc-name{font-size:var(--fs-sm)}
  .result-road{gap:5px}
  .result-road img{width:30px;height:30px}
  #game .run-result .spoils-continue{width:min(320px,100%)}
  @media (max-height:640px){/* a short laptop: two rows up to thirty-two cards, the stops and items smaller */
    #game .run-result .result-collection>.deck-tiles:has(>:nth-child(21)){--cols:14}
    #game .run-result .result-collection>.deck-tiles:has(>:nth-child(29)){--cols:16}
    #game .run-result .deck-belt .deck-tiles{grid-auto-rows:44px;grid-template-columns:repeat(auto-fit,minmax(0,64px))}
    #game .run-result .result-medal,#game .run-result .spoils-medallion{width:52px;height:52px}
    #game .run-result .result-medal .ui-icon{width:30px;height:30px}
    .result-road img{width:22px;height:22px}
  }
  /* W-129 surface 12: the laptop's deck column (the map's, a fight's). V013-DECK-ROWS (designer, 2026-09-30: "Rather
     than the cards … getting smaller as our deck gets bigger. Let's limit it to three per row, and if they don't fit,
     we'll just add a scroll"): three tiles a row at one size, and the column scrolls (the side panel's fade says there is
     more). The column is a size container: a short one drops the items (the bar at the top shows them) and shrinks its
     heading. A hand card picked still docks its whole card here. */
  #game #side-deck:not(.carded),#game:is([data-phase="map"],[data-phase="start"]) #side-map-deck{display:flex;flex-direction:column;overflow:hidden auto;container:deck-col/size}
  #game :is(#side-deck:not(.carded),#side-map-deck)>*,#game :is(#side-deck:not(.carded),#side-map-deck)::after{flex:none}/* the fade too */
  #game :is(#side-deck:not(.carded),#side-map-deck)>h2{margin:0 0 8px}
  #game :is(#side-deck:not(.carded),#side-map-deck) .deck-belt{margin:0 0 8px}
  #game :is(#side-deck:not(.carded),#side-map-deck) .deck-belt .deck-tiles{grid-template-columns:repeat(3,minmax(0,1fr));grid-auto-rows:84px}
  #game :is(#side-deck:not(.carded),#side-map-deck) .deck-legend{margin:0 0 6px}
  #game :is(#side-deck:not(.carded),#side-map-deck)>.deck-tiles{grid-template-columns:repeat(3,minmax(0,1fr));grid-auto-rows:128px}
  #game :is(#side-deck:not(.carded),#side-map-deck) .deck-tile{container-type:size}
  @container deck-col (max-height:700px){
    #game :is(#side-deck:not(.carded),#side-map-deck) .deck-belt .deck-tiles{grid-auto-rows:60px}
  }
  @container deck-col (max-height:500px){
    #game :is(#side-deck:not(.carded),#side-map-deck) .deck-belt .deck-tiles{grid-auto-rows:52px}
  }
  @container deck-col (max-height:340px){
    #game :is(#side-deck:not(.carded),#side-map-deck)>.deck-belt{display:none}
    #game :is(#side-deck:not(.carded),#side-map-deck)>h2{margin:0 0 4px;font-size:var(--fs-lg)}
    #game :is(#side-deck:not(.carded),#side-map-deck)>.deck-tiles{gap:4px;grid-auto-rows:100px}/* a short column: the tiles drop their type line */
  }
  /* The road beside the map, on a short laptop: the quote goes and the key tightens, then the key is its pictures and
     names two across. */
  #game:is([data-phase="map"],[data-phase="start"]) #side-road{container:road-col/size}
  @container road-col (max-height:700px){
    #game #side-road .road-boss{padding:8px 10px;margin-bottom:10px}
    #game #side-road .road-boss .opponent-quote{display:none}
    #game #side-road .road-key{gap:6px}
    #game #side-road .road-key img{width:40px;height:40px}
    #game #side-road .road-key span{font-size:var(--fs-xs)}
  }
  @container road-col (max-height:600px){
    #game #side-road .road-progress{margin-bottom:8px}
    #game #side-road .road-key{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 10px}
    #game #side-road .road-key li{gap:8px}
    #game #side-road .road-key span{display:none}
    #game #side-road .road-key strong{font-size:var(--fs-base)}
  }
  @container (max-height:100px){#game .side-panel .deck-tile>.tc-body>.card-face{display:none}}
  @container (max-height:76px){#game .side-panel .deck-tile>.tc-body{display:none}}
  @container (max-height:60px){#game .side-panel .deck-tile>:is(.tc-type,.tc-tiers,.tc-cost){display:none}#game .side-panel .deck-tile .tc-stage{--tc-top:3px}}
  /* The upgrade reward on the laptop: the towers on the left, the tree beside them. */
  .victory-upgrade{display:grid;grid-template-columns:auto minmax(360px,430px);gap:clamp(18px,2.2vw,32px);justify-content:center;align-items:stretch}
  .victory-upgrade .victory-tiles{--tile-h:170px;grid-template-columns:repeat(var(--cols-l),minmax(0,142px));grid-template-rows:repeat(var(--rows-l),minmax(0,var(--tile-h)));gap:12px;align-content:center}
  .victory-upgrade .tower-tile .tc-body{display:flex;padding:6px 3px 9px;gap:4px}
  .tc-type{display:none}
  .tower-tile .tc-body .card-face.face-line .face-reach{display:inline-grid}
  .tower-tile .tc-body .card-face.face-line .face-reach-word{display:none}
  #game .tower-tile .tc-body .card-face.face-line{font-size:var(--fs-xs);gap:3px}
  .tower-tile .tc-body .card-face.face-line .face-sep{display:none}
  .victory-upgrade .tower-tile .tc-stage{--tc-top:12px}
  #game .victory-upgrade .tower-tile .tc-name{font-size:clamp(13px,1.15vw,var(--fs-md));letter-spacing:-.015em}
  .victory-upgrade .tc-tiers{top:9px;right:9px;gap:4px}
  .victory-upgrade .tc-tiers i{width:7px;height:7px;border-width:1.5px}
  .upgrade-panel{gap:12px;padding:18px 20px 20px}
  .spoils.upgrades .spoils-medallion{width:60px;height:60px}
  /* #137 (the designer: "If we move the Battle won text to the left And over the tower choices then we can make everything
     A bit larger"; then "Lets center it over the card choice"): the head sits over the towers, centred on them, the
     medallion beside the title, the panel beside both at full height; the freed height goes to larger tiles and a wider
     panel. Elite defeated (the three offers) takes the same head, centred over its row. */
  .spoils.victory .spoils-head{display:grid;grid-template-columns:1fr auto auto 1fr;grid-template-areas:". medal title ." ". medal prompt ." "receipt receipt receipt receipt";column-gap:0;align-items:center;justify-items:start;text-align:left}
  .spoils.victory .spoils-medallion{grid-area:medal;margin-right:18px}/* a margin, not a gap: a short window hides it and the title stays centred */
  #game .spoils.victory .spoils-head h1{grid-area:title;margin:0;align-self:end}
  #game .spoils.victory .spoils-prompt{grid-area:prompt;align-self:start;margin-top:2px}
  .spoils.victory .spoils-receipt{grid-area:receipt;justify-self:center;justify-content:center;margin-top:12px}
  .spoils.victory.upgrades:has(>.victory-upgrade){display:grid;grid-template-columns:auto minmax(400px,500px);grid-template-areas:"head panel" "tiles panel" "foot foot";column-gap:clamp(24px,3vw,44px);row-gap:clamp(14px,2.6vh,26px);justify-content:center;align-content:center;align-items:start}
  .spoils.victory.upgrades>.victory-upgrade{display:contents}
  .spoils.victory.upgrades>.spoils-head{grid-area:head;align-self:end;justify-self:center}
  .spoils.victory.upgrades .victory-tiles{grid-area:tiles;--tile-h:clamp(150px,calc((100dvh - 330px) / var(--rows-l)),220px);grid-template-columns:repeat(var(--cols-l),minmax(0,180px));gap:14px;align-content:start}
  .spoils.victory.upgrades .upgrade-panel{grid-area:panel;align-self:stretch}
  .spoils.victory.upgrades>:is(.reward-skip,.spoils-continue){grid-column:1/-1;justify-self:center}
  #game .spoils.victory.upgrades .tower-tile .tc-name{font-size:clamp(14px,1.3vw,var(--fs-lg))}
  .spoils.victory.upgrades .up-option{--disc:112px}
  .spoils.victory.upgrades .up-tree[data-n="1"] .up-option{--disc:144px}
  .up-head{gap:4px}
  #game .up-head .card-face.face-line{font-size:var(--fs-md)}
  #game .up-head h2{font-size:var(--fs-2xl)}
  .up-head small{font-size:var(--fs-sm)}
  .up-tree{gap:10px}
  .up-option{--disc:96px;gap:8px;padding:12px 8px 10px}
  .up-tree[data-n="1"] .up-option{--disc:124px;padding:12px 8px 10px}
  .up-tier{min-width:20px;height:20px;font-size:11px;line-height:20px}
  .up-branch-name{font-size:var(--fs-md)}
  .up-tree[data-n="1"] .up-branch-name{font-size:var(--fs-xl)}
  .up-detail{gap:10px 20px}
  #game .up-detail h3{font-size:var(--fs-xl)}
  .up-lines{font-size:var(--fs-sm)}
  .up-rows,.up-lines{gap:4px}
  /* W-132: a tower with six rows and its range (the Skyhook) sets them closer, and three long lines (the Ranger) a size
     smaller on a short window, so the unlock keeps its place */
  .up-rows:has(>:nth-child(7)){gap:1px}
  .up-rows:has(>:nth-child(7))>.up-row{line-height:1.2}
  @media (max-height:760px){.up-lines:has(>:nth-child(3)){font-size:var(--fs-xs);line-height:1.25}}
  /* W-132 round 2: a splash tower carries two grids (its splash and its range); under 850 tall its six rows set closer */
  .up-splash .up-range{--rg-cell:6px}
  @media (max-height:850px){.up-rows:has(>:nth-child(6)){gap:1px}.up-rows:has(>:nth-child(6))>.up-row{line-height:1.2}}
  .up-row{font-size:var(--fs-sm)}
  .up-range{--rg-cell:8px;width:min(calc(var(--rg-n) * var(--rg-cell)),80px);height:min(calc(var(--rg-slot,var(--rg-n)) * var(--rg-cell)),80px)}
  #game .up-unlock{padding:11px 16px}
  .up-unlock small{font-size:var(--fs-sm)}
  /* A small laptop window: the tile gives its name two lines and drops its status (the panel has it); the tree and the
     medallion shrink on a short one. */
  @media (max-width:1180px){
    .victory-upgrade{grid-template-columns:auto minmax(300px,360px)}
    .spoils.victory.upgrades:has(>.victory-upgrade){grid-template-columns:auto minmax(320px,400px)}
    .spoils.victory.upgrades .victory-tiles{grid-template-columns:repeat(var(--cols-l),minmax(0,150px))}
    .tower-tile .tc-body .card-face.face-line :is(.face-words,.face-sep){display:none}
    #game .victory-upgrade .tower-tile .tc-name{white-space:normal;line-height:1.1;font-size:13px;letter-spacing:-.01em}
    /* the numbers keep to their side (the range row ran 17px past it at 960 wide): they take more of the width, and the
       range grid is smaller */
    .up-detail{grid-template-columns:minmax(0,4fr) minmax(0,7fr)}
    .up-rows{grid-template-columns:minmax(0,1fr)}
    .up-row dt{white-space:normal;overflow:visible;line-height:1.15}/* a long label (a Beacon's "Nearby damage" at tier II) takes two lines, not an ellipsis */
    .up-range{--rg-cell:5.5px;width:min(calc(var(--rg-n) * var(--rg-cell)),60px);height:min(calc(var(--rg-slot,var(--rg-n)) * var(--rg-cell)),60px)}
  }
  @media (max-height:760px){
    .spoils.upgrades .spoils-medallion{width:46px;height:46px}
    #game .spoils.upgrades .spoils-head h1{margin-top:6px}
    .up-option{--disc:74px;padding:9px 6px 7px}
    .up-tree[data-n="1"] .up-option{--disc:94px;padding:9px 6px 7px}
    .upgrade-panel{gap:10px;padding:14px 16px 16px}
    .up-detail{gap:6px 16px}
    .up-rows,.up-lines{gap:2px}
  }
  @media (max-height:640px){
    .spoils.upgrades .spoils-medallion{display:none}
    #game .spoils.upgrades .spoils-head h1{margin-top:0}
    .up-option{--disc:52px;gap:3px;padding:7px 6px 6px}
    .up-tree[data-n="1"] .up-option{--disc:62px;padding:7px 6px 6px}
    .upgrade-panel{gap:8px;padding:12px 14px 14px}
    #game .up-head h2{font-size:var(--fs-xl)}
    #game .up-detail h3{font-size:var(--fs-lg)}
    .up-lines,.up-row{font-size:var(--fs-sm);line-height:1.2}
    .up-rows,.up-lines{gap:1px}
    #game .up-unlock{padding:7px 12px}
    .up-range{--rg-cell:5px;width:min(calc(var(--rg-n) * var(--rg-cell)),50px);height:min(calc(var(--rg-slot,var(--rg-n)) * var(--rg-cell)),50px)}
    .up-rows:has(>:nth-child(7)) .up-range{--rg-cell:4px}
    .up-splash .up-range{--rg-cell:4px}
    .up-about{gap:2px}
    .up-lines:has(>:nth-child(3)){line-height:1.15}
  }
  .spoils-relics{gap:var(--tc-gap)}
  .spoils-receipt b{font-size:var(--fs-lg)}
  #game .spoils .spoils-prompt{margin-top:6px}
  #game .spoil-relic h3{font-size:var(--fs-lg)}
  #game .spoil-relic p{font-size:var(--fs-sm);line-height:1.35}
  .tc-body{gap:6px;padding:13px 16px 16px}
  .sr-stage{width:58px;height:58px}
  .sr-stage .sr-icon{width:46px;height:46px}
}
