/* Gotham AI — city layer (extends style.css) */
#city { position: fixed; inset: 0; width: 100%; height: 100%; display: block; background: #06090e; }
.city .radar { width: clamp(120px, 15vw, 180px); pointer-events: none; }
.city .keys { top: auto; bottom: max(16px, env(safe-area-inset-bottom)); }
.dir-btn { position: fixed; z-index: 3; right: var(--pad); top: calc(max(16px, env(safe-area-inset-top)) + 84px);
  font: 12px var(--display); letter-spacing: .06em; padding: 8px 12px; border-radius: 8px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(6px); }
.cam-btn { top: calc(max(16px, env(safe-area-inset-top)) + 128px); }
.map-btn { top: calc(max(16px, env(safe-area-inset-top)) + 172px); }
.sky-btn { top: calc(max(16px, env(safe-area-inset-top)) + 216px); }
.paper-btn { top: calc(max(16px, env(safe-area-inset-top)) + 260px); border-color: #ff3b4e; }
.lib-btn { top: calc(max(16px, env(safe-area-inset-top)) + 304px); border-color: #e8c46a; }
.snd-btn { top: calc(max(16px, env(safe-area-inset-top)) + 348px); }
.map-btn[aria-pressed="true"] { background: var(--neon); color: #04130e; border-color: var(--neon); }
body:has(.hq.open, .paper.open) :is(.pad, .keys, .prompt, .speedo, .radar, .toast, .dir-btn, .hud-r),
body:has(.title:not(.gone)) .dir-btn,
body:has(.map-btn[aria-pressed="true"]) :is(.pad, .keys, .prompt, .speedo, .radar, .dir-btn:not(.map-btn), .hud-r, .wheel) { visibility: hidden; }   /* city map: only the map button stays */

/* ---------- directory drawer ---------- */
.dir { position: fixed; z-index: 5; top: 0; right: 0; bottom: 0; width: min(380px, 92vw); padding: 20px; overflow: auto;
  background: rgba(10, 8, 18, .88); backdrop-filter: blur(10px); border-left: 1px solid var(--line);
  translate: 100%; transition: translate .3s ease; }
.dir.open { translate: 0; }
.dir header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.dir h2 { font: 20px var(--display); }
.dir header button { background: none; border: 0; font-size: 18px; }
.dir ul { list-style: none; padding: 0; display: grid; gap: 8px; }
.dir li { display: grid; grid-template-columns: 30px 1fr auto auto; grid-template-areas: "logo name gps taxi" "logo meta gps taxi"; gap: 6px; align-items: center; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); border-left: 4px solid var(--c); background: rgba(255, 255, 255, .03); }
.dir li[hidden] { display: none; }
.dir li b { grid-area: name; font: 14px var(--display); } .dir li small { grid-area: meta; font-size: 10px; letter-spacing: .2em; opacity: .6; }
.dir li [data-m=gps] { grid-area: gps; } .dir li [data-m=taxi] { grid-area: taxi; }
.dir li button { font: 11px var(--display); padding: 8px 10px; border-radius: 8px; background: var(--glass); border: 1px solid var(--c); }
.dir li button:hover { background: color-mix(in srgb, var(--c) 30%, transparent); }

/* ---------- HQ lobby ---------- */
.hq { position: fixed; inset: 0; z-index: 6; display: grid; grid-template-rows: auto 1fr; gap: 14px; padding: max(18px, env(safe-area-inset-top)) var(--pad) 18px;
  background: radial-gradient(90% 70% at 20% 0%, color-mix(in srgb, var(--neon) 22%, transparent), transparent 60%), linear-gradient(#0b0a14, #07060c);
  opacity: 0; visibility: hidden; transition: opacity .4s, visibility .4s; overflow: auto; }
.hq.open { opacity: 1; visibility: visible; }
.hq-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.hq-top small { font-size: 10px; letter-spacing: .35em; opacity: .65; }
.hq-top h2 { font: italic clamp(32px, 5vw, 60px)/1 var(--display); color: #ffd35a; -webkit-text-stroke: 2px #120e06; text-shadow: 0 4px 0 #120e06, 0 0 30px color-mix(in srgb, var(--neon) 50%, transparent); }
.hq-grid { display: grid; grid-template-columns: minmax(260px, .85fr) minmax(320px, 1.3fr) minmax(280px, 1fr); gap: 16px; min-height: 0; }
.hq-col { min-width: 0; display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 14px;
  background: rgba(255, 255, 255, .03); border: 1px solid var(--line); }
.hq-col h3 { font: 14px var(--display); letter-spacing: .06em; }
.note { font-size: 11px; opacity: .55; letter-spacing: .04em; }
@media (max-width: 1000px) { .hq-grid { grid-template-columns: 1fr; } .hq { grid-template-rows: auto auto; } }

/* board as a standalone LED panel (not perspective-mapped) */
.hq-board.board { position: relative; transform: none; width: 100%; aspect-ratio: 4 / 5; border-radius: 10px; font-size: 8.2cqw;
  background: #04060a; border: 1px solid color-mix(in srgb, var(--neon) 40%, transparent); box-shadow: 0 0 30px color-mix(in srgb, var(--neon) 20%, transparent), inset 0 0 40px #000; }
.hq-col:first-child { container-type: inline-size; }
.b-big { font: normal .3em var(--mono); letter-spacing: .15em; color: #ffcf8f; opacity: .8; }

/* chart */
.hq-h { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.seg-tog[hidden] { display: none; }
.seg-tog { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg-tog button { font: 11px var(--mono); letter-spacing: .12em; padding: 6px 10px; background: none; border: 0; }
.seg-tog [aria-pressed="true"] { background: var(--neon); color: #04130e; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; }
.legend span, .tip span { display: inline-flex; align-items: center; gap: 6px; }
.legend i, .tip i { width: 10px; height: 10px; border-radius: 3px; }
.chart { position: relative; min-height: 250px; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid line { stroke: rgba(255, 255, 255, .08); } .chart .grid text { fill: rgba(243, 237, 226, .5); font: 10px var(--mono); }
.chart .ctx path { stroke: rgba(255, 255, 255, .08); stroke-width: 1; fill: none; }
.chart .ln { stroke-width: 2; fill: none; stroke-linejoin: round; }
.chart .lin path { stroke-width: 2; fill: none; stroke-dasharray: 5 4; opacity: .5; }
.chart circle { stroke: #0b0e16; stroke-width: 2; }
.chart .xh { stroke: rgba(255, 255, 255, .4); stroke-dasharray: 3 3; } .chart .hit { fill: transparent; }
.chart .tip { position: absolute; top: 6px; display: grid; gap: 3px; padding: 8px 10px; border-radius: 8px; font-size: 11px; pointer-events: none;
  background: rgba(8, 8, 14, .92); border: 1px solid var(--line); box-shadow: 0 6px 20px #0008; }
.chart .tip[hidden] { display: none; }
.chart .tip em { font-style: normal; margin-left: auto; padding-left: 10px; color: var(--ink); font-variant-numeric: tabular-nums; }
.chart .empty { display: grid; place-items: center; min-height: 230px; text-align: center; opacity: .6; font-size: 12px; padding: 0 20px; }
details summary { cursor: pointer; font-size: 11px; letter-spacing: .1em; opacity: .7; }
details table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 11px; }
details th, details td { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--line); }

/* chat */
.hq-chat { min-height: 360px; }
.msgs { flex: 1; min-height: 160px; max-height: 52vh; overflow: auto; display: flex; flex-direction: column; gap: 8px; padding-right: 4px; user-select: text; }
.msg { max-width: 88%; padding: 9px 12px; border-radius: 12px; line-height: 1.45; white-space: pre-wrap; font-size: 13px; }
.msg.assistant { align-self: flex-start; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); }
.msg.user { align-self: flex-end; background: color-mix(in srgb, var(--neon) 28%, transparent); }
.msg.err { border-color: #e66767; color: #ffb3b3; }
.msg.typing::after { content: "▍"; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0 } }
.sugg { display: flex; flex-wrap: wrap; gap: 6px; }
.sugg button { font: 11px var(--mono); padding: 6px 10px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); }
.sugg button:hover { border-color: var(--neon); }
#hq-form { display: flex; gap: 8px; }
#hq-form input { flex: 1; min-width: 0; font: 14px var(--mono); color: var(--ink); padding: 10px 12px; border-radius: 10px; background: #0b0e16; border: 1px solid var(--line); user-select: text; }
#hq-form input:focus { outline: none; border-color: var(--neon); }
#hq-form button { font: 12px var(--display); padding: 0 16px; border-radius: 10px; border: 0; background: var(--neon); color: #04130e; }
.powered { font-size: 10px; letter-spacing: .12em; opacity: .55; } .powered b { color: #3ddc84; }

/* ---------- points + quiz ---------- */
.score { font: 15px var(--display); color: #ffd35a; text-shadow: 0 2px 0 #120e06, 0 0 14px rgba(255, 180, 60, .45); }
.score small { display: block; font: 10px var(--mono); letter-spacing: .2em; color: var(--ink); opacity: .7; text-shadow: none; }
.hq-acts { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.test-btn { font: 14px var(--display); padding: 13px 18px; border-radius: 12px; color: #1a1205; background: #ffd35a; border: 0;
  box-shadow: 0 0 22px rgba(255, 200, 80, .45); }
.qz { position: fixed; inset: 0; z-index: 9; display: grid; place-items: center; padding: 20px; background: rgba(4, 3, 8, .72);
  backdrop-filter: blur(6px); opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; }
.qz.open { opacity: 1; visibility: visible; }
.qz-card { width: min(560px, 100%); display: grid; gap: 16px; padding: 26px; border-radius: 18px; text-align: center;
  background: linear-gradient(#141020, #0b0a12); border: 1.5px solid var(--neon); box-shadow: 0 0 40px color-mix(in srgb, var(--neon) 35%, transparent); }
.qz.win .qz-card { border-color: #ffd35a; box-shadow: 0 0 60px rgba(255, 200, 80, .5); animation: pop .5s ease; }
@keyframes pop { 40% { transform: scale(1.04) } }
.qz-card h3 { font: clamp(18px, 2.6vw, 24px)/1.3 var(--display); }
.qz-prog { display: flex; gap: 6px; justify-content: center; }
.qz-prog i { width: 26px; height: 6px; border-radius: 3px; background: var(--line); } .qz-prog .done { background: var(--neon); } .qz-prog .now { background: #ffd35a; }
.qz-opts { display: grid; gap: 8px; }
.qz-opts button { display: flex; gap: 12px; align-items: center; text-align: left; padding: 13px 14px; border-radius: 12px; font: 15px var(--mono);
  background: rgba(255, 255, 255, .04); border: 1.5px solid var(--line); transition: background .15s, border-color .15s; }
.qz-opts button:hover { border-color: var(--neon); }
.qz-opts kbd { flex: none; }
.qz-opts .right { border-color: #6fd08c; background: rgba(111, 208, 140, .18); }
.qz-opts .wrong { border-color: #e66767; background: rgba(230, 103, 103, .18); }
.qz-opts .dim { opacity: .45; }
.qz-fb { min-height: 1.4em; font-size: 14px; } .qz-fb .gain { font: 22px var(--display); color: #ffd35a; }
.qz-close { justify-self: center; font: 12px var(--display); padding: 10px 16px; border-radius: 10px; background: var(--glass); border: 1px solid var(--line); }

/* ---------- 50-company layer: logos, facts, plan boards, funding ---------- */
.d-logo { grid-area: logo; width: 28px; height: 28px; color: var(--c); border-radius: 6px; object-fit: contain; }
.dir-q { width: 100%; margin-bottom: 12px; font: 14px var(--mono); color: var(--ink); padding: 10px 12px; border-radius: 10px;
  background: #0b0e16; border: 1px solid var(--line); user-select: text; }
.dir-q:focus { outline: none; border-color: var(--neon); }
.chips img { width: 16px; height: 16px; border-radius: 3px; }
.hq-id { display: flex; align-items: center; gap: 16px; min-width: 0; }
.hq-logo :is(svg, img) { display: block; width: clamp(44px, 6vw, 72px); height: clamp(44px, 6vw, 72px); color: var(--neon); border-radius: 14px;
  object-fit: contain; filter: drop-shadow(0 0 14px color-mix(in srgb, var(--neon) 55%, transparent)); }
.facts { display: flex; flex-wrap: wrap; gap: 4px 0; margin-top: 8px; font: 12px var(--mono); letter-spacing: .05em; opacity: .8; }
.facts span + span::before { content: "·"; margin: 0 10px; opacity: .5; }
img.b-logo { height: 1.1em; border-radius: .2em; object-fit: contain; }
.b-none { margin: auto; text-align: center; font: .62em var(--display); color: var(--amber); letter-spacing: .08em; }
.b-none small { display: block; margin-top: .7em; font: .5em var(--mono); color: #c4a676; letter-spacing: .1em; }
.stat { display: grid; place-content: center; gap: 8px; min-height: 230px; text-align: center; }
.stat b { font: clamp(40px, 6vw, 64px)/1 var(--display); color: var(--ink); }
.stat small { font: 11px var(--mono); letter-spacing: .2em; opacity: .65; text-transform: uppercase; }
:is(img.b-logo, img.d-logo, .hq-logo img, .chips img) { background: #f3ede2; padding: 2px; }
.chips .more { --c: #ffd35a; }
.hq { grid-template-columns: minmax(0, 1fr); }
.hq-top { flex-wrap: wrap; } .hq-top h2 { overflow-wrap: anywhere; }

/* ---------- mouse steering: virtual wheel position (cursor is hidden by pointer lock) ---------- */
.wheel { position: fixed; z-index: 3; left: 50%; bottom: max(40px, calc(env(safe-area-inset-bottom) + 28px)); translate: -50% 0; width: min(320px, 60vw); height: 8px;
  border-radius: 4px; background: rgba(255, 255, 255, .12); border: 1px solid var(--line); display: none; }
.wheel::before { content: ""; position: absolute; left: calc(50% - 1px); top: -5px; bottom: -5px; width: 2px; background: rgba(255, 255, 255, .45); }
.wheel i { position: absolute; top: 50%; left: 50%; width: 16px; height: 16px; translate: -50% -50%; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 12px #3ddc84; }
.wheel small { position: absolute; top: 16px; left: 50%; translate: -50% 0; white-space: nowrap; font: 10px var(--mono); letter-spacing: .14em; opacity: .7; }
body.mouse .wheel { display: block; } body.mouse .keys { visibility: hidden; }
body.mouse #city { cursor: crosshair; }
body.map #city { cursor: grab; touch-action: none; }
body.map #city:active { cursor: grabbing; }

/* ---------- The Times AI: street paper + newsroom ---------- */
.paper { position: fixed; inset: 0; z-index: 7; display: grid; place-items: center; padding: 16px; background: rgba(4, 4, 10, .72);
  backdrop-filter: blur(4px); opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; }
.paper.open { opacity: 1; visibility: visible; }
.pp, .hq-news { --ink2: #1a1712; --rule: #1a171240; background: #f3ead4 radial-gradient(ellipse at 50% 30%, #f8f1df, #e9dcbd); color: var(--ink2);
  font: 15px/1.45 Georgia, "Times New Roman", serif; }
.pp { width: min(1180px, 100%); max-height: 100%; overflow: auto; padding: 14px clamp(14px, 3vw, 34px) 20px; border-radius: 2px; rotate: -.3deg;
  box-shadow: 0 30px 80px #000c, inset 0 0 90px #a8915c33; }
.pp kbd { color: inherit; border-color: currentColor; }
.pp footer { display: flex; gap: 10px; justify-content: space-between; flex-wrap: wrap; border-top: 3px double var(--ink2); padding-top: 12px; margin-top: 12px; }
.pp footer button { font: 12px var(--display); padding: 10px 14px; border-radius: 6px; border: 2px solid var(--ink2); background: none; color: var(--ink2); }
.pp footer button:first-child { background: #c8102e; border-color: #c8102e; color: #fff; }
/* broadsheet front page (news.js): masthead + ears, dateline, a ruled 4-column grid that folds to 2 and 1 in narrow containers */
.np { container-type: inline-size; hyphens: auto; }
.np a { color: inherit; text-decoration: none; } .np a:is(:hover, :focus-visible) { text-decoration: underline; }
.np :is(h2, h3, h4, p, ul) { margin: 0; }
.mast { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding-bottom: 4px; }
.mast h2 { font: clamp(42px, 9cqi, 96px)/1 "UnifrakturMaguntia", Georgia, serif; text-align: center; white-space: nowrap; }
.ear { border: 1px solid var(--ink2); padding: 6px 8px; font-size: 12px; line-height: 1.3; font-style: italic; max-width: 170px; }
.ear:last-child { justify-self: end; text-align: right; }
.ear b, .np h4, .dl, .kick, .by, .colo, .stop small, .briefs small { font: 10px/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; font-style: normal; }
.ear b { display: block; }
.dl { display: flex; justify-content: space-between; gap: 6px 14px; flex-wrap: wrap; border-top: 2px solid var(--ink2); border-bottom: 4px double var(--ink2);
  padding: 5px 2px; margin: 4px 0 18px; }
.fp { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px 29px; overflow: hidden; text-align: justify; }
.fp > * { border-left: 1px solid var(--rule); margin-left: -15px; padding-left: 14px; border-top: 1px solid var(--rule); margin-top: -1px; padding-top: 12px; }
.fp .lead { grid-column: span 3; } .fp :is(.leader, .briefs) { grid-column: span 2; } .fp .s + .briefs { grid-column: 1 / -1; } .fp .stop:only-child { grid-column: 1 / -1; }
.np h3 { font: 700 21px/1.12 "Playfair Display", Georgia, serif; text-align: left; hyphens: manual; margin: 2px 0 6px; }
.lead h3 { font-weight: 900; font-size: clamp(30px, 5cqi, 54px); line-height: 1.02; letter-spacing: -.01em; }
.deck { font: italic 400 clamp(17px, 2.2cqi, 22px)/1.25 "Playfair Display", Georgia, serif; text-align: left; hyphens: manual; margin-bottom: 8px !important; }
.kick { color: #b0101f; font-weight: 700; }
.by { opacity: .75; border-block: 1px solid var(--rule); padding: 3px 0; margin-bottom: 8px !important; }
.txt p + p { text-indent: 1.4em; } .s .txt { font-size: 14px; }
.lead .txt { columns: 3 220px; column-gap: 26px; column-rule: 1px solid var(--rule); }
.lead .txt p:first-child::first-letter { float: left; font: 900 4.1em/.8 "Playfair Display", Georgia, serif; padding: 5px 6px 0 0; }
.np h4 { font-weight: 700; border-bottom: 2px solid var(--ink2); padding-bottom: 3px; margin-bottom: 8px; }
.stop { text-align: left; } .stop h4 { background: var(--ink2); color: #f3ead4; padding: 4px 6px; border: 0; }
.stop p { font-size: 13.5px; line-height: 1.28; padding: 6px 0; border-bottom: 1px dotted var(--rule); }
.stop time { font: 700 12px var(--mono); color: #b0101f; } .stop small, .briefs small { display: block; opacity: .6; margin-top: 2px; }
.stop .note, .colo { font-size: 10px; opacity: .6; border: 0; }
.leader { background: #e6d8b4aa; padding-right: 10px; } .leader h3 { font-style: italic; }
.leader .txt { columns: 2 220px; column-gap: 26px; }
.briefs ul { columns: 3 180px; column-gap: 26px; column-rule: 1px solid var(--rule); padding: 0; list-style: none; text-align: left; }
.briefs li { break-inside: avoid; font-size: 14px; line-height: 1.3; padding-bottom: 8px; }
.briefs li::before { content: "■ "; font-size: 9px; vertical-align: 2px; color: #b0101f; }
.colo { text-align: center; border-top: 1px solid var(--rule); margin-top: 14px !important; padding-top: 6px; }
.np .empty { font: 11px var(--mono); letter-spacing: .1em; opacity: .6; padding: 30px 0; text-align: center; }
@container (max-width: 860px) {
  .fp { grid-template-columns: 1fr 1fr; } .fp :is(.lead, .leader, .briefs) { grid-column: 1 / -1; } }
@container (max-width: 560px) {
  .fp { grid-template-columns: 1fr; } .mast { grid-template-columns: 1fr; } .ear { display: none; }
  .dl span:nth-child(3) { display: none; } }
.hq-news { display: none; overflow: auto; padding: 14px 18px; }
.hq.press :is(.hq-grid > .hq-col:first-child, .hq-hist, #hq-test) { display: none; }
.hq.press .hq-news { display: flex; }
@media (min-width: 1001px) { .hq.press .hq-grid { grid-template-columns: minmax(360px, 1.5fr) minmax(300px, 1fr); } }

/* ---------- Gotham Public Library + Power Station: shelves, a cream book page, library card ---------- */
.hq-lib { display: none; }
.hq.lib :is(.hq-grid > .hq-col:first-child, .hq-hist, .hq-news, #hq-test) { display: none; }
.hq.lib .hq-lib { display: flex; }
@media (min-width: 1001px) { .hq.lib .hq-grid { grid-template-columns: minmax(520px, 2fr) minmax(300px, 1fr); } }
.lb-card { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font: 12px var(--mono); }
.lb-ticket { font: 700 11px var(--display); letter-spacing: .2em; color: var(--neon); }
.lb-card b { font: 20px var(--deco); color: #ecd08f; }
.lb-card small { opacity: .65; }
.lb-bar { flex: 1 1 120px; height: 6px; background: rgba(255, 255, 255, .08); outline: 1px solid var(--line); outline-offset: 2px; }
.lb-bar i { display: block; height: 100%; background: var(--neon); box-shadow: 0 0 10px var(--neon); transition: width .4s; }
.lb-card em { font-style: normal; color: #ffd35a; }
.lb-card button, .lb-gps, .lb-page footer button { font: 700 11px var(--display); letter-spacing: .1em; padding: 7px 12px; border-radius: 2px;
  background: none; border: 1px solid var(--neon); color: inherit; }
.lb-card button:hover { background: var(--neon); color: #0b0d12; }
.lb-body { display: grid; grid-template-columns: minmax(200px, 250px) 1fr; gap: 14px; min-height: 0; flex: 1; }
.lb-nav { display: flex; flex-direction: column; gap: 8px; min-height: 0; max-height: 70vh; }
.lb-nav input { font: 12px var(--mono); padding: 8px 10px; background: rgba(0, 0, 0, .35); border: 1px solid var(--line); color: inherit; border-radius: 2px; }
.lb-nav ol { list-style: none; margin: 0; padding: 0 4px 0 0; overflow: auto; display: flex; flex-direction: column; gap: 3px; }
.lb-nav button { width: 100%; text-align: left; background: none; border: 0; color: inherit; padding: 6px 8px; font: 13px/1.25 Georgia, serif; border-radius: 2px; }
.lb-nav button:hover { background: rgba(255, 255, 255, .05); }
.lb-shelf > button, [data-calc] { display: flex; justify-content: space-between; gap: 8px; font: 700 12px var(--display) !important; letter-spacing: .06em;
  border-left: 4px solid var(--neon) !important; background: linear-gradient(90deg, color-mix(in srgb, var(--neon) 14%, transparent), transparent) !important; }
.lb-shelf > button small { font: 11px var(--mono); opacity: .7; }
.lb-shelf ol { padding: 2px 0 6px 10px; overflow: visible; }
.lb-nav [data-b]::before { content: "▫"; margin-right: 6px; opacity: .5; }
.lb-nav [data-b].read::before { content: "✓"; color: var(--neon); opacity: 1; }
.lb-nav button.on { background: color-mix(in srgb, var(--neon) 22%, transparent); }
.lb-page { position: relative; overflow: auto; max-height: 70vh; padding: clamp(16px, 3vw, 30px); background: #f4ecd8; color: #1a1712;
  font: 17px/1.6 Georgia, "Times New Roman", serif; box-shadow: inset 0 0 70px #b9a98033, 0 16px 40px #0008; outline: none; user-select: text; }
.lb-page p { margin: 0 0 .8em; max-width: 62ch; }
.lb-kick { display: block; font: 10px var(--mono); letter-spacing: .18em; opacity: .6; margin-bottom: 6px; }
.lb-page h3 { font: clamp(26px, 3.4vw, 38px)/1.1 var(--deco); letter-spacing: .01em; margin: 0 0 8px; padding-right: 90px; color: #1a1712; }
.lb-lead { font-style: italic; font-size: 19px; border-bottom: 3px double #1a171255; padding-bottom: 10px; }
.lb-fact { margin: 14px 0; padding: 12px 14px; border: 1px solid #1a171240; border-left: 5px solid color-mix(in srgb, var(--neon) 70%, #1a1712); font-size: 15px; background: #fffaf0; }
.lb-fact b { font: 700 11px var(--display); letter-spacing: .15em; margin-right: 6px; }
.lb-stamp { position: absolute; top: 18px; right: 18px; rotate: -12deg; display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%;
  border: 3px double #b3122e; color: #b3122e; font: 700 9px var(--display); letter-spacing: .12em; opacity: .8; animation: stamp .3s ease-out; }
.lb-stamp b { font: 18px var(--deco); letter-spacing: .05em; margin-top: -18px; }
@keyframes stamp { from { scale: 2; opacity: 0; } }
.lb-gps { border-color: var(--c); color: #1a1712; background: color-mix(in srgb, var(--c) 18%, #fff); margin: 4px 0 10px; }
.lb-page footer { display: flex; justify-content: space-between; border-top: 3px double #1a171255; padding-top: 12px; margin-top: 8px; }
.lb-page footer button { border-color: #1a1712; color: #1a1712; }
.lb-page footer button:hover { background: #1a1712; color: #f4ecd8; }
.lb-slide { display: grid; gap: 8px; font-size: 18px; margin: 10px 0 16px; }
.lb-slide output { font: 26px var(--deco); color: #b3122e; padding: 0 4px; }
.lb-slide input { accent-color: #2f8a45; width: 100%; }
.lb-out { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
.lb-out div { padding: 12px; background: #fffaf0; border: 1px solid #1a171230; }
.lb-out .wide { grid-column: 1 / -1; }
.lb-out b { display: block; font: 22px var(--deco); }
.lb-out small { font-size: 13px; opacity: .75; }
.lb-page .note { opacity: .7; font-size: 12px; }
@media (max-width: 700px) { .lb-body { grid-template-columns: 1fr; } .lb-nav { max-height: 36vh; } .lb-page { max-height: none; } }
.hq.lib .msg i { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }

/* ---------- Gotham deco skin: Limelight + Cinzel, gold hairlines, sharp corners, sodium glow ---------- */
:is(.county, .prompt, .pad button, .go, .chips button, .st-go button, .dir-btn, .dir li, .dir li button, .dir-q, .hq-col, .seg-tog, .msg, .sugg button,
  #hq-form :is(input, button), .test-btn, .qz-card, .qz-opts button, .qz-close, .chart .tip, .hq-board.board, kbd) { border-radius: 2px; }
:is(.hq-col, .qz-card, .county, .go) { outline: 1px solid var(--line); outline-offset: 3px; }
:is(.county, .chips button, .dir-btn, .pad button, .dir li button) { font-weight: 700; letter-spacing: .1em; }
.brand { font: 24px var(--deco); color: var(--ink); text-shadow: 0 0 14px rgba(217, 180, 106, .35); }
.title { background: radial-gradient(70% 60% at 50% 45%, rgba(8, 9, 12, .35), rgba(8, 9, 12, .9)); }
.title::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;                 /* deco sunburst */
  background: repeating-conic-gradient(from 0deg at 50% 42%, rgba(217, 180, 106, .07) 0 3deg, transparent 3deg 10deg);
  mask: radial-gradient(closest-side at 50% 42%, #000 15%, transparent 80%); }
.title h1 { font: clamp(48px, 11vw, 120px)/1 var(--deco); letter-spacing: .02em; color: transparent; text-shadow: none;
  background: linear-gradient(#fff4d8, #e2bd72 50%, #8c6a30 51%, #d9b46a); -webkit-background-clip: text; background-clip: text;
  filter: drop-shadow(0 4px 0 #000) drop-shadow(0 0 28px rgba(255, 154, 46, .3)); }
.title h1 span { color: transparent; }
.title h1::after { content: "◆"; display: block; margin-top: 12px; font: 12px/1 var(--display); color: var(--neon);
  background: linear-gradient(90deg, transparent 10%, var(--neon) 40%, transparent 47% 53%, var(--neon) 60%, transparent 90%) center / 100% 1px no-repeat; }
.title > p { font-family: var(--display); font-weight: 600; letter-spacing: .14em; }
.go { font-weight: 700; letter-spacing: .14em; color: #15100a; background: linear-gradient(#f0d394, #c99a4a); box-shadow: 0 0 22px rgba(255, 154, 46, .35); }
@keyframes pulse { 50% { box-shadow: 0 0 6px rgba(255, 154, 46, .2) } }
:is(.toast, .st-ui h2, .hq-top h2) { font-family: var(--deco); font-style: normal; -webkit-text-stroke: 0; color: #ecd08f;
  text-shadow: 0 3px 0 #000, 0 0 26px rgba(255, 154, 46, .35); }
.score { font-weight: 700; color: #ecd08f; }
.radar { border: 2px solid var(--neon); outline: 1px solid var(--line); outline-offset: 3px; background: radial-gradient(circle, #1a1c22, #07080b); }
.speedo { font-weight: 700; color: #ecd08f; }
.dir { background: rgba(11, 13, 18, .94); border-left: 1px solid var(--neon); }
.dir h2 { font: 22px var(--deco); color: #ecd08f; }
.hq { background: radial-gradient(90% 70% at 20% 0%, color-mix(in srgb, var(--neon) 16%, transparent), transparent 60%), linear-gradient(#0d0f14, #07080b); }
.hq-col:not(.hq-news) { background: linear-gradient(rgba(217, 180, 106, .04), rgba(0, 0, 0, .2)); }
.qz-card { background: linear-gradient(#15161b, #0b0c10); }
.wheel i { background: var(--neon); box-shadow: 0 0 12px var(--neon); }

/* ---------- touch: left thumb = joystick (steer + up gas / down brake), right thumb = brake/gas; HUD buttons icon-only ---------- */
.steer { display: none; }
@media (pointer: coarse) {
  #city { touch-action: none; }
  kbd, .prompt kbd { display: none; }
  .pad { left: var(--pad); right: var(--pad); translate: none; align-items: flex-end; }
  .pad > :first-child { margin-right: auto; }
  .steer { --x: 0; --y: 0; display: block; position: relative; width: 132px; height: 132px; border-radius: 50%; touch-action: none; user-select: none; -webkit-user-select: none;
    background: radial-gradient(circle, transparent 56%, rgba(255, 255, 255, .06) 57%), var(--glass); border: 1.5px solid var(--line); backdrop-filter: blur(6px); }
  .steer i { position: absolute; left: calc(50% + var(--x) * 32%); top: calc(50% + var(--y) * 32%); width: 54px; height: 54px; translate: -50% -50%; border-radius: 50%;
    background: var(--neon); box-shadow: 0 0 14px var(--neon); opacity: .85; }
  .pad button { height: 76px; } .pad .brake { width: 70px; } .pad .gas { width: 84px; }
  .pad .act { position: absolute; left: 50%; bottom: calc(100% + 14px); translate: -50%; height: 52px; }
  .speedo { bottom: calc(max(16px, env(safe-area-inset-bottom)) + 92px); }
  .city .radar { width: 96px; left: auto; right: var(--pad); bottom: auto; top: calc(max(16px, env(safe-area-inset-top)) + 84px); }
  .dir-btn { right: auto; left: var(--pad); width: 42px; height: 42px; padding: 0; font-size: 18px; border-radius: 50%; }
  .dir-btn span { display: none; }
  .cam-btn { top: calc(max(16px, env(safe-area-inset-top)) + 134px); } .map-btn { top: calc(max(16px, env(safe-area-inset-top)) + 184px); }
  .sky-btn { top: calc(max(16px, env(safe-area-inset-top)) + 234px); } .paper-btn { top: calc(max(16px, env(safe-area-inset-top)) + 284px); }
  .lib-btn { top: calc(max(16px, env(safe-area-inset-top)) + 334px); } .snd-btn { top: calc(max(16px, env(safe-area-inset-top)) + 384px); }
}

/* ---------- intro film (js/intro.js) ---------- */
.intro { position: fixed; inset: 0; z-index: 50; background: #000; transition: opacity .6s, visibility .6s; }
.intro canvas { display: block; width: 100%; height: 100%; }
.intro.gone { opacity: 0; visibility: hidden; }
.intro-skip, .intro-btn { font: 12px var(--display); letter-spacing: .2em; padding: 8px 14px; color: var(--ink); background: rgba(0, 0, 0, .45);
  border: 1px solid var(--neon); border-radius: 2px; cursor: pointer; }
.intro > .intro-skip { position: absolute; right: 18px; top: max(18px, env(safe-area-inset-top)); }
.intro-cta { position: absolute; left: 0; right: 0; bottom: max(8vh, 40px); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.intro-btn { color: var(--neon); margin-top: 6px; }
