/* A lorebook in Dreamer's house style, "The Show" (his pick 2026-10-28; docs/superpowers/specs/2026-10-28-lorebook-dreamer-house-style-design.md):
   a showbill at night. The colours are lorebook_house.PALETTE (the gate holds this block equal to it): night and hat navy for the
   ground, his compass gold for marks and the selected, the fire orb's ember and the water orb's spiral blue for what you click.
   Faces: Anton for titles, Barlow for reading, Caveat Brush for Dreamer's own lines, JetBrains Mono for labels. */
:root {
  --space-2xs: 2px; --space-xs: 4px; --space-sm: 8px; --space-md: 12px; --space-lg: 16px; --space-xl: 24px;
  --space-2xl: 32px; --space-3xl: 48px;
  --radius-sm: 2px; --radius-md: 3px; --radius-lg: 4px; --radius-full: 9999px;
  --color-bg: #100d22; --color-surface: #161433; --color-surface-elev: #1e1c45; --color-surface-overlay: #28265a;
  --color-border-subtle: #2c2a55; --color-border-strong: #45427a;
  --color-text: #f4eddc; --color-text-muted: #aeb0d2; --color-text-faint: #8a8cb4;
  --color-accent: #3fc7ff; --color-accent-hover: #f5cb6e; --color-accent-soft: #3fc7ff; --color-selected-bg: #e9b64a;
  --color-danger: #ff6b7a; --color-success: #46d37f; --color-warning: #e9b64a; --color-info: #3fc7ff;
  --color-text-on-accent: #100d22;
  --night: #100d22; --hat: #1d2457; --gold: #e9b64a; --ember: #ff5a2a; --spiral: #3fc7ff; --paper: #f4eddc; --mute: #aeb0d2;
  --green: #46d37f; --red: #ff6b7a;
  --hairline: rgba(244, 237, 220, .14);
  --font-show: Anton, Impact, "Arial Narrow", sans-serif;
  --font-ui: Barlow, "Segoe UI", Ubuntu, "DejaVu Sans", system-ui, sans-serif;
  --font-hand: "Caveat Brush", "Comic Sans MS", cursive;
  --font-mono: "JetBrains Mono", "DejaVu Sans Mono", Consolas, monospace;
  --side: 232px;
  color-scheme: dark;
}
@font-face { font-family: Anton; font-weight: 400; font-display: swap; src: url(fonts/anton-400.woff2) format("woff2"); }
@font-face { font-family: Barlow; font-weight: 400; font-display: swap; src: url(fonts/barlow-400.woff2) format("woff2"); }
@font-face { font-family: Barlow; font-weight: 500; font-display: swap; src: url(fonts/barlow-500.woff2) format("woff2"); }
@font-face { font-family: Barlow; font-weight: 600 700; font-display: swap; src: url(fonts/barlow-600.woff2) format("woff2"); }
@font-face { font-family: "Caveat Brush"; font-weight: 400; font-display: swap; src: url(fonts/caveat-brush-400.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400 800; font-display: swap; src: url(fonts/jetbrains-mono.woff2) format("woff2"); }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--color-bg); color: var(--color-text); }
body { font: 16px/1.6 var(--font-ui); }
a { color: var(--color-accent-soft); text-decoration: none; }
a:hover { text-decoration: underline; }
.prose a, .infobox a, .crumbs a, .lede a, .say a, .note a, .pop a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a.card, .prose a.card, .say a.card { text-decoration: none; }   /* a card is a link in itself: no underline on its text */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .card:focus-visible,
.results a:focus-visible, nav.side a:focus-visible, .tabs a:focus-visible, .tile:focus-visible, .dchips a:focus-visible, .dchips button:focus-visible, .bannerlinks a:focus-visible {
  outline: 2px solid var(--color-accent-soft); outline-offset: 2px;
}
nav.side a.on:focus-visible, .tabs a.on:focus-visible, button.primary:focus-visible { outline-color: var(--color-text); }
.results a:focus-visible { outline-offset: -2px; }
img { max-width: 100%; height: auto; }   /* an art picture carries its folder's size: its box holds before it loads */
[hidden] { display: none !important; }
main:focus, h2[tabindex="-1"]:focus { outline: none; }   /* focus moved there by script, for screen readers: no ring */
h1, h2, h3 { line-height: 1.2; margin: 0 0 var(--space-md); }
/* headings a clear step above the 17px prose (NN/g layer-cake scanning; research/lorebook-layout.md) */
/* titles on the poster face, level (the lean is the home panel's alone); reading stays on Barlow */
h1 { font: 400 clamp(30px, 4.2vw, 44px)/1.02 var(--font-show); letter-spacing: .01em; text-transform: uppercase; color: var(--paper);
  overflow-wrap: break-word; text-wrap: balance; }   /* a word breaks only where it cannot fit whole */
h2 { font: 400 24px/1.1 var(--font-show); letter-spacing: .02em; text-transform: uppercase; margin-top: var(--space-2xl);
  padding: var(--space-2xs) 0 var(--space-xs) var(--space-md);
  border-left: 4px solid var(--gold); border-bottom: 1px solid var(--color-border-subtle); scroll-margin-top: 96px; }
h3 { font-size: 17px; font-weight: 600; margin-top: var(--space-xl); color: var(--color-text); scroll-margin-top: 96px; }
p { margin: 0 0 var(--space-md); }
code, kbd { font-family: var(--font-mono); font-size: 13px; }
p code, li code { padding: var(--space-2xs) var(--space-xs); border-radius: var(--radius-sm); background: var(--color-surface-elev); }

/* top bar */
.top { position: sticky; top: 0; z-index: 1100; display: flex; align-items: center; gap: var(--space-lg);
  padding: var(--space-sm) var(--space-lg); background: var(--night); border-bottom: 1px solid rgba(233, 182, 74, .35); }
.brand { display: flex; align-items: center; gap: var(--space-sm); font: 400 21px/1 var(--font-show); letter-spacing: .03em;
  text-transform: uppercase; color: var(--paper); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }   /* the shell's symbols (the compass rose) */
.brand svg { width: 28px; height: 28px; flex: none; color: var(--gold); }
.brand small { display: block; margin-top: var(--space-2xs); font: 500 11px/1.2 var(--font-mono); color: var(--color-text-muted);
  letter-spacing: .1em; text-transform: uppercase; }
.menu-btn { display: none; }
.search { position: relative; flex: 1; max-width: 560px; }
.search input { width: 100%; }
.play { margin-left: auto; white-space: nowrap; }   /* a ticket (below); night text on gold, 10.2:1 */
.results { position: absolute; left: 0; right: 0; top: calc(100% + var(--space-xs)); max-height: 70vh; overflow: auto;
  background: var(--color-surface-elev); border: 1px solid var(--color-border-strong); border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .5); z-index: 1400; }
.results a { display: flex; gap: var(--space-md); align-items: center; padding: var(--space-sm) var(--space-md); color: var(--color-text); }
.results a:hover, .results a.on { background: var(--color-surface-overlay); text-decoration: none; }
.results img { width: 36px; height: 36px; object-fit: cover; border-radius: var(--radius-sm); flex: none; }
.results .kind { margin-left: auto; color: var(--color-text-muted); font-size: 11px; }

/* layout */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: calc(100vh - 56px); }
nav.side { position: sticky; top: 56px; align-self: start; height: calc(100vh - 56px); overflow: auto;
  padding: var(--space-lg) var(--space-sm); border-right: 1px solid var(--color-border-subtle); background: var(--color-surface); }
nav.side .grp { margin: var(--space-md) var(--space-sm) var(--space-xs); color: var(--gold); font: 700 11px/1.4 var(--font-mono);
  letter-spacing: .14em; text-transform: uppercase; }
nav.side a { display: flex; justify-content: space-between; padding: var(--space-xs) var(--space-sm); border-radius: var(--radius-sm); color: var(--color-text-muted); }
nav.side a:hover { background: var(--color-surface-elev); color: var(--color-text); text-decoration: none; }
nav.side a.on { background: var(--color-selected-bg); color: var(--color-text-on-accent); }
nav.side a.allworlds { color: var(--gold); border-bottom: 1px solid var(--hairline); border-radius: 0; margin-bottom: var(--space-xs); }
nav.side a span { color: var(--color-text-muted); font-size: 11px; }
nav.side a.on span { color: var(--color-text-on-accent); }
/* one centred reading width on big screens (Vector 2022 caps content at 960-1244px) */
main { padding: var(--space-xl) var(--space-2xl) var(--space-3xl); min-width: 0; width: 100%; max-width: 1320px; margin-inline: auto; }
.crumbs { color: var(--color-text-muted); font: 500 12px/1.5 var(--font-mono); letter-spacing: .08em; text-transform: uppercase;
  margin-bottom: var(--space-sm); }
.lede { color: var(--color-text-muted); max-width: 72ch; }

/* controls */
input, select, textarea, button { font: inherit; color: var(--color-text); background: var(--color-surface-elev);
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-md); padding: var(--space-sm) var(--space-md); }
input::placeholder, textarea::placeholder { color: var(--color-text-muted); }
button { cursor: pointer; }
button:hover { background: var(--color-surface-overlay); }
button.primary { background: var(--color-selected-bg); border-color: var(--color-selected-bg); color: var(--color-text-on-accent); }
button.primary:hover { background: var(--color-accent-hover); }
.filters { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin: var(--space-lg) 0; align-items: center; }
.filters input[type=search] { min-width: 240px; flex: 1; max-width: 360px; }
.count { color: var(--color-text-muted); font-size: 13px; }

/* cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: var(--space-md); }
.grid.wide { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.card { display: block; background: var(--color-surface); border: 1px solid var(--hairline); border-radius: var(--radius-lg);
  overflow: hidden; color: var(--color-text); }
.card:hover { border-color: var(--gold); background: var(--color-surface-elev); text-decoration: none; transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--gold); }   /* lifted off the page with the house's hard gold shadow */
.card .pic { aspect-ratio: 1 / 1; background: var(--color-surface-elev); }
.card .pic.land { aspect-ratio: 16 / 9; }
.card .pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .body { padding: var(--space-sm) var(--space-md) var(--space-md); }
.card .t { font-weight: 600; line-height: 1.3; }
.card .s { color: var(--color-text-muted); font-size: 13px; margin-top: var(--space-2xs); }
.card .x { color: var(--color-text-muted); font-size: 13px; margin-top: var(--space-xs); display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden; }
.more { margin: var(--space-xl) auto 0; display: block; }
.tag { display: inline-block; padding: 0 var(--space-sm); border-radius: var(--radius-sm); font: 500 11px/20px var(--font-mono);
  letter-spacing: .06em; text-transform: uppercase;
  background: var(--color-surface-overlay); color: var(--color-text-muted); margin: 0 var(--space-xs) var(--space-xs) 0; }
.tag.weak, .tag.strong, .tag.boss { color: var(--color-text); border-left: 3px solid; }
.tag.weak { border-left-color: var(--color-success); } .tag.strong { border-left-color: var(--color-warning); } .tag.boss { border-left-color: var(--color-danger); }

/* article + infobox */
.article { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--space-2xl); align-items: start; }
.article.wide { grid-template-columns: minmax(0, 1fr); }
.article > .infobox { position: sticky; top: calc(var(--top-h, 56px) + var(--space-lg)); }
.prose > p, .prose > ul, .prose > h2, .prose > h3 { max-width: 72ch; }
.prose > p, .prose > ul { font-size: 17px; line-height: 1.7; }
.prose li { margin-bottom: var(--space-xs); }
.lede { font-size: 17px; line-height: 1.6; }
/* the right rail: infobox, then "On this page" (sticky, Vector 2022's TOC) */
.rail { display: flex; flex-direction: column; gap: var(--space-lg); position: sticky; top: calc(var(--top-h, 56px) + var(--space-lg));
  max-height: calc(100vh - var(--top-h, 56px) - var(--space-xl)); overflow: auto; }
.tocgrid { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: var(--space-2xl); align-items: start; }
.toc { padding: var(--space-md) var(--space-lg); background: var(--color-surface); border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg); font-size: 13px; }
.toc b { display: block; margin-bottom: var(--space-sm); color: var(--color-text-muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.toc button { display: block; width: 100%; text-align: left; background: none; border: 0; border-left: 2px solid var(--color-border-subtle);
  border-radius: 0; padding: var(--space-xs) var(--space-sm); color: var(--color-text-muted); font-size: 13px; }
.toc button:hover { color: var(--color-text); background: var(--color-surface-elev); }
.toc button:focus-visible { outline: 2px solid var(--color-accent-soft); outline-offset: -2px; }
h2.cap { text-transform: capitalize; }
.toc button.on { color: var(--color-text); border-left-color: var(--color-accent); }
.totop { position: fixed; right: var(--space-lg); bottom: calc(var(--space-lg) + env(safe-area-inset-bottom, 0px)); z-index: 1100;
  border-radius: var(--radius-full); padding: var(--space-sm) var(--space-lg); box-shadow: 0 4px 16px rgba(0, 0, 0, .4); }
.kindhead { display: flex; align-items: baseline; gap: var(--space-sm); }
.kindhead .count { font-weight: 400; }
.tabs { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin: 0 0 var(--space-lg); }
.tabs a { padding: var(--space-xs) var(--space-md); border-radius: var(--radius-full); border: 1px solid var(--color-border-strong);
  color: var(--color-text-muted); font-size: 13px; }
.tabs a:hover { background: var(--color-surface-elev); text-decoration: none; }
.tabs a.on { background: var(--color-selected-bg); border-color: var(--color-selected-bg); color: var(--color-text-on-accent); }
.prose ul { padding-left: var(--space-xl); margin: 0 0 var(--space-md); }
.prose strong { color: var(--color-text); }
.infobox { background: var(--color-surface); border: 1px solid var(--color-border-subtle); border-radius: var(--radius-lg); overflow: hidden; }
.infobox .hd { padding: var(--space-md); font: 400 20px/1.1 var(--font-show); letter-spacing: .03em; text-transform: uppercase;
  text-align: center; background: var(--hat); border-bottom: 2px solid var(--gold); }
.infobox img { display: block; width: 100%; }
.infobox dl { margin: 0; padding: var(--space-sm) var(--space-md) var(--space-md); display: grid; grid-template-columns: 96px 1fr; gap: var(--space-xs) var(--space-md); font-size: 13px; }
.infobox dt { color: var(--color-text-muted); }
.infobox dd { margin: 0; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--space-md); }
.gallery figure { margin: 0; background: var(--color-surface); border: 1px solid var(--color-border-subtle); border-radius: var(--radius-lg); overflow: hidden; }
.gallery img, .gallery .noimg { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: var(--color-surface-elev); }
.gallery figcaption { padding: var(--space-sm) var(--space-md) var(--space-md); font-size: 13px; color: var(--color-text-muted); }
.gallery figcaption b { display: block; color: var(--color-text); margin-bottom: var(--space-2xs); }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
.tablewrap { overflow-x: auto; }
th, td { text-align: left; padding: var(--space-sm) var(--space-md); border-bottom: 1px solid var(--color-border-subtle); vertical-align: top; }
.sortby { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; }
.sortby:hover { color: var(--color-text); }
.sortby:focus-visible { outline: 2px solid var(--color-accent-soft); outline-offset: 2px; }
th { color: var(--gold); font: 700 11px/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .1em; }

/* home: the showbill. A leaning panel (the act, Dreamer's line, the name with its last word lit over a spiral-blue swoosh, the
   tickets) beside the stage: the world's logo card tilted in a paper frame, Dreamer's host card over its corner, his bubble */
.showbill { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: var(--space-2xl); align-items: center; padding: var(--space-2xl) var(--space-2xl) var(--space-3xl);
  border: 1px solid var(--hairline); border-radius: var(--radius-lg);
  background: radial-gradient(120% 90% at 85% 10%, rgba(29, 36, 87, .95) 0%, transparent 55%),
              radial-gradient(80% 70% at 10% 100%, rgba(255, 90, 42, .14) 0%, transparent 60%), var(--night); }
.showbill .sigil { right: -60px; bottom: -80px; width: 380px; height: 380px; }
.showbill .panel { position: relative; padding: var(--space-xl) var(--space-xl) var(--space-2xl); transform: skewX(-4deg);
  background: linear-gradient(160deg, rgba(29, 36, 87, .92), rgba(16, 13, 34, .94)); border: 1px solid rgba(233, 182, 74, .35);
  box-shadow: 8px 8px 0 rgba(255, 90, 42, .85); }
.showbill .panel > * { transform: skewX(4deg); }   /* the panel leans, its words stand level */
.showbill .panel > .marquee { transform: none; }
.showbill .panel > .patter { margin-top: var(--space-md); transform: skewX(4deg) rotate(-2deg); }
.showbill h1 { margin: 0; font-size: clamp(40px, 5.4vw, 84px); line-height: .9; }
.showbill h1 .hot { display: block; position: relative; width: fit-content; color: var(--ember); }
.showbill h1 .hot::after { content: ""; position: absolute; left: 2%; right: -6%; bottom: -8px; height: 6px; background: var(--spiral);
  transform: skewX(-24deg) rotate(-1.5deg); }
.showbill .lede { margin: var(--space-xl) 0 0; max-width: 44ch; color: var(--mute); }
.acts { display: flex; flex-wrap: wrap; gap: var(--space-md); margin-top: var(--space-lg); }
.stage { position: relative; }
.stage .art { transform: rotate(1.5deg); border: 3px solid var(--paper); box-shadow: -8px 12px 0 var(--hat); background: var(--night); }
.stage .art img { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; }
.stage .host { position: absolute; left: -24px; bottom: -40px; width: 30%; max-width: 150px; border: 3px solid var(--gold);
  transform: rotate(-6deg); box-shadow: 6px 6px 0 var(--ember); background: var(--night); }
.stage .host img { display: block; width: 100%; height: auto; }
.stage .bubble { position: absolute; right: 0; top: -24px; max-width: 220px; margin: 0; padding: var(--space-sm) var(--space-md);
  font: 22px/1.05 var(--font-hand); color: var(--night); background: var(--paper); transform: rotate(3deg); box-shadow: 4px 4px 0 var(--ember); }
/* district accents: --dc is the district's hue (pages.js dcol) */
.card.dc { border-top: 3px solid var(--dc); }
.card.tool .t { color: var(--color-accent-soft); }
h1.dh { display: inline-block; padding-bottom: var(--space-xs); border-bottom: 3px solid var(--dc); }
.dchips { display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.dchips a, .dchips button { display: inline-flex; align-items: center; gap: var(--space-sm); padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full); border: 1px solid var(--color-border-strong); background: var(--color-surface); color: var(--color-text); font: inherit; cursor: pointer; }
.dchips a:hover, .dchips button:hover { border-color: var(--dc); text-decoration: none; }
.dchips i { width: 10px; height: 10px; border-radius: var(--radius-full); background: var(--dc); flex: none; }
.dchips.small { margin-bottom: var(--space-md); }
.dchips.small button { font-size: 13px; padding: var(--space-2xs) var(--space-sm); }
.dchips button[aria-pressed="true"] { border-color: var(--dc); background: var(--color-surface-elev); }
.pin.dc { border-color: var(--dc); }
.pin.dc .lbl { border-left: 3px solid var(--dc); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--space-md); margin: var(--space-xl) 0; }
.tile { display: block; padding: var(--space-md) var(--space-lg); background: var(--color-surface); border: 1px solid var(--hairline);
  border-radius: var(--radius-lg); color: var(--color-text); }
.tile:hover { border-color: var(--gold); text-decoration: none; transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--gold); }
.tile b { display: block; font: 400 32px/1.05 var(--font-show); color: var(--paper); font-variant-numeric: tabular-nums; }
.tile span { color: var(--gold); font: 700 11px/1.4 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; }
.hero { display: block; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--color-border-subtle); max-width: 980px; }
.hero img { display: block; width: 100%; }

/* map */
.mapbar { display: flex; flex-wrap: wrap; gap: var(--space-sm); align-items: center; margin-bottom: var(--space-md); }
.map { position: relative; height: calc(100vh - 210px); min-height: 420px; overflow: hidden; background: var(--color-surface);
  border: 1px solid var(--color-border-subtle); border-radius: var(--radius-lg); touch-action: none; cursor: grab; }
.map.drag { cursor: grabbing; }
.map .stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.map .stage img { display: block; width: 1000px; height: 1000px; max-width: none; user-select: none; -webkit-user-drag: none; }
.pin { position: absolute; width: 14px; height: 14px; border-radius: var(--radius-full); padding: 0;
  background: var(--color-accent); border: 2px solid var(--color-text); box-shadow: 0 0 0 2px rgba(0, 0, 0, .5); cursor: pointer; }
.pin.simple { background: var(--color-info); width: 10px; height: 10px; }
.pin.wilderness { background: var(--color-success); }
.pin::after { content: ""; position: absolute; inset: -8px; border-radius: var(--radius-full); }
.pin.dim { opacity: .2; }
.pin.on { background: var(--color-warning); width: 18px; height: 18px; }
/* labels: a translucent chip so the name reads over busy art; only labels that fit without overlapping show (pages.js) */
.pin .lbl { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); white-space: nowrap; font-size: 13px; font-weight: 600;
  color: var(--color-text); padding: var(--space-2xs) var(--space-sm); border-radius: var(--radius-sm);
  background: rgba(16, 13, 34, .68); backdrop-filter: blur(2px); box-shadow: 0 1px 4px rgba(0, 0, 0, .35); pointer-events: none; }
.pin.complex .lbl { font-size: 15px; }
.pin .lbl.left { left: auto; right: 16px; }
.pin.on .lbl { background: rgba(29, 36, 87, .94); border-left-color: var(--gold); }
.pop { position: absolute; right: var(--space-md); top: var(--space-md); width: 300px; max-height: calc(100% - 24px); overflow: auto;
  background: var(--color-surface-elev); border: 1px solid var(--color-border-strong); border-radius: var(--radius-lg); z-index: 5; }
.pop img { display: block; width: 100%; }
.pop .body { padding: var(--space-md); font-size: 13px; }
.zoom { position: absolute; left: var(--space-md); bottom: var(--space-md); display: flex; gap: var(--space-xs); z-index: 5; }

/* what to say + bench */
.say { background: var(--color-surface); border: 1px solid var(--color-border-subtle); border-radius: var(--radius-lg); padding: var(--space-lg); margin-bottom: var(--space-lg); }
.line { display: flex; gap: var(--space-sm); align-items: center; margin: var(--space-xs) 0; }
.line code { flex: 1; padding: var(--space-sm) var(--space-md); background: var(--color-bg); border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md); color: var(--color-text); white-space: pre-wrap; }
.ok { color: var(--color-success); } .no { color: var(--color-danger); } .warn { color: var(--color-warning); }
.verdict { padding: var(--space-md); border-radius: var(--radius-md); background: var(--color-bg); border: 1px solid var(--color-border-subtle); margin: var(--space-md) 0; }
.beat { white-space: pre-wrap; font-size: 13px; color: var(--color-text-muted); background: var(--color-bg); border-left: 3px solid var(--color-accent);
  padding: var(--space-sm) var(--space-md); margin: var(--space-sm) 0; border-radius: 0 var(--radius-md) var(--radius-md) 0; }
.form { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: var(--space-sm) var(--space-md); align-items: center; max-width: 820px; }
.form label { color: var(--color-text-muted); font-size: 13px; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-xl); }
audio { width: 100%; height: 36px; }
/* connections web (depth.js) */
.web { margin: 0 0 var(--space-lg); max-width: 560px; }
.web svg { width: 100%; height: auto; display: block; background: var(--color-surface); border: 1px solid var(--color-border-subtle); border-radius: var(--radius-lg); }
.web line { stroke-width: 2; }
.webboth, .keyboth { stroke: var(--color-accent-soft); background: var(--color-accent-soft); }
.webnames, .keynames { stroke: var(--color-success); background: var(--color-success); }
.webnamed, .keynamed { stroke: var(--color-warning); background: var(--color-warning); }
.webfac, .keyfac { stroke: var(--color-info); background: var(--color-info); stroke-dasharray: 6 4; }
.webhome, .keyhome { stroke: var(--color-border-strong); background: var(--color-border-strong); stroke-dasharray: 2 4; }
.dchips.inline { display: inline-flex; vertical-align: middle; margin-right: var(--space-sm); }
.webring { fill: var(--color-surface-elev); stroke: var(--color-border-strong); stroke-width: 2; }
.webnone { fill: var(--color-surface-overlay); }
.weblbl { fill: var(--color-text); font-size: 13px; }
.web a:focus-visible .webring, .web a:hover .webring { stroke: var(--color-accent-soft); }
.key { display: inline-block; width: 16px; height: 3px; vertical-align: middle; border-radius: var(--radius-sm); }
.compare { margin: 0 0 var(--space-lg); }
.compare summary, .ladder summary { cursor: pointer; color: var(--color-accent-soft); }
.compare summary:focus-visible, .ladder summary:focus-visible { outline: 2px solid var(--color-accent-soft); outline-offset: 2px; }
.cmpgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--space-md); margin-top: var(--space-md); }
.cmp td.cmpdiff { background: var(--color-surface); }
.cmp th[colspan] { padding-top: var(--space-lg); color: var(--color-accent-soft); }
.ladder ol { list-style: none; padding: 0; margin: var(--space-sm) 0 0; }
.ladder li { padding: var(--space-xs) 0; border-bottom: 1px solid var(--color-border-subtle); }
.ladder .lv { display: inline-block; min-width: 32px; font-weight: 700; color: var(--color-accent-soft); }
.note { color: var(--color-text-muted); font-size: 13px; }

/* the reader's layer (reader.js): the after-the-war switch and cover, link previews, been-there marks */
nav.side .navsw { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm); margin: var(--space-lg) var(--space-sm) 0;
  padding-top: var(--space-md); border-top: 1px solid var(--color-border-subtle); color: var(--color-text-muted); font-size: 13px; cursor: pointer; }
nav.side .navsw input { margin: 0; padding: 0; width: 16px; height: 16px; accent-color: var(--color-accent); }
nav.side .navsw .note { flex-basis: 100%; }
button.linkish { background: none; border: 0; padding: 0; color: var(--color-accent-soft); text-decoration: underline;
  text-decoration-thickness: 1px; text-underline-offset: 2px; font-size: inherit; }
button.linkish:hover { background: none; color: var(--color-text); }
.veil { max-width: 72ch; margin: var(--space-md) 0 var(--space-xl); padding: var(--space-md) var(--space-lg); background: var(--color-surface-elev);
  border: 1px solid var(--color-border-strong); border-left: 4px solid var(--color-warning); border-radius: var(--radius-md); }
.veil p:last-child { margin: 0; display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.veiled, .latebody { filter: blur(10px); opacity: .5; pointer-events: none; user-select: none; max-height: 60vh; overflow: hidden; }
/* a pre-rendered after-the-war page is covered before any script runs; the shell's head script sets html.showlate for a reader who
   chose to see everything */
html.showlate .latebody { filter: none; opacity: 1; pointer-events: auto; user-select: auto; max-height: none; overflow: visible; }
html.showlate .veil.static { display: none; }
#preview { position: absolute; z-index: 1400; width: 320px; background: var(--color-surface-elev); border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg); box-shadow: 0 8px 32px rgba(0, 0, 0, .5); overflow: hidden; font-size: 13px; }
#preview .pv-pic { height: 160px; background: var(--color-surface); }
#preview .pv-pic.tall { height: 200px; }
#preview .pv-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
#preview .pv-pic.tall img { object-position: top; }
#preview .pv-body { padding: var(--space-sm) var(--space-md) var(--space-md); }
#preview .pv-k { color: var(--color-text-muted); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
#preview .pv-t { font-weight: 700; font-size: 15px; margin: var(--space-2xs) 0 var(--space-xs); line-height: 1.3; }
#preview p { margin: 0; color: var(--color-text); line-height: 1.5; }
.beenrow { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-md); margin: calc(-1 * var(--space-xs)) 0 var(--space-lg); }
button.been { display: inline-flex; align-items: center; gap: var(--space-sm); font-size: 13px; padding: var(--space-xs) var(--space-md); }
button.been::before { content: ""; width: 12px; height: 12px; border-radius: var(--radius-full); border: 2px solid var(--color-text-muted); flex: none; }
button.been[aria-pressed="true"] { border-color: var(--color-success); color: var(--color-text); }
button.been[aria-pressed="true"]::before { background: var(--color-success); border-color: var(--color-success); }
.popbtns { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin: var(--space-sm) 0 0; }
.pin.been { box-shadow: 0 0 0 2px rgba(0, 0, 0, .5), 0 0 0 5px var(--color-success); }
.dchips .prog { color: var(--color-text-muted); font-size: 11px; }
.dchips .prog:empty { display: none; }
.card.visited { position: relative; }
.card.visited::after { content: "✓"; position: absolute; top: var(--space-sm); right: var(--space-sm); width: 24px; height: 24px; line-height: 24px;
  text-align: center; border-radius: var(--radius-full); background: var(--color-success); color: var(--color-bg); font-weight: 800; font-size: 13px; }
.beenbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-md); color: var(--color-text-muted); font-size: 13px; }
.beenbar meter { width: 200px; height: 10px; }
@media (prefers-reduced-motion: no-preference) { #preview:not([hidden]) { animation: pv-in .12s ease-out; } }
@keyframes pv-in { from { opacity: 0; transform: translateY(-4px); } }

/* the house pieces (Dreamer's "The Show"): tickets, his lines, the act eyebrow, the compass watermark, the marquee */
/* a ticket, the house's button: lorebook_house.ticket_css, word for word (the root page draws the same); notches cut in the
   background so its hard offset shadow and focus ring show whole */
.ticket, .play { --tk: var(--gold); position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px;
  font: 400 17px/1 var(--font-show); letter-spacing: .06em; text-transform: uppercase; color: var(--night); border-radius: 0;
  box-shadow: 4px 4px 0 var(--ember);
  background: radial-gradient(circle at 0 50%, transparent 6px, var(--tk) 6.5px) left / 51% 100% no-repeat,
              radial-gradient(circle at 100% 50%, transparent 6px, var(--tk) 6.5px) right / 51% 100% no-repeat; }
.ticket small { font: 700 10px/1 var(--font-mono); letter-spacing: .12em; border-left: 2px dashed rgba(16, 13, 34, .5); padding-left: 8px; }
.ticket.blue { --tk: var(--spiral); box-shadow: 4px 4px 0 var(--hat); }
.ticket.hot { --tk: var(--ember); box-shadow: 4px 4px 0 var(--hat); }
.ticket:hover, .play:hover { --tk: var(--color-accent-hover); color: var(--night); text-decoration: none; }
.ticket.blue:hover, .ticket.hot:hover { --tk: var(--paper); }
.ticket:focus-visible, .play:focus-visible { outline: 3px solid var(--paper); outline-offset: 4px; }
/* Dreamer's own line, in his hand */
.patter { margin: 0 0 var(--space-xs); font: 26px/1.1 var(--font-hand); color: var(--gold); transform: rotate(-1.5deg);
  transform-origin: left center; }
/* the act line above a title: a mono label with a lit bulb */
.eye { display: flex; align-items: center; gap: var(--space-sm); font: 700 11px/1 var(--font-mono); letter-spacing: .18em;
  text-transform: uppercase; color: var(--spiral); }
.eye::before { content: ""; width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--spiral);
  box-shadow: 0 0 10px var(--spiral); flex: none; }
/* the compass rose, faint behind a page */
.sigil { position: absolute; pointer-events: none; color: var(--gold); opacity: .07; }
/* the marquee: a dotted bulb border that blinks, for a reader who allows motion */
.marquee { position: absolute; inset: 8px; border: 2px dotted rgba(233, 182, 74, .55); pointer-events: none;
  animation: bulbs 2.4s steps(1) infinite; }
@keyframes bulbs { 50% { border-color: rgba(255, 90, 42, .6); } }
@media (prefers-reduced-motion: no-preference) {
  .card, .tile, .ticket, .play { transition: transform .12s ease-out, box-shadow .12s ease-out, background-color .12s; }
}

@media (max-width: 900px) {
  /* phones: the panel, then the stage below it, everything inside the bill's own edges */
  .showbill { grid-template-columns: 1fr; padding: var(--space-lg) var(--space-lg) var(--space-3xl); gap: var(--space-2xl); }
  .showbill .panel { padding: var(--space-lg) var(--space-lg) var(--space-xl); transform: skewX(-2deg); box-shadow: 6px 6px 0 rgba(255, 90, 42, .85); }
  .showbill .panel > * { transform: skewX(2deg); }   /* half the lean on a phone: the panel's edge and shadow stay inside the bill */
  .showbill .panel > .marquee { transform: none; }
  .showbill .panel > .patter { transform: skewX(2deg) rotate(-2deg); }
  .showbill .sigil { width: 240px; height: 240px; right: -40px; bottom: -40px; }
  .stage { margin: var(--space-lg) var(--space-sm) 0; }
  .stage .host { left: 0; bottom: -32px; width: 28%; }
  .stage .bubble { right: 0; top: -20px; max-width: 64%; font-size: 17px; }
  .shell { grid-template-columns: 1fr; }
  .top { flex-wrap: wrap; gap: var(--space-sm); }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  nav.side { position: fixed; left: 0; top: var(--top-h, 104px); height: calc(100vh - var(--top-h, 104px)); width: 260px; z-index: 1300;
    transform: translateX(-100%); visibility: hidden; transition: transform .15s, visibility .15s; }
  nav.side.open { transform: none; visibility: visible; box-shadow: 0 0 40px rgba(0, 0, 0, .6); }
  .map { height: 62vh; min-height: 320px; }
  .pop { left: var(--space-sm); right: var(--space-sm); top: auto; bottom: var(--space-sm); width: auto; max-height: 45%; }
  .menu-btn { display: inline-block; }
  main { padding: var(--space-lg); }
  .article, .cols, .tocgrid { grid-template-columns: 1fr; }
  .rail, .article > .infobox { position: static; max-height: none; }
  .tocgrid > .rail, .article > .rail { order: -1; }   /* the infobox first on phones, as the pre-rendered page has it (an infobox moved
                                                      into the rail fell below the text: the page's largest paint waited for the app) */
  .infobox { order: -1; }
  .infobox img { max-height: 300px; object-fit: cover; object-position: top; }
  .form { grid-template-columns: 1fr; }
  .brand small { display: none; }
  /* a long name wraps in its own slot, so Menu, the name and Play keep one row */
  .brand { flex: 1; min-width: 0; font-size: 17px; line-height: 1.05; white-space: normal; }
  .brand svg { width: 22px; height: 22px; }
  .play .wide { display: none; }
}

/* last, so it wins over every earlier rule of the same weight (the phone menu's slide is set in the block above) */
@media (prefers-reduced-motion: reduce) {
  .marquee { animation: none; }
  nav.side { transition: none; }   /* the phone menu opens without sliding */
}
