@import url('./route-map.css');
@import url('./event-scene.css');
@import url('./era-header.css');
@import url('./upgrade-flow.css');
:root{font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#302f25;background:#18261e;--ink:#302f25;--muted:#696b54;--gold:#d9b775;--paper:#ebdfbd;--blue:#416775}
/* W-109: one text scale. Phone sizes here (nothing under 11 px); the wide layout raises the whole scale. */
:root{--fs-xs:11px;--fs-sm:12px;--fs-base:13px;--fs-md:14px;--fs-lg:15px;--fs-xl:16px;--fs-2xl:17px;--fs-3xl:19px;--fs-4xl:21px;--fs-5xl:24px;--fs-6xl:32px}

*{box-sizing:border-box}
body{margin:0;min-height:100dvh;display:grid;place-items:center;background:#18261e}
/* W-158 (#73) (the designer, 2026-10-20: "When you scroll up or down and hit the limit of the screen the whole thing sort
   of bounces/jumps … makes it feel more like a web page and less like a solid game"): a scroll stops dead at its end.
   The page itself never rubber-bands (Safari and the phone bounce even a page that cannot scroll), and no panel in the
   game does, nor hands its scroll on to the page: the sheet, the hand, the side panels, a card's or tower's details, the
   deck, map and menu windows, the gallery, the map list, the pickers, the lighting editor, the title card, the upgrade
   flow's sheet, an event's picker. Everything on the page is inside #game (index.html), so one rule reaches them all. */
html,body{overscroll-behavior:none}
#game *{overscroll-behavior:none}
button{font:inherit;color:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent}
button:disabled{cursor:default}
button:focus-visible,summary:focus-visible{outline:3px solid #619dac;outline-offset:2px}
h1,h2,h3,p{margin:0}
h1,h2,h3{font-weight:750;line-height:1.15}
h1{font-size:var(--fs-5xl)}
h2{font-size:var(--fs-3xl)}
h3{font-size:var(--fs-lg)}
.hidden{display:none!important}
.ui-icon{width:22px;height:22px;display:inline-block;flex-shrink:0;vertical-align:middle;fill:currentColor}
.subtle{border:0;background:transparent;min-height:38px;padding:6px;color:inherit;font-size:var(--fs-xs)}
.wide{width:100%}

#game{width:min(100vw,480px);height:100dvh;max-height:980px;position:relative;overflow:hidden;background:#352d25 url('/assets/ui/timber.svg');background-size:240px 120px;box-shadow:0 12px 50px #050d0780;display:flex;flex-direction:column;border:3px solid #433d2e;border-top-color:#9a8156;border-bottom-color:#221f1a}

#hud{height:44px;flex-shrink:0;display:flex;align-items:center;gap:7px;padding:0 7px;color:#eadbb2;border-bottom:2px solid #927347;z-index:3}
.era-mark{display:flex;align-items:center;gap:2px;color:#d2b271;font-size:var(--fs-xs)}
.era-mark .ui-icon{width:25px;height:25px}
.resources{display:flex;gap:10px;align-items:center;flex:1;justify-content:flex-end;font-size:var(--fs-lg);font-variant-numeric:tabular-nums}
.resources>span{display:flex;gap:4px;align-items:center;white-space:nowrap}
.resources small{font-size:var(--fs-xs);opacity:.65;margin-left:-4px}
.resources .ui-icon{width:19px;height:21px}
.health-counter{color:#eac8b7}
.rail-button{border:0;background:transparent;min-width:38px;height:40px;padding:7px 5px;display:flex;align-items:center;justify-content:center;gap:3px;color:inherit}
.rail-button:hover{background:#bca57220}
.rail-button small{font-size:var(--fs-xs)}
.rail-button .ui-icon{width:23px;height:23px}

#battle-view{display:flex;flex-direction:column;flex:1;min-height:0}
#board-wrap{flex:1;min-height:150px;position:relative;overflow:hidden;background:#415b37}
/* V013-SHOW-FPS: the Developer tab's frame-rate badge, at the board's bottom right (fps-meter.js). */
#fps-meter{position:absolute;right:8px;bottom:8px;z-index:6;display:flex;align-items:baseline;gap:4px;padding:3px 8px;border-radius:6px;background:#000000b8;color:#d8e6e2;font:600 11px/1.3 ui-monospace,SFMono-Regular,Menlo,monospace;font-variant-numeric:tabular-nums;pointer-events:none}
#fps-meter b{font-size:14px;color:var(--fps,#d8e6e2)}
#fps-meter small{font-size:10px;opacity:.75}
#fps-meter[data-band="good"]{--fps:#8ff0a4}#fps-meter[data-band="mid"]{--fps:#ffd36b}#fps-meter[data-band="low"]{--fps:#ff8c7a}
#board{display:block;width:100%;height:100%;touch-action:none;cursor:crosshair}
#board-caption{display:none}
#loading{position:absolute;inset:0;background:#3d4e36;display:grid;place-items:center;font-size:var(--fs-xl);color:#e5d7b5}

#opponent{position:absolute;top:5px;left:8px;right:8px;display:flex;align-items:flex-start;gap:7px;z-index:2;pointer-events:none}
.enemy-pennant{display:flex;align-items:center;gap:7px;min-height:43px;max-width:calc(100% - 46px);padding:0 17px 3px 4px;border:0;background:url('/assets/ui/pennant.svg') center/100% 100%;color:#f1e2c2;text-align:left;pointer-events:auto}
.enemy-pennant>img{width:34px;height:40px;object-fit:contain;align-self:flex-end}
.enemy-pennant strong{font-size:var(--fs-sm);display:block}
.enemy-pennant small{font-size:var(--fs-xs);line-height:1.25;display:block;margin-top:3px;color:#e3c7ad}
.wave-seal{background:#3c4436;border:1px solid #b6a576;color:#f1dfb3;clip-path:polygon(0 0,100% 0,100% 78%,50% 100%,0 78%);min-width:37px;height:43px;padding:4px 4px 10px;text-align:center}
.wave-seal b{font-size:var(--fs-4xl)}
.wave-seal small{font-size:var(--fs-xs)}
/* W-058: the tempo chip under the wave seal ("Mini-boss" halfway, "Boss" on the last wave) reuses the seal's colours. */
.wave-stack{display:flex;flex-direction:column;align-items:center;gap:2px}
.wave-chip{font-size:var(--fs-xs);font-weight:750;line-height:1;padding:3px 6px;border-radius:9px;background:#3c4436;border:1px solid #b6a576;color:#f1dfb3;text-transform:uppercase;letter-spacing:.03em;white-space:nowrap}

#inspector{flex-shrink:0;min-height:67px;display:flex;align-items:center;gap:7px;padding:7px 9px;background:var(--paper) url('/assets/ui/parchment.svg') center/100% 100%;border-top:2px solid #a58d61;position:relative;z-index:2;color:var(--ink)}
#inspector .info{flex:1;min-width:0}
#inspector h3{font-size:var(--fs-base)}
#inspector p{font-size:var(--fs-xs);line-height:1.38;margin-top:4px;color:#4b5142}
.mini-art{width:42px;height:48px;object-fit:contain}
#inspector .subtle{align-self:flex-start;min-width:30px;padding:4px}
#inspector .subtle .ui-icon{width:18px}
.cost{color:#386779;font-weight:750}
.small-button{min-height:40px;padding:7px 11px;font-size:var(--fs-sm);display:inline-flex;align-items:center;gap:7px;justify-content:center}
.target-choice{border:0;background:#8b9c832a;min-height:32px;padding:3px 8px 3px 3px;font-size:var(--fs-xs);color:#375b60;display:flex;gap:4px;align-items:center;margin-top:3px}
.target-choice .ui-icon{width:16px;height:16px}
.target-choice:is(:disabled,[aria-disabled=true]){opacity:.6}/* W-116: aria-disabled still answers a tap with the reason */

#hand{height:105px;display:flex;align-items:stretch;gap:4px;padding:5px 7px 3px;flex-shrink:0;overflow-x:auto;scrollbar-width:thin;border-top:2px solid #b4935c;background:url('/assets/ui/timber.svg') center/240px 120px}
.card{position:relative;flex:1;min-width:53px;max-width:97px;background:url('/assets/ui/card.svg') center/100% 100%;border:0;padding:4px 3px 7px;display:flex;flex-direction:column;align-items:center;text-align:center;transition:translate .13s;filter:drop-shadow(0 3px 2px #141b1166)}
.card.selected{translate:0 -4px;outline:2px solid #79b0b9;outline-offset:-3px}
.card.unaffordable{filter:saturate(.45);opacity:.58}
.card-cost{position:absolute;top:3px;left:2px;z-index:1;display:grid;place-items:center;width:24px;height:26px;color:#173747;font-size:var(--fs-md);font-weight:850}
.card-cost .ui-icon{position:absolute;inset:0;width:24px;height:26px;z-index:-1}
.card :is(img,.piece-art){width:70px;max-width:100%;height:50px;object-fit:contain;margin:1px 0 0}
.card-name{font-size:var(--fs-xs);line-height:1.08;font-weight:750;margin-top:auto;color:#32382b}
.card-kind{font-size:var(--fs-xs);text-transform:uppercase;color:#63735a;margin-top:3px;letter-spacing:.025em}
.card.rare:after,.card.uncommon:after{content:'';position:absolute;right:5px;top:5px;width:6px;height:6px;background:#8c6088;rotate:45deg}
.card.uncommon:after{background:#53765f}
.card.dealt{animation:deal-in .18s both;animation-delay:var(--deal-delay,0ms)}
@keyframes deal-in{from{opacity:0;transform:translateY(8px)}
to{opacity:1;transform:translateY(0)}
}

#actions{height:55px;padding:3px 7px 5px;display:flex;align-items:center;gap:7px;flex-shrink:0;border-top:1px solid #99815b88;color:#e9d8b3;background:#272c23}
.mana{display:flex;align-items:center;position:relative;min-width:55px;gap:2px;font-variant-numeric:tabular-nums}
.mana>.ui-icon{width:28px;height:32px}
.mana strong{font-size:var(--fs-5xl);color:#b2dce0}
.mana small{font-size:var(--fs-xs);color:#9bacac}
.piles{display:flex;flex-direction:column;align-items:center;border:0;background:transparent;color:#b8c1a3;min-width:32px;min-height:43px;font-size:var(--fs-xs);padding:2px}
.piles span{display:flex;align-items:center;gap:3px}
.piles .ui-icon{width:15px;height:17px}
/* W-109: two button styles, main (.primary) and secondary (.secondary; .small-button shares its face). Built in CSS so a
   button of any size keeps round rivets and crisp rims, and works with the connection down. Each era sets the --b1-*
   (main) and --b2-* (secondary) tokens below; the title and loading screens use the global set. */
:root,#title,#boot{--b1-face:linear-gradient(#9d6f47,#7d5337 46%,#6b442a);--b1-rim:#dcbc78;--b1-edge:#2a2218;--b1-ink:#fff0cc;--b1-rivet:#e8ca86;--b1-glow:#0000;--b1-accent:#0000;--b1-radius:4px;
 --b2-face:linear-gradient(#2d281fe6,#1b1813eb);--b2-rim:#b8995c;--b2-ink:#f3e6c4;--b2-radius:4px}
#game[data-era="1"]{--b1-rim:#cfae6b;--b1-rivet:#dab877;--b2-face:linear-gradient(#f4eacd,#e0d1a8);--b2-rim:#a3854f;--b2-ink:#3a3326}
.primary,.info-card .tower-info .inspector-actions .upgrade-button{position:relative;border:1px solid var(--b1-edge);border-radius:var(--b1-radius);color:var(--b1-ink);min-height:45px;padding:10px 24px;font-size:var(--fs-md);font-weight:750;letter-spacing:.01em;text-shadow:0 1px 1px #0007;display:inline-flex;align-items:center;justify-content:center;gap:9px;
 background:radial-gradient(circle at 11px 50%,var(--b1-rivet) 0 2.2px,#0000 2.9px),radial-gradient(circle at calc(100% - 11px) 50%,var(--b1-rivet) 0 2.2px,#0000 2.9px),linear-gradient(var(--b1-accent),var(--b1-accent)) center calc(100% - 5px)/calc(100% - var(--b1-accent-inset,30px)) 2px no-repeat,var(--b1-face);
 box-shadow:inset 0 0 0 2px var(--b1-rim),inset 0 4px 0 1px #ffffff1f,inset 0 -3px 0 1px #0000002e,0 2px 0 #0000004d,0 0 12px var(--b1-glow)}
.primary:hover:not(:disabled){filter:brightness(1.1)}
.primary:active:not(:disabled){transform:translateY(1px);filter:brightness(.96)}
.primary:disabled,.upgrade-button[aria-disabled=true]{opacity:.55;filter:saturate(.5)}
.secondary,.small-button{border:1px solid var(--b2-rim);border-radius:var(--b2-radius);background:var(--b2-face);color:var(--b2-ink);box-shadow:inset 0 1px 0 #ffffff26,0 1px 0 #00000026}
.secondary{min-height:44px;padding:9px 18px;font-size:var(--fs-md);font-weight:650;display:inline-flex;align-items:center;justify-content:center;gap:8px}
:is(.secondary,.small-button):hover:not(:disabled){filter:brightness(1.06)}
:is(.secondary,.small-button):active:not(:disabled){transform:translateY(1px)}
:is(.secondary,.small-button):disabled{opacity:.55}
.primary .ui-icon{width:15px;height:15px}
#end-turn{flex:1;min-width:95px;padding:9px 8px}
.speed{font-size:var(--fs-sm);font-weight:700;min-width:30px}
#battle-view.resolving #hand{display:none}
#battle-view.resolving .mana{opacity:.55}

#screen{flex:1;overflow:auto;padding:14px 13px 18px;margin:5px;background:#e6d7af url('/assets/ui/parchment.svg') center/100% 100%;scrollbar-width:thin;scrollbar-color:#a29068 transparent;min-height:0;border:1px solid #a89468}
.sheet-heading{display:flex;align-items:center;gap:11px;min-height:66px;padding-bottom:13px;margin-bottom:10px;border-bottom:1px solid #aa96666b}
.sheet-heading>img{width:70px;height:66px;object-fit:contain}
.sheet-heading>div{flex:1}
.sheet-heading h1{font-size:var(--fs-4xl);color:#3e4a32}
.sheet-heading p{font-size:var(--fs-xs);line-height:1.4;margin-top:5px;color:#646952}
.battle-receipt{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:3px 0 13px;font-size:var(--fs-xs);color:#687254}
.battle-receipt span{display:flex;align-items:center;gap:3px}
.battle-receipt .ui-icon{width:18px;height:18px}
.reward-list,.site-actions{display:flex;flex-direction:column;gap:8px}
.offer{width:100%;min-height:103px;position:relative;display:flex;align-items:center;gap:7px;background:url('/assets/ui/card.svg') center/100% 100%;border:0;padding:10px;text-align:left;color:#34412e}
.offer:hover:not(:disabled){filter:brightness(1.035);outline:2px solid #728b61;outline-offset:-4px}
.offer:disabled{opacity:.46}
.offer-art{width:65px;height:74px;object-fit:contain;flex-shrink:0}
.offer>div{flex:1;min-width:0}
.offer h3{font-size:var(--fs-lg);margin-bottom:5px}
.offer p{font-size:var(--fs-xs);color:#5b654f;line-height:1.4}
.offer small{display:block;color:#7b785a;text-transform:uppercase;font-size:var(--fs-xs);letter-spacing:.07em;margin:0 0 4px}
.offer-mark{width:22px;margin:0 5px}
.price{display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:26px;font-weight:750;font-size:var(--fs-lg);color:#80642e;align-self:center}
.price .ui-icon{width:23px;height:23px}
.mana-price{color:#426675}
.site-note{font-size:var(--fs-sm);line-height:1.5;color:#696b54;margin:0 0 12px}
.site-actions .offer{min-height:93px}
.site-icon{width:51px;height:45px;margin:0 7px}
.shop-list .offer{min-height:88px;padding:7px 9px}
.shop-list .offer-art{height:65px;width:57px}
.shop-list .offer small{margin-top:6px;margin-bottom:0}
.shop-list+.primary{margin-top:12px}

.back{display:flex;align-items:center;gap:5px;min-height:38px;padding:0 5px;border:0;background:transparent;color:#697251;font-size:var(--fs-sm)}
.back .ui-icon{width:17px;height:17px}
.tech-group{padding:5px 0 12px;border-bottom:1px solid #aa96665c;margin-bottom:9px}
.tech-owner{display:flex;align-items:center;gap:5px;margin-bottom:5px;min-height:37px}
.tech-owner img{width:34px;height:36px;object-fit:contain}
.tech-owner strong{font-size:var(--fs-sm)}
.tech-owner small{font-size:var(--fs-xs);color:#727257;margin-left:auto}
.tech-choices{display:flex;flex-direction:column;gap:5px}
.tech-choices button{display:flex;align-items:center;gap:8px;text-align:left;min-height:81px;padding:6px 9px;background:#d8c9a288;border:1px solid #b49d6b66}
.tech-choices button:hover{background:#d4c397}
.tech-choices img{width:57px;height:66px;object-fit:contain}
.tech-choices h3{font-size:var(--fs-base)}
.tech-choices p{font-size:var(--fs-xs);line-height:1.4;color:#63674f;margin-top:4px}
.tech-cost{display:flex;align-items:center;gap:3px;font-size:var(--fs-xs);color:#496970;margin-top:4px}
.tech-cost .ui-icon{width:13px;height:15px}
.empty-note{font-size:var(--fs-sm);padding:14px}

.chart-title{display:flex;align-items:center;gap:8px}
.chart-title .ui-icon{width:29px;height:30px}
.chart-title h1{font-size:21px}
.chart-title span{font-size:9px;margin-left:auto;color:#6f7458}
.chart-hint{font-size:10px;color:#687855;margin:7px 0 12px;padding-bottom:9px;border-bottom:1px solid #ac9b6b55}
.journey-map{height:496px;position:relative;display:flex;flex-direction:column;gap:8px}
.route-lines{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.route-lines path{fill:none;stroke:#929578;stroke-width:2;stroke-dasharray:3 4;opacity:.5}
.route-lines .walked{stroke:#8d5c38;stroke-dasharray:none;stroke-width:3;opacity:1}
.route-lines .available{stroke:#59764f;stroke-dasharray:none;opacity:1}
.map-row{height:64px;flex-shrink:0;display:flex;justify-content:center;gap:14px;position:relative}
.node{border:0;background:#decea680;width:calc(50% - 7px);padding:4px;display:flex;align-items:center;gap:5px;text-align:left;color:#475439;min-width:0}
.node.active{background:#f4e9c9;box-shadow:inset 0 0 0 2px #617d50,0 2px 0 #9d956477}
.node.bypassed{opacity:.32}
.node.future{opacity:.64}
.node.visited{background:#c7c49e}
.node-title{font-size:10px;font-weight:750;display:block;line-height:1.25}
.node-label{font-size:8px;display:block;color:#6c7557;margin-top:3px}
.map-portrait{width:39px;height:53px;flex-shrink:0;position:relative;display:block;overflow:hidden}
.map-portrait>img{width:100%;height:100%;object-fit:contain}
.map-portrait.opposing{background:#90735b22}
.map-portrait.opposing>img{width:54px;height:57px;max-width:none;margin-left:-7px}
.map-portrait.wayside>img{transform:scale(1.65)}
.map-portrait>.ui-icon{position:absolute;right:0;bottom:0;width:17px;height:17px;padding:1px;background:#748154;color:#f5e3b9}
.map-row:last-child .node{background:#a46d6033}
.map-row:last-child .node.active{background:#ebd4b5}

.result-banner{display:flex;align-items:center;gap:12px;padding:12px;background:url('/assets/ui/pennant.svg') center/100% 100%;color:#f3e2bf}
.result-banner>.ui-icon{width:49px;height:49px}
.result-banner h1{font-size:var(--fs-5xl)}
.result-banner p{font-size:var(--fs-xs);margin-top:5px;color:#e3c8a7}
.result-banner.lost{filter:saturate(.45)}
.result-stats{display:flex;justify-content:space-around;gap:15px;padding:17px 0;text-align:center}
.result-stats strong{font-size:var(--fs-5xl);color:#4e5c3c}
.result-stats small{display:block;font-size:var(--fs-xs);color:#77775d;margin-top:3px}
.result-collection{margin-top:20px}
.collection-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:9px}
.collection-heading h2{font-size:var(--fs-xl)}
.collection-heading>span{font-size:var(--fs-xs);color:#6c7156}
.run-cards{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.run-card{display:flex;align-items:center;min-height:64px;gap:4px;padding:4px;background:#d2c69e70;border:1px solid #aa97684d}
.run-card.learned{background:#c3c39870;border-color:#92935c}
.run-card :is(img,.piece-art){width:44px;height:54px;object-fit:contain}
.run-card strong{font-size:var(--fs-xs);line-height:1.2;display:block;color:#46543a}
.run-card small{font-size:var(--fs-xs);color:#727454;display:block;margin-top:4px}
.route-record{margin-top:16px;font-size:11px;color:#6b6d51;border-top:1px solid #a7956466;padding-top:9px}
.route-record summary{min-height:35px;padding:8px 0;cursor:pointer}
.route-record ol{line-height:1.9;margin-top:3px;padding-left:18px}

dialog{padding:16px;background:#e6d7af url('/assets/ui/parchment.svg') center/100% 100%;color:#34412e;border:4px solid #716043;width:min(425px,calc(100vw - 24px));max-height:88dvh;box-shadow:0 10px 60px #10160ab0;scrollbar-width:thin}
dialog::backdrop{background:#142417b5}
.dialog-top{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px;border-bottom:1px solid #a792655e;padding-bottom:5px}
.dialog-top h2{font-size:var(--fs-3xl)}
.dialog-top button{background:none;border:0;min-width:38px;min-height:40px;padding:8px}
.menu-actions{display:flex;flex-direction:column;gap:7px}
.menu-actions .small-button{justify-content:flex-start;font-size:var(--fs-base)}
.menu-actions .small-button span{margin-left:auto;font-size:var(--fs-xs);color:var(--ink)}
.menu-actions a.small-button{color:var(--ink);text-decoration:none}
.menu-actions .ui-icon{width:21px;height:22px}
.menu-actions .primary{margin-bottom:3px}
/* W-109 menus: two tabs (the game's menu, the developer controls) and rows in labelled groups, one panel per group
   with hairlines between rows, for the journey menu and the title's Settings (ui-kit.js menuTabs/menuGroup) */
.menu-tabs{display:grid;grid-template-columns:1fr 1fr;margin:0 0 12px;padding:3px;border:1px solid var(--b2-rim);border-radius:calc(var(--b2-radius) + 3px);background:#0000001f}
.menu-tab{min-height:40px;border:0;border-radius:var(--b2-radius);background:transparent;color:inherit;font-size:var(--fs-md);font-weight:650;opacity:.7}
.menu-tab[aria-selected="true"]{background:var(--b2-face);color:var(--b2-ink);opacity:1;box-shadow:inset 0 0 0 1px var(--b2-rim),0 1px 2px #0003}
.menu-tab:focus-visible{outline:2px solid var(--card-focus,#497985);outline-offset:1px}
.menu-actions:has(.menu-group),.title-actions:has(.menu-group){gap:12px}
.menu-group{display:flex;flex-direction:column;gap:5px}
.menu-group h3{margin:0 2px;font-size:var(--fs-xs);font-weight:750;letter-spacing:.14em;text-transform:uppercase;color:var(--muted)}
.menu-rows{display:flex;flex-direction:column;border:1px solid var(--b2-rim);border-radius:min(var(--b2-radius),16px);/* Era IV's pill radius would clip a group */background:var(--b2-face);box-shadow:inset 0 1px 0 #ffffff26,0 1px 0 #00000026;overflow:hidden}
.menu-rows>.small-button{border:0;border-radius:0;box-shadow:none;background:transparent;min-height:46px}
.menu-rows>.small-button+.small-button{border-top:1px solid color-mix(in srgb,var(--b2-rim) 50%,transparent)}
/* Tiles: short rows side by side, the icon beside the label and the value under it (designer, 2026-09-27: less scrolling) */
.menu-rows.tiles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1px;background:color-mix(in srgb,var(--b2-rim) 50%,transparent)}
.menu-rows.tiles-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.menu-rows:is(.tiles-2,.tiles-4)>:last-child:nth-child(odd){grid-column:1/-1}
.menu-rows.tiles>.small-button{display:grid;grid-template-columns:auto minmax(0,1fr);align-content:center;justify-content:stretch;column-gap:8px;row-gap:1px;min-height:56px;padding:7px 10px;background:var(--b2-face);text-align:left;line-height:1.2}
.menu-rows.tiles>.small-button:not(:has(.ui-icon)){grid-template-columns:minmax(0,1fr)}
.menu-rows.tiles>.small-button>.ui-icon{grid-row:1/3;align-self:center}
.menu-actions .menu-rows.tiles>.small-button span,#title .title-card .menu-rows.tiles>.small-button span{grid-column:-2;margin:0;font-size:var(--fs-xs);opacity:.85}
.menu-rows.tiles>.small-button+.small-button{border-top:0}
.menu-rows.tiles-3>.small-button{grid-template-columns:minmax(0,1fr);justify-items:center;text-align:center;padding:8px 6px}
.menu-rows.tiles-3>.small-button>.ui-icon{grid-row:auto;margin-bottom:2px}
.menu-actions .menu-rows.tiles-3>.small-button span{grid-column:1}
/* On/off rows show their state in the icon: a green tick when on, a red cross when off (designer, 2026-09-27) */
.ui-icon.status-on{color:#2f7a3b}.ui-icon.status-off{color:#b23a2e}
#game[data-era="3"] .ui-icon.status-on{color:#62d98a}#game[data-era="3"] .ui-icon.status-off{color:#ff7a70}
#menu-dialog:has(.menu-tabs){margin-block:max(16px,5dvh) auto}/* pinned at the top: switching tabs moves only its bottom edge */
/* #50: the Developer tab's Rehearsal: Find and Order stay at the top of the dialog as the list scrolls under them; 16px
   text so a phone doesn't zoom in on the field */
#menu-dialog:has(.rehearsal-pick){margin-block:max(16px,5dvh) auto}/* pinned at the top: the list shrinking as you type moves only its bottom edge, and a phone's keyboard covers no field */
.rehearsal-controls{position:sticky;top:-16px;z-index:1;display:grid;grid-template-columns:minmax(0,3fr) minmax(0,2fr);gap:6px 8px;align-items:end;margin:-4px -4px 0;padding:6px 4px 4px;background:#e6d7af;box-shadow:0 6px 8px -6px #34412e55}
.rehearsal-controls label{display:flex;flex-direction:column;gap:3px;font-size:var(--fs-xs);font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.rehearsal-controls input,.rehearsal-controls select{box-sizing:border-box;width:100%;min-height:40px;padding:6px 10px;font-family:inherit;font-size:16px;line-height:1.2;letter-spacing:0;text-transform:none;color:#34412e;background:#fffaf0d9;border:1px solid #716043;border-radius:9px}
.rehearsal-count{grid-column:1/-1;margin:0 2px;font-size:var(--fs-xs);color:var(--muted)}
.rehearsal-pick .menu-rows>.small-button{min-height:42px;text-align:left;line-height:1.25}
#menu-content>.build-version{margin:12px 0 0;text-align:center;font-size:var(--fs-xs);color:var(--muted)}
.intel-intent{font-size:var(--fs-xs);color:#657052;line-height:1.5;margin:4px 0 13px}
.intel-list{display:flex;flex-direction:column;gap:7px}
.intel-unit{display:flex;gap:9px;align-items:center;background:#c9c29850;padding:8px;border-bottom:1px solid #b4a07366}
.intel-unit img{width:47px;height:64px;object-fit:contain}
.intel-unit h3{font-size:var(--fs-base)}
.unit-stats{font-size:var(--fs-xs);color:#756847;margin-top:4px}
.intel-unit p{font-size:var(--fs-xs);color:#65704e;margin-top:5px;line-height:1.4}

#toast{position:absolute;bottom:170px;left:16px;right:16px;z-index:8;background:#e8d8b0 url('/assets/ui/parchment.svg') center/100% 100%;border:2px solid #9f6d4d;padding:12px;color:#493f2b;text-align:center;font-size:var(--fs-sm);opacity:0;pointer-events:none;transition:opacity .15s;box-shadow:0 4px 12px #10190c88}
#toast.show{opacity:1}
/* W-119 B-006: hidden once faded, so the box never shows empty while its text is cleared. */
#toast{visibility:hidden;transition:opacity .15s,visibility 0s linear .15s}#toast.show{visibility:visible;transition-delay:0s}
/* W-155 (#62, D-180): a recorded run started over asks why, once (capture-ui.js): one tap, optional; it sits above the toast */
.quit-why{position:absolute;bottom:96px;left:16px;right:16px;z-index:9;background:#e8d8b0 url('/assets/ui/parchment.svg') center/100% 100%;border:2px solid #9f6d4d;padding:10px 44px 10px 12px;color:#493f2b;font-size:var(--fs-sm);box-shadow:0 4px 12px #10190c88}
.quit-why p{margin:0 0 8px}.quit-why p span{opacity:.7;margin-left:6px}
.quit-why-row{display:flex;flex-wrap:wrap;gap:6px}.quit-why-row .small-button{flex:1 1 auto;min-height:40px}
.quit-why-close{position:absolute;top:6px;right:6px}
.record-code{display:flex;flex-direction:column;gap:4px;width:100%}.record-code input{font:inherit;padding:8px;width:100%;box-sizing:border-box}

#boss-status{position:absolute;top:72px;left:12px;right:96px;display:flex;gap:6px;pointer-events:none;max-width:335px;margin:auto}
.boss-bar{flex:1 1 0;min-width:0;background:#3b3830 url('/assets/ui/timber.svg') center/240px 120px;border:1px solid #8f7c58;border-left:4px solid #ad737c;color:#e8d5b4;padding:5px 9px}
.boss-bar>div:first-child{display:flex;justify-content:space-between;font-size:var(--fs-xs);gap:7px}
.boss-bar strong{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.boss-bar span{white-space:nowrap}
.boss-bar small{display:block;font-size:var(--fs-xs);color:#d6c7ad;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* Designer, 2026-09-29: on a phone the bars sit in the items strip, top right, off the board (main.js renderBoss). */
#hud-strip #boss-status{position:static;flex:1 1 0;min-width:0;max-width:none;margin:0;align-self:stretch;padding:2px 0}
#hud-strip .boss-bar{display:flex;flex-direction:column;justify-content:center;padding:1px 7px;border-left-width:3px;line-height:1.15}
#hud-strip .boss-bar .boss-track{margin:2px 0 1px;flex-shrink:0}/* W-145: the bar never gives way to its words (a three-line bar in the 50 px strip squeezed it to nothing) */
#hud-strip .boss-bar small{flex:none;font-size:10px;line-height:1.1;white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.boss-bar .boss-hp{display:none;font-weight:700}
.boss-extra{display:flex;flex-wrap:wrap;gap:5px;margin-top:2px;font-size:var(--fs-xs)}/* W-145 step 2: a boss's barExtra */
#hud-strip .boss-extra{margin-top:0}/* W-145: in the 50 px strip a 12 px chip under the bar hung 3 px past its border (T3, gate 7) */
.wave-order{margin:6px 0 0}/* W-145 step 2: a boss's previewOrder */
.card-note{position:absolute;top:30px;left:2px;right:2px;z-index:2;padding:1px 2px;white-space:nowrap;overflow:hidden;border-radius:3px;background:#3a1630;color:#ffe3f0;font-size:10px;line-height:12px;font-weight:800;text-align:center;letter-spacing:0;box-shadow:0 0 0 1px #ff6fae}.card-note-line{margin:0 0 8px;padding:6px 8px;border-left:3px solid #ff6fae;background:rgba(58,22,48,.85);color:#ffe3f0;font-size:var(--fs-sm);font-weight:700}/* W-147 (#45): a boss's cardNote: its tag on the hand's card, its line in the card's details and a relic's sheet */
#hud-strip .boss-bar>div:first-child>span{display:none}#hud-strip .boss-bar .boss-hp{display:inline}
#hud-strip.boss-fight{height:50px}
#hud-strip:has(#boss-status:not(.hidden)) .belt-label{display:none}
#hud-strip:has(#boss-status:not(.hidden)) #relic-row{flex:0 1 auto}
.boss-track{height:4px;background:#1c241d;margin:5px 0 2px;position:relative}
.boss-track i{display:block;height:100%;background:#bb8492}
.boss-track b{position:absolute;left:50%;top:-2px;height:8px;width:1px;background:#f2d194}
/* W-137 (#6): the boss speaks from its portrait: a dialog box hung under its pennant (main.js bossSay places it), over the
   castle wall at the top of the board rather than the middle of the play area. Its tail points up at the portrait. */
#boss-say{position:absolute;left:8px;top:52px;z-index:4;width:max-content;max-width:min(58%,300px);padding:6px 10px 7px;border-radius:7px;
  background:#2b2520f0;border:1.5px solid #c9974d;color:#f3e2bf;box-shadow:0 3px 10px #0007;pointer-events:none;opacity:0;visibility:hidden;--tail:24px}
#boss-say::before,#boss-say::after{content:'';position:absolute;left:var(--tail);width:0;height:0;border:7px solid transparent;border-top:0;transform:translateX(-50%)}
#boss-say::before{top:-8px;border-bottom:8px solid #c9974d}
#boss-say::after{top:-5.5px;border-bottom:7px solid #2b2520}
/* W-169 (#99): the zoom intro (?intro=zoom) keeps the board in full view: no dimming, a clear layer that takes the tap
   for the next line, and the Skip button. */
#conversation.zoom-intro::before{display:none}
#conversation.zoom-intro .zoom-tap{position:absolute;inset:0;border:0;background:none;padding:0;cursor:pointer}
#conversation.zoom-intro .conversation-skip{z-index:1}
/* W-177 (#145): an elite's intro, "Tap to skip" under the line; it fades as the camera flies home. W-185 (#164): it is a
   speech bubble on the board, not the dialogue box at its foot: the elite's name, the line typing in, the tail on the
   elite (main.js placeEliteBubble moves it each frame, and sets the tail's side and place, --tail). */
#conversation.elite-intro .elite-bubble{position:absolute;left:0;top:0;z-index:1;width:max-content;max-width:min(76vw,300px);padding:8px 13px 7px;
  border-radius:12px;border:2px solid #716043;background:var(--paper,#ebdfbd) url('/assets/ui/parchment.svg') center/100% 100%;color:var(--ink,#302f25);
  box-shadow:0 6px 18px #10160a99;pointer-events:none;transition:opacity .25s ease;--tail:50%}
#game:is([data-era="2"],[data-era="3"],[data-era="4"]) #conversation.elite-intro .elite-bubble{background:var(--paper) var(--era-paper) center/100% 100%;border-color:var(--era-edge,#716043)}
.elite-bubble-name{display:block;font-size:var(--fs-xs);font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:#7a5a2a;margin-bottom:2px}
#conversation.elite-intro .elite-bubble .conversation-line{min-height:0;margin:0;font-size:var(--fs-lg);line-height:1.3;font-weight:600}
#conversation.elite-intro .elite-bubble .conversation-hint{display:block;margin-top:3px;text-align:right;font-size:var(--fs-xs);opacity:.7}
/* The tail: a border triangle and its fill, on the side main.js names (down: under the bubble; left or right: beside it). */
.elite-bubble::before,.elite-bubble::after{content:'';position:absolute;width:0;height:0;border:solid transparent}
.elite-bubble[data-side="down"]::before{left:var(--tail);top:100%;transform:translateX(-50%);border-width:12px 9px 0;border-top-color:#716043}
.elite-bubble[data-side="down"]::after{left:var(--tail);top:calc(100% - 3px);transform:translateX(-50%);border-width:10px 7px 0;border-top-color:var(--paper,#ebdfbd)}
.elite-bubble[data-side="left"]::before{top:var(--tail);right:100%;transform:translateY(-50%);border-width:9px 12px 9px 0;border-right-color:#716043}
.elite-bubble[data-side="left"]::after{top:var(--tail);right:calc(100% - 3px);transform:translateY(-50%);border-width:7px 10px 7px 0;border-right-color:var(--paper,#ebdfbd)}
.elite-bubble[data-side="right"]::before{top:var(--tail);left:100%;transform:translateY(-50%);border-width:9px 0 9px 12px;border-left-color:#716043}
.elite-bubble[data-side="right"]::after{top:var(--tail);left:calc(100% - 3px);transform:translateY(-50%);border-width:7px 0 7px 10px;border-left-color:var(--paper,#ebdfbd)}
#game:is([data-era="2"],[data-era="3"],[data-era="4"]) .elite-bubble::before{border-color:transparent}
#game:is([data-era="2"],[data-era="3"],[data-era="4"]) .elite-bubble[data-side="down"]::before{border-top-color:var(--era-edge,#716043)}
#game:is([data-era="2"],[data-era="3"],[data-era="4"]) .elite-bubble[data-side="left"]::before{border-right-color:var(--era-edge,#716043)}
#game:is([data-era="2"],[data-era="3"],[data-era="4"]) .elite-bubble[data-side="right"]::before{border-left-color:var(--era-edge,#716043)}
#conversation.elite-intro .elite-bubble>*{animation:elite-say .3s ease-out}
#conversation.elite-intro:not(.speaking) .elite-bubble{visibility:hidden}/* while the camera flies in */
#conversation.elite-intro.landing .elite-bubble{opacity:0}
@keyframes elite-say{from{opacity:0;transform:translateY(4px)}}
@media(prefers-reduced-motion:reduce){#conversation.elite-intro .elite-bubble>*{animation:none}}
:root[data-motion="reduced"] #conversation.elite-intro .elite-bubble>*{animation:none}
#boss-say q{display:block;font-size:var(--fs-sm);line-height:1.3;quotes:'“' '”'}
#boss-say.show{visibility:visible;opacity:1;animation:boss-say .22s ease-out}
@keyframes boss-say{from{transform:translateY(-5px) scale(.96)}to{transform:none}}
#opponent.speaking .enemy-pennant>img{filter:drop-shadow(0 0 4px #f2cf86)}
@media(prefers-reduced-motion:reduce){#boss-say.show{animation:none;opacity:1}}
/* W-169 (#98), the new screen (?screen=v19): the designer: "The character portraits/title cards that sits Currently in the top
   right of the board can be moved to the top left of the screen, currently the only thing that is there is the era
   numeral". The pennant and its wave seal become a chip in the HUD's empty left (the pennant moved to #game, main.js),
   36 px tall inside its 44; it still opens the intel, and the boss's lines still come from it (under its edge). */
/* the designer (2026-10-31, on the first look): "drop the Era 1 Symbol altogether. We need the room for the boss card" */
#game[data-screen="v19"] #hud .era-mark{display:none}
#game[data-screen="v19"]>#opponent{position:absolute;top:calc(var(--safe-top,env(safe-area-inset-top,0px)) + 4px);left:7px;right:auto;max-width:calc(100% - 290px);z-index:5;gap:4px}
#game[data-screen="v19"]>#opponent .enemy-pennant{min-height:36px;height:36px;max-width:none;min-width:0;flex:1 1 auto;overflow:hidden;padding:0 9px 2px 3px;gap:4px}
#game[data-screen="v19"]>#opponent .enemy-pennant>img{width:28px;height:33px}
#game[data-screen="v19"]>#opponent .enemy-pennant>span{min-width:0}
#game[data-screen="v19"]>#opponent .enemy-pennant strong{font-size:var(--fs-xs);line-height:1.12;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
/* the wave's state is on the seal and the Wave button; the chip keeps the name (two lines on a phone) */
#game[data-screen="v19"]>#opponent .enemy-pennant small{display:none}
#game[data-screen="v19"]>#opponent .wave-stack{flex-direction:row;gap:3px;align-items:center}
#game[data-screen="v19"]>#opponent .wave-seal{min-width:28px;height:36px;padding:2px 3px 8px}
#game[data-screen="v19"]>#opponent .wave-seal b{font-size:var(--fs-xl)}
#game[data-screen="v19"]>#opponent .wave-chip{display:none}
/* #166 (the designer, v0.20 playtest: "move the wave symbol so that it is right below this menu off to the left side.
   Extra space for the Enemy title card"): the seal hangs just under the HUD bar at the left, over the board's corner,
   and the chip's name takes the width it left (main.js chipRoom). The laptop's docked card keeps its seal beside it (wide.css). */
#game[data-screen="v19"]>#opponent .wave-stack{position:absolute;left:0;top:calc(100% + 8px)}
#game[data-screen="v19"]:not(.in-battle)>#opponent{display:none}
/* the designer (2026-10-31): "boss dialog must be under one line long": every line is written to fit (boss-voice.test's
   budget); the bubble never wraps, and a line that somehow runs long is cut with an ellipsis rather than a second row. */
#game[data-screen="v19"] #boss-say q{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* W-169 (#109): the bubble slides under the boss's bar while the bar rides near the top (main.js placeSay). */
#game[data-screen="v19"] #boss-say{transition:top .18s ease-out}
/* W-169 (#102): the boss bar on the board, over the back wall (main.js placeBar sets left, top and width each frame). */
#game[data-screen="v19"] #board-wrap>#boss-status{right:auto;max-width:none;margin:0;transform:none;z-index:3}
/* the designer (2026-10-31, on the first try): "there is way too much helper text. And back ground. Its [not] intergraded
   the way I am hoping": on the board the bar is the boss's name, its health and the track, no panel, no notes, no
   "Next:" line (what comes next is on the board: the Hut's door ring fills to its next gang, hut-view.js). */
#game[data-screen="v19"] #boss-status .boss-bar{background:none;border:0;box-shadow:none;padding:0 2px;backdrop-filter:none;-webkit-backdrop-filter:none}
#game[data-screen="v19"] #boss-status .boss-bar>small,#game[data-screen="v19"] #boss-status .boss-extra{display:none}
#game[data-screen="v19"] #boss-status .boss-bar>div:first-child{text-shadow:0 1px 2px #000,0 0 6px #000c}
#game[data-screen="v19"] #boss-status .boss-track{box-shadow:0 1px 3px #000a}
/* W-116 call 22: the bar sits under the wave seal's Boss chip and clear of the camera buttons; a flying boss (its lane
   drawn on the board) gets a red bar that reads like a boss bar. */
.boss-bar.flyer-boss{border-left-color:#e0523c}
.flyer-boss .boss-track{height:7px}
.flyer-boss .boss-track i{background:#e0523c}
/* W-126: a set-piece boss's notches (at ⅔ and ⅓); one it has passed dims */
.boss-track b.notch{top:-3px;height:calc(100% + 6px);width:2px;margin-left:-1px;background:#f2d194;box-shadow:0 0 0 1px #1c241d}
.boss-track b.notch.passed{opacity:.4}
/* W-165 (#93), shared change 5: a bar as bricks (brick-bar.js) in the track's place, the next to go pulsing, the notches
   gold seams, and in his walk the worn brick larger and cracking.
   W-177 (#143), the designer (2026-11-01): "I don't think people will get that its a wall and bricks". So it is drawn as
   a wall of his grey dressed stone: taller courses set in dark mortar joints, each brick lit at its top-left and shaded at
   its bottom-right with a little shade of its own, half bricks at the bond's ends (brick-bar.js), and a knocked-out brick
   a dark hole in the wall. Sized from the bar's width (10½ bricks a course); 10 px courses over the board, 6 px in the
   phone's strip. */
.boss-bricks{display:flex;flex-direction:column;gap:1px;padding:1px;margin:4px 0 2px;background:#2f2924;border-radius:2px;box-shadow:0 1px 0 #00000059,0 0 0 1px #1b1714;--brick-h:10px}
.boss-bricks>.course{display:flex;gap:1px;height:var(--brick-h)}
.boss-bricks>.seam{flex:none;height:2px;margin:-1px 0;background:linear-gradient(#5a3a08 50%,#d9a84a 50%)}/* gate 7: a dark line over the gold, so the seam reads in grey (the gold alone had the bricks' value) */
.boss-bricks>.seam.passed{opacity:.5}
.boss-bricks i{flex:0 0 calc((100% - var(--n) * 1px) / (var(--n) + .5));display:block;position:relative;box-sizing:border-box;border-radius:1px;background:linear-gradient(#b4b6ba,#9ea1a7 45%,#8b8e94);box-shadow:inset 1px 1px 0 #d6d8dba6,inset -1px -1px 0 #5f6268}
.boss-bricks i.half{flex-basis:calc((100% - var(--n) * 1px) / (2 * var(--n) + 1))}
.boss-bricks>.course>i:nth-child(3n+2){filter:brightness(.92)}
.boss-bricks>.course>i:nth-child(4n+1){filter:brightness(1.05)}
.boss-bricks>.course>i:nth-child(7n+4){filter:brightness(.86) sepia(.12)}
.boss-bricks i.out{background:#16130f;box-shadow:inset 1px 2px 2px #000,inset -1px -1px 0 #4a4238;filter:none}
.boss-bricks i.seam{border-left:2px solid #d9a84a}
.boss-bricks i.seam.passed{border-left-color:#d9a84a80}
.boss-bricks i.preview{animation:brick-preview .9s ease-in-out infinite}
@keyframes brick-preview{50%{background:#ffe08a;box-shadow:inset 0 0 0 1px #b07a12,0 0 3px #ffd36a}}/* a warm flash, never the hollow look */
@media(prefers-reduced-motion:reduce){.boss-bricks i.preview{animation:none;outline:1px solid #ffcf5a;outline-offset:-1px;background:#d8c99a}}
.boss-bricks i.current{transform:scale(1.12,1.4);z-index:1;box-shadow:inset 1px 1px 0 #d6d8dba6,inset -1px -1px 0 #5f6268,0 0 0 1px #2d2b27}
.boss-bricks i.crack1::after,.boss-bricks i.crack2::after{content:'';position:absolute;inset:0;background:linear-gradient(115deg,transparent 42%,#3a3834 42% 56%,transparent 56%)}
.boss-bricks i.crack2::after{background:linear-gradient(115deg,transparent 42%,#3a3834 42% 56%,transparent 56%),linear-gradient(60deg,transparent 18%,#3a3834 18% 30%,transparent 30%)}
.boss-bar.brick-bar>div:first-child{align-items:center}
.boss-bar.brick-bar>div:first-child>.boss-extra{flex:none;flex-wrap:nowrap;margin:0 0 0 auto}
#hud-strip .boss-bricks{--brick-h:6px;margin:1px 0}
#hud-strip .boss-bar.brick-bar small{display:block;white-space:nowrap;-webkit-line-clamp:none;overflow:hidden;text-overflow:ellipsis}
/* W-165 (#93) critic round 1, note 7: beside the Keystone's bar (126 px each in a phone's strip) his name and his chip's
   two shapes fill the title row, so his chip's ▦ count gives way there and the chip sits closer (his name whole). */
#hud-strip .boss-bar.brick-bar{container-type:inline-size}
@container (max-width:160px){.mason-chip .mason-count{display:none}.mason-chip{margin-left:0!important;padding:0 2px!important;gap:1px!important}.mason-chip svg{width:13px;height:10px}
  .boss-bar.brick-bar>div:first-child{gap:4px}}
/* …critic round 2, note 3: and there his note shows the ▦ count in place of "2 stones a turn" (his chip's two shapes say
   it): "8/30 · ▦ 28" (his note's `mason-back`, hidden in a wider bar, where his chip shows it) */
.boss-bar.brick-bar .mason-back{display:none}
@container (max-width:160px){.boss-bar.brick-bar .mason-turns{display:none}.boss-bar.brick-bar .mason-back{display:inline}}
/* W-165 (#93), the designer's notes after playing (10-26: every line waits for Send wave): his note's " · ×N at Send"
   (`mason-send`, the bricks your Send knocks out now) in gold and bold, the multiplier read where his bar is; beside the
   Keystone's bar (160 px or narrower: only in the wave the Keystone comes) it gives way, as his turns' words do, and
   "8/30 · ▦ 28" reads as before (the board's plate on its foot rim still says it) */
.boss-bar.brick-bar .mason-send{color:#ffd54a;font-weight:800}
@container (max-width:160px){.boss-bar.brick-bar .mason-send{display:none}}
/* W-165 (#93) gate 7 (critic round 1, note 9): on a laptop his bar floats over the board, about 240 px, its title row his
   name, his chip (two shapes and ▦ past ⅔) and "19 / 30 bricks", and his name gave way ("Old M…"). It is a container
   there too: under 280 px the count's word gives way (the grid says bricks, as the strip's count does: call 7); under
   200 px (the Keystone's bar beside it) the count moves into the note, as in the phone's strip. */
.boss-bar.brick-bar{container-type:inline-size}
@container (max-width:279px){.boss-bar.brick-bar .brick-word{display:none}}
@container (max-width:200px){.boss-bar.brick-bar>div:first-child>span{display:none}.boss-bar.brick-bar .boss-hp{display:inline}}
/* … and on a laptop beside the Keystone's bar (at 1280 × 800 the bars over the board share 240 px: 117 each), both bars
   in his fight take the phone strip's way: their numbers in the note, the strip's padding and its 10 px note, so neither
   name gives way ("Old Mo…", "The…" before). */
#board-wrap>#boss-status:has(>.brick-bar+.boss-bar,>.boss-bar+.brick-bar)>.boss-bar{padding:4px 6px;border-left-width:3px}
#board-wrap>#boss-status:has(>.brick-bar+.boss-bar,>.boss-bar+.brick-bar)>.boss-bar>div:first-child>span{display:none}
#board-wrap>#boss-status:has(>.brick-bar+.boss-bar,>.boss-bar+.brick-bar)>.boss-bar .boss-hp{display:inline}
#board-wrap>#boss-status:has(>.brick-bar+.boss-bar,>.boss-bar+.brick-bar)>.boss-bar small{font-size:10px}
#board-wrap>#boss-status:has(>.brick-bar+.boss-bar,>.boss-bar+.brick-bar)>.brick-bar{flex-grow:1.2}/* his note's line the longer */
/* W-165 (#93), shared change 6: a picture flying between the board and the screen (board-flight.js), over everything */
.board-flight{position:fixed;left:0;top:0;z-index:1000;pointer-events:none;will-change:transform,opacity;transform-origin:50% 50%}
.board-flight>*{display:block;width:100%;height:100%}
.flyer-boss small{font-weight:700}

@media(min-width:600px){body{padding:12px}
#game{height:calc(100dvh - 24px);width:min(480px,calc((100dvh - 24px)*.51))}
}

@media(max-height:740px){#hud{height:40px}
#hand{height:96px}
.card :is(img,.piece-art){height:43px}
#actions{height:51px}
#inspector{min-height:59px;padding-block:5px}
.mini-art{width:34px;height:39px}
#inspector p{font-size:var(--fs-xs)}
.enemy-pennant{min-height:39px}
.enemy-pennant>img{height:36px}
.enemy-pennant strong{font-size:var(--fs-xs)}
.enemy-pennant small{font-size:var(--fs-xs)}
.wave-seal{height:39px}
.sheet-heading{min-height:55px}
.sheet-heading>img{height:53px;width:57px}
.journey-map{height:454px;gap:7px}
.map-row{height:58px}
.map-portrait{height:49px}
.chart-hint{margin-bottom:8px}
.offer{min-height:95px}
#screen{padding:10px}
}

@media(max-width:350px){#hud{gap:3px;padding-inline:4px}
.resources{gap:6px;font-size:var(--fs-base)}
.resources .ui-icon{width:16px}
.rail-button{min-width:33px}
.era-mark{gap:0}
.era-mark .ui-icon{width:21px}
.card-name{font-size:var(--fs-xs)}
#hand{padding-inline:4px;gap:3px}
.sheet-heading h1{font-size:var(--fs-3xl)}
.offer{padding:8px;gap:5px}
.offer-art{width:52px}
.offer p{font-size:var(--fs-xs)}
.price{min-width:23px}
.run-card :is(img,.piece-art){width:36px}
.run-card strong{font-size:var(--fs-xs)}
.node-title{font-size:9px}
.map-portrait{width:32px}
.node{gap:3px}
.chart-title span{font-size:8px}
}

@media(prefers-reduced-motion:reduce){.card.dealt{animation:none}
.card,#toast{transition:none}
}


#game:is([data-phase="map"],[data-phase="start"]) #screen{display:flex;flex-direction:column}
.journey-map{flex:1;min-height:454px;height:auto}
.map-row{flex:1;height:auto;min-height:58px}
.map-portrait{height:clamp(49px,7.8dvh,69px)}


.run-cards.detailed{grid-template-columns:1fr}
.detailed .run-card{align-items:flex-start;padding:8px;gap:8px}
.detailed .run-card :is(img,.piece-art){width:54px;height:65px}
.detailed .run-card>div{flex:1}
.detailed .run-card strong{font-size:var(--fs-base);display:flex;justify-content:space-between;align-items:center}
.detailed .run-card small{font-size:var(--fs-xs)}
.detailed .run-card p{font-size:var(--fs-sm);line-height:1.45;margin-top:6px;color:#4d563d}
.detailed .learned-effect{border-top:1px solid #a6976c66;padding-top:5px}
.learned-effect b{display:block;font-size:var(--fs-xs);color:#59643f}
.deck-cost{display:flex;align-items:center;font-size:var(--fs-sm);color:#406f7a}
.deck-cost .ui-icon{width:15px;height:15px}


.site-vignette{display:flex;justify-content:center;align-items:center;height:clamp(140px,25dvh,215px);margin:-12px 0 10px}
.site-vignette img{height:100%;width:100%;object-fit:contain}
.site-vignette+.site-note{text-align:center;margin-bottom:16px}

/* Each era uses a material kit cut to the same compact board footprint. */
body[data-era="2"]{background:#202b2c}body[data-era="3"]{background:#091820}body[data-era="4"]{background:#1b2b40}
#game[data-era="2"]{--ink:#303d3b;--muted:#606d66;--paper:#c4c6b3;--era-edge:#ad8d53;--era-light:#e1d2a7;--era-rail:url('/assets/ui/e2-rail.svg');--era-paper:url('/assets/ui/e2-paper.svg');--era-card:url('/assets/ui/e2-card.svg');--era-button:url('/assets/ui/e2-button.svg');--era-pennant:url('/assets/ui/e2-pennant.svg');--era-tray:#293637;border-color:#776842}
#game[data-era="3"]{--ink:#e3ece0;--muted:#a5c1bb;--paper:#193c46;--era-edge:#416c73;--era-light:#d9eada;--era-rail:url('/assets/ui/e3-rail.svg');--era-paper:url('/assets/ui/e3-paper.svg');--era-card:url('/assets/ui/e3-card.svg');--era-button:url('/assets/ui/e3-button.svg');--era-pennant:url('/assets/ui/e3-pennant.svg');--era-tray:#132c38;border-color:#345c68}
#game[data-era="4"]{--ink:#293e51;--muted:#52697b;--paper:#d7e2df;--era-edge:#8aabb4;--era-light:#263d54;--era-rail:url('/assets/ui/e4-rail.svg');--era-paper:url('/assets/ui/e4-paper.svg');--era-card:url('/assets/ui/e4-card.svg');--era-button:url('/assets/ui/e4-button.svg');--era-pennant:url('/assets/ui/e4-pennant.svg');--era-tray:#30465b;border-color:#b3c6ca}
#game:is([data-era="2"],[data-era="3"],[data-era="4"]){background-image:var(--era-rail);color:var(--ink)}
#game:is([data-era="2"],[data-era="3"],[data-era="4"]) :is(#screen,#inspector,dialog,#toast){background:var(--paper) var(--era-paper) center/100% 100%;border-color:var(--era-edge);color:var(--ink)}
/* W-121 W-020/W-035: a tall panel doesn't stretch the era paper (its frame rule landed in the heading): the plate is drawn
   at its own 120 px height at the top and at the bottom, plain paper covers each plate's inner half (the other edge's
   rule and studs), and the side rules carry on between them. W-047: the sheets too, on a phone as on a laptop (their rule crossed Route taken and a reward row). */
#game:is([data-era="2"],[data-era="3"],[data-era="4"]){--panel-paper:linear-gradient(90deg,#0000 calc(3.75% - .5px),var(--era-line) 0 calc(3.75% + .5px),#0000 0 calc(96.25% - .5px),var(--era-line) 0 calc(96.25% + .5px),#0000 0) 0 60px/100% calc(100% - 120px) no-repeat,linear-gradient(var(--paper),var(--paper)) 0 60px/100% calc(100% - 120px) no-repeat,var(--era-paper) top/100% 120px no-repeat,var(--era-paper) bottom/100% 120px no-repeat,var(--paper)}/* W-158 (#78): the era's panel paper, named so the laptop's see-through layers (wide.css) can wear it too */
#game:is([data-era="2"],[data-era="3"],[data-era="4"]) :is(.side-panel,#screen:not([data-view="map"],[data-view="start"])){background:var(--panel-paper);border-color:var(--era-edge)}
#game[data-era="2"]{--era-line:#ae8c4a73}#game[data-era="3"]{--era-line:#497c8273}#game[data-era="4"]{--era-line:#809ba873}
#game:is([data-era="2"],[data-era="3"],[data-era="4"]) :is(.card,.offer){background-image:var(--era-card);color:var(--ink)}
#game:is([data-era="2"],[data-era="3"],[data-era="4"]) #hand{background-image:var(--era-rail);border-color:var(--era-edge)}
#game:is([data-era="2"],[data-era="3"],[data-era="4"]) #hud{color:var(--era-light);border-color:var(--era-edge)}
#game:is([data-era="2"],[data-era="3"],[data-era="4"]) #actions{background:var(--era-tray);border-color:var(--era-edge)}
/* W-109: the era versions of the main and secondary buttons (see .primary). */
#game[data-era="2"]{--b1-face:linear-gradient(#4b5455,#373e3f 48%,#2a3031);--b1-rim:#b8954f;--b1-edge:#151819;--b1-ink:#f2e2b6;--b1-rivet:#d9b875;--b1-radius:3px;--b2-face:linear-gradient(#d6d8c9,#bfc2ae);--b2-rim:#a3844d;--b2-ink:#2c3837;--b2-radius:3px}
#game[data-era="3"]{--b1-face:linear-gradient(#17404d,#102a35 55%,#0a1c24);--b1-rim:#4fb9bf;--b1-edge:#041015;--b1-ink:#e0f8f4;--b1-rivet:#0000;--b1-glow:#4fb9bf40;--b1-accent:#e74394;--b1-radius:2px;--b2-face:linear-gradient(#1f4b57,#163945);--b2-rim:#3f9097;--b2-ink:#e3ece0;--b2-radius:2px}
#game[data-era="4"]{--b1-face:linear-gradient(#f7fafa,#d8e3e5 55%,#bfd0d5);--b1-rim:#8aabb4;--b1-edge:#5f7c8a;--b1-ink:#233a50;--b1-rivet:#0000;--b1-accent:#a18bcb;--b1-accent-inset:70px;--b1-radius:999px;--b2-face:linear-gradient(#ffffff,#e4ecea);--b2-rim:#8aabb4;--b2-ink:#293e51;--b2-radius:999px}
#game[data-era="4"] .primary{text-shadow:0 1px 0 #ffffffb3}
#game:is([data-era="2"],[data-era="3"],[data-era="4"]) :is(.enemy-pennant,.result-banner){background-image:var(--era-pennant);color:var(--era-light)}
#game:is([data-era="2"],[data-era="3"],[data-era="4"]) .enemy-pennant small{color:inherit;opacity:.85}/* W-121 W-045: Era I's peach was ~1.6:1 on Era IV's pale pennant */
#game:is([data-era="2"],[data-era="3"],[data-era="4"]) :is(h1,h2,h3,.card-name,.run-card strong,.result-stats strong,.node,.card-cost){color:var(--ink)}
#game:is([data-era="2"],[data-era="3"],[data-era="4"]) :is(.sheet-heading p,.offer p,.offer small,.card-kind,#inspector p,.tech-choices p,.run-card small,.route-record,.chart-title span,.chart-hint,.node-label,.site-note,.collection-heading>span,.result-stats small,.back,.tech-owner small,.battle-receipt,.intel-intent,.intel-unit p,.unit-stats){color:var(--muted)}
#game:is([data-era="2"],[data-era="3"],[data-era="4"]) :is(.node,.tech-choices button,.run-card){background:var(--era-card) center/100% 100%;border-color:var(--era-edge)}
#game:is([data-era="2"],[data-era="3"],[data-era="4"]) .node.active{box-shadow:inset 0 0 0 2px var(--era-edge),0 3px 0 #05141940;filter:brightness(1.12)}
#game[data-era="3"] :is(.cost,.tech-cost,.mana-price,.target-choice){color:#8cdae0}#game[data-era="3"] .price{color:#e5ca75}#game[data-era="3"] .small-button{border-color:#5b8c8c;background:#38616b}
#game[data-era="4"] .health-counter{color:#8b343e}#game[data-era="4"] .era-mark{color:#5d517f}
.era-route{display:flex;align-items:center;gap:4px;margin:13px 0 8px}
.era-route span{flex:1;text-align:center;border-bottom:3px solid #7d8e7c40;padding:4px;font-size:var(--fs-xs);color:var(--muted)}
.era-route .crossed{border-color:#608e70}.era-route .current{border-color:#c19853;color:var(--ink);font-weight:800}
.era-crossing{text-align:center}.era-crossing h1{font-size:31px;margin:20px 0 4px}.era-crossing>p{font-size:12px;color:var(--muted)}
.crossing-city{width:100%;height:220px;object-fit:contain}.crossing-lineage{display:flex;align-items:center;justify-content:center;gap:12px}.crossing-lineage figure{margin:0}.crossing-lineage img{width:100px;height:100px;object-fit:contain}.crossing-lineage figcaption{font-size:9px;color:var(--muted)}
.era-crossing .crossing-note{line-height:1.5;margin:20px 8px}.era-crossing .primary{margin-top:4px}
.enemy-pennant>img{width:38px;height:38px;object-fit:cover;border-radius:2px;margin:3px 0 2px}.map-portrait.opposing>img{width:100%;height:100%;margin:0;object-fit:cover}
.card.static{opacity:.65;filter:saturate(.3)}
.card.curse{filter:saturate(.35) contrast(1.1)}
.event-choice em{display:block;font-style:normal;color:#8a5a4a;margin-top:3px}
.pick-list .run-card{width:100%;border:1px solid #aa97684d;text-align:left;cursor:pointer;min-height:84px}
.pick-list .run-card:hover{outline:2px solid #728b61;outline-offset:-2px}
.pick-list .run-card p{font-size:var(--fs-xs);line-height:1.35;color:#5b654f;margin-top:3px}
@media(max-height:740px){.crossing-city{height:160px}.crossing-lineage img{width:80px;height:80px}.era-crossing h1{margin-top:12px}.era-crossing .crossing-note{margin:12px 8px}}


#game:is([data-era="2"],[data-era="3"],[data-era="4"]) .boss-bar{background:var(--era-rail) center/100% 100%;border-color:var(--era-edge);color:var(--era-light)}
#game:is([data-era="2"],[data-era="3"],[data-era="4"]) .boss-bar.flyer-boss{border-left-color:#e0523c}
#game:is([data-era="2"],[data-era="3"],[data-era="4"]) .boss-bar small{color:var(--era-light);opacity:.8}

#game:is([data-era="2"],[data-era="3"],[data-era="4"]) .result-banner :is(h1,p){color:var(--era-light)}/* W-121 W-021: the title too, on the dark pennant */

.opponent-quote{font-size:var(--fs-xs);line-height:1.4;font-style:italic;margin:0 0 10px;color:var(--ink)}
#game:is([data-era="2"],[data-era="3"],[data-era="4"]) .intel-unit{background:var(--era-card) center/100% 100%;border-color:var(--era-edge)}


/* Portrait card pass: frame the piece, reserve readable labels, use the whole tray. */
.piece-art{display:block;flex-shrink:0;overflow:hidden}
#game{--card-focus:#497985;--art-well:#af996926}
#game[data-era="2"]{--card-focus:#725520;--art-well:#75887b2b}
#game[data-era="3"]{--card-focus:#88e2df;--art-well:#06192155}
#game[data-era="4"]{--card-focus:#4b648c;--art-well:#718db52b}
#hand{height:clamp(138px,19dvh,174px);padding:7px 6px 5px;gap:5px;justify-content:center;overflow-y:hidden;scrollbar-width:none}
.card{flex:1 0 0;min-width:62px;max-width:180px;padding:7px 5px 14px;isolation:isolate}
.card::before{content:'';position:absolute;inset:7px 6px 49px;background:var(--art-well);clip-path:polygon(8% 0,92% 0,100% 9%,100% 100%,0 100%,0 9%);z-index:-1}
.card>.piece-art{width:100%;height:0;min-height:0;flex:1 1 0;margin:14px 0 5px;filter:drop-shadow(0 3px 2px #101a1825)}
.card-cost{top:5px;left:4px;width:27px;height:30px;font-size:var(--fs-2xl);color:#173747!important}
.card-cost .ui-icon{width:27px;height:30px;color:#afd3d8}
.card-name{font-size:var(--fs-sm);line-height:1.12;min-height:2.24em;display:flex;align-items:center;justify-content:center;margin:0;overflow-wrap:normal}
.card-kind{font-size:var(--fs-xs);line-height:1.1;margin-top:4px;min-height:11px;letter-spacing:0;text-transform:none;font-weight:600}
.card.selected{translate:0 -3px;outline:3px solid var(--card-focus);outline-offset:-3px;filter:drop-shadow(0 4px 3px #101a1866)}
.card.unaffordable{opacity:1;filter:none}
.card.unaffordable .card-cost{color:#834531!important}
.card.unaffordable .card-cost .ui-icon{color:#d5b99b}
.card.rare:after,.card.uncommon:after{width:7px;height:7px;right:8px;top:8px}
#hand[data-count="0"]{height:0;padding:0;border:0}
#hand[data-count="1"] .card,#hand[data-count="2"] .card,#hand[data-count="3"] .card{max-width:180px}
#hand[data-count="1"] .card-name,#hand[data-count="2"] .card-name,#hand[data-count="3"] .card-name{font-size:var(--fs-md)}
#actions{height:61px;gap:7px;padding:5px 7px}
#actions .rail-button{min-width:44px;height:44px}
#actions .redraw{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0;padding:2px 4px;line-height:1}
#actions .redraw>.ui-icon{width:18px;height:18px}
#actions .redraw small{display:flex;align-items:center;gap:1px;font-size:var(--fs-xs);font-weight:700}
#actions .redraw small .ui-icon{width:10px;height:11px}
#actions .redraw:disabled{opacity:.4}
#actions .piles{min-width:38px;min-height:44px;font-size:var(--fs-sm)}
#actions .piles .ui-icon{width:18px;height:18px}
#actions .mana strong{font-size:var(--fs-5xl)}
#actions .mana small{font-size:var(--fs-sm)}
#end-turn{min-height:46px;font-size:var(--fs-xl)}
/* The inspector is for reading. No tiny duplicate illustration beside the hand. */
#inspector{padding:10px 10px 9px;gap:8px;max-height:32dvh;overflow:auto}
#inspector>.mini-art{display:none}
#inspector h3{font-size:var(--fs-lg)}
#inspector p{font-size:var(--fs-sm);line-height:1.4}
#inspector .subtle{min-width:40px;min-height:40px}
#inspector .small-button{min-height:44px;font-size:var(--fs-base);padding:8px}
.target-choice{min-height:38px;font-size:var(--fs-sm)}
#screen[data-view="reward"]{display:flex;flex-direction:column;padding:12px;gap:0}
#screen[data-view="reward"] .sheet-heading{min-height:64px;padding-bottom:9px;margin-bottom:5px;gap:10px}
#screen[data-view="reward"] .sheet-heading>img{width:60px;height:60px;object-fit:cover}
#screen[data-view="reward"] .sheet-heading h1{font-size:var(--fs-5xl)}
#screen[data-view="reward"] .sheet-heading p{font-size:var(--fs-base)}
#screen[data-view="reward"] .battle-receipt{font-size:var(--fs-sm);padding:6px 0 12px;gap:4px}
#screen[data-view="reward"] .reward-list{flex:1;gap:10px;min-height:min-content}
#screen[data-view="reward"] .offer{flex:1;min-height:158px;padding:15px 12px;gap:12px}
#screen[data-view="reward"] .offer-art{width:32%;height:122px;max-height:100%;filter:drop-shadow(0 4px 3px #18232a25)}
#screen[data-view="reward"] .offer>div{align-self:center;padding-right:4px}
#screen[data-view="reward"] .offer h3{font-size:var(--fs-3xl);line-height:1.12;margin:0 0 8px}
#screen[data-view="reward"] .offer small{font-size:var(--fs-xs);margin:0 0 6px;letter-spacing:.035em}
#screen[data-view="reward"] .offer p{font-size:var(--fs-base);line-height:1.4}
#screen[data-view="reward"] .price,#screen[data-view="reward"] .offer-mark{position:absolute;top:12px;left:12px;font-size:var(--fs-lg);min-width:28px;margin:0;background:var(--paper);border-radius:4px;flex-direction:row;gap:2px}
#screen[data-view="reward"] .price .ui-icon{width:18px;height:22px}
#screen[data-view="reward"] .offer-mark{width:26px;height:26px;padding:3px}
/* D-107 boss spoils: each tower offer lists its two branches so the theme reads on the reward screen. */
.offer-branches{list-style:none;margin:8px 0 0;padding:8px 0 0;border-top:1px solid #b8ad8c66;display:grid;gap:5px}
.offer-branches li{font-size:var(--fs-xs);line-height:1.35;color:#5b654f}
.offer-branches b{display:block;font-size:var(--fs-xs);color:#344;letter-spacing:.01em}
#game:is([data-era="2"],[data-era="3"],[data-era="4"]) :is(.offer-branches li,.offer-branches b){color:inherit}
#screen[data-view="reward"] .offer:has(.offer-branches){flex:1 0 auto;padding-top:22px;padding-bottom:22px}
.offer.fixed{outline:2px solid #7d5f2a;outline-offset:-5px}
.shop-list .offer{padding:12px;gap:12px;min-height:116px}
.shop-list .offer-art{width:82px;height:94px}
.shop-list .offer h3{font-size:var(--fs-2xl)}
.shop-list .offer p{font-size:var(--fs-base)}
.shop-list .offer small{font-size:var(--fs-xs)}
.run-card>.piece-art{width:58px;height:64px}
.detailed .run-card>.piece-art{width:76px;height:90px}
.detailed .run-card{padding:12px;gap:12px}
.detailed .run-card strong{font-size:var(--fs-xl)}
.detailed .run-card p{font-size:var(--fs-base)}
@media(max-height:700px){
 #hand{height:138px}
 #inspector{padding:7px 9px}
 #screen[data-view="reward"]{padding:8px}
 #screen[data-view="reward"] .offer{min-height:148px;padding:11px;gap:9px}
 #screen[data-view="reward"] .offer-art{height:108px;width:29%}
 #screen[data-view="reward"] .offer h3{font-size:var(--fs-2xl)}
}
@media(max-width:350px){
 #hand{gap:3px;padding-inline:4px}
 .card{min-width:56px;padding-inline:4px}
 .card-name{font-size:var(--fs-xs)}
 .card-kind{font-size:var(--fs-xs)}
 #actions{gap:3px;padding-inline:4px}
 #actions .mana>.ui-icon{width:22px}
 #end-turn{min-width:78px;font-size:var(--fs-md)}
 #screen[data-view="reward"] .offer h3{font-size:var(--fs-2xl)}
 #screen[data-view="reward"] .offer p{font-size:var(--fs-sm)}
}

#hand:is([data-count="1"],[data-count="2"],[data-count="3"]) .card-name{min-height:1.2em}
#hand:is([data-count="1"],[data-count="2"],[data-count="3"]) .card>.piece-art{margin-top:8px}
.tech-owner>.piece-art{width:44px;height:48px}
.tech-choices .piece-art{width:76px;height:84px}
.tech-choices button{padding:10px;gap:12px}
.tech-choices h3{font-size:var(--fs-lg)}
.tech-choices p{font-size:var(--fs-base)}
.tech-cost{font-size:var(--fs-sm)}

/* Readable planning panel: separate values, coverage and effects. */
#game #inspector{display:block;padding:10px 12px;max-height:35dvh;overflow-y:auto}
#game #inspector h3{font-size:var(--fs-3xl);line-height:1.2;padding-right:38px;margin-bottom:6px}
#game #inspector p{font-size:var(--fs-lg);line-height:1.4;color:var(--ink);margin-top:8px}
#game #inspector>.subtle{position:absolute;right:4px;top:3px;min-width:44px;min-height:44px}
#inspector .combat-stats{display:grid;grid-template-columns:1fr 1fr 1.15fr;gap:6px;margin:0 0 10px}
.combat-stats>div{padding:5px 7px;background:#6f806514;border-left:2px solid var(--era-edge,#ac9560)}
.combat-stats dt{font-size:var(--fs-base);line-height:1.2;color:var(--ink)}
.combat-stats dd{font-size:var(--fs-xl);line-height:1.3;font-weight:750;margin:3px 0 0;color:var(--ink)}
.coverage-key{display:flex;align-items:center;flex-wrap:wrap;gap:4px 7px;font-size:var(--fs-md);line-height:1.3}
.coverage-key i{width:16px;height:16px;background:#24b8e0;border:2px solid #e2fcff;outline:1px solid #153e53;flex-shrink:0}
.coverage-key span{font-size:var(--fs-base)}
.inspector-actions{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 8px}
.inspector-actions:empty{display:none}
#game #inspector .target-choice,#game #inspector .small-button{font-size:var(--fs-md);min-height:44px;padding:8px 10px;margin:0;color:var(--ink)}
#game #inspector .target-choice .ui-icon{width:20px;height:20px}
.tower-tech{font-size:var(--fs-md);margin-top:8px;border-top:1px solid #87958360;padding-top:6px}
.tower-tech summary{cursor:pointer;min-height:28px}
@media(max-width:350px){#game #inspector h3{font-size:var(--fs-3xl)}.combat-stats dd{font-size:var(--fs-lg)}.combat-stats>div{padding:5px}}

#battle-view:has(#inspector.inspecting:not(.hidden)) #hand{display:none}

/* The tower tray uses exactly the hand's slot: the battlefield never refits. */
#game{--hand-height:clamp(138px,19dvh,174px)}
#hand{height:var(--hand-height)}
#game #inspector.inspecting{height:var(--hand-height);min-height:0;max-height:none;flex:0 0 var(--hand-height)}
#inspector.inspecting .info{animation:selection-reveal 140ms ease-out}
.spell-hint{font-size:var(--fs-base);margin-left:10px}
.card{touch-action:manipulation}
@keyframes selection-reveal{from{opacity:.4;transform:translateY(3px)}to{opacity:1;transform:none}}
@media(max-height:700px){#game{--hand-height:138px}}
@media(prefers-reduced-motion:reduce){#inspector.inspecting .info{animation:none}}

/* Card details: a small ⓘ above the hand opens an overlay on top of the board. Nothing below moves. */
.info-button{position:absolute;left:8px;bottom:8px;z-index:4;width:44px;height:44px;padding:9px;border:1px solid #c9dbe0aa;border-radius:50%;background:#11252ee6;color:#eaf6f3;display:grid;place-items:center;box-shadow:0 2px 6px #08111480;animation:selection-reveal 140ms ease-out}
.info-button svg{width:26px;height:26px;fill:currentColor}
.info-button:hover{background:#1b3a47}
#board-wrap:has(.info-button:not(.hidden)) #board-caption{left:60px;max-width:calc(100% - 68px)}
#overlay{position:absolute;inset:0;z-index:7;background:#0c161180;touch-action:manipulation;--board-top:44px;--board-bottom:200px}
#overlay .info-card{position:absolute;left:10px;right:10px;bottom:calc(var(--board-bottom) + 10px);max-height:calc(100% - var(--board-top) - var(--board-bottom) - 20px);overflow-y:auto;scrollbar-width:thin;padding:12px 12px 12px;background:var(--paper) url('/assets/ui/parchment.svg') center/100% 100%;border:3px solid #716043;color:var(--ink);box-shadow:0 10px 40px #10160ab0;animation:overlay-reveal 160ms ease-out}
@keyframes overlay-reveal{from{opacity:.4;transform:translateY(10px)}to{opacity:1;transform:none}}
#game:is([data-era="2"],[data-era="3"],[data-era="4"]) #overlay .info-card{background:var(--paper) var(--era-paper) center/100% 100%;border-color:var(--era-edge)}
.info-card .info-close{position:absolute;right:4px;top:4px;min-width:44px;height:44px;color:var(--ink)}
.info-card .info-close .ui-icon{width:22px;height:22px}
/* Hold to peek (designer, 2026-09-26): the eye mirrors the close button; while held, the card and tint fade so the
   board shows the reach now (cyan) and what the upgrade adds (gold), named by the key at the top of the board. */
.info-card .info-peek{position:absolute;left:4px;top:4px;min-width:44px;height:44px;color:var(--ink);touch-action:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.info-card .info-peek .ui-icon{width:22px;height:22px}
.info-card .tower-info{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
#overlay{transition:background-color .15s ease-out}
#overlay .info-card{transition:opacity .15s ease-out}
#overlay.peeking{background:transparent}
#overlay.peeking .info-card{opacity:.08}
#overlay .peek-key{display:none;position:absolute;top:calc(var(--board-top) + 8px);left:50%;transform:translateX(-50%);gap:12px;align-items:center;white-space:nowrap;padding:6px 12px;border-radius:999px;background:#0c1611d9;color:#f4ecd8;font-size:13px;pointer-events:none}
#overlay.peeking .peek-key{display:flex}
#overlay .peek-key span{display:flex;align-items:center;gap:6px}
#overlay .peek-key i{width:13px;height:13px;border-radius:2px}
#overlay .peek-key i.now{background:#1db9e7;box-shadow:inset 0 0 0 2px #c4f7ff}
#overlay .peek-key i.gain{background:#f2b53a4d;box-shadow:inset 0 0 0 2px #ffd36a}
#overlay .peek-key i.lost{background:#1db9e7;box-shadow:inset 0 0 0 2px #ff5a48}
@media(prefers-reduced-motion:reduce){#overlay,#overlay .info-card{transition:none}}
.info-head{display:flex;align-items:center;gap:12px;padding-right:44px;margin-bottom:8px}
.info-head h3{font-size:var(--fs-3xl);line-height:1.15}
.info-head small{display:block;font-size:var(--fs-sm);margin-top:4px;color:var(--muted)}
.info-art{width:64px;height:72px;flex-shrink:0;object-fit:contain;filter:drop-shadow(0 3px 2px #101a1830)}
.info-card>p{font-size:var(--fs-lg);line-height:1.4;color:var(--ink);margin-top:6px}
.info-card .coverage-key{margin-top:8px}
.info-card .combat-stats{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin:4px 0 8px}
.info-card .combat-stats>div{padding:5px 7px;background:#6f806514;border-left:2px solid var(--era-edge,#ac9560)}
.info-card .combat-stats dd small{font-size:var(--fs-xs);font-weight:600;color:var(--muted)}
.info-card .tower-effect{font-size:var(--fs-md);line-height:1.4;margin:8px 0 6px}
.counter-list{margin:6px 0 0;padding:0 0 0 18px;font-size:var(--fs-md);line-height:1.4;color:var(--ink)}
.counter-list li{margin-top:3px}
.info-actions{display:flex;align-items:center;flex-wrap:wrap;gap:8px 10px;margin-top:12px}
.info-actions .primary{min-height:46px;padding:9px 16px}
.info-card .intel-intent{margin:6px 0 8px}
.info-card .opponent-quote{margin:4px 0 6px}
.opponent-art{object-fit:cover;border-radius:3px}
@media(prefers-reduced-motion:reduce){.info-button,#overlay .info-card{animation:none}}
@media(max-height:700px){.info-card .info-head h3{font-size:var(--fs-2xl)}.info-art{width:54px;height:60px}.info-card>p{font-size:var(--fs-md)}}

/* Card type is stable across eras; material frames and rarity gems keep their roles. */
.card[data-kind="tower"]{--type-color:#9c681e;--type-wash:#d6ab5340;--type-paper:#f6df9d;--type-ink:#48300b}
.card[data-kind="spell"]{--type-color:#337e9b;--type-wash:#62c3df40;--type-paper:#c9edf5;--type-ink:#153c4d}
/* W-152 (#52) Tactics (the designer, 2026-10-17: "Orange"): the wave's aimed spells are their own kind (card-kind.js). */
.card[data-kind="tactic"]{--type-color:#d4561a;--type-wash:#f2884640;--type-paper:#fbd8bd;--type-ink:#5c2509}
.card[data-kind="mod"]{--type-color:#86518e;--type-wash:#b987cc40;--type-paper:#ead5ef;--type-ink:#4c2957}
.card[data-kind="curse"],.card[data-kind="static"]{--type-color:#9c4c59;--type-wash:#c8687c40;--type-paper:#edd0d6;--type-ink:#632737}
/* W-165 (#93): the Mason's stone card, in his greys (Era I only, so no neon). */
.card[data-kind="stone"]{--type-color:#9a968e;--type-wash:#9a968e40;--type-paper:#e4e1da;--type-ink:#3a3832}
.card[data-kind]::before{background:var(--type-wash);border-top:4px solid var(--type-color)}
#game #hand .card[data-kind] .card-kind{align-self:stretch;color:var(--type-ink);background:var(--type-paper);border-left:3px solid var(--type-color);padding:3px 1px;font-size:var(--fs-xs);line-height:1.15;min-height:16px;text-transform:capitalize}
.card[data-kind].selected{outline-color:var(--type-color)}
#board-caption:not(:empty){display:block;position:absolute;left:8px;right:8px;bottom:7px;width:fit-content;max-width:calc(100% - 16px);padding:5px 8px;background:#11252eec;border:1px solid #6d9ca4;color:#e9f6f2;font-size:var(--fs-sm);line-height:1.25;pointer-events:none;z-index:3}

/* W-042 shop grid */
.shop-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:6px}
.shop-grid+.primary{margin-top:12px}
/* end W-042 shop grid */

/* ---- D-108 (W-056): deck grid, map dialog, forge, win sequence, era title card ---- */
/* V013-DECK-HAND: in hand is rose, a colour no rarity uses (the uncommon rim is green in every era). */
.deck-legend{display:flex;flex-wrap:wrap;gap:5px 11px;font-size:var(--fs-xs);color:var(--muted);margin:0 0 9px}
.deck-legend span{display:flex;align-items:center;gap:4px}
.deck-legend i{width:10px;height:10px;border-radius:2px;background:var(--state,#8a8a70);display:inline-block}
.state-hand{--state:#c2477a}.state-draw{--state:#3f6f9e}.state-discard{--state:#8a7457}.state-played{--state:#b0812c}.state-exhausted{--state:#7a6a7e}.state-deck{--state:transparent}
#game[data-era="3"] .state-hand{--state:#ff6fb4}#game[data-era="3"] .state-draw{--state:#8fc4ee}#game[data-era="3"] .state-discard{--state:#c9b08a}#game[data-era="3"] .state-played{--state:#f0c66a}#game[data-era="3"] .state-exhausted{--state:#c2b0c6}
.deck-detail{padding:2px 0}
.deck-detail .back{margin-bottom:6px}
.deck-detail>p{font-size:var(--fs-md);line-height:1.45;margin-top:8px;color:var(--ink)}
.deck-detail .learned-effect{border-top:1px solid #a6976c66;padding-top:6px;margin-top:8px;font-size:var(--fs-base);line-height:1.45}

.forge-progress{text-align:center;margin-top:10px}

/* Feel of winning: banner drops, receipt counts up, offers deal in (≤ 1.2 s); reduced motion shows the plain screen. */
.battle-receipt b{font-variant-numeric:tabular-nums;font-size:var(--fs-base);color:var(--ink);margin-right:3px}
.win-title{display:block;font-size:10px;letter-spacing:.09em;text-transform:uppercase;color:#8a5a4a;margin-bottom:3px;font-weight:750}
#game:is([data-era="2"],[data-era="3"],[data-era="4"]) .win-title{color:var(--era-edge)}
/* W-151 (#51) rec 7: the won reward no longer drops its banner and deals its cards one by one over ~1 s; it rises whole
   (.win-sequence, below with the Victory stamp). */
@keyframes banner-drop{from{opacity:0;transform:translateY(-22px)}to{opacity:1;transform:none}}
@keyframes receipt-in{from{opacity:0}to{opacity:1}}

/* Era crossing: a static title card. Fallen boss fades, the numeral and name rise, the palette wipes across. */
.era-card{position:relative;flex:1;min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;overflow:hidden;padding:24px 18px;background:var(--paper);color:var(--ink);isolation:isolate}
.era-card-wipe{position:absolute;inset:0;z-index:0;background:var(--era-from-paper,#ebdfbd);animation:era-wipe .7s 1.35s cubic-bezier(.7,0,.3,1) both;pointer-events:none}
.era-card[data-era-from="1"] .era-card-wipe{--era-from-paper:#ebdfbd}
.era-card[data-era-from="2"] .era-card-wipe{--era-from-paper:#c4c6b3}
.era-card[data-era-from="3"] .era-card-wipe{--era-from-paper:#193c46}
.era-card-fallen{position:relative;z-index:1;display:flex;flex-direction:column;align-items:center;gap:6px;animation:fallen-fade 1s .25s ease-in both;font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);height:0}
.era-card-fallen img{width:112px;height:112px;object-fit:cover;border-radius:50%;border:3px solid var(--era-edge,#a58d61);filter:grayscale(.6)}
.era-card-title{position:relative;z-index:1;margin-top:118px;animation:title-rise .8s .75s cubic-bezier(.2,.8,.2,1) both}
.era-card-numeral{display:block;font-size:13px;letter-spacing:.2em;text-transform:uppercase;color:var(--muted);margin-bottom:6px}
.era-card-title h1{font-size:34px;line-height:1.1}
.era-card-title p{font-size:13px;color:var(--muted);margin-top:6px}
.era-card-city{position:relative;z-index:1;width:100%;max-width:300px;height:170px;object-fit:contain;margin-top:16px;animation:title-rise .8s 1.1s ease-out both}
.era-card-hint{position:relative;z-index:1;display:block;margin-top:18px;font-size:10px;color:var(--muted);line-height:1.4;animation:receipt-in .5s 1.9s both}
.era-card-tap{position:absolute;inset:0;z-index:2;background:transparent;border:0;cursor:pointer}
@keyframes fallen-fade{0%{opacity:1;transform:none}60%{opacity:1}100%{opacity:0;transform:translateY(-12px) scale(.94)}}
@keyframes title-rise{from{opacity:0;transform:translateY(18px)}to{opacity:1;transform:none}}
@keyframes era-wipe{from{clip-path:inset(0 0 0 0)}to{clip-path:inset(0 0 0 100%)}}
#game[data-phase="transition"] #screen{display:flex;flex-direction:column;overflow:hidden;padding:0}
@media(max-height:740px){.era-card-fallen img{width:88px;height:88px}.era-card-title{margin-top:96px}.era-card-city{height:130px}}
@media(prefers-reduced-motion:reduce){
 .era-card-title,.era-card-city,.era-card-hint{animation:none}
 .era-card-wipe{display:none}
 .era-card-fallen{animation:none;height:auto;margin-bottom:14px}
 .era-card-title{margin-top:0}
}
/* W-055 battle clarity: keyword terms, tooltip sheet, breach/blocked feedback, wave preview. */
dfn.kw{font-style:normal;font-weight:750;color:var(--kw,#2f6a7b);text-decoration:underline dotted;text-decoration-thickness:1.5px;text-underline-offset:3px;cursor:pointer;border-radius:3px;padding:0 1px;-webkit-tap-highlight-color:transparent}
dfn.kw:hover,dfn.kw:focus-visible{background:#2f6a7b1c;outline-offset:1px}
#game[data-era="3"]{--kw:#8fe0e4}#game[data-era="2"]{--kw:#5b4a1c}#game[data-era="4"]{--kw:#345a86}
#keyword-sheet{position:absolute;z-index:12;padding:10px 12px 8px;background:var(--paper,#ebdfbd) url('/assets/ui/parchment.svg') center/100% 100%;border:2px solid #716043;color:var(--ink);box-shadow:0 8px 28px #10160aa0;pointer-events:none;animation:overlay-reveal 140ms ease-out}
#keyword-sheet strong{display:block;font-size:var(--fs-lg);margin-bottom:4px}
#keyword-sheet p{font-size:var(--fs-base);line-height:1.4}
#keyword-sheet small{display:block;margin-top:6px;font-size:var(--fs-xs);color:var(--muted)}
#keyword-sheet::after{content:'';position:absolute;left:calc(50% - 7px);bottom:-8px;border:7px solid transparent;border-bottom:0;border-top-color:#716043}
#keyword-sheet.below::after{bottom:auto;top:-8px;border-top:0;border-bottom:7px solid #716043}
#game:is([data-era="2"],[data-era="3"],[data-era="4"]) #keyword-sheet{background:var(--paper) var(--era-paper) center/100% 100%;border-color:var(--era-edge)}
dialog #keyword-sheet{z-index:2}
/* Breach: red screen edge, shaking health, floating −n. Blocked: pale shield pop and a chip. */
#game.breach::after{content:'';position:absolute;inset:0;z-index:9;pointer-events:none;box-shadow:inset 0 0 70px 22px #d8322a;animation:breach-edge .65s ease-out forwards}
@keyframes breach-edge{0%{opacity:0}12%{opacity:1}100%{opacity:0}}
.health-counter{position:relative}
.health-counter.shake{animation:health-shake .5s ease-in-out;color:#ff9a86}
@keyframes health-shake{10%,50%,90%{transform:translateX(-3px)}30%,70%{transform:translateX(3px)}}
#vitals-fx{position:absolute;inset:0;pointer-events:none;z-index:10}
.hit-number{position:absolute;translate:-50% 0;font-weight:850;font-size:var(--fs-3xl);color:#ff6d5a;text-shadow:0 1px 2px #2a0b07,0 0 6px #2a0b07;pointer-events:none;animation:hit-rise 1s ease-out forwards;white-space:nowrap}
@keyframes hit-rise{0%{opacity:0;transform:translateY(-4px)}15%{opacity:1}100%{opacity:0;transform:translateY(20px)}}
.shield-counter.pop .ui-icon{animation:shield-pop .45s ease-out}
@keyframes shield-pop{40%{transform:scale(1.5);filter:brightness(1.6)}}
.blocked-chip{position:absolute;translate:-50% 0;display:flex;align-items:center;gap:4px;padding:3px 9px;background:#f3e4b6;border:1px solid #b89a52;border-radius:12px;color:#4d4020;font-size:var(--fs-sm);font-weight:750;pointer-events:none;z-index:5;animation:chip-pop 1.1s ease-out forwards}
.blocked-chip .ui-icon{width:16px;height:16px;color:#7f6a2a}
@keyframes chip-pop{0%{opacity:0;transform:scale(.8)}12%{opacity:1;transform:scale(1.06)}25%{transform:scale(1)}80%{opacity:1}100%{opacity:0}}
@media(prefers-reduced-motion:reduce){
 #keyword-sheet{animation:none}
 .health-counter.shake{animation:none}
 .hit-number{animation:hit-fade 1s linear forwards}
 @keyframes hit-fade{0%,70%{opacity:1}100%{opacity:0}}
 .shield-counter.pop .ui-icon{animation:none}
 .blocked-chip{animation:chip-fade 1.1s linear forwards}
 @keyframes chip-fade{0%,80%{opacity:1}100%{opacity:0}}
 #game.breach::after{animation:breach-fade .65s linear forwards}
 @keyframes breach-fade{0%{opacity:1}100%{opacity:0}}
}
/* Formation card: one big icon per minion type, three to a row, with its count. */
.wave-preview{display:grid;grid-template-columns:repeat(auto-fill,minmax(98px,1fr));gap:8px;margin:8px 0 10px}
.wave-preview .wave-label{grid-column:1/-1;margin:0;padding:3px 8px;border-left:3px solid var(--label-edge,#c9a24a);background:rgba(255,255,255,.05);font-size:12px;font-weight:700;line-height:1.3;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}/* W-145: a boss's preview label, one line across the formation */
/* W-084: the stats and rule line that used to sit in a list under the cards now live on each card. */
/* W-084 tower card: the tower's own model turns at the top of the card, over the era paper. */
/* Designer, 2026-09-23: the model uses the card's spare height (it is tall and narrow, so height is what makes it
   larger), scaled with the screen so the card still fits over the board without scrolling. */
.info-card .tower-info .tower-model{height:clamp(104px,calc(100dvh - 620px),220px);margin:-6px 40px 0;display:flex;justify-content:center}
/* A tower with its next tier learned shows that tier as the win's upgrade screen does (spoils.js tierDetail; 2026-10-27):
   its rows carry the tower's numbers now and after, so the stat tiles give way to them (the designer's pick), and the
   model steps down so it all fits without a scroll. */
.info-card .tower-info:has(>.up-detail)>.combat-stats{display:none}
.info-card .tower-info:has(>.up-detail) .tower-model{height:clamp(104px,calc(100dvh - 720px),160px)}
.info-card .tower-info>.up-detail{margin:0 0 10px}
.tower-model .model-viewer{display:block;width:100%;height:100%;opacity:0}
.info-card .tower-info .combat-stats.no-range{grid-template-columns:repeat(3,minmax(0,1fr))}
.info-card .tower-info .combat-stats.no-range dt{font-size:var(--fs-xs);letter-spacing:0}
.info-card .tower-info .combat-stats.no-range dd{font-size:var(--fs-lg)}
/* Tower details in the overlay (2026-09-21): same card as card/minion details, no tray scrolling. */
/* W-057 tower card over the board: title, mod chips, 2×2 stat tiles, rule lines, next tier, one action row. */
.info-card .info h3{font-size:var(--fs-4xl);line-height:1.2;padding-right:44px;margin-bottom:6px}
.tower-chips{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 10px}
.tower-chips .chip{font-size:var(--fs-sm);font-weight:700;line-height:1;padding:6px 9px;border-radius:999px;background:#7a4d8a22;border:1px solid #7a4d8a66;color:var(--ink)}
.info-card .tower-info .combat-stats{grid-template-columns:1fr 1fr;gap:6px;margin:0 0 10px}
.info-card .tower-info .combat-stats>div{padding:6px 8px 7px;border-left-width:3px}
.info-card .tower-info .combat-stats dt{font-size:var(--fs-sm);letter-spacing:.02em;text-transform:uppercase;color:var(--muted)}
.info-card .tower-info .combat-stats dd{font-size:var(--fs-2xl);margin-top:2px}
/* W-132: every list of rules is line items (line-items.js): one fact per line after a small dot, in the branch's colour
   where there is one; a change old ▸ new, as a row shows it (line-items.js). */
.line-items{display:grid;gap:2px;list-style:none;margin:0;padding:0;line-height:1.35}
.line-items li{position:relative;margin:0;padding:0 0 0 12px}
.line-items li::before{content:'';position:absolute;left:1px;top:calc(.675em - 2.5px);width:5px;height:5px;border-radius:50%;background:var(--branch,var(--era-edge,#ac9560))}
.line-items .li-from{font-size:inherit;font-weight:600;color:var(--muted)}
.line-items .li-change{white-space:nowrap}
.line-items .li-change s{text-decoration:none;font-weight:600;color:var(--muted)}
.line-items .li-change b{font-weight:800}
.line-items .li-change.better b{color:var(--tc-better,#3b7a3a)}
.line-items .li-change.worse b{color:var(--tc-worse,#a4412f)}
.line-items .li-change .up-arrow{width:.62em;height:.62em;margin:0 .28em;color:var(--muted);vertical-align:.04em}
.tower-rules{margin:0 0 10px;gap:4px;font-size:var(--fs-md)}
.tower-next{font-size:var(--fs-base);line-height:1.35;margin:0 0 10px;padding:7px 9px;background:#6f806514;border-left:3px solid var(--era-edge,#ac9560)}
.tower-next.tower-why{color:var(--muted);font-style:italic;border-left-color:#0000}/* W-119: why there is no Upgrade button */
.tower-next.tower-note{display:flex;gap:.5em;align-items:center;font-weight:600}.tower-next.tower-note>svg{flex:none;width:1.4em;height:1.4em}/* W-145 (#43): a boss's `towerNote` (the Kraken's braced tower), its icon first */
.tower-next b{display:block;margin-bottom:2px}
.info-card .tower-info .inspector-actions{display:flex;gap:8px;margin:0}
/* W-116: a tall tower card (an unlocked branch's Next line) scrolls, and its Upgrade and Target buttons stay pinned at the card's foot instead of hiding below a scroll nothing showed */
#overlay .info-card .tower-info .inspector-actions{position:sticky;bottom:-12px;z-index:1;margin:0 -12px -12px;padding:10px 12px 12px;background:var(--paper);box-shadow:0 -10px 10px -8px #10160a66}
.info-card .tower-info .inspector-actions .small-button,.info-card .tower-info .target-choice{flex:1 1 0;justify-content:center;min-height:44px;font-size:var(--fs-md);padding:8px 10px;margin:0;color:var(--ink)}
.info-card .tower-info .target-choice .ui-icon{width:18px;height:18px}
/* The upgrade is the card's main action (designer, 2026-09-23): brass like the game's primary buttons, bold, with a
   slow glow while it can be bought; muted when it cannot (not enough mana, or the wave is running). */
.info-card .tower-info .inspector-actions .upgrade-button{flex:1.2 1 0;font-size:var(--fs-xl);font-weight:800;letter-spacing:.02em;color:var(--b1-ink)}/* W-119 I-037: the button's own ink (the small-button rule gave it the page ink: dark on dark, as if disabled) */
.info-card .tower-info .upgrade-button .ui-icon{width:20px;height:20px;filter:drop-shadow(0 1px 1px #0006)}
.info-card .tower-info .upgrade-button::after{content:"";position:absolute;inset:-3px;border-radius:5px;box-shadow:0 0 0 2px #f4d27a,0 0 16px 3px #f4c95acc;opacity:0;pointer-events:none;animation:upgrade-glow 2.2s ease-in-out infinite}
@keyframes upgrade-glow{50%{opacity:.9}}
.info-card .tower-info .upgrade-button:hover:not(:disabled){filter:brightness(1.1)}
.info-card .tower-info .upgrade-button:disabled{filter:saturate(.3) brightness(.92);opacity:.6;box-shadow:none}
.info-card .tower-info .upgrade-button:disabled::after{display:none}
@media(prefers-reduced-motion:reduce){.info-card .tower-info .upgrade-button::after{animation:none;opacity:.7}}
.info-card .tower-info .upgrade-button{flex:1.4 1 0}
.info-card .tower-info .upgrade-button .ui-icon{width:16px;height:16px;vertical-align:-3px}
.info-card .combat-stats{grid-template-columns:1fr 1fr}
.info-card .combat-stats dt{font-size:var(--fs-sm);text-transform:uppercase;letter-spacing:.02em;color:var(--muted)}
/* ---- W-059 character dialogue: the opponent talks over the board before the fight and has a last word after it ---- */
#conversation{position:absolute;top:44px;left:0;right:0;bottom:0;z-index:6;isolation:isolate;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:14px;padding:18px 14px calc(var(--safe-bottom,env(safe-area-inset-bottom)) + 22px);color:var(--ink);text-align:center}
/* W-109: the board stays in view, dimmed, behind the speaker; the words sit on a speech panel like the keepers'. */
#conversation::before{content:'';position:absolute;inset:0;z-index:-1;background:linear-gradient(to bottom,#0c16108c,#0c1610d9 55%,#0c1610f2);transition:opacity .45s}
.conversation-panel{position:relative;width:100%;max-width:460px;padding:18px 16px 10px;text-align:left;background:var(--paper) url('/assets/ui/parchment.svg') center/100% 100%;border:1px solid var(--era-edge,#a58d61);box-shadow:0 8px 24px #0007;transition:opacity .3s}
#game:is([data-era="2"],[data-era="3"],[data-era="4"]) .conversation-panel{background:var(--paper) var(--era-paper) center/100% 100%}
.conversation-stage{width:52%;max-width:260px;aspect-ratio:1;flex-shrink:1;min-height:0}
.conversation-portrait{margin:0;width:100%;height:100%;border:3px solid #716043;background:#5f5a4b;box-shadow:0 10px 30px #10160a70;overflow:hidden;will-change:transform}
.conversation-portrait img{display:block;width:100%;height:100%;object-fit:cover}
#conversation.still .conversation-portrait img{animation:portrait-bob 3s ease-in-out infinite}/* no frames: a 2 px idle bob */
@keyframes portrait-bob{50%{transform:translateY(2px)}}
.conversation-plate{position:absolute;top:-13px;left:14px;padding:5px 16px;background:#3c4436;color:#f1dfb3;border:1px solid #b6a576;font-size:var(--fs-sm);letter-spacing:.06em;text-transform:uppercase;clip-path:polygon(6px 0,calc(100% - 6px) 0,100% 50%,calc(100% - 6px) 100%,6px 100%,0 50%)}
.conversation-line{min-height:2.9em;font-size:var(--fs-2xl);line-height:1.45;font-weight:600;color:var(--ink)}
.conversation-caret{display:none;width:2px;height:1em;margin-left:3px;vertical-align:-2px;background:currentColor;animation:caret-blink 1s steps(2) infinite}
#conversation.typing .conversation-caret{display:inline-block}
@keyframes caret-blink{50%{opacity:0}}
.conversation-hint{display:block;text-align:right;margin-top:2px;font-size:var(--fs-xs);color:var(--muted);letter-spacing:.04em;text-transform:uppercase}
.conversation-tap{position:absolute;inset:0;z-index:1;background:transparent;border:0;cursor:pointer}
.conversation-skip{position:absolute;top:12px;right:12px;z-index:2;min-height:44px;padding:9px 26px;font-size:var(--fs-md);font-weight:650;border:1px solid var(--b2-rim);border-radius:var(--b2-radius);background:var(--b2-face);color:var(--b2-ink);box-shadow:inset 0 1px 0 #ffffff26,0 1px 0 #00000026}
.conversation-line,.conversation-hint,.conversation-skip{transition:opacity .3s}
#conversation.flying{pointer-events:none}
#conversation.flying::before,#conversation.flying :is(.conversation-panel,.conversation-skip){opacity:0}
#game.handing-off .enemy-pennant>img{visibility:hidden}/* the flying portrait stands in for it */
@media(max-height:700px){.conversation-stage{width:44%}.conversation-line{font-size:var(--fs-lg)}}
@media(prefers-reduced-motion:reduce){#conversation::before,.conversation-panel,.conversation-line,.conversation-hint,.conversation-skip{transition:none}.conversation-caret,#conversation.still .conversation-portrait img{animation:none}}
/* W-151 (#58) (the designer, 2026-10-17: "Move the skip and continue buttons to the bottom during dialog"): Skip, and
   Continue on the closing line, sat at the top right over the top bar. It now sits under the speech panel at the panel's
   right edge, in the conversation's own column, so the portrait and the panel rise by its height and nothing overlaps
   the line or its hint. Its right margin follows the panel's width (wide.css says the laptop's, --talk-panel). */
.conversation-skip{position:relative;top:auto;right:auto;order:1;align-self:flex-end;margin:-4px max(0px,calc((100% - var(--talk-panel,460px))/2)) 0 0}

/* W-087 (D-126): a hand of four. The cards take the tray's full width, fan slightly from a common pivot below the
   tray, show the piece large, and name a tower's technology on one line ("Rapid I"; the kind bar's colour says tower
   or spell). Cards deal in from the draw pile at the bottom left. */
#hand{gap:7px;padding:8px 10px 9px;align-items:flex-end}
.card{max-width:118px;transform-origin:50% 130%;transition:translate .16s ease-out,rotate .16s ease-out,box-shadow .16s}
/* v0.9 (laptop playtest: "Cards look blurry in hand"): a tilted card must not carry a CSS filter. Chrome draws a
   filtered element flat into its own surface and then turns that surface, resampling every pixel; on a 1×–1.5× laptop
   screen that softens the text and art by a full pixel (a 2×–3× phone or Mac hides it). The card's shadow is a
   box-shadow instead, and the deal-in animation lets go of the card when it ends. */
#hand .card{box-shadow:0 3px 3px #141b1166;border-radius:5px}
#hand .card:not(.static,.curse){filter:none}/* curse and static cards keep their grey-out filter */
#hand .card.selected{filter:none;box-shadow:0 5px 4px #101a1866}
#hand[data-count="4"] .card:nth-child(1){rotate:-3deg;translate:0 3px}
#hand[data-count="4"] .card:nth-child(2){rotate:-1.2deg}
#hand[data-count="4"] .card:nth-child(3){rotate:1.2deg}
#hand[data-count="4"] .card:nth-child(4){rotate:3deg;translate:0 3px}
#hand[data-count="3"] .card:nth-child(1){rotate:-2.5deg;translate:0 3px}
#hand[data-count="3"] .card:nth-child(3){rotate:2.5deg;translate:0 3px}
#hand .card.selected{rotate:0deg;translate:0 -7px;z-index:2}
.card{height:100%}
.card::before{inset:7px 6px 44px}
.card>.piece-art{margin:10px 2px 4px;filter:drop-shadow(0 4px 3px #101a1830)}
.card-name{font-size:var(--fs-base);min-height:2.3em}
.card-kind{font-size:var(--fs-xs);font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.card-kind b{font-family:Georgia,serif;font-weight:700;margin-left:2px}
.card.dealt{animation:deal-from-pile .32s cubic-bezier(.2,.8,.25,1.06) backwards;animation-delay:var(--deal-delay,0ms)}
@keyframes deal-from-pile{from{opacity:0;transform:translate(-46vw,32px) scale(.45) rotate(-14deg)}40%{opacity:1}to{opacity:1;transform:none}}
@media(max-height:700px){.card-name{font-size:var(--fs-sm)}.card>.piece-art{margin-top:8px}}
@media(prefers-reduced-motion:reduce){.card.dealt{animation:none}.card{transition:none}}

:is(dialog,.title-card,.dialog-top,.build-version,.menu-actions>*,.title-actions>*){transition:opacity .18s ease,background-color .18s ease,border-color .18s ease}
/* W-094 battle camera: the orbit control, top-right of the board — a view cube that turns with the camera, then lock
   and reset, with Turn fit to its left. It dims while the board is being turned. */
.cam-control{position:absolute;top:6px;right:6px;z-index:5;display:flex;flex-direction:column;align-items:flex-end;gap:4px;pointer-events:none;transition:opacity .18s}
.cam-control>*{pointer-events:auto}
.cam-control.dragging{opacity:.45}
.cam-control button{font:inherit;color:#eaf6f3;background:#11252ee6;border:1px solid #c9dbe0aa;box-shadow:0 2px 6px #08111480;cursor:pointer;-webkit-tap-highlight-color:transparent}
.cam-control .cam-cube{width:72px;height:72px;display:grid;place-items:center;cursor:grab;touch-action:none;border-radius:50%;background:radial-gradient(circle,#11252e80 0,#11252e40 55%,transparent 70%)}
.cam-control.dragging .cam-cube{cursor:grabbing}
.cam-cube-body{position:relative;width:38px;height:38px;transform-style:preserve-3d;pointer-events:none}
.cam-control .cam-face{position:absolute;inset:0;padding:0;border-radius:3px;border:1px solid #0d1c22;box-shadow:inset 0 0 0 1px #ffffff30;color:#1b2a22;font-size:8px;font-weight:800;letter-spacing:.04em;text-transform:uppercase;display:grid;place-items:center;backface-visibility:hidden;pointer-events:auto;transition:background .12s}
.cam-control .cam-top{transform:translateZ(19px);background:#a9cf8f}
.cam-control .cam-front{transform:rotateX(-90deg) translateZ(19px);background:#d8cdb2}
.cam-control .cam-back{transform:rotateX(90deg) rotateZ(180deg) translateZ(19px);background:#c9a98a}
.cam-control .cam-left{transform:rotateY(-90deg) rotateZ(90deg) translateZ(19px);background:#bfb49b}
.cam-control .cam-right{transform:rotateY(90deg) rotateZ(-90deg) translateZ(19px);background:#bfb49b}
.cam-control .cam-face:hover{background:#f1d899}
.cam-control .cam-corner{position:absolute;width:9px;height:9px;padding:0;border-radius:50%;background:#f1d899;border:1px solid #0d1c22;box-shadow:none;transform:translateZ(19.5px);pointer-events:auto}
.cam-control .cam-corner::before{content:'';position:absolute;inset:-6px}
.cam-c-fl{left:-4px;bottom:-4px}.cam-c-fr{right:-4px;bottom:-4px}.cam-c-bl{left:-4px;top:-4px}.cam-c-br{right:-4px;top:-4px}
.cam-tools{display:flex;gap:6px;margin-right:8px}
.cam-control .cam-tool{width:36px;height:36px;padding:8px;border-radius:50%;display:grid;place-items:center}
.cam-tool svg{width:18px;height:18px}
.cam-control .cam-tool:hover{background:#1b3a47}
.cam-control .cam-tool[aria-pressed="true"]{background:#6b4c1ee8;border-color:#f1d899;color:#ffe9b5}
.cam-control.frozen .cam-cube{opacity:.75}
#board-wrap.cam-dragging #board{cursor:grabbing}
.cam-hint{position:absolute;left:50%;bottom:12px;z-index:4;transform:translate(-50%,6px);max-width:calc(100% - 24px);padding:6px 12px;border-radius:14px;background:#11252ee6;border:1px solid #c9dbe0aa;color:#eaf6f3;font-size:12px;white-space:nowrap;pointer-events:none;opacity:0;transition:opacity .25s,transform .25s}
.cam-hint.show{opacity:1;transform:translate(-50%,0)}
@media (prefers-reduced-motion:reduce){.cam-control,.cam-hint{transition:none}}
.cam-top-row{display:flex;align-items:center;gap:2px;pointer-events:none}
.cam-top-row>*{pointer-events:auto}
.cam-control .cam-tool[data-cam="turnfit"][aria-pressed="true"]{background:#2d6f7ae6;border-color:#bfeff2}
/* W-096 · a site scene: the painting fills the top of the screen edge to edge and moves; the site's name sits on it,
   and the offers start where the painting's calm lower part begins (site-scene.js spacer). */
#screen:has(.site-scene){position:relative}
.site-scene{position:absolute;left:0;right:0;top:0;aspect-ratio:var(--site-aspect);pointer-events:none;overflow:hidden;border-radius:inherit}
.site-scene .site-motion{display:block;width:100%;height:100%}
.site-scene::after{content:"";position:absolute;inset:auto 0 0 0;height:22%;background:linear-gradient(to bottom,transparent,var(--paper,#e6d7af))}
.site-scene-head{position:absolute;left:0;right:0;top:10px;text-align:center;pointer-events:none}
.site-scene-head .sheet-heading{justify-content:center;border:0;margin:0}
.site-scene-head h1{color:#fff4d6;text-shadow:0 2px 0 #0008,0 3px 12px #000c}
/* W-096 (Era II sites): the era ink rule (#game:is([data-era="2"],…) :is(h1,…)) outranks the line above, so eras II-IV
   drew the site name in dark ink over the painting; the id-level selector keeps it cream on every era. */
#game #screen .site-scene-head h1{color:#fff4d6}
.site-scene-spacer{width:100%}
.site-scene-spacer~:not(.site-scene-head){position:relative}
.cam-views{display:flex;align-items:center;gap:6px;margin-right:8px;pointer-events:none}
.cam-views>*{pointer-events:auto}
.cam-caption{padding:4px 9px;border-radius:12px;background:#11252ee6;border:1px solid #c9dbe0aa;color:#eaf6f3;font-size:11px;white-space:nowrap;opacity:0;transform:translateX(6px);transition:opacity .2s,transform .2s;pointer-events:none!important}
.cam-caption.show{opacity:1;transform:none}
@media (prefers-reduced-motion:reduce){.cam-caption{transition:none}}
/* W-092 · Confirm placement: Cancel + Place stand where Send wave is while a tower is staged. */
#actions .stage-bar{flex:1;display:flex;gap:6px;min-width:0}
#actions .stage-bar .small-button{flex:0 0 auto;min-height:44px;padding:0 12px}
#actions .stage-bar .primary{flex:1;min-height:46px;font-size:var(--fs-lg);display:flex;align-items:center;justify-content:center;gap:4px}
/* W-165 (#93): a stone's bar, Cancel · Place · 1◆ (the 10-26 notes took ↻ Turn off it). On a phone, while a stone is
   staged, it takes the room of the piles and the redraw (back with Send wave): at 390 px without it "Place · 1" wrapped
   onto two lines and ran over the speed button (production/evidence/mason-165/notes1/hand). The laptop's bar has a row
   of its own. */
@media not all and (min-width:960px) and (min-height:600px) and (min-aspect-ratio:5/4){#actions:has(.stage-bar.stone) :is(.piles,.redraw){display:none}}
/* W-097: music and effects volume sliders (☰ menu and title Settings) */
.volume-row{cursor:default}.volume-row input[type=range]{flex:1;min-width:80px;margin:0 6px;accent-color:#8a6a2f}.volume-row span{min-width:34px;text-align:right}

/* v0.9 (designer: "the models should be the center of attention … use the space better", cards the same size):
   the hand card's model starts at the top edge beside the cost badge and runs almost edge to edge; the formation's
   minions are drawn from their cropped bounds (like the hand) instead of the whole render with its empty margin. */
#hand .card>.piece-art{margin:1px -3px 1px;width:calc(100% + 6px)}
#hand .card::before{inset:7px 6px 44px}
#hand .card{padding-bottom:10px}
#hand .card-name{min-height:0;margin-top:2px}/* a one-line name gives its second line to the model */
/* W-109 · the keeper's line at a shop, forge or rest (site-talk.js, typed by main.js like the opponents' talk): a speech
   plate with the keeper's name tab, laid over the calm foot of the painting just above the offers. */
.keeper-talk{position:relative;z-index:1;margin:-62px 4px 12px;padding:15px 14px 10px;min-height:68px;background:var(--paper) url('/assets/ui/parchment.svg') center/100% 100%;border:1px solid var(--era-edge,#a58d61);box-shadow:0 6px 16px #0005;color:var(--ink)}
#game:is([data-era="2"],[data-era="3"],[data-era="4"]) .keeper-talk{background:var(--paper) var(--era-paper) center/100% 100%}
.keeper-name{position:absolute;top:-12px;left:12px;padding:4px 14px;background:#3c4436;color:#f1dfb3;border:1px solid #b6a576;font-size:var(--fs-xs);font-weight:700;letter-spacing:.06em;text-transform:uppercase;clip-path:polygon(6px 0,calc(100% - 6px) 0,100% 50%,calc(100% - 6px) 100%,6px 100%,0 50%)}
.keeper-line{margin:0;min-height:2.8em;font-size:var(--fs-lg);line-height:1.4;font-weight:600;color:var(--ink)}
.talk-caret{display:none;width:2px;height:1em;margin-left:3px;vertical-align:-2px;background:currentColor;animation:caret-blink 1s steps(2) infinite}
.keeper-talk.typing .talk-caret{display:inline-block}
@media(prefers-reduced-motion:reduce){.talk-caret{animation:none}}

/* On a phone it sits just above the action bar; on a laptop it is a line in the action panel (wide.css). */
#actions{position:relative}
/* W-121 batch 3 (view-fade.js): the leaving view's copy, or the live battle, over the next view while it fades out. */
.view-ghost{position:absolute;inset:0;z-index:30;pointer-events:none;overflow:hidden}
#battle-view.view-leaving{position:absolute;z-index:30;pointer-events:none}

/* D-143 (W-123): rarity on the card. An uncommon tower's larger card (the start pick, a boss's offer, the shop, the
   gallery) has a green gem in its top corner, a thin green rim and "Uncommon" in its caption line; a rare's is violet,
   its gem a little larger; a common's has none. The hand cards keep their small gem (.card.uncommon:after above).
   The word and gem are card-face.js rarityMark; the card carries rarityClass for the rim. Era III's dark cards take
   lighter shades. */
:root{--rarity-uncommon:#53765f;--rarity-rare:#8c6088}
#game[data-era="3"]{--rarity-uncommon:#8ad3a4;--rarity-rare:#d2aaf4}
.rarity-uncommon{--rarity:var(--rarity-uncommon)}
.rarity-rare{--rarity:var(--rarity-rare)}
.rarity-mark{display:inline-flex;align-items:center;gap:5px;color:var(--rarity);font-weight:750;letter-spacing:.05em;text-transform:uppercase;white-space:nowrap;vertical-align:baseline}
.rarity-gem{display:inline-block;flex:none;width:7px;height:7px;background:var(--rarity);rotate:45deg;box-shadow:0 0 0 1px #fff8,0 1px 2px #0004}
.rarity-mark.rarity-rare .rarity-gem{width:8px;height:8px}
:is(.offer,.uf-tower):is(.rarity-uncommon,.rarity-rare)::before{content:'';position:absolute;inset:5px;border:2px solid var(--rarity);border-radius:3px;opacity:.9;pointer-events:none}
:is(.offer,.uf-tower):is(.rarity-uncommon,.rarity-rare) .rarity-mark .rarity-gem{position:absolute;z-index:1;top:11px;right:12px;width:11px;height:11px;box-shadow:0 0 0 1.5px #fff9,0 1px 3px #0005}
:is(.offer,.uf-tower).rarity-rare .rarity-mark .rarity-gem{top:10px;right:11px;width:14px;height:14px}
.start-tower:is(.rarity-uncommon,.rarity-rare) .rarity-mark .rarity-gem{right:auto;left:12px}
.info-head .rarity-mark{margin-left:4px}
/* D-143: a boss now offers three towers, and an uncommon lists three branches. A tower offer with its branches is a
   compact grid: a smaller picture beside its label, name and face band, then the rules and the branches the card's full
   width, so the three towers and the relic pick stay short at 390 wide and sit in one row on the laptop. */
#screen[data-view="reward"] .offer.tower:has(.offer-branches){display:grid;grid-template-columns:clamp(62px,26%,104px) minmax(0,1fr);column-gap:12px;align-items:start;align-content:start;padding:36px 16px 32px}
#screen[data-view="reward"] .offer.tower:has(.offer-branches)>div{display:contents}
#screen[data-view="reward"] .offer.tower:has(.offer-branches) .offer-art{grid-column:1;grid-row:1/span 3;width:100%;height:auto;max-height:104px;align-self:end;margin-top:14px}
#screen[data-view="reward"] .offer.tower:has(.offer-branches)>div>:is(small,h3,.card-face){grid-column:2;justify-self:start}
#screen[data-view="reward"] .offer.tower:has(.offer-branches)>div>h3{margin-bottom:6px}
#screen[data-view="reward"] .offer.tower:has(.offer-branches)>div>:is(p,.offer-branches){grid-column:1/-1}
#screen[data-view="reward"] .offer.tower:has(.offer-branches)>div>p{margin-top:8px}
/* W-152 (#52) the tower ring (tower-ring.js): a tapped tower's actions round it on a phone, in planning and in a wave.
   main.js places each button over its tower every frame (a transform), so the ring follows the free camera. */
#tower-ring{position:absolute;left:0;top:0;width:0;height:0;z-index:6}
#tower-ring.hidden{display:none}
#tower-ring .ring-button{position:absolute;left:0;top:0;width:46px;height:46px;border-radius:50%;padding:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;
 background:var(--paper) url('/assets/ui/parchment.svg') center/100% 100%;color:var(--ink);border:2px solid var(--era-edge,#9c7b45);box-shadow:0 3px 9px #0008;
 font:700 10.5px/1 system-ui,-apple-system,sans-serif;letter-spacing:-.01em;touch-action:manipulation;animation:ring-in .14s ease-out both}
#tower-ring .ring-button .ui-icon{width:17px;height:17px}
#tower-ring .ring-button span{display:flex;align-items:center;gap:1px;white-space:nowrap}
#tower-ring .ring-button span .ui-icon{width:12px;height:12px}
#tower-ring .ring-button[aria-pressed="true"]{background:#2f5560;border-color:var(--gold);color:#f6ebc8;box-shadow:0 0 0 2px #f6ebc880,0 3px 9px #0008}
#tower-ring .ring-button[aria-disabled="true"]{opacity:.62}
#tower-ring .ring-button:disabled{opacity:.4}
#tower-ring .ring-up{font-size:13px;line-height:1;color:#3d7a3a}
#tower-ring .ring-upgrade:not([aria-disabled="true"]){border-color:#3d7a3a}
#tower-ring .ring-i{font:italic 700 17px/1 Georgia,serif}
@keyframes ring-in{from{opacity:0;scale:.6}to{opacity:1;scale:1}}
@media (prefers-reduced-motion:reduce){#tower-ring .ring-button{animation:none}}
/* W-151 (#54) (the designer, 2026-10-17: "Trxt coloring on tower menu is too light in thir era"): Era III's ink is light,
   so its ring drops the parchment for the era's own dark paper (the lit glass under its interface looks), rimmed and lit
   like the camera's buttons; the upgrade's green ▲ goes light to match. */
#game[data-era="3"] #tower-ring .ring-button{background-image:none}
#game[data-era="3"][data-neon-ui] #tower-ring .ring-button:not([aria-pressed="true"]){box-shadow:0 0 8px #3de9f233,0 3px 9px #000a}
#game[data-era="3"] #tower-ring .ring-up{color:#7be08f}
#game[data-era="3"] #tower-ring .ring-upgrade:not([aria-disabled="true"]){border-color:#7be08f}
/* W-152 (#52): the tower card's orders, one tap each (main.js orderChoices) */
.order-choices{display:flex;align-items:center;gap:3px;margin-top:3px;color:#375b60}
.order-choices>.ui-icon{width:16px;height:16px;flex:none}
.order-choices .target-choice{margin-top:0;padding:3px 8px;flex:1 1 auto;justify-content:center}
.order-choices .target-choice[aria-pressed="true"]{background:#2f5560;color:#f6ebc8}
/* #51 rec 1 (W-152 builds it): an upgrade on the board. main.js riseTag: "▲ Rapid I" over the tower and "−2" off the
   gem; applyManaFx: the gem drains on a buy and flashes red when short (a redraw mid-effect resumes it, --fx-delay). */
.rise-tag{position:absolute;z-index:9;pointer-events:none;transform:translate(-50%,-100%);white-space:nowrap;font:800 15px/1 system-ui,-apple-system,sans-serif;color:#fff1c2;
 text-shadow:0 1px 0 #5a3d12,0 0 3px #2a1c08,0 0 10px #000b;animation:rise-tag 1.3s ease-out both}
.rise-tag.mana-tag{font-size:14px;color:#c8f1ff;text-shadow:0 1px 0 #13404d,0 0 8px #000b}
@keyframes rise-tag{0%{opacity:0;translate:0 10px;scale:.7}14%{opacity:1;translate:0 0;scale:1.14}28%{scale:1}75%{opacity:1}100%{opacity:0;translate:0 -36px}}
.mana.mana-drain>.ui-icon{animation:gem-drain .62s ease-out var(--fx-delay,0ms) both}
.mana.mana-drain strong{animation:gem-drain-n .62s ease-out var(--fx-delay,0ms) both}
@keyframes gem-drain{0%{scale:1.32;filter:drop-shadow(0 0 9px #9fe8ff) brightness(1.6)}55%{scale:.9;filter:drop-shadow(0 0 3px #9fe8ff) brightness(.85)}100%{scale:1;filter:none}}
@keyframes gem-drain-n{0%{color:#f2feff;scale:1.15}100%{color:#b2dce0;scale:1}}
.mana.mana-short>.ui-icon{animation:gem-short .52s linear var(--fx-delay,0ms) both}
.mana.mana-short strong{animation:gem-short-n .52s linear var(--fx-delay,0ms) both}
@keyframes gem-short{0%,50%{filter:drop-shadow(0 0 7px #ff4b36) sepia(1) saturate(7) hue-rotate(-38deg)}25%,75%,100%{filter:none}}
@keyframes gem-short-n{0%,50%{color:#ff7a66}25%,75%,100%{color:#b2dce0}}
@media (prefers-reduced-motion:reduce){.rise-tag{animation:rise-fade 1.3s both}@keyframes rise-fade{0%,75%{opacity:1}100%{opacity:0}}.mana.mana-drain>.ui-icon,.mana.mana-drain strong{animation:none}}
/* W-151 (#51) rec 6, "counters that move" (counters.js): coins arc into (or out of) the gold counter, each change shows
   as a tag under its counter, the counter pops as gold or a card arrives, and health flashes red or green. */
.coin-flight{position:fixed;z-index:1001;width:18px;height:18px;pointer-events:none;color:#f2c94c;filter:drop-shadow(0 2px 2px #0009);will-change:transform}
.count-tag{position:absolute;z-index:12;translate:-50% 2px;pointer-events:none;white-space:nowrap;font:800 13px/1 system-ui,-apple-system,sans-serif;text-shadow:0 1px 0 #000,0 0 6px #000c;animation:count-tag 1.1s ease-out both}
.count-tag.gold-tag{color:#f7d77c}.count-tag.spend-tag{color:#e7c48d}.count-tag.hurt-tag{color:#ff7a66}.count-tag.heal-tag{color:#93e6a3}.count-tag.deck-tag{color:#f5d98e}
@keyframes count-tag{0%{opacity:0;transform:translateY(-6px) scale(.75)}18%{opacity:1;transform:none;scale:1.12}32%{scale:1}75%{opacity:1}100%{opacity:0;transform:translateY(10px)}}
#hud .count-pop{animation:count-pop .42s cubic-bezier(.3,1.6,.5,1)}
@keyframes count-pop{35%{scale:1.22;filter:drop-shadow(0 0 7px #f5d27a)}}
#hud .health-counter.count-hurt{animation:count-hurt .55s ease-out}
#hud .health-counter.count-hurt .ui-icon{animation:count-hurt-icon .55s ease-out}
@keyframes count-hurt{0%,40%{color:#ff8f7d}15%{translate:-3px 0}30%{translate:3px 0}45%{translate:-2px 0}60%{translate:0 0}}
@keyframes count-hurt-icon{0%{scale:1.3;filter:drop-shadow(0 0 8px #ff3b2a) brightness(1.4)}100%{scale:1;filter:none}}
#hud .health-counter.count-heal .ui-icon{animation:count-heal .6s ease-out}
@keyframes count-heal{0%{scale:1.3;filter:drop-shadow(0 0 8px #6fe08a) brightness(1.3)}100%{scale:1;filter:none}}
/* W-151 (#51) rec 7, "a win moment": on the last kill the board holds a beat (main.js WIN_MS) while "Victory" stamps
   over it and the towers flare from the middle out (scene.js celebrate); a tap skips it. Then the last word, and the
   reward rises whole from the board (it no longer deals in piece by piece). */
.win-stamp{position:absolute;inset:0;z-index:30;display:grid;place-items:center;pointer-events:auto;cursor:pointer;-webkit-tap-highlight-color:transparent}/* over the board, it takes the tap that cuts it short */
.win-stamp.leaving{pointer-events:none}
.win-stamp::before{content:'';position:absolute;left:0;right:0;top:50%;height:150px;translate:0 -50%;background:radial-gradient(ellipse 60% 50% at center,#0b1020b0,#0b102000);animation:win-dim .35s ease-out both}
.win-stamp::after{content:'';position:absolute;left:50%;top:50%;width:80px;height:80px;margin:-40px 0 0 -40px;border-radius:50%;border:3px solid #ffe7a0;box-shadow:0 0 18px #ffd77a;animation:win-ring .65s .2s ease-out both}
.win-stamp b{position:relative;font:900 clamp(46px,14vw,78px)/1 "Iowan Old Style","Palatino Linotype",Palatino,Georgia,serif;letter-spacing:.06em;text-transform:uppercase;color:#f1d58f;background:linear-gradient(180deg,#fff3c4 0%,#f1d58f 38%,#c8923f 62%,#f4d98e 100%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;filter:drop-shadow(0 2px 0 #5b3a1c) drop-shadow(0 0 16px #ffd77a99) drop-shadow(0 6px 14px #000c);animation:win-stamp .52s linear both}
.win-stamp.leaving{animation:win-out .3s ease-in both}
@keyframes win-stamp{0%{opacity:.25;scale:2.6;rotate:-9deg;animation-timing-function:cubic-bezier(.55,0,.9,.55)}40%{opacity:1;scale:.9;rotate:-3deg;animation-timing-function:ease-out}62%{scale:1.05}100%{opacity:1;scale:1;rotate:-3deg}}/* falls faster and faster, lands at .2 s, bounces */
@keyframes win-dim{from{opacity:0}}
@keyframes win-ring{from{opacity:1;scale:.6}to{opacity:0;scale:5}}
@keyframes win-out{to{opacity:0;scale:1.08}}
.win-sequence{animation:reward-rise .4s cubic-bezier(.2,.9,.3,1.05) backwards}
@keyframes reward-rise{from{opacity:0;translate:0 48px;scale:.97}}
.view-ghost .win-sequence{animation:none}/* the frozen copy that fades out as you leave (view-fade.js) does not rise again */
@media (prefers-reduced-motion:reduce){.win-stamp,.win-stamp::before,.win-stamp::after,.win-stamp b,.win-sequence{animation:none}}
/* W-151 (#51) rec 8, "cards that play" (card-play.js): a played card leaves the hand for where it went (its tile, its
   tower, the square it was aimed at) or bursts where it was; a selected spell a second tap casts says so. */
#hand>.card-flight{z-index:40;flex:none;pointer-events:none;will-change:transform,opacity}/* fixed where it flies (inline), still in the hand */
.card-burst{position:absolute;z-index:41;border-radius:50%;border:3px solid var(--burst,#f3d27a);box-shadow:0 0 18px var(--burst,#f3d27a),inset 0 0 14px var(--burst,#f3d27a);pointer-events:none;animation:card-burst .42s ease-out both}
@keyframes card-burst{from{opacity:1;scale:.3}to{opacity:0;scale:2.2}}
.card-spark{position:absolute;z-index:41;width:8px;height:8px;margin:-4px 0 0 -4px;border-radius:50%;background:var(--burst,#f3d27a);box-shadow:0 0 7px var(--burst,#f3d27a);pointer-events:none}
.cast-hint{position:absolute;left:5px;right:5px;top:40%;z-index:3;padding:4px 3px;border-radius:7px;background:#1d2b30eb;color:#fff3cf;font:800 11px/1.15 system-ui,-apple-system,sans-serif;letter-spacing:0;text-align:center;text-transform:none;box-shadow:0 0 0 1px #f3d27a,0 2px 6px #0008;pointer-events:none;animation:cast-hint .9s ease-in-out infinite alternate}
@keyframes cast-hint{from{translate:0 0}to{translate:0 -3px}}
@media (prefers-reduced-motion:reduce){.cast-hint{animation:none}}

/* W-158 (#80, #81) the phone: the board runs behind the bands. The designer (2026-10-21, on the phone in Era II): "the bar
   at the top where items and relics sit, let's make that the same translucent effect we added to the desktop design.
   Let's also do that for the cards at the bottom"; "we waist a lot of space at the top. The game board already feels a
   bit small on mobile so let's be more efficient with that space"; "there is also wasted space at the bottom we can play
   with". The canvas leaves its wrap by the HUD and the items strip above and the hand (and an open inspector) below
   (band-cover.js sets --top-cover and --hand-cover); those bands turn to a dark glass (the era's tray colour over a
   blur) with the board moving behind them, and the camera keeps the grid in the visible middle (scene.js). The frame's
   top and bottom lines go, and in a fight the action bar takes the home bar's inset into its own padding, so the bar
   runs to the screen's edge with its buttons above the home bar. Everything but the laptop (wide.css's query). */
@media not all and (min-width:960px) and (min-height:600px) and (min-aspect-ratio:5/4){
#game{--band:#2a2219;--band-glass:64%;--band-blur:8px;border-top-width:0;border-bottom-width:0}
#game:is([data-era="2"],[data-era="3"],[data-era="4"]){--band:var(--era-tray)}
#game #board-wrap{overflow:visible;background:none}
#game #board{position:absolute;left:0;width:100%;top:calc(-1 * var(--top-cover,0px));height:calc(100% + var(--top-cover,0px) + var(--hand-cover,0px));z-index:0}
#game #hud,#game #hud-strip,#game #battle-view #hand{position:relative;z-index:3;background:color-mix(in srgb,var(--band) var(--band-glass),transparent);backdrop-filter:blur(var(--band-blur));-webkit-backdrop-filter:blur(var(--band-blur))}
#game #inspector,#game #actions{position:relative;z-index:2}
#game[data-phase="battle"]{padding-bottom:0}
#game[data-phase="battle"] #actions{height:auto;padding:7px 7px calc(10px + var(--safe-bottom,env(safe-area-inset-bottom,0px)))}
}

/* #154: the dip from a won fight into its reward (view-fade.js dipOutLive): the table's colour, under the HUD, over the
   leaving battle; the enemy card keeps its place under it rather than vanishing first. */
.view-dip{position:absolute;left:0;right:0;bottom:0;z-index:31;pointer-events:none;background:radial-gradient(ellipse at 50% 45%,#0000 45%,#0000005c),var(--tc-table,#2a231c)}
#game[data-screen="v19"].view-dipping>#opponent{display:flex}
/* #157: a card you can play during a live wave: a glowing gold border that breathes. Mana is the live .unaffordable mark. */
#battle-view.live-wave #hand .card.playable:not(.dealt,.unaffordable){box-shadow:0 0 0 2px #f2cf6b,0 0 14px 2px #f2cf6bb3,0 6px 16px #000a;animation:card-playable 1.6s ease-in-out infinite alternate}
@keyframes card-playable{from{box-shadow:0 0 0 2px #f2cf6b,0 0 8px 1px #f2cf6b80,0 6px 16px #000a}to{box-shadow:0 0 0 2px #ffe08a,0 0 18px 4px #f2cf6bcc,0 6px 16px #000a}}
@media (prefers-reduced-motion:reduce){#battle-view.live-wave #hand .card.playable:not(.dealt,.unaffordable){animation:none}}

