/* W-109: the wide layout for laptop play (designer, 2026-09-26: "a full wide layout for laptop play").
   Linked after style.css so its rules win at equal specificity. The query is layout-pref.js WIDE_QUERY (keep them the same);
   the Layout setting (Auto / Phone / Laptop) points this block at the player's choice.
   On a phone nothing here applies except that the side panels stay hidden. */
.side-panel{display:none}

@media (min-width:960px) and (min-height:600px) and (min-aspect-ratio:5/4){
/* The laptop text scale: the same steps as the phone's, one size up. */
:root{--fs-xs:12px;--fs-sm:13px;--fs-base:14px;--fs-md:15px;--fs-lg:16px;--fs-xl:18px;--fs-2xl:19px;--fs-3xl:21px;--fs-4xl:23px;--fs-5xl:27px;--fs-6xl:36px}
body{padding:0}
#game{--side-w:clamp(290px,24vw,390px);--hand-height:clamp(150px,19dvh,196px);--card-h:clamp(150px,20dvh,196px);width:min(100vw,1920px);height:100dvh;max-height:none;border-width:0 3px}
#hud{height:46px;padding:0 14px;gap:12px}
#hud .resources{font-size:var(--fs-xl);gap:18px}
#hud .rail-button{min-width:46px;height:46px}
/* W-169 (#98): the new screen's encounter chip sits in the HUD after the items and relics (the phone's sits beside the numeral). */
#game[data-screen="v19"]>#opponent{top:5px;left:var(--chip-left,290px);max-width:420px}
#game[data-screen="v19"]>#opponent .enemy-pennant small{display:block}
#game[data-screen="v19"] #board-wrap>#boss-status{right:auto;max-width:none;transform:none}
#game[data-screen="v19"]>#opponent .enemy-pennant strong{display:block;white-space:nowrap}
/* #136: the title card shows once. `panel` (default; the designer: "before the enemy was on a nice card, we are just
   moving that card to the other area getting the sizing right and preventing conflicts"): the HUD's enemy card moves to
   the top of the left panel, sized to it, and the panel's plain head goes; `chip` (?titlecard=chip): the card stays in the
   HUD. Either way the panel's head goes and the items and relics sit right, beside the counters (main.js chipRoom). */
#game[data-screen="v19"] #side-intel .info-head{display:none}
#game[data-screen="v19"][data-titlecard="panel"]>#opponent{top:58px;left:12px;width:calc(var(--side-w) - 24px);max-width:none;gap:8px;align-items:stretch}
#game[data-screen="v19"][data-titlecard="panel"]>#opponent .enemy-pennant{height:auto;min-height:72px;padding:6px 14px 6px 6px;gap:12px;border-radius:10px}
#game[data-screen="v19"][data-titlecard="panel"]>#opponent .enemy-pennant>img{width:56px;height:62px}
#game[data-screen="v19"][data-titlecard="panel"]>#opponent .enemy-pennant strong{font-size:var(--fs-2xl);line-height:1.1;white-space:normal}
#game[data-screen="v19"][data-titlecard="panel"]>#opponent .enemy-pennant small{display:block;font-size:var(--fs-base);margin-top:3px}
#game[data-screen="v19"][data-titlecard="panel"]>#opponent .wave-stack{position:static;flex-direction:column;justify-content:center}/* #166: beside the card, not hung under the bar */
#game[data-screen="v19"][data-titlecard="panel"]>#opponent .wave-seal{min-width:42px;height:auto;min-height:52px;padding:5px 6px 13px}
#game[data-screen="v19"][data-titlecard="panel"]>#opponent .wave-seal b{font-size:var(--fs-4xl)}
#game[data-screen="v19"][data-titlecard="panel"]>#opponent .wave-chip{display:block}
#game[data-screen="v19"][data-titlecard="panel"].in-battle #side-intel{padding-top:96px}

/* Battle (designer, 2026-09-26: "move the hand to a 2x2 grid to the right under the deck, and the send wave to the left
   under the wave info, so the board can take the full space in the center"):
   the enemy formation over the action bar | the board, full height | the deck over the hand. */
#battle-view{display:grid;grid-template-columns:var(--side-w) minmax(0,1fr) var(--side-w);grid-template-rows:minmax(0,1fr) auto auto;grid-template-areas:"intel board deck" "intel board hand" "actions board hand"}
#board-wrap{grid-area:board}
#inspector,#hand{grid-area:hand}
#hand{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:var(--card-h);height:auto;max-height:62dvh;overflow-y:auto;gap:10px;padding:12px 14px 14px;border-left:2px solid #a58d61;align-content:start;align-items:stretch;justify-content:stretch}
#hand .card{max-width:none;min-width:0;height:100%}
/* W-121 W-025/W-033: a hand of five or more (a boss hand, the Field Satchel) takes three shorter rows, so every card is
   on screen and the Deck panel above keeps its room. */
#hand:not([data-count="0"],[data-count="1"],[data-count="2"],[data-count="3"],[data-count="4"]){grid-auto-rows:calc(var(--card-h) * .78)}
#hand[data-count] .card:nth-child(n){rotate:none;translate:none}/* no fan in a grid */
#hand[data-count] .card.selected:nth-child(n){translate:0 -4px;box-shadow:0 0 0 3px #f1d58f,0 6px 10px #101a1866}
#game #inspector.inspecting{height:auto;flex:none;max-height:62dvh}
#actions{grid-area:actions;height:auto;flex-wrap:wrap;align-content:center;padding:12px 16px 14px;gap:8px 12px;border-top:2px solid #b4935c;border-right:2px solid #a58d61}
#actions #end-turn,#actions .stage-bar{flex:1 1 100%;order:3;min-height:58px;margin:0}
#actions .rail-button{margin-left:auto}
#actions .rail-button~.rail-button{margin-left:0}
.side-panel{display:block;min-height:0;overflow-y:auto;scrollbar-width:thin;padding:16px 16px 20px;background:var(--paper) url('/assets/ui/parchment.svg') center/100% 100%;color:var(--ink);border:0 solid #a58d61;position:relative;z-index:2}
/* ...and a card's label clears its frame's inner rule (7.5% of its height from the edge). */
#side-intel{grid-area:intel;border-right-width:2px}
#side-deck{grid-area:deck;border-left-width:2px}
.side-panel.more::after{content:'';position:sticky;display:block;bottom:-20px;height:48px;margin:-48px -16px -20px;background:linear-gradient(#0000,var(--paper) 85%);pointer-events:none}/* W-121 W-025: more below */
 /* During a wave (or an empty hand) the deck takes the whole right column */
 #battle-view:not(:has(#hand:not([data-count="0"]),#inspector.inspecting:not(.hidden))) #side-deck,#battle-view.resolving:not(:has(#inspector.inspecting:not(.hidden))) #side-deck{grid-row:1/-1}
.side-panel h2{font-size:var(--fs-3xl);margin:0 0 10px}
.side-panel .info-head{display:flex;align-items:center;gap:12px;margin-bottom:8px}
.side-panel .info-head h3{font-size:var(--fs-4xl)}
.side-panel .info-head small{font-size:var(--fs-base);color:var(--muted)}
.side-panel .info-art{width:72px;height:72px;object-fit:cover;border-radius:4px;border:2px solid var(--era-edge,#a58d61)}
.side-panel .opponent-quote{font-style:italic;font-size:var(--fs-base);color:var(--muted);margin:6px 0}
.side-panel .intel-intent{font-size:var(--fs-md);line-height:1.4;margin:6px 0}
.side-panel .wave-preview{grid-template-columns:repeat(2,minmax(0,1fr))}/* W-121 W-043: two across at every width (three ran the stat captions together) */
/* The pennant stays on the board (the conversation's portrait lands in it); the formation is always open on the left. */
#hud-strip.boss-fight{height:46px}
#board-wrap #boss-status{max-width:420px;left:50%;right:auto;transform:translateX(-50%);width:calc(100% - 24px)}
/* W-121 W-025: where the board is wide enough, the boss bar joins the pennant's row (between the wave seal and the camera
   buttons) instead of lying over the gate the boss walks out of. */
#board-wrap{container-type:inline-size}
@container (min-width:640px){#board-wrap #boss-status{top:5px;left:auto;right:124px;transform:none;width:min(380px,calc(100% - 420px))}}
/* Card, tower and minion details open in the deck's column instead of over the board. */
#overlay{background:#0c161140}
#overlay .info-card{left:auto;right:10px;top:calc(var(--board-top) + 10px);bottom:auto;width:calc(var(--side-w) - 20px);max-height:calc(var(--hand-top,100dvh) - var(--board-top,46px) - 20px);overflow-y:auto}/* W-121 W-023: as tall as its details, stopping above the hand */
/* W-112 (designer, 2026-09-27): "when we have a card selected from in hand, we should have its info take the space of
   the deck until it is deselected or it's played … when we tap a tower that is on the board, its menu pops up over the
   deck as well, but it also extends down way more than necessary … you can still see your hand". The tower card (and any
   detail) stops above the hand (main.js measures --hand-top); a selected card's details are the deck panel itself. */
#game #card-info{display:none}
/* W-121 W-008: the card sits beside the board here, so holding the eye needn't fade it (its ghost lay over the Deck panel's
   text); the board brightens and shows the reach as on a phone. */
#overlay.peeking .info-card{opacity:1}
/* While a tower's panel is open the hand keeps two rows (a fifth card scrolls), and the tower's model gives up height
   first, so the readout and Upgrade fit above the hand without scrolling. */
#game:has(#overlay:not(.hidden) .tower-info) #hand:is([data-count="1"],[data-count="2"],[data-count="3"],[data-count="4"]){max-height:calc(2 * var(--card-h) + 36px)}/* W-121 W-044: five or more keep their three short rows; the details scroll above them */
#game:has(#overlay:not(.hidden) .tower-info) #hand:not([data-count="0"],[data-count="1"],[data-count="2"],[data-count="3"],[data-count="4"]){grid-auto-rows:calc(var(--card-h) * .6)}/* W-046: shorter still while a tower is open, so its details have room */
/* W-121 W-041: the Upgrade label stays on one line in a 287 px card, and the deck under an open card shows only its paper. */
.info-card .tower-info .inspector-actions .upgrade-button{flex:1.5 1 auto;white-space:nowrap;padding-inline:12px}
#game:has(#overlay:not(.hidden) .info-card) #side-deck>*{visibility:hidden}
#overlay .info-card .tower-info .tower-model{height:clamp(84px,calc(var(--hand-top,100dvh) - var(--board-top,46px) - 290px),200px)}
#overlay .info-card .tower-info:has(>.up-detail) .tower-model{height:clamp(84px,calc(var(--hand-top,100dvh) - var(--board-top,46px) - 420px),160px)}/* room for its next tier's numbers (2026-10-27) */
#game #overlay .info-card .up-detail h3{font-size:var(--fs-lg)}
/* #128 (D-194 sprint, the W-163 close-out): on the laptop's tower card the next tier's heading ("Next · Cut I") had the
   detail's narrow left column (5fr of the card, ~126 px) and wrapped onto two lines. It takes its own row across the
   card, on one line; the tier's lines and its numbers sit side by side under it as before. */
#game #overlay .info-card .up-detail{grid-template-areas:"head head" "about rows" "act act";grid-template-rows:auto minmax(0,1fr) auto}
#game #overlay .info-card .up-detail>.up-about{display:contents}
#game #overlay .info-card .up-detail>.up-about>h3{grid-area:head;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#game #overlay .info-card .up-detail>.up-about>:not(h3){grid-area:about;min-width:0}
/* W-119 I-040: a tower's title stays on one line, so a new tier's numeral doesn't push Upgrade down; the close button sits over the model */
#overlay .info-card{container-type:inline-size}
#overlay .info-card .tower-model+h3{padding-right:0;white-space:nowrap;font-size:clamp(16px,calc(100cqi * .072),var(--fs-4xl))}
.side-card .info-head{align-items:flex-start}
.side-card .info-art{width:88px;height:88px}
.side-card>p{font-size:var(--fs-md);line-height:1.45}
.side-card .side-card-hint{font-size:var(--fs-sm);color:var(--muted);font-style:italic;margin-top:14px}
.side-card .info-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;margin-top:16px}
.side-card .info-actions .primary{flex:1 1 100%;min-height:52px}

/* Screens: a framed page in the middle of the table. */
#screen{margin:14px auto;width:min(calc(100% - 28px),1180px);padding:22px 28px 26px}
.sheet-heading{min-height:78px}
.reward-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:14px}
.reward-list .offer{min-height:180px}
#screen[data-view] .reward-list:has(.offer-branches){padding-bottom:10px}#screen .reward-list .offer.tower:has(.offer-branches){padding:38px 20px 36px}/* W-119 run 5: a boss tower's three branches cleared its frame's rules; D-143: three towers, the compact grid (style.css) */
#screen .reward-towers:is(:has(>:nth-child(7):last-child),:has(>:nth-child(8):last-child)){grid-template-columns:repeat(4,minmax(0,1fr))}/* W-121: 4 + 3, not 6 + 1 */
#screen .primary.wide{max-width:460px;margin-inline:auto;display:flex}

/* W-121 batch 2 (T3's wide list: W-006, W-012, W-014, W-028, W-029): a sheet is as tall as what it holds, in the middle
   of the table, and scrolls (button included) only when the window is too short for it. The map and an event keep the
   whole table. */
#screen:not([data-view="map"],[data-view="start"]):not(:has(.event-scene)){flex:0 1 auto;margin-block:auto;max-height:calc(100% - 46px - 28px)}/* W-119 B-011: never an event: a scene is flex:1 with nothing in flow, so a content-sized sheet drew it 0 px tall */
#screen[data-view] :is(.result-stats,.battle-receipt){justify-content:center;gap:clamp(32px,6vw,88px)}
/* W-014: the shop's stock is taller than its cropped picture, so the picture stands the column's full height and shows
   more of the painting below the crop (cut at the column's foot), its name still over its top. */
#screen:has(.site-scene):has(>.shop-grid) .site-scene{aspect-ratio:auto;align-self:stretch;overflow:hidden}
/* W-029: a short laptop window (720 px) keeps the shop's stock, services and Continue on screen. */
@media (max-height:780px){
 #screen:has(.site-scene)>.keeper-talk{margin:6px 0 10px}
}
/* W-119 B-015's packing of a crowded shop (.tight) went with W-129 surface 3: the wares fit one screen at every size
   (tower-card.css). */
/* When a sheet still has to scroll, its Continue stays pinned at the foot of the window (W-029). */
#screen>.primary.wide{position:sticky;bottom:0;z-index:2;box-shadow:0 -6px 14px #0003}

/* Shop, rest and forge: the painted scene on the left (cropped to its painted top, the part the phone shows above the
   offers), its name over it as on the phone, and the offers on the right. W-121 W-012: the right column stands between
   two free rows, so it sits in the middle beside the picture, and the picture in the middle beside a taller column. */
#screen:has(.site-scene){display:grid;grid-template-columns:minmax(0,1.15fr) minmax(360px,1fr);grid-template-rows:1fr auto auto auto auto 1fr;align-content:safe center;column-gap:32px;padding:22px}
#screen:has(.site-scene) .site-scene{position:relative;inset:auto;grid-column:1;grid-row:1/-1;align-self:center;width:100%;aspect-ratio:var(--site-crop,var(--site-aspect));max-height:100%;border-radius:4px;box-shadow:0 8px 30px #0006;outline:3px solid var(--era-edge,#8f7c58)}
#screen:has(.site-scene) .site-scene .site-motion{height:auto;aspect-ratio:var(--site-aspect)}
#screen:has(.site-scene) .site-scene::after{display:none}
#screen:has(.site-scene) .site-scene-spacer{display:none}
#screen:has(.site-scene) .site-scene-head{position:relative;inset:auto;grid-column:1;grid-row:1/-1;align-self:start;z-index:1;padding-top:14px}
#screen:has(.site-scene) .site-scene-head h1{font-size:var(--fs-6xl)}
#screen:has(.site-scene)>:is(.shop-grid,.site-actions){grid-column:2;grid-row:3;align-self:center}
#screen:has(.site-scene)>.keeper-talk{grid-column:2;grid-row:2;align-self:end;margin:14px 0 18px}
#screen:has(.site-scene)>:is(.primary.wide,.site-note){grid-column:2;grid-row:5;align-self:end;margin-top:14px;max-width:none}
/* W-112 (lead, 2026-09-28, for T4's shop services): card removal, the reroll and the second Restore sit under the stock. */
#screen:has(.site-scene)>.shop-services{grid-column:2;grid-row:4;margin-top:12px}
#screen:has(.site-scene) .site-actions .offer{min-height:120px}
#screen[data-view="reward"]{display:flex;flex-direction:column}
#screen[data-view="reward"]>.battle-won{flex:none;margin-block:auto}

/* Events: the painted scene keeps its portrait stage, centred on the table with a soft light around it. */
#screen:has(.ev-composed){width:100%;margin:0;padding:0;border:0;background:radial-gradient(ellipse 55% 75% at 50% 45%,#ffe7b01f,#0000 70%),radial-gradient(ellipse at center,#0000 35%,#000a)!important}
/* W-121 W-015 (T3's wide list): on a laptop the painted scene keeps its portrait stage and its whole picture; the banner,
   the line and the choices stand in a column beside it (their painted plates and type stay the stage's size, so the
   scene's own rules still hold), the pair centred on the table. The outcome and "Tap to continue" sit under the choices
   instead of over the line (T1's B-007), and a pick (the Hedge Witch's spells, T1's I-016) takes the whole column.
   The column is lifted to the middle of the part of the stage that shows; --ev-end is where the choices end below the line's panel
   (both in % of the stage's height, per layout variant: event-scene.css). */
/* The stage is drawn a quarter taller than the table and hangs from its top: the foot of the picture, which the phone
   hides under the panel, runs off the bottom, and the scene, its plates and its type come out a quarter larger. */
#screen>.event-scene.ev-composed{width:min(52cqw,calc(125cqh * var(--scene-aspect,.5714286)));align-self:flex-start}
.event-scene.ev-composed{--ev-h:calc(1cqw / var(--scene-aspect,.5714286));--ev-end:33;translate:-46% 0;overflow:visible}
.event-scene.ev-composed.ev-compact{--ev-end:36.4}
.event-scene.ev-composed.ev-type-large{--ev-end:37.1}
.event-scene.ev-composed.ev-compact.ev-type-large{--ev-end:38.8}
.ev-composed :is(.ev-banner,.ev-panel,.ev-plates){left:104%;translate:0 calc(-37 * var(--ev-h))}
.ev-composed .ev-plates{right:-92%}
.ev-composed .ev-tap{right:-92%}
#game .ev-composed :is(.ev-outcome,.ev-hint){top:calc(var(--ev-end) * var(--ev-h) + 1.6cqw);bottom:auto}
#game .ev-composed .ev-outcome{left:0;max-width:100%;font-size:3.1cqw}
#game .ev-composed .ev-hint{right:0;left:auto;font-size:2.8cqw}
/* W-151 (#51) step 3: "Tap to continue" is an arrow at the line's end now (event-scene.css), so the outcome takes the row. */
.ev-composed .ev-picker{left:104%;right:-92%;top:3%;bottom:auto;max-height:74%}
.ev-picker .reward-list .offer{min-height:0}/* W-036: three spells fit a 720 px window */
/* W-119 B-013: an event's card picker lists one card to a row, as the removal sheet does; three across it squeezed each
   card's text into a faded strip beside its art. */
#screen .ev-picker .run-cards.pick-list{grid-template-columns:1fr;gap:8px}
#screen .ev-picker .pick-list .run-card{min-height:0}
#game:is([data-era="2"],[data-era="3"],[data-era="4"]) .ev-picker .pick-list .run-card p{color:inherit;opacity:.8}
/* The map (T3's screen) keeps its portrait column until T3 lays it out for a laptop. */
#game:is([data-phase="map"],[data-phase="start"]) #screen:is([data-view="map"],[data-view="start"]){width:min(calc(100% - 2*var(--side-w)),640px);align-self:center;margin:0 auto}/* W-001: the map under the start's pick is the map's own size */
/* The laptop map (designer, 2026-09-26): the route in the middle, the road ahead on its left and the deck on its right */
.map-side{display:none}
/* W-121 W-003: the side panels reach the map's edges, so no bare wood band sits either side of it. */
#game:is([data-phase="map"],[data-phase="start"]) .map-side{display:block;position:absolute;top:46px;bottom:0;width:max(var(--side-w),calc((100% - 640px) / 2))}
#side-road{left:0;border-right-width:2px}
#side-map-deck{right:0;border-left-width:2px}
.road-progress{margin:-4px 0 14px;font-size:var(--fs-base);color:var(--muted)}
.road-boss{padding:12px;margin-bottom:16px;border:2px solid var(--era-edge,#a58d61);border-radius:4px;background:#fff3}
.road-boss .info-head h3{font-size:var(--fs-2xl)}
.road-boss .opponent-quote{margin-bottom:0}
/* The laptop title (designer, 2026-09-26): the painting keeps the whole window (it is still the Era I intro's first
   frame, D-124); the wordmark and the menu stand in a column on its left over a shade that clears toward the town.
   The loading screen puts its wordmark and bar in the same column, so the words do not move as the title takes over. */
#title,#boot{--title-left:clamp(48px,7vw,140px);--title-col:min(420px,34vw);justify-content:flex-start;gap:34px;padding:max(16dvh,64px) 0 24px var(--title-left)}
#title :is(.title-mark,.title-panel),#boot :is(.title-mark,.boot-panel){width:var(--title-col);max-width:none;box-sizing:border-box;margin:0;padding:0}
#title .title-mark h1,#boot .title-mark h1{font-size:clamp(48px,5.2vw,76px)}
#title .title-mark p,#boot .title-mark p{font-size:var(--fs-sm);margin-top:14px}
#title .title-card{max-height:calc(84dvh - 200px)}
#title .title-shade{background:linear-gradient(90deg,#0c1210f0 0,#0c1210c0 calc(var(--title-left) + var(--title-col) * .7),#0c121000 calc(var(--title-left) + var(--title-col) + 260px)),linear-gradient(to bottom,#10172a73 0,#10172a00 22%)}
/* W-112: the words, menu and shade wait off the art while the camera climbs the mountain and pulls back (title.js
   .opening), then the wordmark fades in and the menu follows. */
#title :is(.title-mark,.title-panel,.title-shade){transition:opacity .8s ease-out}
#title .title-panel{transition-delay:.3s}
#title.opening :is(.title-mark,.title-panel,.title-shade){opacity:0;pointer-events:none;transition:none}
#game:has(>#title.ready)>#boot{background:linear-gradient(90deg,#141b2af5 0,#141b2acc calc(var(--title-left) + var(--title-col) * .7),#141b2a00 calc(var(--title-left) + var(--title-col) + 260px))}
/* W-112 (designer, 2026-09-27): "Map headers are too large". The painted plate is sized for a phone's width; on a laptop it
   keeps a readable banner width and its lettering scales with it (about the phone's proportions: 5 % and 3.9 % of the plate, so the longest name, Brasshaven, fits its ribbon). */
.map-header-plate{width:min(100%,420px);margin-inline:auto;container-type:inline-size}
.map-header-plate.painted .map-header-name{font-size:5cqi}
.map-header-plate.painted .map-header-numeral{font-size:3.9cqi}
/* Then (designer, 2026-09-27): "move it to the top of the road section so that the map can have the full center space". */
.road-header{padding:0;margin:-4px -4px 14px}
.road-header .map-header-plate{width:min(100%,440px)}/* W-121: the wider map panels keep the plate its size */
.road-header .map-header-guide{display:none}/* the road's own progress line says it */
.road-key{list-style:none;margin:0;padding:0;display:grid;gap:10px}
.road-key li{display:flex;align-items:center;gap:12px}
.road-key img{width:52px;height:52px;flex:none;object-fit:cover;border-radius:50%;border:2px solid var(--ink);background:var(--paper)}
.road-key :is(.event,.shop,.forge,.rest) img{object-fit:contain;padding:2px}
.road-key strong{display:block;font-size:var(--fs-lg)}
.road-key span{display:block;font-size:var(--fs-sm);line-height:1.35;color:var(--muted)}
/* The in-game gallery (T5): more, smaller tiles across a laptop screen, and a readable column for badges and stats. */
.gal-grid{grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:12px}
.gal-badges,.gal-bars{max-width:900px;margin-inline:auto}

/* The upgrade flow: a readable page in the middle, its tower picker three across. */
#upgrade-flow .uf-sheet{max-width:860px;margin-inline:auto}
/* W-121 W-010/W-011: the flow's sheet (and the mastered pick's) is as tall as its step, in the middle of the window. */
:is(#upgrade-flow,#mastery-flow){align-items:center}
:is(#upgrade-flow,#mastery-flow) .uf-sheet{flex:0 1 auto;width:min(100%,860px);max-height:100%;margin-inline:auto}
/* T3's recheck: one height for every step of the flow (it snapped 611 → 713 → 639 px), each step in its middle. */
#upgrade-flow .uf-sheet{height:min(100%,740px);display:flex;flex-direction:column;justify-content:flex-start}
/* W-121 W-040: the heading holds one place on every step; what follows it is centred in the room below, and the last line
   keeps clear of the frame. Four (or seven, eight) towers go four across rather than leaving one alone on a row. */
#upgrade-flow .uf-sheet>.uf-head+*{margin-top:auto}
#upgrade-flow .uf-sheet>:last-child{margin-bottom:auto;padding-bottom:12px}
#upgrade-flow .uf-towers{grid-template-columns:repeat(3,minmax(0,1fr))}
#upgrade-flow .uf-towers:is(:has(>:nth-child(4):last-child),:has(>:nth-child(7):last-child),:has(>:nth-child(8):last-child)){grid-template-columns:repeat(4,minmax(0,1fr))}

/* W-121 W-002: Choose your towers uses the sheet: the heading centred over a wider grid, larger cards with room for
   three lines above the card's bottom rule, the whole block in the middle of the sheet. */
#start-pick .start-sheet{justify-content:center}
#start-pick .start-sheet .uf-head{width:100%;max-width:1040px;margin:0 auto 6px;text-align:center;justify-content:center}
#start-pick .start-sheet .uf-head>div{flex:1}
#start-pick .start-towers{max-width:1040px;grid-auto-rows:clamp(190px,calc((100dvh - 250px) / 2 - 10px),300px);gap:14px}
#start-pick .start-tower{padding:10px 12px 26px}
#start-pick .start-tower p{font-size:var(--fs-sm);-webkit-line-clamp:3}
#start-pick .start-sheet>.primary{max-width:460px;min-height:54px}

/* W-121 W-022 (T3's wide list): a battle's conversation is sized for the table (a wider panel, larger words and
   portrait), and the hand deals in inside its own column (it flew in from the phone's pile, across the Deck panel). */
.conversation-panel{max-width:720px;padding:22px 24px 14px}
#conversation.elite-intro .elite-bubble{max-width:400px;padding:10px 16px 9px}/* W-185 (#164) */
#conversation.elite-intro .elite-bubble .conversation-line{font-size:var(--fs-xl)}
.conversation-line{font-size:var(--fs-4xl)}
.conversation-stage{width:34%;max-width:340px}
#conversation{--talk-panel:720px}/* W-151 (#58): the wider panel, for Skip's place under it (style.css) */
#hand .card.dealt{animation:deal-rise .3s cubic-bezier(.2,.8,.25,1.06) backwards;animation-delay:var(--deal-delay,0ms)}
@keyframes deal-rise{from{opacity:0;transform:translateY(26px) scale(.94)}to{opacity:1;transform:none}}

/* W-121 batch 4 (W-021, W-024): the result sheet lays the deck out as cards, not stretched phone rows; the gallery reveal
   is a readable card of its own width with smaller tiles and a row of buttons. */
#screen :is(.run-cards,.deck-grid){grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px}
.rev-card{width:min(100% - 48px,1000px);flex:0 1 auto;margin:24px auto;max-height:calc(100% - 48px)}
#reveal{align-items:center}
.rev-head{padding:24px 24px 16px}.rev-head h2{font-size:28px}.rev-head p{font-size:12px}.rev-head span{font-size:14px}
.rev-body{padding:4px 24px 16px}.rev-body h3{font-size:12px}
.rev-grid{grid-template-columns:repeat(auto-fill,minmax(132px,1fr));gap:10px}
.rev-item figcaption{font-size:12px}.rev-item figcaption small{font-size:11px}
.rev-actions{flex-direction:row;justify-content:center;padding:14px 24px 20px}
.rev-actions button{flex:0 1 300px}

/* Windows over the game (deck, map, menu) stay a readable width. */
dialog{width:min(560px,calc(100vw - 48px))}
#menu-dialog:has(.menu-tabs){height:min(780px,88dvh);overflow-y:auto}/* W-121 W-016: both tabs one height, so switching moves nothing */
/* Toasts: a short note over the middle of the board, not a strip across the window (designer, 2026-09-27) */
#toast{left:50%;right:auto;bottom:110px;width:max-content;min-width:240px;max-width:min(460px,calc(100% - 2 * var(--side-w) - 48px));translate:-50% 0;padding:12px 22px;box-sizing:border-box}
/* W-152 (#52): with waves live, the tower card beside the board neither tints nor blocks the board: the wave stays in
   view and a tap on the board goes to it (another tower opens; the open tower's own square, or an empty one, closes). */
#overlay:has(.tower-info){background:transparent;pointer-events:none}
#overlay:has(.tower-info) .info-card{pointer-events:auto}
/* W-158 (#78) (the designer, 2026-10-20: "I find myself more and more enjoying playing with the free cam as the wave
   plays out. But parts of the board quickly get covered up by the menus. So what if to make it more Immersive we instead
   had the menu backgrounds be translucent and you could see through them. Of course the cards and the information and
   the buttons should still be on top"; shown two looks, their pick: "A, parchment at 55%"; then: "Let's keep improving.
   Make sure all text is readable and check all other eras"). The board's canvas runs the whole window under the side
   panels: it leaves its wrap by a panel's width each side, so the wrap, and the pennant, the caption, the boss bar and
   the camera controls in it, keep the middle column, and so does the board's framing (the usual view fits the board by
   height, in the middle of a canvas whose two margins are equal). The panels' paper is a pair of grid layers under them
   (the panel scrolls; a layer inside it would scroll away), at --see-through: Era I's parchment, and in Eras II–IV the
   era's own panel paper (style.css --panel-paper; Era III's neon glass: neon.css). For the words to read over a busy
   board, each panel blurs what is behind it (--see-through-blur): the board shows through as colour and motion, and the
   ink keeps its contrast. The cards, the words and the buttons stay opaque on top, and a tap on a panel, the hand or the
   action bar is theirs, never the board's (main.js boardUnder). Era I's hand and action bar keep their timber, a shade
   darker. The phone changes nothing (this block is the laptop's). */
#game{--see-through:.55;--see-through-blur:6px}
#board-wrap{overflow:visible;background:none}
#board{position:absolute;top:0;left:calc(-1 * var(--side-w));width:calc(100% + 2 * var(--side-w));height:100%}/* a canvas is replaced: insets alone don't stretch it */
#battle-view::before,#battle-view::after{content:'';z-index:1;opacity:var(--see-through);pointer-events:none;background:var(--panel-paper,var(--paper) url('/assets/ui/parchment.svg') center/100% 100%)}
#battle-view::before{grid-area:intel}
#battle-view::after{grid-area:deck}
#battle-view:not(:has(#hand:not([data-count="0"]),#inspector.inspecting:not(.hidden)))::after,#battle-view.resolving:not(:has(#inspector.inspecting:not(.hidden)))::after{grid-row:1/-1}/* with the deck panel above (its own rule) */
#game[data-era] #battle-view .side-panel{background:none;backdrop-filter:blur(var(--see-through-blur));-webkit-backdrop-filter:blur(var(--see-through-blur))}/* as specific as the eras' paper rule (style.css), and later, so it wins; Era III's neon rules: neon.css */
.side-panel.more::after{background:linear-gradient(#0000,color-mix(in srgb,var(--paper) 55%,transparent) 85%)}
#hand,#actions,#inspector{position:relative;z-index:2}
#game[data-era="1"] :is(#hand,#actions){background-color:#2a2219b3;background-blend-mode:multiply}
}
/* #136 (the designer: "look at that text its hard to read"): the laptop panel's lines read in ink, not the muted tone. */
@media (min-width:960px) and (min-height:600px) and (min-aspect-ratio:5/4){#game[data-screen="v19"] #side-intel :is(.intel-intent,.opponent-quote){color:var(--ink,#2c2418);opacity:1}}

