@font-face { font-family: 'Chakra Petch'; font-weight: 500; font-display: swap; src: url('../assets/fonts/ChakraPetch-500.woff2') format('woff2'); }
@font-face { font-family: 'Chakra Petch'; font-weight: 700; font-display: swap; src: url('../assets/fonts/ChakraPetch-700.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 400; font-display: swap; src: url('../assets/fonts/IBMPlexMono-400.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 600; font-display: swap; src: url('../assets/fonts/IBMPlexMono-600.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 400 600; font-display: swap; src: url('../assets/fonts/IBMPlexSans.woff2') format('woff2'); }
@font-face { font-family: 'Kalam'; font-weight: 400; font-display: swap; src: url('../assets/fonts/Kalam-400.woff2') format('woff2'); }

:root {
  --bg: #07080d;
  --panel: rgba(9, 11, 18, 0.9);
  --line: rgba(255, 255, 255, 0.14);
  --text: #e6ebf3;
  --muted: #9aa3b5;
  --you: #2ef2ff;
  --ink: #ff3ad8;
  --danger: #ff5a5a;
  --display: 'Chakra Petch', 'Avenir Next Condensed', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  --sans: 'IBM Plex Sans', system-ui, sans-serif;
  --hand: 'Kalam', 'Comic Sans MS', cursive;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); overflow: hidden; }
body { font-family: var(--mono); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
canvas#view { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
canvas#hack { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#labels { position: fixed; inset: 0; pointer-events: none; z-index: 3; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
button, .button { font: inherit; }

/* ------------------------------------------------------------------ HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 4; transition: opacity 0.3s; }
#hud.hacking { opacity: 0; }
/* panels behind each group, so the HUD reads over any floor */
.hud-panel { background: rgba(6, 8, 13, 0.68); border: 1px solid rgba(255, 255, 255, 0.09); border-radius: 12px; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }

.hud-status { position: absolute; left: 16px; top: 14px; width: 252px; padding: 10px 14px 10px; }
.hud-top { display: flex; align-items: center; gap: 6px; margin-bottom: 18px; }
/* which counter lasts: a caption under each */
.hud-scrap, .hud-data { position: relative; }
.hud-scrap::after, .hud-data::after { content: attr(data-tag); position: absolute; left: 0; right: 0; top: 100%; margin-top: 2px; text-align: center; font-size: 8.5px; letter-spacing: 0.14em; text-transform: uppercase; line-height: 1; }
.hud-scrap::after { color: rgba(255, 226, 168, 0.7); }
.hud-data::after { color: rgba(46, 242, 255, 0.75); }
.hud-top .hud-name { margin-right: auto; white-space: nowrap; }
.hud-name { font-family: var(--display); font-weight: 700; letter-spacing: 0.1em; font-size: 15px; }
.stat { margin-bottom: 9px; }
.stat-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 4px; }
.stat-label { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: #b8c0cf; }
.stat-label svg { color: #f2f5fa; flex: none; }
.stat.energy .stat-label svg { color: var(--you); }
.stat-label small { font-size: 11px; letter-spacing: 0; text-transform: none; color: #8a93a6; }
.stat-value { font-family: var(--display); font-weight: 700; font-size: 15px; line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; }
.stat-value small { font-family: var(--mono); font-weight: 400; font-size: 11px; color: #6f788c; margin-left: 1px; }
.stat.low .stat-value, .stat.low .stat-label, .stat.low .stat-label svg { color: var(--danger); }
.bar { position: relative; height: 10px; background: rgba(255, 255, 255, 0.08); border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.bar.energy { height: 7px; }
.bar span { position: absolute; inset: 0 auto 0 0; z-index: 1; background: #f2f5fa; box-shadow: 0 0 10px rgba(255, 255, 255, 0.5); transition: width 0.15s; }
.bar b { position: absolute; inset: 0 auto 0 0; z-index: 0; background: rgba(255, 90, 90, 0.7); transition: width 0.6s 0.2s; }
.bar.energy span { background: var(--you); box-shadow: 0 0 10px var(--you); }
.bar.low span { background: var(--danger); }
.bar.flash { animation: flash 0.4s; }
@keyframes flash { 50% { border-color: var(--danger); } }
.stat-row { display: flex; align-items: center; gap: 8px; min-height: 22px; }
.stat-row .stat-label { width: 42px; flex: none; }
.pips { display: inline-flex; gap: 4px; }
.pips i { width: 8px; height: 8px; border-radius: 50%; background: var(--you); box-shadow: 0 0 6px rgba(46, 242, 255, 0.6); }
.stat-note { font-size: 12px; color: #8f98ab; }

.hud-scrap { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #b8c0cf; padding: 2px 9px; border: 1px solid rgba(255, 226, 168, 0.35); border-radius: 999px; background: rgba(255, 226, 168, 0.06); }
.hud-scrap svg { color: #ffe2a8; }
.hud-scrap b { color: #fff4dc; font-family: var(--display); font-size: 14px; font-weight: 700; display: inline-block; transform-origin: center; font-variant-numeric: tabular-nums; }
.hud-scrap.bump b { animation: bump 0.25s ease-out; }
.hud-data { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: #b8c0cf; padding: 2px 8px; border: 1px solid rgba(46, 242, 255, 0.35); border-radius: 999px; background: rgba(46, 242, 255, 0.06); }
.hud-data svg { color: var(--you); }
.hud-data b { color: #e9fdff; font-family: var(--display); font-size: 14px; font-weight: 700; display: inline-block; font-variant-numeric: tabular-nums; }
.hud-data.bump b { animation: bump 0.25s ease-out; }
.hud-status { width: 276px; }
.hud-top .hud-scrap, .hud-top .hud-data { padding: 2px 7px; gap: 4px; white-space: nowrap; }
#hud.in-heap .claim-row, #hud.in-heap .stat-row:has(#hud-pips) { display: none; }
.pop.word.data { color: var(--you); font-size: 12px; }
.label.npc { font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; }

/* ------------------------------------------------------------------ the cast */
.portrait { display: block; width: 120px; height: 120px; flex: none; border-radius: 14px; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.1); }
.portrait.small { width: 64px; height: 64px; border-radius: 10px; }
.screen.talk-screen { align-items: flex-end; justify-content: center; padding: 0 16px 28px; background: linear-gradient(to top, rgba(4, 5, 9, 0.85), rgba(4, 5, 9, 0) 55%); }
.talk { display: flex; gap: 18px; align-items: flex-start; width: min(820px, 100%); padding: 18px 20px; background: rgba(8, 10, 16, 0.94); border: 1px solid var(--who, var(--line)); border-radius: 16px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5); }
.talk-body { flex: 1; min-width: 0; }
.talk-name { margin: 0 0 6px; font-size: 20px; color: var(--who, #fff); letter-spacing: 0.04em; }
.talk-name small { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: 0; font-weight: 400; margin-left: 6px; }
.talk-text { margin: 0 0 14px; font-size: 17px; line-height: 1.5; min-height: 3em; color: #eef2f8; }
.talk-opts { display: flex; flex-wrap: wrap; gap: 8px; flex-direction: row; }
.talk-opts button { width: auto; min-width: 0; }
.shop-voice { display: flex; align-items: center; gap: 12px; margin: 4px 0 10px; }
.shop-voice p { margin: 0; color: #eef2f8; font-size: 14px; }
.fab-wallet.data { border-color: rgba(46, 242, 255, 0.4); }
.fab-wallet.data svg { color: var(--you); }
.notches { display: inline-flex; gap: 3px; margin-left: 8px; vertical-align: middle; }
.notches i { width: 9px; height: 9px; border-radius: 2px; border: 1px solid rgba(46, 242, 255, 0.6); }
.notches i.on { background: var(--you); }
.panel.bench-panel { display: grid; grid-template-columns: minmax(200px, 300px) 1fr; gap: 24px; align-items: start; width: min(900px, 100%); overflow-y: auto; }
.bench-klp { margin: 0; position: sticky; top: 0; }
.bench-klp .plate-stage { --ink: var(--you); aspect-ratio: 1 / 1.1; }
.bench-klp figcaption { margin-top: 8px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.bench-klp figcaption b { color: var(--you); font-family: var(--display); letter-spacing: 0.06em; text-transform: uppercase; }
.bench-klp figcaption .just { color: var(--text); }
.bench-klp .plate-stage.mended { animation: mended 1.1s ease-out; }
@keyframes mended { 0% { box-shadow: 0 0 0 0 rgba(46, 242, 255, 0.9), 0 0 60px rgba(46, 242, 255, 0.8); } 100% { box-shadow: 0 0 0 14px rgba(46, 242, 255, 0), 0 0 46px rgba(46, 242, 255, 0.16); } }
.fab-line i { color: var(--muted); font-style: normal; }
.hud-cond { margin-left: 4px; font-family: var(--mono); font-weight: 400; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--you); }
@media (max-width: 720px) { .panel.bench-panel { grid-template-columns: 1fr; } .bench-klp { position: static; max-width: 260px; } }
.radio { position: absolute; left: 50%; bottom: 92px; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; max-width: min(620px, calc(100vw - 32px)); padding: 10px 16px 10px 10px; background: rgba(8, 10, 16, 0.92); border: 1px solid var(--who, var(--line)); border-radius: 14px; transition: opacity 0.4s; }
.radio .portrait { width: 56px; height: 56px; border-radius: 10px; }
.radio-name { display: block; color: var(--who, #fff); font-family: var(--display); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; }
.radio-text { margin: 2px 0 0; font-size: 14px; line-height: 1.45; color: #eef2f8; }
.radio.out { opacity: 0; }
/* ------------------------------------------------------------------ the Tower Gazette */
.panel.gazette { background: #f1ece0; color: #1c1a16; border-color: #c9bfa8; font-family: Georgia, 'Times New Roman', serif; max-width: 860px; }
.gazette .gz-mast { border-bottom: 3px double #1c1a16; margin: -8px 0 10px; padding-bottom: 4px; text-align: center; }
.gazette .gz-ears { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 4px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: #5c5446; border-bottom: 1px solid #1c1a16; padding-bottom: 4px; }
.gazette .gz-title { margin: 0; font-size: clamp(26px, 4.4vw, 38px); font-weight: 700; letter-spacing: 0.01em; line-height: 1.05; }
.panel.gazette h2 { margin: 4px 0 6px; font-family: var(--display); font-size: clamp(22px, 3.4vw, 32px); line-height: 1.08; color: #111; letter-spacing: 0.01em; }
.gazette .lede { color: #2b2720; font-size: 16px; font-style: italic; margin: 0 0 10px; max-width: none; }
.gazette .gz-cols { display: grid; grid-template-columns: 1fr 230px; gap: 22px; border-top: 1px solid #1c1a16; padding-top: 12px; }
.gazette .gz-copy p { margin: 0 0 8px; font-size: 14.5px; line-height: 1.45; color: #23201b; }
.gazette .gz-copy p:first-child::first-letter { float: left; font-size: 46px; line-height: 0.9; padding: 4px 6px 0 0; font-weight: 700; }
.gazette .gz-side { border-left: 1px solid #1c1a16; padding-left: 16px; }
.gazette .gz-side h3 { margin: 0 0 6px; font-family: var(--display); font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: #1c1a16; }
.gazette .stats { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; margin: 0; }
.gazette .stats div { display: contents; }
.gazette .stats dt { font-family: var(--mono); font-size: 11.5px; color: #4a4336; padding: 1px 0; border-bottom: 1px dotted #b8ad95; }
.gazette .stats dd { margin: 0; font-family: var(--display); font-weight: 700; font-size: 13px; color: #111; text-align: right; padding: 1px 0; border-bottom: 1px dotted #b8ad95; }
.gazette .gz-photo { margin: 0 0 12px; }
.gazette .gz-photo img, .gazette .gz-also img { display: block; width: 100%; height: auto; border: 1px solid #1c1a16; background: #e3dccb; }
.gazette .gz-photo figcaption, .gazette .gz-also figcaption { margin-top: 5px; font-family: var(--mono); font-size: 11.5px; line-height: 1.4; color: #3a352c; }
.gazette .gz-credit { font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: #7a705c; white-space: nowrap; }
.gazette .gz-also { margin: 0 0 14px; padding-bottom: 12px; border-bottom: 1px solid #1c1a16; }
.gazette .gz-also-h { margin: 0 0 6px; font-family: var(--display); font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: #1c1a16; }
.gazette .gz-weather, .gazette .gz-classified { font-size: 13px; color: #3a352c; }
.gazette .gz-classified { border-top: 1px solid #1c1a16; margin-top: 10px; padding-top: 8px; font-family: var(--mono); font-size: 12px; }
.gazette .gz-weather b, .gazette .gz-classified b { font-family: var(--display); letter-spacing: 0.1em; text-transform: uppercase; font-size: 11px; margin-right: 6px; }
.gazette .ledger { margin-top: 12px; border-top: 3px double #1c1a16; padding-top: 10px; }
.gazette .ledger-why { margin: 0 0 10px; font-family: var(--mono); font-size: 13px; color: #1c1a16; background: #e3dccb; padding: 8px 12px; border-left: 4px solid #0b5f66; }
.gazette .ledger-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.gazette .ledger h3 { margin: 0 0 4px; font-family: var(--display); font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; }
.gazette .ledger .kept h3 { color: #0b5f66; }
.gazette .ledger .lost h3 { color: #8c2a1c; }
.gazette .ledger ul { margin: 0; padding-left: 18px; font-family: var(--mono); font-size: 12.5px; color: #2b2720; }
.gazette .ledger .lost li { text-decoration: line-through; text-decoration-color: rgba(140, 42, 28, 0.55); }
.gazette .ledger .kept b { color: #0b5f66; }
@media (max-width: 640px) { .gazette .ledger-cols { grid-template-columns: 1fr; } }
.gazette .share pre { background: #e6dfcf; color: #1c1a16; }
.gazette button, .gazette .button { background: #1c1a16; color: #f1ece0; border-color: #1c1a16; }
.gazette button:focus-visible { outline: 3px solid #0b8f99; outline-offset: 2px; }
@media (max-width: 720px) { .gazette .gz-cols { grid-template-columns: 1fr; } .gazette .gz-side { border-left: 0; padding-left: 0; border-top: 1px solid #1c1a16; padding-top: 10px; } }
@keyframes bump { 40% { color: #ffe2a8; transform: scale(1.25); } }
.hud-gang { display: flex; gap: 6px; flex-wrap: wrap; }
.hud-gang .ally { position: relative; font-family: var(--display); font-weight: 700; font-size: 11px; color: var(--you); padding: 1px 7px 3px; border: 1px solid rgba(46, 242, 255, 0.4); border-radius: 4px; background: rgba(46, 242, 255, 0.06); overflow: hidden; }
.hud-gang .ally i { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--you); }

.hud-deck { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); text-align: center; min-width: 280px; padding: 8px 18px 9px; }
.hud-deck-name { font-family: var(--display); font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; font-size: 14px; }
.claim-row { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 6px; }
.claim { width: 150px; height: 5px; background: rgba(255, 255, 255, 0.1); border-radius: 3px; overflow: hidden; }
.claim span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--ink), var(--you)); transition: width 0.6s; }
.claim-pc { font-size: 11px; color: #8f98ab; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hud-clearance { font-size: 12px; color: #b8c0cf; margin-top: 5px; }
.hud-clearance.ok { color: var(--you); }

.hud-map { position: absolute; right: 16px; top: 14px; padding: 6px; line-height: 0; }
#minimap { width: 168px; height: 168px; }

.sockets { position: absolute; left: 18px; bottom: 18px; display: flex; gap: 10px; }
.socket { width: 154px; padding: 8px 10px 9px; background: rgba(8, 10, 16, 0.78); border: 1px solid var(--line); border-radius: 8px; position: relative; overflow: hidden; }
.socket .slot { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; display: flex; justify-content: space-between; }
.socket .slot kbd { font-family: var(--mono); color: var(--text); background: rgba(255, 255, 255, 0.1); border-radius: 3px; padding: 0 5px; }
.socket .mod { display: flex; align-items: center; gap: 7px; margin-top: 4px; font-family: var(--display); font-weight: 700; font-size: 14px; line-height: 1.15; white-space: nowrap; }
.socket .mod svg { flex: none; color: var(--you); }
.socket.empty .mod { color: var(--muted); font-weight: 500; }
.socket.empty .mod svg { color: var(--muted); }
.socket .cool { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--you); width: 0; }
.socket.active { border-color: var(--you); box-shadow: 0 0 14px rgba(46, 242, 255, 0.35) inset; }

.prompt { position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%); padding: 8px 14px; background: rgba(8, 10, 16, 0.85); border: 1px solid var(--line); border-radius: 8px; font-size: 14px; white-space: nowrap; opacity: 0; transition: opacity 0.15s; }
.prompt.on { opacity: 1; }
body.radio-on .prompt { bottom: 184px; }
.prompt kbd { font-family: var(--mono); background: var(--you); color: #001014; padding: 1px 7px; border-radius: 4px; font-weight: 600; margin-right: 6px; }
.prompt .sub { color: var(--muted); margin-left: 8px; font-size: 12px; }
.prompt.warn kbd { background: var(--muted); }

.hint { position: absolute; left: 50%; top: 132px; transform: translateX(-50%); max-width: min(560px, calc(100vw - 32px)); padding: 10px 16px; background: rgba(8, 10, 16, 0.9); border: 1px solid rgba(46, 242, 255, 0.45); border-radius: 10px; font-size: 14px; text-align: center; opacity: 0; transition: opacity 0.3s; }
.hint.on { opacity: 1; }
.hint b { color: var(--you); font-weight: 600; }

.toasts { position: absolute; right: 18px; bottom: 18px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.toast { padding: 7px 12px; background: rgba(8, 10, 16, 0.88); border-left: 3px solid var(--you); border-radius: 4px; font-size: 13px; animation: toast-in 0.25s ease-out; max-width: 340px; }
.toast.out { opacity: 0; transition: opacity 0.4s; }
@keyframes toast-in { from { transform: translateX(20px); opacity: 0; } }

.banner { position: absolute; left: 50%; top: 33%; transform: translate(-50%, -50%); text-align: center; pointer-events: none; animation: banner 1.9s ease-out forwards; }
.banner-h { white-space: nowrap; font-family: var(--display); font-weight: 700; font-size: clamp(30px, 6vw, 56px); letter-spacing: 0.12em; text-transform: uppercase; color: #fff; line-height: 1;
  text-shadow: 0 0 2px #fff, 3px 0 0 rgba(46, 242, 255, 0.75), -3px 0 0 rgba(255, 226, 168, 0.6), 0 0 30px rgba(46, 242, 255, 0.5); }
.banner-sub { margin-top: 8px; font-size: 15px; color: #ffe2a8; letter-spacing: 0.06em; }
.banner.gold { animation-duration: 3.2s; }
.banner.gold .banner-h { color: #fff4dc; text-shadow: 0 0 2px #fff, 3px 0 0 rgba(255, 207, 110, 0.75), -3px 0 0 rgba(255, 140, 60, 0.5), 0 0 34px rgba(255, 190, 80, 0.6); }
@keyframes banner { 0% { opacity: 0; transform: translate(-50%, -50%) scale(1.5); } 10% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -60%); } }
body.reduced .banner { animation: none; }

.label { position: absolute; transform: translate(-50%, -100%); font-family: var(--display); font-weight: 700; font-size: 12px; letter-spacing: 0.06em; color: var(--ink); text-shadow: 0 0 6px rgba(0, 0, 0, 0.9); white-space: nowrap; text-align: center; }
.label .hp { position: relative; display: block; width: 44px; height: 4px; margin: 3px auto 0; background: rgba(255, 255, 255, 0.15); border-radius: 1px; }
.label .hp i { display: block; height: 100%; background: currentColor; }
/* the two dent points: below each, it hacks back with a pulser fewer */
.label .hp::before, .label .hp::after { content: ''; position: absolute; top: -2px; bottom: -2px; width: 1.5px; background: rgba(255, 255, 255, 0.75); }
.label .hp::before { left: 30%; opacity: 0.5; }
.label .hp::after { left: var(--open-at, 60%); top: -3px; bottom: -3px; width: 2px; background: #fff; box-shadow: 0 0 4px rgba(255, 255, 255, 0.8); }
.label.open .hp i, .label.crit .hp i { background: var(--you); box-shadow: 0 0 6px var(--you); }
.label.open span::after, .label.crit span::after { content: ' OPEN'; color: var(--you); font-size: 10px; letter-spacing: 0.12em; }
.label.crit span::after { content: ' CRITICAL'; }
.label.locked { filter: drop-shadow(0 0 4px rgba(46, 242, 255, 0.8)); }
.pop { position: absolute; left: 0; top: 0; pointer-events: none; font-family: var(--display); font-weight: 700; font-size: 15px; color: #fff; white-space: nowrap; text-shadow: 0 1px 0 #000, 0 0 6px rgba(0, 0, 0, 0.9); will-change: transform, opacity; }
.pop.ally { color: var(--you); font-size: 13px; }
.pop.hurt { color: #ff5a5a; }
.pop.crit { color: #ffd25a; font-size: 20px; text-shadow: 0 1px 0 #000, 0 0 10px rgba(255, 190, 60, 0.8); }
.pop.word { font-size: 14px; letter-spacing: 0.14em; }
.pop.word.slam { color: #fff; font-size: 17px; text-shadow: 0 1px 0 #000, 0 0 12px rgba(255, 140, 60, 0.9); }
.pop.word.dent { color: #ffc067; font-size: 12px; }
.pop.word.open { color: var(--you); font-size: 18px; text-shadow: 0 1px 0 #000, 0 0 14px rgba(46, 242, 255, 0.95); }
.pop.emote { font-size: 22px; font-weight: 700; }
.pop.emote.alert { color: #ffd25a; text-shadow: 0 1px 0 #000, 0 0 10px rgba(255, 190, 60, 0.8); }
.pop.emote.puzzled { color: #e6ebf3; }
.pop.emote.talky { color: #fff; font-size: 20px; }
.pop.emote.dozing { color: #9fd8ff; font-size: 15px; font-style: italic; }
.pop.word.dodge { color: var(--you); font-size: 12px; }
.pop.word.clear { color: #fff; font-size: 16px; text-shadow: 0 1px 0 #000, 0 0 12px rgba(46, 242, 255, 0.9); }
.label.cmd { color: #fff; }
.label.cmd::before { content: '◆ '; color: var(--ink); }
.label.relic { font-size: 13px; letter-spacing: 0.08em; }
.label.relic::before { content: '◆ '; color: var(--you); text-shadow: 0 0 8px var(--you); }
.label.bounty { color: #ffcf6e; }
.label.rival { color: #ff7a6a; font-size: 13px; }
.card.dim { opacity: 0.6; }
.banner.rival .banner-h { color: #ffe1dc; text-shadow: 0 0 2px #fff, 3px 0 0 rgba(255, 106, 90, 0.75), -3px 0 0 rgba(255, 180, 90, 0.5), 0 0 34px rgba(255, 106, 90, 0.6); }
.label.bounty::before { content: '★ '; }
.label.you, .label.ally { color: var(--you); }
.bubble { position: absolute; transform: translate(-50%, -100%); padding: 3px 8px; background: rgba(6, 8, 13, 0.92); border: 1px solid var(--ink); border-radius: 6px; font-family: var(--mono); font-weight: 600; font-size: 11.5px; letter-spacing: 0.04em; color: #f2f5fa; white-space: nowrap; animation: bubble-in 0.18s ease-out; transition: opacity 0.3s; }
.bubble::after { content: ''; position: absolute; left: 50%; bottom: -5px; width: 8px; height: 8px; background: rgba(6, 8, 13, 0.92); border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink); transform: translateX(-50%) rotate(45deg); }
.bubble.ally { border-color: var(--you); }
.bubble.ally::after { border-color: var(--you); }
.bubble.fading { opacity: 0; }
@keyframes bubble-in { from { transform: translate(-50%, -80%) scale(0.6); opacity: 0; } }

/* ------------------------------------------------------------------ screens */
.screen { position: fixed; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; padding: 16px; }
.panel-screen { background: rgba(3, 4, 8, 0.6); backdrop-filter: blur(3px); }
/* a panel never runs off the screen: if it's taller than the window, it scrolls */
.panel { width: min(460px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 26px 26px 22px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6); }
.panel.wide { width: min(860px, 100%); }
.panel.scroll { overflow-y: auto; }
.panel h2 { font-family: var(--display); font-weight: 700; font-size: 24px; letter-spacing: 0.04em; margin: 0 0 8px; }
.lede { color: var(--muted); margin: 0 0 18px; max-width: 64ch; }
.row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }

.menu { display: flex; flex-direction: column; gap: 8px; }
.menu.row { flex-direction: row; justify-content: flex-start; }
button, .button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 18px;
  background: rgba(255, 255, 255, 0.06); color: var(--text); border: 1px solid var(--line); border-radius: 8px;
  font-family: var(--display); font-weight: 700; font-size: 16px; letter-spacing: 0.04em; text-decoration: none; cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.menu button, .menu .button { justify-content: flex-start; }
button:hover, .button:hover { background: rgba(255, 255, 255, 0.11); }
button:focus-visible, .button:focus-visible, button.focus { outline: none; border-color: var(--you); color: var(--you); background: rgba(46, 242, 255, 0.08); box-shadow: 0 0 0 1px var(--you), 0 0 18px rgba(46, 242, 255, 0.25); }

/* title */
.title { background: radial-gradient(ellipse at 70% 60%, rgba(0, 0, 0, 0) 0%, rgba(3, 4, 8, 0.75) 70%); justify-content: flex-start; padding-left: max(16px, 7vw); }
.title-block { max-width: 460px; }
.logo { font-family: var(--display); font-weight: 700; font-size: clamp(56px, 11vw, 112px); letter-spacing: 0.1em; margin: 0; line-height: 0.95; color: #fff;
  text-shadow: 0 0 2px #fff, 4px 0 0 rgba(46, 242, 255, 0.7), -4px 0 0 rgba(255, 58, 216, 0.7), 0 0 40px rgba(46, 242, 255, 0.35); }
.strap { color: var(--muted); margin: 14px 0 28px; font-size: 15px; }
.records { color: var(--muted); font-size: 12px; margin-top: 18px; min-height: 1.5em; }
.sound-hint { display: flex; align-items: center; gap: 8px; margin: 6px 0 0; font-size: 12.5px; color: var(--you); }
.sound-hint[hidden] { display: none; }
.title-foot { position: absolute; bottom: 14px; left: max(16px, 7vw); margin: 0; color: #6c7488; font-size: 12px; }

/* cards for parts and firmware */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 280px)); justify-content: center; gap: 12px; }
.card { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; text-align: left; gap: 6px; padding: 14px; min-height: 150px; font-family: var(--mono); font-weight: 400; font-size: 13px; letter-spacing: 0; line-height: 1.45; }
.card .card-head { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 17px; color: var(--text); }
.card .card-head svg { color: var(--you); flex: none; }
.card .slot-tag { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }
.card .line { color: var(--text); }
.card .use { color: var(--muted); font-size: 12px; }
.card .stats { color: #cfe9ee; font-size: 12px; font-family: var(--mono); }
.card .stats:empty { display: none; }
.card .swap { color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); padding-top: 6px; margin-top: auto; }
.card .swap b { color: var(--ink); font-weight: 600; }
.card.better .swap b { color: var(--you); }
.card.turn { border-style: dashed; border-color: rgba(46, 242, 255, 0.35); }
.card.relic { border-color: rgba(46, 242, 255, 0.5); background: linear-gradient(180deg, rgba(46, 242, 255, 0.08), rgba(46, 242, 255, 0.02)); }
.card.relic .card-head svg { color: var(--you); }
.slot-tag.kept { color: var(--you); }
.card .strength { display: block; height: 6px; margin: 2px 0; background: rgba(255, 255, 255, 0.1); border-radius: 3px; overflow: hidden; }
.card .strength i { display: block; height: 100%; background: var(--you); }
.card .strength.frail i { background: #ffc067; }
.card:focus-visible .card-head, .card.focus .card-head { color: var(--you); }

/* the boot screen and the memories */
.screen.boot { background: #020304; }
.boot-box { width: min(560px, 100%); }
.boot-text { margin: 0 0 24px; min-height: 9em; font-family: var(--mono); font-size: 15px; line-height: 1.6; color: var(--you); text-shadow: 0 0 8px rgba(46, 242, 255, 0.6); white-space: pre-wrap; }
.memory { position: fixed; inset: 0; z-index: 9; display: flex; align-items: flex-end; justify-content: center; padding: 0 16px 34px; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.22) 0 1px, transparent 1px 3px), radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.7)); }
.memory.now { background: radial-gradient(ellipse at center, transparent 60%, rgba(0, 0, 0, 0.45)); }
.mem-box { width: min(760px, 100%); padding: 14px 20px 12px; background: #000; border: 2px solid var(--ink, #fff); }
.mem-head { margin: 0 0 8px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink, #fff); }
.mem-who { margin: 0 0 2px; font-family: var(--display); font-weight: 700; font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: #fff; }
.mem-text { margin: 0; min-height: 3em; font-family: var(--mono); font-size: 17px; line-height: 1.5; color: #fff; }
.mem-text.loud { color: var(--ink, #fff); letter-spacing: 0.06em; }
.mem-keys { margin: 8px 0 0; font-family: var(--mono); font-size: 11px; color: #8a90a0; text-align: right; }

/* loadout */
.loadout { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.loadout .box { border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.loadout .box.run { border-color: rgba(255, 210, 120, 0.3); }
.loadout .box.kept { border-color: rgba(46, 242, 255, 0.3); }
.loadout .box.kept p b, .loadout .box.run p b { font-family: var(--display); font-size: 16px; }
.loadout .box.kept p b { color: var(--you); }
.loadout .box.run p b { color: #ffd27a; }
.sheet-h { margin: 20px 0 10px; font-family: var(--display); font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase; }
.sheet-h small { margin-left: 8px; font-family: var(--mono); font-size: 11px; letter-spacing: 0; text-transform: none; color: var(--muted); }
.sheet-h.r { color: #ffd27a; }
.sheet-h.k { color: var(--you); }
.sheet-table { width: 100%; border-collapse: collapse; margin: 4px 0 6px; font-size: 13px; }
.sheet-table th, .sheet-table td { padding: 7px 10px; text-align: left; border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
.sheet-table thead th { font-family: var(--display); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.sheet-table tbody th { font-family: var(--display); font-weight: 700; font-size: 14px; color: var(--text); }
.sheet-table tbody th small { font-family: var(--mono); font-weight: 400; font-size: 11px; color: var(--muted); }
.sheet-table td.now { font-family: var(--display); font-weight: 700; font-size: 16px; color: #fff; }
.sheet-table .k { color: var(--you); }
.sheet-table .r { color: #ffd27a; }
.loadout .box .stats { color: #cfe9ee; font-size: 12px; font-family: var(--mono); }
.loadout h3 { font-family: var(--display); margin: 0 0 6px; font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.loadout .name { font-family: var(--display); font-weight: 700; font-size: 18px; display: flex; gap: 8px; align-items: center; }
.loadout .name svg { color: var(--you); }
.loadout p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.loadout ul { margin: 0; padding-left: 18px; color: var(--muted); }
.loadout li b { color: var(--text); }

/* fabricator */
.fab-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.fab-wallet { display: flex; align-items: center; gap: 8px; margin: 0; padding: 6px 12px; border: 1px solid rgba(255, 226, 168, 0.45); border-radius: 8px; background: rgba(255, 226, 168, 0.07); color: #ffe2a8; white-space: nowrap; }
.fab-wallet b { font-family: var(--display); font-size: 24px; font-weight: 700; line-height: 1; color: #fff4dc; display: inline-block; }
.fab-wallet span { font-size: 13px; }
.fab-wallet.spent b { animation: spent 0.35s ease-out; }
@keyframes spent { 40% { transform: scale(1.25); color: #ffe2a8; } }
.fab-list { display: flex; flex-direction: column; gap: 8px; }
.fab-item { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 14px; text-align: left; padding: 10px 14px; min-height: 56px; }
.fab-item .fab-name { display: flex; align-items: center; gap: 8px; }
.fab-item .fab-name svg { color: var(--you); }
.fab-item .fab-line { grid-column: 1; font-family: var(--mono); font-weight: 400; font-size: 12.5px; color: var(--muted); letter-spacing: 0; }
.fab-item .fab-cost { grid-column: 2; grid-row: 1 / span 2; font-size: 15px; color: #ffe2a8; white-space: nowrap; }
.fab-item[disabled] { opacity: 0.45; cursor: default; }
.fab-item[disabled] .fab-cost { color: var(--muted); }

/* settings */
.settings { display: flex; flex-direction: column; gap: 12px; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 40px; }
.setting label { flex: 1; }
.setting small { display: block; color: var(--muted); font-size: 12px; }
.setting input[type=range] { width: 150px; accent-color: var(--you); height: 28px; }
.setting input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--you); }

/* loadout */
.loadout kbd, .klp-sheet kbd { font-family: var(--mono); background: rgba(255, 255, 255, 0.1); border-radius: 3px; padding: 0 5px; color: var(--text); }

/* ------------------------------------------------------------------ books: the archive and the manual */
.panel.book { width: min(1120px, 100%); height: min(780px, calc(100vh - 32px)); max-height: none; display: flex; flex-direction: column; padding: 0; overflow: hidden; background: linear-gradient(180deg, rgba(13, 15, 24, 0.97), rgba(7, 8, 13, 0.97)); }
.book-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px 14px 22px; border-bottom: 1px solid var(--line); }
.book-head h2 { margin: 0; font-size: 26px; }
.book-sub { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.book-back { flex: none; }
.book-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 272px 1fr; }
.book-index { overflow-y: auto; padding: 6px 10px 18px 12px; border-right: 1px solid var(--line); background: rgba(0, 0, 0, 0.28); scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.18) transparent; }
.book-group { margin: 14px 8px 6px; font-family: var(--display); font-size: 11px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.book-tab { display: grid; grid-template-columns: 48px 1fr auto; align-items: center; justify-content: stretch; gap: 11px; width: 100%; min-height: 62px; padding: 6px 10px 6px 7px; margin: 0 0 3px; background: transparent; border: 1px solid transparent; border-radius: 11px; text-align: left; font-weight: 400; letter-spacing: 0; }
.book-tab:hover { background: rgba(255, 255, 255, 0.05); }
.book-tab[aria-selected="true"] { background: color-mix(in srgb, var(--ink) 13%, transparent); border-color: color-mix(in srgb, var(--ink) 55%, transparent); }
.book-tab:focus-visible { color: var(--text); background: color-mix(in srgb, var(--ink) 13%, transparent); }
.book-thumb { width: 48px; height: 48px; border-radius: 9px; overflow: hidden; background: #05060a; border: 1px solid rgba(255, 255, 255, 0.08); display: grid; place-items: center; color: var(--ink); }
.book-thumb img { display: block; width: 48px; height: 48px; }
.thumb-wait { display: block; width: 100%; height: 100%; background: linear-gradient(110deg, #07080d 30%, #141824 50%, #07080d 70%); background-size: 200% 100%; animation: wait 1.2s linear infinite; }
@keyframes wait { to { background-position: -200% 0; } }
.book-label { min-width: 0; }
.book-label b { display: block; font-family: var(--display); font-size: 15px; font-weight: 700; letter-spacing: 0.02em; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.book-label small { display: block; font-family: var(--mono); font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.book-tab.dim .book-label b { color: #677085; }
.book-flag { display: flex; align-items: center; }
.book-flag .new { font-family: var(--display); font-weight: 700; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: #061015; background: var(--you); border-radius: 4px; padding: 1px 5px; box-shadow: 0 0 10px rgba(46, 242, 255, 0.45); }
.book-flag .done { color: var(--ink); font-weight: 700; font-size: 15px; }
.ticks { display: inline-flex; gap: 3px; }
.ticks i { width: 7px; height: 7px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--ink) 70%, transparent); }
.ticks i.on { background: var(--ink); box-shadow: 0 0 6px color-mix(in srgb, var(--ink) 60%, transparent); }
.ticks.big { display: flex; gap: 6px; margin: 2px 0 8px !important; }
.ticks.big i { width: 14px; height: 14px; }

.book-page { overflow-y: auto; padding: 24px 28px 34px; outline: none; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
  background-image: linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 24px 24px; }
.book-page:focus-visible { box-shadow: inset 0 0 0 2px var(--you); }

.entry { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; grid-template-areas: "plate head" "plate notes" "cols cols"; gap: 4px 28px; align-items: start; animation: page-in 0.28s ease-out; }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } }
.plate { grid-area: plate; margin: 0; }
.plate-stage { position: relative; aspect-ratio: 1 / 1.08; border-radius: 14px; overflow: hidden; background: #05060a; border: 1px solid color-mix(in srgb, var(--ink) 35%, transparent); box-shadow: 0 0 46px color-mix(in srgb, var(--ink) 16%, transparent); }
.plate-stage canvas.studio { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.plate-stage canvas.studio:active { cursor: grabbing; }
.plate-stage.no-gl::after { content: 'No picture: this browser can\'t draw 3D.'; position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; text-align: center; color: var(--muted); font-size: 12px; }
.plate.likeness canvas { display: block; width: 100%; max-width: 300px; aspect-ratio: 1; border-radius: 14px; background: radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--ink) 10%, #0a0c12), #05060a 75%); border: 1px solid color-mix(in srgb, var(--ink) 35%, transparent); }
.plate figcaption { margin-top: 8px; font-family: var(--sans); font-size: 12px; font-style: italic; color: var(--muted); }
.entry-head { grid-area: head; position: relative; padding-top: 2px; }
.kicker { margin: 4px 0 4px; font-family: var(--display); font-weight: 700; font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink); }
.entry-name { margin: 0; font-family: var(--display); font-weight: 700; font-size: clamp(36px, 4.4vw, 54px); line-height: 0.95; color: #fff; text-shadow: 0 0 26px color-mix(in srgb, var(--ink) 40%, transparent); }
.entry-meta { margin: 8px 0 12px; font-size: 12.5px; color: var(--muted); }
.entry-lede { margin: 0 0 14px; max-width: 54ch; font-family: var(--sans); font-size: 16.5px; line-height: 1.5; color: #e2e7f0; }
.entry-where { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; font-size: 12px; color: var(--muted); }
.entry-where > span:first-child { margin-right: 4px; }
.chip { font-family: var(--display); font-weight: 700; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; padding: 2px 9px; border-radius: 999px; color: var(--c); border: 1px solid color-mix(in srgb, var(--c) 55%, transparent); background: color-mix(in srgb, var(--c) 10%, transparent); }
.stamp { position: absolute; right: 0; top: 0; margin: 0; transform: rotate(9deg); font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--ink); border: 2px solid var(--ink); border-radius: 6px; padding: 4px 8px 4px 12px; opacity: 0.85; mix-blend-mode: screen; }
.notes { grid-area: notes; display: flex; flex-wrap: wrap; gap: 14px; margin: 14px 0 0; }
.note { position: relative; max-width: 330px; padding: 11px 15px 13px; font-family: var(--hand); font-size: 18px; line-height: 1.32; color: #fff0de; background: color-mix(in srgb, var(--who) 14%, #120e0a); border: 1px solid color-mix(in srgb, var(--who) 40%, transparent); border-radius: 4px 14px 6px 12px; transform: rotate(-1.3deg); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35); }
.note.later { transform: rotate(1.1deg); }
.note-by { display: block; margin-bottom: 2px; font-family: var(--display); font-weight: 700; font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--who); }
.entry-cols { grid-area: cols; display: grid; grid-template-columns: 1fr 1fr; gap: 18px 30px; margin-top: 22px; padding-top: 18px; border-top: 1px solid color-mix(in srgb, var(--ink) 30%, transparent); }
.entry-cols section.wide { grid-column: 1 / -1; }
.entry-cols h4, .chart h4 { display: flex; align-items: center; gap: 10px; margin: 0 0 9px; font-family: var(--display); font-weight: 700; font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink); }
.entry-cols h4::after, .chart h4::after { content: ''; flex: 1; height: 1px; background: color-mix(in srgb, var(--ink) 25%, transparent); }
.entry-cols p { margin: 0 0 8px; font-family: var(--sans); font-size: 14.5px; line-height: 1.55; color: #c9cfdb; }
.entry-cols p.temper { color: var(--text); font-style: italic; }
.entry-cols p.locked { color: #6f788c; font-style: italic; }
.entry-cols p.tally { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.quotes, .said, .parts { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.quotes li { padding: 6px 10px; font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.06em; color: var(--ink); border-left: 2px solid var(--ink); background: color-mix(in srgb, var(--ink) 8%, transparent); }
.said li { padding: 4px 0 4px 14px; font-family: var(--sans); font-size: 14.5px; line-height: 1.5; color: #dfe4ee; border-left: 2px solid color-mix(in srgb, var(--ink) 50%, transparent); }
.parts li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; }
.parts svg { margin-top: 1px; color: var(--you); }
.parts li.starter svg, .parts li.none svg, .parts li.unknown svg { color: #59617a; }
.parts b { display: block; font-family: var(--display); font-size: 14px; color: var(--text); }
.parts span { font-family: var(--sans); font-size: 13.5px; line-height: 1.4; color: #b9c0cd; }
.sheet { display: grid; grid-template-columns: auto 1fr; margin: 0; }
.sheet dt, .sheet dd { padding: 5px 0; border-bottom: 1px dotted rgba(255, 255, 255, 0.13); font-size: 12.5px; }
.sheet dt { color: var(--muted); }
.sheet dd { margin: 0; text-align: right; font-family: var(--display); font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.entry.unseen .entry-name { color: #4a5160; text-shadow: none; }
.entry.unseen .plate-stage { border-color: rgba(255, 255, 255, 0.1); box-shadow: none; }

/* the manual */
.ch-no { font-family: var(--display); font-weight: 700; font-size: 19px; letter-spacing: 0.04em; color: var(--ink); }
.chapter { max-width: 780px; animation: page-in 0.28s ease-out; }
.chapter header { margin-bottom: 16px; }
.chapter .entry-lede { font-size: 17px; max-width: 60ch; }
.art { margin: 0 0 18px; padding: 14px 14px 12px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--ink) 28%, transparent); background-color: #080a11;
  background-image: linear-gradient(color-mix(in srgb, var(--ink) 6%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--ink) 6%, transparent) 1px, transparent 1px);
  background-size: 20px 20px; }
.art svg { display: block; width: 100%; height: auto; overflow: visible; }
.art figcaption { margin-top: 8px; font-family: var(--sans); font-size: 13px; font-style: italic; color: var(--muted); text-align: center; }
.art .lbl { font-family: var(--display); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.art .cap { font-family: var(--display); font-weight: 700; }
.art .say { font-family: var(--mono); letter-spacing: 0.04em; }
.art .pulse { animation: art-pulse 1.6s ease-in-out infinite; }
.art .zap, .art .flow { animation: art-dash 0.6s linear infinite; }
.art .zap { stroke-dasharray: 10 6; }
.art .bolts { animation: art-dash2 0.6s linear infinite; }
.art .comet { animation: art-comet 1.8s linear infinite; }
.art .spin { transform-box: fill-box; transform-origin: center; animation: art-spin 7s linear infinite; }
.art .bolt { animation: art-bolt 1.6s linear infinite; }
.art .fall { animation: art-fall 2.4s linear infinite; }
@keyframes art-pulse { 50% { opacity: 0.45; } }
@keyframes art-dash { to { stroke-dashoffset: -16; } }
@keyframes art-dash2 { to { stroke-dashoffset: -32; } }
@keyframes art-comet { from { stroke-dashoffset: 14; } to { stroke-dashoffset: -240; } }
@keyframes art-spin { to { transform: rotate(360deg); } }
@keyframes art-bolt { 85% { opacity: 1; } to { transform: translate(var(--dx), var(--dy)); opacity: 0; } }
@keyframes art-fall { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { transform: translateY(186px); opacity: 0; } }
body.reduced .art *, body.reduced .thumb-wait, body.reduced .entry, body.reduced .chapter { animation: none !important; }
.chapter-body p, .points li { font-family: var(--sans); font-size: 15px; line-height: 1.6; color: #cdd3de; }
.chapter-body p { margin: 0 0 12px; max-width: 64ch; }
.points { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 9px; max-width: 66ch; }
.points li { position: relative; padding-left: 22px; }
.points li::before { content: ''; position: absolute; left: 3px; top: 0.6em; width: 7px; height: 7px; border-radius: 1px; background: var(--ink); transform: rotate(45deg); box-shadow: 0 0 6px color-mix(in srgb, var(--ink) 60%, transparent); }
.chapter-body .tip { padding: 10px 14px; border-left: 3px solid var(--ink); border-radius: 0 10px 10px 0; background: color-mix(in srgb, var(--ink) 8%, transparent); }
.chapter-body b { color: var(--text); }
.book-page kbd { display: inline-block; min-width: 1.6em; padding: 0 6px; font-family: var(--mono); font-size: 12px; line-height: 1.6; text-align: center; color: #fff; background: #171b28; border: 1px solid #3a4256; border-bottom-width: 3px; border-radius: 5px; }
.chart { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 22px; margin-top: 16px; }
.two-kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 0 0 14px; }
.two-kinds section { padding: 12px 14px 4px; border-radius: 12px; border: 1px solid; }
.two-kinds h4 { margin: 0 0 8px; font-family: var(--display); font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; }
.two-kinds .kept { border-color: rgba(46, 242, 255, 0.4); background: rgba(46, 242, 255, 0.05); --ink: var(--you); }
.two-kinds .kept h4 { color: var(--you); }
.two-kinds .run { border-color: rgba(255, 210, 120, 0.4); background: rgba(255, 210, 120, 0.05); --ink: #ffd27a; }
.two-kinds .run h4 { color: #ffd27a; }
.parts small { margin-left: 4px; font-family: var(--mono); font-weight: 400; font-size: 10.5px; color: var(--muted); }
.chapter-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.chapter-nav button { min-height: 40px; font-size: 14px; }

@media (max-width: 820px) {
  .chart, .two-kinds { grid-template-columns: 1fr; }
  .book-body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .book-index { display: flex; gap: 6px; overflow-x: auto; overflow-y: hidden; padding: 8px 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .book-index [role="tablist"] { display: flex; gap: 6px; }
  .book-group { display: none; }
  .book-tab { width: 190px; flex: none; margin: 0; }
  .book-page { padding: 18px 16px 26px; }
  .entry { grid-template-columns: 1fr; grid-template-areas: "plate" "head" "notes" "cols"; }
  .plate-stage { max-width: 340px; }
  .entry-cols { grid-template-columns: 1fr; }
}

/* end of run */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0; }
.stats div { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.stats dt { color: var(--muted); font-size: 12px; }
.stats dd { margin: 0; font-family: var(--display); font-weight: 700; font-size: 22px; }
.unlocks { color: var(--you); min-height: 1em; }
.share { margin-top: 14px; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.share pre { margin: 0 0 10px; font-family: var(--mono); font-size: 13px; line-height: 1.6; white-space: pre-wrap; color: var(--text); }
.share-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.share-row span { color: var(--muted); font-size: 12.5px; }
.menu button.daily { justify-content: space-between; gap: 12px; }
.menu button.daily small { font-family: var(--mono); font-weight: 400; font-size: 12px; color: var(--muted); letter-spacing: 0; }

/* deck intro card */
.deck-card { position: fixed; left: 50%; top: 38%; transform: translate(-50%, -50%); text-align: center; z-index: 6; pointer-events: none; animation: deck-in 2.6s ease-out forwards; width: min(560px, calc(100vw - 32px)); }
.deck-num { font-size: 13px; letter-spacing: 0.4em; color: var(--muted); }
.deck-title { font-family: var(--display); font-weight: 700; font-size: clamp(40px, 8vw, 72px); letter-spacing: 0.12em; text-transform: uppercase; color: #fff; text-shadow: 0 0 30px var(--ink), 0 0 2px #fff; line-height: 1.1; }
@keyframes deck-in { 0% { opacity: 0; letter-spacing: 0.3em; } 12% { opacity: 1; } 75% { opacity: 1; } 100% { opacity: 0; } }

.fade { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; z-index: 20; transition: opacity 0.6s; }
.fade.on { opacity: 1; }
.loading { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--display); letter-spacing: 0.4em; color: var(--muted); z-index: 30; background: var(--bg); transition: opacity 0.5s; }
.loading.done { opacity: 0; pointer-events: none; }
.noscript { padding: 24px; }

/* a back issue of the Gazette, kept in the archive */
.clipping { background: #f1ece0; color: #1c1a16; font-family: Georgia, 'Times New Roman', serif; padding: 18px 22px 20px; border-radius: 4px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); max-width: 620px; }
.clipping .clip-ears { display: flex; justify-content: space-between; margin: 0 0 4px; padding-bottom: 4px; border-bottom: 1px solid #1c1a16; font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: #5c5446; }
.clipping .clip-title { margin: 0 0 8px; padding-bottom: 6px; border-bottom: 3px double #1c1a16; text-align: center; font-size: 26px; font-weight: 700; }
.clipping .clip-head { margin: 0 0 6px; font-family: var(--display); font-size: 24px; line-height: 1.1; text-transform: uppercase; color: #1c1a16; }
.clipping .clip-stand { margin: 0 0 10px; font-style: italic; font-size: 15px; color: #2b2720; }
.clipping figure { margin: 0 0 10px; }
.clipping img { display: block; width: 100%; aspect-ratio: 3 / 2; height: auto; border: 1px solid #1c1a16; background: #e3dccb; }
.clipping figcaption { margin-top: 5px; font-family: var(--mono); font-size: 11.5px; color: #3a352c; }
.clipping .gz-credit { font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: #7a705c; }
.clipping .clip-lead { font-size: 14.5px; line-height: 1.45; color: #23201b; margin: 0 0 12px; }
.clipping .clip-also-h { margin: 12px 0 6px; padding-top: 10px; border-top: 1px solid #1c1a16; font-family: var(--display); font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; }
.clipping .clip-also { max-width: 300px; }
.book-tab .issue-thumb { width: 48px; height: 48px; object-fit: cover; filter: grayscale(1) contrast(1.1); border-radius: 4px; }
/* ------------------------------------------------------------------ small screens */
@media (max-width: 900px) {
  .hud-deck { left: auto; right: 16px; transform: none; top: 200px; min-width: 0; text-align: right; }
  .claim-row { justify-content: flex-end; }
  .hint { top: auto; bottom: 96px; }
  .loop { left: 16px; transform: none; top: 196px; }
  .radio { bottom: 168px; }
  body.radio-on .prompt { bottom: 262px; }
}
@media (max-width: 720px) {
  .stat-label small { display: none; }
  .hud-status { width: 200px; }
  .hud-deck { left: auto; right: 16px; transform: none; top: 140px; min-width: 0; text-align: right; }
  .claim-row { justify-content: flex-end; }
  #minimap { width: 110px; height: 110px; }
  .socket { width: 104px; }
  .panel { padding: 20px 16px; }
}

/* the induction's strip: the whole loop, the step you're on lit */
.loop { position: absolute; left: 50%; top: 112px; transform: translateX(-50%); display: flex; gap: 4px; margin: 0; padding: 5px; list-style: none; background: rgba(8, 10, 16, 0.88); border: 1px solid var(--line); border-radius: 12px; font-family: var(--display); font-weight: 700; font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap; }
.loop li { display: flex; align-items: center; gap: 8px; padding: 7px 14px 7px 9px; border-radius: 8px; color: #6b7385; transition: color 0.3s, background 0.3s; }
.loop li b { display: inline-grid; place-items: center; width: 21px; height: 21px; border-radius: 50%; border: 1.5px solid currentColor; font-size: 11px; letter-spacing: 0; }
.loop li.done { color: var(--you); }
.loop li.done b { font-size: 0; background: rgba(46, 242, 255, 0.15); }
.loop li.done b::after { content: '✓'; font-size: 12px; }
.loop li.now { color: #021014; background: var(--you); box-shadow: 0 0 18px rgba(46, 242, 255, 0.45); animation: loop-now 1.3s ease-in-out infinite; }
.loop li.now b { border-color: #021014; }
.loop.all-done { border-color: rgba(46, 242, 255, 0.6); }
@keyframes loop-now { 50% { box-shadow: 0 0 30px rgba(46, 242, 255, 0.8); } }
body.reduced .loop li.now { animation: none; }
/* the first droid you break open: everything stops, and this says hack it */
.teach { position: fixed; inset: 0; z-index: 7; pointer-events: none; background: radial-gradient(circle at var(--x, 50%) calc(var(--y, 40%) + 70px), rgba(3, 4, 8, 0) 70px, rgba(3, 4, 8, 0.62) 240px); }
.teach-sign { position: absolute; left: var(--x, 50%); top: var(--y, 40%); transform: translate(-50%, calc(-100% - 34px)); padding: 16px 30px 18px; text-align: center; white-space: nowrap; background: rgba(4, 8, 14, 0.86); border: 2px solid rgba(46, 242, 255, 0.9); border-radius: 18px; box-shadow: 0 0 40px rgba(46, 242, 255, 0.28); }
.teach-top { font-family: var(--mono); font-size: 19px; color: #a9f6ff; letter-spacing: 0.04em; }
.teach-main { font-family: var(--display); font-weight: 700; font-size: 44px; line-height: 1.15; color: #fff; text-shadow: 0 0 18px rgba(46, 242, 255, 0.55); margin-top: 4px; }
.teach-main kbd { display: inline-block; vertical-align: 6px; margin-left: 10px; padding: 2px 16px 4px; font-family: var(--display); font-size: 34px; font-weight: 700; color: #021014; background: var(--you); border-radius: 10px; text-shadow: none; box-shadow: 0 0 22px rgba(46, 242, 255, 0.6); }
.teach-arrow { position: absolute; left: var(--x, 50%); top: var(--y, 40%); width: 0; height: 0; transform: translate(-50%, -30px); border-left: 16px solid transparent; border-right: 16px solid transparent; border-top: 20px solid var(--you); filter: drop-shadow(0 0 8px rgba(46, 242, 255, 0.8)); animation: teach-bob 0.9s ease-in-out infinite; }
.teach.in .teach-sign { animation: teach-in 0.35s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
.teach.in .teach-main kbd { animation: teach-key 1.1s ease-in-out 0.4s infinite; }
@keyframes teach-in { from { opacity: 0; transform: translate(-50%, calc(-100% - 10px)) scale(0.85); } }
@keyframes teach-bob { 50% { transform: translate(-50%, -22px); } }
@keyframes teach-key { 50% { box-shadow: 0 0 36px rgba(46, 242, 255, 0.95); transform: scale(1.06); } }
body.reduced .teach-arrow, body.reduced .teach.in .teach-sign, body.reduced .teach.in .teach-main kbd { animation: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .deck-card { animation: none; opacity: 1; }
}
body.reduced *, body.reduced *::before, body.reduced *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
