*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0e0e0f;
  --bg2:       #161618;
  --bg3:       #1e1e21;
  --border:    #2a2a2e;
  --narrator:  #8b9aa8;
  --scene:     #c4b89a;
  --creature:  #d4a843;
  --outcome:   #e8e0d0;
  --red:       #c0392b;
  --green:     #27ae60;
  --gold:      #c9a227;
  --fate:      #9b59b6;
  /* stat colors */
  --str:       #e05c3a;
  --int:       #4a9fd4;
  --dex:       #2ecc71;
  --stamina:   #c0392b;
  --sanity:    #2980b9;
  --radius:    5px;
  --font:      'Georgia', 'Times New Roman', serif;
  --mono:      'Courier New', monospace;
  /* max width — average mobile */
  --maxw:      480px;
}

html, body {
  background: var(--bg);
  color: var(--scene);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  min-height: 100dvh;
}

.screen { display: none; flex-direction: column; min-height: 100dvh; max-width: var(--maxw); margin: 0 auto; }
.screen.active { display: flex; }

/* ── COLORS ────────────────────────────────────────────────── */
.str-color     { color: var(--str); }
.int-color     { color: var(--int); }
.dex-color     { color: var(--dex); }
.stamina-label { color: var(--stamina); }
.sanity-label  { color: var(--sanity); }
.fate-label    { color: var(--fate); }
.gold-label    { color: var(--gold); }

/* ── START ──────────────────────────────────────────────────── */
#screen-start { align-items: center; justify-content: center; padding: 2rem 1.5rem; text-align: center; }

.start-wrap { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 1rem; align-items: center; }

.tower-title { display: flex; flex-direction: column; }
.title-small { font-size: 0.9rem; letter-spacing: 0.2em; color: var(--narrator); text-transform: uppercase; }
.title-large { font-size: 2.2rem; font-style: italic; color: var(--scene); line-height: 1.1; }
.title-sub   { color: var(--narrator); font-size: 0.8rem; font-style: italic; }

.name-entry { display: flex; flex-direction: column; gap: 0.5rem; width: 100%; }
.name-entry label { color: var(--narrator); font-size: 0.85rem; font-style: italic; }
.name-entry input {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--outcome); font-family: var(--font); font-size: 1rem; padding: 0.65rem 0.9rem; width: 100%; outline: none;
}
.name-entry input:focus { border-color: var(--int); }

.error-text { color: var(--red); font-size: 0.8rem; }
.hidden { display: none !important; }

/* ── BUTTONS ────────────────────────────────────────────────── */
.btn-primary {
  background: var(--bg3); border: 1px solid var(--int); border-radius: var(--radius);
  color: var(--int); cursor: pointer; font-family: var(--font); font-size: 0.9rem;
  padding: 0.65rem 1.2rem; width: 100%; transition: background 0.15s, color 0.15s; margin-top: 0.25rem;
}
.btn-primary:hover  { background: var(--int); color: var(--bg); }
.btn-primary:active { background: var(--int); color: var(--bg); }

.btn-secondary {
  background: transparent; border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--narrator); cursor: pointer; font-family: var(--font); font-size: 0.8rem;
  padding: 0.4rem 0.75rem; transition: border-color 0.15s, color 0.15s;
}
.btn-secondary:hover { border-color: var(--scene); color: var(--scene); }

.btn-ghost { background: transparent; border: none; color: var(--narrator); cursor: pointer; font-family: var(--font); font-size: 0.8rem; padding: 0.4rem; text-decoration: underline; }
.btn-ghost:hover { color: var(--scene); }
.btn-ghost-sm { background: transparent; border: none; color: var(--narrator); cursor: pointer; font-family: var(--font); font-size: 0.75rem; padding: 0.3rem; text-decoration: underline; }

.btn-danger { background: transparent; border: 1px solid var(--red); border-radius: var(--radius); color: var(--red); cursor: pointer; font-family: var(--font); font-size: 0.85rem; padding: 0.6rem 1rem; }
.btn-danger:hover { background: var(--red); color: var(--bg); }

.full-width { width: 100%; }

.btn-continue {
  background: var(--bg3); border: 1px solid var(--int); border-radius: var(--radius);
  color: var(--int); cursor: pointer; font-family: var(--font); font-size: 0.9rem;
  padding: 0.6rem 0; width: 100%; margin-top: 0.5rem; transition: background 0.15s;
}
.btn-continue:hover { background: var(--int); color: var(--bg); }

/* ── TITLE BAR ──────────────────────────────────────────────── */
#title-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.4rem 0.75rem; background: var(--bg2); border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.title-bar-name { color: var(--narrator); font-size: 0.75rem; font-style: italic; letter-spacing: 0.05em; }
.title-bar-right { display: flex; gap: 0.4rem; align-items: center; }

.btn-help {
  background: var(--fate); border: none; border-radius: var(--radius);
  color: #fff; cursor: pointer; font-family: var(--mono); font-size: 0.65rem;
  font-weight: bold; letter-spacing: 0.05em; padding: 0.2rem 0.45rem;
}
.btn-help:hover { opacity: 0.85; }

.btn-abandon {
  background: transparent; border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--narrator); cursor: pointer; font-size: 0.75rem; padding: 0.18rem 0.45rem; line-height: 1;
}
.btn-abandon:hover { border-color: var(--red); color: var(--red); }

.btn-map {
  background: var(--bg3); border: 1px solid var(--int); border-radius: var(--radius);
  color: var(--int); cursor: pointer; font-family: var(--mono); font-size: 0.65rem;
  font-weight: bold; letter-spacing: 0.05em; padding: 0.2rem 0.45rem;
}
.btn-map:hover { background: var(--int); color: var(--bg); }

/* ── FLOOR INDICATOR ────────────────────────────────────────── */
#floor-map-wrap { padding: 0.35rem 0.75rem; background: var(--bg2); border-bottom: 1px solid var(--border); flex-shrink: 0; }

#floor-label { color: var(--narrator); font-size: 0.72rem; letter-spacing: 0.06em; font-family: var(--mono); }

#floor-rooms { display: none; } /* rooms shown in map modal only */

/* ── MAP MODAL ──────────────────────────────────────────────── */
.map-modal-content { display: flex; flex-direction: column; gap: 0.3rem; max-height: 60dvh; overflow-y: auto; }

.map-floor-section { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.map-floor-label { background: var(--bg3); color: var(--narrator); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; padding: 0.25rem 0.5rem; }

.map-room-row {
  display: grid; grid-template-columns: 24px 1fr auto; gap: 0.2rem 0.5rem;
  padding: 0.3rem 0.5rem; border-top: 1px solid var(--border); align-items: center;
}
.map-room-row.current { background: rgba(74,159,212,0.08); }
.map-room-row.visited { opacity: 0.5; }
.map-room-num  { font-family: var(--mono); font-size: 0.7rem; color: var(--narrator); text-align: right; }
.map-room-name { font-size: 0.8rem; color: var(--scene); }
.map-room-name.unknown { color: var(--narrator); font-style: italic; }
.map-room-name.current { color: var(--int); }
.map-room-tag  { font-size: 0.6rem; color: var(--narrator); font-family: var(--mono); white-space: nowrap; }
.map-room-tag.current-tag { color: var(--int); }

/* ── EQUIPMENT ──────────────────────────────────────────────── */
#slots { display: flex; gap: 0.35rem; padding: 0.4rem 0.75rem; border-bottom: 1px solid var(--border); flex-shrink: 0; }

.slot { flex: 1; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.3rem 0.4rem; min-width: 0; }
.slot-label { display: block; font-size: 0.55rem; color: var(--narrator); text-transform: uppercase; letter-spacing: 0.08em; }
.slot-name  { display: block; font-size: 0.72rem; color: var(--scene); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot-stat  { display: block; font-size: 0.6rem; color: var(--int); font-family: var(--mono); }

/* ── LORE BAR ───────────────────────────────────────────────── */
#lore-bar { padding: 0.35rem 0.75rem; border-bottom: 1px solid var(--border); flex-shrink: 0; }

.btn-lore {
  background: transparent; border: 1px dashed var(--border); border-radius: var(--radius);
  color: var(--narrator); cursor: pointer; font-family: var(--font); font-size: 0.75rem;
  font-style: italic; padding: 0.3rem 0.6rem; width: 100%; text-align: center; transition: color 0.15s, border-color 0.15s;
}
.btn-lore:hover { color: var(--gold); border-color: var(--gold); }
.btn-lore:disabled { opacity: 0.4; cursor: default; }

/* ── MAIN TEXT ──────────────────────────────────────────────── */
#main-text { padding: 0.75rem; flex: 1; }

.text-narrator { color: var(--narrator); font-style: italic; font-size: 0.85rem; margin-bottom: 0.6rem; line-height: 1.6; }
.text-scene    { color: var(--scene);    font-size: 0.9rem;  margin-bottom: 0.6rem; line-height: 1.6; }
.text-creature { color: var(--creature); font-size: 0.88rem; font-style: italic; margin-bottom: 0.6rem; line-height: 1.6;
  padding-left: 0.65rem; border-left: 2px solid var(--creature); }
.text-outcome  { color: var(--outcome); font-size: 0.88rem; margin-top: 0.5rem; line-height: 1.6;
  padding: 0.6rem 0.7rem; background: var(--bg2); border-radius: var(--radius); border-left: 2px solid var(--int); }
.text-outcome.fail { border-left-color: var(--red); }
.text-exit     { color: var(--narrator); font-size: 0.8rem; font-style: italic; margin-top: 0.4rem; line-height: 1.5; }

/* ── LORE PANEL ─────────────────────────────────────────────── */
#lore-panel { margin: 0 0.75rem 0.5rem; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.6rem 0.75rem; }
.text-lore  { color: var(--narrator); font-size: 0.82rem; font-style: italic; line-height: 1.6; margin-bottom: 0.4rem; }

/* ── CHOICE TABLE ───────────────────────────────────────────── */
#choices { padding: 0 0.75rem 0.5rem; flex-shrink: 0; }

#choice-table {
  width: 100%; border-collapse: collapse; font-size: 0.78rem;
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}

#choice-table thead tr { background: var(--bg3); }
#choice-table th { color: var(--narrator); font-weight: normal; font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.06em; padding: 0.3rem 0.4rem; text-align: left; border-bottom: 1px solid var(--border); }

.choice-row { cursor: pointer; transition: background 0.1s; border-top: 1px solid var(--border); }
.choice-row:hover { background: var(--bg3); }
.choice-row td   { padding: 0.45rem 0.4rem; vertical-align: middle; }

.cell-statval  { font-family: var(--mono); font-size: 0.9rem; color: var(--outcome); font-weight: bold; width: 36px; text-align: center; }
.cell-statname { font-size: 0.78rem; font-weight: bold; width: 72px; }
.cell-dc       { font-family: var(--mono); color: var(--narrator); width: 60px; }
.cell-pass     { color: var(--gold);    font-size: 0.75rem; }
.cell-fail     { color: var(--stamina); font-size: 0.75rem; }

/* ── DICE ───────────────────────────────────────────────────── */
#dice-area { padding: 0.5rem 0.75rem; display: flex; align-items: center; gap: 0.6rem; flex-shrink: 0; }

#dice-wrap, #boss-dice-wrap { width: 64px; height: 64px; flex-shrink: 0; }

#d20-svg, #boss-d20-svg { width: 64px; height: 64px; }

#d20-shape, #boss-d20-shape {
  fill: var(--bg3);
  stroke: var(--int);
  stroke-width: 2.5;
  transition: stroke 0.2s;
}

#d20-text, #boss-d20-text {
  font-family: var(--mono); font-size: 26px; font-weight: bold; fill: var(--int);
  transition: fill 0.2s;
}

.dice-str #d20-shape { stroke: var(--str); }
.dice-str #d20-text  { fill:   var(--str); }
.dice-int #d20-shape { stroke: var(--int); }
.dice-int #d20-text  { fill:   var(--int); }
.dice-dex #d20-shape { stroke: var(--dex); }
.dice-dex #d20-text  { fill:   var(--dex); }

.dice-str-boss #boss-d20-shape { stroke: var(--str); }
.dice-str-boss #boss-d20-text  { fill:   var(--str); }
.dice-int-boss #boss-d20-shape { stroke: var(--int); }
.dice-int-boss #boss-d20-text  { fill:   var(--int); }
.dice-dex-boss #boss-d20-shape { stroke: var(--dex); }
.dice-dex-boss #boss-d20-text  { fill:   var(--dex); }

@keyframes d20-spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.d20-spinning { animation: d20-spin 0.12s linear infinite; transform-origin: 50px 50px; }

/* ── ROLL LOG ───────────────────────────────────────────────── */
#roll-log { padding: 0 0.75rem 0.4rem; font-family: var(--mono); font-size: 0.72rem; color: var(--narrator); flex-shrink: 0; }
#roll-log div { line-height: 1.7; }
.roll-pass { color: var(--green); font-weight: bold; }
.roll-fail { color: var(--red);   font-weight: bold; }

/* ── HUD ────────────────────────────────────────────────────── */
#hud { border-top: 1px solid var(--border); padding: 0.4rem 0.75rem; flex-shrink: 0; display: flex; flex-direction: column; gap: 0.3rem; background: var(--bg2); }

.hud-row { display: flex; gap: 0.4rem; align-items: center; }

.hud-stat-block { flex: 3; min-width: 0; }

.hud-label-row { display: flex; align-items: baseline; gap: 0.35rem; margin-bottom: 0.15rem; }
.hud-label { font-size: 0.7rem; font-weight: bold; text-transform: uppercase; letter-spacing: 0.08em; }
.hud-val   { font-family: var(--mono); font-size: 0.8rem; color: var(--outcome); }

.hud-help-btn {
  background: transparent; border: 1px solid var(--border); border-radius: 50%;
  color: var(--narrator); cursor: pointer; font-size: 0.6rem; width: 14px; height: 14px;
  display: flex; align-items: center; justify-content: center; line-height: 1; padding: 0; margin-left: auto;
}
.hud-help-btn:hover { border-color: var(--fate); color: var(--fate); }

.bar-wrap { height: 5px; background: var(--bg3); border-radius: 3px; overflow: hidden; }
.bar      { height: 100%; border-radius: 3px; transition: width 0.35s ease; }
.bar-stamina { background: var(--stamina); }
.bar-sanity  { background: var(--sanity);  }

.hud-chip-block { flex: 1; display: flex; align-items: center; justify-content: center; }

.hud-chip {
  display: flex; flex-direction: column; align-items: center; gap: 0; padding: 0.2rem 0.4rem;
  background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius); min-width: 52px; text-align: center;
}
.chip-fate { border-color: var(--fate); }
.chip-gold { border-color: var(--gold); }

.chip-icon  { font-size: 0.8rem; line-height: 1; }
.chip-label { font-size: 0.55rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--narrator); }
.chip-val   { font-family: var(--mono); font-size: 0.9rem; color: var(--outcome); font-weight: bold; }
.chip-fate .chip-val { color: var(--fate); }
.chip-gold .chip-val { color: var(--gold); }

/* ── OVERLAY ────────────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.82);
  display: flex; align-items: center; justify-content: center; padding: 1rem; z-index: 100;
}

.overlay-box {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  max-width: var(--maxw); width: 100%; padding: 1.25rem; display: flex; flex-direction: column; gap: 0.75rem; max-height: 90dvh; overflow-y: auto;
}
.overlay-wide { max-width: 440px; }

.overlay-title { color: var(--scene); font-size: 1rem; font-style: italic; border-bottom: 1px solid var(--border); padding-bottom: 0.4rem; }
.overlay-actions { display: flex; gap: 0.5rem; align-items: center; }
.overlay-actions .btn-primary { margin-top: 0; flex: 1; }

/* ── HELP MODAL ─────────────────────────────────────────────── */
.help-title   { color: var(--scene); font-size: 1rem; font-style: italic; border-bottom: 1px solid var(--border); padding-bottom: 0.4rem; }
.help-body    { display: flex; flex-direction: column; gap: 0.75rem; }
.help-section { display: flex; flex-direction: column; gap: 0.25rem; }
.help-heading { font-size: 0.8rem; font-weight: bold; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.1rem; }
.help-body p  { color: var(--narrator); font-size: 0.82rem; line-height: 1.55; }
.help-danger  { color: var(--red) !important; }

/* ── ITEM FOUND ─────────────────────────────────────────────── */
.item-overlay-slots {
  display: flex; gap: 0.3rem; margin-bottom: 0.4rem;
}
.item-overlay-slot {
  flex: 1; background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.25rem 0.35rem; min-width: 0;
}
.item-overlay-slot.will-replace { border-color: var(--gold); }
.item-overlay-slot-label { font-size: 0.55rem; color: var(--narrator); text-transform: uppercase; letter-spacing: 0.06em; display: block; }
.item-overlay-slot-name  { font-size: 0.68rem; color: var(--scene); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-overlay-slot-stat  { font-size: 0.58rem; color: var(--int); font-family: var(--mono); display: block; }
#item-found-content { background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.6rem 0.75rem; }
.item-name    { color: var(--scene); font-size: 1rem; margin-bottom: 0.2rem; }
.item-stat    { font-family: var(--mono); font-size: 1rem; margin-bottom: 0.15rem; }
.item-flavour { color: var(--narrator); font-size: 0.8rem; font-style: italic; }
.item-slot-label { color: var(--narrator); font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.35rem; }

#item-reroll-area { display: flex; flex-direction: column; gap: 0.35rem; }

/* ── SHOP ───────────────────────────────────────────────────── */
#screen-shop  { padding: 0.75rem; gap: 0.75rem; }

.page-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); padding-bottom: 0.4rem; }
.shop-section-title { color: var(--narrator); font-size: 0.75rem; font-style: italic; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.4rem; display: flex; justify-content: space-between; align-items: center; }
.shop-reroll-info { font-size: 0.65rem; color: var(--narrator); opacity: 0.7; }

.shop-section { display: flex; flex-direction: column; }

.restore-grid { display: flex; flex-direction: column; gap: 0.35rem; }

.restore-row { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.45rem 0.6rem; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.restore-name { font-size: 0.8rem; font-weight: bold; min-width: 55px; }
.restore-rate { font-size: 0.7rem; color: var(--narrator); flex: 1; }
.restore-controls { display: flex; align-items: center; gap: 0.35rem; }
.btn-qty { background: var(--bg3); border: 1px solid var(--border); border-radius: 3px; color: var(--scene); cursor: pointer; font-size: 0.85rem; padding: 0.1rem 0.4rem; line-height: 1; }
.qty-val { font-family: var(--mono); font-size: 0.85rem; min-width: 16px; text-align: center; }
.restore-buy { font-size: 0.72rem; padding: 0.3rem 0.55rem; }

.chip-gold-inline { color: var(--gold); font-family: var(--mono); font-size: 0.85rem; }
.lb-title { color: var(--scene); font-style: italic; font-size: 1rem; }

#shop-item-list { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 0.4rem; }

.shop-item { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.5rem 0.65rem; display: flex; align-items: center; gap: 0.5rem; }
.shop-item-info { flex: 1; min-width: 0; }
.shop-item-name { color: var(--scene); font-size: 0.95rem; }
.shop-item-stat { font-family: var(--mono); font-size: 0.95rem; }
.shop-item-flav { color: var(--narrator); font-size: 0.75rem; font-style: italic; }
.shop-item-buy  { background: transparent; border: 1px solid var(--gold); border-radius: var(--radius); color: var(--gold); cursor: pointer; font-family: var(--mono); font-size: 0.72rem; padding: 0.3rem 0.55rem; white-space: nowrap; }
.shop-item-buy:hover { background: var(--gold); color: var(--bg); }

/* ── BOSS ───────────────────────────────────────────────────── */
#screen-boss { padding: 0.75rem; gap: 0.6rem; }
.phase-label { color: var(--narrator); font-size: 0.72rem; font-style: italic; text-align: center; border-top: 1px solid var(--border); padding-top: 0.4rem; }

#boss-choice-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
#boss-choice-table thead tr { background: var(--bg3); }
#boss-choice-table th { color: var(--narrator); font-weight: normal; font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.06em; padding: 0.3rem 0.4rem; text-align: left; border-bottom: 1px solid var(--border); }

.boss-hud { display: flex; gap: 1rem; padding: 0.5rem 0; border-top: 1px solid var(--border); font-size: 0.85rem; }
.boss-hud strong { font-family: var(--mono); }

#boss-dice-area { display: flex; align-items: center; gap: 0.6rem; }
#boss-roll-log  { font-family: var(--mono); font-size: 0.72rem; color: var(--narrator); line-height: 1.7; }

/* ── VICTORY / DEAD ─────────────────────────────────────────── */
#screen-victory, #screen-dead { padding: 1rem 0.75rem; gap: 0.75rem; align-items: center; }

#certificate-canvas { max-width: 100%; border: 1px solid var(--border); display: block; }
.score-display { font-family: var(--mono); font-size: 0.85rem; color: var(--int); text-align: center; }
.spoiler-text  { color: var(--narrator); font-style: italic; font-size: 0.8rem; text-align: center; line-height: 1.5; }

.email-section { display: flex; flex-direction: column; gap: 0.4rem; width: 100%; }
.email-section input { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); color: var(--outcome); font-family: var(--font); font-size: 0.9rem; padding: 0.55rem 0.75rem; width: 100%; outline: none; }
.email-section input:focus { border-color: var(--int); }

/* ── LEADERBOARD ────────────────────────────────────────────── */
#screen-leaderboard { padding: 0.75rem; gap: 0.5rem; }

.lb-entry { display: grid; grid-template-columns: 24px 1fr auto; gap: 0.2rem 0.5rem; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.5rem 0.65rem; }
.lb-rank  { color: var(--narrator); font-family: var(--mono); font-size: 0.75rem; }
.lb-name  { color: var(--scene); font-size: 0.85rem; }
.lb-score { color: var(--gold); font-family: var(--mono); font-size: 0.85rem; text-align: right; }
.lb-meta  { color: var(--narrator); font-size: 0.7rem; font-style: italic; grid-column: 2; }
.lb-date  { color: var(--narrator); font-size: 0.65rem; font-family: var(--mono); grid-column: 3; text-align: right; }

#lb-pages { display: flex; justify-content: center; gap: 0.4rem; }
.lb-page-btn { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); color: var(--narrator); cursor: pointer; font-family: var(--mono); font-size: 0.75rem; padding: 0.25rem 0.5rem; }
.lb-page-btn.active { border-color: var(--int); color: var(--int); }

/* ── SCROLLBAR ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ── REDUCED MOTION ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
