/* Layout: one column on phones (top bar, scene, stats, log, tabs);
   two columns from 900px (scene and stats left, log right). */
:root {
  --paper: #e9efea;      /* celadon-grey ground */
  --surface: #f6f9f6;
  --ink: #1d2724;
  --muted: #56655f;     /* (≥4.5:1 on the ground and the cards: players 2026-11-14, "the letters are sunken") */
  --line: #c9d6cf;
  --jade: #2c6b59;       /* accent: realm, qi, active controls */
  --gold: #7a5a0c;       /* lifespan (deepened 2026-11-14: "yellow letters can't be seen", now ≥5:1 on the ground) */
  --on-gold: #ffffff;    /* text on a gold fill */
  --cinnabar: #a8352a;   /* health, death */
  --up: #2c7a3d;
  --down: #b03328;
  /* the log's marks (src/log-marks.js): ties sky blue, things by their tier
     (items.js TIERS' hues, deepened to read on the light ground) */
  --tie: #2c63b0;
  --t0: #5d6460; --t1: #9a4a24; --t2: #2f7a3a; --t3: #2563a8; --t4: #7a3fb0; --t5: #a07c00;
  /* event rarity */
  --r-uncommon: #2f7a3a;
  --r-rare: #2563a8;
  --r-epic: #7a3fb0;
  --r-legendary: #b0670a;
  /* Buttons: a filled face, a firm border and a pixel "key" edge below, so a
     control reads apart from the ground and the cards in both themes. */
  --btn-bg: #fbfdfb;
  --btn-ink: #1d2724;
  --btn-border: #6f877d;
  --btn-edge: #9fb1a8;
  --btn-hover-bg: #e1ede6;
  --btn-press-bg: #cfe0d6;
  --btn-sel-bg: #1d2724;
  --btn-sel-ink: #f6f9f6;
  --btn-primary-border: #1f4f42;
  --btn-primary-edge: #173d33;
  --btn-primary-hover: #245b4c;
  --btn-dis-bg: #e4eae6;
  --btn-dis-hatch: #d6dfd9;
  --btn-dis-ink: #55655f;
  --btn-dis-border: #8a9c94;
  --focus-ring: #9a5800;
  --danger: #a8352a;
  --font-display: "Noto Serif Thai", "Noto Serif", Georgia, serif;
  --font-body: "IBM Plex Sans Thai", "Noto Sans Thai", system-ui, sans-serif;
  --gutter-l: max(16px, calc(env(safe-area-inset-left, 0px) / var(--zoom, 1)));
  --gutter-r: max(16px, calc(env(safe-area-inset-right, 0px) / var(--zoom, 1)));
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121815;
    --surface: #1a221e;
    --ink: #e2ebe6;
    --muted: #93a59d;
    --line: #2c3833;
    --jade: #6cc2a4;
    --gold: #d6b45c;
    --on-gold: #1d1a16;
    --cinnabar: #e07565;
    --up: #7fcf8c;
    --down: #ef8072;
    --tie: #86c4f2;
    --t0: #a3a8a5; --t1: #e0906a; --t2: #7fcf8c; --t3: #7fb2ec; --t4: #c39af0; --t5: #e6be55;
    --r-uncommon: #7fcf8c;
    --r-rare: #7fb2ec;
    --r-epic: #c39af0;
    --r-legendary: #f0b45a;
    --btn-bg: #26322d;
    --btn-ink: #e2ebe6;
    --btn-border: #6b8178;
    --btn-edge: #050807;
    --btn-hover-bg: #31413a;
    --btn-press-bg: #1b2521;
    --btn-sel-bg: #e2ebe6;
    --btn-sel-ink: #121815;
    --btn-primary-border: #9ad8c1;
    --btn-primary-edge: #2b5e4f;
    --btn-primary-hover: #86d3b8;
    --btn-dis-bg: #1c2420;
    --btn-dis-hatch: #242e2a;
    --btn-dis-ink: #a3b3ac;
    --btn-dis-border: #52645d;
    --focus-ring: #f0b45a;
    --danger: #ef8a7b;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper: #121815;
  --surface: #1a221e;
  --ink: #e2ebe6;
  --muted: #93a59d;
  --line: #2c3833;
  --jade: #6cc2a4;
  --gold: #d6b45c;
  --on-gold: #1d1a16;
  --cinnabar: #e07565;
  --up: #7fcf8c;
  --down: #ef8072;
  --tie: #86c4f2;
  --t0: #a3a8a5; --t1: #e0906a; --t2: #7fcf8c; --t3: #7fb2ec; --t4: #c39af0; --t5: #e6be55;
  --r-uncommon: #7fcf8c;
  --r-rare: #7fb2ec;
  --r-epic: #c39af0;
  --r-legendary: #f0b45a;
  --btn-bg: #26322d;
  --btn-ink: #e2ebe6;
  --btn-border: #6b8178;
  --btn-edge: #050807;
  --btn-hover-bg: #31413a;
  --btn-press-bg: #1b2521;
  --btn-sel-bg: #e2ebe6;
  --btn-sel-ink: #121815;
  --btn-primary-border: #9ad8c1;
  --btn-primary-edge: #2b5e4f;
  --btn-primary-hover: #86d3b8;
  --btn-dis-bg: #1c2420;
  --btn-dis-hatch: #242e2a;
  --btn-dis-ink: #a3b3ac;
  --btn-dis-border: #52645d;
  --focus-ring: #f0b45a;
  --danger: #ef8a7b;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
/* Phones' in-app browsers (Facebook, LINE) blow small text up on their own;
   the game sizes its text itself. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; touch-action: manipulation; }
/* (manipulation: a quick second tap on the same spot is two taps, not a zoom: players on phones, 2026-10-29. Pinch zoom stays.) */
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.9375rem; /* (15px at the root's 16: in rem so Settings' text size moves it, src/text-size.js) */
  line-height: 1.5;
}
button, input { font: inherit; color: inherit; }
button {
  border: 1px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--btn-ink);
  border-radius: 6px;
  padding: 10px 14px;
  min-height: 44px;
  cursor: pointer;
  box-shadow: 0 2px 0 var(--btn-edge);
}
/* (Less motion: Settings, src/motion.js.) */
:root:not(.less-motion) button { transition: background-color 0.12s, border-color 0.12s, color 0.12s, transform 0.06s; }
/* Button states, kept at the lowest weight (:where) so each panel's own
   look (tabs, chips, the dark menus) still wins over them:
   hover lightens and takes the jade border; pressed sinks onto its edge;
   selected (.active, aria-pressed) is a solid ink fill; disabled is hatched,
   dashed and muted but still readable. */
button:where(:hover:not(:disabled)) { background-color: var(--btn-hover-bg); border-color: var(--jade); }
button:where(:active:not(:disabled)) { background-color: var(--btn-press-bg); transform: translateY(2px); box-shadow: 0 0 0 var(--btn-edge); }
button:where(.active, [aria-pressed="true"]) { background: var(--btn-sel-bg); color: var(--btn-sel-ink); border-color: var(--btn-sel-bg); font-weight: 700; box-shadow: inset 0 0 0 2px var(--btn-sel-ink), 0 2px 0 var(--btn-edge); }
button:where(:disabled, [aria-disabled="true"]) {
  cursor: not-allowed;
  color: var(--btn-dis-ink);
  background: repeating-linear-gradient(135deg, var(--btn-dis-bg) 0 5px, var(--btn-dis-hatch) 5px 8px);
  border-color: var(--btn-dis-border);
  border-style: dashed;
  box-shadow: none;
  transform: none;
}
/* Main actions: the jade fill, a darker frame and a deeper edge. */
button.primary { background: var(--jade); border-color: var(--btn-primary-border); color: var(--paper); font-weight: 700; box-shadow: 0 3px 0 var(--btn-primary-edge); }
button.primary:hover:not(:disabled) { background: var(--btn-primary-hover); border-color: var(--btn-primary-border); }
button.primary:active:not(:disabled) { background: var(--jade); transform: translateY(3px); box-shadow: 0 0 0 var(--btn-primary-edge); }
button.primary:disabled { color: var(--btn-dis-ink); background: repeating-linear-gradient(135deg, var(--btn-dis-bg) 0 5px, var(--btn-dis-hatch) 5px 8px); border: 2px dashed var(--jade); box-shadow: none; }
/* Harmful or final acts: the cinnabar frame and text on a faint red wash. */
button.danger { color: var(--danger); border-color: var(--danger); background: color-mix(in srgb, var(--danger) 9%, var(--btn-bg)); font-weight: 600; }
button.danger:hover:not(:disabled) { background: color-mix(in srgb, var(--danger) 18%, var(--btn-bg)); border-color: var(--danger); }
button.danger:disabled { color: var(--btn-dis-ink); border-color: color-mix(in srgb, var(--danger) 60%, var(--btn-dis-border)); background: repeating-linear-gradient(135deg, var(--btn-dis-bg) 0 5px, var(--btn-dis-hatch) 5px 8px); }
button.link { border: 0; background: none; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; box-shadow: none; }
button.link:hover:not(:disabled) { color: var(--ink); background: none; text-decoration-thickness: 2px; }
button.link:active:not(:disabled) { transform: none; }
button.link:disabled { background: none; text-decoration-style: dotted; }
/* One keyboard focus ring for every control: amber, thick and set off from
   the button, so it reads apart from the jade selection and the red acts. */
:is(button, a[href], [role="button"], [role="tab"], summary, input, select, textarea, [tabindex]:not([tabindex="-1"])):focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}
[hidden] { display: none !important; }

.screen { max-width: 720px; margin: 0 auto; }

/* Start */
.start {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  padding-block: 24px;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
}
.start h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2.4rem;
  line-height: 1.2;
  text-wrap: balance;
}
.subtitle { margin: 0; color: var(--muted); }
.warning { margin: 0; font-size: 0.9rem; color: var(--muted); border-left: 3px solid var(--cinnabar); padding-left: 10px; }
.start input { padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }

/* Game */
.game { display: flex; flex-direction: column; height: 100%; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-block: 8px;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
  border-bottom: 1px solid var(--line);
}
.who { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.who strong { font-family: var(--font-display); font-size: 1.15rem; }
.who span { font-size: 0.82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.who .realm { color: var(--jade); font-weight: 600; }
.who .arc { color: var(--gold); }
.who-line { display: flex; flex-direction: column; }
.speed { display: flex; gap: 4px; flex-shrink: 0; }
.speed button { min-width: 40px; padding: 6px; font-variant-numeric: tabular-nums; }
.speed-pick { display: none; }
.speed button.active { background: var(--btn-sel-bg); color: var(--btn-sel-ink); border-color: var(--btn-sel-bg); font-weight: 700; box-shadow: inset 0 0 0 2px var(--btn-sel-ink); transform: translateY(2px); }

/* The scene takes the top half of the screen. */
.scene { position: relative; isolation: isolate; height: calc(var(--vh, 1vh) * 42); min-height: 200px; overflow: hidden; flex-shrink: 0; }
/* The pixel-art backdrop (src/pixel.js), enlarged with hard edges. */
.pixel-bg { position: absolute; left: 0; top: 0; image-rendering: pixelated; image-rendering: crisp-edges; }
.pixel-weather { z-index: 1; pointer-events: none; }
.pixel-front { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.front-piece { position: absolute; image-rendering: pixelated; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .front-piece { filter: brightness(0.82) saturate(0.9); } }
:root[data-theme="dark"] .front-piece { filter: brightness(0.82) saturate(0.9); }
/* The veil that fades the scene between places. */
.veil { position: absolute; inset: 0; background: var(--paper); opacity: 0; pointer-events: none; transition: opacity 0.45s ease; z-index: 2; }
.veil.on { opacity: 1; }
.veil.night { background: #000; color: #f3ead8; display: grid; place-items: center; font: 600 1.25rem/1.4 var(--serif, serif); letter-spacing: 0.04em; z-index: 9; }
.less-motion .veil { transition: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pixel-bg { filter: brightness(0.82) saturate(0.9); } }
:root[data-theme="dark"] .pixel-bg { filter: brightness(0.82) saturate(0.9); }

/* The hero and other people: pixel-art frame strips from src/pixel.js
   (size and images are set there); poses with two frames step through them. */
.figure, .npc, .px {
  position: absolute;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.figure { bottom: 18%; left: 50%; transform-origin: 50% 80%; }
/* The hero is drawn over everyone else in the scene (their name over theirs
   too); effects, bars, the weather and names stay over the hero. */
#figure { z-index: 1; }
.px { background-size: 100% 100%; }
.figure.glow { filter: drop-shadow(0 0 3px #ffd36a) drop-shadow(0 0 8px #f2b640); }
.figure.moving { animation: pxframes2 0.3s steps(2) infinite; }
.npc.walking { animation: pxframes2 0.3s steps(2) infinite; }
.convoy-cart { animation: cart-bob 0.6s steps(2) infinite; }
@keyframes cart-bob { 50% { translate: 0 -1px; } }
.figure.talk { animation: pxframes2 0.6s steps(2) infinite; }
.figure.sweep { animation: pxframes2 0.7s steps(2) infinite; }
.figure.punch { animation: pxframes2 0.7s steps(2) infinite; }
.figure.hop { animation: hop 0.6s ease-in-out infinite; }
.npc.thief { animation: pxframes2 0.3s steps(2) infinite; }
@keyframes pxframes2 { to { background-position: 200% 0; } }
/* A beast's idle and fight strips (pixel.js beastCss): 3 or 4 frames. */
@keyframes pxframes3 { to { background-position: 150% 0; } }
@keyframes pxframes4 { to { background-position: 133.3333% 0; } }
/* A fox's tails sway while the figure stands still (pixel.js SWAY_FRAMES). */
@keyframes pxframes6 { to { background-position: 120% 0; } }
/* A moving costume's loop (pixel.js COSTUME_FRAMES). */
@keyframes pxframes8 { to { background-position: 114.2857% 0; } }
.npc.sway:not(.walking):not(.talking) { animation: pxframes6 1.8s steps(6) infinite; }
@keyframes hop { 50% { transform: translateY(-10px); } }

/* Event animation layer (src/scene.js). Placeholders until real art. */
.fx-layer { position: absolute; inset: 0; pointer-events: none; }
.fx-layer .vfx { position: absolute; left: 0; top: 0; width: 100%; height: 100%; image-rendering: pixelated; pointer-events: none; z-index: 3; }
.fx-back .vfx { z-index: auto; }
.sprite { position: absolute; line-height: 1; transform-origin: 50% 50%; }
.idle-npc { bottom: 18%; opacity: 0; filter: blur(3px); transition: opacity 0.8s, filter 0.8s; }
.idle-npc.shown { opacity: 1; filter: none; }
/* During an event the friend and the people about blur away, then back. */
.idle-npc.shown.away { opacity: 0; filter: blur(3px); }
.idle-prop { position: absolute; bottom: 20%; font-size: 20px; line-height: 1; }
.beam {
  position: absolute;
  bottom: 18%;
  width: 60px;
  height: 100%;
  transform-origin: 50% 100%;
  background: linear-gradient(to top, color-mix(in srgb, var(--gold) 80%, transparent), transparent);
}
.caption {
  position: absolute;
  z-index: 3;
  left: var(--gutter-l);
  right: var(--gutter-r);
  top: 54px;
  padding: 4px 8px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1.35;
}

.less-motion .figure.hop, .less-motion .figure.moving, .less-motion .figure.talk, .less-motion .figure.sweep, .less-motion .figure.punch, .less-motion .npc.thief, .less-motion .npc.walking, .less-motion .convoy-cart, .less-motion .npc.sway { animation: none; }
.scene-text {
  position: absolute;
  z-index: 3;
  left: var(--gutter-l);
  top: 10px;
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  color: var(--ink);
  padding: 2px 8px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
}
#place { font-family: var(--font-display); font-weight: 600; }

.less-motion .figure, .less-motion .track div { transition: none; }

.stats {
  padding-block: 8px;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 4px;
}
.stat-row { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.9rem; }
.stat-row b { font-variant-numeric: tabular-nums; transition: color 0.3s; }
.stat-row b.up { color: var(--up); }
.stat-row b.down { color: var(--down); }
.stat-row small { color: var(--muted); font-size: 0.75rem; }
.stat-row i { font-style: normal; }
.bars { display: grid; gap: 4px; }
.bar { display: grid; grid-template-columns: 4.5em 1fr auto; align-items: center; gap: 8px; font-size: 0.85rem; }
.bar em { font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* A long note (qi: "no progress: meridians sealed…") wraps under its bar instead of pushing the panel wider. */
#qi-text { white-space: normal; max-width: 13em; text-align: right; line-height: 1.2; }
.bar .track { min-width: 48px; }
.track { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.track div { height: 100%; width: 0; transition: width 0.4s; }
#life-bar { background: var(--gold); }
#health-bar { background: var(--cinnabar); }
#qi-bar { background: var(--jade); }
#inf-bar { background: var(--gold); }
.bar.small { font-size: 0.75rem; }
.bar.small .track { height: 5px; }
.meta-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 12px; }
.money { font-size: 0.85rem; color: var(--muted); }
.focus { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; color: var(--muted); }
.focus button { min-height: 36px; padding: 4px 12px; border-color: var(--jade); color: var(--jade); font-weight: 600; }
.focus { min-width: 0; }
.focus button { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.focus #focus2-btn { font-weight: 500; border-style: solid; opacity: 0.92; }
.focus #focus2-btn.none { border-style: dashed; color: var(--muted); border-color: var(--line); font-weight: 400; }
.focus button:disabled { opacity: 1; cursor: not-allowed; color: var(--btn-dis-ink); border-color: var(--btn-dis-border); }
.money b { color: var(--ink); font-variant-numeric: tabular-nums; }
/* Karma with fame under it (players, 2026-10-27), each with its picture. */
.standing { display: grid; justify-items: end; gap: 1px; }
.money .stand-ico { width: 1.25em; height: 1.25em; vertical-align: -0.28em; margin: 0 0.2em 0 0; }
.stat-row .stat-ico { width: 1.15em; height: 1.15em; vertical-align: -0.22em; margin: 0 0.22em 0 0; }

.panel {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-block: 8px 16px;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
}
/* The log's two pages: what one did (events) and what one heard (news: rumours, word from afar). */
.log-tabs { display: flex; gap: 6px; padding: 6px 0 4px; }
.log-tabs button { flex: 1; position: relative; padding: 6px 8px; }
.log-tabs button.active { background: var(--btn-sel-bg); color: var(--btn-sel-ink); border-color: var(--btn-sel-bg); font-weight: 700; }
.log-tabs button[data-new]::after { content: attr(data-new); position: absolute; top: -6px; right: -4px; min-width: 18px; padding: 1px 5px; border-radius: 99px; background: var(--cinnabar); color: #fff; font-size: 11px; line-height: 16px; font-weight: 700; }
.log.sub-events li.news-item:not(.both), .log.sub-news li:not(.news-item) { display: none; }
.log.sub-events details[data-age]:not(:has(li:not(.news-item), li.both)), .log.sub-news details[data-age]:not(:has(li.news-item)), .log.sub-news details[data-rift] { display: none; }
.log details { border-bottom: 1px solid var(--line); padding: 4px 0; }
.log summary { cursor: pointer; font-family: var(--font-display); font-weight: 600; padding: 6px 0; }
.log ul { margin: 0; padding-left: 18px; }
.log li { margin: 0; padding: 6px 0; line-height: 1.5; }
/* A faint line between events, so each reads on its own. */
.log li + li { border-top: 1px solid var(--line); }
.log li.milestone { color: var(--jade); font-weight: 600; }
.log li.death { color: var(--cinnabar); font-weight: 700; }
.log li.year { color: var(--muted); font-size: 0.85rem; list-style: none; margin-left: -18px; }
.log li.talent { color: var(--gold); display: list-item; }
.log li.choice { color: var(--ink); font-weight: 600; }
.log li.major { color: var(--ink); font-weight: 600; border-left: 3px solid var(--gold); padding-left: 6px; list-style: none; margin-left: -18px; }

/* A new chapter of life (docs/25). */
.log li.arc { color: var(--gold); font-family: var(--font-display); font-weight: 700; list-style: none; margin-left: -18px; padding: 2px 0; border-top: 1px dashed var(--line); }
.arc-path { margin: 0; padding-left: 22px; }
.arc-path li { margin: 2px 0; color: var(--muted); }
.arc-path li.now { color: var(--ink); font-weight: 600; }

/* The world map (character sheet) and the life summary (end of a life). */
/* The world map (src/worldmap.js): pixel art in a parchment frame, with
   the names of the lands and the hero's town over it. */
.world-map {
  position: relative; width: 100%; max-width: 480px;
  border: 3px solid #8a6a4a; box-shadow: inset 0 0 0 2px #e8d8b0, 0 2px 0 rgb(0 0 0 / 0.3); border-radius: 2px;
}
.world-map canvas { display: block; width: 100%; height: auto; image-rendering: pixelated; image-rendering: crisp-edges; }
.world-map .map-name, .world-map .map-town {
  position: absolute; transform: translate(-50%, -50%); white-space: nowrap; pointer-events: none;
  font-size: 0.72rem; font-weight: 700; color: #2a2018; text-shadow: 0 0 2px #f4ecd0, 0 0 2px #f4ecd0, 0 0 3px #f4ecd0;
}
.world-map .map-name.unseen { color: #7a8088; font-weight: 400; }
.world-map .map-town { color: #8a1a14; font-size: 0.68rem; }
.life-summary { display: grid; gap: 4px; margin: 6px 0; }
.life-summary p { margin: 0; }
.life-summary ul { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 2px; }
.life-summary li { font-size: 0.9rem; }

/* Event rarity: a badge in the rarity's colour; rare and above also edge the line. */
.r-uncommon { --r-color: var(--r-uncommon); }
.r-rare { --r-color: var(--r-rare); }
.r-epic { --r-color: var(--r-epic); }
.r-legendary { --r-color: var(--r-legendary); }
.rarity-badge {
  display: inline-block; margin-right: 6px; padding: 0 7px; border: 1px solid var(--r-color); border-radius: 999px;
  color: var(--r-color); font-size: 0.72rem; font-weight: 700; line-height: 1.5; vertical-align: 1px; white-space: nowrap;
}
.log li.r-rare, .log li.r-epic, .log li.r-legendary { border-left: 3px solid var(--r-color); padding-left: 6px; list-style: none; margin-left: -18px; }
.log li.r-legendary { background: color-mix(in srgb, var(--r-legendary) 10%, transparent); border-radius: 0 6px 6px 0; }
#choice[class*="r-"] .card { border-top: 4px solid var(--r-color); }
#choice-title .rarity-badge { font-family: var(--font-body); font-size: 0.75rem; vertical-align: 3px; }

.character { display: grid; gap: 6px; }
.character dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 12px; margin: 0; }
.character dt { color: var(--muted); }
.character dd { margin: 0; min-width: 0; }
.character h3 { margin: 6px 0 0; font-family: var(--font-display); }
.axis { display: grid; grid-template-columns: 5.5em 1fr 7.5em; gap: 6px; align-items: center; font-size: 0.85rem; }
.axis .track { position: relative; }
.axis .track div { position: absolute; top: 0; bottom: 0; background: var(--jade); }
/* People (docs/18): who the hero knows and how close they are. */
.people { display: grid; gap: 6px; }
.people h3 { margin: 8px 0 0; font-family: var(--font-display); font-size: 0.95rem; }
.people-head { margin: 0; color: var(--muted); font-size: 0.85rem; }
/* The People tab: a grid of faces, names below (docs/18). */
.faces { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 6px; }
/* Cards out of view skip layout and paint (a long list froze phones). */
.faces > .face { content-visibility: auto; contain-intrinsic-size: auto 118px; }
.people-more { display: block; width: 100%; margin: 6px 0 2px; }
.face { position: relative; display: grid; justify-items: center; gap: 1px; padding: 6px 4px 5px; min-width: 0; text-align: center; }
.sex-badge { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 4px; font: 700 11px/1 sans-serif; color: #fff; vertical-align: middle; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.9), 0 1px 2px rgba(0, 0, 0, 0.35); }
.sex-badge.m { background: #3d8ee0; }
.sex-badge.f { background: #e0619d; }
.face > .sex-badge { position: absolute; top: 3px; right: 3px; z-index: 2; pointer-events: none; }
.face img, .person-top img { width: 64px; height: 64px; image-rendering: pixelated; background: var(--paper-2, rgba(0, 0, 0, 0.04)); border-radius: 6px; }
.face strong { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.82rem; }
.face small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 0.72rem; }
.face .closeness { width: 100%; margin-top: 3px; }
/* The closeness as a number and where they are, under the bar. */
.face .face-home { color: var(--jade); font-size: 0.68rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people-town { display: flex; gap: 8px; align-items: center; margin: 4px 0 8px; font-size: 0.85rem; color: var(--muted); }
.people-town select { flex: 1 1 auto; min-width: 0; max-width: 320px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--ink); font: inherit; }
.face .face-meta { display: flex; gap: 4px; align-items: center; justify-content: center; flex-wrap: wrap; font-size: 0.66rem; line-height: 1.2; margin-top: 2px; }
.face .face-meta b.warm { color: var(--up); }
.face .face-meta b.cold { color: var(--down); }
.face .face-meta .reach { padding: 0 4px; border-radius: 6px; white-space: nowrap; color: var(--muted); border: 1px solid var(--line); }
.face .face-meta .reach.near { color: #0f1a15; background: #7cc79a; border-color: #7cc79a; font-weight: 700; }
.face.gone img, .person-top img.gone { filter: grayscale(1) opacity(0.6); }
.face.divine img { box-shadow: 0 0 10px 2px rgba(255, 220, 140, 0.8); }
/* Taken into the family (src/family-invite.js): an adopted child, a sworn
   sibling of the house, a retainer, marked apart from the blood by a corner tag. */
.face .tie-tag { position: absolute; top: 3px; left: 3px; z-index: 2; padding: 0 4px; border-radius: 4px; font-size: 0.6rem; line-height: 1.4; color: #0f1a15; background: #d8c27a; pointer-events: none; }
.face .tie-tag.sworn { background: #9ec1e6; }
.face .tie-tag.retainer { background: #c9c9c9; }
.face.tie-adopt img, .face.tie-sworn img { outline: 2px dashed #d8c27a; outline-offset: 1px; }
.face.tie-sworn img { outline-color: #9ec1e6; }
/* The People tab's pages (ui.js peoplePage): a tree, the elder generation
   or the higher standing on top, joined by a line down the middle. */
.people-subs { margin: 6px 0 4px; flex-wrap: wrap; }
.people-subs button { padding: 6px 8px; }
.people-page { display: grid; gap: 0; padding-top: 6px; }
.tree-row { display: grid; justify-items: center; gap: 4px; position: relative; padding-bottom: 14px; }
.tree-row + .tree-row::before { content: ""; position: absolute; top: -14px; left: 50%; width: 2px; height: 12px; background: var(--line); }
.tree-row h4 { margin: 0; font-size: 0.78rem; font-weight: 600; color: var(--muted); }
.tree-faces { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; width: 100%; }
.tree-faces .face { width: 78px; padding: 4px 3px; }
.tree-faces .face img, .face.me canvas { width: 46px; height: 46px; }
.face.me { border: 2px solid var(--jade); border-radius: 6px; background: color-mix(in srgb, var(--jade) 10%, transparent); }
.face.me canvas { image-rendering: pixelated; border-radius: 6px; }
/* The sect page: the hero in their seat on the ladder and the roster (players, 2026-10-26). */
.sect-ladder li.here { border-left: 3px solid var(--jade); padding-left: 6px; background: color-mix(in srgb, var(--jade) 8%, transparent); }
.sect-ladder .me-seat { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 6px; font-size: 0.75rem; color: #0f1a15; background: var(--jade); font-weight: 700; }
.sect-mates h4.mates-mine { color: var(--jade); }
.face .mate-line { color: var(--muted); }
.sect-mates .faces .face.me canvas { width: 44px; height: 44px; }
.pupil-row .treasury-words.link-like, .treasury-row .treasury-words.link-like { background: none; border: 0; box-shadow: none; padding: 0; text-align: left; color: inherit; cursor: pointer; min-width: 0; }
/* (The key disciples' names: a dotted line says a tap shows who they are.) */
.sect-rule .treasury-words.link-like strong { text-decoration: underline dotted; text-underline-offset: 3px; }
.pupil-acts small { flex-basis: 100%; }
.person-card { max-height: calc(var(--vh, 1vh) * 85); overflow-y: auto; }
/* A person's card opens from inside panels too (the town's notables, the war council): above the menu panels (60), below the guide (70) and the confirmations (80). Players 2026-10-31: "can't open the acquaintances' window". */
#person-card { z-index: 65; }
.person-top { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.person-top img { width: 96px; height: 96px; flex: none; }
.person-top h2 { margin: 0; }
.person-top p { margin: 2px 0 0; color: var(--muted); font-size: 0.85rem; }
.person-card dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin: 0 0 8px; font-size: 0.88rem; }
.person-card dt { color: var(--muted); }
.person-card dd { margin: 0; }
.person-card h3 { margin: 6px 0 2px; font-size: 0.9rem; }
.person-card ul { margin: 0 0 10px; padding-left: 18px; font-size: 0.82rem; }
.closeness { position: relative; height: 5px; margin-top: 4px; background: var(--line); border-radius: 3px; overflow: hidden; }
.closeness::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--muted); }
.closeness i { position: absolute; top: 0; bottom: 0; }
.closeness i.warm { background: var(--jade); }
.closeness i.cold { background: var(--cinnabar); }
/* Bag and skills (docs/20). */
.gear { display: grid; gap: 6px; }
.gear h3 { margin: 8px 0 0; font-family: var(--font-display); font-size: 0.95rem; }
.slot { display: grid; grid-template-columns: minmax(90px, 35%) 1fr; align-items: center; gap: 8px; font-size: 0.88rem; }
.slot select { min-width: 0; padding: 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); font: inherit; }
.thing { display: grid; gap: 2px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.thing small { color: var(--muted); font-size: 0.78rem; }
.tier { display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 2px; vertical-align: baseline; }
.mastery { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.mastery i { display: block; height: 100%; background: var(--gold); }
.tabs button { font-size: 0.85rem; }
.character .seed { margin: 0; color: var(--muted); font-size: 0.8rem; word-break: break-all; }

.tabs {
  display: flex;
  border-top: 1px solid var(--line);
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
}
.tabs button { flex: 1; border: 0; border-radius: 0; background: none; color: var(--muted); box-shadow: none; font-weight: 600; }
/* A picture over each tab's name (ui.js tabIcon). */
.tabs button.has-icon { display: flex; flex-direction: column; align-items: center; gap: 2px; padding-top: 6px; padding-bottom: 6px; line-height: 1.1; }
.tabs button.has-icon::before { content: ""; width: 24px; height: 24px; background: var(--tab-icon) center / contain no-repeat; image-rendering: pixelated; image-rendering: crisp-edges; opacity: 0.75; transition: transform 0.15s, opacity 0.15s; }
.tabs button.has-icon.active::before, .tabs button.has-icon:hover::before { opacity: 1; transform: translateY(-1px) scale(1.08); }
@media (max-width: 520px) { .tabs button.has-icon { font-size: 0.68rem; padding-left: 1px; padding-right: 1px; } .tabs button.has-icon::before { width: 22px; height: 22px; } }
.tabs button:hover { color: var(--ink); background: color-mix(in srgb, var(--jade) 9%, transparent); }
.tabs button:active { transform: none; background: color-mix(in srgb, var(--jade) 16%, transparent); }
.tabs button.active { color: var(--ink); font-weight: 700; background: color-mix(in srgb, var(--jade) 14%, transparent); box-shadow: inset 0 4px 0 var(--jade); }
.tabs button:focus-visible { outline-offset: -3px; }

.overlay {
  position: fixed;
  z-index: 20;
  inset: 0;
  background: color-mix(in srgb, var(--paper) 30%, transparent);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-block: max(16px, calc(env(safe-area-inset-top, 0px) / var(--zoom, 1))) max(16px, calc(env(safe-area-inset-bottom, 0px) / var(--zoom, 1)));
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  max-width: 480px;
  width: 100%;
  max-height: 90%;
  overflow-y: auto;
  display: grid;
  gap: 10px;
  box-shadow: 0 10px 40px color-mix(in srgb, var(--ink) 25%, transparent);
}
.card h2, .card h3, .card p { margin: 0; }
.card h2 { font-family: var(--font-display); color: var(--cinnabar); }
.card ul { margin: 0; padding-left: 18px; }
#choice h2 { color: var(--jade); }
/* A decision folded away for a moment, to look at the scene, the people
   and the log; a button at the bottom brings it back. */
/* The choice always fits the screen (a phone on its side too): it scrolls
   inside itself rather than running off the bottom. */
#choice .card { position: relative; max-height: 100%; overflow-y: auto; overscroll-behavior: contain; }
#choice .choice-fold { position: absolute; top: 6px; right: 10px; font-size: 0.8rem; min-height: 28px; }
#choice h2 { padding-right: 96px; }
#choice .choice-unfold { display: none; }
#choice .choice-fold-start { display: flex; gap: 6px; align-items: center; margin-top: 10px; color: var(--muted); font-size: 0.8rem; }
/* Tinted, not blurred: the page behind the card stays readable (players, 2026-10-27). */
#choice { backdrop-filter: none; }
#choice.folded { background: transparent; backdrop-filter: none; pointer-events: none; z-index: 15; }
/* (Folded, the way back to the decision lies under every card, menu and panel opened over the page: players, 2026-11-01.) */
#choice.folded .card { display: none; }
body:has(#choice.folded) .speed button:not([data-speed="0"]) { opacity: 0.45; }
#choice.folded .choice-unfold { display: block; position: fixed; left: var(--ux, 50%); top: var(--uy, 40%); transform: translate(-50%, -50%); pointer-events: auto; border-radius: 999px; padding: 8px 18px; box-shadow: 0 4px 16px rgb(0 0 0 / 0.35); animation: unfoldPulse 1.8s infinite; }
/* (In the middle of the scene, a soft pulse so it is seen; still for reduced motion.) */
@keyframes unfoldPulse { 0% { box-shadow: 0 0 0 0 rgb(243 227 168 / 0.6); } 70% { box-shadow: 0 0 0 14px rgb(243 227 168 / 0); } 100% { box-shadow: 0 0 0 0 rgb(243 227 168 / 0); } }
.less-motion #choice.folded .choice-unfold { animation: none; }
.options { display: grid; gap: 8px; }
.options button { text-align: left; display: grid; gap: 2px; }
.options button small { color: var(--muted); font-size: 0.82rem; }
.options button.suggested { border-color: var(--jade); }
.options #choice-ok { text-align: center; }
.options button.locked { cursor: not-allowed; color: var(--btn-dis-ink); border-style: dashed; border-color: var(--btn-dis-border); background: repeating-linear-gradient(135deg, var(--btn-dis-bg) 0 5px, var(--btn-dis-hatch) 5px 8px); box-shadow: none; }
.options button.suggested { border-width: 2px; }

/* A wide screen: the scene across the top half; below it the stats on the
   left and the log and tabs on the right. */
@media (min-width: 900px) {
  /* The scene gives way on a short screen so the panel below keeps room to
     read: the log, and at least five lines of chat (2026-10-24). */
  /* (2026-10-25: the scene ninety art rows high on every computer screen
     (ui.js fitScene, --scene-h), so the same part of each place shows, the roofs' tops cut,
     the ground in full; only a very short window gives some of it back to
     the panel below.) */
  .screen.game { max-width: none; height: calc(var(--vh, 1vh) * 100); display: grid; grid-template-columns: 340px 1fr; grid-template-rows: auto max(180px, min(var(--scene-h, calc(calc(var(--vw, 1vw) * 100) / 4.2)), calc(calc(var(--vh, 1vh) * 100) - 330px))) 1fr auto; }
  .world-panel > .chat-list { min-height: 10.5em; }
  .topbar { grid-column: 1 / 3; }
  .scene { grid-column: 1 / 3; grid-row: 2; height: auto; min-height: 0; }
  .stats { grid-column: 1; grid-row: 3 / 5; align-content: start; min-width: 0; }
  .panel { grid-column: 2; grid-row: 3; min-height: 0; overflow: auto; border-left: 1px solid var(--line); }
  .tabs { grid-column: 2; grid-row: 4; border-left: 1px solid var(--line); }
}
/* (Not a phone held sideways: its own layout is below.) */
@media (min-width: 900px) and (pointer: fine), (min-width: 900px) and (min-height: 621px), (min-width: 900px) and (orientation: portrait) {
  /* The stats keep to their column (players, 2026-10-28: "the stats panel on
     the left spills into the middle"): every row as narrow as the column at
     most, a long word or number wrapping in it, and what a short window has no
     room for scrolled to inside the column, never drawn over the log. */
  .screen.game > .stats { min-height: 0; overflow: hidden auto; overscroll-behavior: contain; scrollbar-width: thin; }
  .screen.game > .stats > * { min-width: 0; max-width: 100%; }
  .screen.game > .stats .stat-row > span, .screen.game > .stats .money, .screen.game > .stats .bar > span { min-width: 0; overflow-wrap: anywhere; }
  .screen.game > .stats .bar { grid-template-columns: minmax(0, 4.5em) minmax(40px, 1fr) minmax(0, auto); }
  .screen.game > .stats .meta-row > * { min-width: 0; max-width: 100%; }
  .screen.game > .stats .focus { flex-wrap: wrap; }
}

/* A phone or a narrow window: the name and the speed buttons share a line,
   the stats sit compact under them, above the scene (each stat's name over
   its value; lifespan, health and qi side by side), and the scene is a
   little shorter, so the log keeps room to be read. */
@media (max-width: 899px) {
  .topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; row-gap: 2px; padding-block: 6px; }
  .who { display: contents; }
  .who strong { grid-row: 1; grid-column: 1; align-self: center; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .speed { grid-row: 1; grid-column: 2; }
  .speed { gap: 3px; }
  .speed button { min-width: 30px; min-height: 40px; padding: 4px 3px; font-size: 0.8rem; }
  /* (2026-10-25, players: pause/play and the speed chosen with ‹ ›, not a row of speeds.) */
  .speed [data-speed] { display: none; }
  .speed-pick { display: flex; align-items: center; gap: 3px; }
  .speed-pick .sp-play { min-width: 44px; }
  /* <<< >>> narrow, in yellow (players, 2026-10-25) */
  .speed-pick .sp-step { min-width: 32px; padding: 4px 3px; font-size: 0.72rem; font-weight: 800; letter-spacing: -0.12em;
    background: var(--speed-step, #e2b93b); color: #2b2008; border-color: color-mix(in srgb, #e2b93b 70%, #000); }
  .speed-pick .sp-step:active { filter: brightness(0.92); }
  .speed-pick .sp-val { min-width: 2.4em; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
  /* (2026-10-25, players' mock-up: the title on the left and the age and season on the right; then the realm on the left, the chapter on the right.) */
  .who-line { grid-row: 2; grid-column: 1 / 3; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; align-items: baseline; line-height: 1.35; }
  .who-line #age { justify-self: end; text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .who-line #realm { grid-column: 1; white-space: nowrap; }
  .who-line #arc { grid-column: 2; justify-self: end; text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .who-line:not(:has(.hero-title)) #age { grid-column: 1 / -1; justify-self: start; text-align: left; }
  /* (2026-10-25, players: the world tab's thin top on every tab.) The three
     bars thin on one line, the five stats on one line under them. The money,
     karma and way-of-life line stays on the world tab too (players, 2026-10-25). */
  .screen.game .stats { padding-block: 3px; gap: 2px; }
  .screen.game .stats .bars { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 10px; }
  .screen.game .stats .bar { font-size: 0.66rem; gap: 1px 4px; }
  .screen.game .stats .bar .track { height: 4px; }
  .screen.game .stats .stat-row { order: 9; margin-top: 2px; font-size: 0.68rem; line-height: 1.2; gap: 0 4px; }
  .screen.game .stats .stat-row i { display: inline; font-size: 0.62rem; }
  .screen.game .stats .stat-row small { display: none; }
  .screen.game .stats .meta-row { order: 10; }
  .stats { padding-block: 6px; gap: 6px; }
  .stat-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0 4px; text-align: center; font-size: 0.85rem; line-height: 1.25; }
  .stat-row i { display: block; font-size: 0.72rem; color: var(--muted); }
  .stat-row small { font-size: 0.66rem; }
  .bars { grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 2px 12px; }
  .bar { grid-template-columns: 1fr auto; grid-template-areas: "label value" "track track"; gap: 2px 4px; font-size: 0.75rem; }
  .bar > span { grid-area: label; color: var(--muted); }
  .bar em { grid-area: value; }
  .bar .track { grid-area: track; height: 6px; }
  .money, .focus { font-size: 0.8rem; }
  .focus button { min-height: 36px; padding: 2px 10px; }
  .scene { height: calc(var(--vh, 1vh) * 36); min-height: 180px; }
  .tabs button { min-height: 44px; padding: 6px 2px; font-size: 0.8rem; white-space: nowrap; }
}

/* The jail clip: bars over the hero. */
.fx-layer .jail { z-index: 2; position: absolute; bottom: 14%; background: repeating-linear-gradient(90deg, #3a3330 0 4px, transparent 4px 13px); border-top: 4px solid #3a3330; border-bottom: 4px solid #3a3330; pointer-events: none; }

#karma-val.good { color: var(--jade); }
#karma-val.bad { color: var(--down); }

/* People living in the place, and the hero's beast (docs/16). */
.extras { position: absolute; inset: 0; pointer-events: none; }
.extras .npc.extra { position: absolute; bottom: 18%; opacity: 0.92; }
.extras .pet { position: absolute; bottom: 17%; font-size: 20px; line-height: 1; }
/* Blurred away while a moment plays, all but the one it is about, one by one
   (scene.js fadeExtras: .faded on the layer, .lent and .lent-away on each). */
/* Icon grids for gear and techniques: a square framed in the tier's colour. */
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.icon-cell { display: grid; justify-items: center; align-content: start; gap: 2px; padding: 4px 2px; border: 0; border-radius: 8px; background: none; color: var(--ink); font: inherit; text-align: center; cursor: pointer; }
.icon-cell .sq { position: relative; display: grid; place-items: center; width: 52px; height: 52px; border: 3px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 1.6rem; line-height: 1; }
.icon-cell .sq.empty { border-style: dashed; color: var(--muted); font-size: 1.2rem; }
.icon-cell .sq i { position: absolute; right: 2px; bottom: 1px; font-style: normal; font-size: 0.65rem; font-weight: 700; }
.icon-cell .name { font-size: 0.72rem; line-height: 1.2; overflow-wrap: anywhere; }
.icon-cell small { color: var(--muted); font-size: 0.66rem; }
.icon-cell .slot-name { order: -1; color: var(--muted); }
.icon-cell .worn-tag { color: var(--ink); font-weight: 700; }
.icon-cell.using .sq { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--gold); }
.icon-cell.picked { background: color-mix(in srgb, var(--gold) 18%, transparent); }
.picker { max-height: calc(var(--vh, 1vh) * 85); overflow-y: auto; }
.picker .detail { display: grid; gap: 4px; padding-left: 8px; border-left: 4px solid var(--line); }
.picker .detail p { margin: 0; font-size: 0.88rem; }
.picker .detail small { color: var(--muted); }
.picker-actions { display: flex; gap: 8px; justify-content: flex-end; }
.bag-use { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0; }
/* A fight: HP bars over both sides, the attack's name, the damage dealt. */
.hpbar { position: absolute; width: 44px; height: 6px; transform: translateX(-50%); background: rgb(0 0 0 / 0.5); border: 1px solid rgb(0 0 0 / 0.7); border-radius: 3px; overflow: hidden; }
.hpbar i { display: block; width: 100%; height: 100%; background: #d8443a; transition: width 0.25s ease-out; }
.hpbar.hero i { background: #3fae5a; }
.atk-name, .dmg { position: absolute; white-space: nowrap; font-weight: 700; color: #fff; text-shadow: 0 1px 0 #000, 0 0 3px #000; pointer-events: none; }
.atk-name { font-size: 11px; }
.dmg { font-size: 13px; color: #ffd36a; }
/* A real fight shown (src/fight-show.js, docs/74 §13): the skills' canvas over the scene, the figures holding
   their weapons (a canvas in the figure's element, its own picture hidden), the floats, the status icons over the
   bars and the body's tints, the banners of a finisher, a qi's trigger, an element's edge. */
.fight-stage { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; image-rendering: pixelated; z-index: 3; }
.figure.posed, .npc.posed, .figure.posed.moving, .npc.posed.walking { background-image: none !important; animation: none !important; }
.fig-pose { position: absolute; pointer-events: none; image-rendering: pixelated; image-rendering: crisp-edges; }
.dmg.crit { color: #ffcc33; font-size: 16px; }
.dmg.miss { color: #e8eef4; font-size: 12px; }
.dmg.heal { color: #7ae08a; }
.dmg.tick { color: #ff9a5a; font-size: 11px; }
.dmg.st { font-size: 11px; color: #f0d8ff; }
.dmg.parry { color: #cfe4ff; }
.dmg.counter { color: #ffb08a; }
.qi-edge { position: absolute; font-size: 10px; font-weight: 700; color: #ffe9a8; text-shadow: 0 1px 0 #000, 0 0 3px #000; pointer-events: none; transform: translateX(-50%); }
.atk-name.ult { font-size: 13px; color: #ffe08a; }
.st-row { position: absolute; transform: translateX(-50%); display: flex; gap: 1px; pointer-events: none; z-index: 4; }
.st-ic { display: block; width: 10px; height: 10px; border: 1px solid rgb(0 0 0 / 0.7); border-radius: 2px; font: 700 8px/10px sans-serif; font-style: normal; color: #fff; text-align: center; text-shadow: 0 0 2px #000; }
.fight-banner { position: absolute; left: 50%; top: 16%; padding: 2px 10px; border-radius: 6px; background: rgb(14 10 18 / 0.72); color: #fff3cf; font-weight: 700; font-size: 12px; white-space: nowrap; pointer-events: none; z-index: 5; }
.fight-banner.ult { font-size: 14px; color: #ffd36a; box-shadow: inset 0 0 0 1px #c89a3a; }
.fight-banner.qi { top: 24%; color: #cfeaff; font-size: 11px; }
.fight-banner.elem { top: 30%; color: #ffe0a8; font-size: 11px; }
.fight-banner.elem.clash, .fight-banner.elem.rootClash { color: #ffb0a0; }
.st-freeze { filter: saturate(0.6) hue-rotate(160deg) brightness(1.1); }
.st-poison { filter: sepia(0.3) hue-rotate(60deg) saturate(1.4); }
.st-burn { animation: st-burn 0.5s steps(2) infinite; }
@keyframes st-burn { 50% { filter: sepia(0.4) saturate(2) hue-rotate(-20deg) brightness(1.1); } }
.st-stun { filter: brightness(0.9); }
.st-shield { filter: drop-shadow(0 0 2px #7ae0ff) drop-shadow(0 0 5px #3aa8e0); }
.st-stone { filter: grayscale(1) brightness(0.9); }
.st-sleep { filter: brightness(0.8) saturate(0.7); }
.st-charm { filter: drop-shadow(0 0 3px #ff8ac8); }
.less-motion .st-burn { animation: none; }
/* The command bar of a fight commanded by hand (src/battle-ui.js, docs/74 §9.4): right under the scene. */
.battle-bar { position: relative; box-sizing: border-box; width: min(100%, 460px); margin: 4px auto; padding: 4px 6px 6px; border-radius: 8px; background: rgb(18 14 22 / 0.9); color: #f3ead8; z-index: 8; pointer-events: auto; font-size: 12px; }
.battle-bar .bb-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 20px; }
.battle-bar .bb-title { font-weight: 700; color: #ffd36a; visibility: hidden; }
.battle-bar.asking .bb-title { visibility: visible; }
.battle-bar .bb-auto { font: inherit; font-size: 11px; padding: 1px 8px; border-radius: 999px; border: 1px solid #8a7a5a; background: transparent; color: #e8dcc0; cursor: pointer; }
.battle-bar .bb-auto.on { background: #3f8f78; border-color: #3f8f78; color: #fff; }
.battle-bar .bb-body { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 4px; }
.battle-bar .bb-body:empty { display: none; }
.battle-bar .bb-btn { font: inherit; padding: 5px 4px; border-radius: 6px; border: 1px solid #6a5a3a; background: #2a2230; color: #f3ead8; cursor: pointer; line-height: 1.2; }
.battle-bar .bb-btn small { display: block; font-size: 10px; opacity: 0.75; }
.battle-bar .bb-btn:disabled { opacity: 0.4; cursor: default; }
.battle-bar .bb-btn.attack { border-color: #c89a3a; }
.battle-bar .bb-btn.ai { border-style: dashed; }
.beam { position: absolute; height: 5px; border-radius: 3px; background: linear-gradient(90deg, #fff8d0, #ffd36a, #fff8d0); box-shadow: 0 0 8px #ffd36a; }
/* The road while travelling (src/travel-art.js): layers slide behind the hero. */
.travel { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.travel[hidden] { display: none; }
.travel-layer { position: absolute; inset: 0; background-repeat: repeat-x; image-rendering: pixelated; image-rendering: crisp-edges; }
.scene.flying .figure.fly { bottom: 40%; }
.figure.soaring { animation: soar 3.6s ease-in-out infinite; }
/* Riding the sword: a slow rise and fall in two swells, as on the title (the owner, 2026-10-26). */
@keyframes soar { 0%, 100% { translate: 0 0; } 25% { translate: 0 -7px; } 50% { translate: 0 -2px; } 75% { translate: 0 -10px; } }
/* The sword's light and a master's lines of speed (scene.js heroFx), just behind the hero. */
.hero-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; image-rendering: pixelated; }
.less-motion .figure.soaring { animation: none; }
/* Pixel icons (src/icons.js). */
.pxicon { display: inline-block; background-size: 100% 100%; background-repeat: no-repeat; image-rendering: pixelated; image-rendering: crisp-edges; }
.icon-cell .sq .pxicon { display: block; }
.idle-prop.floating { animation: zfloat 2.4s ease-in-out infinite; }
@keyframes zfloat { 0% { translate: 0 4px; opacity: 0.2; } 50% { opacity: 1; } 100% { translate: 4px -8px; opacity: 0; } }
.less-motion .idle-prop.floating { animation: none; }
.scene-ghost { pointer-events: none; }
/* A small boat under the hero (the "boat" clip). */
/* Vignettes (scene.js vignette): a small framed scene over the place, for
   what the place can't show (in the water, a sickbed). */
.vig { position: absolute; top: 6%; right: 4%; width: 42%; height: 76%; overflow: hidden; z-index: 6; border: 3px solid #2a2018; border-radius: 6px; box-shadow: 0 0 0 2px #d8c49a, 0 6px 18px rgb(0 0 0 / 0.45); }
.vig .figure, .vig .npc { position: absolute; z-index: 1; }
.vig-water { background: linear-gradient(#a9d2ee 0 34%, #6f9a5a 34% 40%, #4f86b4 40% 100%); }
.vig-water-front { position: absolute; left: 0; right: 0; bottom: 0; height: 50%; z-index: 2; background: rgb(52 112 165 / 0.82); border-top: 2px solid #d7eefa; }
.vig-wave { position: absolute; left: -20%; right: -20%; bottom: calc(50% - 1px); height: 3px; z-index: 3; background: repeating-linear-gradient(90deg, #f2fbff 0 10px, transparent 10px 22px); animation: vig-wave 1.6s linear infinite; }
@keyframes vig-wave { to { transform: translateX(22px); } }
.vig-bubble { position: absolute; bottom: 50%; width: 6px; height: 6px; z-index: 3; border: 2px solid #eaf7ff; border-radius: 50%; }
.vig-tree, .vig-wall, .vig-field { background: linear-gradient(#a9d2ee 0 62%, #79a85e 62% 100%); }
/* A chase at sea: sky, the sea's swells streaming away left, a little boat
   under the hero (the shark swims at the surface behind). */
.vig-sea { background: linear-gradient(#a9d2ee 0 44%, #3d7fb0 44% 100%); }
.vig-sea-water { position: absolute; left: 0; right: 0; top: 44%; bottom: 0; background: repeating-linear-gradient(90deg, transparent 0 22px, rgb(255 255 255 / 0.28) 22px 34px) 0 12% / 100% 4px no-repeat, repeating-linear-gradient(90deg, transparent 0 30px, rgb(255 255 255 / 0.22) 30px 40px) 0 46% / 100% 4px no-repeat, repeating-linear-gradient(90deg, transparent 0 26px, rgb(255 255 255 / 0.2) 26px 36px) 0 80% / 100% 4px no-repeat; }
.vig-running .vig-sea-water { animation: vig-sea 0.6s linear infinite; }
@keyframes vig-sea { to { background-position: -34px 12%, -40px 46%, -36px 80%; } }
.vig-sea-boat { position: absolute; left: 50%; bottom: 24%; width: 26%; height: 9%; background: #7a5432; border-bottom: 4px solid #4e3420; clip-path: polygon(0 0, 100% 0, 88% 100%, 10% 100%); z-index: 2; }
.vig-running .vig-sea-boat, .vig-sea .vig-me { animation: vig-bob 1.1s ease-in-out infinite; }
@keyframes vig-bob { 50% { translate: 0 3px; } }
/* The open sky of a chase on a flying sword: clouds stream past. */
.vig-sky { background: linear-gradient(#7fb4e0, #cfe6f6); }
/* A band of clouds: one tile of puffs repeated across, slid left by exactly
   a tile's width per loop, so it flows without a seam. */
.vig-clouds { position: absolute; left: 0; right: 0; background-repeat: repeat-x; }
.vig-clouds.far { top: 10%; height: 22%; opacity: 0.75; background-size: 160px 100%;
  background-image: radial-gradient(ellipse 30px 11px at 40px 60%, #fff 98%, transparent), radial-gradient(ellipse 22px 9px at 62px 45%, #fff 98%, transparent), radial-gradient(ellipse 26px 9px at 122px 70%, #fff 98%, transparent); }
.vig-clouds.near { top: 60%; height: 30%; background-size: 220px 100%;
  background-image: radial-gradient(ellipse 44px 16px at 60px 60%, #fff 98%, transparent), radial-gradient(ellipse 30px 13px at 92px 42%, #fff 98%, transparent), radial-gradient(ellipse 36px 13px at 170px 66%, #f4f8fb 98%, transparent); }
.vig-running .vig-clouds.far { animation: vig-clouds-far 2.4s linear infinite; }
.vig-running .vig-clouds.near { animation: vig-clouds-near 1s linear infinite; }
@keyframes vig-clouds-far { to { background-position-x: -160px; } }
@keyframes vig-clouds-near { to { background-position-x: -220px; } }
.vig-trunk { position: absolute; left: 44%; bottom: 14%; width: 12%; height: 74%; background: #6b4a2e; box-shadow: inset -4px 0 0 #4e3420; }
.vig-crown { position: absolute; left: 22%; top: 2%; width: 56%; height: 34%; background: #4f8f45; border-radius: 40% 40% 30% 30%; box-shadow: inset 0 -6px 0 #3d7337; }
.vig-wallblock { position: absolute; left: 0; bottom: 14%; width: 52%; height: 44%; background: repeating-linear-gradient(#b8ad98 0 12px, #8f846f 12px 14px); border-top: 5px solid #6a5a46; }
.vig-lane { position: absolute; left: 0; right: 0; bottom: 0; height: 16%; background: repeating-linear-gradient(90deg, #a68a5e 0 18px, #957a50 18px 30px); }
/* The hero runs to the right, so the ground streams away to the left. */
.vig-running .vig-lane { animation: vig-lane 0.4s linear infinite; }
@keyframes vig-lane { to { background-position: -30px 0; } }
/* Running for one's life: quicker steps than a walk. */
.vig-running .figure.moving, .vig-running .npc.moving { animation-duration: 180ms !important; }
/* An animal on the move (drawn in one frame): it bounds, its body pitching
   and rising in two hard steps, like legs at a gallop. */
.px.walking { animation: gallop 0.26s steps(2, jump-none) infinite; }
@keyframes gallop { from { translate: 0 0; rotate: -6deg; } to { translate: 0 -3px; rotate: 6deg; } }
.vig-room { background: linear-gradient(#4a3a2e 0 74%, #6b5240 74% 100%); }
.vig-bed { position: absolute; left: 26%; bottom: 20%; width: 58%; height: 12%; background: #7a4f30; border-top: 8px solid #e6dccb; border-radius: 3px; }
.vig-lamp { position: absolute; left: 10%; bottom: 34%; width: 8px; height: 14px; background: #ffd27a; box-shadow: 0 0 14px 6px rgb(255 200 110 / 0.45); animation: vig-flicker 0.9s ease-in-out infinite alternate; }
@keyframes vig-flicker { to { opacity: 0.6; transform: scaleY(0.85); } }
.vig-soul { position: absolute; width: 14px; height: 14px; margin-left: -7px; z-index: 3; border-radius: 50%; background: radial-gradient(#ffffff, rgb(220 240 255 / 0.2)); box-shadow: 0 0 12px 4px rgb(230 245 255 / 0.6); }
.boat { position: absolute; bottom: 15%; background: linear-gradient(#7a5232, #553620); border-radius: 0 0 40% 40%; border-top: 2px solid #9a6a42; }
/* Romance: hearts under a person's portrait. */
.face .hearts { font-size: 0.7rem; letter-spacing: 1px; color: #d8507a; line-height: 1; }
.face .hearts.crush { color: #e48aa6; }
/* The focus picker: main or secondary, and the darker roads marked. */
.focus-tabs { display: flex; gap: 6px; margin-bottom: 4px; }
/* The way-of-life cards: a faint scene of the way behind the words. */
.options button.focus-card { position: relative; isolation: isolate; overflow: hidden; }
.options button.focus-card::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: var(--scene) center 80% / cover no-repeat; image-rendering: pixelated; opacity: 0.24; }
:root[data-theme="dark"] .options button.focus-card::before { opacity: 0.16; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .options button.focus-card::before { opacity: 0.16; } }
.focus-tabs button { flex: 1; padding: 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--muted); font: inherit; }
.focus-tabs button.active { border-color: var(--ink); color: var(--ink); font-weight: 600; }
#choice-options .choice-months { display: flex; align-items: center; gap: 8px; margin: -4px 0 8px 14px; font-size: 0.9em; }
#choice-options .choice-months input { width: 5em; padding: 4px 6px; font: inherit; }
#choice-options button.second { border-style: dashed; border-color: var(--gold); }
#choice-options button.dark-path strong { color: var(--cinnabar); }

/* ---- At sea (docs/25, src/travel-art.js travelShip): the junk the hero
   stands on during a voyage, between the swells and the breakers. The
   scene rocks it and the hero together (Web Animations, paused with the
   road and under reduced motion). */
.travel-ship { position: absolute; pointer-events: none; image-rendering: pixelated; image-rendering: crisp-edges; }

/* The title screen (src/title.js): pixel art behind a menu. */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.title-screen {
  position: fixed; inset: 0; max-width: none; margin: 0; padding: 0;
  display: block; overflow: hidden; background: #1d2b4f;
}
.title-art { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; image-rendering: crisp-edges; }
.title-menu {
  position: absolute; left: 50%; bottom: 34px; transform: translateX(-50%); z-index: 2;
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; width: min(820px, calc(100% - 24px));
}
.title-menu > * { grid-column: span 2; min-width: 0; }
.title-menu button { padding: 8px 10px; font-size: 0.95rem; }
/* A portrait phone: the menu in three narrow columns under the scene. */
@media (max-width: 619px) and (orientation: portrait) {
  .title-menu { width: calc(100% - 16px); gap: 5px; bottom: 30px; }
  .title-menu > * { grid-column: span 3; }
  .title-menu > .given-input, .title-menu > #new-life, .title-menu > .gender-pick { grid-column: span 6; }
  .title-menu button { padding: 4px 6px; font-size: 0.76rem; line-height: 1.15; min-height: 40px; }
  .title-menu #new-life { font-size: 1rem; min-height: 42px; }
  .title-menu .given-input { padding: 7px 10px; }
  .title-menu .gender-pick button { min-height: 32px; }
}
/* The copyright line and the terms link under the title menu (src/legal.js, docs/72).
   It stands at the foot, the content warning above it and the menu above both. */
.title-legal {
  position: absolute; left: 12px; right: 12px; bottom: 4px; z-index: 2; margin: 0;
  text-align: center; font-size: 0.66rem; line-height: 1.3;
  color: rgb(241 233 210 / 0.75);
}
.title-legal a { color: #f1e9d2; text-decoration: underline; }
.title-screen:has(.title-legal) .warning { bottom: 20px; }
.title-screen:has(.title-legal) .title-menu { bottom: 44px; }
@media (max-width: 619px) and (orientation: portrait) {
  .title-legal { font-size: 0.6rem; }
  .title-screen:has(.title-legal) .warning { bottom: 18px; }
  .title-screen:has(.title-legal) .title-menu { bottom: 40px; }
}
@media (max-height: 520px) {
  .title-legal { font-size: 0.58rem; bottom: 2px; }
  .title-screen:has(.title-legal) .warning { bottom: 15px; }
  .title-screen:has(.title-legal) .title-menu { bottom: 30px; }
}
.title-menu button, .menu-panel button {
  font-family: var(--font-display); font-weight: 700; font-size: 1.05rem;
  padding: 10px 14px; color: #f1e9d2; background: #241a1c;
  border: 2px solid #e2d6b8; border-radius: 0;
  box-shadow: inset 0 0 0 2px #241a1c, inset 0 0 0 4px #7b6450, 0 3px 0 #0d0a0b;
  cursor: pointer;
}
.title-menu button:hover, .menu-panel button:hover, .title-menu button:focus-visible { background: #3a2a2c; }
.title-menu button:active, .menu-panel button:active { transform: translateY(2px); box-shadow: inset 0 0 0 2px #241a1c, inset 0 0 0 4px #7b6450; }
.title-menu #new-life { background: #5a2226; }
.lang-chip {
  position: absolute; top: max(12px, calc(env(safe-area-inset-top, 0px) / var(--zoom, 1) + 6px)); left: 12px; z-index: 2;
  padding: 4px 10px; font-size: 0.85rem; color: #f1e9d2;
  background: rgb(10 12 20 / 0.6); border: 1px solid rgb(241 233 210 / 0.4); border-radius: 0;
}
.donate-qr { display: block; width: min(100%, 260px); margin: 10px auto; background: #fff; border-radius: 6px; }
.sell-many { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.sell-many input { width: 4.5em; min-height: 36px; }
.lang-chip.fs-chip { left: auto; right: 12px; }
.title-screen .warning {
  position: absolute; left: 12px; right: 12px; bottom: 10px; z-index: 2;
  font-size: 0.72rem; color: rgb(241 233 210 / 0.75); border: 0; padding: 0; text-align: center;
}

/* Panels over the screen: the menus, settings, feedback. */
.menu-panel {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center;
  padding: 16px; background: rgb(5 8 12 / 0.55); overflow-y: auto; overscroll-behavior: contain;
}
.menu-panel > section {
  width: min(420px, 100%); max-height: calc(calc(var(--vh, 1vh) * 100) - 32px); overflow: auto;
  /* (Border-box: with the padding and border outside the max-height the card stood 40px taller than a phone's
     screen, its top and foot cut off and out of reach; it scrolls inside itself, and the touch stays in it.) */
  box-sizing: border-box; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y;
  display: grid; gap: 10px; padding: 18px;
  background: #1b1517; color: #f1e9d2;
  border: 2px solid #e2d6b8; box-shadow: inset 0 0 0 3px #1b1517, inset 0 0 0 5px #7b6450, 0 8px 30px rgb(0 0 0 / 0.5);
}
.menu-panel h2 { margin: 0 0 4px; font-family: var(--font-display); font-size: 1.3rem; }
.menu-panel h3 { margin: 6px 0 0; font-size: 0.95rem; color: #cbbd9c; }
.menu-panel .menu-body { display: grid; gap: 10px; }
/* The encyclopedia's button with its "?" (the FAQ) beside it. */
.menu-panel .wiki-row { display: flex; gap: 8px; }
.menu-panel .wiki-row .primary { flex: 1 1 auto; min-width: 0; }
.menu-panel .wiki-row .wiki-faq { flex: none; width: 48px; padding: 0; font-size: 1.3rem; }
.menu-panel.sure-stack { z-index: 80; }
.menu-panel .sure-text { margin: 0; white-space: pre-line; }
.menu-panel .row { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.menu-panel label.row { justify-content: flex-start; }
/* Settings' text size: the four sizes in one row, equal buttons (src/text-size.js). */
.text-size-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.text-size-pick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; flex: 1 1 15em; min-width: 0; }
.text-size-pick > button { min-width: 0; min-height: 44px; padding: 4px 2px; line-height: 1.1; }
.menu-panel input[type="range"] { flex: 1; }
.menu-panel textarea, .menu-panel .seed-input, .menu-panel input[type="number"] {
  width: 100%; padding: 10px; font: inherit; color: #f1e9d2; background: #0f0c0d;
  border: 1px solid #7b6450; border-radius: 0; resize: vertical;
}
.menu-panel .muted { margin: 0; font-size: 0.9rem; color: #cbbd9c; }
.menu-panel .kinds button { flex: 1; font-size: 0.95rem; }
.menu-panel .kinds button.active, .menu-panel button.primary { background: #5a2226; }
.menu-panel .save-card { display: grid; gap: 2px; padding: 10px; border: 1px dashed #7b6450; }
.menu-panel .menu-close { background: transparent; box-shadow: none; border-color: #7b6450; font-size: 0.95rem; }
.menu-btn { min-width: 40px; padding: 6px; }

/* Names over heads in the scene. */
.name-tags { position: absolute; inset: 0; pointer-events: none; z-index: 35; overflow: hidden; }
.name-tag {
  position: absolute; left: 0; top: 0; white-space: nowrap;
  padding: 0 5px; font-size: 0.72rem; line-height: 1.5; color: #f4efe2;
  background: rgb(16 18 24 / 0.55); border-radius: 3px;
}
.name-tag.hero { color: #bff0dc; z-index: 1; }
.scene.landing .name-tag.hero { visibility: hidden; }
/* Words said aloud in the scene (src/scene.js bubble): a speech bubble
   whose tail points down at the speaker (--tail: its x in the bubble). */
.speech {
  position: absolute; left: 0; top: 0; z-index: 2; max-width: min(62%, 260px);
  padding: 3px 8px; font-size: 0.8rem; line-height: 1.35; color: #241c16;
  background: #fbf6e8; border: 2px solid #2a1f1d; border-radius: 6px;
  box-shadow: 0 2px 0 rgb(0 0 0 / 0.25); overflow-wrap: anywhere;
  animation: speech-in 0.18s ease-out;
}
.speech::after {
  content: ""; position: absolute; top: 100%; left: calc(var(--tail, 50%) - 5px);
  border: 5px solid transparent; border-top: 6px solid #2a1f1d;
}
.speech.hero { background: #eefaf3; }
/* A voice from someone not drawn: from the side of the scene, no tail. */
.fx-layer .speaker-off { position: absolute; right: 12%; bottom: 18%; width: 1px; }
.speech.off { font-style: italic; }
.speech.letter { background: #f6ecd0; font-style: italic; border-color: #8a6a3a; }
.speech.off::after { display: none; }
@keyframes speech-in { from { opacity: 0; scale: 0.85; } }

/* The World tab (docs/27): who is online, the chat, lives to watch. */
.world { display: grid; gap: 8px; padding-block: 8px; }
.world h3 { margin: 6px 0 0; font-family: var(--font-display); font-size: 1rem; }
.world .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.world-stats { margin: 0; color: var(--muted); }
.chat-list { height: 220px; overflow-y: auto; padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); display: grid; align-content: start; gap: 4px; }
.chat-line { line-height: 1.4; overflow-wrap: anywhere; }
.chat-line small { color: var(--muted); }
.chat-line.mine b { color: var(--jade); }
.chat-form { display: flex; gap: 6px; }
.chat-form input { flex: 1; min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); }
.lives-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.lives-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); }
.tabs button.unread::after { content: " •"; color: var(--cinnabar); }
.muted { color: var(--muted); }
.watch-view { display: grid; gap: 10px; }
.watch-head { display: flex; gap: 12px; align-items: center; }
.watch-face { width: 64px; height: 64px; image-rendering: pixelated; border: 1px solid #7b6450; }
.watch-lines { margin: 0; padding-left: 18px; display: grid; gap: 6px; max-height: calc(var(--vh, 1vh) * 55); overflow-y: auto; }
.watch-tabs { margin: 10px 0 8px; }
.online-chip {
  position: absolute; left: 12px; top: 44px; z-index: 2;
  padding: 3px 8px; font-size: 0.8rem; color: #f1e9d2; background: rgb(10 12 20 / 0.6);
}
.bug-btn {
  position: absolute; right: 8px; bottom: 8px; z-index: 3;
  padding: 2px 6px; font-size: 1rem; line-height: 1.4;
  background: rgb(16 18 24 / 0.5); border: 1px solid rgb(255 255 255 / 0.3); border-radius: 4px;
}
/* World chat drifting over the scene (ui.js floatChat). */
.chat-float-btn {
  position: absolute; right: 48px; bottom: 8px; z-index: 3;
  padding: 2px 6px; font-size: 1rem; line-height: 1.4;
  background: rgb(16 18 24 / 0.5); border: 1px solid rgb(255 255 255 / 0.3); border-radius: 4px;
}
.chat-float-btn.off { opacity: 0.45; filter: grayscale(1); }
.chat-float { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.float-line {
  position: absolute; left: 0; white-space: nowrap; max-width: none;
  padding: 1px 8px; border-radius: 10px; font-size: 0.85rem; line-height: 1.5;
  color: #f4ecd8; background: rgb(16 18 24 / 0.55); text-shadow: 0 1px 2px #000;
  will-change: transform;
}
.float-line b { color: #e8d9a8; font-weight: 600; }
.float-line.friend b { color: var(--gold); }
.float-line.mine b { color: #9fe0c0; }
.google-btn { min-height: 44px; display: flex; justify-content: center; }
.menu-panel p.or { text-align: center; margin: 2px 0; }

/* The guide for a first life: a card over a dimmed screen, pointing at one
   part of it, which glows above the dimming. */
.tut { position: fixed; inset: 0; z-index: 70; background: rgb(5 8 12 / 0.55); display: flex; justify-content: center; padding: 16px; pointer-events: auto; }
.tut-card {
  position: absolute; left: 50%; transform: translateX(-50%); width: min(420px, calc(100% - 32px));
  display: grid; gap: 8px; padding: 16px 18px; max-height: calc(100% - 32px); overflow-y: auto;
  background: #1b1517; color: #f1e9d2; border: 2px solid #e2d6b8;
  box-shadow: inset 0 0 0 3px #1b1517, inset 0 0 0 5px #7b6450, 0 8px 30px rgb(0 0 0 / 0.5);
  top: 50%; translate: 0 -50%;
}
.tut-card.below { top: auto; bottom: 16px; translate: none; }
.tut-card.above { top: 16px; translate: none; }
.tut-card h2 { margin: 0; font-family: var(--font-display); font-size: 1.2rem; }
.tut-card p { margin: 0; line-height: 1.55; }
.tut-card h3 { margin: 6px 0 0; font-family: var(--font-display); font-size: 1rem; color: #e0b85a; }
.tut-count { color: #cbbd9c; font-variant-numeric: tabular-nums; }
.tut-nav { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.tut-nav .link { margin-right: auto; color: #cbbd9c; }
/* A long card scrolls inside itself; its buttons stay in view at the bottom (same place when it fits). */
.tut-card .tut-nav { position: sticky; bottom: -16px; margin-bottom: -16px; padding-bottom: 16px; background: #1b1517; }
.tut-lift { position: relative; }
.tut-focus { z-index: 71; box-shadow: 0 0 0 3px #e0b85a, 0 0 18px 4px rgb(224 184 90 / 0.6); border-radius: 6px; }
/* System guides (src/guides.js): the same card, with a spot drawn over the part
   (it may sit inside an overlay, where a raised z-index would not reach). */
.tut.guide { background: transparent; }
.tut.guide.dim { background: rgb(5 8 12 / 0.55); }
.guide-spot { position: fixed; border-radius: 8px; pointer-events: none; box-shadow: 0 0 0 3px #e0b85a, 0 0 18px 4px rgb(224 184 90 / 0.6), 0 0 0 100vmax rgb(5 8 12 / 0.55); transition: left 0.15s, top 0.15s, width 0.15s, height 0.15s; }
.guide-spot[hidden] { display: none; }
/* A panel's "?": its tip again (src/guides.js tipQ). */
.tip-q { display: inline-flex; align-items: center; justify-content: center; width: 1.5em; height: 1.5em; min-width: 0; min-height: 0; margin: 0 0 0 6px; padding: 0; border-radius: 50%; font: 600 0.75rem/1 var(--font-body, inherit); vertical-align: middle; flex: none; opacity: 0.75; }
.tip-q:hover, .tip-q:focus-visible { opacity: 1; }
.hall-tip { margin: 0; text-align: end; }
/* (On touch the "?" stays small to the eye but takes a finger: an unseen 44px ring around it.) */
@media (pointer: coarse) { .tip-q { width: 1.9em; height: 1.9em; position: relative; } .tip-q::after { content: ""; position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; translate: -50% -50%; } }

/* The pixel fire (src/scene.js pixelFire): its canvas, sparks, smoke and glow. */
.fx-fire { position: absolute; image-rendering: pixelated; image-rendering: crisp-edges; pointer-events: none; }
.fx-glow { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen; }
.fx-ember { position: absolute; background: #ffd27a; box-shadow: 0 0 3px #ff8a2a; pointer-events: none; }
.fx-smoke { position: absolute; background: rgb(70 62 58 / 0.55); pointer-events: none; }
/* The war's clips (scene.js siegeAssault): an arrow in flight, a shaft with its head and a flight of feathers. */
.war-arrow { position: absolute; width: 14px; height: 2px; background: #6a4a2e; box-shadow: 14px 0 0 #c8c8d0, -2px -1px 0 #e8e0c8, -2px 1px 0 #e8e0c8; pointer-events: none; }

/* Other players passing far off (src/scene.js passBy): smaller and paler
   with distance; mortals walk, cultivators glide on a sword. */
.passers { position: absolute; inset: 0; pointer-events: none; transition: opacity 0.7s, filter 0.7s; }
.passers.faded { opacity: 0; filter: blur(3px); }
.passers .npc.passer { position: absolute; transform-origin: 50% 100%; filter: saturate(0.85) brightness(0.95); }
.name-tag.passer { color: #ffe7a8; background: rgb(40 30 10 / 0.55); }

/* Friends and search in the World tab. */
.lives-search { width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); }
.lives-list .row-actions { display: flex; gap: 6px; flex-shrink: 0; }
.lives-list .row-actions button { min-height: 36px; padding: 4px 10px; }
.lives-list li.friend > span:first-child, .chat-line.friend .chat-name { color: var(--gold); }
.chat-name { all: unset; cursor: pointer; font-weight: 700; }
.chat-name:hover, .chat-name:focus-visible { text-decoration: underline; }
.chat-actions { display: flex; gap: 6px; margin: 4px 0 2px; }
.chat-actions button { min-height: 32px; padding: 2px 10px; font-size: 0.85rem; }
.chat-time { color: var(--muted); font-size: 0.75rem; font-variant-numeric: tabular-nums; }

/* The rankings (World tab), one at a time under their tabs. */
.hall { display: grid; gap: 8px; margin-top: 8px; }
.hall-list h3 { margin: 0; font-family: var(--font-display); }
.hall-list p { margin: 2px 0 6px; font-size: 0.8rem; }
.hall-list ol { margin: 0; padding-left: 2.6em; display: grid; gap: 4px; font-size: 0.9rem; }
.hall-list li.mine b { color: var(--jade); }
.hall-list li.friend b { color: var(--gold); }
.hall-list li.hall-gap { margin-top: 10px; }
/* The week's rankings (src/weekly-hall.js): the countdown and last week's podium, across the top. */
.hall-week { grid-column: 1 / -1; display: grid; gap: 4px; }
.hall-week p { margin: 0; font-size: 0.85rem; }
.hall-countdown { font-weight: 700; color: var(--gold, #8f6a12); }
.hall-podium { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 6px 12px; padding: 6px 8px; border: 1px solid rgb(201 162 39 / 0.45); border-radius: 6px; }
.hall-podium h3 { grid-column: 1 / -1; margin: 0; font-family: var(--font-display); font-size: 1rem; }
.hall-podium ol { margin: 2px 0 0; padding-left: 20px; display: grid; gap: 2px; font-size: 0.85rem; }
.hall-podium li.mine b { color: var(--jade); }
.life-title-chip.lt-week { background: linear-gradient(90deg, #b8860b, #e0b84a); color: #241a06; }
.who-line .hero-title.week-title { color: var(--gold); border-style: double; border-width: 3px; }

/* The Martial World Tournament (World tab) and notices over the scene. */
.tourney { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.tourney h3 { margin: 0; font-family: var(--font-display); }
.tourney-when, .tourney-in { margin: 0; font-variant-numeric: tabular-nums; }
.tourney-in { color: var(--jade); font-weight: 600; }
.bracket h4 { margin: 6px 0 4px; }
.bracket-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; align-items: center; }
.bracket-col { display: grid; gap: 6px; }
.match { display: grid; gap: 1px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 4px; font-size: 0.78rem; }
.match span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match .won { font-weight: 700; }
.match .lost { color: var(--muted); text-decoration: line-through; }
.match .player { color: var(--gold); }
.match .me { color: var(--jade); }
.bracket .champ { margin: 4px 0 0; font-weight: 700; }
.notice {
  position: absolute; z-index: 5; left: 50%; top: 10px; transform: translateX(-50%); max-width: calc(100% - 24px);
  display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 6px;
  background: rgb(20 16 18 / 0.88); color: #f1e9d2; border: 1px solid #e0b85a; font-size: 0.9rem;
}
.notice button { min-height: 32px; padding: 2px 10px; }
.notice .link { color: #cbbd9c; }
/* The Mount Hua summit's titles: a chip before the name, one colour each, none gold like the admin's. */
.title-badge { display: inline-block; margin-right: 4px; padding: 0 5px; border-radius: 3px; font-size: 0.72rem; font-weight: 700; line-height: 1.35; color: #fff; background: #555; white-space: nowrap; vertical-align: baseline; }
.title-center { background: #9a1f7c; }
.title-east { background: #b3301b; }
.title-west { background: #20733a; }
.title-south { background: #1a5fb8; }
.title-north { background: #5b3fb0; }
/* The five summit titles of Mount Hua shine (2026-10-25): a light sweeps
   across the band now and then, and a soft gold glow sits around it. */
.title-badge { position: relative; overflow: hidden; box-shadow: 0 0 0 1px rgb(255 226 140 / 0.7), 0 0 6px rgb(255 210 110 / 0.55); }
.title-badge::after { content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 45%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgb(255 255 255 / 0.75), transparent); transform: skewX(-20deg); animation: title-shine 3.2s ease-in-out infinite; }
@keyframes title-shine { 0%, 55% { left: -60%; } 85%, 100% { left: 130%; } }
.less-motion .title-badge::after { animation: none; display: none; }
:root[data-theme="dark"] .title-center { background: #d65cb8; color: #1b1020; }
:root[data-theme="dark"] .title-east { background: #ff7a5f; color: #2a0e08; }
:root[data-theme="dark"] .title-west { background: #5fd078; color: #08200f; }
:root[data-theme="dark"] .title-south { background: #6fb0ff; color: #08182e; }
:root[data-theme="dark"] .title-north { background: #a894ff; color: #150e30; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .title-center { background: #d65cb8; color: #1b1020; }
  :root:not([data-theme="light"]) .title-east { background: #ff7a5f; color: #2a0e08; }
  :root:not([data-theme="light"]) .title-west { background: #5fd078; color: #08200f; }
  :root:not([data-theme="light"]) .title-south { background: #6fb0ff; color: #08182e; }
  :root:not([data-theme="light"]) .title-north { background: #a894ff; color: #150e30; }
}
.admin-badge { margin-right: 4px; padding: 0 4px; border-radius: 3px; font-size: 0.72rem; color: #1b1517; background: #e0b85a; font-weight: 700; }
.admin-badge.mod-badge { background: #8ec5a4; }
.admin-badge.ai-badge { background: #9db7e6; }
.mod-mins { font: inherit; font-size: 0.8rem; }
.ai-list { display: flex; flex-direction: column; gap: 6px; }
.ai-line { max-width: 88%; padding: 6px 10px; border-radius: 10px; white-space: pre-wrap; word-break: break-word; }
.ai-line.ai-me { align-self: flex-end; background: var(--accent-soft, rgba(224, 184, 90, 0.18)); }
.ai-line.ai-ai { align-self: flex-start; background: rgba(157, 183, 230, 0.16); }
.ai-line.ai-note { align-self: center; font-size: 0.85rem; opacity: 0.8; }

/* The World tab's own tabs and its private chat. */
.world-tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.world-tabs button { flex: 0 0 auto; min-height: 38px; padding: 6px 10px; border: 0; border-radius: 6px 6px 0 0; background: none; color: var(--muted); white-space: nowrap; font-size: 0.85rem; }
.world-tabs button.active { color: var(--ink); font-weight: 700; background: color-mix(in srgb, var(--jade) 14%, transparent); box-shadow: inset 0 -4px 0 var(--jade); }
.world-tabs button { box-shadow: none; }
.world-tabs button:hover { color: var(--ink); background: color-mix(in srgb, var(--jade) 9%, transparent); }
.world-tabs button:active { transform: none; }
.world-tabs button:focus-visible { outline-offset: -3px; }
.world-tabs button.unread::after { content: " •"; color: var(--cinnabar); }
/* The World tab fills the panel: its tabs on top, the open one below
   taking the rest, a chat's messages scrolling while its box stays put. */
.panel:has(> .world:not([hidden])) { display: flex; flex-direction: column; overflow: hidden; padding-bottom: 6px; }
.world { display: flex; flex-direction: column; flex: 1; min-height: 0; padding-block: 0; }
.world .world-stats { margin: 0; font-size: 0.85rem; }
.world-panel { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 8px; }
.world-panel > .chat-list, .dm, .dm-thread { flex: 1 1 auto; min-height: 60px; height: auto; }
.dm { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.world-panel > * { flex-shrink: 0; }
.world-panel > .chat-list, .world-panel > .dm { flex-shrink: 1; }
.dm-open { all: unset; cursor: pointer; display: grid; gap: 2px; width: 100%; }
.dm-thread .chat-line.mine { text-align: right; color: var(--jade); }
.dm-list li { padding: 8px 0; }
.world-panel p { margin: 0; }
.world-panel > p:empty { display: none; }

/* Companions panel (People tab). */
.companions { margin: 4px 0 10px; padding: 8px; border: 1px solid var(--line, rgb(0 0 0 / 0.15)); border-radius: 6px; }
.companions h3 { margin: 0; }
.companions > p { margin: 2px 0 6px; font-size: 0.8rem; }
.comp-row { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.comp-row .face { flex: 0 0 auto; width: 96px; }
.comp-row.following .face { outline: 2px solid var(--gold); outline-offset: 2px; }
.comp-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0; }
.comp-tag { color: var(--gold); font-weight: 600; font-size: 0.9rem; }

/* The tournament show (ui.js): a line along the bottom of the scene. */
.show-bar {
  position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 4;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px 10px; border-radius: 6px; font-size: 0.9rem;
  color: #f4ecd8; background: rgb(16 18 24 / 0.72); border: 1px solid rgb(232 200 120 / 0.5);
}
.show-bar button { min-height: 32px; padding: 2px 10px; flex-shrink: 0; }
/* The world arena's stage (arena-stage.js): the crowd, the two fighters
   left and right, and the tabs to watch another court. The hero's own
   figure steps aside while it is up. */
.scene.arena-on .figure, .scene.arena-on .idle-npc, .scene.arena-on .idle-prop, .scene.arena-on .extras, .scene.arena-on .name-tag.hero { visibility: hidden; }
.arena-stage { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.arena-crowd { position: absolute; left: 0; top: 0; image-rendering: pixelated; image-rendering: crisp-edges; pointer-events: none; }
.arena-crowd.front { z-index: 2; }
.arena-folk, .arena-hud { position: absolute; inset: 0; pointer-events: none; }
.arena-stage .fx-layer { z-index: 1; }
.arena-hud { z-index: 1; }
.arena-fig { position: absolute; background-repeat: no-repeat; image-rendering: pixelated; image-rendering: crisp-edges; }
.arena-fig.idle { animation: arena-breath 0.9s steps(2) infinite; }
.arena-fig.glow { filter: drop-shadow(0 0 3px #ffd36a) drop-shadow(0 0 8px #f2b640); }
@keyframes arena-breath { 50% { translate: 0 -2px; } }
.arena-hud .hpbar { width: 56px; }
.arena-hud .hpbar.l i { background: #3f8fd8; }
.arena-name { position: absolute; transform: translateX(-50%); white-space: nowrap; max-width: 46%; overflow: hidden; text-overflow: ellipsis; padding: 0 6px; border-radius: 8px; font-size: 11px; line-height: 16px; color: #f4ecd8; background: rgb(16 18 24 / 0.7); }
.arena-name.me { color: #ffd36a; }
.arena-tabs { position: absolute; left: 6px; right: 6px; top: 44px; z-index: 3; display: flex; flex-direction: column; gap: 3px; pointer-events: none; }
.arena-row { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; pointer-events: auto; }
.arena-row::-webkit-scrollbar { display: none; }
.arena-row button { flex: 1 0 auto; min-height: 0; padding: 2px 8px; border-radius: 6px; font-size: 11px; line-height: 15px; color: #f4ecd8; background: rgb(16 18 24 / 0.68); border: 1px solid rgb(232 200 120 / 0.35); box-shadow: none; white-space: nowrap; }
.arena-row button.on { background: rgb(120 84 20 / 0.92); border-color: #ffd36a; color: #fff; }
.arena-row button.mine:not(.on) { border-color: #ffd36a; }
.arena-row .court { display: flex; flex-direction: column; align-items: stretch; text-align: left; flex: 1 1 0; min-width: 78px; padding: 2px 6px; }
.arena-row .court span { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.arena-row .court span + span { opacity: 0.85; }
.arena-row .court span + span::before { content: "× "; opacity: 0.6; }
.scene.arena-on #doing { display: none; }
.scene.arena-on.arena-small .show-bar { font-size: 0.78rem; padding: 3px 8px; bottom: 4px; line-height: 1.25; }
.scene.arena-on.arena-small .show-bar button { min-height: 26px; padding: 1px 8px; }
.arena-stage.compact .court { flex: 0 0 auto; flex-direction: row; align-items: center; gap: 3px; min-width: 0; }
.arena-stage.compact .court span { max-width: 6.5em; }
.arena-row button.cycle { background: rgb(120 84 20 / 0.85); border-color: #ffd36a; }
.less-motion .arena-fig.idle { animation: none; }
.speed.locked button { opacity: 0.6; border-style: dashed; box-shadow: none; }

/* Born a boy, a girl, or at random (title menu). */
.gender-pick { display: flex; gap: 4px; justify-content: center; }
.gender-pick button { flex: 1; min-height: 34px; padding: 2px 6px; font-size: 0.85rem; opacity: 0.7; white-space: nowrap; }
.title-menu .gender-pick button { padding: 2px 4px; font-size: 0.8rem; }
.gender-pick button.active { opacity: 1; outline: 2px solid var(--gold); outline-offset: -2px; }

/* An item or technique shown off in the chat. */
.show-chip { min-height: 0; padding: 0 6px; margin-left: 4px; font-size: 0.85rem; font-weight: 600; background: transparent; border: 1px solid; border-radius: 4px; }
.float-show { font-weight: 600; }

/* Way of the Dao / Way of Craft chooser (Character tab). */
.dao-btn { min-height: 30px; padding: 2px 10px; }
.dao-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px; margin: 8px 0 12px; }
.dao-grid button.active { outline: 2px solid var(--gold); outline-offset: -2px; font-weight: 600; }

/* Encyclopedia (menu): three rows of tabs, each lighter than the one above,
   scrolling sideways rather than wrapping; a plain list below. */
.menu-body.codex { display: flex; flex-direction: column; gap: 6px; min-height: 0; min-width: 0; overflow-x: hidden; }
.menu-body.codex > * { min-width: 0; max-width: 100%; }
/* All six pages always in sight: they wrap onto a second line if need be. */
.cx-tabs { display: flex; flex-wrap: wrap; gap: 5px; padding-bottom: 2px; }
.cx-tabs::-webkit-scrollbar { display: none; }
.cx-tabs button { flex: 0 0 auto; min-height: 30px; padding: 2px 10px; font-size: 0.8rem; border-radius: 16px; white-space: nowrap; }
.cx-tabs button.active { background: var(--gold); color: var(--on-gold, #1d1a16); border-color: var(--gold); font-weight: 600; }
/* Categories down the left; the list beside them. */
.cx-main { display: flex; gap: 8px; min-height: 0; }
.cx-side { flex: 0 0 auto; width: 30%; max-width: 150px; max-height: calc(var(--vh, 1vh) * 60); overflow-y: auto; }
.cx-side[hidden] { display: none; }
.cx-sub, .cx-sub2 { display: flex; flex-direction: column; gap: 3px; }
.cx-sub button, .cx-sub2 button { text-align: left; min-height: 30px; padding: 3px 8px; font-size: 0.8rem; border-radius: 6px; background: transparent; border: 1px solid transparent; white-space: normal; line-height: 1.2; }
.cx-sub button.active { background: var(--gold); color: #1d1a16; font-weight: 600; }
.cx-sub2 { margin: 2px 0 6px 10px; padding-left: 6px; border-left: 2px solid rgb(232 200 120 / 0.4); }
.cx-sub2 button { min-height: 26px; font-size: 0.75rem; opacity: 0.85; }
.cx-sub2 button.active { background: rgb(232 200 120 / 0.22); color: inherit; opacity: 1; font-weight: 600; }
.cx-list { flex: 1; min-width: 0; max-height: calc(var(--vh, 1vh) * 60); overflow-y: auto; display: grid; gap: 2px; align-content: start; }
.cx-list h3 { margin: 8px 0 0; }
.cx-entry { padding: 6px 4px; display: flex; gap: 10px; align-items: center; border-bottom: 1px solid rgb(128 128 128 / 0.15); }
.cx-entry p { margin: 2px 0 0; font-size: 0.8rem; opacity: 0.85; }
.cx-words { display: grid; gap: 1px; min-width: 0; }
.cx-words small { font-size: 0.75rem; }
.cx-pic { flex: 0 0 44px; width: 44px; height: 44px; display: grid; place-items: center; border: 2px solid rgb(128 128 128 / 0.35); border-radius: 8px; background: rgb(0 0 0 / 0.15); overflow: hidden; }
.cx-pic img { width: 40px; height: 40px; image-rendering: pixelated; object-fit: contain; }
/* Achievements (encyclopedia): each line, town or sect, how much of it has been met. */
.achieve h3 { margin: 12px 0 4px; font-size: 0.95rem; }
.ach-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; align-items: baseline; padding: 5px 4px; border-bottom: 1px solid rgb(128 128 128 / 0.15); }
.ach-row strong { font-size: 0.85rem; }
.ach-row small { font-size: 0.75rem; white-space: nowrap; }
.ach-bar { grid-column: 1 / -1; grid-row: 2; height: 6px; border-radius: 3px; background: rgb(128 128 128 / 0.2); overflow: hidden; }
.ach-bar span { display: block; height: 100%; background: var(--jade); }
.ach-row.done .ach-bar span { background: var(--gold); }

/* The sect's treasury (Skills tab). */
.treasury { margin: 14px 0 12px; padding: 8px; border: 1px solid rgb(232 200 120 / 0.4); border-radius: 6px; box-sizing: border-box; max-width: 100%; min-width: 0; overflow: hidden; }
.treasury .cx-tabs.sub { margin: 6px 0 4px; padding-left: 8px; border-left: 2px solid rgb(232 200 120 / 0.4); }
.treasury .cx-tabs.sub button { min-height: 26px; font-size: 0.75rem; padding: 1px 8px; }
.treasury h3 { margin: 0; }
/* The master's panel: its sub tabs (overview, buildings, other sects, key disciples). */
.sect-rule .rule-tabs { margin: 6px 0 8px; padding-left: 8px; border-left: 2px solid rgb(232 200 120 / 0.4); }
.sect-rule .rule-tabs button { min-height: 28px; font-size: 0.78rem; padding: 1px 9px; flex: 1 1 auto; max-width: 100%; }
.sect-rule { min-width: 0; max-width: 100%; box-sizing: border-box; }
.treasury > p { margin: 2px 0 6px; font-size: 0.8rem; }
.treasury-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.trial-ways { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.trial-ways button { font-size: 0.8rem; }
.treasury-row .icon-cell { flex: 0 0 auto; }
.treasury-words { display: grid; flex: 1; min-width: 0; }
.treasury-row.locked .treasury-words { opacity: 0.6; }
/* The heir named to the master's seat (the Rule page): marked by a gold edge, the theme's own. */
.treasury-row.heir-named { border-left: 3px solid var(--gold); padding-left: 8px; background: color-mix(in srgb, var(--gold) 8%, transparent); border-radius: 4px; }
.treasury-row > button { flex-shrink: 0; min-height: 32px; padding: 2px 10px; }
/* The other sects (the master's Other sects page): words above, buttons wrapping below. */
.treasury-row.rel-row { flex-wrap: wrap; align-items: flex-start; border-bottom: 1px solid rgba(127,127,127,0.18); padding: 8px 0; }
.rel-row .treasury-words { flex: 1 1 100%; }
.rel-acts { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.rel-acts > button { flex: 1 1 auto; min-height: 32px; padding: 2px 10px; }
/* The master's accounts (Sect › Rule): the year's line on every page, the
   money page's income and costs, label left, figure right; a phone's width too. */
.sect-rule .acct-line { margin: 4px 0 6px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; }
.sect-rule .acct-line p { margin: 2px 0; font-size: 0.82rem; overflow-wrap: anywhere; }
.sect-rule .good { color: #2f7d4f; }
.sect-rule .bad { color: #b0443a; }
:root[data-theme="dark"] .sect-rule .good { color: #7fd09a; }
:root[data-theme="dark"] .sect-rule .bad { color: #f08a7f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sect-rule .good { color: #7fd09a; } :root:not([data-theme="light"]) .sect-rule .bad { color: #f08a7f; } }
.acct-trend { display: inline-flex; align-items: flex-end; gap: 2px; height: 18px; vertical-align: middle; }
.acct-trend i { display: block; width: 5px; background: rgb(232 200 120 / 0.85); border-radius: 1px; }
.acct-trend i.neg { background: #b0443a; }
.acct-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 3px 0; border-bottom: 1px dashed rgba(127,127,127,0.18); font-size: 0.85rem; }
.acct-row > span { min-width: 0; overflow-wrap: anywhere; }
.acct-row > b { flex-shrink: 0; white-space: nowrap; }
.acct-row.acct-net { border-bottom: 0; border-top: 1px solid var(--line); margin-top: 2px; font-size: 0.92rem; }
.acct-next { margin: 2px 0 8px; padding-left: 18px; font-size: 0.82rem; }
.acct-next li { margin: 2px 0; }
.sect-rule h4 { margin: 12px 0 4px; }
/* A key disciple (Rule › Disciples): the name and words, then the duty's list and the dismissal on the line under
   them, the list shrinking to the card's width (its longest choice is wider than a phone: report 5556). */
.treasury-row.rule-key-row { flex-wrap: wrap; border-bottom: 1px solid rgba(127,127,127,0.18); padding: 6px 0 8px; }
.rule-key-row > .treasury-words { flex: 1 1 100%; }
.rule-key-row > select.rule-duty { flex: 1 1 0; min-width: 0; width: 0; min-height: 32px; padding: 2px 6px; border: 1px solid #7b6450; border-radius: 6px; background: #2a2224; color: #f1e9d2; font: inherit; font-size: 0.85rem; text-overflow: ellipsis; }
.sect-rule .treasury-row.rel-row .treasury-words small { overflow-wrap: anywhere; }

/* Alchemy and Forge panel (Bag tab, src/craft-ui.js). */
.craft { margin: 0; padding: 8px; border: 1px solid rgb(232 150 80 / 0.45); border-radius: 6px; box-sizing: border-box; max-width: 100%; min-width: 0; overflow: hidden; }
.craft h3 { margin: 0 0 4px; }
.craft p { margin: 4px 0; }
.craft-sum { display: grid; gap: 1px; margin: 4px 0 6px; }
.craft-row { display: grid; grid-template-columns: 44px 1fr auto; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); }
.craft-row .sq { display: grid; place-items: center; width: 40px; height: 40px; border: 3px solid var(--line); border-radius: 8px; background: var(--surface); }
.craft-row.locked .craft-words > strong { opacity: 0.75; }
.craft-words { display: grid; gap: 1px; min-width: 0; }
.craft-needs { display: flex; flex-wrap: wrap; gap: 2px 8px; }
.craft-needs .have { color: var(--ink); }
.craft-needs .miss { color: #d8443a; }
.craft-why { color: var(--muted); font-style: italic; }
.craft-row > button { min-height: 34px; padding: 2px 10px; white-space: nowrap; }
/* Wear of a hammer or a furnace (src/craft-ui.js toolDurEl). */
.dur { display: grid; gap: 3px; margin: 4px 0 6px; min-width: 0; }
.dur-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dur-badge { font-size: 0.75em; padding: 0 6px; border-radius: 8px; background: #d8443a; color: #fff; }
.dur-badge.low { background: #c98a1a; }
.dur-bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.dur-bar i { display: block; height: 100%; background: #5a9a4a; }
.dur-bar.low i { background: #c98a1a; }
.dur-bar.broken { background: rgb(216 68 58 / 0.55); }
.dur-bar.broken i { background: #d8443a; }
.dur-fix button { min-height: 34px; max-width: 100%; padding: 2px 10px; white-space: normal; }
.icon-cell .dur.compact { margin: 2px 0 0; }
.icon-cell .dur.compact .dur-bar { height: 4px; }

/* Save slots (title menu). */
.slot-card { display: grid; gap: 4px; }
.slot-card.current { outline: 2px solid var(--gold); outline-offset: -2px; }
.slot-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.slot-acts button { min-height: 34px; }

/* The encyclopedia's tabs are plain chips, not the menu's framed buttons. */
.menu-panel .cx-tabs button, .menu-panel .cx-side button { box-shadow: none; border: 1px solid rgb(232 200 120 / 0.35); background: transparent; }
.menu-panel .cx-side button { border-color: transparent; }
.menu-panel .cx-tabs button.active, .menu-panel .cx-sub > button.active { background: var(--gold); color: #1d1a16; border-color: var(--gold); }
.menu-panel .cx-sub2 button.active { background: rgb(232 200 120 / 0.22); color: inherit; border-color: transparent; }
.menu-panel .cx-tabs button:active, .menu-panel .cx-side button:active { transform: none; box-shadow: none; }
.menu-panel .cx-side button:hover, .menu-panel .cx-tabs button:hover { background: rgb(232 200 120 / 0.12); }

/* A watched life's gear and arts. */
.watch-gear h4 { margin: 8px 0 4px; font-size: 0.85rem; }
.watch-gear .icon-cell .name { font-size: 0.7rem; }

/* A thing's card shows above menus too (a watched life's gear). */
#picker { z-index: 70; }

/* The World Dungeon: a room's band, what this turn brings, the choices. */
.dungeon-box > button { justify-self: start; }
.dungeon-rooms { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.dungeon-rooms button { min-height: 30px; padding: 2px 10px; }
.dungeon-rooms button.chosen, .delve-tile .options button.chosen { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 22%, transparent); }
.delve { z-index: 30; }
.delve-card { width: min(560px, 100%); max-height: 100%; overflow-y: auto; display: grid; gap: 10px; }
.delve-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.delve-head h2 { margin: 0; color: var(--jade); font-size: 1.15rem; }
.delve-timer { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; }
.delve-team { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 10px; }
.delve-team li { display: grid; gap: 2px; font-size: 0.8rem; min-width: 0; }
.delve-team li b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.delve-team li.me b { color: var(--gold); }
.delve-team li.ally b { color: var(--jade); }
.delve-team li.fell, .delve-team li.out { opacity: 0.5; }
.hpbar-mini { display: block; height: 4px; background: rgb(0 0 0 / 0.25); border-radius: 2px; overflow: hidden; }
.hpbar-mini i { display: block; height: 100%; background: var(--jade); }
.delve-tile { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
.delve-tile h3 { margin: 0; }
.delve-tile p { margin: 0; }
.delve-tile .options { display: grid; gap: 6px; }
.delve-weak { color: var(--cinnabar); }
.delve-end { font-weight: 600; margin: 0; }
.delve-log { margin: 0; padding-left: 18px; display: grid; gap: 3px; font-size: 0.8rem; max-height: calc(var(--vh, 1vh) * 28); overflow-y: auto; }

/* The encyclopedia's two worlds, above its tabs. */
.cx-worlds { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 6px; }
.cx-worlds button { min-height: 34px; font-size: 0.85rem; }
.cx-worlds button.active { background: var(--jade); color: #fff; border-color: var(--jade); font-weight: 600; }
.menu-panel .cx-worlds button { padding: 4px 8px; min-height: 36px; box-shadow: none; }

/* Talents on the character page: each with what it does. */
.talent-list { display: grid; gap: 4px; }
.talent { display: grid; line-height: 1.3; }
.talent.good b { color: var(--jade); }
.talent.bad b { color: var(--danger, #b8353a); }

/* The chat docked at the left, over the game, a little see-through. */
.chat-dock-btn {
  position: absolute; right: 88px; bottom: 8px; z-index: 3;
  padding: 2px 6px; font-size: 1rem; line-height: 1.4;
  background: rgb(16 18 24 / 0.5); border: 1px solid rgb(255 255 255 / 0.3); border-radius: 4px;
}
.chat-dock-btn.on { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 35%, rgb(16 18 24 / 0.6)); }
.chat-dock {
  position: fixed; left: 8px; top: 96px; bottom: 8px; z-index: 15; width: min(320px, calc(var(--vw, 1vw) * 46));
  display: grid; grid-template-rows: auto 1fr auto; gap: 6px; padding: 8px;
  /* Solid, so the log behind doesn't show through the messages (players, 2026-10-25). */
  background: var(--paper); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 4px 16px rgb(0 0 0 / 0.35);
}
.chat-dock[hidden], body:has(#game[hidden]) .chat-dock { display: none; }
/* Typing on a phone: the docked chat's foot rises above the keyboard (ui.js keyboardFit, --kb). */
body.kb-open .chat-dock { bottom: calc(8px + var(--kb, 0px)); max-height: calc(var(--app-h, 100vh) - 16px); top: auto; }
@media (max-width: 899px) { body.kb-open .tabs { display: none; } }
/* Typing in a panel on a phone (the chat, a note): the top, the figures and the scene step aside so the
   messages and the box keep the screen above the keyboard; back when the keyboard goes down. */
@media (max-width: 899px) and (orientation: portrait) {
  body.kb-open .screen.game:has(.panel :focus) > .topbar,
  body.kb-open .screen.game:has(.panel :focus) > .stats,
  body.kb-open .screen.game:has(.panel :focus) > .scene { display: none; }
}
.chat-dock .chat-list { min-height: 0; height: auto; max-height: none; overflow-y: auto; font-size: 0.82rem; background: transparent; border: 0; padding: 0; }
.chat-dock .chat-form { display: flex; gap: 4px; }
.chat-dock .chat-form input { flex: 1; min-width: 0; }
.chat-dock { max-height: calc(100% - 16px); }
/* Its head: the name and a close button big enough for a thumb (players, 2026-10-28:
   "the message box on the phone opens and can't be closed"). */
.chat-dock .dock-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.chat-dock .dock-head b { font-size: 0.9rem; }
.chat-dock .dock-close { min-height: 36px; min-width: 64px; padding: 4px 10px; font-size: 0.95rem; border: 1px solid var(--line); border-radius: 6px; }
@media (max-width: 899px) { .chat-dock { top: auto; height: calc(var(--vh, 1vh) * 42); width: min(300px, calc(var(--vw, 1vw) * 72)); } }

/* A moment shared into the chat, and the share button on a log line. */
.show-event { display: flex; align-items: center; gap: 6px; margin: 2px 0; padding: 2px 8px; border-left: 3px solid var(--line); border-radius: 4px; background: color-mix(in srgb, var(--surface) 70%, transparent); }
.show-event p { margin: 0; }
.show-event .show-line { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.show-event button { flex: none; white-space: nowrap; padding: 0 4px; }
.show-event.r-rare { border-color: #3d7fd1; } .show-event.r-epic { border-color: #9a4fd1; } .show-event.r-legendary { border-color: var(--gold); }
.share-row { display: block; margin-top: 2px; }
#log li { cursor: pointer; }

/* One's own dungeon has the whole screen: the scene on top, the turn below. */
.delve.full { display: grid; grid-template-rows: auto 1fr; align-items: start; justify-items: center; gap: 8px; padding: 8px; overflow-y: auto; background: var(--paper); }
.delve.full #scene { width: min(960px, 100%); }
.delve.full .delve-card { width: min(960px, 100%); max-height: none; }
.delve.full #scene { height: calc(var(--vh, 1vh) * 42); min-height: 220px; flex-shrink: 0; grid-row: 1; grid-column: 1; }
.delve.full .delve-card { grid-row: 2; grid-column: 1; }
.delve.full { grid-template-columns: minmax(0, 960px); justify-content: center; }

/* A shared moment played in a little scene of its own (the sharer's). */
.shared-view .card { width: min(720px, 100%); display: grid; gap: 8px; }
.shared-scene { height: 300px; min-height: 0; width: 100%; border-radius: 6px; }

/* Leaving a sect: three ways, each in its own box. */
.leave-way { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 10px; }
.leave-way h4 { margin: 0; }
.leave-way p { margin: 0; font-size: 0.85rem; }
.leave-years { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.leave-way .leave-years button { min-width: 52px; min-height: 40px; padding: 6px 10px; font: inherit; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); cursor: pointer; touch-action: manipulation; }
.leave-way .leave-years button.active { background: var(--jade, #2c6b59); border-color: var(--jade, #2c6b59); color: #fff; font-weight: 700; }
.leave-way .leave-years input.leave-years-n { width: 64px; flex: none; margin: 0; min-height: 40px; box-sizing: border-box; padding: 6px 8px; font: inherit; border: 1px solid var(--line); border-radius: 8px; }
.leave-opt { display: flex; gap: 6px; align-items: center; font-size: 0.9rem; }
.cx-guide { margin-top: 4px; font-size: 0.85em; }
.cx-guide summary { cursor: pointer; color: var(--accent, #4f7a63); }
.cx-guide p { margin: 4px 0 0; }
.exam-box { border: 1px solid var(--line, #ccc); border-radius: 8px; padding: 8px 12px; margin: 8px 0; }
.exam-box h4 { margin: 0 0 4px; }
.exam-checks { list-style: none; padding: 0; margin: 4px 0; }
.exam-checks li { margin: 2px 0; }
.exam-checks li.ok { color: #3d7a4f; }
.exam-checks li.no { color: #b04040; }
.exam-checks li.soft { color: #a07020; }
#choice-text { white-space: pre-line; }
.leave-way p.bad { color: var(--danger, #b8353a); }
.act-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0; } .act-row button.danger { color: var(--danger, #b8353a); border-color: var(--danger, #b8353a); }
.act-row button.danger:disabled { color: var(--btn-dis-ink); border-color: color-mix(in srgb, var(--danger) 60%, var(--btn-dis-border)); }
.chat-list.admin-chat { height: calc(var(--vh, 1vh) * 60); width: min(640px, calc(var(--vw, 1vw) * 90)); }

.qi-mote { position: absolute; width: 11px; height: 11px; border-radius: 50%; background: radial-gradient(circle, #fffbe0, #ffd36a 50%, transparent 72%); box-shadow: 0 0 8px #ffe9a0; pointer-events: none; }
.roadmap { margin: 0; padding-left: 1.4em; display: grid; gap: 10px; }
.roadmap li strong { margin-right: 8px; }
.roadmap .rm-state { font-size: 0.8em; padding: 1px 8px; border-radius: 10px; border: 1px solid var(--line); }
.roadmap .rm-now .rm-state { background: var(--gold, #d4a838); color: #222; border-color: transparent; }
.roadmap .rm-begun .rm-state { background: color-mix(in srgb, var(--gold, #d4a838) 35%, transparent); }
.roadmap p { margin: 2px 0 0; }
.devlog { margin: 0; padding-left: 1.2em; display: grid; gap: 10px; }
.devlog li strong { margin-right: 8px; }
.devlog .rm-state { font-size: 0.8em; padding: 1px 8px; border-radius: 10px; border: 1px solid var(--line); }
.devlog p { margin: 2px 0 0; }
.title-menu .given-input { width: 100%; box-sizing: border-box; padding: 10px 12px; font: inherit; text-align: center; background: #241a1c; color: #f3e6c8; border: 2px solid #7b6450; }
.menu-panel input:not([type]) , .menu-panel input[type="text"] { width: 100%; box-sizing: border-box; padding: 8px; font: inherit; margin: 6px 0; }
/* The heavenly tribulation (scene.js tribulation): clouds by realm, the hero's strength bar, the light that fills all. */
/* (Just behind the hero, in front of the place and the sea of clouds: scene.js puts it before the hero.) */
.trib-sky { position: absolute; left: 0; top: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; image-rendering: pixelated; }
/* Above the clouds (tribulation from the Nascent Soul): the sea of clouds over the place, behind the hero. */
.trib-above { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; image-rendering: pixelated; }
@keyframes trib-swirl { from { transform: translateX(-3%); } to { transform: translateX(3%); } }
.trib-hp { position: absolute; bottom: 52%; width: 44px; height: 5px; background: #2a1a1a; border: 1px solid #000; pointer-events: none; }
.trib-hp i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #e04a3a, #ffb04a); }
.trib-flash { position: absolute; inset: 0; background: radial-gradient(circle at 50% 60%, #ffffff, #fff6d8 45%, #fff1c0); opacity: 0; pointer-events: none; }
.smoke-puff { position: absolute; bottom: 24%; width: 12px; height: 12px; border-radius: 50%; background: radial-gradient(circle, #6a6a6a, #3a3a3a 60%, transparent 72%); pointer-events: none; }
.vow-list { margin: 0; padding-left: 1.1em; } .vow-list .vow-broken { text-decoration: line-through; color: var(--danger, #b8353a); } .vow-list .vow-done { color: var(--muted, #888); }
.stat-plus { color: var(--accent, #4fae7a); font-size: 0.75em; margin-left: 2px; }

/* A phone screen (or large system text): the log keeps a good part of the
   screen. When the top grows too tall, the page scrolls as a whole and the
   tabs stay at the bottom, rather than the log being squeezed to nothing. */
@media (max-width: 899px) {
  .screen.game { height: auto; min-height: 100%; min-height: calc(var(--vh, 1dvh) * 100); }
  .screen.game .panel { flex: 1 1 0; min-height: calc(var(--vh, 1vh) * 42); min-height: calc(var(--vh, 1dvh) * 42); }
  .screen.game .tabs { position: sticky; bottom: 0; z-index: 4; background: var(--paper); }
}
@media (max-width: 899px) and (max-height: 760px) {
  .scene { height: calc(var(--vh, 1vh) * 30); height: calc(var(--vh, 1dvh) * 30); min-height: 150px; }
}
/* Upright on a phone: the game is exactly the screen's height. The name,
   the speed buttons, the stats and the scene stay in view; only the panel
   below them scrolls (the page itself never does). */
@media (max-width: 899px) and (orientation: portrait) {
  .screen.game { height: calc(var(--vh, 1vh) * 100); height: calc(var(--vh, 1dvh) * 100); height: var(--app-h, calc(var(--vh, 1dvh) * 100)); min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
  .screen.game > .topbar, .screen.game > .stats, .screen.game > .scene, .screen.game > .tabs { flex: none; }
  .screen.game .panel { flex: 1 1 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  .screen.game .tabs { position: static; }
  .stats { padding-block: 4px; gap: 4px; }
  /* The scene keeps one shape on every phone (as wide as the screen, 5:4),
     shorter only where the screen is too short to leave the panel below
     some 240px (three chat messages). */
  /* (The height is set from the width, not by aspect-ratio: Safari would
     narrow the scene to keep the ratio once the height is capped.) */
  .screen.game > .scene { width: 100%; align-self: stretch; aspect-ratio: auto; min-height: 140px; height: max(140px, min(calc(var(--vw, 1vw) * 80), calc(calc(var(--vh, 1vh) * 100) - 560px))); height: max(140px, min(calc(var(--vw, 1vw) * 80), calc(calc(var(--vh, 1dvh) * 100) - 560px))); height: max(140px, min(calc(var(--vw, 1vw) * 80), calc(var(--app-h, calc(var(--vh, 1dvh) * 100)) - 560px))); }
}
/* The chat on an upright phone: tighter, the reactions on the line itself,
   so at least three messages show. */
@media (max-width: 899px) and (orientation: portrait) {
  .world .world-stats { font-size: 0.78rem; line-height: 1.3; }
  .world .world-tabs button { min-height: 30px; padding: 2px 8px; font-size: 0.8rem; }
  .world-panel { gap: 6px; padding-top: 6px; }
  .chat-list { padding: 4px 8px; gap: 3px; }
  .chat-line { line-height: 1.35; }
  .chat-line .chat-reacts { display: inline-flex; margin: 0 0 0 6px; vertical-align: middle; }
  .chat-line .chat-reacts button { min-height: 24px; padding: 0 5px; font-size: 0.75rem; box-shadow: none; }
  .chat-form input { padding: 4px 8px; min-height: 34px; }
  .chat-form button { min-height: 34px; padding: 2px 12px; }
}
/* The chat on a computer, as on a phone (2026-10-25): the reactions on the
   line itself, the button to add one shown on hover. */
@media (min-width: 900px) {
  .chat-list { gap: 2px; }
  .chat-line { line-height: 1.35; }
  .chat-line .chat-reacts { display: inline-flex; margin: 0 0 0 6px; vertical-align: middle; }
  .chat-line .chat-reacts button { min-height: 20px; padding: 0 5px; font-size: 0.72rem; box-shadow: none; }
  .chat-line .chat-reacts .react-add { opacity: 0; }
  /* The top bar on one line (2026-10-25): name, title, age, realm and chapter
     side by side, who is online in the middle; the panel below gets the room. */
  .topbar { padding-block: 4px; }
  .who { flex-direction: row; align-items: baseline; gap: 10px; flex-wrap: wrap; }
  .who-line { flex-direction: row; align-items: baseline; gap: 4px 10px; flex-wrap: wrap; }
  .topbar .world-stats { flex: 1 1 auto; text-align: center; margin: 0; font-size: 0.8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .world .world-tabs button { min-height: 32px; padding: 3px 10px; }
  /* The chat's two pages (talk, shared moments) on the tabs' own row, at its
     right end (2026-10-25), so the chat keeps that row for itself. */
  .world { position: relative; }
  .world > .world-tabs { padding-right: 250px; }
  .world-panel > .chat-filter { position: absolute; top: 0; right: 0; height: 36px; margin: 0; align-items: center; }
  .world-panel > p.muted:empty { display: none; }
  .world-panel { gap: 6px; padding-top: 6px; }
  .chat-filter button { min-height: 26px; padding: 1px 10px; }
  .chat-form input { padding: 4px 8px; min-height: 34px; }
  .chat-form button { min-height: 34px; padding: 2px 12px; }
  /* The small frame keeps its shape on a wide scene (not stretched across it). */
  .vig { width: auto; max-width: 46%; aspect-ratio: 8 / 5; }
  .chat-line:hover .chat-reacts .react-add, .chat-line .chat-reacts .react-add:focus-visible, .chat-line .chat-reacts:has(.react-picker) .react-add { opacity: 0.6; }
}
/* The encyclopedia on a phone (2026-10-25: its top took half the screen):
   the kinds in one row that scrolls sideways, the two worlds and the search
   slimmer, the lists given the room. */
@media (max-width: 899px) {
  .menu-body.codex .cx-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
  .menu-body.codex .cx-tabs button { min-height: 32px; }
  .menu-panel .menu-body.codex .cx-tabs button.active, .menu-panel .menu-body.codex .cx-tabs button.active:hover { background: var(--gold); color: #1d1a16; border-color: var(--gold); }
  .menu-body.codex .cx-worlds { margin-bottom: 0; }
  .menu-panel .menu-body.codex .cx-worlds button { min-height: 32px; padding: 2px 6px; font-size: 0.8rem; }
  .menu-body.codex .cx-search { margin: 2px 0; padding: 6px 10px; }
  .menu-body.codex .cx-side, .menu-body.codex .cx-list { max-height: calc(var(--vh, 1vh) * 68); }
}
/* A narrow phone: the speed buttons a little slimmer, so the name keeps room. */
@media (max-width: 400px) and (orientation: portrait) {
  .speed { gap: 2px; }
  .speed button { min-width: 26px; padding: 4px 2px; font-size: 0.72rem; }
}

/* A tab with something waiting (the sect could build). */
.tabs button.nudge::after { content: "●"; color: #e0b85a; margin-left: 3px; font-size: 0.7em; vertical-align: 2px; }

/* Harmful interactions, kept well apart from the kind ones. */
.act-harsh-label { display: block; margin-top: 18px; color: #c96a5a; }
.act-row.act-harsh { margin-top: 6px; padding-top: 8px; border-top: 1px dashed rgba(201,106,90,0.5); }
.chain-tag { display: block; font-size: 0.72rem; font-weight: 600; color: var(--gold, #c9a227); margin-bottom: 2px; letter-spacing: 0.02em; }
/* Idle seclusion (docs/44): a calm panel over the game while the clock trains the life. */
.afk-panel { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(10, 16, 14, 0.82); }
.afk-panel section { max-width: 440px; width: 100%; background: var(--paper, #1b2420); color: var(--ink, #e8efe9); border-radius: 12px; padding: 18px; display: grid; gap: 10px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4); }
.afk-panel h2 { margin: 0; }
.afk-stats { font-variant-numeric: tabular-nums; font-weight: 600; }
.afk-gate { font-weight: 700; color: var(--accent, #c8902a); }

/* ---- Buttons in their places: the face cards, the scene's chips, the dark
   menus, and room for fingers on a touch screen. */
/* People's faces stay cards; they lift on hover and sink when pressed. */
.faces .face, .comp-row .face { min-height: 0; border-color: color-mix(in srgb, var(--btn-border) 70%, var(--line)); }
.faces .face:hover, .comp-row .face:hover { border-color: var(--jade); background: var(--btn-hover-bg); }
.faces .face:active, .comp-row .face:active { transform: translateY(2px); box-shadow: none; background: var(--btn-press-bg); }
.faces .face:focus-visible, .comp-row .face:focus-visible { outline-offset: 2px; position: relative; z-index: 1; }
/* Chips over the pixel scene keep their smoked glass, without the key edge. */
.bug-btn, .chat-float-btn, .chat-dock-btn { box-shadow: none; color: #f4efe2; min-height: 36px; }
.bug-btn:hover, .chat-float-btn:hover, .chat-dock-btn:hover { background: rgb(16 18 24 / 0.78); border-color: rgb(255 255 255 / 0.7); }
.chat-float-btn[aria-pressed="true"] { box-shadow: none; color: #f4efe2; }
.show-chip, .show-event button, .cx-sub button, .cx-sub2 button { box-shadow: none; }
/* The way of life (focus) and the travel/trial buttons read as actions. */
.focus button { background: var(--btn-bg); box-shadow: 0 2px 0 var(--btn-edge); }
.focus button:hover:not(:disabled) { background: var(--btn-hover-bg); }
.trial-ways { gap: 6px; }
.comp-acts button, .act-row button, .trial-ways button { font-weight: 600; }
/* The dark pixel menus (title, settings, encyclopedia) keep their frames;
   they gain the focus ring and a readable disabled state. */
.title-menu button:focus-visible, .menu-panel button:focus-visible, .lang-chip:focus-visible { outline: 3px solid #f0b45a; outline-offset: 3px; }
.menu-panel .cx-tabs button:focus-visible, .menu-panel .cx-side button:focus-visible, .menu-panel .cx-sub button:focus-visible { outline-offset: 1px; }
.title-menu button:disabled, .menu-panel button:disabled {
  cursor: not-allowed; color: #cbbd9c; transform: none;
  background: repeating-linear-gradient(135deg, #241a1c 0 5px, #2e2224 5px 8px);
  border: 2px dashed #7b6450; box-shadow: none;
}
.menu-panel .kinds button.active, .menu-panel .cx-worlds button.active { box-shadow: inset 0 0 0 2px #f1e9d2; }
.gender-pick button:hover, .dao-grid button:hover { opacity: 1; }
/* A touch screen: every button at least about a fingertip tall, and a
   little more room between the buttons in a row. Dense grids (the faces,
   the encyclopedia's lists) keep their size. */
@media (pointer: coarse) {
  .speed button, .focus button, .chat-actions button, .notice button, .show-bar button,
  .treasury-row > button, .dungeon-rooms button, .lives-list .row-actions button,
  .slot-acts button, .cx-tabs button, .cx-worlds button, .gender-pick button, .dao-btn,
  .world-tabs button, .trial-ways button, .comp-acts button, .act-row button { min-height: 40px; }
  .act-row, .comp-acts { gap: 10px; }
  .trial-ways { gap: 8px; }
  .options { gap: 10px; }
  .faces { gap: 8px; }
}
@media (pointer: coarse) and (min-width: 420px) {
  .comp-acts button, .act-row button, .trial-ways button, .slot-acts button { min-height: 44px; }
}

/* Places and journeys (docs/45): where people are, the map's towns, the road. */
.place-lines { margin: 8px 0; padding: 8px 10px; border: 1px solid var(--btn-border, var(--line, #c9b98f)); border-radius: 6px; background: var(--paper-2, rgba(0, 0, 0, 0.03)); }
.place-lines p { margin: 2px 0; }
.place-lines .near { color: var(--jade, #2f7a55); font-weight: 600; }
.place-lines .far { color: var(--gold, #a8742a); font-weight: 600; }
.picker-actions button.blocked { opacity: 0.6; }
.picker-actions:has(> .act-why) { flex-wrap: wrap; }
.picker-actions .act-why { flex-basis: 100%; order: 9; }
.act-why { margin: 6px 0 0; font-size: 0.85rem; color: var(--muted); }
.act-why::before { content: ""; display: inline-block; width: 1.1em; height: 1.1em; margin-right: 0.3em; vertical-align: -0.2em; background: var(--px-info) center / contain no-repeat; image-rendering: pixelated; }
.go-confirm { margin: 8px 0; padding: 10px; border: 2px solid var(--gold, #a8742a); border-radius: 6px; background: var(--paper, #fffaf0); }
.go-confirm .go-q { margin: 0 0 4px; font-weight: 700; }
.go-confirm button { margin: 6px 8px 0 0; }
.world-map.pickable .map-spot {
  position: absolute; width: 18px; height: 18px; min-height: 0; margin: -12px 0 0 -9px; padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.85); border-radius: 50%; background: rgba(58, 46, 38, 0.35); box-shadow: none; cursor: pointer;
}
.world-map.pickable .map-spot:hover { background: rgba(255, 243, 192, 0.6); }
.world-map.pickable .map-spot.home { border-color: #e0403a; }
.world-map.pickable .map-spot.here { box-shadow: 0 0 0 2px #e0403a; }
.world-map.pickable .map-spot.picked { background: #fff3c0; border-color: #3a2e26; box-shadow: 0 0 0 3px #e0b03c; }
@media (pointer: coarse) { .world-map.pickable .map-spot { width: 26px; height: 26px; margin: -16px 0 0 -13px; } }
.map-status { margin: 8px 0; }
.map-status p { margin: 2px 0; }
.map-status .map-road { font-weight: 700; color: var(--gold, #a8742a); }
.town-info { margin: 8px 0; padding: 10px; border: 1px solid var(--btn-border, var(--line, #c9b98f)); border-radius: 6px; background: var(--paper-2, rgba(0, 0, 0, 0.03)); }
.town-info h4 { margin: 0 0 2px; }
.town-info .map-tag { color: var(--jade, #2f7a55); font-weight: 600; margin: 4px 0; }
.harbour { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--btn-border, var(--line, #c9b98f)); }
.harbour h5 { margin: 0 0 6px; }
.ship-row { align-items: center; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.ship-to { flex: 1 1 160px; }
.map-ship { color: var(--jade, #2f7a55); font-weight: 600; }
.people-group > summary { cursor: pointer; font-weight: 700; font-size: 1.05rem; margin: 14px 0 6px; padding: 6px 0; }
/* A choice that changes the life path: marked, and asked twice. */
#choice-options button.path-turn { border: 2px solid var(--danger, #b0362c); }
#choice-options .path-badge { display: block; margin-top: 4px; font-style: normal; font-weight: 700; font-size: 0.82rem; color: var(--danger, #b0362c); }
.death-badge { display: block; margin-top: 4px; font-style: normal; font-weight: 700; font-size: 0.82rem; color: var(--danger, #b0362c); }
.path-confirm { padding: 12px; border: 3px solid var(--danger, #b0362c); border-radius: 6px; background: var(--paper, #fffaf0); }
.path-confirm .path-q { margin: 0 0 6px; font-weight: 800; font-size: 1.05rem; color: var(--danger, #b0362c); }
.path-confirm button { margin: 8px 8px 0 0; }
/* The map tab (docs/45): a painted map, its towns as buttons. */
.map-tab { padding: 4px 0 16px; }
.map-lands { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
/* The map tab's pages (2026-10-28): this town's places, and the world map in a pop-up. */
.map-here-head h3 { margin: 0; }
.map-here-head p { margin: 2px 0 6px; }
.map-here .places-card.compact { margin-top: 10px; }
.places-card.compact > h3 { margin: 0 0 2px; }
.places-card.compact .places-part { margin: 10px 0 0; }
.map-world .map-open-world { display: block; width: 100%; min-height: 52px; margin: 10px 0 6px; font-size: 1.05rem; }
.world-map-panel { padding: 8px; place-items: stretch; }
.world-map-panel .world-map-card {
  width: 100%; max-width: 1180px; height: calc(var(--vh, 1vh) * 100 - 16px); max-height: none; margin: 0 auto;
  display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; overflow: hidden;
}
.world-map-head { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.world-map-head h2 { flex: 1 1 auto; margin: 0; min-width: 0; }
.world-map-zoom { display: flex; gap: 4px; }
.world-map-panel button { font-size: 0.9rem; padding: 6px 10px; }
.world-map-panel .world-map-zoom button { min-width: 38px; padding: 4px 8px; font-size: 1.1rem; }
.world-map-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; display: grid; align-content: start; gap: 8px; }
.world-map-body .map-status { margin: 0; font-size: 0.9rem; }
.world-map-body .map-status .muted { font-size: 0.85rem; }
.world-map-scroll { overflow: auto; max-width: 100%; border-radius: 3px; -webkit-overflow-scrolling: touch; }
.world-map-panel .ink-map { max-width: none; }
.world-map-panel .world-map-scroll .ink-map[style*="width"] { max-width: none; }
.world-map-panel .ink-map .ink-spot { padding: 0; min-height: 0; font-size: inherit; box-shadow: none; transform: none; }
.world-map-panel .ink-map .ink-spot:not(.picked):not(.home):not(:hover) { border-color: transparent; background: transparent; }
.world-map-panel .ink-map .ink-spot.picked { box-shadow: 0 0 0 3px rgba(224, 176, 60, 0.8); }
.world-map-panel .map-lands button { box-shadow: none; border: 1px solid rgb(232 200 120 / 0.35); background: transparent; padding: 4px 10px; font-size: 0.85rem; }
.world-map-panel .map-lands button.active { background: var(--gold); color: #1d1a16; border-color: var(--gold); }
.world-map-panel .world-map-body section {
  width: auto; max-height: none; overflow: visible; display: block; padding: 10px;
  background: rgb(255 255 255 / 0.04); border: 1px solid #7b6450; border-radius: 6px; box-shadow: none;
}
.world-map-body .town-map { display: grid; gap: 8px; min-width: 0; }
.world-map-body .town-map > * { min-width: 0; }
.world-map-left { min-width: 0; }
.world-map-body .town-info { margin: 0; }
.world-map-body .town-info .act-row button { text-align: left; }
.world-map-body .harbour .ship-row { align-items: center; }
.world-map-body .harbour .ship-to { flex: 1 1 100%; }
/* Wide screens: the map on the left, what is picked beside it. */
@media (min-width: 900px) {
  .world-map-body .town-map { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
  .world-map-panel .world-map-scroll { max-height: calc(var(--vh, 1vh) * 100 - 190px); }
  .world-map-panel .world-map-body section { max-height: calc(var(--vh, 1vh) * 100 - 130px); overflow-y: auto; }
}
.world-map-panel .town-info .map-tag, .world-map-panel .site-own, .world-map-panel .site-friend { color: #8fd0a8; }
.world-map-panel .act-why { color: #e8a090; }
.world-map-panel .sea-steps { color: #cbbd9c; }
.ink-map { position: relative; width: 100%; max-width: 760px; margin: 0 auto; }
.ink-map canvas { display: block; width: 100%; height: auto; border-radius: 3px; box-shadow: 0 3px 10px rgb(0 0 0 / 0.25); }
.ink-map .ink-spot {
  position: absolute; width: 28px; height: 28px; min-height: 0; margin: -20px 0 0 -14px; padding: 0;
  border: 2px solid transparent; border-radius: 50%; background: transparent; box-shadow: none; cursor: pointer;
}
.ink-map .ink-spot:hover { border-color: rgba(184, 50, 31, 0.6); background: rgba(255, 246, 216, 0.35); }
.ink-map .ink-spot.picked { border-color: #b8321f; background: rgba(255, 246, 216, 0.5); box-shadow: 0 0 0 3px rgba(224, 176, 60, 0.8); }
.ink-map .ink-spot.home { border-color: rgba(58, 42, 30, 0.7); }
.ink-map .ink-mark { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); font-size: 14px; font-weight: 800; color: #b8321f; text-shadow: 0 0 3px #f3e7c8, 0 0 3px #f3e7c8; }
.ink-map .ink-spot.here .ink-mark { font-size: 11px; }
@media (pointer: coarse) { .ink-map .ink-spot { width: 36px; height: 36px; margin: -24px 0 0 -18px; } }
/* The world map in pixel art (src/pixmap.js): the art drawn small and scaled by whole device pixels, the names,
   title and buttons sharp HTML over it. */
.pix-map { --pix-ink: #2a1e18; --pix-paper: #f6ecd2; --pix-gold: #f0c040; }
.pix-map .pix-stage { position: relative; isolation: isolate; margin: 0 auto; max-width: 100%; line-height: 0; }
.pix-map canvas { display: block; width: 100%; height: auto; border-radius: 0; image-rendering: pixelated; image-rendering: crisp-edges;
  box-shadow: none; }
.pix-map .pix-stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2;
  box-shadow: inset 0 0 0 2px var(--pix-ink), inset 0 0 0 4px #8e6640, inset 0 0 0 5px var(--pix-ink); }
.pix-map .pix-label {
  position: absolute; transform: translate(-50%, -50%); white-space: nowrap; pointer-events: none; z-index: 1;
  font-size: var(--pix-fs, 11px); font-weight: 600; line-height: 1.2; padding: 0 3px; color: var(--pix-ink); background: rgb(246 236 210 / 0.86);
  box-shadow: 0 0 0 1px rgb(42 30 24 / 0.55);
}
/* A sect's seal stuck over its mountain on the map (pixmap.js): about 11 art pixels wide, over the building, never in the way of a tap. */
.pix-map .pix-emblem { position: absolute; width: calc(var(--pix-px, 3px) * 11) !important; height: calc(var(--pix-px, 3px) * 11) !important;
  transform: translate(-50%, calc(var(--pix-px, 3px) * -12)); pointer-events: none; z-index: 2; image-rendering: auto; }
.pix-map .pix-label.capital { font-weight: 800; }
.pix-map .pix-label.site { font-size: calc(var(--pix-fs, 11px) - 1px); font-weight: 500; }
.pix-map .pix-label.site.xian { color: #1f5a50; }
.pix-map .pix-label.site.martial { color: #6a2a1e; }
.pix-map.pix-dark .pix-label { color: #f1e9d2; background: rgb(18 22 36 / 0.82); box-shadow: 0 0 0 1px rgb(240 192 64 / 0.35); }
.pix-map.pix-dark .pix-label.site.xian { color: #9ad8c4; }
.pix-map.pix-dark .pix-label.site.martial { color: #f0a088; }
.pix-map .pix-title {
  position: absolute; top: 6px; right: 6px; z-index: 2; display: flex; align-items: center; gap: 6px; line-height: 1.2;
  padding: 4px 6px 4px 10px; font-family: var(--font-display, serif); font-weight: 700; font-size: calc(var(--pix-fs, 11px) + 4px); color: var(--pix-ink);
  background: var(--pix-paper); box-shadow: 0 0 0 2px var(--pix-ink), 3px 3px 0 2px rgb(42 30 24 / 0.45); pointer-events: none;
}
.pix-map .pix-seal { display: inline-block; width: 14px; height: 14px; background: #b8321f; box-shadow: inset 0 0 0 2px #b8321f, inset 0 0 0 3px #f6ecd2; }
.pix-map.pix-dark .pix-title { color: #f1e9d2; background: #1e2236; box-shadow: 0 0 0 2px #0a0c14, 3px 3px 0 2px rgb(0 0 0 / 0.5); }
.pix-map .ink-spot { z-index: 3; border-radius: 0; margin: -22px 0 0 -14px; }
.pix-map .ink-spot:hover { border-color: var(--pix-gold); background: rgb(255 246 216 / 0.18); }
.pix-map .ink-spot.picked, .world-map-panel .pix-map .ink-spot.picked {
  border: 2px solid var(--pix-gold); background: rgb(255 246 216 / 0.22); box-shadow: 0 0 0 2px var(--pix-ink), inset 0 0 0 1px var(--pix-ink);
  animation: pix-pick 1s steps(2, jump-none) infinite;
}
@keyframes pix-pick { from { border-color: var(--pix-gold); } to { border-color: #fff4dc; } }
@media (prefers-reduced-motion: reduce) { .pix-map .ink-spot.picked { animation: none; } }
.pix-map .ink-spot.home { border-color: transparent; }
.pix-map .ink-mark { top: -14px; color: var(--pix-ink); text-shadow: none; background: var(--pix-paper); line-height: 1; padding: 1px; box-shadow: 0 0 0 1px var(--pix-ink); font-size: 12px; }
.pix-map .ink-spot, .world-map-panel .pix-map .ink-spot { width: var(--pix-hit, 28px); height: var(--pix-hit, 28px); margin: calc(var(--pix-hit, 28px) * -0.72) 0 0 calc(var(--pix-hit, 28px) / -2); }
.world-map-scroll.dragging { cursor: grabbing; user-select: none; }
.world-map-panel .world-map-x { position: static; float: none; margin: 0; flex: none; }
/* Buttons in a row are of one size (the owner's rule): the lands three to a row, the zoom pair square, a town's
   visit and move side by side; the words centred and wrapped inside, never cut. */
.world-map-panel .map-lands, .map-world-embed .map-lands { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.world-map-panel .map-lands button, .map-world-embed .map-lands button {
  width: 100%; min-width: 0; min-height: 40px; margin: 0; padding: 4px 6px; white-space: normal; overflow-wrap: anywhere; text-align: center; line-height: 1.2;
}
.world-map-zoom { display: grid; grid-template-columns: repeat(2, 40px); gap: 6px; }
.world-map-zoom button, .world-map-panel .world-map-zoom button { width: 40px; height: 40px; min-width: 0; min-height: 0; padding: 0; margin: 0; display: grid; place-items: center; }
.world-map-panel .world-map-x { width: 40px; height: 40px; min-width: 0; min-height: 0; padding: 0; }
.world-map-body .town-info .act-row, .map-world-embed .town-info .act-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.world-map-body .town-info .act-row button, .map-world-embed .town-info .act-row button { width: 100%; min-width: 0; margin: 0; white-space: normal; overflow-wrap: anywhere; text-align: center; }
/* On a computer the world map is its own big window (a player 2026-11-14): most of the screen, the ✕ top left.
   The map takes the whole left of the window, as big as whole pixels allow (pixmap.js fits it to this frame's
   width and height); where one is, the lands, what is picked and the war's key stand in a column beside it. */
@media (min-width: 900px) {
  .world-map-panel.world-map-window { padding: 0; place-items: center; }
  .world-map-panel.world-map-window .world-map-card { width: 90vw; max-width: none; height: 85vh; height: calc(var(--vh, 1vh) * 85); }
  .world-map-window .world-map-body {
    overflow: hidden; display: grid; gap: 8px 12px; align-content: stretch;
    grid-template-columns: minmax(0, 1fr) clamp(280px, 24vw, 380px); grid-template-rows: auto auto auto minmax(0, 1fr);
  }
  .world-map-window .world-map-body .town-map, .world-map-window .world-map-left { display: contents; }
  .world-map-window .world-map-frame { grid-column: 1; grid-row: 1 / -1; min-height: 0; height: 100%; }
  .world-map-window .world-map-scroll {
    min-height: 0; max-height: none; height: 100%;
    display: flex; cursor: grab;
  }
  .world-map-window .world-map-scroll .pix-map { width: 100%; flex: none; margin: auto; }
  .world-map-window .world-map-body .map-status { grid-column: 2; grid-row: 1; }
  .world-map-window .map-lands { grid-column: 2; grid-row: 2; margin: 0; }
  .world-map-window .map-war-key { grid-column: 2; grid-row: 3; }
  .world-map-window .world-map-body .town-map > section { grid-column: 2; grid-row: 4; min-height: 0; max-height: none; overflow-y: auto; align-self: stretch; }
  .world-map-panel.world-map-window .world-map-body section { max-height: none; }
}
/* The great war on the map (docs/61 E5, war-map.js): its key, a held town's card line. */
.map-war-key { margin: 4px 0 0; font-size: 0.85em; text-align: center; }
.map-war-flag { display: inline-block; width: 12px; height: 8px; border: 2px solid; border-radius: 1px; vertical-align: middle; }
.town-info .map-war-tag { color: #9a2a1e; }
.town-info .map-war-tag.light { color: #2a5a96; }
.world-map-panel .town-info .map-war-tag { color: #f08a6a; }
.world-map-panel .town-info .map-war-tag.light { color: #8ab8ec; }
/* The road of love (docs/08): its steps, where the two stand, what comes next. */
.love-road { margin: 8px 0; padding: 8px 10px; border: 1px solid var(--btn-border, #c9b98f); border-radius: 6px; }
.love-road h4 { margin: 0 0 4px; }
.love-steps { margin: 0; padding-left: 18px; }
.love-steps li { margin: 2px 0; color: var(--muted); }
.love-steps li.done { color: var(--jade, #2f7a55); }
.love-steps li.next { color: inherit; font-weight: 700; }
.love-steps li small { font-weight: 400; }
/* An admin's right-click menu and the bar while viewing another's save (docs/36). */
.admin-ctx { position: fixed; z-index: 60; padding: 4px; background: var(--paper, #fffaf0); border: 2px solid var(--btn-border, #8a6a4a); border-radius: 6px; box-shadow: 0 4px 12px rgb(0 0 0 / 0.3); }
.inspect-bar { position: fixed; z-index: 55; left: 50%; top: 6px; transform: translateX(-50%); display: flex; gap: 10px; align-items: center; padding: 6px 12px; background: #b8321f; color: #fff; border-radius: 6px; font-weight: 700; box-shadow: 0 3px 10px rgb(0 0 0 / 0.3); }
.inspect-bar button { background: #fff; color: #b8321f; }
/* A sect's mountain or the battlefield picked on the map (docs/45). */
.site-info .site-friend, .site-info .site-own { color: var(--jade, #2f7a55); }
.site-info .site-foe, .site-info .site-war { color: var(--danger, #b8321f); }
.site-info .site-field { color: var(--ink-2, #6b4a2e); }
.ink-spot.site { width: 26px; height: 26px; }
/* One's own cave (src/cave-ui.js): its facts and the vein's bar. */
.cave-facts { margin: 6px 0; padding-left: 18px; }
.cave-facts li { margin: 2px 0; }
.cave-vein { height: 8px; border-radius: 4px; background: rgba(120, 110, 90, 0.25); overflow: hidden; margin: 2px 0 6px; max-width: 260px; }
.cave-vein i { display: block; height: 100%; background: linear-gradient(90deg, #4f8a7a, #8fd0b8); }
.map-caves { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.site-head { display: flex; align-items: center; gap: 10px; }
.site-head h4 { margin: 0; }
/* A child on the way, always in sight (docs/41). */
#age.pregnant { color: var(--jade, #2f7a55); font-weight: 600; }
.child-chance { margin: 4px 0 0; font-size: 0.9em; }
.map-lands button.unseen { opacity: 0.75; font-style: italic; }
.sea-steps { margin: 6px 0; font-size: 0.92em; color: var(--ink-2, #5a4636); }
/* The campaign board (docs/48): the front or the battle, the army's numbers, the chain's five nodes. */
.cmp-board { display: grid; gap: 6px; min-width: 0; }
.cmp-board .cmp-canvas { width: 100%; min-width: 0; }
.cmp-board canvas { display: block; width: 100%; border-radius: 3px; box-shadow: 0 2px 8px rgb(0 0 0 / 0.22); }
.cmp-board p { margin: 0; }
.cmp-head { font-weight: 700; font-size: 0.86rem; }
.cmp-legend, .cmp-chain { font-size: 0.76rem; color: var(--muted); }
.cmp-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 2px 10px; }
.cmp-bar { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 6px; font-size: 0.76rem; }
.cmp-bar .cmp-track { height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--ink) 14%, transparent); overflow: hidden; }
.cmp-bar .cmp-track span { display: block; height: 100%; background: var(--jade); }
.cmp-bar.low .cmp-track span { background: var(--cinnabar); }
.cmp-bar.foe .cmp-track span { background: color-mix(in srgb, var(--ink) 70%, transparent); }
.cmp-bar b { font-variant-numeric: tabular-nums; min-width: 2ch; text-align: right; }
.cmp-chips { display: flex; flex-wrap: wrap; gap: 4px 6px; font-size: 0.74rem; }
.cmp-chips span { padding: 1px 6px; border-radius: 9px; border: 1px solid var(--line); }
.cmp-chips span.plan { border-color: var(--gold, #c98f22); }
.cmp-nodes { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; list-style: none; counter-reset: cmp; }
.cmp-nodes li { counter-increment: cmp; flex: 1 1 0; min-width: 0; font-size: 0.7rem; line-height: 1.2; padding: 3px 4px; border-radius: 4px; border: 1px dashed var(--line); color: var(--muted); overflow-wrap: anywhere; }
.cmp-nodes li::before { content: counter(cmp) ". "; font-weight: 700; }
.cmp-nodes li.now { border-style: solid; border-color: var(--jade); color: inherit; font-weight: 700; }
.cmp-nodes li.done { border-style: solid; color: inherit; }
.cmp-nodes li.done.success { background: color-mix(in srgb, var(--jade) 14%, transparent); }
.cmp-nodes li.done.failure, .cmp-nodes li.done.timeout { background: color-mix(in srgb, var(--cinnabar) 12%, transparent); }
.cmp-reports { margin: 0; padding-left: 18px; font-size: 0.78rem; }
.menu-panel .cmp-board { margin-bottom: 8px; }
@media (max-width: 360px) { .cmp-nodes li { flex-basis: calc(50% - 4px); } }

/* character creation: a full screen, one choice at a time */
.create-screen { position: fixed; inset: 0; z-index: 60; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--bg, #14100f); color: var(--fg, #eee); --muted: #a9b4ae; } /* (its ground is always dark: the grey notes ≥4.5:1 on it) */
.create-left { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 16px; background: rgba(0,0,0,.25); }
.create-preview { display: grid; place-items: center; }
.create-portrait { width: min(calc(var(--vh, 1vh) * 46), calc(var(--vw, 1vw) * 40)); height: min(calc(var(--vh, 1vh) * 46), calc(var(--vw, 1vw) * 40)); image-rendering: pixelated; background: rgba(255,255,255,.05); border-radius: 8px; }
.create-sum { font-size: 1.1rem; }
.create-right { display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 16px 20px; }
.create-right h2 { margin: 0; }
.create-pick { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; }
.create-arrow { font-size: 1.8rem; min-width: 64px; min-height: 64px; }
.create-value { text-align: center; display: grid; gap: 2px; }
.create-value strong { font-size: 1.25rem; }
.create-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.create-chips button { min-height: 48px; padding: 6px 14px; }
.create-nav { display: flex; gap: 10px; margin-top: 10px; }
.create-nav button { flex: 1; min-height: 52px; font-size: 1.05rem; }
@media (max-width: 700px) and (orientation: portrait) { .create-screen { grid-template-columns: 1fr; grid-template-rows: auto 1fr; } .create-portrait { width: calc(var(--vw, 1vw) * 36); height: calc(var(--vw, 1vw) * 36); } }

/* character creation: the trait cards (create-traits.js) */
.trait-panel { display: grid; gap: 8px; min-width: 0; }
.trait-hint { margin: 0; font-size: .85rem; }
.trait-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.trait-card { position: relative; display: grid; align-content: center; justify-items: center; gap: 2px; min-height: 104px; padding: 22px 6px 8px; border: 2px solid var(--tier-ink, #888); border-radius: 10px; background: rgba(255,255,255,.05); color: inherit; text-align: center; cursor: pointer; }
.trait-card.bad { border-style: dashed; border-color: #c0504a; }
.trait-card.on { background: rgba(255,215,120,.18); box-shadow: 0 0 0 2px var(--tier-ink, #fc6) inset, 0 0 10px var(--tier-ink, #fc6); }
.trait-card.bad.on { box-shadow: 0 0 0 2px #c0504a inset, 0 0 10px #c0504a; }
.trait-card.off { opacity: .45; }
.trait-icon { font-size: 1.6rem; line-height: 1; }
.trait-name { font-size: .95rem; line-height: 1.15; overflow-wrap: anywhere; }
.trait-eff { font-size: .72rem; opacity: .8; line-height: 1.15; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.trait-cost { position: absolute; top: 4px; left: 4px; min-width: 24px; padding: 1px 6px; border-radius: 10px; background: #2b2b2b; color: #fff; font-size: .8rem; font-weight: 700; }
.trait-cost.refund { background: #1f7a3a; }
.trait-info { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 1px solid currentColor; font-size: .8rem; font-style: italic; display: grid; place-items: center; opacity: .8; }
.trait-row { display: flex; align-items: center; gap: 12px; }
.trait-tabs { display: flex; gap: 6px; }
.trait-tab { flex: 1; min-height: 40px; padding: 4px 10px; border: 2px solid transparent; border-radius: 10px; background: rgba(255,255,255,.06); color: inherit; cursor: pointer; font-weight: 600; }
.trait-tab.on { border-color: var(--t2, #7fcf8c); background: rgba(255,255,255,.14); }
.trait-tab.bad.on { border-color: #c0504a; }
/* A legendary gift: a deep gold-violet card with a slow shimmer, hard to mistake for the rest. */
.trait-card.legend { border-color: var(--t5, #e6be55); border-width: 3px; background: linear-gradient(135deg, #2a1240 0%, #5a2a0a 55%, #2a1240 100%); color: #fff2c8; box-shadow: 0 0 12px 2px rgba(230,190,85,.65); overflow: hidden; animation: legendGlow 1.8s ease-in-out infinite; }
.trait-card.legend::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, transparent 35%, rgba(255,244,200,.55) 50%, transparent 65%); background-size: 250% 100%; animation: legendSheen 2.4s linear infinite; }
.trait-card.legend .trait-name { color: #ffd76a; text-shadow: 0 0 6px rgba(255,200,80,.8); }
.trait-card.legend.on { background: linear-gradient(135deg, #3b1a5c 0%, #7a3a0c 55%, #3b1a5c 100%); }
@keyframes legendGlow { 0%, 100% { box-shadow: 0 0 8px 1px rgba(230,190,85,.5); } 50% { box-shadow: 0 0 18px 4px rgba(255,215,110,.95); } }
@keyframes legendSheen { from { background-position: 150% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .trait-card.legend, .trait-card.legend::after { animation: none; } }
.trait-reroll.warn-legend { outline: 2px dashed var(--t5, #e6be55); outline-offset: 2px; }
.legend-note { color: var(--t5, #e6be55); font-weight: 600; }
.trait-reroll { min-height: 48px; padding: 6px 18px; font-size: 1.05rem; }
.trait-warn { min-height: 1.3em; color: #e8806a; font-size: .9rem; visibility: hidden; }
.trait-warn.show { visibility: visible; }
.trait-detail { border: 1px solid var(--tier-ink, #888); border-radius: 8px; padding: 8px 10px; font-size: .9rem; }
.trait-detail p { margin: 4px 0 0; }
.trait-kept { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 6px; }
.trait-chip { border: 1px solid var(--tier-ink, #888); border-radius: 12px; padding: 2px 8px; font-size: .85rem; }
.trait-chip.bad { border-color: #c0504a; }
.create-screen.create-traits .create-right { overflow-y: auto; justify-content: flex-start; }
.create-screen.create-traits .create-nav { position: sticky; bottom: 0; background: var(--bg, #14100f); padding: 8px 0; margin-top: 4px; }
/* (Players 2026-11-14: on a computer the reroll sat under the nine cards, below the window's edge on a screen
   of 1280×800 or a 1920 one scaled up, reached only by scrolling.) Beside a portrait, the reroll and its count
   come up between the gifts / flaws tabs and the cards, always in view near them; on a short window the cards
   are a little lower. */
@media (min-width: 701px), (orientation: landscape) {
  .trait-panel > .trait-row { order: 1; }
  .trait-panel > .trait-grid { order: 2; }
  .trait-panel > .trait-warn { order: 3; }
  .trait-panel > .trait-detail { order: 4; }
  .trait-row .trait-reroll { min-height: 44px; }
}
@media (min-width: 701px) and (max-height: 760px), (orientation: landscape) and (max-height: 760px) {
  .trait-card { min-height: 88px; padding-top: 20px; }
  .create-screen.create-traits .create-right { gap: 10px; padding-block: 10px; }
}
@media (max-width: 700px) and (orientation: portrait) {
  .create-screen.create-traits { grid-template-rows: auto minmax(0, 1fr); }
  .create-screen.create-traits .create-left { padding: 6px; flex-direction: row; gap: 10px; justify-content: flex-start; }
  .create-screen.create-traits .create-portrait { width: calc(var(--vw, 1vw) * 18); height: calc(var(--vw, 1vw) * 18); }
  .create-screen.create-traits .create-sum { font-size: .9rem; text-align: left; }
  .create-screen.create-traits .create-right { padding: 8px 10px; gap: 8px; }
  .create-screen.create-traits .create-right h2 { font-size: 1.1rem; }
  .trait-card { min-height: 92px; }
}

/* A phone held sideways: the animation and the vitals on the left (name and
   speed on top, the stats below the scene), the windows on the right. */
@media (pointer: coarse) and (orientation: landscape) and (max-height: 620px) {
  .screen.game { max-width: none; height: calc(var(--vh, 1vh) * 100); height: calc(var(--vh, 1dvh) * 100); min-height: 0; display: grid; grid-template-columns: minmax(0, 46%) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; }
  .topbar { grid-column: 1; grid-row: 1; padding: 3px 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; }
  .who { display: block; flex: 1 1 100%; min-width: 0; }
  .who strong { display: block; font-size: 1rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .who-line { display: block; font-size: 0.78rem; line-height: 1.25; }
  .speed { flex: 1 1 100%; display: flex; gap: 2px; }
  .speed button { flex: 1 1 0; min-width: 0; min-height: 30px; padding: 2px 0; font-size: 0.75rem; }
  .screen.game > .scene { grid-column: 1; grid-row: 2; height: auto; min-height: 0; }
  .shared-view .scene { height: min(calc(var(--vh, 1vh) * 64), 360px); min-height: 160px; }
  .stats { grid-column: 1; grid-row: 3; padding: 2px 8px; gap: 2px; max-height: none; overflow: hidden; }
  .stats .stat-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0 2px; text-align: center; font-size: 0.7rem; line-height: 1.15; }
  .stats .stat-row i { display: block; font-size: 0.62rem; }
  .stats .stat-row small { display: none; }
  .stats .bars { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 8px; }
  .stats .bar { font-size: 0.66rem; gap: 0 3px; }
  .stats .bar .track { height: 6px; }
  .stats .meta-row { font-size: 0.68rem; gap: 0 8px; flex-wrap: nowrap; }
  .stats .meta-row .focus button { padding: 0 6px; min-height: 22px; font-size: 0.68rem; }
  /* (The tabs only as tall as their icons and names: the panel reaches down beside the stats to
     them, never a blank band under the tabs where the stats are taller; the owner 2026-11-12.) */
  .screen.game .panel { grid-column: 2; grid-row: 1 / 4; min-height: 0; flex: none; overflow: auto; border-left: 1px solid var(--line); margin-bottom: calc(var(--tabs-side-h) + calc(env(safe-area-inset-bottom, 0px) / var(--zoom, 1))); }
  .screen.game .tabs { grid-column: 2; grid-row: 3; align-self: end; height: calc(var(--tabs-side-h) + calc(env(safe-area-inset-bottom, 0px) / var(--zoom, 1))); box-sizing: border-box; position: static; border-left: 1px solid var(--line); display: flex; overflow: hidden; }
  .screen.game { --tabs-side-h: 50px; }
  .screen.game .tabs button { flex: 1 1 0; min-width: 0; padding: 6px 1px; font-size: 0.72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
/* The title menu on a short screen: tighter, so the panels keep their height. */
@media (max-height: 520px) {
  .title-menu { bottom: 20px; gap: 4px; }
  .title-menu button { padding: 3px 8px; font-size: 0.82rem; min-height: 30px; box-shadow: inset 0 0 0 2px #241a1c, inset 0 0 0 3px #7b6450, 0 2px 0 #0d0a0b; }
  .title-menu .given-input { padding: 3px 8px; min-height: 30px; }
  .title-menu .gender-pick button { min-height: 30px; }
  .title-screen .warning { bottom: 4px; font-size: 0.62rem; }
}
/* Held sideways, a phone is asked to turn upright (once; it can be waved away). */
.rotate-hint { display: none; position: fixed; inset: 0; z-index: 90; place-items: center; align-content: center; gap: 12px; text-align: center; padding: 24px; background: rgb(8 8 12 / 0.92); color: #f1e9d2; }
.rotate-hint .rot-icon { font-size: 3rem; }
@media (pointer: coarse) and (orientation: landscape) and (max-height: 620px) {
  body.playing:not(.rot-ok):not(.kb-open) .rotate-hint { display: grid; }
}

/* Called by name: a red mark, like a phone's notification, until read. */
.tabs button.mentioned::after, .world-tabs button.mentioned::after {
  content: "!"; display: inline-block; margin-left: 4px; min-width: 1.2em; height: 1.2em; line-height: 1.2em; text-align: center;
  font-size: 0.75em; font-weight: 700; color: #fff; background: #d8262c; border-radius: 50%; vertical-align: 1px;
}
.chat-line.called { background: rgba(216, 38, 44, 0.12); border-left: 3px solid #d8262c; padding-left: 4px; }
.chat-reacts { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; margin: 2px 0 4px 0; }
.chat-reacts button { padding: 0 6px; min-height: 22px; font-size: 0.8rem; line-height: 1.3; border-radius: 12px; }
.chat-reacts .react-add { opacity: 0.55; }
.chat-reacts .react-pill.mine { outline: 2px solid var(--cinnabar, #c0392b); }
/* The report flag beside the reactions' button (ui.js reportButton): once
   reported it stays shown, lit like a reaction of one's own. */
.chat-reacts .react-report.reported, .chat-line .chat-reacts .react-report.reported { opacity: 0.9; outline: 2px solid var(--cinnabar, #c0392b); cursor: default; }
.react-picker { display: inline-flex; gap: 2px; background: var(--paper, #fff); border: 1px solid var(--line, #888); border-radius: 14px; padding: 2px 4px; }
.react-picker button { border: 0; background: none; font-size: 1.1rem; box-shadow: none; }

/* The player's pause: every animation holds where it is. */
body.frozen *, body.frozen *::before, body.frozen *::after { animation-play-state: paused !important; }
.scene.held *, .scene.held *::before, .scene.held *::after { animation-play-state: paused !important; }
/* Another player's shared moment plays on while paused (ui.js sharedView). */
body.frozen .shared-view *, body.frozen .shared-view *::before, body.frozen .shared-view *::after { animation-play-state: running !important; }
/* So does a rift on screen (freeze.js leaves its stage running too, 2026-10-26: a paused player's rift stood still). */
body.frozen .rift-stage *, body.frozen .rift-stage *::before, body.frozen .rift-stage *::after { animation-play-state: running !important; }
/* So does the gathering place (2026-11-16: a paused player stepping into the clothing house was left under the
   held fade, a black screen; the gacha's reveal held too). */
body.frozen .lobby *, body.frozen .lobby *::before, body.frozen .lobby *::after { animation-play-state: running !important; }
.chat-older { justify-self: center; min-height: 32px; padding: 2px 12px; font-size: 0.85rem; }
.announce-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 60; display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 8px 14px; background: #f3d27a; color: #1a1408; font-weight: 700; box-shadow: 0 2px 8px rgb(0 0 0 / 0.4); overflow-wrap: anywhere; }
.announce-bar button { color: inherit; min-width: 32px; min-height: 32px; }
/* An update on the way (src/update-notice.js): a slim bar over the top of the page; the page moves down by its
   height (--upd-h, measured by ui.js) and the game's screen is that much shorter, so nothing is under it. */
.update-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 60; display: flex; gap: 8px; align-items: center; padding: 3px 12px; background: #f3d27a; color: #1a1408; font-size: 0.8rem; line-height: 1.3; box-shadow: 0 1px 4px rgb(0 0 0 / 0.3); }
html.has-upd body { padding-top: var(--upd-h, 0px); }
html.has-upd .announce-bar { top: var(--upd-h, 0px); }
@media (min-width: 900px) { html.has-upd .screen.game { height: calc(var(--vh, 1vh) * 100 - var(--upd-h, 0px)); } }
@media (max-width: 899px) and (orientation: portrait) { html.has-upd .screen.game { height: calc(var(--app-h, calc(var(--vh, 1dvh) * 100)) - var(--upd-h, 0px)); } }
@media (pointer: coarse) and (orientation: landscape) and (max-height: 620px) { html.has-upd .screen.game { height: calc(var(--vh, 1dvh) * 100 - var(--upd-h, 0px)); } }
.update-bar.due { background: #e8893a; }
.update-bar .update-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.update-bar .update-text strong { font-variant-numeric: tabular-nums; }
.update-bar button { color: inherit; flex: none; }
.update-bar .update-save { min-height: 32px; padding: 2px 8px; line-height: 1.2; font-size: 0.78rem; background: #fff8e2; border-color: #8a6a20; color: #1a1408; }
.update-bar .update-close { min-width: 32px; min-height: 32px; padding: 0; }
/* A lucky encounter's cutscene: letterbox bars over the scene. */
/* The bars are always there, closed; they slide in and out, never pop. */
.scene::before, .scene::after { content: ""; position: absolute; left: 0; right: 0; height: 0; background: #000; z-index: 30; pointer-events: none; transition: height 0.6s ease-in-out; }
.scene::before { top: 0; }
.scene::after { bottom: 0; }
.scene.cutscene::before, .scene.cutscene::after { height: 12%; }
/* A choice up: the bars draw back, nothing black over the moment or near
   the answers (the scene is held still meanwhile). */
body:has(#choice:not([hidden])) .scene.cutscene::before, body:has(#choice:not([hidden])) .scene.cutscene::after { height: 0; }
/* The rift or the arena opened over a cutscene (a decision folded away for
   it): no bars over their own clock, head count and leave button. */
.scene.cutscene.rift-on::before, .scene.cutscene.rift-on::after, .scene.cutscene.arena-on::before, .scene.cutscene.arena-on::after { height: 0; }
.scene.cutscene.rift-on > .caption, .scene.cutscene.arena-on > .caption { visibility: hidden; }
body:has(#choice:not([hidden])) .scene.cutscene .scene-text { top: 6px; }
body:has(#choice:not([hidden])) .scene.cutscene .bug-btn, body:has(#choice:not([hidden])) .scene.cutscene .chat-float-btn, body:has(#choice:not([hidden])) .scene.cutscene .chat-dock-btn { bottom: 8px; }
/* What sits at the top of the scene (the place and what the hero is doing,
   the caption, the corner buttons) moves down with the bar, never under it. */
.scene-text { transition: top 0.6s ease-in-out; }
/* The corner buttons sit at the bottom right, clear of the place's words at
   the top; in a cutscene they rise above the lower bar and its subtitle. */
.bug-btn, .chat-float-btn, .chat-dock-btn { transition: bottom 0.6s ease-in-out; }
.scene.cutscene .scene-text { top: calc(12% + 6px); }
/* In a cutscene the caption is a subtitle in the lower bar, clear of the
   people and their words. */
.scene.cutscene > .caption { top: auto; bottom: 3px; z-index: 31; background: rgb(8 10 14 / 0.55); border-radius: 6px; padding: 3px 10px; color: #f4efe2; text-align: center; text-shadow: 0 1px 2px #000, 0 0 3px #000; }
.scene.cutscene .bug-btn, .scene.cutscene .chat-float-btn, .scene.cutscene .chat-dock-btn { bottom: calc(12% + 40px); }
/* In a cutscene only the story is on stage: no prop of the month's chores, no friend standing by. */
.scene.cutscene .idle-prop, .scene.cutscene .idle-npc { visibility: hidden; }
.lucky-tag { display: block; color: var(--gold); font-weight: 700; letter-spacing: 0.02em; }

/* The town shop and the auction notice (src/shop-ui.js) */
.shop-card { width: min(560px, 100%); display: grid; gap: 8px; }
.shop-list { display: grid; gap: 6px; max-height: calc(var(--vh, 1vh) * 52); overflow-y: auto; }
.shop-row { display: grid; grid-template-columns: 44px 1fr auto; gap: 8px; align-items: center; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.shop-row .sq { display: grid; place-items: center; width: 40px; height: 40px; border: 3px solid var(--line); border-radius: 8px; }
.shop-body { display: grid; gap: 1px; min-width: 0; }
.shop-eff { color: var(--muted); font-size: 0.78rem; }
.shop-sell { display: grid; gap: 4px; }
.shop-note { font-size: 0.78rem; }
.shop-entry, .auction-notice { margin-top: 8px; display: grid; gap: 6px; }
.auction-notice { padding: 8px; border: 1px solid var(--gold); border-radius: 8px; background: var(--surface); }

/* The admin's character editor (src/admin-edit.js). */
.ae-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.ae-row > span { flex: 1 1 8em; }
.ae-row > input:not([type=checkbox]), .ae-row > select { flex: 1 1 9em; min-width: 0; width: auto; margin: 0; padding: 6px; font: inherit; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); }
.ae-checks { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.ae-check { display: inline-flex; align-items: center; gap: 4px; }
.ae-check.bad span { color: var(--danger, #b8353a); }
.ae-msg { color: var(--danger, #b8353a); min-height: 1.2em; margin: 0; }
.ae-status { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 0.9em; }
.ae-st-applied { color: var(--good, #2e7d4f); }
.ae-st-refused { color: var(--danger, #b8353a); }

/* An art's element under its name (ui.js iconCell). */
.icon-cell small.el-tag { font-weight: 600; }
.icon-cell small.scroll-tag { color: #7a5a0c; }
/* (Light ground: the elements deepened to ≥4.5:1, players 2026-11-14 "yellow letters can't be seen"; the night
   theme and the dark windows keep the bright ones.) */
.el-metal { color: #6f5f10 !important; } .el-wood { color: #2f7a3a !important; } .el-water { color: #2563a8 !important; }
.el-fire { color: #b0401c !important; } .el-earth { color: #7a5626 !important; } .el-lightning { color: #6f45b0 !important; }
.el-ice { color: #1f7486 !important; } .el-wind { color: #246e4c !important; } .el-demonic { color: #a82a44 !important; }
:root[data-theme="dark"] .el-metal { color: #c9b458 !important; } :root[data-theme="dark"] .el-wood { color: #5fae5a !important; } :root[data-theme="dark"] .el-water { color: #4f9bd9 !important; }
:root[data-theme="dark"] .el-fire { color: #e0623a !important; } :root[data-theme="dark"] .el-earth { color: #b0844a !important; } :root[data-theme="dark"] .el-lightning { color: #b48ae8 !important; }
:root[data-theme="dark"] .el-ice { color: #7fd0e0 !important; } :root[data-theme="dark"] .el-wind { color: #7cc8a0 !important; } :root[data-theme="dark"] .el-demonic { color: #c8405a !important; }
.menu-panel .el-metal { color: #c9b458 !important; } .menu-panel .el-wood { color: #5fae5a !important; } .menu-panel .el-water { color: #4f9bd9 !important; }
.menu-panel .el-fire { color: #e0623a !important; } .menu-panel .el-earth { color: #b0844a !important; } .menu-panel .el-lightning { color: #b48ae8 !important; }
.menu-panel .el-ice { color: #7fd0e0 !important; } .menu-panel .el-wind { color: #7cc8a0 !important; } .menu-panel .el-demonic { color: #c8405a !important; }
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) .el-metal { color: #c9b458 !important; } :root:not([data-theme="light"]) .el-wood { color: #5fae5a !important; } :root:not([data-theme="light"]) .el-water { color: #4f9bd9 !important; }
:root:not([data-theme="light"]) .el-fire { color: #e0623a !important; } :root:not([data-theme="light"]) .el-earth { color: #b0844a !important; } :root:not([data-theme="light"]) .el-lightning { color: #b48ae8 !important; }
:root:not([data-theme="light"]) .el-ice { color: #7fd0e0 !important; } :root:not([data-theme="light"]) .el-wind { color: #7cc8a0 !important; } :root:not([data-theme="light"]) .el-demonic { color: #c8405a !important; }
}
:root[data-theme="dark"] .icon-cell small.scroll-tag, .menu-panel .icon-cell small.scroll-tag { color: #c9a24a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .icon-cell small.scroll-tag { color: #c9a24a; } }

/* The Dimensional Rift (src/rift-stage.js): a show of travel, gathering, jump, realms and a boss. */
.rift-stage { position: relative; overflow: hidden; background: #0b0a14; --rpx: 3px; }
.rift-actors, .rift-fx, .rift-labels { position: absolute; inset: 0; pointer-events: none; }
.rift-stage .rf-lab { position: absolute; width: 0; height: 0; }
.rift-stage .rf { position: absolute; width: 0; height: 0; }
.rift-stage .rf .npc { left: 0; bottom: 0; }
/* on the way through the sky (rift-stage.js seat): the auspicious cloud under a rider and those it carries,
   in front of their feet; a rider bobs a pixel or two with it */
.rift-stage .rf-cloud { position: absolute; background-repeat: no-repeat; image-rendering: pixelated; image-rendering: crisp-edges; pointer-events: none; }
.rift-stage .rf.aloft { animation: rfbob 2.8s ease-in-out infinite; }
@keyframes rfbob { 50% { translate: 0 calc(var(--rpx) * -1); } }
.less-motion .rift-stage .rf.aloft { animation: none; }
.rift-stage .rf-lab.talking { z-index: 2900 !important; }
.rf-tag { position: absolute; left: 0; bottom: calc(var(--rpx) * 36 + 2px); transform: translateX(-50%); white-space: nowrap; padding: 0 5px; font-size: 0.7rem; line-height: 1.5; color: #f4efe2; background: rgb(16 18 24 / 0.62); border-radius: 3px; opacity: 0; transition: opacity 0.25s; pointer-events: none; z-index: 3; }
.rf-tag.show { opacity: 1; }
.rf-lab.me .rf-tag { color: #bff0dc; }
.rf-lab.side-dark .rf-tag { color: #ffb8aa; }
.rf-lab.side-light .rf-tag { color: #d6f5d0; }
.rf-tag.mon { color: #ffe08a; bottom: calc(var(--rpx) * 40 + 4px); }
.rf-tag.mon.boss { color: #ffb0a0; font-weight: 600; bottom: calc(var(--rpx) * 62 + 4px); }
.rf-hp { position: absolute; left: calc(var(--rpx) * -10); bottom: calc(var(--rpx) * -3); width: calc(var(--rpx) * 20); height: 3px; background: rgb(0 0 0 / 0.55); border-radius: 2px; overflow: hidden; }
.rf-hp i { display: block; height: 100%; width: 100%; background: #5ed06a; transition: width 0.6s; }
.rf-hp.low i { background: #e0503c; }
.rf-say { position: absolute; left: 0; bottom: calc(var(--rpx) * 36 + 20px); transform: translateX(-50%); width: max-content; max-width: 132px; padding: 3px 8px; border-radius: 9px; background: #fffdf4; color: #2a2620; font-size: 0.72rem; line-height: 1.3; text-align: center; box-shadow: 0 1px 4px rgb(0 0 0 / 0.4); z-index: 4; animation: riftsay 0.25s ease-out; }
.rf-say::after { content: ""; position: absolute; left: 50%; bottom: -5px; margin-left: -5px; border: 5px solid transparent; border-top-color: #fffdf4; border-bottom: 0; }
@keyframes riftsay { from { opacity: 0; scale: 0.7; } }
.rift-pop { position: absolute; transform: translateX(-50%); font-size: 1.1rem; line-height: 1; text-shadow: 0 1px 3px rgb(0 0 0 / 0.5); animation: riftpop 1.6s ease-out forwards; z-index: 3000; white-space: nowrap; }
.rift-pop.big { font-size: 1.7rem; }
.rift-pop.label { font-size: 0.75rem; color: #fff; background: rgb(0 0 0 / 0.6); padding: 1px 8px; border-radius: 4px; }
@keyframes riftpop { 0% { translate: 0 0; opacity: 0; scale: 0.5; } 15% { opacity: 1; scale: 1.2; } 100% { translate: 0 -34px; opacity: 0; } }
.rift-mon { position: absolute; width: 0; height: 0; }
.rift-mon .px { left: 0; bottom: 0; translate: -50% 0; }
.rift-mon .npc { left: 0; bottom: 0; }
.rift-trial { position: absolute; transform: translateX(-50%); font-size: 2.2rem; line-height: 1; filter: drop-shadow(0 0 8px #ffd36a); animation: riftfloat 2s ease-in-out infinite; z-index: 800; }
.rift-trial.dark { filter: drop-shadow(0 0 9px #e02838); }
@keyframes riftfloat { 50% { translate: 0 -6px; } }
.rift-bolt { position: absolute; width: 14px; height: 4px; border-radius: 2px; background: linear-gradient(90deg, transparent, #fff6b0, #ffb040); box-shadow: 0 0 8px #ffd070; z-index: 3000; }
.rift-title { z-index: 1; pointer-events: none; position: absolute; left: 0; right: 0; top: 58px; padding: 6px 12px; text-align: center; font: 600 1.15rem var(--font-display, serif); color: #fff; text-shadow: 0 2px 6px #000; background: linear-gradient(90deg, transparent, rgb(0 0 0 / 0.65), transparent); z-index: 20; pointer-events: none; }
.rift-title.boss { color: #ffc4b4; }
.rift-title.boss.lose { color: #c8c8d4; }
.rift-where { position: absolute; left: 8px; top: 8px; max-width: calc(100% - 16px); box-sizing: border-box; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 2px 8px; border-radius: 4px; background: rgb(0 0 0 / 0.55); color: #fff; font-size: 0.78rem; z-index: 10; }
.rift-bossbar { position: absolute; left: 12px; right: 12px; top: 34px; z-index: 10; color: #fff; font-size: 0.74rem; text-shadow: 0 1px 2px #000; }
.rift-bossbar span { display: block; height: 8px; margin-top: 2px; background: rgb(0 0 0 / 0.6); border: 1px solid rgb(255 255 255 / 0.35); border-radius: 4px; overflow: hidden; }
.rift-bossbar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #a01828, #e04a3a); transition: width 0.8s; }
.rift-veil { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity 0.4s; z-index: 40; }
.rift-veil.on { opacity: 1; }
/* sized and placed by rift-stage.js portalSize: inside the gate's mouth, or growing in the sky on the way */
.rift-portal { position: absolute; translate: -50% 0; z-index: 0; pointer-events: none; filter: drop-shadow(0 0 10px #8a4cff); }
.rift-portal i { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, #1a0a3a, #7a3cff, #1ee0ff, #1a0a3a, #d050ff, #1a0a3a); animation: riftspin 3.2s linear infinite; -webkit-mask: radial-gradient(closest-side, transparent 22%, #000 40%, #000 62%, transparent 100%); mask: radial-gradient(closest-side, transparent 22%, #000 40%, #000 62%, transparent 100%); }
.rift-portal i:nth-child(2) { inset: 12%; animation-duration: 2.1s; animation-direction: reverse; opacity: 0.9; }
.rift-portal i:nth-child(3) { inset: 26%; background: radial-gradient(circle, #05010f 40%, #5a2cc8 75%, transparent 100%); -webkit-mask: none; mask: none; animation: none; }
.rift-portal.pulse { animation: riftpulse 0.8s ease-out; }
@keyframes riftspin { to { rotate: 360deg; } }
@keyframes riftpulse { 40% { filter: drop-shadow(0 0 30px #fff) brightness(1.8); scale: 1.12; } }
.rift-stage[data-mode="map"] .rift-portal { display: none; }
.less-motion .rift-portal i, .less-motion .rift-trial { animation: none; }
/* the rift's overlay: the stage above, the roster and the log below */
.rift-card { width: min(960px, 100%); display: grid; gap: 8px; }
.rift-card .rift-stage { height: calc(var(--vh, 1vh) * 42); min-height: 230px; border-radius: 6px; }
.rift-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.rift-top h2 { margin: 0; font-size: 1.05rem; color: var(--jade); }
.rift-top .rift-clock { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 0.85rem; }
.rift-roster { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 3px 8px; font-size: 0.76rem; }
.rift-roster li { display: grid; gap: 1px; min-width: 0; }
.rift-roster li b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.rift-roster li.me b { color: var(--gold); }
.rift-roster li.out { opacity: 0.45; }
.rift-roster li.side-dark b::after { content: " ☯"; color: #c0392b; }
.rift-roster li.side-light b::after { content: " ☯"; color: var(--jade); }
.rift-log { margin: 0; padding-left: 18px; display: grid; gap: 3px; font-size: 0.8rem; max-height: calc(var(--vh, 1vh) * 24); overflow-y: auto; }
.rift-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rift-result { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; display: grid; gap: 4px; font-size: 0.85rem; }
.rift-chip { position: fixed; right: 8px; bottom: 8px; z-index: 31; box-shadow: 0 2px 8px rgb(0 0 0 / 0.35); }
.life-tabs { margin: 0; }
/* The Life tab's row: its sub tabs, and rename / the admins' editor at the right. */
.life-head { display: flex; align-items: center; gap: 8px; margin: 2px 0 2px; min-width: 0; max-width: 100%; }
.life-head .life-tabs { flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.life-head .life-tabs::-webkit-scrollbar { display: none; }
.life-head .life-tabs > button { flex: 0 0 auto; }
.life-acts { margin-left: auto; display: flex; gap: 12px; align-items: center; flex: 0 0 auto; }
.life-acts .link { width: auto; min-height: 0; padding: 2px 4px; font-size: 0.85rem; }

/* The rift in the main scene (ui.js): the stage fills it, a strip along the bottom, the happenings in the Log. */
.rift-stage.rift-main { position: absolute; inset: 0 0 38px 0; z-index: 3; }
.scene.rift-on .figure, .scene.rift-on .idle-npc, .scene.rift-on .idle-prop, .scene.rift-on .extras, .scene.rift-on .name-tag.hero { visibility: hidden; }
.scene.rift-on #doing { display: none; }
.rift-bar { z-index: 6; font-size: 0.78rem; line-height: 1.3; padding: 3px 8px; left: 0; right: 0; bottom: 0; border-radius: 0; border-width: 1px 0 0; background: #14121c; max-height: 36px; overflow: hidden; }
.rift-bar .rift-clock { flex: 1 1 auto; min-width: 0; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rift-bar button { min-height: 26px; padding: 1px 8px; }
#log details[data-rift] > summary { color: var(--jade); font-weight: 600; }
#log li.rift-line.big { font-weight: 600; }

/* The rewards table (ui.js rewardsCard): over the stage when the run ends, and again in the World tab / a panel. */
.rift-reward-wrap { position: absolute; left: 6px; right: 6px; bottom: 6px; z-index: 5000; max-height: calc(100% - 12px); overflow-y: auto; }
.rift-reward { display: grid; gap: 4px; padding: 6px 8px; border: 1px solid var(--gold); border-radius: 8px; background: color-mix(in srgb, var(--surface) 92%, transparent); color: var(--ink); }
.rift-reward-wrap .rift-reward { background: rgb(20 18 28 / 0.97); color: #f2ecdc; --ink: #f2ecdc; --muted: #b8b0a0; --surface: #2a2638; --line: #5a5270; }
.rift-reward h4 { margin: 0; font-size: 0.85rem; }
.rift-reward .icon-grid { display: flex; flex-wrap: wrap; gap: 2px; }
.rift-reward .icon-cell { width: 66px; padding: 2px; cursor: pointer; }
.rift-reward .icon-cell small { font-size: 0.6rem; line-height: 1.15; }
.rift-reward .icon-cell .sq { width: 40px; height: 40px; }
.rift-reward .icon-cell .sq img, .rift-reward .icon-cell .sq canvas { max-width: 30px; max-height: 30px; }
.rift-reward .rift-none { margin: 0; font-weight: 600; }
.rift-reward button:not(.icon-cell) { justify-self: start; min-height: 28px; padding: 2px 10px; }

/* Pixel icons in the rift (src/art/rift-icons.js): no emoji on the stage, in the strip, the log or the rewards. */
.pxi-canvas, .rift-ico { image-rendering: pixelated; }
.rift-ico { display: inline-block; vertical-align: -0.2em; background-size: 100% 100%; background-repeat: no-repeat; }
.rift-pop canvas { display: block; filter: drop-shadow(0 1px 2px rgb(0 0 0 / 0.6)); }
.rift-pop.dmg { color: #ff8a78; font-weight: 700; font-size: 0.95rem; text-shadow: 0 1px 2px #000; }
.rift-trial canvas { display: block; }
.rf-mhp { position: absolute; left: 0; bottom: calc(var(--rpx) * 41 + 6px); transform: translateX(-50%); width: 46px; height: 5px; background: rgb(0 0 0 / 0.6); border: 1px solid rgb(0 0 0 / 0.7); border-radius: 3px; overflow: hidden; z-index: 3; }
.rf-mhp i { display: block; height: 100%; width: 100%; background: linear-gradient(#ff7a5a, #d8382a); transition: width 0.35s; }
.rift-bossbar.rage i { background: linear-gradient(#ff9a3a, #e02818); }
.rift-mon.enraged { filter: drop-shadow(0 0 6px #ff3b20) saturate(1.3); }

/* The foes of the trials (src/art/rift-foes.js): figures of their own, idle-bobbing, with a life bar like a monster. */
.rift-mon .rift-foe { position: relative; left: 0; bottom: 0; translate: -50% 0; background-size: 100% 100%; background-repeat: no-repeat; image-rendering: pixelated; animation: riftfoe 2.2s ease-in-out infinite; transform-origin: 50% 100%; }
.rift-mon .rift-foe.ghost { opacity: 0.9; filter: drop-shadow(0 0 5px var(--glow, #bfe8ff)); }
.rift-mon .rift-foe:not(.ghost):not(.shadow) { filter: drop-shadow(0 0 4px var(--glow, transparent)); }
.rift-mon .rift-foe.shadow { filter: brightness(0.22) sepia(1) hue-rotate(228deg) saturate(4) drop-shadow(0 0 7px #8a3aff); animation-name: riftfoe; }
.rift-mon.haze::before { content: ""; position: absolute; translate: none; left: -48px; bottom: -6px; width: 96px; height: 92px; background: radial-gradient(closest-side, rgb(138 58 255 / 0.5), rgb(80 20 160 / 0.22) 60%, transparent); filter: blur(3px); pointer-events: none; }
@keyframes riftfoe { 0%, 100% { translate: -50% 0; } 50% { translate: -50% -3px; } }

/* While a rift show is on, nothing of the life's own scene shows through: its captions, names and passers-by. */
.scene.rift-on .scene-text, .scene.rift-on .caption, .scene.rift-on .passers, .scene.rift-on .name-tags, .scene.rift-on .extras, .scene.rift-on .fx-layer.life { visibility: hidden; }
#log details[data-rift] { margin: 4px 0 2px; border-left: 2px solid var(--jade); padding-left: 6px; }

/* ---- iPhone (Safari, Dynamic Island, viewport-fit=cover) ---- */
/* iOS zooms the page when a field under 16px takes focus, and stays zoomed: everything then looks big. */
@media (pointer: coarse) { input, textarea, select { font-size: 16px; } }
@media (max-width: 899px) {
  /* The top bar clears the island/status bar; the tab bar clears the home indicator. */
  .topbar { padding-top: max(6px, calc(env(safe-area-inset-top, 0px) / var(--zoom, 1))); }
  .screen.game .tabs { padding-bottom: calc(env(safe-area-inset-bottom, 0px) / var(--zoom, 1)); }
  /* A long qi line (Thai) wraps inside its column instead of pushing the page wider than the screen. */
  .bars > .bar { min-width: 0; grid-template-columns: auto minmax(0, 1fr); }
  .bar em { white-space: nowrap; text-align: right; min-width: 0; overflow-wrap: anywhere; line-height: 1.25; }
  .bar > span { min-width: 0; line-height: 1.25; }
  /* Lifespan and health share the line half and half; qi has a line of its own. */
  .bars { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #qi-row { grid-column: 1 / -1; }
  #qi-row em { white-space: normal; }
  /* (1vh as the fallback: a var() falling back to dvh where dvh is unknown, old
     Safari, dropped the height and the dock grew past the top of the screen.) */
  .chat-dock { top: auto; height: calc(var(--vh, 1vh) * 42); bottom: max(8px, calc(env(safe-area-inset-bottom, 0px) / var(--zoom, 1))); left: max(8px, calc(env(safe-area-inset-left, 0px) / var(--zoom, 1))); max-height: calc(100% - 16px); }
  .menu-panel > section { max-height: calc(calc(var(--vh, 1vh) * 100) - 32px); max-height: calc(calc(var(--vh, 1dvh) * 100) - 32px); }
  .rotate-hint { padding-block: max(24px, calc(env(safe-area-inset-top, 0px) / var(--zoom, 1))) max(24px, calc(env(safe-area-inset-bottom, 0px) / var(--zoom, 1))); }
}
/* Held sideways, the notch is on a short side: keep content out of it. */
@media (pointer: coarse) and (orientation: landscape) and (max-height: 620px) {
  .topbar { padding-left: max(8px, calc(env(safe-area-inset-left, 0px) / var(--zoom, 1))); padding-top: 3px; }
  .stats { padding-left: max(8px, calc(env(safe-area-inset-left, 0px) / var(--zoom, 1))); }
  .stats #qi-row { grid-column: auto; }
  /* (The figures in full, the bar giving way: an ellipsis hid the qi percentage, players 2026-10-26.) */
  .stats .bars > .bar { grid-template-columns: auto minmax(12px, 1fr) max-content; column-gap: 4px; }
  .stats .bar em, .stats #qi-text { white-space: nowrap; overflow: visible; max-width: none; }
  .screen.game .panel { padding-right: max(var(--gutter-r), calc(env(safe-area-inset-right, 0px) / var(--zoom, 1))); }
  .screen.game .tabs { padding-right: calc(env(safe-area-inset-right, 0px) / var(--zoom, 1)); padding-bottom: calc(env(safe-area-inset-bottom, 0px) / var(--zoom, 1)); }
  .scene-text { left: max(8px, calc(env(safe-area-inset-left, 0px) / var(--zoom, 1))); }
  .chat-dock { height: calc(var(--vh, 1vh) * 70); }
}
@supports (height: 1dvh) {
  @media (max-width: 899px) { .chat-dock { height: calc(var(--vh, 1dvh) * 42); } }
  @media (pointer: coarse) and (orientation: landscape) and (max-height: 620px) { .chat-dock { height: calc(var(--vh, 1dvh) * 70); } }
}
/* Choosing many at once (openBulk): ticks, icons, names. */
.bulk-list { display: grid; gap: 4px; margin: 8px 0; max-height: calc(var(--vh, 1vh) * 50); overflow-y: auto; }
.bulk-row { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.bulk-row input { width: 20px; height: 20px; flex: none; }
.bulk-row span { font-size: 0.9rem; }
.bulk-tools { display: flex; gap: 12px; }
/* Rowing (scene.js boat): a little window of open water over the scene. */
.fx-layer .boat-inset { position: absolute; left: 50%; top: 6%; width: min(48%, 280px); aspect-ratio: 16 / 9; transform: translateX(-50%); overflow: hidden; z-index: 4;
  border: 3px solid #1c1820; border-radius: 6px; box-shadow: 0 3px 0 rgba(0,0,0,.35); background: linear-gradient(#a9d8ee 0%, #dff2f8 50%, #2f6f9a 50%, #24557a 100%); image-rendering: pixelated; }
.boat-inset .bi-far { position: absolute; left: 0; right: 0; bottom: 50%; height: 22%; background: #6f9a8a; clip-path: polygon(0 100%, 0 60%, 12% 25%, 24% 55%, 38% 10%, 52% 50%, 66% 20%, 80% 60%, 92% 30%, 100% 55%, 100% 100%); }
.boat-inset .bi-water { position: absolute; left: 0; right: 0; bottom: 0; height: 50%; }
.boat-inset .bi-wave { position: absolute; left: -40px; right: -40px; height: 3px; background: repeating-linear-gradient(90deg, #cfeaf5 0 10px, transparent 10px 26px); animation: bi-waves 1.6s linear infinite; opacity: .8; }
.boat-inset .bi-wave0 { top: 18%; }
.boat-inset .bi-wave1 { top: 48%; animation-duration: 2.2s; animation-direction: reverse; }
.boat-inset .bi-wave2 { top: 78%; animation-duration: 1.2s; }
@keyframes bi-waves { from { transform: translateX(0); } to { transform: translateX(26px); } }
.boat-inset .bi-skiff { position: absolute; left: 30%; bottom: 22%; width: 40%; height: 46%; }
.boat-inset .bi-hull { position: absolute; left: 0; right: 0; bottom: 0; height: 26%; background: linear-gradient(#8a5c36, #553620); border-radius: 0 0 45% 45%; border-top: 2px solid #b07a4a; }
.boat-inset .bi-rower { left: 30% !important; bottom: 14% !important; transform-origin: 50% 100%; }
.boat-inset .bi-oar { position: absolute; left: 62%; bottom: 8%; width: 3px; height: 70%; background: #c9a06a; transform-origin: 50% 85%; box-shadow: 0 0 0 1px #3a2a1a; }

/* The encyclopedia's search box. */
.cx-search { width: 100%; box-sizing: border-box; margin: 6px 0; padding: 8px 10px; font-size: 16px; border: 1px solid var(--line); border-radius: 8px; background: rgba(0, 0, 0, 0.35); color: inherit; }
.cx-search::placeholder { color: inherit; opacity: 0.55; }

/* An auction lot's card (ui.js lotCard): picture, grade, details folded. */
.lot-card { margin: 4px 0 10px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; background: color-mix(in srgb, var(--surface) 90%, var(--gold, #c9a227) 10%); }
.lot-card .cx-entry { margin: 0; border-left-width: 3px; }
.lot-card .lot-toggle { margin-top: 4px; font-size: 0.8rem; min-height: 28px; padding: 2px 10px; }
.lot-card .lot-more { margin: 6px 0 0 4px; font-size: 0.88rem; }
.lot-card .lot-more p { margin: 2px 0; }

/* The way of arts (ui.js pickDao): a way tapped shows what it does and its arts. */
.dao-grid button.picked { outline: 2px solid var(--jade); }
.dao-detail { margin: 10px 0; display: grid; gap: 6px; }
.dao-detail:empty { display: none; }
.dao-detail h3 { margin: 0; }
.dao-effects { margin: 0; padding-left: 18px; font-size: 0.85rem; }
.dao-arts { display: flex; flex-wrap: wrap; gap: 4px; font-size: 0.75rem; }
.dao-arts span { padding: 1px 6px; border: 1px solid var(--line); border-radius: 10px; }
.dao-arts span.known { border-color: var(--jade); color: var(--jade); font-weight: 600; }

/* A test's stat and how hard it looks, under a choice (ui.js oddsBand). */
#choice-options button small.odds { display: block; margin-top: 2px; font-size: 0.75rem; font-weight: 600; color: var(--muted); }
/* What the test weighs: the hero's stat against the level's average, by a tap on
   the info mark or the mouse over the band (ui.js oddsEl). */
#choice-options .odds-info { display: inline-block; min-width: 22px; padding: 0 4px; border-radius: 10px; text-align: center; color: var(--jade); cursor: help; font-weight: 700; }
#choice-options .odds-info:hover, #choice-options .odds-info:focus-visible { background: color-mix(in srgb, var(--jade) 16%, transparent); }
#choice-options .odds-pop { display: none; margin-top: 2px; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
#choice-options small.odds.open .odds-pop { display: block; }
#choice-options .odds-line { display: block; }
#choice-options .odds-why { display: block; font-weight: 500; color: var(--muted); overflow-wrap: anywhere; }
#choice-options small.odds.open .odds-why { display: none; }
@media (hover: hover) { #choice-options small.odds:hover .odds-why { display: none; } }
@media (hover: hover) { #choice-options small.odds:hover .odds-pop { display: block; } }
/* The hero's numbers on the decision card (ui.js choiceStats): the page behind
   is under the card, so they are shown here. The ones a choice tests stand out. */
.choice-stats { display: flex; flex-wrap: wrap; gap: 3px 10px; margin: -2px 0 0; font-size: 0.75rem; color: var(--muted); }
.choice-stats:empty { display: none; }
.choice-stats span { white-space: nowrap; }
.choice-stats i { font-style: normal; }
.choice-stats b { color: var(--ink); }
.choice-stats .tested { color: var(--jade); font-weight: 700; }
.choice-stats .tested b { color: var(--jade); }
#choice-options button small.mission-info { display: flex; flex-direction: column; gap: 1px; margin-top: 3px; font-size: 0.72rem; color: var(--muted); text-align: left; }
#choice-options button small.mission-info .ok { color: var(--jade, #2c6b59); }
#choice-options button small.mission-info .fail, #choice-options button small.mission-info .risk { color: var(--danger, #a33); }
#choice-options button small.cost-tag { display: block; margin-top: 2px; font-size: 0.75rem; font-weight: 600; color: var(--muted); }
/* What a choice changes in the hero's standing (ui.js stakesMark, src/stakes.js), in the odds' small hand. */
#choice-options button small.stakes, .here-ask .here-options button small.stakes { display: block; margin-top: 2px; font-size: 0.75rem; font-weight: 600; color: var(--gold); overflow-wrap: anywhere; }
#choice-options button small.fight-tag { display: block; margin-top: 2px; font-size: 0.75rem; font-weight: 600; color: #c0603a; }
/* The chapter line opens a choice (heading the family). */
.arc.tappable { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }

/* A title the hero wears beside the name (src/life-titles.js); tap the name to choose. */
.who-line .hero-title { width: auto; min-width: 0; min-height: 0; max-width: calc(var(--vw, 1vw) * 60); margin: 0 4px 0 0; padding: 0 8px; border: 1px solid currentColor; border-radius: 999px; background: transparent; box-shadow: none; color: var(--gold, #8f6a12); font: inherit; font-size: inherit; line-height: 1.5; font-weight: 600; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.save-card.locked { opacity: 0.6; }
/* (Players 2026-11-14: the long title covered the bar and could not be read or hit.) The chip stays small and
   cut short, its words in .ht-text; the button itself is never cut, so its hit area reaches 32px+ tall around the
   pill (::after); tapped, the titles page opens with the title worn written whole at its top. */
.who-line .hero-title { position: relative; overflow: visible; max-width: min(16em, calc(var(--vw, 1vw) * 40)); }
.who-line .hero-title > .ht-text { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-line .hero-title::after { content: ""; position: absolute; inset: -8px -3px; }
.title-worn-full { margin: 0; font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; color: #e9c46a; overflow-wrap: anywhere; }

/* The skip button over the scene while a moment or a cutscene plays (ui.js cutSkip). */
.scene-skip { position: absolute; top: 8px; right: 8px; z-index: 30; width: auto; min-width: 0; min-height: 0; padding: 2px 10px; border: 1px solid rgba(255, 255, 255, 0.6); border-radius: 999px; background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 0.95rem; line-height: 1.4; cursor: pointer; box-shadow: none; }
.scene-skip:hover { background: rgba(0, 0, 0, 0.75); }

/* The story journal on the Life tab (ui.js): each story under way and where it goes next. */
.story-journal { margin: 0; display: grid; gap: 6px; }
.story-journal > p.muted { margin: 0; font-size: 0.85rem; }
.story-card > button { justify-self: start; width: auto; min-height: 28px; padding: 2px 16px; margin-top: 2px; }
.story-journal h4 { margin: 4px 0; }
.story-card { display: grid; gap: 2px; padding: 6px 10px; border: 1px solid var(--line); border-left: 4px solid var(--jade, #2c6b59); border-radius: 6px; }
.hh-jobs { display: grid; gap: 2px; margin-top: 2px; }
.hh-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.hh-row > span { flex: 1 1 auto; }
.hh-row > button { width: auto; min-height: 26px; padding: 1px 12px; }
.story-card.shelved { border-left-color: var(--muted, #888); opacity: 0.85; }
.story-card.taken-in { border-left-style: dashed; border-left-color: #d8c27a; }
/* The family's estate from above (src/clan-estate.js): pixels scaled by whole steps. */
.estate { display: grid; justify-items: center; gap: 6px; min-width: 0; max-width: 100%; }
.estate-stage { position: relative; max-width: 100%; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; }
.estate-cv { display: block; image-rendering: pixelated; image-rendering: crisp-edges; cursor: pointer; touch-action: manipulation; }
.estate-card { display: grid; gap: 2px; width: 100%; box-sizing: border-box; padding: 6px 10px; border: 1px solid var(--line); border-left: 4px solid var(--gold, #8f6a12); border-radius: 6px; font-size: 0.9rem; color: var(--muted, inherit); }
.estate-card strong { color: var(--ink); }
.estate-card button { font: inherit; font-size: 0.82rem; padding: 3px 12px; min-height: 28px; margin: 2px 4px 0 0; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); cursor: pointer; }
.estate-floors { display: flex; flex-wrap: wrap; }
/* Inside a building (src/estate-inside.js): its own frame in the estate's
   colours, the heading "Inside: …", the big way back always top left, the
   small map of the estate, so it is never taken for the main scene. */
.estate-inside { position: absolute; inset: 0; z-index: 2; overflow: hidden; box-sizing: border-box; background: #2a1d14; border: 3px solid #b8892c; box-shadow: inset 0 0 0 2px #3d2414; }
.estate-in-cv { position: absolute; left: 0; top: 0; image-rendering: pixelated; image-rendering: crisp-edges; cursor: pointer; touch-action: manipulation; }
.estate-in-head { position: absolute; left: 0; right: 0; top: 0; z-index: 3; display: flex; align-items: center; gap: 8px; min-height: 34px; box-sizing: border-box; padding: 3px 6px; background: #2a1d14; border-bottom: 2px solid #b8892c; color: #f4e2b0; }
.estate-in-title { flex: 1; min-width: 0; display: grid; font-size: 0.86rem; line-height: 1.25; }
.estate-in-line, .estate-in-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.estate-in-title small { color: #d8c690; font-size: 0.8rem; }
.estate-in-sub { color: #e8d9a8; font-size: 0.76rem; }
.estate-back { flex: none; font: inherit; font-weight: 700; font-size: 0.95rem; padding: 3px 12px; min-height: 28px; border: 2px solid #e6c45a; border-radius: 6px; background: #8f2b23; color: #fff6e0; cursor: pointer; touch-action: manipulation; }
.estate-up { flex: none; font: inherit; font-size: 0.8rem; padding: 3px 10px; min-height: 26px; border: 1px solid #e6c45a; border-radius: 999px; background: transparent; color: #f4e2b0; cursor: pointer; }
.estate-mini { position: absolute; right: 6px; bottom: 6px; z-index: 3; width: 100px; height: 60px; image-rendering: pixelated; image-rendering: crisp-edges; border: 2px solid #b8892c; border-radius: 4px; pointer-events: none; }
/* The row of buildings under the estate: tap a name to go inside. */
.estate-row { display: flex; gap: 6px; max-width: 100%; overflow-x: auto; padding: 2px; box-sizing: border-box; scrollbar-width: thin; }
.estate-chip { flex: none; font: inherit; font-size: 0.82rem; padding: 4px 12px; min-height: 30px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); cursor: pointer; white-space: nowrap; touch-action: manipulation; }
.estate-chip.active { background: #8f2b23; color: #fff6e0; border-color: #e6c45a; }
.estate-chip:disabled { opacity: 0.6; cursor: default; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .estate-cv, :root:not([data-theme="light"]) .estate-in-cv { filter: brightness(0.82) saturate(0.9); } }
:root[data-theme="dark"] .estate-cv, :root[data-theme="dark"] .estate-in-cv { filter: brightness(0.82) saturate(0.9); }
.less-motion .estate-cv, .less-motion .estate-in-cv, .less-motion .estate-inside { transition: none !important; }
/* On the scene (ui.js): the estate covers the frame, the picture centred,
   the row of buildings along the bottom, the card above it; the switch above all. */
.estate-host { position: absolute; inset: 0; z-index: 12; overflow: hidden; background: #3a6629; }
.estate-host .estate { position: absolute; inset: 0; display: block; }
.estate-host .estate-stage { position: absolute; inset: 0; max-width: none; border: 0; border-radius: 0; }
.estate-host .estate-cv { position: absolute; max-width: none; }
.estate-host .estate-in-head { padding-right: calc(var(--gutter-r, 8px) + 128px); }
.estate-host .estate-inside { border-bottom: 44px solid #3d2414; }
.estate-card.estate-card-in { gap: 0; }
.estate-card .estate-here { color: var(--ink); }
.estate-host .estate-card.estate-card-in { max-width: min(62%, 460px); padding: 2px 8px; }
.estate-host .estate-row { position: absolute; z-index: 4; left: var(--gutter-l, 8px); right: var(--gutter-r, 8px); bottom: 6px; width: auto; }
.estate-host .estate-chip { background: color-mix(in srgb, var(--surface) 90%, transparent); }
.estate-host .estate-card { position: absolute; z-index: 4; left: var(--gutter-l, 8px); bottom: 44px; width: auto; max-width: min(70%, 420px); background: color-mix(in srgb, var(--surface) 90%, transparent); font-size: 0.82rem; padding: 4px 10px; }
.estate-switch { position: absolute; z-index: 13; top: 8px; right: var(--gutter-r, 8px); display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: color-mix(in srgb, var(--surface) 88%, transparent); }
.estate-switch button { font: inherit; font-size: 0.8rem; line-height: 1.2; padding: 4px 10px; border: 0; background: transparent; color: var(--ink); cursor: pointer; touch-action: manipulation; }
.estate-switch button.active { background: var(--ink); color: var(--paper); }
/* The log while the estate is on: the house's lines only, from both pages. */
.log-clan-note { margin: 4px 0; padding: 4px 10px; font-size: 0.82rem; color: var(--muted, inherit); border-left: 3px solid var(--gold, #8f6a12); background: color-mix(in srgb, var(--gold, #8f6a12) 8%, transparent); }
#log.sub-clan li:not(.clan-item) { display: none; }
#log.sub-clan li.clan-item { display: list-item; }
#log.sub-clan details[data-age]:not(:has(li.clan-item)), #log.sub-clan details[data-rift] { display: none; }
#log.sub-clan details[data-age]:has(li.clan-item) { display: block; }
/* The house's housekeeping (estateOnly: lands, posts, the treasury, buildings) is told only on the estate. */
#log:not(.sub-clan) li.estate-only { display: none; }
#log:not(.sub-clan) details[data-age]:not(:has(li:not(.estate-only))) { display: none; }
/* The sect's tab (src/sect-estate.js): its own lines only, its housekeeping (sectOnly) told only there. */
#log.sub-sect li:not(.sect-item) { display: none; }
#log.sub-sect li.sect-item { display: list-item; }
#log.sub-sect details[data-age]:not(:has(li.sect-item)), #log.sub-sect details[data-rift] { display: none; }
#log.sub-sect details[data-age]:has(li.sect-item) { display: block; }
#log:not(.sub-sect) li.sect-only { display: none; }
#log:not(.sub-sect):not(.sub-clan) details[data-age]:not(:has(li:not(.sect-only):not(.estate-only))) { display: none; }
/* The House / Sect tabs over the estate, and the sect's status line. */
.estate-tabs { position: absolute; z-index: 5; top: 8px; left: var(--gutter-l, 8px); display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: color-mix(in srgb, var(--surface) 90%, transparent); }
.estate-tabs button { font: inherit; font-size: 0.8rem; line-height: 1.2; padding: 4px 12px; border: 0; background: transparent; color: var(--ink); cursor: pointer; touch-action: manipulation; }
.estate-tabs button.active { background: #8f2b23; color: #fff6e0; }
.estate-tabs .estate-unread { display: inline-block; min-width: 16px; padding: 0 4px; border-radius: 99px; background: var(--cinnabar); color: #fff; font-size: 10px; line-height: 15px; font-weight: 700; text-align: center; vertical-align: 1px; }
.sect-status { position: absolute; z-index: 5; top: 8px; left: var(--gutter-l, 8px); max-width: calc(100% - var(--gutter-l, 8px) - var(--gutter-r, 8px) - 150px); padding: 3px 10px; border: 1px solid var(--line); border-left: 4px solid var(--gold, #8f6a12); border-radius: 6px; background: color-mix(in srgb, var(--surface) 90%, transparent); color: var(--ink); font-size: 0.76rem; line-height: 1.3; }
.sect-status.with-tabs { top: 42px; max-width: calc(100% - var(--gutter-l, 8px) - var(--gutter-r, 8px) - 8px); }
.estate-host:has(.estate-inside-on) .estate-tabs, .estate-host:has(.estate-inside-on) .sect-status { display: none; }
@media (max-width: 520px) { .sect-status { top: 52px; max-width: calc(100% - var(--gutter-l, 8px) - var(--gutter-r, 8px) - 8px); font-size: 0.72rem; } .sect-status.with-tabs { top: 52px; } }
.estate-switch .estate-unread { display: inline-block; min-width: 16px; padding: 0 4px; border-radius: 99px; background: var(--cinnabar); color: #fff; font-size: 10px; line-height: 15px; font-weight: 700; text-align: center; vertical-align: 1px; }
/* The clock held by the estate (ui.js syncSpeedButtons): the pause marked as the estate's. */
.speed.clock-held button.active, .speed.clock-held .sp-play { outline: 2px dashed var(--muted, #8a8070); outline-offset: 1px; }
.speed button.estate-held, .speed-pick .sp-play.estate-held { outline: 2px dashed var(--gold, #8f6a12); outline-offset: 1px; }
.clan-panel select.clan-pick { width: auto; max-width: 100%; min-height: 26px; font-size: 0.85rem; }

/* World chat: talk and shared moments apart (ui.js chatFilter). */
.chat-filter { display: flex; gap: 6px; margin: 4px 0; }
.chat-filter .chip { width: auto; min-height: 0; padding: 2px 12px; border: 1px solid var(--line); border-radius: 999px; background: transparent; font-size: 0.85rem; }
.chat-filter .chip.active { background: var(--jade, #2c6b59); border-color: var(--jade, #2c6b59); color: #fff; }

/* The great happening under way, on the News page (ui.js jhCardDraw). */
.jh-card { margin: 6px 0 10px; padding: 10px 12px; border: 1px solid var(--gold, #8f6a12); border-left: 4px solid var(--gold, #8f6a12); border-radius: 8px; display: grid; gap: 4px; }
.jh-card p { margin: 0; }
.jh-card .jh-effects { font-weight: 600; }
.jh-card button { justify-self: start; }

/* A way of life that does little for a sect disciple: dimmed, the reason below. */
#choice-options button.focus-weak { opacity: 0.55; }
#choice-options button .focus-sect-note { display: block; margin-top: 3px; color: var(--accent, #d8b45a); font-style: italic; }
#choice-options button.focus-weak .focus-sect-note { color: #e08a6a; }

/* What a recipe's pill or weapon does, under its name. */
.craft-for { display: block; color: var(--gold, #c9a45c); font-size: 0.78rem; }
.craft-effect { display: block; color: var(--jade); font-size: 0.78rem; }

/* The title a speaker's life wears, by their name in the chat. */
.life-title-chip { margin-right: 4px; padding: 0 4px; border-radius: 3px; font-size: 0.72rem; font-weight: 700; color: #fff; background: #6a6a72; }
.life-title-chip.lt-virtue { background: #c8962a; color: #241a06; }
.life-title-chip.lt-evil { background: #8a1f2a; }
.life-title-chip.lt-fame { background: #2f6aa8; }
.life-title-chip.lt-wealth { background: #b8862a; color: #241a06; }
.life-title-chip.lt-craft { background: #b0582a; }
.life-title-chip.lt-kin { background: #2f7a58; }
.life-title-chip.lt-war { background: #6a3a8a; }
.life-title-chip.lt-charm { background: #b8487a; }
.life-title-chip.lt-mind { background: #3a6a7a; }
.life-title-chip.lt-age { background: #5a7a3a; }
/* The higher title of a pair shines. */
.life-title-chip.lt-high { box-shadow: 0 0 0 1px #ffe9a0, 0 0 6px rgb(255 220 120 / 0.55); }

/* A line said inside a small frame: a small bubble, kept within it. */
.speech.vig-speech { position: absolute; left: 0; top: 0; font-size: 0.72rem; padding: 2px 6px; max-width: 30%; line-height: 1.25; z-index: 8; pointer-events: none; }

/* The log on every screen (2026-10-25): its two pages' buttons slim, the lines close. */
.log-tabs { padding: 3px 0 2px; gap: 6px; }
.log-tabs button { padding: 0 8px; min-height: max(20px, 1.75em); /* (grows with Settings' text size) */ font-size: 0.8rem; line-height: 1.2; }
.log details { padding: 0; }
.log summary { padding: 3px 0; }
.log li { padding: 3px 0; line-height: 1.4; }
@media (pointer: coarse) { .log-tabs button { min-height: 30px; } }
/* The small frame on a phone keeps its 8:5 shape too, not stretched tall. */
@media (max-width: 899px) { .vig { width: 64%; height: auto; aspect-ratio: 8 / 5; top: 6%; } }

/* The news of a great happening still under way: tap to go (2026-10-25). */
#log li.jh-line { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
#log li .share-row .primary { width: auto; min-height: 26px; padding: 1px 12px; }
#log li.jh-line .share-row { display: inline-block; text-decoration: none; }
#log li .realm-card { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; }
#log li .realm-card .primary { align-self: flex-start; margin-top: 2px; }
.heir-row { display: grid; gap: 6px; margin: 8px 0; } .heir-row > p { margin: 0; font-size: 0.85rem; }

/* What's new (ui.js showUpdates). */
.up-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; margin: 6px 0 10px; }
.up-table th, .up-table td { border-bottom: 1px solid color-mix(in srgb, var(--ink) 15%, transparent); padding: 5px 6px; text-align: left; vertical-align: top; }
.up-table th { font-size: 0.78rem; opacity: 0.75; }
.up-table .up-area { font-weight: bold; white-space: nowrap; }
.up-wiki { display: block; margin: 4px 0 10px; font-size: 0.85rem; color: #e8c878; }

/* Designed moments in the small frame (scene.js FRAME_PLAYS). */
.vig .vfx { position: absolute; left: 0; top: 0; width: 100%; height: 100%; image-rendering: pixelated; pointer-events: none; z-index: 4; }
.vig-face, .vig-closeup { background: radial-gradient(circle at 50% 45%, #f4e6cc, #c8b08a); }
.vig-face { background: radial-gradient(circle at 50% 40%, #e8eef6, #8f9db4); }
.vig-face-img { position: absolute; left: 50%; top: 0; height: 100%; width: auto; transform: translateX(-50%); image-rendering: pixelated; }
.vig-tear { position: absolute; width: 2.6%; aspect-ratio: 2 / 3; margin-left: -1.3%; z-index: 2; background: #8fd0ff; border-radius: 50% 50% 50% 50% / 30% 30% 70% 70%; box-shadow: 0 0 0 1px #3f7fb8; }
.vig-close { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
.vig-sweat { position: absolute; width: 5px; height: 7px; z-index: 3; background: #bfe6ff; border-radius: 50% 50% 50% 50% / 30% 30% 70% 70%; opacity: 0; }
.vig-atk { position: absolute; top: 8%; transform: translateX(-50%); z-index: 5; padding: 1px 6px; font-size: 0.72rem; font-weight: bold; color: #fff6dc; background: rgb(40 24 16 / 0.8); border-radius: 4px; white-space: nowrap; }
.vig-ghost { width: 18px; height: 22px; margin-left: -9px; border-radius: 50% 50% 40% 40%; }
.vig-streak { position: absolute; width: 1.2%; margin-left: -0.6%; z-index: 1; background: linear-gradient(#9fd8ff, rgb(159 216 255 / 0.2)); border-radius: 2px; opacity: 0.85; }
.vig.vig-sickbed { background: repeating-linear-gradient(90deg, #7a5536 0 22px, #6c4a2e 22px 23px, #82603e 23px 45px, #6c4a2e 45px 46px); }
.vig-bedside { position: absolute; left: 30%; width: 40%; top: 4%; bottom: 4%; background: #f1ead9; border: 6px solid #5a3820; border-radius: 6px; box-shadow: inset 0 0 0 2px #d8cdb4, 3px 4px 0 rgb(0 0 0 / 0.25); }
.vig-bedside ~ .vig-pillow { position: absolute; left: 38%; width: 24%; top: 12%; height: 15%; background: #fffaf0; border-radius: 30%; box-shadow: inset 0 -3px 0 #ddd3bf; }
.vig-bedside, .vig-bedside ~ .vig-pillow { z-index: 0; }
.vig-bedside ~ .vig-ill, .vig-bedside ~ .figure { z-index: 1; transform-origin: 50% 50%; }
.vig-bedside ~ .vig-sweat { z-index: 3; }
.vig-bedside ~ .vig-quilt { position: absolute; left: 31.5%; width: 37%; top: 50%; bottom: 5.5%; z-index: 2; background: #8a3a3a; border-top: 5px solid #f1ead9; border-radius: 3px; box-shadow: inset 0 -5px 0 #6a2a2a, inset 6px 0 0 #9c4646; transform-origin: 50% 0; }

/* The dress over the armour (ui.js dressRow). */
.dress-row { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 8px; }
.dress-card { display: grid; justify-items: center; gap: 2px; min-width: 84px; max-width: 110px; padding: 6px; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--ink) 20%, transparent); background: transparent; }
.dress-card.on { border: 2px solid #d9a53a; background: color-mix(in srgb, #d9a53a 12%, transparent); }
.dress-card small { font-size: 0.72rem; line-height: 1.2; text-align: center; }
.dress-fig { width: 56px; height: 72px; background-size: auto 100%; background-repeat: no-repeat; background-position: 0 0; image-rendering: pixelated; }

/* A history folded under "ประวัติ" (ui.js loreBox, src/lore.js). */
.lore { margin-top: 6px; font-size: 0.86rem; }
.lore summary { cursor: pointer; font-weight: bold; color: var(--muted, #8a7a6a); }
.lore p { margin: 4px 0; line-height: 1.5; }
.named-lore .lore { margin-top: 2px; font-size: 0.82rem; font-weight: normal; }

/* Phone: who is online and the chat's chips on one row (ui.js worldTop). */
.world-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.world-top .world-stats { flex: 1 1 auto; min-width: 0; }
.world-top .chat-filter { margin: 0; flex: none; }
.world-top:empty { display: none; }
/* Eating or drinking up close (scene.js FRAME_PLAYS.consume). */
.vig-hand { position: absolute; left: 50%; top: 68%; width: 26%; aspect-ratio: 1; z-index: 3; }
.vig-hand .vig-held { position: absolute; left: 18%; top: 0; width: 64% !important; height: 64% !important; background-size: 100% 100%; image-rendering: pixelated; }
.vig-hand i { position: absolute; left: 10%; top: 44%; width: 80%; height: 46%; background: #f0c8a0; border: 2px solid #2a1f1d; border-radius: 40% 40% 30% 30%; box-shadow: inset 0 -4px 0 #c8946a; }
.vig-blush { position: absolute; top: 74%; width: 12%; height: 6%; margin-left: -6%; z-index: 2; border-radius: 50%; background: #e8607a; opacity: 0; filter: blur(1px); }
.vig-steam { position: absolute; top: 60%; width: 3%; height: 14%; z-index: 2; border-radius: 50%; background: rgb(255 255 255 / 0.75); filter: blur(1px); opacity: 0; }
.vig-glow { position: absolute; inset: 10% 20%; z-index: 2; border-radius: 50%; background: radial-gradient(rgb(255 240 180 / 0.9), rgb(255 210 90 / 0.3) 55%, transparent 70%); opacity: 0; pointer-events: none; }
/* The everyday frames (scene.js FRAME_PLAYS read … sleep, 2026-10-25). */
.vig-icon { position: absolute; z-index: 3; aspect-ratio: 1; height: auto !important; transform: translate(-50%, -50%); background-size: 100% 100%; image-rendering: pixelated; pointer-events: none; }
.vig-dream .vig-icon { z-index: 1; }
.vig-pop { animation: vig-pop 0.5s ease-out both; }
@keyframes vig-pop { from { transform: translate(-50%, -50%) scale(0); } 70% { transform: translate(-50%, -50%) scale(1.3); } to { transform: translate(-50%, -50%) scale(1); } }
.vig-book { position: absolute; left: 50%; top: 56%; width: 58%; height: 50%; transform: translate(-50%, -50%) perspective(300px) rotateX(18deg); z-index: 2; }
.vig-book i { position: absolute; top: 0; bottom: 0; width: 50%; background: repeating-linear-gradient(#f6eed8 0 9px, #b8a988 9px 10px); border: 3px solid #6a3a22; box-shadow: inset 0 0 0 2px #e6dcc0; }
.vig-book i:first-child { left: 0; border-radius: 6px 0 0 6px; border-right-width: 1px; }
.vig-book i:nth-child(2) { right: 0; border-radius: 0 6px 6px 0; border-left-width: 1px; }
.vig-book b { position: absolute; left: 50%; top: 3px; bottom: 3px; width: 48%; transform-origin: 0 50%; background: repeating-linear-gradient(#fbf5e4 0 9px, #c8b998 9px 10px); border-radius: 0 4px 4px 0; box-shadow: 1px 0 0 #8a7a5a; z-index: 1; }
.vig-mote { position: absolute; width: 2.4%; aspect-ratio: 1; margin: -1.2% 0 0 -1.2%; z-index: 3; border-radius: 50%; background: #bfe8ff; box-shadow: 0 0 6px 2px rgb(150 210 255 / 0.8); opacity: 0; }
.vig-mote.gold { background: #ffe9a0; box-shadow: 0 0 6px 2px rgb(255 210 110 / 0.8); }
.vig-anvil { position: absolute; left: 50%; top: 66%; width: 34%; height: 22%; transform: translateX(-50%); z-index: 1; background: linear-gradient(#6b6f78 0 30%, #4a4e57 30% 55%, transparent 55%), linear-gradient(90deg, transparent 32%, #3d4048 32% 68%, transparent 68%); border-radius: 4px 4px 0 0; }
.vig-soil { position: absolute; left: 0; right: 0; top: 64%; bottom: 0; z-index: 1; background: repeating-linear-gradient(170deg, #6a4a2c 0 8px, #5a3d22 8px 12px); }
.vig-floor { position: absolute; left: 0; right: 0; top: 64%; bottom: 0; z-index: 1; background: repeating-linear-gradient(90deg, #9a7650 0 30px, #7c5c3c 30px 32px); }
.vig-tool { z-index: 4; transform-origin: 80% 80%; }
.vig-spark { position: absolute; width: 4px; height: 4px; z-index: 5; background: #ffd75a; box-shadow: 0 0 4px #ff9a2a; }
.vig-dust { position: absolute; width: 6px; height: 6px; z-index: 5; border-radius: 50%; background: #b08a5c; }
.vig-smoke { position: absolute; top: 34%; width: 8%; aspect-ratio: 1; margin-left: -4%; z-index: 2; border-radius: 50%; background: rgb(235 235 235 / 0.85); filter: blur(1px); opacity: 0; }
.vig-smoke.dark { background: rgb(40 36 36 / 0.9); }
.vig-smoke.thin { width: 2.5%; margin-left: -1.25%; background: rgb(225 225 225 / 0.8); }
.vig-ring { position: absolute; left: 50%; top: 40%; width: 46%; aspect-ratio: 1; z-index: 2; border-radius: 50%; border: 3px dashed rgb(255 225 130 / 0.95); box-shadow: 0 0 10px rgb(255 220 120 / 0.8), inset 0 0 10px rgb(255 220 120 / 0.6); opacity: 0; }
.vig-dream { position: absolute; right: 8%; top: 6%; width: 24%; aspect-ratio: 1.3; z-index: 4; border-radius: 50%; background: #fffdf6; border: 2px solid #2a1f1d; opacity: 0; }
.vig-dream::after { content: ""; position: absolute; left: -14%; bottom: -10%; width: 16%; aspect-ratio: 1; border-radius: 50%; background: #fffdf6; border: 2px solid #2a1f1d; }
.vig-hoe { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2016%2016%22%20shape-rendering%3D%22crispEdges%22%3E%3Crect%20x%3D%222%22%20y%3D%2213%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22%238a5a2c%22/%3E%3Crect%20x%3D%223%22%20y%3D%2213%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22%235e3a1a%22/%3E%3Crect%20x%3D%223%22%20y%3D%2212%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22%238a5a2c%22/%3E%3Crect%20x%3D%224%22%20y%3D%2212%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22%235e3a1a%22/%3E%3Crect%20x%3D%224%22%20y%3D%2211%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22%238a5a2c%22/%3E%3Crect%20x%3D%225%22%20y%3D%2211%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22%235e3a1a%22/%3E%3Crect%20x%3D%225%22%20y%3D%2210%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22%238a5a2c%22/%3E%3Crect%20x%3D%226%22%20y%3D%2210%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22%235e3a1a%22/%3E%3Crect%20x%3D%226%22%20y%3D%229%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22%238a5a2c%22/%3E%3Crect%20x%3D%227%22%20y%3D%229%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22%235e3a1a%22/%3E%3Crect%20x%3D%227%22%20y%3D%228%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22%238a5a2c%22/%3E%3Crect%20x%3D%228%22%20y%3D%228%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22%235e3a1a%22/%3E%3Crect%20x%3D%228%22%20y%3D%227%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22%238a5a2c%22/%3E%3Crect%20x%3D%229%22%20y%3D%227%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22%235e3a1a%22/%3E%3Crect%20x%3D%229%22%20y%3D%226%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22%238a5a2c%22/%3E%3Crect%20x%3D%2210%22%20y%3D%226%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22%235e3a1a%22/%3E%3Crect%20x%3D%2210%22%20y%3D%225%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22%238a5a2c%22/%3E%3Crect%20x%3D%2211%22%20y%3D%225%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22%235e3a1a%22/%3E%3Crect%20x%3D%2211%22%20y%3D%224%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22%238a5a2c%22/%3E%3Crect%20x%3D%2212%22%20y%3D%224%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22%235e3a1a%22/%3E%3Crect%20x%3D%2211%22%20y%3D%222%22%20width%3D%224%22%20height%3D%222%22%20fill%3D%22%233a3d44%22/%3E%3Crect%20x%3D%2212%22%20y%3D%224%22%20width%3D%223%22%20height%3D%223%22%20fill%3D%22%239aa0a8%22/%3E%3Crect%20x%3D%2212%22%20y%3D%227%22%20width%3D%223%22%20height%3D%221%22%20fill%3D%22%233a3d44%22/%3E%3Crect%20x%3D%2211%22%20y%3D%224%22%20width%3D%221%22%20height%3D%223%22%20fill%3D%22%233a3d44%22/%3E%3C/svg%3E"); }
/* Sealing the cave (scene.js sealCave): a rock face, the dark mouth, the stone. */
.vig.vig-rock { background: linear-gradient(#8c8a84, #6e6b64 70%, #5a574f 70%, #4f4c45); }
.vig-cavemouth { position: absolute; left: 50%; bottom: 16%; width: 30%; height: 56%; transform: translateX(-50%); background: radial-gradient(ellipse at 50% 100%, #0c0a08, #1e1a16 70%); border-radius: 50% 50% 6% 6% / 60% 60% 4% 4%; box-shadow: 0 0 0 4px #4a4740, inset 0 6px 0 #2a2622; z-index: 0; }
.vig-boulder { position: absolute; left: 125%; bottom: 12%; width: 36%; aspect-ratio: 1; transform: translateX(-50%); z-index: 2; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #a7a39a, #7c786f 45%, #57534b 80%); border: 3px solid #2a2724; box-shadow: inset -6px -8px 0 rgb(0 0 0 / 0.18); }
.vig-boulder::before { content: ""; position: absolute; left: 22%; top: 40%; width: 30%; height: 6%; background: #4a463f; border-radius: 3px; transform: rotate(-20deg); }
.vig-boulder::after { content: ""; position: absolute; left: 55%; top: 62%; width: 20%; height: 5%; background: #4a463f; border-radius: 3px; transform: rotate(30deg); }
/* Auto settings (src/auto-ui.js). */
.auto-card .auto-head { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.auto-card.on { border-color: #4f9a58; }
.auto-way, .auto-person { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; font-size: 0.86rem; }
.auto-recipes { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; font-size: 0.86rem; }
.auto-recipe { display: flex; align-items: flex-start; gap: 6px; }
.auto-people { display: grid; gap: 4px; margin-top: 4px; }
.axis-what { margin: 4px 0 8px; font-size: 0.86rem; }
.axis-what p { margin: 4px 0; line-height: 1.45; }
/* One met in the sky rides an auspicious cloud, and a hero laid down up there
   lies on a level sword: drawn apart from the body, so they never tip with it
   (scene.js cloudRiders, skyMounts; art src/art/ride-cloud.js). */
.sky-mounts { position: absolute; inset: 0; pointer-events: none; }
.sky-mounts .ride-cloud, .sky-mounts .sky-sword { position: absolute; left: 0; top: 0; background-repeat: no-repeat; image-rendering: pixelated; image-rendering: crisp-edges; }
.sky-mounts .sky-sword { background-size: 100% 100%; }
.sky-mounts [hidden] { display: none; }
/* Up on the sword the hero keeps to the sky's height whatever the pose. */
.scene.flying .figure { bottom: 40%; }

/* The way of life that brought an event on (ui.js renderLog). */
.log-focus { margin-left: 6px; padding: 0 6px; border: 1px solid var(--line); border-radius: 999px; font-size: 0.7rem; color: var(--jade); white-space: nowrap; }
/* The month's activity a line came of (sim.js tagAct): quieter than a way of life. */
.log-act { color: var(--muted, #888); border-style: dashed; }
/* Townsfolk on the street (scene.js streetLife): behind everyone, a little smaller and paler. */
.walkers { position: absolute; inset: 0; pointer-events: none; }
.walkers .npc.walker { position: absolute; transform-origin: 50% 100%; filter: saturate(0.8) brightness(0.96); }
.quest-need { display: block; color: var(--accent, #c8902a); }
.quest-step { display: block; margin-top: 2px; color: var(--ink, inherit); opacity: 0.9; }

/* Quest slots, deadlines and giving up (Life tab, 2026-10-25). */
.quest-slots { display: flex; gap: 6px; align-items: center; }
.quest-pip { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--jade, #2c6b59); }
.quest-pip.on { background: var(--jade, #2c6b59); }
.quest-pip.followed { border-color: var(--gold, #b8862b); }
.quest-pip.followed.on { background: var(--gold, #b8862b); }
.quest-exp { display: grid; gap: 2px; }
.quest-track { height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.quest-track i { display: block; height: 100%; background: var(--jade, #2c6b59); }
.quest-exp.soon small { color: var(--cinnabar, #a8352a); font-weight: 600; }
.quest-exp.soon .quest-track i { background: var(--cinnabar, #a8352a); }
.quest-btns { display: flex; gap: 6px; flex-wrap: wrap; }
/* The title with its follow button beside it; a followed quest's held deadline (2026-10-27). */
.quest-head { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.quest-head strong { min-width: 0; overflow-wrap: anywhere; }
.quest-head .quest-follow { width: auto; flex: none; min-height: 28px; padding: 2px 12px; }
.quest-follow.on { border-color: var(--jade, #2c6b59); color: var(--jade, #2c6b59); }
.quest-exp.held small { color: var(--jade, #2c6b59); font-weight: 600; }
.quest-btns button { width: auto; min-height: 28px; padding: 2px 14px; }
.quest-over { display: block; }
/* Naming a newborn: a light card low on the screen, the scene still in view. */
.menu-panel.name-ask { background: rgb(5 8 12 / 0.12); place-items: end center; padding-bottom: max(24px, calc(env(safe-area-inset-bottom, 0px) / var(--zoom, 1))); }
.menu-panel.name-ask > section { max-width: min(420px, 100%); box-shadow: 0 8px 28px rgb(0 0 0 / 0.45); }
.stat-held { opacity: 0.7; font-size: 0.8em; }
.stat-full { font-weight: bold; text-decoration: underline; text-underline-offset: 2px; }
/* A stat's ceiling by its potential's grade (sim.js potGrade): low, average, high, excellent. */
.stat-cap { font-size: 0.75em; }
/* (The ceiling stays on the thin top too, where the other small figures are hidden.) */
.screen.game .stats .stat-row small.stat-cap, .stats .stat-row small.stat-cap { display: inline; font-size: 0.85em; }
.stat-row small.stat-cap.pot-low { color: #9e4a42; } .stat-row small.stat-cap.pot-high { color: #2a6f9e; } .stat-row small.stat-cap.pot-excellent { color: #7a5a0c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .stat-row small.stat-cap.pot-low { color: #e0877e; } :root:not([data-theme="light"]) .stat-row small.stat-cap.pot-high { color: #78bde6; } :root:not([data-theme="light"]) .stat-row small.stat-cap.pot-excellent { color: #f0c25a; } }
:root[data-theme="dark"] .stat-row small.stat-cap.pot-low { color: #e0877e; } :root[data-theme="dark"] .stat-row small.stat-cap.pot-high { color: #78bde6; } :root[data-theme="dark"] .stat-row small.stat-cap.pot-excellent { color: #f0c25a; }
.pot-low { color: #9e4a42; }
.pot-mid { color: var(--muted, #888); }
.pot-high { color: #2a6f9e; }
.pot-excellent { color: #7a5a0c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pot-low { color: #e0877e; } :root:not([data-theme="light"]) .pot-high { color: #78bde6; } :root:not([data-theme="light"]) .pot-excellent { color: #f0c25a; } }
:root[data-theme="dark"] .pot-low { color: #e0877e; } :root[data-theme="dark"] .pot-high { color: #78bde6; } :root[data-theme="dark"] .pot-excellent { color: #f0c25a; }
.stat-pot { margin-top: 8px; } .stat-pot p { margin: 4px 0; }

/* Town sagas (docs/60): a part's card, the marks a choice leaves, the turns of the story, the end's scroll. */
.saga-card { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 7; text-align: center; padding: 14px 28px 12px; color: #f4ead2;
  background: radial-gradient(ellipse at center, rgb(12 10 8 / 0.82) 0%, rgb(12 10 8 / 0.62) 60%, transparent 100%); font-family: var(--font-display); white-space: nowrap; text-shadow: 0 2px 4px #000; }
.saga-card .saga-town { font-size: 0.8rem; letter-spacing: 0.2em; opacity: 0.85; }
.saga-card .saga-title { font-size: clamp(1.1rem, 3.4vw, 1.7rem); font-weight: 700; margin: 2px 0; }
.saga-card .saga-num { font-size: 0.85rem; color: #e6c27a; }
.saga-tick { position: absolute; bottom: 64%; z-index: 7; white-space: nowrap; font: 600 0.9rem var(--font-display); padding: 2px 8px; border-radius: 10px; background: rgb(12 10 8 / 0.6); text-shadow: 0 1px 2px #000; }
.saga-tick.up { color: #9fe0b8; }
.saga-tick.down { color: #f0a090; }
.saga-mark { z-index: 7; }
.vig.vig-past { border-color: #3a2a18; box-shadow: 0 0 0 2px #b89a6a, inset 0 0 18px 6px rgb(60 40 20 / 0.6); filter: sepia(0.85); }
.saga-leaf { position: absolute; left: 0; width: 7px; height: 4px; border-radius: 4px 0; background: #8a6a2a; z-index: 5; }
.saga-focus { position: absolute; inset: 0; z-index: 4; background: radial-gradient(ellipse 60% 70% at 50% 62%, transparent 55%, rgb(0 0 0 / 0.55) 100%); }
.saga-ink { position: absolute; aspect-ratio: 1; z-index: 6; border-radius: 47% 53% 41% 59% / 55% 44% 56% 45%; background: radial-gradient(circle at 45% 40%, #0d0b09 0%, #15110d 55%, rgb(20 16 12 / 0.7) 72%, transparent 74%); }
.saga-truth { position: absolute; left: 50%; top: 44%; z-index: 7; color: #f6e7c4; font: 700 clamp(1.2rem, 4vw, 2rem) var(--font-display); white-space: nowrap; text-shadow: 0 0 8px #000, 0 2px 0 #7a1a12; }
.saga-scroll { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 8; width: min(78%, 420px); padding: 12px 18px; text-align: center; color: #2a1d10;
  background: linear-gradient(#efe0bd, #e6d2a6); border-top: 6px solid #6a4a2a; border-bottom: 6px solid #6a4a2a; box-shadow: 0 8px 24px rgb(0 0 0 / 0.5); font-family: var(--font-display); }
.saga-scroll .saga-town { font-size: 0.75rem; letter-spacing: 0.2em; opacity: 0.8; }
/* (A saga's end scroll stays until shut, its ✕ at the top left: scene.js sagaEnd, report 5563.) */
.fx-keep { z-index: 30; }
.fx-keep .saga-scroll { pointer-events: auto; max-height: calc(100% - 16px); overflow-y: auto; }
.saga-scroll .saga-x { position: absolute; z-index: 2; left: 4px; top: 4px; min-width: 32px; min-height: 32px; padding: 0; border: 1px solid #6a4a2a; border-radius: 6px; background: #f4e8cc; color: #2a1d10; font-size: 1rem; line-height: 1; cursor: pointer; }
.saga-scroll .saga-title { font-size: 1.15rem; font-weight: 700; }
.saga-scroll .saga-endname { margin: 4px 0 8px; color: #7a1a12; font-weight: 700; }
.saga-scroll .saga-row { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; align-items: center; font-size: 0.8rem; text-align: right; }
.saga-scroll .saga-bar, .saga-track { position: relative; height: 6px; border-radius: 3px; background: rgb(0 0 0 / 0.15); overflow: hidden; }
.saga-scroll .saga-bar i, .saga-track i { position: absolute; top: 0; height: 100%; }
.saga-scroll .saga-bar i.up, .saga-track i.up { background: var(--jade, #2c6b59); }
.saga-scroll .saga-bar i.down, .saga-track i.down { background: var(--cinnabar, #a8352a); }
.saga-scroll .saga-cast { margin-top: 8px; font-size: 0.75rem; }
.saga-bars { display: grid; gap: 3px; margin: 4px 0; }
.saga-axis { display: grid; grid-template-columns: minmax(80px, 1fr) 2fr 2.5em; gap: 6px; align-items: center; }
.saga-track { background: var(--line); }
.saga-v { text-align: right; font-variant-numeric: tabular-nums; }

/* The town card (src/town-ui.js, docs/60): kinds, specialties, standing, board, journal. */

.town-entry { width: 100%; }
.menu-panel .town-card { width: min(560px, 100%); }
.town-tags, .town-specials { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.town-tag, .town-special { padding: 2px 8px; font-size: 0.85rem; border: 1px solid #7b6450; background: #241a1c; }
.town-standing { display: grid; gap: 4px; }
.town-track { height: 8px; background: #0f0c0d; border: 1px solid #7b6450; }
.town-track span { display: block; height: 100%; background: #c98f22; }
.town-board { display: grid; gap: 8px; }
.town-post { display: grid; gap: 4px; padding: 10px; border: 1px dashed #7b6450; background: #221a1c; }
.town-post.saga { border-style: solid; border-color: #c98f22; }
.town-post.done { opacity: 0.6; }
.town-post .town-note { margin: 0; font-size: 0.9rem; line-height: 1.45; color: #e8dcc0; }
.town-post button { justify-self: start; font-size: 0.95rem; padding: 6px 14px; }
/* (The town card scrolls the whole journal; a box inside it hid the older lines on a phone.) */
.town-journal { margin: 0; padding-left: 18px; display: grid; gap: 3px; font-size: 0.88rem; }
.town-journal .k-tier { color: #e0b03c; }
.town-journal .k-saga { color: #e8b0a0; }
.town-journal .k-clue { color: #a8c8e8; }
.town-journal .k-festival { color: #e8c890; }
.town-journal .k-notable { color: #c8e0b0; }
/* Stage 3–4 (docs/60): the notables, the festivals, the secret's clues. */
.town-notables { display: grid; gap: 6px; }
.town-notable { display: grid; gap: 2px; text-align: left; padding: 8px 10px; border: 1px solid #7b6450; background: #221a1c; min-width: 0; }
.town-notable strong { font-size: 0.98rem; }
.town-notable small { line-height: 1.35; overflow-wrap: anywhere; font-weight: normal; }
.town-notable .warm { color: #e0b03c; }
.town-notable .cold { color: #9ab0d0; }
.town-notable.gone { opacity: 0.6; }
.town-fests { margin: 0; padding-left: 18px; display: grid; gap: 3px; font-size: 0.9rem; }
.town-fests .soon strong { color: #e0b03c; }
.town-secret { display: grid; gap: 4px; padding: 10px; border: 1px solid #4f6070; background: #1a1e24; }
.town-secret .town-note { margin: 0; font-size: 0.9rem; line-height: 1.45; color: #dde6f0; }
/* The quest page's secret and gate-clue cards reuse the name on the page's own ground, in either theme. */
.town-secret .town-secret-title { color: #e0b03c; font-weight: 600; }
.story-card.town-secret { padding: 6px 10px; gap: 2px; color: var(--ink); background: var(--surface); border-color: var(--line); border-left-color: var(--gold); }
.town-clues { margin: 0; padding-left: 20px; display: grid; gap: 3px; font-size: 0.88rem; line-height: 1.4; }

/* The places card (src/place-guide.js): a town's places or the sect's mountain. */
.places-card { margin: 8px 0; }
.places-card > summary.places-sum { cursor: pointer; font-weight: bold; font-size: 1.05rem; padding: 4px 0; }
.places-part { margin: 10px 0 2px; font-size: 0.9rem; color: var(--muted); }
.place-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.place-row.here strong { color: var(--jade); }
.place-row.shut .place-words { opacity: 0.65; }
.place-words { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.place-words small { line-height: 1.35; overflow-wrap: anywhere; }
.place-service { color: var(--jade); }
.place-acts { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: 0 0 auto; max-width: 40%; }
.place-acts button { min-height: 32px; padding: 2px 10px; }
.place-acts .act-why { margin: 0; text-align: right; font-size: 0.75rem; }
.places-lacks { font-size: 0.8rem; }
/* A stat's own figure by where it came from (ui.js openStatPanel). */
.stat-from { margin: 2px 0 4px; font-size: 0.9rem; }
/* The bag's and the arts' kinds (ui.js catChips, src/bag-sort.js): a row of chips that wraps. */
.cat-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.cat-chip { min-height: 32px; padding: 2px 10px; border-radius: 99px; font-size: 0.82rem; }
.cat-chip.on { background: var(--btn-sel-bg); color: var(--btn-sel-ink); border-color: var(--btn-sel-bg); font-weight: 700; }
.bulk-row[hidden] { display: none; }
.bulk-sum { margin: 2px 0 6px; font-weight: 600; }
/* The shop's many-at-once selling (shop-ui.js). */
.shop-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.shop-pick .active { background: var(--btn-sel-bg); color: var(--btn-sel-ink); border-color: var(--btn-sel-bg); }
.shop-tick { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; cursor: pointer; }
.shop-tick input { width: 22px; height: 22px; }
/* The words over the scene fit what they say (players, 2026-10-26: "the
   black bar is too long; only what is needed"): the place and what the hero
   is doing, and the moment's line, each only as wide as its words. */
.caption { right: auto; width: fit-content; max-width: calc(100% - var(--gutter-l) - var(--gutter-r)); box-sizing: border-box; }
.scene-text { max-width: calc(100% - var(--gutter-l) - var(--gutter-r) - 48px); box-sizing: border-box; }
.scene-text > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scene.cutscene > .caption { left: 50%; right: auto; transform: translateX(-50%); width: max-content; max-width: calc(100% - 24px); }
/* In a cutscene only the place's name stays at the top: the line is in the lower bar. */
.scene.cutscene #doing { display: none; }
/* "New lines above" while the log is read far down (ui.js logNewLines). */
.log-new { position: sticky; top: 0; z-index: 2; display: block; margin: 0 auto 4px; min-height: 30px; padding: 2px 14px; border-radius: 99px; background: var(--btn-sel-bg); color: var(--btn-sel-ink); border-color: var(--btn-sel-bg); font-size: 0.82rem; font-weight: 700; box-shadow: 0 2px 6px rgb(0 0 0 / 0.2); }
.log-new[hidden] { display: none; }
.panel:has(> #log[hidden]) > .log-new { display: none; }
/* A small frame is the scene's own: never over the rift or the arena, and never in the way of a tap (players, 2026-10-26). */
.vig { pointer-events: none; }
.scene.rift-on .vig, .scene.arena-on .vig, .scene.rift-on .speech, .scene.arena-on .speech { visibility: hidden; }
/* Comprehension of the dao (src/dao-ui.js) */
.dao-panel { margin: 12px 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.dao-panel summary { cursor: pointer; font-weight: 600; }
.dao-list { display: grid; gap: 8px; margin-top: 6px; }
.dao-row .dao-head { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; margin-bottom: 3px; }
.dao-row .dao-lvl { margin-left: auto; font-size: 0.85em; opacity: 0.85; }
.dao-row .dao-tag { font-size: 0.75em; padding: 0 6px; border-radius: 6px; background: var(--gold); color: #1a1a1a; }
.dao-row.main strong { color: var(--gold); }
.dao-now { margin-top: 8px; }
/* A talent's tier beside its name (ui.js talentTier): the rarer, the brighter. */
.talent .talent-tier { font-size: 0.75rem; padding: 0 6px; border-radius: 6px; justify-self: start; border: 1px solid var(--line); opacity: 0.9; }
.talent.good.tier2 .talent-tier { border-color: #4a8fd0; color: #7ab6ec; }
.talent.good.tier3 .talent-tier { border-color: #a060d8; color: #c79af0; }
.talent.good.tier4 .talent-tier { border-color: #e0b03c; color: #f0c860; }
.talent.bad.tier2 .talent-tier { border-color: #b8353a; color: #e07a7e; }
.edited-badge { font-size: 0.75rem; padding: 0 6px; border: 1px solid var(--danger); border-radius: 6px; color: var(--danger); text-decoration: none; }
/* How fast a way grows for this hero (dao-ui.js, dao-life.js daoRate). */
.dao-row .dao-rate { font-size: 0.75em; opacity: 0.8; }
.dao-row .dao-rate.fast { color: var(--jade); opacity: 1; }
.dao-row .dao-rate.slow { color: var(--danger, #b8353a); opacity: 1; }
.dao-intent { margin: 8px 0 2px; font-weight: 600; }

/* Favourites and the log's links (players, 2026-10-26). */
.log-link { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; font-weight: 600; }
.log-link.item { color: var(--tier-ink, inherit); text-decoration-color: currentColor; text-decoration-thickness: 1px; }
/* The log's marks (the owner, 2026-10-28; src/log-marks.js): a change up
   green, money / treasury / merit gold, ties and closeness sky blue, down red;
   things gained and arts learned in their tier's colour; the month first. */
.log-fx { font-weight: 600; white-space: nowrap; }
.fx-up { color: var(--up); }
.fx-gold { color: var(--gold); }
.fx-tie { color: var(--tie); }
.fx-down { color: var(--down); }
.log-art { font-weight: 600; color: var(--tier-ink); }
.tier-0 { --tier-ink: var(--t0); } .tier-1 { --tier-ink: var(--t1); } .tier-2 { --tier-ink: var(--t2); }
.tier-3 { --tier-ink: var(--t3); } .tier-4 { --tier-ink: var(--t4); } .tier-5 { --tier-ink: var(--t5); }
.log-mo { display: inline-block; min-width: 3.2em; margin-right: 6px; color: var(--muted); font-size: 0.72rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.log li.mo-same > .log-mo { visibility: hidden; }
.log-link.person { color: var(--jade); }
.log-link:hover, .log-link:focus-visible { text-decoration-style: solid; }
.fav-star { position: absolute; top: -7px; left: -7px; z-index: 2; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); color: var(--muted); font: 700 14px/1 sans-serif; box-shadow: 0 0 0 1px var(--line); cursor: pointer; opacity: 0.7; }
.fav-star.on { color: #e0a800; opacity: 1; }
.face > .fav-star { top: 3px; left: 3px; width: 18px; height: 18px; font-size: 12px; pointer-events: none; }
.fav-btn.on { border-color: #e0a800; }
.person-top h2 .fav-star { position: static; display: inline-grid; vertical-align: middle; margin-left: 6px; width: 28px; height: 28px; font-size: 18px; opacity: 1; }
.icon-cell.flash .sq { animation: bag-flash 0.5s ease-in-out 4 alternate; }
@keyframes bag-flash { to { box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px #e0a800; } }
.fav-btn { display: block; margin: 0 0 6px auto; min-height: 30px; padding: 2px 12px; font-size: 0.82rem; border-radius: 16px; }

/* The solo dungeon's panel (src/dungeon-ui.js, docs/62): the plan as rows of buttons, the meter. */
.dungeon-entry { width: 100%; }
#doing.town-link { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.dg-row { display: flex; flex-wrap: wrap; gap: 6px; }
.dg-row button { flex: 1 1 30%; min-height: 40px; }
.dg-row button.on { background: #c98f22; color: #1b1517; border-color: #f1e9d2; font-weight: 600; }
.dg-pack { display: grid; gap: 6px; }
.dg-supply { display: grid; grid-template-columns: 1fr 40px 2.2em 40px; gap: 6px; align-items: center; padding: 6px; border: 1px dashed #7b6450; }
.dg-supply-name { display: grid; min-width: 0; }
.dg-supply button { min-height: 36px; padding: 0; }
.dg-secret { display: grid; gap: 4px; padding: 6px; margin-bottom: 6px; border: 1px dashed #7b6450; }
.dg-secret small { overflow-wrap: anywhere; }
.dg-secret button { min-height: 40px; }
.dg-secret button.on { background: #c98f22; color: #1b1517; border-color: #f1e9d2; font-weight: 600; }
.dg-num { text-align: center; font-variant-numeric: tabular-nums; }
.dg-meter span { background: #b8382e; }
/* Asking to learn, giving (src/learn-give-ui.js). */
.lg-pick ul { list-style: none; margin: 6px 0 0; padding: 0; max-height: 52vh; overflow-y: auto; }
.lg-pick li { padding: 6px 0; border-top: 1px dashed rgba(168,116,42,0.35); }
.lg-pick li:first-child { border-top: 0; }
.lg-art-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lg-art-head small { flex: 1 1 100%; }
.lg-pick .act-row button { font-size: 0.9em; }
.lg-given { display: block; margin-top: 4px; }
/* The sect war's front (war-ui.js): the strip under the scene and in the war's panel. */
.front-strip { display: inline-flex; align-items: center; gap: 3px; flex-wrap: wrap; font-size: 0.78rem; line-height: 1.3; }
.front-strip > b { margin-right: 3px; font-weight: 600; }
.front-step { display: inline-flex; align-items: center; gap: 3px; opacity: 0.65; }
.front-step.taken { opacity: 0.85; }
.front-step.here { opacity: 1; color: #f2d24a; font-weight: 600; }
.front-dot { width: 7px; height: 7px; border-radius: 50%; background: #7b6450; display: inline-block; }
.front-step.taken .front-dot { background: #6aa0d8; }
.front-step.here .front-dot { background: #f2d24a; box-shadow: 0 0 0 1px #2a1f1d, 0 0 0 2px #f2d24a; }
.front-dash { font-style: normal; opacity: 0.45; font-size: 0.7rem; }
.front-duel { color: #f2d24a; }
.war-card .front-strip { font-size: 0.9rem; margin: 6px 0; }
.duel-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px 8px; align-items: center; font-size: 0.85rem; }
.duel-slot { display: flex; gap: 4px; align-items: center; min-width: 0; }
.duel-pick { flex: 1; min-width: 0; max-width: 100%; }
.duel-them { min-width: 0; overflow-wrap: anywhere; }

/* The person card's pages (2026-10-28): Details (what to do with them at its top), the two of you, their circle. */
.pc-tabs { margin: 6px 0 8px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; flex-wrap: nowrap; }
.pc-tabs button { min-width: 0; padding: 2px 3px; font-size: 0.74rem; overflow: hidden; text-overflow: ellipsis; }
.pc-pane[hidden] { display: none; }
/* Every page the same height, scrolling inside, so the card keeps its size between tabs (the owner, 2026-10-28). */
.pc-pane { height: min(48vh, 360px); overflow-y: auto; overscroll-behavior: contain; }
.pc-details-head { margin: 14px 0 6px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 0.95rem; }
.pc-pane > .pc-details-head:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.pc-standing { font-weight: 600; margin: 4px 0 8px; }
.pc-meter { display: grid; grid-template-columns: 5.5em 1fr 3em; align-items: center; gap: 8px; margin: 4px 0; }
.pc-meter .closeness { margin: 0; }
.pc-meter b { text-align: right; }
.pc-debts { margin: 4px 0 8px; padding-left: 1.2em; }
.pc-debts li.life { font-weight: 600; }
.pc-circle { display: flex; flex-direction: column; gap: 6px; }
.pc-tie { display: flex; align-items: center; gap: 8px; text-align: left; padding: 6px 8px; }
.pc-tie img { image-rendering: pixelated; flex: none; }
.pc-tie small { display: block; opacity: 0.85; }
.pc-tie.foe { border-left: 3px solid #c0503c; }
.pc-tie.love { border-left: 3px solid #d4689a; }
.pc-tie.friend { border-left: 3px solid #5aa36a; }
.pc-tie.kin { border-left: 3px solid #c8902a; }

/* The updates notice (2026-10-28): every update missed, each folded under its kind and title. */
.up-list { max-height: 60vh; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.up-item { border: 1px solid var(--line, #3a4a44); border-radius: 8px; padding: 4px 8px; }
.up-item summary { cursor: pointer; padding: 4px 0; }
.up-kind { display: inline-block; padding: 0 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; border: 1px solid currentColor; }
.up-kind-new { color: #4fb36f; } .up-kind-rule { color: #e0705a; } .up-kind-balance { color: #d6b45c; } .up-kind-fix { color: #6fa0e0; } .up-kind-look { color: #a88ad6; }
/* The scene's own buttons over a management view (the family's estate, the sect's mountain and every inside of
   theirs; players, 2026-10-28: the report and chat buttons sat on the caravan's and the seclusion room's controls).
   The drifting chat and its toggle are put away (nothing drifts over a panel; ui.js floatChat waits), the report and
   chat-dock buttons stay, a little smaller, in the bottom-right corner, and the view keeps that corner free:
   its row of places stops short of it. A notice (a message, a gift) shows over
   the view, under its head, instead of behind it. */
.scene.estate-on .chat-float-btn, .scene.estate-on .chat-float { display: none; }
.scene.estate-on .bug-btn, .scene.estate-on .chat-dock-btn { z-index: 14; bottom: 6px; min-height: 30px; padding: 1px 5px; font-size: 0.9rem; }
.scene.estate-on .chat-dock-btn { right: 44px; }
.scene.estate-on .notice { z-index: 14; top: 52px; }
.estate-host { --float-keep: 84px; }
.estate-host .estate-row { right: max(var(--gutter-r, 8px), var(--float-keep)); }
/* Taps on the estate and the sect's mountain (players, 2026-10-28: "very hard to tap things in the estate view"):
   every button over the view a finger's size (44px) and none on another. The row of places is 56px tall (its
   chips 44px), the card sits above it and below the switch, scrolling inside itself when long; the inside's
   frame keeps the row's band (ROW_H in clan-estate.js / sect-estate.js). */
.estate-switch button, .estate-tabs button { min-height: 44px; min-width: 44px; padding: 4px 12px; }
.sect-status.with-tabs { top: 58px; }
@media (max-width: 520px) { .sect-status, .sect-status.with-tabs { top: 58px; } }
.estate-chip { min-height: 44px; min-width: 44px; padding: 6px 14px; }
.estate-chip.estate-help-btn { font-weight: 700; padding: 6px 0; width: 44px; }
.estate-chip.estate-chip-plot { border-style: dashed; color: var(--muted, inherit); }
.estate-host .estate-row { bottom: 4px; padding: 2px; min-height: 48px; align-items: center; }
.estate-back, .estate-up { min-height: 44px; min-width: 44px; }
.estate-in-head { min-height: 52px; }
.estate-host .estate-inside { border-bottom-width: 56px; }
.estate-card button { min-height: 44px; min-width: 44px; padding: 6px 14px; font-size: 0.85rem; }
.estate-card button.primary { background: #8f2b23; color: #fff6e0; border-color: #e6c45a; }
.estate-card button:disabled { opacity: 0.55; cursor: default; }
.estate-card-top { display: flex; align-items: flex-start; gap: 8px; }
.estate-card-top strong { flex: 1; min-width: 0; padding-top: 10px; }
.estate-card .estate-card-x { flex: none; width: 44px; height: 44px; margin: 0 -6px 0 0; padding: 0; border-radius: 999px; font-size: 1.3rem; line-height: 1; }
.estate-acts { display: grid; gap: 2px; }
.estate-why { color: var(--cinnabar, #b23a2c); }
.estate-host .estate-card { bottom: 58px; max-height: calc(100% - 58px - 60px); overflow-y: auto; overscroll-behavior: contain; }
.estate-host .estate-card.estate-help { max-width: min(calc(100% - var(--gutter-l, 8px) - var(--gutter-r, 8px)), 560px); }
.estate-card.estate-help small { color: var(--ink); line-height: 1.4; }
.estate-host .estate-card.estate-card-in { max-height: none; overflow: visible; }
/* The sect's element (or a jianghu sect's way) under its name on the Sect tab. */
.sect-nature { margin: -4px 0 8px; color: var(--jade); font-weight: 600; }
.treasury-words .sect-nature { display: block; margin: 0; font-size: 0.85rem; }

/* ---- Players' UI asks, 2026-10-28 ---- */
/* The Map tab: a top bar of two (this town, the world map), then the current
   town's page in ruled sections with a row of chips that jump to each. */
.map-topbar { position: sticky; top: -8px; z-index: 3; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; margin: 0 0 10px; padding: 6px 0; background: var(--paper); border-bottom: 1px solid var(--line); }
.map-top-btn { min-height: 42px; padding: 4px 6px; font-size: 0.98rem; font-weight: 700; }
.map-top-btn.active { outline: 2px solid var(--jade); }
.map-top-btn.map-world-btn { background: var(--jade); color: var(--paper); border-color: var(--btn-primary-border); box-shadow: 0 3px 0 var(--btn-primary-edge); }
.map-top-btn.map-world-btn:hover:not(:disabled) { background: var(--btn-primary-hover); }
.map-here-head { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.map-here-head h3 { margin: 0; font-size: 1.08rem; }
.map-here-head .map-status { margin: 4px 0 0; font-size: 0.9rem; }
.map-here-head .map-status button { margin-top: 6px; }
.map-jump { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 2px; }
.map-jump-chip { min-height: 36px; padding: 4px 12px; border-radius: 999px; font-size: 0.85rem; }
.map-sec { margin-top: 14px; padding: 10px 12px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); scroll-margin-top: 60px; display: grid; gap: 8px; min-width: 0; }
.map-sec > * { min-width: 0; }
.map-sec > .map-sec-title { margin: 0; padding-bottom: 6px; border-bottom: 1px solid var(--line); font-family: var(--font-display); font-size: 1.05rem; color: var(--jade); }
.map-sec > p { margin: 0; }
.map-sec .shop-entry, .map-sec .auction-notice { margin-top: 0; }
.map-sec .shop-entry button, .map-sec .town-entry { min-height: 46px; font-size: 1rem; }
.map-sec .places-card.compact { margin: 0; }
.map-sec .places-card.compact > h3 { display: none; }
.map-sec h4 { margin: 4px 0 0; font-size: 0.95rem; }
/* The board and the dungeon inside the page: the theme's colours, not the dark pop-up's. */
.map-sec .town-post { background: var(--paper); border-color: var(--line); border-style: solid; border-radius: 6px; color: var(--ink); }
.map-sec .town-post.saga { border-color: var(--gold); }
.map-sec .town-post .town-note { color: var(--ink); }
.map-stories { display: grid; gap: 6px; }
.map-story { text-align: left; min-height: 40px; }
.dg-inline { display: grid; gap: 8px; min-width: 0; line-height: 1.45; }
.dg-inline > p, .dg-inline > small { margin: 0; }
.dg-inline > small { display: block; font-size: 0.85rem; }
.dg-inline h4 { margin: 8px 0 0; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 0.95rem; }
.dg-inline .dg-row button { flex: 1 1 calc(50% - 6px); min-width: 0; font-size: 0.92rem; }
.dg-inline .dg-row button.on { background: var(--btn-sel-bg); color: var(--btn-sel-ink); border-color: var(--btn-sel-bg); font-weight: 700; }
.dg-inline .dg-supply, .dg-inline .dg-secret { border: 1px solid var(--line); border-radius: 6px; background: var(--paper); }
.dg-inline .town-track { background: var(--line); border-color: var(--line); }
.dg-inline > button.primary, .dg-inline > button:last-child { min-height: 46px; }
.dg-fold { border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; background: var(--paper); display: grid; gap: 6px; }
.dg-fold > summary { cursor: pointer; font-weight: 700; padding: 4px 0; }
.dg-fold small { display: block; }
@media (min-width: 900px) { .dg-inline .dg-row button { flex: 1 1 calc(33% - 6px); } }
/* The place's name on the scene: a button with a chevron that opens the current-town page. */
#place.town-link { cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; align-self: flex-start;
  margin: -1px -4px 1px; padding: 1px 6px 1px 6px; border: 1px solid color-mix(in srgb, var(--jade) 70%, transparent); border-radius: 6px;
  background: color-mix(in srgb, var(--surface) 70%, transparent); box-shadow: 0 2px 0 color-mix(in srgb, var(--jade) 45%, transparent); }
#place.town-link::after { content: "›"; font-size: 1.15em; line-height: 1; color: var(--jade); font-weight: 800; }
#place.town-link:hover { background: var(--btn-hover-bg); }
#place.town-link:active { transform: translateY(1px); box-shadow: none; }
#place.town-link:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
/* The year of the hero's age in twelve pips beside it. */
.year-bar { display: inline-flex; gap: 1px; vertical-align: middle; margin: 0 2px; padding: 2px; border: 1px solid var(--line); border-radius: 3px; cursor: pointer; }
.year-bar i { display: block; width: 3px; height: 8px; background: color-mix(in srgb, var(--muted) 25%, transparent); border-radius: 1px; }
.year-bar i.on { background: var(--jade); }
/* The log in two columns: the stamp ruled off on the left, the words on the right. */
.log li.has-mo { display: grid; grid-template-columns: 3.3rem minmax(0, 1fr); column-gap: 8px; list-style: none; margin-left: -18px; }
.log li.has-mo > .log-mo { grid-column: 1; grid-row: 1 / span 4; margin: 0; padding: 0.2em 6px 0 0; border-right: 1px solid var(--line); white-space: normal; min-width: 0; line-height: 1.35; }
.log li.has-mo > .log-body, .log li.has-mo > .share-row { grid-column: 2; min-width: 0; }
.log li.has-mo.mo-same > .log-mo { visibility: visible; color: transparent; }
.log li.has-mo.r-rare, .log li.has-mo.r-epic, .log li.has-mo.r-legendary, .log li.has-mo.major { padding-left: 6px; }
/* The sect's main weapons, beside its element. */
.sect-weapons { margin: -10px 0 8px; color: var(--gold); font-weight: 600; }
.treasury-words .sect-weapons { display: block; margin: 0; font-size: 0.85rem; }
/* The Life tab's character page in sub pages. */
.char-subs { margin: 6px 0 10px; }
/* The way out of a dungeon run, plain on the scene (players 2026-10-29: "they can't find it"). */
.dg-exit { position: absolute; z-index: 13; top: 52px; right: var(--gutter-r, 8px); font: inherit; font-size: 0.85rem; font-weight: 700; line-height: 1.2; padding: 6px 12px; border: 2px solid #fff; border-radius: 999px; background: var(--cinnabar, #b8353a); color: #fff; cursor: pointer; touch-action: manipulation; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45); }
.dg-exit:hover, .dg-exit:focus-visible { filter: brightness(1.12); }
.dg-exit[hidden] { display: none; }

/* A family matter answered where it was pressed (ui.js hereAskEl, 2026-10-29):
   the card on the Run-the-family page or the person card, its options as the
   decision box has them, and what came of it once answered. */
.here-asks { display: grid; gap: 8px; margin: 6px 0; }
.here-ask { border-left-color: var(--gold, #b8862b); gap: 6px; }
.here-ask .here-text { margin: 0; }
.here-ask .here-letter { margin: 0; font-style: italic; }
.here-ask .here-options { display: grid; gap: 6px; }
.here-ask .here-options button { display: grid; gap: 2px; text-align: left; min-height: 44px; padding: 6px 10px; }
.here-ask .here-options button small.odds { display: block; font-size: 0.75rem; font-weight: 600; color: var(--muted); }
.here-ask .odds-info { display: inline-block; min-width: 22px; padding: 0 4px; border-radius: 10px; text-align: center; color: var(--jade); cursor: help; font-weight: 700; }
.here-ask .odds-pop { display: none; margin-top: 2px; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.here-ask small.odds.open .odds-pop { display: block; }
.here-ask .odds-line { display: block; }
.here-ask .here-done { margin: 0; }
.here-ask.answered { border-left-color: var(--jade, #2c6b59); }

/* The told scene (scene.js toldFrame, src/told-scene.js; 2026-10-29): a small
   frame that plays a told event where and when it happened. Far away in
   colour with the place named; the past in sepia (.vig-past). */
.vig.vig-far { border-color: #3a2a18; box-shadow: 0 0 0 2px #e0c27a, 0 6px 18px rgb(0 0 0 / 0.45); }
.vig-where { position: absolute; left: 4%; bottom: 4%; z-index: 4; padding: 1px 6px; border-radius: 3px; background: rgb(20 14 8 / 0.72); color: #f3e2b8; font: 600 10px/1.4 system-ui, sans-serif; letter-spacing: 0.02em; pointer-events: none; }
.vig-weather { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; image-rendering: pixelated; pointer-events: none; }
.vig-night { position: absolute; inset: 0; z-index: 2; background: rgb(18 24 60 / 0.42); mix-blend-mode: multiply; pointer-events: none; }
.vig-told .told-prop { z-index: 2; }
.vig-told .told-white { filter: grayscale(1) brightness(1.7); }
.told-coffin { position: absolute; bottom: 14%; width: 22%; height: 13%; margin-left: -11%; z-index: 0; background: linear-gradient(#3a2418 0 18%, #2a180e 18% 100%); border: 2px solid #1a0e06; border-radius: 2px 2px 1px 1px; box-shadow: inset 0 3px 0 #5a3a24, inset -3px 0 0 #8a2a1a, inset 3px 0 0 #8a2a1a; }
.told-bed { position: absolute; bottom: 12%; width: 34%; height: 11%; margin-left: -17%; z-index: 0; background: linear-gradient(#e8dcc0 0 30%, #a8553a 30% 100%); border: 2px solid #5a3420; border-radius: 2px; }
.npc.told-lying { z-index: 1; }
.told-baby { position: absolute; bottom: 27%; width: 4.6%; aspect-ratio: 3 / 2; margin-left: -1.7%; z-index: 2; background: radial-gradient(circle at 30% 45%, #f2d2b0 0 22%, transparent 24%), #f4ecd8; border: 1px solid #8a6a4a; border-radius: 45%; transform-origin: 50% 60%; }
.told-smoke { position: absolute; width: 2.4%; aspect-ratio: 1; z-index: 2; border-radius: 50%; background: rgb(220 220 220 / 0.6); pointer-events: none; }
.told-point { position: absolute; bottom: 31%; width: 9%; height: 2px; z-index: 2; background: #e8d8b8; box-shadow: 0 0 0 1px #3a2a18; transform: scaleX(0); }
.told-mote { position: absolute; width: 1.6%; aspect-ratio: 1; z-index: 2; background: #fff2b0; box-shadow: 0 0 4px #ffd36a; pointer-events: none; }

/* While a small frame plays over the scene (a chase, a told moment, the cliff
   shaft: scene.js vignette), the button gives way so the frame is whole
   (playtest 2026-10-29: it covered the chase frame's corner); back after. */
.scene:has(.vig) .dg-exit { visibility: hidden; pointer-events: none; }
/* Gathering qi in seclusion (src/qi-gather-ui.js): the cave's button, and its panel's bar. */
.qg-btn { position: absolute; z-index: 13; top: 52px; right: var(--gutter-r, 8px); font: inherit; font-size: 0.85rem; font-weight: 700; line-height: 1.2; padding: 6px 12px; border: 2px solid #fff; border-radius: 999px; background: var(--jade, #2c6b59); color: #fff; cursor: pointer; touch-action: manipulation; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .qg-btn { color: #10201a; border-color: #10201a; } }
:root[data-theme="dark"] .qg-btn { color: #10201a; border-color: #10201a; }
.qg-btn:hover, .qg-btn:focus-visible { filter: brightness(1.12); }
.qg-btn[hidden] { display: none; }
.scene:has(.vig) .qg-btn { visibility: hidden; pointer-events: none; }
.qg-panel .qg-how, .qg-panel .qg-said, .qg-panel .qg-keys { margin: 0; }
.qg-panel .qg-keys { font-size: 0.78rem; color: #cbbd9c; }
.qg-panel .qg-said { min-height: 1.4em; font-weight: 700; color: #f2d27a; }
.qg-bar { position: relative; height: 44px; border: 2px solid #e2d6b8; background: #0f0b0c; box-shadow: inset 0 0 0 2px #3a2a2c; touch-action: none; cursor: pointer; user-select: none; -webkit-user-select: none; }
.qg-bar .qg-good, .qg-bar .qg-perfect { position: absolute; top: 4px; bottom: 4px; }
.qg-bar .qg-good { background: #3f7f6a; }
.qg-bar .qg-perfect { background: #f2d27a; }
.qg-bar .qg-mark { position: absolute; top: -6px; bottom: -6px; width: 4px; margin-left: -2px; background: #fff; box-shadow: 0 0 0 1px #0f0b0c, 0 0 6px #fff; pointer-events: none; }
.qg-bar.hit-perfect { animation: qg-flash-p 0.35s ease-out; }
.qg-bar.hit-good { animation: qg-flash-g 0.35s ease-out; }
.qg-bar.hit-miss { animation: qg-shake 0.3s ease-out; }
@keyframes qg-flash-p { from { box-shadow: inset 0 0 0 2px #3a2a2c, 0 0 14px #f2d27a; } }
@keyframes qg-flash-g { from { box-shadow: inset 0 0 0 2px #3a2a2c, 0 0 10px #6cc2a4; } }
@keyframes qg-shake { 30% { transform: translateX(-3px); } 60% { transform: translateX(3px); } }
@media (prefers-reduced-motion: reduce) { .qg-bar.hit-perfect, .qg-bar.hit-good, .qg-bar.hit-miss { animation: none; } }
.qg-pips { display: flex; gap: 8px; justify-content: center; }
.qg-pip { min-width: 64px; padding: 2px 8px; text-align: center; border: 1px solid #7b6450; font-size: 0.85rem; color: #cbbd9c; }
.qg-pip.perfect { color: #1b1517; background: #f2d27a; border-color: #f2d27a; }
.qg-pip.good { color: #fff; background: #3f7f6a; border-color: #6cc2a4; }
.qg-pip.miss { color: #e9a196; border-color: #a8352a; }
.qg-acts { display: flex; gap: 8px; }
.qg-acts .qg-tap { flex: 1 1 auto; min-height: 52px; font-size: 1.1rem; touch-action: manipulation; }

/* The dungeon's camp (scene.js camp): the array about it lit in a ring. */
.dg-ward { position: absolute; bottom: 6%; width: 46%; max-width: 240px; aspect-ratio: 3 / 1; border-radius: 50%; border: 2px solid rgb(150 220 255 / 0.85); box-shadow: 0 0 12px 3px rgb(120 200 255 / 0.45), inset 0 0 10px 2px rgb(120 200 255 / 0.35); pointer-events: none; z-index: 2; transform: translateX(-50%); }
.less-motion .dg-ward { display: none; }
/* The encounter rule's mark (dungeon-ui.js meetRuleEl): the game's own field
   colours, the page's in the Map tab, the panel's dark ones in the pop-up. */
.dg-meet-n { display: flex; align-items: center; gap: 6px; margin: 6px 0; }
.dg-meet-n input { width: 4.5em; padding: 6px 8px; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--muted); border-radius: 4px; }
.menu-panel .dg-meet-n input { color: #f1e9d2; background: #0f0c0d; border: 1px solid #7b6450; border-radius: 0; }

/* The dungeon's campfire (scene.js setCamp): standing on the ground at the
   hero's side, its stones and roll still, its flame stepping on its own; the
   floor about it lit by two crisp warm bands (screen: lighter, never blurred). */
.dg-campfire { position: absolute; pointer-events: none; }
.dg-campfire canvas, .dg-campfire i { position: absolute; image-rendering: pixelated; image-rendering: crisp-edges; display: block; }
.dg-campfire-base { left: 0; bottom: 0; }
.dg-campfire-glow { mix-blend-mode: screen; }
.dg-campfire-spark { background: #fde27a; }
.dg-campfire.dim .dg-campfire-flame { transform: scaleY(0.6); transform-origin: 50% 100%; filter: brightness(0.8); }
.dg-campfire.dim .dg-campfire-glow { opacity: 0.5; }
/* The hero in its warm light (a hue shift, not a blur), while no clip sets its own filter. */
#figure.camp-lit:not([style*="filter"]) { filter: sepia(0.18) saturate(1.15) brightness(1.04); }
.shop-row.tappable { cursor: pointer; }
.shop-qty { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.shop-qty button.active { outline: 2px solid var(--accent, currentColor); }

/* The realm label opens the ladder of ranks. */
.realm.tappable { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.ladder-row { padding: 6px 8px; border-left: 3px solid #4a3d33; opacity: 0.55; }
.ladder-row.done { opacity: 0.85; border-left-color: #6a8f6a; }
.ladder-row.now { opacity: 1; border-left-color: #e2c26a; background: rgb(226 194 106 / 0.12); }
.ladder-tag { color: #e2c26a; font-size: 0.85rem; }
.ladder-stages { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.ladder-stage { padding: 1px 6px; border: 1px solid #4a3d33; font-size: 0.8rem; opacity: 0.6; }
.ladder-stage.done { opacity: 0.9; border-color: #6a8f6a; }
.ladder-stage.now { opacity: 1; background: #e2c26a; color: #1b1517; font-weight: 700; border-color: #e2c26a; }
/* Filter chips: one row each, scrolling sideways (items, crafting). */
.filter-chips { display: grid; gap: 2px; margin: 4px 0 8px; }
.filter-chips .cat-chips { flex-wrap: nowrap; overflow-x: auto; margin: 0; padding-bottom: 4px; scrollbar-width: none; }
.filter-chips .cat-chips::-webkit-scrollbar { display: none; }
.filter-chips .cat-chip { flex: 0 0 auto; white-space: nowrap; }
.filter-chips .cat-chip.empty { opacity: 0.45; }
/* The detail of a tapped item opens right under its row of the grid. */
.icon-grid > .grid-detail { grid-column: 1 / -1; display: grid; gap: 6px; padding: 8px; border-radius: 8px; background: color-mix(in srgb, var(--gold) 10%, transparent); scroll-margin: 8px; }
.icon-grid > .grid-detail .picker-actions { flex-wrap: wrap; justify-content: flex-start; }
.icon-grid > .grid-detail[hidden] { display: none; }
.dg-journal { max-height: 50vh; overflow-y: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; min-width: 0; }
.dg-jrow { margin: 0 0 4px; font-size: 0.85rem; line-height: 1.4; overflow-wrap: anywhere; }
.dg-jrun > summary { cursor: pointer; font-weight: 700; font-size: 0.9rem; padding: 4px 0; }

/* The dungeon chooser (src/dungeon-choose.js): a button for each dungeon on a picture of its place. */
.dgc-page { display: grid; gap: 8px; min-width: 0; }
.dgc-page > p, .dgc-page > small { margin: 0; }
.dgc-open { width: 100%; }
.menu-panel .dgc-card { width: min(520px, 100%); }
.dgc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dgc-head h2 { margin: 0; }
.menu-panel .dgc-x { flex: 0 0 auto; min-width: 40px; min-height: 40px; padding: 0; font-size: 1.3rem; }
.dgc-item { --r-color: #8a8478; display: grid; gap: 4px; padding: 0 0 8px; border: 2px solid var(--r-color); border-radius: 6px; background: #2a2224 center / cover no-repeat; image-rendering: pixelated; min-width: 0; overflow: hidden; }
.dgc-item.locked { filter: grayscale(0.7) brightness(0.8); }
.menu-panel .dgc-btn { display: grid; gap: 3px; width: 100%; min-height: 96px; align-content: end; text-align: left; padding: 10px 12px; background: transparent; border: 0; box-shadow: none; color: #f6efd9; font: inherit; min-width: 0; }
.menu-panel .dgc-btn:hover:not(:disabled) { background: rgb(255 255 255 / 0.08); }
.menu-panel .dgc-btn:disabled { cursor: not-allowed; opacity: 1; }
.dgc-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.dgc-name { font-size: 1.05rem; text-shadow: 0 1px 3px #000; overflow-wrap: anywhere; }
.dgc-tier.rarity-badge { margin: 0; flex: 0 0 auto; background: rgb(10 8 12 / 0.65); color: #f6efd9; border-color: var(--r-color); }
.dgc-desc { font-size: 0.82rem; line-height: 1.35; color: #e6dcc0; text-shadow: 0 1px 2px #000; overflow-wrap: anywhere; }
.dgc-why { font-size: 0.82rem; color: #ffb4a0; text-shadow: 0 1px 2px #000; overflow-wrap: anywhere; }
.dgc-item.r-uncommon { --r-color: #7fcf8c; } .dgc-item.r-rare { --r-color: #6aa6f0; } .dgc-item.r-epic { --r-color: #c39af0; } .dgc-item.r-legendary { --r-color: #f0b45a; }

.dgc-danger { display: flex; flex-wrap: wrap; gap: 4px 10px; padding: 0 12px 8px; font-size: 0.8rem; color: #e8dcc0; }
.dgc-dg { padding: 0 8px; border: 1px solid var(--dg-color, #9a9484); border-radius: 999px; background: rgb(10 8 12 / 0.7); color: color-mix(in srgb, var(--dg-color, #9a9484) 55%, #fff); line-height: 1.6; }
.dgc-dg.dg-safe { --dg-color: #7fcf8c; } .dgc-dg.dg-ok { --dg-color: #b8d27a; } .dgc-dg.dg-risky { --dg-color: #f0c45a; } .dgc-dg.dg-hard { --dg-color: #f09a5a; } .dgc-dg.dg-deadly { --dg-color: #e8645a; }

.dg-modes { position: absolute; z-index: 36; right: var(--gutter-r, 8px); top: 92px; width: min(236px, calc(100% - 16px)); display: flex; flex-direction: column; align-items: flex-end; }
.dg-modes[hidden] { display: none; }
.scene:has(.vig) .dg-modes { visibility: hidden; pointer-events: none; }
.dg-mode-btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; padding: 3px 10px; border: 2px solid #e9d9a8; border-radius: 999px; background: linear-gradient(180deg, rgb(42 33 28 / 0.94), rgb(24 19 18 / 0.94)); color: #f4e8c8; cursor: pointer; touch-action: manipulation; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); }
.dg-mode-btn:hover, .dg-mode-btn:focus-visible { filter: brightness(1.12); }
.dg-mode-cur { font-size: 0.8rem; line-height: 1.3; color: #fff4d2; }
.dg-mode-caret { font-size: 0.8rem; color: #e9d9a8; transition: transform 0.15s; }
.dg-mode-btn.open .dg-mode-caret { transform: rotate(180deg); }
.dg-menu { display: grid; grid-template-columns: repeat(auto-fill, minmax(102px, 1fr)); width: min(440px, 92vw); gap: 3px; margin-top: 4px; padding: 3px; border: 2px solid #e9d9a8; border-radius: 12px; background: linear-gradient(180deg, rgb(46 37 31 / 0.97), rgb(26 21 20 / 0.97)); box-shadow: 0 6px 14px rgba(0, 0, 0, 0.55); }
.dg-menu[hidden] { display: none; }
.dg-menu-item { display: grid; grid-template-columns: 20px 1fr 12px; align-items: center; gap: 4px; text-align: left; font: inherit; padding: 3px 6px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #f1e6c8; cursor: pointer; touch-action: manipulation; }
.dg-menu-item:hover, .dg-menu-item:focus-visible { background: rgb(233 217 168 / 0.14); }
.dg-menu-item.on { background: color-mix(in srgb, var(--jade, #3f7d62) 55%, transparent); border-color: rgb(233 217 168 / 0.6); color: #fff; }
.dg-menu-ico { font-size: 0.95rem; text-align: center; }
.dg-menu-name { font-size: 0.76rem; line-height: 1.25; white-space: nowrap; }
.dg-menu-tick { color: #ffe08a; font-weight: 700; font-size: 0.7rem; text-align: center; }
.dg-menu-sep { display: none; }
.dg-menu-item.camp .dg-menu-ico { color: #f0b45a; }
/* the arts of a lesson told by kind (players 2026-11-04) */
.go-confirm .pick-group { margin: 10px 0 2px; font-size: 0.9em; font-weight: 700; color: var(--muted, #6b5a3a); border-bottom: 1px dashed var(--gold, #a8742a); }

/* The Court tab (ui.js renderCourt, docs/69 P5). */
.my-court { display: grid; gap: 8px; align-content: start; }
.court-page { display: grid; gap: 8px; }
.reign-prov { display: grid; gap: 2px; margin-top: 4px; }
.court-page h4 { margin: 6px 0 0; }
.court-bar { height: 10px; background: var(--line); border-radius: 5px; overflow: hidden; }
.court-bar i { display: block; height: 100%; background: var(--gold); border-radius: 5px; }
.court-bar.bad i { background: #c0584a; }
.court-ok { color: var(--jade, #2c6b59); }
.court-chip { display: inline-block; padding: 1px 8px; border: 1px solid var(--line); border-radius: 12px; font-size: 0.75rem; white-space: nowrap; }
.court-chip.side-ally { border-color: var(--jade, #2c6b59); color: var(--jade, #2c6b59); }
.court-chip.side-foe { border-color: #c0584a; color: #c0584a; }
.court-person { display: flex; align-items: center; gap: 8px; width: 100%; padding: 4px 8px; text-align: left; flex-wrap: wrap; }
.court-person img { width: 36px; height: 36px; image-rendering: pixelated; border-radius: 4px; flex: 0 0 auto; }
.court-person-words { display: grid; flex: 1 1 120px; min-width: 0; }
.court-loy { display: grid; gap: 1px; flex: 0 0 84px; }
.court-faction { gap: 6px; }
.court-prices { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0; }
.court-order.off { opacity: 0.85; }
.court-confirm { display: grid; gap: 6px; margin-top: 4px; padding: 6px; border: 1px dashed var(--line); border-radius: 6px; }
.court-confirm-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.court-confirm select { max-width: 100%; }
.court-result { border-left-color: var(--gold); }
.court-act { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; }
.court-act.on { border-color: var(--gold); }
.court-act.off { opacity: 0.6; }
.court-act-words { display: grid; flex: 1 1 auto; min-width: 0; }
.court-share { flex: 0 0 auto; }
@media (max-width: 520px) { .tabs button[data-tab="court"] { min-width: 0; } }
.court-bad { color: #c0584a; }
.story-card .court-person { justify-self: stretch; }

/* The Works and Schemes pages of the Court tab (court-craft-ui.js, docs/69 P7c, P7d). */
.court-crafts button { display: inline-flex; align-items: center; gap: 3px; min-height: 36px; }
.court-work { display: grid; gap: 6px; }
.court-work.off { opacity: 0.7; }
.court-work-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.court-needs { display: flex; flex-wrap: wrap; gap: 4px; }
.court-work button, .court-act button { min-height: 40px; }
.court-act .court-act-words small { overflow-wrap: anywhere; }
button.danger { background: #8e3a30; color: #fff; border-color: #8e3a30; }
/* Where can I find this? (ing-sources-ui.js) */
.src-block { margin: 8px 0; min-width: 0; }
.src-row { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; padding: 4px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.src-row > strong { flex: 0 0 auto; }
.src-row > small { flex: 1 1 12rem; min-width: 0; }
.src-row.hint > small { font-style: italic; }
.src-row .src-go { min-height: 34px; padding: 2px 10px; max-width: 100%; white-space: normal; }
.src-finder { margin: 6px 0; min-width: 0; }
.src-finder summary, .src-item summary { cursor: pointer; padding: 4px 0; }
.src-item summary.miss { color: #d8443a; }
.src-item { border-top: 1px solid var(--line); padding-left: 6px; }
/* The close button of a person card's learn / give / ask / invite list (learn-give-ui.js). */
.lg-box .lg-hide { float: right; margin: 0 0 4px 8px; }
.lg-box .act-row button.active { outline: 2px solid var(--accent, #c9a24a); }
/* The menu's "cloud last synced" line (ui.js syncLineEl); red when the last upload failed. */
.sync-line.bad { color: var(--danger, #b8353a); font-weight: 600; }

/* The grades in order, the one shown ringed (ui.js gradeLadderEl). */
.grade-ladder { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 4px; margin: 2px 0 4px; font-size: 0.72rem; color: var(--muted); }
.grade-ladder .gl-step { padding: 0 5px; border: 1px solid var(--tier-ink); border-radius: 999px; color: var(--tier-ink); line-height: 1.5; white-space: nowrap; opacity: 0.7; }
.grade-ladder .gl-step.on { opacity: 1; font-weight: 700; box-shadow: 0 0 0 1px var(--tier-ink); }
.grade-ladder .gl-arrow { opacity: 0.6; }
.refine-many { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
/* The World Dungeon's call (players, 2026-11-07: "the dungeon notice is too small to see"):
   larger, two lines, a bold title and a big join button, and a slow glow. */
.notice.notice-big { top: 50%; transform: translate(-50%, -50%); flex-direction: column; align-items: stretch; gap: 8px; width: min(340px, calc(100% - 24px));
  padding: 14px 16px; font-size: 1.05rem; text-align: center; border-width: 2px; box-shadow: 0 0 0 3px rgb(224 184 90 / 0.25), 0 6px 22px rgb(0 0 0 / 0.55); animation: notice-glow 1.6s ease-in-out infinite alternate; }
.notice.notice-big .notice-title { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; color: #ffd98a; }
.notice.notice-big button:not(.link) { min-height: 44px; font-size: 1.05rem; font-weight: 700; background: #8f2b23; color: #fff6e0; border: 2px solid #e6c45a; border-radius: 8px; }
.notice.notice-big .link { position: absolute; top: 4px; right: 6px; }
@keyframes notice-glow { from { box-shadow: 0 0 0 3px rgb(224 184 90 / 0.2), 0 6px 22px rgb(0 0 0 / 0.55); } to { box-shadow: 0 0 0 6px rgb(224 184 90 / 0.45), 0 6px 22px rgb(0 0 0 / 0.55); } }
@media (prefers-reduced-motion: reduce) { .notice.notice-big { animation: none; } }

/* ---- The world chat on a phone (ui.js belowShown: the World tab's chat page; the owner
   2026-11-12: the chat belongs in the World menu, the scene above it never shrunk or covered).
   A compact messenger; a computer keeps its own chat. ---- */
:root { --name-s: 62%; --name-l: 33%; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --name-l: 72%; } }
:root[data-theme="dark"] { --name-l: 72%; }
/* The World tab's button: how many lines came while away, "@" when one was called by name. */
body.chat-below .tabs button[data-tab="world"] { position: relative; }
body.chat-below .tabs button[data-tab="world"][data-badge]::after { content: attr(data-badge); position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; padding: 1px 5px; border-radius: 99px; background: var(--cinnabar); color: #fff; font-size: 11px; line-height: 16px; font-weight: 700; box-shadow: 0 0 0 2px var(--paper); }
body.chat-below .tabs button[data-tab="world"].badge-at[data-badge]::after { background: #d8262c; }
/* The page: the chips and who is online in one row (the line above it gives its room to the lines). */
/* (The owner, 2026-11-13: the chips sit at the right of the who-is-online row, the World tab's sub tabs below as they are.) */
body.chat-below .world.on-chat > .world-top { display: flex; min-height: 32px; padding-right: 136px; flex-wrap: nowrap; }
body.chat-below .world.on-chat > .world-top .world-stats { margin: 0; font-size: 0.74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* (The chips go up to the right end of the World tab's own row, as on a computer: the lines get that row's room.) */
body.chat-below .world.on-chat { position: relative; }
body.chat-below .world.on-chat > .world-tabs { padding-right: 0; }
body.chat-below .world.on-chat .chat-under { position: static; }
body.chat-below .world.on-chat .bc-head { position: absolute; top: 0; right: 0; z-index: 2; height: 32px; padding-left: 8px; background: var(--paper); }
body.chat-below .world.on-chat .bc-online { display: none; }
body.chat-below .world.on-chat .chat-under .chat-filter .chip { min-height: 28px; padding: 0 10px; font-size: 0.78rem; }
body.chat-below .world-panel:has(> .chat-under) { overflow: hidden; gap: 0; padding-top: 4px; }
.world-panel > .chat-under { display: flex; flex-direction: column; flex: 1 1 0; min-height: 0; gap: 4px; position: relative; }
.chat-under .bc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chat-under .chat-filter { margin: 0; gap: 4px; }
.chat-under .chat-filter .chip { min-height: 40px; padding: 2px 16px; font-size: 0.85rem; box-shadow: none; }
.chat-under .chat-filter .chip.active { box-shadow: none; }
.chat-under .bc-online { font-size: 0.74rem; color: var(--muted); white-space: nowrap; }
.chat-under > p.muted { margin: 0; font-size: 0.78rem; }
.chat-under > p.muted:empty { display: none; }
.chat-under .chat-list { display: block; height: auto; flex: 1 1 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 0 4px; border: 0; border-radius: 0; background: transparent; }
.chat-under .chat-older { display: block; margin: 4px auto; }
/* One message: the name in its colour and the time on the first line, the words under it; a sender's next lines only their words. */
.chat-under .chat-line { display: block; margin: 0; padding: 4px 8px 2px; border-radius: 8px; line-height: 1.42; font-size: 0.93rem; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; transition: background 0.2s; }
.chat-under .chat-line + .chat-line:not(.cont) { margin-top: 1px; border-top: 1px solid color-mix(in srgb, var(--line) 55%, transparent); border-top-left-radius: 0; border-top-right-radius: 0; }
.chat-under .chat-line.cont { padding-top: 0; }
.chat-under .chat-line > .admin-badge, .chat-under .chat-line > .life-title-chip { font-size: 0.66rem; margin-right: 4px; vertical-align: 1px; }
.chat-under .chat-line > .chat-name { display: inline-block; color: hsl(var(--nh, 160) var(--name-s) var(--name-l)); font-weight: 700; padding: 0; margin-right: 6px; max-width: 62%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; min-height: 0; background: none; border: 0; box-shadow: none; }
.chat-under .chat-line > small { display: none; }
.chat-under .chat-line > .chat-time { float: right; margin: 3px 0 0 8px; font-size: 0.68rem; }
.chat-under .chat-line > .chat-text:empty { display: none; }
.chat-under .chat-line > .show-event { margin: 3px 0; padding: 4px 4px 4px 10px; }
.chat-under .chat-line .show-event .show-line { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 0.88rem; line-height: 1.35; }
.chat-under .chat-line .show-event button { min-height: 44px; padding: 0 12px; border: 1px solid var(--jade); border-radius: 6px; color: var(--jade); font-weight: 700; text-decoration: none; }
.chat-under .chat-line > .chat-reacts { display: flex; margin: 3px 0 1px; }
.chat-under .chat-line.cont > :is(.chat-time, .chat-name, .admin-badge, .life-title-chip) { display: none; }
.chat-under .chat-line .chat-reacts .react-add, .chat-under .chat-line .chat-reacts .react-report, .chat-under .chat-line .chat-reacts .react-picker { display: none; }
.chat-under .chat-line .chat-reacts:not(:has(.react-pill)) { display: none; }
.chat-under .chat-line .chat-reacts .react-pill { min-height: 28px; padding: 0 8px; font-size: 0.78rem; box-shadow: none; border-radius: 99px; }
.chat-under .chat-line.mine { background: color-mix(in srgb, var(--jade) 9%, transparent); }
.chat-under .chat-line.called { background: rgba(216, 38, 44, 0.1); border-left: 3px solid #d8262c; }
.chat-under .chat-line.pressed { background: color-mix(in srgb, var(--jade) 22%, transparent); }
.chat-under .chat-line .chat-actions { display: none; }
.chat-under .bc-new { position: absolute; left: 50%; bottom: 56px; transform: translateX(-50%); z-index: 2; min-height: 34px; padding: 2px 16px; border-radius: 99px; background: var(--jade); border-color: var(--jade); color: #fff; font-size: 0.82rem; font-weight: 700; box-shadow: 0 2px 8px rgb(0 0 0 / 0.25); }
.chat-under .bc-new[hidden] { display: none; }
.chat-under .bc-form { position: relative; gap: 6px; }
.chat-under .bc-at { position: absolute; left: 0; right: 0; bottom: calc(100% + 2px); z-index: 3; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 4px 2px; background: color-mix(in srgb, var(--paper) 94%, transparent); box-shadow: 0 -4px 10px rgb(0 0 0 / 0.12); border-radius: 8px 8px 0 0; }
.chat-under .bc-at[hidden] { display: none; }
.chat-under .bc-at-pick { flex: none; min-height: 44px; padding: 2px 12px; border-radius: 99px; color: hsl(var(--nh, 160) var(--name-s) var(--name-l)); font-weight: 700; white-space: nowrap; box-shadow: none; }
.chat-under .bc-form input { min-height: 46px; padding: 6px 12px; border-radius: 8px; font-size: 16px; }
.chat-under .bc-send { min-width: 70px; min-height: 46px; padding: 4px 12px; font-weight: 700; }
.chat-under .bc-send.slow { font-variant-numeric: tabular-nums; }
/* A message's sheet (a long press, or a tap on the name): over the panel only (ui.js chatSheet), below the choice card (z 20). */
.bc-sheet-wrap { position: fixed; inset: 0; z-index: 18; display: flex; align-items: flex-end; justify-content: center; background: color-mix(in srgb, #000 10%, transparent); }
.bc-sheet { width: 100%; max-width: 560px; max-height: 100%; overflow-y: auto; overscroll-behavior: contain; display: grid; gap: 10px; padding: 10px 14px max(14px, calc(env(safe-area-inset-bottom, 0px) / var(--zoom, 1))); background: var(--surface); border-top: 4px solid hsl(var(--nh, 160) var(--name-s) var(--name-l)); border-radius: 14px 14px 0 0; box-shadow: 0 -6px 24px rgb(0 0 0 / 0.28); animation: bc-up 0.18s ease-out; }
@keyframes bc-up { from { transform: translateY(40px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .bc-sheet { animation: none; } }
.bc-sh-head { display: flex; align-items: center; gap: 8px; }
.bc-sh-who { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.bc-sh-name { color: hsl(var(--nh, 160) var(--name-s) var(--name-l)); font-family: var(--font-display); font-size: 1.1rem; }
.bc-sh-close { min-width: 48px; min-height: 48px; padding: 0; box-shadow: none; }
.bc-sh-quote { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; padding: 4px 10px; border-left: 3px solid var(--line); color: var(--muted); font-size: 0.9rem; line-height: 1.4; }
.bc-sh-reacts { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; }
.bc-sh-reacts button { min-height: 48px; padding: 0; font-size: 1.3rem; box-shadow: none; }
.bc-sh-reacts button.mine { outline: 2px solid var(--cinnabar); }
.bc-sh-acts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.bc-sh-acts button, .bc-sh-acts select { min-height: 48px; padding: 4px 8px; font-size: 0.9rem; }
.bc-sh-acts .bc-report { color: var(--cinnabar); }
.bc-sh-acts .bc-report.reported { opacity: 0.6; }
@media (pointer: coarse) and (orientation: landscape) and (max-height: 620px) {
  .bc-sheet-wrap { left: 46%; }
  .bc-sheet { max-height: 92%; }
}
/* Typing upright: the top bar, the stats and the tabs step aside; the scene keeps its size (--scene-keep,
   measured before) and stays whole in view, however short the screen (the owner's rule: the scene is never
   shrunk or cut while chatting), the newest lines and the box right under it. */
@media (max-width: 899px) and (orientation: portrait) and (pointer: coarse) {
  body.chat-typing .screen.game > .topbar, body.chat-typing .screen.game > .stats, body.chat-typing .screen.game > .tabs,
  body.chat-typing .world > .world-tabs, body.chat-typing .chat-under .bc-head, body.chat-typing .chat-under > p.muted { display: none !important; }
  body.chat-typing .screen.game .panel { padding-top: 2px; }
  body.chat-typing .world-panel:has(> .chat-under) { padding-top: 0; }
  body.chat-typing .screen.game > .scene { height: var(--scene-keep) !important; min-height: 0 !important; margin-top: calc(env(safe-area-inset-top, 0px) / var(--zoom, 1)); }
}
/* Typing held sideways: the scene takes the whole left side (the top and the stats step aside), the right
   column is the lines and the box. */
@media (pointer: coarse) and (orientation: landscape) and (max-height: 620px) {
  body.chat-typing .screen.game > .topbar, body.chat-typing .screen.game > .stats, body.chat-typing .screen.game > .tabs,
  body.chat-typing .world > .world-tabs, body.chat-typing .chat-under .bc-head, body.chat-typing .chat-under > p.muted { display: none !important; }
  body.chat-typing .screen.game > .scene { grid-row: 1 / 4; }
  body.chat-typing .screen.game .panel { grid-row: 1 / 4; padding-top: 4px; margin-bottom: 0; }
  .chat-under .chat-filter .chip { min-height: 36px; padding-inline: 12px; }
}

/* ---- The phone's popups (ui.js popSync; the owner 2026-11-12): the Map and the Bag open
   as a window over the whole game, the scene seen faintly behind, the clock held while one is open. ---- */
.pop-head { display: none; }
.pop-veil { display: none; position: fixed; inset: 0; z-index: 18; background: rgb(12 10 8 / 0.55); animation: pop-veil 0.18s ease-out; }
@keyframes pop-veil { from { opacity: 0; } }
/* A window over the game, not the whole screen (the owner, 2026-11-12/13: "a popup not full screen,
   the game seen faintly behind"; on every screen); the page under it stays as it was; a tap on the veil closes it. */
.pop-win { display: none; }
body.pop-full .pop-win { display: block; position: fixed; z-index: 19; inset: max(28px, calc(calc(env(safe-area-inset-top, 0px) / var(--zoom, 1)) + 16px)) max(10px, calc(env(safe-area-inset-right, 0px) / var(--zoom, 1))) max(14px, calc(calc(env(safe-area-inset-bottom, 0px) / var(--zoom, 1)) + 10px)) max(10px, calc(env(safe-area-inset-left, 0px) / var(--zoom, 1))); min-height: 0; margin: 0; padding: 0 var(--gutter-r) 16px var(--gutter-l); overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); box-shadow: 0 12px 40px rgb(0 0 0 / 0.45); }
html.has-upd body.pop-full .pop-win { top: calc(var(--upd-h, 0px) + 12px); }
/* (On a computer a window of its own width in the middle, the game round it.) */
@media (min-width: 900px) { body.pop-full .pop-win { top: 5vh; bottom: 5vh; left: max(16px, calc(50% - 440px)); right: max(16px, calc(50% - 440px)); } }
body.pop-full .pop-veil { display: block; }
body.pop-full .pop-win.pop-rise { animation: pop-rise 0.18s ease-out; }
body.pop-full .pop-head { display: flex; position: sticky; top: 0; z-index: 5; align-items: center; gap: 8px; min-height: 52px; margin: 0 calc(-1 * var(--gutter-r)) 8px calc(-1 * var(--gutter-l)); padding: 4px var(--gutter-r) 4px var(--gutter-l); background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: 0 2px 8px rgb(0 0 0 / 0.08); }
.pop-head .pop-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 1.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pop-head .pop-title::before { content: ""; flex: none; width: 28px; height: 28px; background: var(--tab-icon) center / contain no-repeat; image-rendering: pixelated; }
.pop-head .pop-paused { flex: none; padding: 2px 10px; border-radius: 99px; border: 1px dashed var(--muted); color: var(--muted); font-size: 0.75rem; white-space: nowrap; }
.pop-head .pop-choice { flex: none; min-height: 40px; padding: 0 10px; font-size: 0.85rem; white-space: nowrap; }
.pop-head .pop-x { flex: none; min-width: 48px; min-height: 44px; padding: 0 10px; font-size: 1.1rem; }
/* (The Bag's window is as tall as what it holds, up to the full height: no half-empty box round two things; QA 2026-11-12.) */
/* (The map's own sticky row sits under the popup's head.) */
body.pop-full .map-topbar { top: 52px; }
@keyframes pop-rise { from { transform: translateY(24px); opacity: 0.5; } }
@media (prefers-reduced-motion: reduce) { body.pop-full .pop-win.pop-rise { animation: none; } }
/* (The player's pause holds every animation: a popup's or a message sheet's own entrance still plays.) */
body.frozen.pop-full .pop-win.pop-rise, body.frozen .pop-veil, body.frozen .bc-sheet { animation-play-state: running !important; }

/* ---- The phone's rows and talk pages (the owner, 2026-11-12: "every sub tab row one row that
   scrolls sideways, nothing spills out"; "the AI's chat like the world chat, no scrolling";
   "as little empty space as can be"). ---- */
@media (max-width: 899px) and (orientation: portrait) and (pointer: coarse), (pointer: coarse) and (orientation: landscape) and (max-height: 620px) {
  /* Every row of sub tabs and chips: one line that scrolls sideways (never two or three lines, never
     cut off), the edge with more beyond it faded (ui.js hrowsSync), room below for the buttons' edge. */
  :is(.cx-tabs, .world-tabs, .map-jump, .cat-chips, .chat-filter, .dress-row) { display: flex; flex-wrap: nowrap !important; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: none; max-width: 100%; min-width: 0; }
  :is(.cx-tabs, .map-jump, .cat-chips) { padding-bottom: 4px; }
  /* (A row asks no width of its own: a box holding it is never pushed wider than the panel.) */
  :is(.cx-tabs, .map-jump, .cat-chips) { contain: inline-size; width: 100%; }
  :is(.cx-tabs, .world-tabs, .map-jump, .cat-chips, .chat-filter, .dress-row)::-webkit-scrollbar { display: none; }
  :is(.cx-tabs, .world-tabs, .map-jump, .cat-chips, .chat-filter) > * { flex: 0 0 auto !important; white-space: nowrap; }
  :is(.cx-tabs, .map-jump, .cat-chips) > button { min-height: 40px; }
  /* (Every row's buttons a finger's height: the World and Log rows, the chat's chips, the treasury's own row
     whose older rule asked 26px.) */
  .screen.game :is(.world-tabs, .log-tabs, .chat-filter) > button, .screen.game .chat-under .chat-filter .chip, .treasury .cx-tabs.sub button { min-height: 40px; }
  body.chat-below .world.on-chat .chat-under .chat-filter .chip { min-height: 40px; }
  .place-acts button { min-height: 40px; }
  /* (No news yet: a line says so, not a blank page.) */
  .log.sub-news:not(:has(li.news-item))::before { content: attr(data-none); display: block; padding: 12px 4px; color: var(--muted); font-size: 0.9rem; }
  /* (A notable's row opens their card; what they are shows on its one line, cut with "…".) */
  .town-notable > small.xfh { display: block; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .hfade-r { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent) !important; mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent) !important; }
  .hfade-l { -webkit-mask-image: linear-gradient(90deg, transparent, #000 32px) !important; mask-image: linear-gradient(90deg, transparent, #000 32px) !important; }
  .hfade-l.hfade-r { -webkit-mask-image: linear-gradient(90deg, transparent, #000 32px, #000 calc(100% - 32px), transparent) !important; mask-image: linear-gradient(90deg, transparent, #000 32px, #000 calc(100% - 32px), transparent) !important; }
  .menu-body.codex .cx-tabs:not(.hfade-r):not(.hfade-l) { -webkit-mask-image: none; mask-image: none; }
  .people-subs { margin: 4px 0 2px; }
  .map-jump { margin: 6px 0 0; }

  /* The AI and a private thread laid out as the world chat: the lines fill the page between the
     World tab's row and the box, the box at the foot, the page itself not scrolled. Who is online
     steps aside (the chat's head carries it); the AI page's "?" and "clear" go up beside the row. */
  /* (The head row of who is online stands on every page at one height, so the tab row never jumps
     between pages; players 2026-11-14: "the row won't stay still". The AI page's "?" and "clear" sit at its end.) */
  body.chat-below .world > .world-top { display: flex; height: 40px; min-height: 40px; box-sizing: border-box; flex-wrap: nowrap; align-items: center; }
  body.chat-below .world[data-sub="ai"] > .world-top { padding-right: 40px; }
  body.chat-below .world[data-sub="ai"]:has(.ai-line) > .world-top { padding-right: var(--ai-over, 160px); }
  body.chat-below .world.on-chat .bc-head { height: 40px; }
  body.chat-below .world[data-sub="ai"] { position: relative; }
  /* (The row ends where the "?" and "clear" begin, so its fade falls on the tab cut off there and
     nothing shows through them; QA 2026-11-12: "ชี ล้างการสนทนา".) */
  body.chat-below .world-panel:has(> .ai-box), body.chat-below .world-panel:has(> .dm) { overflow: hidden; gap: 0; padding-top: 4px; }
  body.chat-below .world-panel > .ai-box, body.chat-below .world-panel > .dm { display: flex; flex-direction: column; flex: 1 1 0; min-height: 0; gap: 4px; }
  body.chat-below .ai-box > .hall-tip, body.chat-below .ai-box > button.link { position: absolute; top: 0; z-index: 2; height: 40px; display: flex; align-items: center; margin: 0; background: var(--paper); }
  body.chat-below .ai-box > .hall-tip { right: 0; width: 40px; justify-content: center; }
  /* ("Clear" reads as an action, not one more tab: a small outlined button with a cross.) */
  body.chat-below .ai-box > button.link { right: 40px; top: 2px; height: 36px; min-height: 36px; max-width: calc(var(--ai-over, 160px) - 46px); padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 0.78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; color: var(--muted); }
  body.chat-below .ai-box > button.link::before { content: "\2715"; margin-right: 4px; font-size: 0.7rem; }
  body.chat-below .ai-box:not(:has(.ai-line)) > button.link { display: none; }
  body.chat-below :is(.ai-box > .ai-list, .dm > .dm-thread, .dm > .dm-list) { flex: 1 1 0; min-height: 0; height: auto; overflow-y: auto; overscroll-behavior: contain; margin: 0; padding: 2px 0 4px; border: 0; border-radius: 0; background: transparent; }
  body.chat-below .ai-box > .ai-list { display: flex; flex-direction: column; gap: 6px; }
  body.chat-below .ai-list > .ai-line:first-child { margin-top: auto; }
  body.chat-below .ai-list > p.muted:only-child { margin: auto; padding: 0 16px; text-align: center; font-size: 0.9rem; }
  body.chat-below .dm > .row { min-height: 40px; margin: 0; padding: 0; gap: 8px; align-items: center; flex-wrap: nowrap; }
  body.chat-below .dm > .row > button.link { min-height: 40px; padding: 0 6px 0 0; }
  body.chat-below .dm > .row > b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* (Typing in a thread: the back row steps aside like the tab row, the lines get its room.) */
  body.chat-typing .dm > .row { display: none; }
  body.chat-below .dm-thread .chat-line { max-width: 86%; margin: 0; padding: 5px 10px; border-radius: 10px; background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--ink); text-align: left; overflow-wrap: anywhere; }
  body.chat-below .dm-thread .chat-line.mine { align-self: flex-end; background: color-mix(in srgb, var(--jade) 16%, transparent); }
  body.chat-below .dm-thread { display: flex; flex-direction: column; gap: 4px; }
  body.chat-below .dm-thread > .chat-line:first-child { margin-top: auto; }
  body.chat-below .dm-thread .chat-line > small { display: block; font-size: 0.68rem; }
  body.chat-below :is(.ai-box, .dm) > .chat-form { flex: none; gap: 6px; }
  body.chat-below :is(.ai-box, .dm) > .chat-form input { min-height: 46px; padding: 6px 12px; border-radius: 8px; font-size: 16px; }
  body.chat-below :is(.ai-box, .dm) > .chat-form button { min-height: 46px; padding: 0 16px; }
  body.chat-typing .ai-box > .hall-tip, body.chat-typing .ai-box > button.link { display: none; }

  /* Less empty room: a page's lone "?" sits beside what is before or after it, not on a line of
     its own; the Life tab's names take only the room they need. */
  .hall-week { display: flex; flex-wrap: wrap; align-items: center; column-gap: 8px; }
  .hall-week > * { flex: 1 1 100%; }
  .hall-week > .hall-countdown { flex: 1 1 0; min-width: 0; margin: 0; }
  .hall-week > .hall-tip { flex: none; }
  .dgc-page { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
  .dgc-page > * { flex: 1 1 100%; min-width: 0; }
  .dgc-page > .dgc-open { flex: 1 1 0; order: -2; }
  .dgc-page > .hall-tip { flex: none; order: -1; }
  .character dl { grid-template-columns: fit-content(32%) minmax(0, 1fr); gap: 4px 10px; }
  .character dt { font-size: 0.88rem; overflow-wrap: anywhere; }
}
@media (max-width: 899px) and (orientation: portrait) and (pointer: coarse), (pointer: coarse) and (orientation: landscape) and (max-height: 620px) {
  /* (The week's rankings' "?" goes up to the end of the line of who is online.) */
  body.chat-below .world[data-sub="hall"] { position: relative; }
  body.chat-below .world[data-sub="hall"] > .world-top { padding-right: 40px; }
  body.chat-below .world[data-sub="hall"] .hall-week > .hall-tip { position: absolute; top: 0; right: 0; height: 40px; display: flex; align-items: center; margin: 0; }
  body.chat-below .world[data-sub="hall"] .hall-week > .hall-tip .tip-q { width: 26px; height: 26px; }
}
@media (max-width: 899px) and (orientation: portrait) and (pointer: coarse), (pointer: coarse) and (orientation: landscape) and (max-height: 620px) {
  /* The Map's own buttons on one line each (not two lines of a tall button); the gear and the bag five to a row. */
  .map-topbar { gap: 6px; margin-bottom: 6px; padding: 4px 0; }
  .map-topbar .map-top-btn { min-height: 44px; padding: 2px 4px; font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .icon-grid { grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); gap: 6px 4px; }
}
@media (max-width: 899px) and (orientation: portrait) and (pointer: coarse), (pointer: coarse) and (orientation: landscape) and (max-height: 620px) {
  /* Explanations folded to their headings (ui.js xfSync, the owner 2026-11-12: "just the headings").
     A line marked under a name hides; the name's row carries the chevron and opens it. A note shows
     its first line (cut with "…", never a sliver of the second) and the chevron. The chevron points down when shut, up when open. */
  .xf-host { position: relative; padding-right: 30px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .xf-host > .xfh { display: none !important; }
  .xf-host.xf-open > .xfh { display: block !important; }
  .xf-host.xf-open > small.xfh { display: block !important; }
  .xf-chev { position: absolute; top: 0; right: 0; width: 28px; height: 1.4em; pointer-events: none; }
  .xf-chev::before, .xf-c:not(.xf-fit)::after { content: ""; position: absolute; width: 7px; height: 7px; border: solid currentColor; border-width: 0 2px 2px 0;
    opacity: 0.7; rotate: 45deg; translate: -50% -70%; }
  .xf-chev::before { left: 50%; top: 50%; }
  .xf-host.xf-open > .xf-chev::before { rotate: -135deg; translate: -50% -30%; }
  .xf-c { position: relative; }
  /* (width 0 / min-width 100%: the one long line never widens what holds it.) */
  .xf-c:not(.xf-fit) { display: block; box-sizing: border-box; width: 0; min-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    padding-right: 24px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .xf-c:not(.xf-fit)::after { right: 6px; top: 0.75em; }
  .xf-c.xf-open:not(.xf-fit) { white-space: normal; overflow: visible; }
  .xf-c.xf-open:not(.xf-fit)::after { rotate: -135deg; translate: -50% -30%; }
  .xf-host:focus-visible, .xf-c:focus-visible { outline: 2px solid var(--jade, #5b9); outline-offset: 2px; }
}
@media (max-width: 899px) and (orientation: portrait) and (pointer: coarse), (pointer: coarse) and (orientation: landscape) and (max-height: 620px) {
  /* (A gift folded: its name and tier on one line.) */
  .talent.xf-host { display: flex; flex-wrap: wrap; align-items: center; column-gap: 6px; min-height: 28px; }
  .talent.xf-host > .xfh { flex-basis: 100%; }
}

/* ---- A phone held upright: the top kept tight (the owner, 2026-11-12: "the top could be more compact").
   The name and the speed buttons on one line; title, realm, age and chapter on the next; the bars on
   one line; the five stats on one line; money, karma and fame on one line; the way of life small. ---- */
@media (max-width: 899px) and (orientation: portrait) {
  .topbar { padding-block: max(3px, calc(env(safe-area-inset-top, 0px) / var(--zoom, 1))) 3px; /* (the status bar or the island above it, players 2026-11-14: "nothing at the top can be pressed") */ row-gap: 0; }
  .who strong { font-size: 1.02rem; }
  .speed button, .speed-pick .sp-play, .speed-pick .sp-step { min-height: 34px; padding-block: 2px; }
  .who-line { line-height: 1.2; column-gap: 8px; row-gap: 0; }
  /* (Players 2026-11-14: the top's letters too small: none under 0.78rem.) */
  .who-line span, .who-line #age, .who-line #arc { font-size: 0.74rem; }
  .who-line .hero-title { padding: 0 7px; font-size: 0.72rem; line-height: 1.5; min-height: 0; }
  .screen.game .stats { padding-block: 2px 3px; gap: 1px; }
  .screen.game .stats .bars { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0 10px; }
  .screen.game .stats .bars > .bar[hidden] { display: none; }
  .screen.game .stats .bars > .bar { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label value" "track track"; gap: 0 4px; line-height: 1.15; }
  .screen.game .stats .bar > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .screen.game .stats .bar .track { height: 3px; }
  .screen.game .stats .stat-row { margin-top: 1px; font-size: 0.7rem; }
  .screen.game .stats .meta-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 0 12px; line-height: 1.25; }
  .screen.game .stats .standing { display: contents; }
  .screen.game .stats .money { font-size: 0.74rem; white-space: nowrap; }
  .screen.game .stats .money .info, .screen.game .stats .money button { min-height: 0; min-width: 0; }
  .screen.game .stats .money img, .screen.game .stats .money [data-icon], .screen.game .stats .money .stat-ico { width: 1em; height: 1em; }
  /* (The owner, 2026-11-12: money, karma and fame after the way of life, on its line.) */
  .screen.game .stats .meta-row { flex-wrap: nowrap; gap: 0 9px; overflow: hidden; }
  .screen.game .stats .focus { order: -1; flex: 0 1 auto; gap: 4px; font-size: 0.7rem; min-width: 0; }
  .screen.game .stats .focus > span { white-space: nowrap; }
  .screen.game .stats .focus button { min-height: 28px; padding: 0 7px; font-size: 0.72rem; max-width: 7.5em; }
  .screen.game .stats .money { flex: none; font-size: 0.72rem; }
  .screen.game .stats .money > span[data-t] { display: none; }
}
/* (The owner, 2026-11-12: "move some things so it gets smaller".) Upright, the full screen and day/night
   buttons go into the ≡ menu (ui.js openGameMenu), the title chip and the realm come up beside the name,
   and the age and the chapter share the line under it. */
@media (max-width: 899px) and (orientation: portrait) {
  .topbar #fs-btn, .topbar #theme-btn { display: none; }
  .topbar { grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 8px; align-items: center; }
  .topbar .who-line { display: contents; }
  .who strong { grid-row: 1; grid-column: 1; max-width: 10em; }
  .topbar .who-line #realm { grid-row: 1; grid-column: 2; justify-self: start; align-self: center; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.78rem; }
  .topbar .speed { grid-row: 1; grid-column: 3; }
  /* Row two: the title chip, the age and season, the chapter at the right end. */
  .topbar .who-line .hero-title, .topbar .who-line #age, .topbar .who-line #arc { grid-row: 2; }
  .topbar .who-line .hero-title { grid-column: 1; justify-self: start; white-space: nowrap; max-width: 7em; overflow: visible; }
  .topbar .who-line #age { grid-column: 2 / 4; justify-self: start; text-align: left; max-width: calc(64% - 6px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar .who-line #age .year-bar { padding: 1px; margin: 0 1px; }
  .topbar .who-line #age .year-bar i { width: 2px; height: 7px; }
  .topbar .who-line #arc { grid-column: 2 / 4; justify-self: end; text-align: right; max-width: 36%; }
  .topbar .who-line:not(:has(.hero-title)) #age { grid-column: 1 / 4; }
  .menu-quick { display: flex; gap: 8px; }
  .menu-quick > button { flex: 1; }
  /* (Players 2026-11-14, larger letters: the realm, the age and the chapter wrap onto a second line where
     they don't fit, never cut with "…"; the age and the chapter keep their sides of the line.) */
  .topbar .who-line #realm { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.15; word-break: keep-all; overflow-wrap: anywhere; }
  .topbar .who-line #age, .topbar .who-line #arc { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.2; align-self: center; word-break: keep-all; overflow-wrap: anywhere; }
  .topbar .who-line:not(:has(#arc:not(:empty))) #age { max-width: 100%; }
  .screen.game .stats .stat-row small.stat-cap { font-size: 0.72rem; }
  /* (The way of life, money, karma and fame go onto two lines rather than over each other at a larger text size.) */
  .screen.game .stats .meta-row { flex-wrap: wrap; }
  .screen.game .stats .focus { flex: 0 0 auto; }
  /* (At 115% and 130% (Settings, src/text-size.js) the realm takes a line of its own under the name.) */
  :root:is([data-text-size="115"], [data-text-size="130"]) .topbar .who-line #realm { grid-row: 2; grid-column: 1 / 4; }
  :root:is([data-text-size="115"], [data-text-size="130"]) .topbar .who-line .hero-title,
  :root:is([data-text-size="115"], [data-text-size="130"]) .topbar .who-line #age,
  :root:is([data-text-size="115"], [data-text-size="130"]) .topbar .who-line #arc { grid-row: 3; }
}
@media not ((max-width: 899px) and (orientation: portrait)) { .menu-quick { display: none; } }
/* (A narrow phone: the year's pips give way so the age and the chapter share their line whole.) */
@media (max-width: 389px) and (orientation: portrait) { .topbar .who-line #age .year-bar { display: none; } }
/* (The owner, 2026-11-12: the gaps between a person's action buttons even.) On a phone a person's
   actions sit in two equal columns with even gaps, each button full width and centred. */
@media (max-width: 899px) and (orientation: portrait), (pointer: coarse) and (orientation: landscape) and (max-height: 620px) {
  .pc-pane .act-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .pc-pane .act-row > button { width: 100%; min-width: 0; margin: 0; justify-content: center; text-align: center; white-space: normal; line-height: 1.25; }
  .pc-pane .act-row:empty { display: none; }
}
@media (max-width: 899px) and (orientation: portrait), (pointer: coarse) and (orientation: landscape) and (max-height: 620px) {
  .pc-pane > small.muted.xf-c { display: block; }
  /* A person's card: its page buttons share the row in equal parts. */
  .person-card .pc-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; overflow: visible; -webkit-mask-image: none; mask-image: none; }
  .person-card .pc-tabs > button { width: 100%; min-width: 0; padding-inline: 4px; text-align: center; justify-content: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* "What next" (src/goals.js, ui.js goalCardDraw) and the log's filter chips (the owner, 2026-11-13). */
.goal-card { margin: 4px 0 4px; padding: 5px 9px; border: 1px solid var(--line, #c9b98f); border-left: 4px solid var(--gold, #8f6a12); border-radius: 8px; display: grid; gap: 5px; font-size: 0.85rem; }
.goal-card .goal-head { display: flex; align-items: center; gap: 6px; min-width: 0; }
.goal-card .goal-head strong { font-size: 0.85rem; white-space: nowrap; }
.goal-card .goal-peek { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 0.8rem; }
.goal-card .goal-fold { margin-left: auto; padding: 0 4px; font-size: 0.8rem; min-height: 0; }
.goal-card .goal { display: grid; gap: 1px; }
.goal-card .goal-title { display: flex; align-items: center; gap: 5px; font-weight: 700; text-align: left; padding: 0; border: 0; background: none; color: inherit; font-size: 0.85rem; min-height: 0; justify-content: flex-start; }
.goal-card .goal-go { color: var(--muted); }
.goal-card .goal-ico { width: 14px; height: 14px; flex: none; }
.goal-card .goal-bar { height: 4px; border-radius: 99px; background: color-mix(in srgb, var(--muted, #888) 25%, transparent); overflow: hidden; }
.goal-card .goal-bar i { display: block; height: 100%; background: var(--gold, #8f6a12); border-radius: 99px; }
.goal-card .goal-row { color: var(--muted); line-height: 1.25; font-size: 0.75rem; }
.goal-card .goal-row.yes::before { content: "✓ "; color: var(--jade, #2f8f5b); }
.goal-card .goal-row.no::before { content: "✗ "; color: var(--cinnabar, #b33); }
.goal-card .goal-row.soft::before { content: "△ "; }
.log-filter { display: flex; gap: 6px; padding: 2px 0 4px; }
.log-filter .chip, .screen.game .log-filter .chip { padding: 2px 12px; min-height: 28px; border-radius: 99px; font-size: 0.8rem; }
.log-filter .chip.active { background: var(--btn-sel-bg); color: var(--btn-sel-ink); border-color: var(--btn-sel-bg); font-weight: 700; }
.log.only-ms li:not(.ms) { display: none; }
.log.only-ms details[data-age]:not(:has(li.ms)) { display: none; }
.odds .odds-ico { width: 12px; height: 12px; vertical-align: -2px; margin-right: 3px; }
/* The command bar's turn strip and rarity tints (src/battle-ui.js; docs/74 §9.3) */
.battle-bar .bb-strip { display: flex; align-items: center; gap: 3px; margin-top: 3px; font-size: 10px; }
.battle-bar .bb-strip:empty { display: none; }
.battle-bar .bb-strip .bb-next { opacity: 0.7; margin-right: 2px; }
.battle-bar .bb-strip i { font-style: normal; padding: 0 5px; border-radius: 4px; background: #3a3040; }
.battle-bar .bb-strip i:first-of-type { outline: 1px solid #ffd36a; }
.battle-bar .bb-strip i.me { background: #2f5f8f; }
.battle-bar .bb-strip i.foe { background: #8f3a3a; }
.battle-bar .bb-btn.r-rare { border-color: #4a8fd8; }
.battle-bar .bb-btn.r-epic { border-color: #a35ad8; }
.battle-bar .bb-btn.r-legendary { border-color: #d8a63a; }
/* The Bag tab's Fight page and the fight sheet (src/loadout-ui.js; docs/74 §9.1) */
.fight-sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 2px 10px; font-size: 12px; }
.fight-sheet .fs-row { display: flex; justify-content: space-between; gap: 6px; border-bottom: 1px dotted var(--line, #ccc4); }
.fight-sheet-fold summary { cursor: pointer; font-size: 12px; }
.loadout h3 { margin: 12px 0 4px; }
.loadout .lo-order { display: flex; justify-content: flex-end; margin-bottom: 4px; }
.loadout .lo-slot { display: flex; align-items: flex-start; gap: 6px; padding: 4px 0; border-bottom: 1px solid var(--line, #ccc4); opacity: 0.7; }
.loadout .lo-slot.in { opacity: 1; }
.loadout .lo-n { min-width: 16px; font-weight: 700; text-align: center; }
.loadout .lo-art { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.loadout .lo-art small { overflow-wrap: anywhere; }
.loadout .lo-name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.loadout .lo-name > strong { min-width: 0; overflow-wrap: anywhere; }
.loadout .lo-ico { flex: none; border: 2px solid transparent; border-radius: 6px; background-color: var(--surface); box-sizing: content-box; padding: 1px; }
.loadout .lo-head { font-weight: 600; }
.loadout .lo-line { opacity: 0.85; }
.loadout .lo-tier.up { color: #3f8f4f; } .loadout .lo-tier.down { color: #b0533a; }
.loadout .lo-move { display: flex; flex-direction: column; gap: 2px; }
.loadout .lo-btn { font: inherit; font-size: 12px; padding: 2px 8px; border-radius: 6px; cursor: pointer; }
.loadout .lo-check { display: flex; align-items: center; gap: 6px; margin: 8px 0 2px; }
.loadout .lo-pouch { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 0; font-size: 13px; }
.loadout .lo-pouch input { width: 60px; }
.art-fight { margin: 6px 0; padding: 4px 8px; border-left: 2px solid var(--line, #ccc6); display: flex; flex-direction: column; gap: 1px; }
.art-fight .lo-tier.up { color: #3f8f4f; } .art-fight .lo-tier.down { color: #b0533a; }

/* The stats on a phone held upright (players 2026-11-13: "the numbers spill over the edge" once each shows its
   ceiling, 51/100): five even columns, the name above, the number and its ceiling below on one line. */
@media (max-width: 899px) and (orientation: portrait) {
  .screen.game .stats .stat-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0 4px; text-align: center; }
  .screen.game .stats .stat-row > span { white-space: nowrap; min-width: 0; }
  .screen.game .stats .stat-row i { display: block; overflow: hidden; text-overflow: ellipsis; }
}

/* The gathering place (src/lobby.js, the owner 2026-11-15): full screen over the game, its clock stopped. */
/* (The page under the square is not drawn while it is open: src/lobby.js.) */
body.in-lobby > :not(.lobby) { content-visibility: hidden; }
.lobby { position: fixed; inset: 0; z-index: 95; display: flex; flex-direction: column; background: #151014; color: #f1e9d2; overscroll-behavior: contain; }
.lobby .lb-top { display: flex; align-items: center; gap: 8px; padding: 6px 10px; flex-wrap: wrap; }
.lobby .lb-top h2 { margin: 0; font-family: var(--font-display); font-size: 1.15rem; }
.lobby .lb-status { flex: 1 1 auto; color: #cbbd9c; font-size: 0.85rem; }
.lobby .lb-btn { min-height: 36px; padding: 4px 12px; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.lobby .lb-stage { position: relative; flex: none; height: min(62vh, max(calc(100vw * 100 / 175), 34vh)); overflow: hidden; background: #8fc8f0; touch-action: none; }
.lobby .lb-canvas { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; image-rendering: crisp-edges; }
.lobby .lb-over { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.lobby .lb-note { position: absolute; z-index: 3; left: 50%; top: 8px; transform: translateX(-50%); max-width: 90%; padding: 6px 12px; border-radius: 6px; background: rgb(20 14 16 / 0.82); color: #f6f1e4; font-size: 0.85rem; text-align: center; }
.lobby .lb-reel { position: absolute; right: 12px; top: 10%; bottom: 10%; display: flex; gap: 6px; }
.lobby .lb-reel-bar, .lobby .lb-reel-fill { position: relative; width: 22px; border: 2px solid #2a1f1d; border-radius: 4px; background: #24324a; }
.lobby .lb-reel-fill { width: 10px; background: #3a2a26; }
.lobby .lb-reel-prog { position: absolute; left: 0; right: 0; bottom: 0; background: #7cc46a; }
.lobby .lb-reel-zone { position: absolute; left: 0; right: 0; background: #5aa6d8; }
.lobby .lb-reel-zone.in { background: #7cc46a; }
.lobby .lb-reel-mark { position: absolute; left: -4px; right: -4px; height: 4px; margin-bottom: -2px; background: #f2d24a; border: 1px solid #2a1f1d; }
.lobby .lb-pad { display: flex; align-items: center; gap: 8px; padding: 6px 10px; flex-wrap: wrap; }
.lobby .lb-arrow { width: 56px; font-size: 1.1rem; }
.lobby .lb-arrow[hidden], .lobby .lb-fish[hidden] { display: none; }
/* The fishing pair (src/lobby.js fishGroup, players 2026-11-16): after the sword's button, a little apart from
   it, each button of one width whatever it says, and a part not wanted now held unseen in its place. */
.lobby .lb-fishgroup { display: flex; gap: 8px; margin-left: 6px; }
.lobby .lb-fishgroup[hidden] { display: none; }
.lobby .lb-fishgroup .lb-fish { width: 7.4em; padding-inline: 4px; white-space: nowrap; }
.lobby .lb-fishgroup .lb-auto { width: 8.6em; padding-inline: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lobby .lb-held { visibility: hidden; pointer-events: none; }
.lobby .lb-fly { padding: 4px 10px; }
.lobby .lb-fly.on { background: #3f8f78; color: #f6f1e4; border-color: #9ff0dc; }
.lobby .lb-line.lb-dragon { color: #f0c040; font-weight: 600; }
/* Duels, the player card and pets (src/lobby-duel.js). */
.lobby .lb-line.lb-duel { color: #ffb070; }
/* The chat's tabs (src/lobby-chat.js): ลาน, โลก, เพื่อน, ส่วนตัว, each its own log and unread count. */
.lobby .lb-tabs { display: flex; gap: 4px; padding: 0 10px 4px; }
.lobby .lb-tab { position: relative; flex: 1 1 0; min-height: 30px; padding: 2px 6px; font-size: 0.85rem; background: #241c1f; color: #cbbd9c; border: 1px solid #4a3e3a; border-radius: 6px; }
.lobby .lb-tab.on { background: #3a2d2a; color: #ffe08a; border-color: #e2d6b8; }
.lobby .lb-tab[hidden], .lobby .lb-badge[hidden], .lobby .lb-to[hidden], .lobby .lb-log[hidden] { display: none; }
.lobby .lb-badge { position: absolute; top: -6px; right: -4px; min-width: 18px; padding: 0 4px; border-radius: 9px; background: #d8443a; color: #fff; font-size: 0.7rem; font-style: normal; font-weight: 700; line-height: 18px; }
.lobby .lb-logs { flex: 1 1 auto; min-height: 60px; display: flex; flex-direction: column; overflow: hidden; }
.lobby .lb-logs > .lb-log { flex: 1 1 auto; min-height: 0; }
.lobby .lb-to { flex: 0 1 34%; min-width: 0; }
.lobby .lb-log [data-pid] { cursor: pointer; }
.lobby .lb-pet.on { background: #6a4a2a; border-color: #f0c070; color: #fff2d8; }
.lobby .lb-card, .lobby .lb-ask { position: absolute; left: 50%; top: 8px; z-index: 3; transform: translateX(-50%); width: min(320px, calc(100% - 24px)); display: grid; gap: 4px; padding: 10px 12px; background: rgb(27 21 23 / 0.94); border: 2px solid #e2d6b8; border-radius: 8px; box-shadow: 0 4px 14px rgb(0 0 0 / 0.45); }
.lobby .lb-card[hidden], .lobby .lb-ask[hidden], .lobby .lb-card button[hidden], .lobby .lb-ask button[hidden] { display: none; }
.lobby .lb-card-name { font-size: 1.05rem; color: #ffe08a; }
.lobby .lb-card-lv, .lobby .lb-card-rec { font-size: 0.85rem; color: #cbbd9c; }
.lobby .lb-card-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.lobby .lb-card-acts .lb-btn { flex: 1 1 auto; }
.lobby .lb-card-friend.on { color: #8ee6a8; }
.lobby .lb-ask { z-index: 4; border-color: #ffb070; }
.lobby .lb-ask-text { margin: 0; font-size: 0.9rem; }
.lobby .lb-ask-left { font-size: 0.8rem; color: #ffb070; }
/* A duel's mode on the card (กดเอง / อัตโนมัติ), and the menu of a duel by hand under the square (src/lobby-duel.js createDuelMenu). */
.lobby .lb-card-mode { display: flex; gap: 6px; }
.lobby .lb-card-mode .lb-mode { flex: 1 1 0; min-height: 30px; font-size: 0.82rem; opacity: 0.75; }
.lobby .lb-card-mode .lb-mode.on { opacity: 1; background: #6a4a2a; border-color: #f0c070; color: #fff2d8; }
.lobby .lb-dm { flex: none; display: grid; gap: 4px; padding: 5px 8px 6px; background: #1f181b; border-top: 2px solid #ffb070; }
.lobby .lb-dm[hidden] { display: none; }
.lobby .lb-dm-head { display: flex; align-items: center; gap: 8px; min-height: 22px; font-size: 0.85rem; }
.lobby .lb-dm-who { color: #ffe08a; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lobby .lb-dm:not(.mine) .lb-dm-who { color: #cbbd9c; font-weight: 500; }
.lobby .lb-dm-left { flex: none; min-width: 3.2em; text-align: right; color: #ffb070; font-variant-numeric: tabular-nums; }
.lobby .lb-dm-left.hot { color: #ff6a5a; }
.lobby .lb-dm-strip { flex: none; display: flex; gap: 2px; }
.lobby .lb-dm-strip i { font-style: normal; font-size: 0.66rem; padding: 0 4px; border-radius: 3px; background: #4a2a2a; color: #ffd0c0; }
.lobby .lb-dm-strip i.me { background: #2a4a32; color: #c8f0c8; }
.lobby .lb-dm-main, .lobby .lb-dm-list { display: flex; gap: 5px; }
.lobby .lb-dm-list { overflow-x: auto; scrollbar-width: thin; padding-bottom: 2px; }
.lobby .lb-dm-main:empty, .lobby .lb-dm-list:empty { display: none; }
.lobby .lb-dm-btn { flex: 1 1 0; min-width: 0; min-height: 40px; padding: 3px 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; font-size: 0.86rem; }
.lobby .lb-dm-list .lb-dm-btn { flex: 0 0 auto; max-width: 9.5em; white-space: normal; }
.lobby .lb-dm-btn small { font-size: 0.68rem; opacity: 0.8; }
.lobby .lb-dm-btn.atk { background: #6a3a2a; border-color: #f0a070; color: #fff2e0; }
.lobby .lb-dm-btn.ult { border-color: #ffd84a; color: #ffe9a8; }
.lobby .lb-dm-btn.it { border-color: #8ee6a8; }
.lobby .lb-dm-btn.quit { flex: 0 1 auto; opacity: 0.85; }
.lobby .lb-dm-btn:disabled { opacity: 0.4; }
.lobby .lb-dm.wait .lb-dm-who { animation: lbhot 0.9s steps(2) infinite; }
.lobby .lb-fish.hot { animation: lbhot 0.3s steps(2) infinite; }
@keyframes lbhot { 50% { filter: brightness(1.5); } }
.lobby .lb-emotes { display: flex; gap: 4px; margin-left: auto; }
.lobby .lb-emote { width: 36px; padding: 0; background: var(--icon) center / 24px no-repeat; image-rendering: pixelated; }
.lobby .lb-face-btn { padding: 0 10px; border-color: #e0789a; box-shadow: 0 0 0 1px #e0789a inset; white-space: nowrap; }
.lobby .lb-face-btn[aria-expanded="true"] { filter: brightness(1.3); }
.lobby .lb-faces { position: absolute; right: 6px; bottom: 6px; left: 6px; z-index: 3; display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 4px; padding: 6px; max-height: calc(100% - 12px); overflow-y: auto; background: rgb(20 15 17 / 0.92); border: 2px solid #e2d6b8; }
.lobby .lb-faces[hidden] { display: none; }
.lobby .lb-face { min-height: 32px; padding: 2px 4px; font-size: 0.8rem; }
.lobby .lb-form { display: flex; gap: 8px; padding: 0 10px 6px; }
.lobby .lb-form input { flex: 1 1 auto; min-width: 0; }
/* The big action button at the end of the chat's row (src/lobby.js actBtn, players 2026-11-18): on a narrow screen
   only, a wide target ("ตกปลา" by the water, "ปลูก" / "รดน้ำ" / "เก็บเกี่ยว" in the garden), the chat's field shorter;
   the pad's own fishing button then gives way to it (the auto switch stays in the pad). */
.lobby .lb-act { display: none; }
@media (max-width: 719px) {
  .lobby .lb-form { align-items: stretch; gap: 6px; }
  .lobby .lb-form .lb-act { display: block; flex: 0 0 38%; max-width: 13em; min-height: 46px; padding: 4px 6px; font-size: 1.05rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .lobby .lb-form .lb-act:disabled { opacity: 0.4; }
  .lobby .lb-form .lb-act.hot { animation: lbhot 0.3s steps(2) infinite; }
  .lobby .lb-form button[type=submit] { flex: none; padding-inline: 10px; }
  .lobby .lb-form .lb-to { flex-basis: 26%; }
  .lobby .lb-fishgroup .lb-fish { display: none; }
}
.lobby .lb-log { flex: 1 1 auto; min-height: 60px; overflow-y: auto; padding: 4px 10px 10px; font-size: 0.82rem; line-height: 1.45; overflow-wrap: anywhere; }
.lobby .lb-line.lb-sys { color: #9c8f78; }
.lobby .lb-line.lb-mine { color: #ffe08a; }
.lobby .lb-best { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; background: rgb(5 8 12 / 0.55); }
.lobby .lb-best section { width: min(420px, 100%); max-height: 90%; overflow: auto; display: grid; gap: 8px; padding: 16px; background: #1b1517; border: 2px solid #e2d6b8; }
.lobby .lb-best h3 { margin: 0; }
.lobby .lb-best ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 0.88rem; }
/* The gathering place's economy (src/lobby-shop.js): the stones, the auto switch, the bag's squares, the NPCs' panels. */
.lobby .lb-purse { padding: 2px 8px; border: 1px solid rgb(126 214 255 / 0.5); border-radius: 10px; color: #bfe8ff; font-size: 0.82rem; white-space: nowrap; }
.lobby .lb-purse::before, .lobby .lb-stone::before { content: ""; display: inline-block; width: 9px; height: 11px; margin-right: 5px; vertical-align: -1px; background: linear-gradient(135deg, #e8fbff 0 30%, #7ed6ff 30% 70%, #3a8ac0 70%); clip-path: polygon(50% 0, 100% 35%, 80% 100%, 20% 100%, 0 35%); }
.lobby .lb-auto.on { background: #2f6a8a; border-color: #7ed6ff; color: #eaf8ff; box-shadow: 0 0 8px rgb(126 214 255 / 0.6); }
.lobby .lb-shop { z-index: 4; }
/* The admin's tools (src/lobby-admin.js): the top bar's button, the grant panel, the card's row. */
.lobby .lb-admin-btn { color: #ff9c8a; border-color: #ff9c8a; }
.lobby .lb-admin-btn[hidden], .lobby .lb-card-admin[hidden], .lobby .lb-adm-row[hidden] { display: none; }
.lobby .lb-adm-body { gap: 8px; }
.lobby .lb-adm-row { display: grid; grid-template-columns: 5.5em 1fr; gap: 8px; align-items: center; font-size: 0.86rem; }
.lobby .lb-adm-label { color: #cbbd9c; }
.lobby .lb-adm-row select, .lobby .lb-adm-row input { min-width: 0; width: 100%; min-height: 32px; padding: 2px 6px; background: #2a2226; color: #f6f1e4; border: 1px solid #5a4a44; border-radius: 4px; font: inherit; }
.lobby .lb-adm-out { min-height: 1.3em; }
.lobby .lb-card-give { color: #ff9c8a; border-color: #ff9c8a; }
.lobby .lb-line.lb-gift { color: #bfe8ff; }
.lobby .lb-shop section.lb-shop-box { width: min(480px, 100%); max-height: 92%; gap: 10px; padding: 12px; }
.lobby .lb-shop-head { display: flex; align-items: center; gap: 8px; }
.lobby .lb-shop-head h3 { flex: 1 1 auto; }
.lobby .lb-shop-x { width: 36px; padding: 0; font-size: 1.2rem; }
.lobby .lb-shop-body { display: grid; gap: 10px; }
.lobby .lb-shop-purse { margin: 0; color: #bfe8ff; }
.lobby .lb-shop-note { margin: 0; font-size: 0.8rem; color: #cbbd9c; }
.lobby .lb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; }
.lobby .lb-slot { position: relative; aspect-ratio: 1; min-height: 0; padding: 0; display: grid; place-items: center; background: #2a2226; border: 2px solid #4a3e3a; border-radius: 6px; box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.4); transform: none; }
.lobby .lb-slot.empty { background: #1f1a1c; border-style: dashed; border-color: #3a3034; }
.lobby .lb-slot:not(.empty) { border-color: var(--glow); background: radial-gradient(circle at 50% 55%, color-mix(in srgb, var(--glow) 32%, transparent) 0 45%, #2a2226 75%); }
.lobby .lb-slot.t3, .lobby .lb-slot.t4, .lobby .lb-slot.t5 { box-shadow: 0 0 6px var(--glow), inset 0 0 6px color-mix(in srgb, var(--glow) 50%, transparent); }
.lobby .lb-slot.t5 { animation: lbglow 1.6s ease-in-out infinite alternate; }
@keyframes lbglow { to { box-shadow: 0 0 12px var(--glow), inset 0 0 10px var(--glow); } }
.lobby .lb-slot.sel { outline: 3px solid #ffe08a; outline-offset: 1px; }
.lobby .lb-slot-icon { width: 80%; height: 80%; image-rendering: pixelated; pointer-events: none; }
.lobby .lb-slot-n { position: absolute; right: 2px; bottom: 1px; padding: 0 3px; border-radius: 3px; background: rgb(20 14 16 / 0.85); color: #fff; font-size: 0.72rem; font-weight: 700; line-height: 1.3; }
.lobby .lb-fish-detail { display: grid; gap: 8px; padding: 8px; border: 2px solid var(--glow); border-radius: 6px; background: #221c1f; }
.lobby .lb-fish-top { display: flex; gap: 10px; align-items: center; }
.lobby .lb-fish-big { width: 72px; height: 72px; image-rendering: pixelated; filter: drop-shadow(0 0 6px var(--glow)); }
.lobby .lb-fish-say { font-size: 0.8rem; opacity: 0.85; }
.lobby .lb-kg-list { display: flex; flex-wrap: wrap; gap: 4px; }
.lobby .lb-kg { min-height: 28px; padding: 2px 8px; font-size: 0.78rem; }
.lobby .lb-kg, .lobby .lb-gear-line .lb-btn { background: #2e2629; color: #f6f1e4; border-color: #5a4a44; box-shadow: none; }
.lobby .lb-kg.sel { background: #3a2f22; border-color: #ffe08a; color: #ffe08a; font-weight: 700; }
.lobby .lb-shop-acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.lobby .lb-shop-row { display: flex; gap: 8px; align-items: center; justify-content: space-between; font-size: 0.85rem; }
.lobby .lb-gear { display: grid; gap: 6px; padding-top: 6px; border-top: 1px solid #3a3034; }
.lobby .lb-gear-line, .lobby .lb-odds { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 0.8rem; }
.lobby .lb-gear-line .lb-btn { min-height: 30px; padding: 2px 8px; font-size: 0.8rem; }
.lobby .lb-gear-line .lb-btn.on { background: #3a2f22; border-color: #ffe08a; color: #ffe08a; font-weight: 700; }
.lobby .lb-gear-k { margin-right: 4px; color: #9c8f78; }
.lobby .lb-odd { padding: 1px 6px; border: 1px solid var(--glow); border-radius: 8px; color: var(--glow); }
.lobby .lb-odd.off { opacity: 0.35; }
.lobby .lb-shop-list { display: grid; gap: 6px; }
.lobby .lb-shop-item { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 8px; border: 1px solid #3a3034; border-radius: 6px; background: #221c1f; }
.lobby .lb-shop-item.on { border-color: #ffe08a; }
.lobby .lb-shop-info { display: grid; gap: 3px; font-size: 0.82rem; min-width: 0; }
.lobby .lb-shop-item .lb-shop-acts { flex: none; flex-direction: column; align-items: stretch; }
.lobby .lb-gate { color: var(--glow); }
/* The rod shop's rows on one grid (src/lobby-shop.js rodsPanel, players 2026-11-16): the words and bars in the
   first column, the price or use in the second, each the same width in every row. */
.lobby .lb-rod-list { grid-template-columns: minmax(0, 1fr) max-content; }
.lobby .lb-rod-list .lb-shop-item { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; }
.lobby .lb-rod-list .lb-shop-acts { min-width: 7.5em; }
.lobby .lb-rod-list .lb-shop-acts > * { width: 100%; white-space: nowrap; }
.lobby .lb-tag { padding: 2px 8px; border: 1px solid #ffe08a; border-radius: 8px; color: #ffe08a; font-size: 0.8rem; text-align: center; }
.lobby .lb-bars { display: grid; gap: 2px; }
.lobby .lb-bar { display: grid; grid-template-columns: 4.5em 1fr; gap: 6px; align-items: center; font-size: 0.75rem; color: #9c8f78; }
.lobby .lb-bar-track { height: 6px; background: #3a3034; border-radius: 3px; overflow: hidden; }
.lobby .lb-bar-track i { display: block; height: 100%; background: #7cc46a; }
.lobby .lb-smith { display: grid; gap: 8px; }
.lobby .lb-smith-odds { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 0; font-size: 0.85rem; }
.lobby .lb-smith-odds dt { color: #9c8f78; }
.lobby .lb-smith-odds dd { margin: 0; }
.lobby .lb-smith-res { padding: 8px; border-radius: 6px; text-align: center; font-weight: 700; font-size: 1.05rem; }
.lobby .lb-smith-res.up { background: #2f5a2a; color: #d8ffc8; box-shadow: 0 0 10px #7cc46a; }
.lobby .lb-smith-res.broke { background: #5a2420; color: #ffd0c8; }
.lobby .lb-smith-res.same { background: #3a3034; color: #e8dcc4; }
.lobby .lb-confirm { flex: 1 1 100%; font-size: 0.85rem; color: #ffe08a; }
.lobby .lb-fishline-icon { width: 24px; height: 24px; vertical-align: middle; image-rendering: pixelated; filter: drop-shadow(0 0 3px var(--glow)); }
/* The anglers' titles (src/fish-titles.js fishTitleChip, the owner 2026-11-17): a chip before a name in the plaza's and
   the world chat, alive like the badge over the head and grander by rank: #1 gold, a moving sheen, a light sweeping
   across and a pulsing glow; #2 silver, a slower sweep; #3 bronze into ocean blue, its colours rolling like a wave. */
.ft-chip { position: relative; overflow: hidden; display: inline-block; margin-right: 4px; padding: 0 6px 0 17px; border-radius: 4px; font-size: 0.72rem; font-weight: 700; line-height: 1.45; white-space: nowrap; vertical-align: baseline; background-size: 220% 100%; animation: ft-flow 4s linear infinite; }
.ft-chip::before { content: ""; position: absolute; left: 4px; top: 50%; width: 11px; height: 7px; margin-top: -3.5px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 14'%3E%3Cpath d='M0 1l6 6-6 6zM5 7c3-6 12-7 17 0-5 7-14 6-17 0z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 14'%3E%3Cpath d='M0 1l6 6-6 6zM5 7c3-6 12-7 17 0-5 7-14 6-17 0z'/%3E%3C/svg%3E") center / contain no-repeat; }
.ft-chip::after { content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; pointer-events: none; background: linear-gradient(100deg, transparent, rgb(255 255 255 / 0.8), transparent); transform: skewX(-20deg); }
.ft-1 { color: #3a2200; background-image: linear-gradient(110deg, #d9a21c 0%, #fff1a8 25%, #e6b230 50%, #fff1a8 75%, #d9a21c 100%); box-shadow: 0 0 0 1px #7a4a06, 0 0 6px rgb(255 213 74 / 0.8); animation: ft-flow 3s linear infinite, ft-glow 1.8s ease-in-out infinite; }
.ft-1::after { animation: ft-sweep 1.8s ease-in-out infinite; }
.ft-2 { color: #1d2633; background-image: linear-gradient(110deg, #a9b6c6 0%, #ffffff 25%, #c3cdd9 50%, #ffffff 75%, #a9b6c6 100%); box-shadow: 0 0 0 1px #3e4a5a, 0 0 4px rgb(216 230 255 / 0.7); animation-duration: 5s; }
.ft-2::after { animation: ft-sweep 2.6s ease-in-out infinite; animation-delay: 0.6s; opacity: 0.7; }
.ft-3 { color: #fff6ea; text-shadow: 0 1px 0 rgb(0 0 0 / 0.45); background-image: linear-gradient(100deg, #c27a40 0%, #2f7fa8 30%, #6cc8ff 45%, #2f7fa8 60%, #c27a40 100%); box-shadow: 0 0 0 1px #3a2412, 0 0 4px rgb(108 200 255 / 0.55); animation-duration: 3.6s; }
.ft-3::after { display: none; }
@keyframes ft-flow { from { background-position: 0% 0; } to { background-position: -220% 0; } }
@keyframes ft-sweep { 0%, 40% { left: -60%; } 90%, 100% { left: 130%; } }
@keyframes ft-glow { 0%, 100% { box-shadow: 0 0 0 1px #7a4a06, 0 0 3px rgb(255 213 74 / 0.5); } 50% { box-shadow: 0 0 0 1px #7a4a06, 0 0 9px rgb(255 213 74 / 0.95); } }
.less-motion .ft-chip, .less-motion .ft-chip::after { animation: none; }
@media (prefers-reduced-motion: reduce) { .ft-chip, .ft-chip::after { animation: none; } }
/* The anglers' board (src/lobby-rank.js). */
.lobby .lb-fishgroup .lb-rank-btn { padding-inline: 8px; white-space: nowrap; }
.lobby .lb-rank-tabs { display: flex; gap: 6px; }
.lobby .lb-rank-tab { flex: 1 1 0; min-height: 32px; opacity: 0.75; }
.lobby .lb-rank-tab.on { opacity: 1; background: #6a4a2a; border-color: #f0c070; color: #fff2d8; }
.lobby .lb-rank-holders { display: grid; gap: 4px; padding: 8px; border: 1px solid #5a4a44; border-radius: 6px; background: rgb(255 213 74 / 0.06); }
.lobby .lb-rank-holder { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; }
.lobby .lb-rank-mine { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; }
.lobby .lb-rank-mine .lb-rank-show { margin-left: auto; min-height: 30px; }
.lobby .lb-rank-show.on { background: #2f5a3a; border-color: #8ee6a8; color: #eafff0; }
.lobby .lb-rank-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 3px; font-size: 0.85rem; }
.lobby .lb-rank-row { display: grid; grid-template-columns: 2.2em minmax(0, 1fr) auto auto; align-items: center; gap: 2px 8px; padding: 3px 6px; border-radius: 4px; background: rgb(255 255 255 / 0.03); }
.lobby .lb-rank-row.top1 { background: rgb(255 213 74 / 0.16); }
.lobby .lb-rank-row.top2 { background: rgb(216 230 255 / 0.12); }
.lobby .lb-rank-row.top3 { background: rgb(108 200 255 / 0.1); }
.lobby .lb-rank-row.me { outline: 1px solid #ffe08a; color: #ffe08a; }
.lobby .lb-rank-r { font-weight: 700; text-align: center; }
.lobby .lb-rank-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lobby .lb-rank-pts { font-weight: 700; color: #ffe08a; text-align: right; }
.lobby .lb-rank-n { color: #cbbd9c; font-size: 0.78rem; text-align: right; }
.lobby .lb-rank-best { grid-column: 2 / -1; display: flex; align-items: center; gap: 4px; font-size: 0.76rem; }
.lobby .lb-rank-fish { width: 18px; height: 18px; image-rendering: pixelated; }
.lobby .lb-rank-reset { grid-column: 2 / -1; justify-self: start; min-height: 26px; padding: 0 8px; font-size: 0.75rem; color: #ff9c8a; border-color: #ff9c8a; }
.lobby .lb-rank-rules p { margin: 0 0 4px; font-size: 0.84rem; }
.lobby .lb-rank-cardline[hidden] { display: none; }
.lobby .lb-rank-card[hidden] { display: none; }
.lobby .lb-line.lb-ftnews { color: #ffe08a; }
/* The world tab's door to it. */
.world-lobby { padding: 10px 4px; }
.world-lobby p { margin: 0 0 10px; }
.world-lobby-btn { margin: 0 0 6px; }
/* ---- The phone prototype, round 4 (the owner, 2026-11-13) ---- */
/* The chat's buttons are gone from the scene; its lines still float over it. */
.chat-float-btn[hidden], .chat-dock-btn[hidden] { display: none !important; }
/* A shared moment in the chat: its words wrap (two lines at most) and the Watch button stays in sight, no sideways scroll. */
.chat-line { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.chat-line > .show-event { box-sizing: border-box; width: 100%; max-width: 100%; min-width: 0; flex-wrap: wrap; }
.chat-line .show-event .show-line { flex: 1 1 140px; min-width: 0; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chat-line .show-event button { flex: none; margin-left: auto; }
.chat-list, .chat-under .chat-list { overflow-x: hidden; }
/* The Bag's three pages. */
.pop-win > .bag-tabs { position: sticky; top: 52px; z-index: 4; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; margin: 0 0 8px; padding: 4px 0; background: var(--paper); }
.pop-win > .bag-tabs[hidden] { display: none; }
.pop-win > .bag-tabs button { min-height: 40px; font-weight: 700; }
.pop-win > .bag-tabs button.active { background: var(--btn-sel-bg); color: var(--btn-sel-ink); border-color: var(--btn-sel-bg); }
/* The Way tab. */
.way-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.way-tab .icon-cell { position: relative; }
.way-tab .way-bar { display: block; width: 52px; height: 4px; border-radius: 99px; background: linear-gradient(90deg, var(--gold, #8f6a12) var(--w, 0%), color-mix(in srgb, var(--muted, #888) 25%, transparent) var(--w, 0%)); }
.way-crafts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.way-craft { display: grid; justify-items: center; align-content: center; gap: 6px; min-height: 110px; padding: 10px 6px; font-size: 1rem; }
.way-craft small { font-size: 0.7rem; line-height: 1.25; }
.craft-pop section { width: min(720px, 100%); }
/* The Map's three pages: one size each. */
.map-topbar.map-topbar-3 .map-top-btn.map-world-btn:not(.active) { background: var(--surface); color: var(--ink); box-shadow: none; }
.map-topbar.map-topbar-3 .map-top-btn.active { background: var(--jade); color: var(--paper); outline: none; }
/* The world map's page (the owner 2026-11-14: "too much gap"): the − + on the map's corner, the home line one small
   line, the lands compact, 6px between them and the map; the map fitted to the height left (pixmap.js). */
.world-map-frame { position: relative; min-width: 0; }
.map-world-embed .world-map-zoom.on-map { position: absolute; right: calc(8px + var(--pix-gap, 0px)); bottom: 8px; z-index: 4; display: grid; grid-template-columns: repeat(2, 36px); gap: 6px; margin: 0; }
.map-world-embed .world-map-zoom.on-map button { width: 36px; height: 36px; min-width: 0; min-height: 0; padding: 0; font-size: 1.1rem; line-height: 1; box-shadow: 0 0 0 2px rgb(42 30 24 / 0.6); }
.map-world-embed .world-map-zoom.on-map button:disabled { opacity: 0.55; }
.map-world-embed .world-map-body { gap: 6px; overflow: visible; }
.map-world-embed .world-map-body .town-map, .map-world-embed .world-map-left { gap: 6px; }
.map-world-embed .map-status { margin: 0; }
.map-world-embed .map-status > p { margin: 0; font-size: 0.8rem; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-world-embed .map-status > p.map-road, .map-world-embed .map-status > p.map-ship { white-space: normal; }
.map-world-embed .map-lands { margin: 0 0 6px; gap: 6px; }
.map-world-embed .map-lands button { min-height: 34px; padding: 2px 4px; font-size: 0.85rem; }
.map-world-embed .map-lands button.active { font-weight: 700; box-shadow: inset 0 0 0 2px var(--gold, #c98f22); }
.map-world-embed .world-map-scroll .pix-map { margin: 0 auto; }
/* Under the place's lines: three buttons of one size, and nothing else. */
.here-three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 10px 0 4px; }
.here-three .here-btn { min-height: 56px; padding: 6px 4px; font-weight: 700; font-size: 0.92rem; line-height: 1.2; white-space: normal; }
/* The Places window: names only, buttons of one size, a shop mark where goods are sold. */
.places-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 700px) { .places-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.places-grid .place-btn { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; min-height: 54px; padding: 6px; font-weight: 600; text-align: center; }
.places-grid .place-btn small { flex-basis: 100%; font-weight: 400; font-size: 0.72rem; }
.places-grid .place-btn.here { outline: 2px solid var(--jade); }
.places-grid .shop-mark { font-size: 0.8rem; }
/* What a shop sells, under its name (shop-guide-ui.js goodsLineEl): wraps, never cut. */
.places-grid .place-btn small.place-sells { font-size: 0.68rem; line-height: 1.25; color: var(--muted); white-space: normal; overflow-wrap: anywhere; }
/* "Find an item" (shop-guide-ui.js shopFinderEl), above the places. */
.shop-finder { margin: 0 0 10px; min-width: 0; }
.shop-finder-label { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-weight: 600; }
.shop-finder-input { flex: 1 1 12rem; min-width: 0; max-width: 100%; box-sizing: border-box; font: inherit; font-weight: 400; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fffdf6; color: #1d1a16; }
.shop-finder-note { display: block; margin-top: 2px; font-size: 0.72rem; }
.shop-finder-out h4 { margin: 8px 0 4px; }
.shop-finder-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 6px; align-items: center; padding: 4px 0; border-top: 1px solid var(--line); }
.shop-finder-row .sq { display: grid; place-items: center; width: 30px; height: 30px; border: 2px solid var(--line); border-radius: 6px; }
.shop-finder-body { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.shop-finder-body .tappable { cursor: pointer; text-decoration: underline dotted; }
.shop-finder-row .src-go { min-height: 34px; padding: 2px 8px; max-width: 9.5rem; white-space: normal; font-size: 0.8rem; }
.shop-finder-else summary { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
/* "Buy" at the scene's top right while the hero stands at a place that sells. */
.scene-buy { position: absolute; top: 8px; right: 8px; z-index: 6; min-height: 36px; padding: 2px 12px; font-weight: 700; }
.scene-buy[hidden] { display: none; }
.auto-card .auto-about > summary { cursor: pointer; font-size: 0.78rem; color: var(--muted); }
.auto-card .auto-about[open] > summary { margin-bottom: 2px; }
.craft-pages { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; margin-bottom: 8px; }
.fold-note > summary { cursor: pointer; font-weight: 700; }
.fold-note > small { display: block; margin-top: 2px; }
body.chat-typing .world.on-chat > .world-top { display: none !important; }
/* A chat line's add-react and report buttons only on the line tapped (one at a time); reactions it has stay (the owner, 2026-11-13). */
.chat-line .chat-reacts .react-add, .chat-line .chat-reacts .react-report, .chat-line .chat-reacts .react-picker { display: none !important; }
.chat-line .chat-reacts:not(:has(.react-pill)) { display: none; }
.chat-line.acts-on .chat-reacts, .chat-under .chat-line.acts-on .chat-reacts { display: inline-flex !important; }
.chat-line.acts-on .chat-reacts .react-add, .chat-line.acts-on .chat-reacts .react-report { display: inline-flex !important; opacity: 1 !important; min-height: 36px; min-width: 40px; align-items: center; justify-content: center; }
.chat-line.acts-on .chat-reacts .react-picker { display: inline-flex !important; }
.chat-line.acts-on { background: color-mix(in srgb, var(--jade, #2c6b59) 8%, transparent); border-radius: 6px; }
/* "Bag/Skill" in two lines where the bar is narrow (the owner, 2026-11-13). */
.tabs button[data-tab="bag"] { white-space: normal; overflow-wrap: normal; line-height: 1.05; }
@media (max-width: 899px) { .tabs button[data-tab="bag"] { font-size: 0.72rem; } }

/* ---- Boxes of one size (the owner, 2026-11-13: "boxes keep resizing"): a window, the choice card and the
   goal card keep one width and height for the screen; what is in them scrolls inside. ---- */
/* The Map's and the Bag's window: its inset, the same for every page (no sizing to its content). */
body.pop-full .pop-win { height: auto; }
/* Windows over the game (openPanel): one size for the screen; a confirmation stays small. */
.menu-panel:not(.sure-stack):not(.name-ask):not(.world-map-panel) > section { width: min(560px, 100%); height: min(720px, calc(var(--vh, 1vh) * 100 - 32px)); max-height: none; align-content: start; }
/* The decision's card: one height while it is up, its words typing in and its options coming without it growing. */
#choice:not(.folded) > .card { height: min(640px, 100%); max-height: 100%; box-sizing: border-box; align-content: start; }
/* The goal card: one height open, one folded. */
.goal-card:not(.folded) { height: 150px; box-sizing: border-box; overflow-y: auto; align-content: start; }
.goal-card.folded { height: 34px; box-sizing: border-box; overflow: hidden; }
/* (Players 2026-11-14: "What next" too big on a computer.) A wide screen sets the two goals side by side under
   the heading, so the card is about two thirds as tall; a phone keeps its card as it was. */
@media (min-width: 900px) {
  .goal-card:not(.folded) { height: calc(6.9rem + 2px); column-gap: 18px; row-gap: 3px; }
  .goal-card:not(.folded):has(.goal + .goal) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .goal-card:not(.folded) > .goal-head { grid-column: 1 / -1; }
  .goal-card .goal-title { overflow-wrap: anywhere; }
}
/* The place's chip on the scene: one line, never wider than the scene. */
.scene-text { max-width: calc(100% - 16px); }
.scene-text #place, .scene-text #doing { display: block; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* The arts learned, by kind: one swipeable chip row, the grid in a box of one height. */
.art-kinds { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 6px; scrollbar-width: none; }
.art-kinds button { flex: none; white-space: nowrap; min-height: 32px; padding: 2px 12px; border-radius: 99px; }
.art-kinds button.active { background: var(--btn-sel-bg); color: var(--btn-sel-ink); border-color: var(--btn-sel-bg); font-weight: 700; }
.art-kind-pane { height: 300px; overflow-y: auto; overscroll-behavior: contain; }
.scene-text #place, .scene-text #doing { width: max-content; }
/* (A town-link chip draws its "›" inside the same line.) */
/* Windows over the game: the cross at the top right, not across the window; the slots look as on the pages. */
.menu-panel > section > .menu-x { justify-self: start; width: auto; }
.menu-panel .icon-cell { border: 0; background: none; box-shadow: none; color: inherit; min-height: 0; padding: 4px 2px; }
.menu-panel .icon-cell .sq { background: rgb(255 255 255 / 0.06); }
.menu-panel .icon-cell .sq.empty { color: #cbbd9c; }
/* The chat's chips beside who is online on a narrow screen with a mouse too (the phone frame on a computer). */
@media (max-width: 899px) {
  .world-top { flex-wrap: nowrap; }
  .world-top .world-stats { margin: 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.78rem; }
  .world-top .chat-filter { gap: 4px; }
  .world-top .chat-filter .chip { min-height: 26px; padding: 1px 8px; font-size: 0.75rem; }
}
/* The place's chip keeps its two lines (the place / "Now: …"), as wide as the short name needs, never cut (the owner, 2026-11-13). */
.scene .scene-text #place { width: max-content; max-width: none; overflow: visible; text-overflow: clip; }
.scene .scene-text { max-width: calc(100% - 16px); width: max-content; }
/* The way of life: the main way wide enough for its name, the second narrower and smaller (the owner, 2026-11-13). */
@media (max-width: 899px) {
  .screen.game .stats .focus #focus-btn { flex: 0 0 auto; max-width: 11em; }
  .screen.game .stats .focus #focus2-btn { flex: 0 1 auto; min-width: 2.5em; max-width: 6em; font-size: 0.74rem; padding: 0 5px; }
}
@media (max-width: 899px) {
  .world-top { align-items: flex-start; }
  .world-top .world-stats { line-height: 26px; height: 26px; }
  .world-top .chat-filter .chip { height: 26px; min-height: 26px; box-sizing: border-box; }
}
/* A dungeon's page in its window (the owner, 2026-11-13): Information and Settings side by side, Enter under them, biggest and green. */
.dgc-one-head { display: grid; gap: 4px; min-height: 96px; align-content: end; padding: 10px 12px; border-radius: 8px; background-size: cover; background-position: center; color: #f4efe2; margin: 6px 0 10px; }
.dgc-three { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dgc-three .dgc-info, .dgc-three .dgc-set { min-height: 56px; font-weight: 700; font-size: 1rem; }
.dgc-three .dgc-enter { grid-column: 1 / -1; min-height: 72px; font-size: 1.25rem; font-weight: 800; background: #2f8f4f; border-color: #2a7a45; color: #fff; }
.dgc-three .dgc-enter:disabled { background: #5d6a60; border-color: #4d5a50; opacity: 0.7; }
.dgc-three .dgc-why { grid-column: 1 / -1; }
.dgc-back { justify-self: start; margin-bottom: 4px; }
.dgc-one-body { display: grid; gap: 8px; }
/* An option keeps its size: its details never open on hover, only on a tap of ⓘ, as a small box over the
   card that pushes nothing (the owner, 2026-11-13). */
@media (hover: hover) {
  #choice-options small.odds:hover .odds-pop { display: none; }
  #choice-options small.odds:hover .odds-why { display: block; }
}
#choice-options button small.odds { position: relative; }
#choice-options small.odds.open .odds-pop { display: block; position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 6; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); box-shadow: 0 6px 18px rgb(0 0 0 / 0.25); font-weight: 500; }
#choice-options small.odds.open .odds-why { display: block; }
#choice-options button { overflow: visible; }
/* ---- Explanations folded on every screen (the owner, 2026-11-13; ui.js xfSync): a line under a name hides
   behind the name's chevron; a longer note shows only a small "▸ details", a tap opens it. ---- */
.xf-host { position: relative; padding-right: 30px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.xf-host > .xfh { display: none !important; }
.xf-host.xf-open > .xfh, .xf-host.xf-open > small.xfh { display: block !important; }
.xf-chev { position: absolute; top: 0; right: 0; width: 28px; height: 1.4em; pointer-events: none; }
.xf-chev::before { content: ""; position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; border: solid currentColor; border-width: 0 2px 2px 0; opacity: 0.7; rotate: 45deg; translate: -50% -70%; }
.xf-host.xf-open > .xf-chev::before { rotate: -135deg; translate: -50% -30%; }
.xf-c { position: relative; }
.xf-c:not(.xf-fit) { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.xf-c:not(.xf-fit):not(.xf-open) { display: block; width: auto !important; min-width: 0 !important; padding: 0 !important; font-size: 0 !important; line-height: 0 !important; white-space: normal !important; overflow: visible !important; }
.xf-c:not(.xf-fit):not(.xf-open) > * { display: none !important; }
.xf-c:not(.xf-fit):not(.xf-open)::before { content: attr(data-xfl); display: inline-block; font-size: 0.74rem; line-height: 1.6; color: var(--muted); text-decoration: underline dotted; text-underline-offset: 3px; }
.xf-c:not(.xf-fit):not(.xf-open)::after { content: none !important; }
.xf-c.xf-open:not(.xf-fit) { white-space: normal; overflow: visible; display: block; width: auto; min-width: 0; padding-right: 0; }
.xf-c.xf-open:not(.xf-fit)::after { content: none !important; }
.xf-host:focus-visible, .xf-c:focus-visible { outline: 2px solid var(--jade, #5b9); outline-offset: 2px; }
/* The run's window: its three pages, the menu at the window's foot, one size for all (the owner, 2026-11-13). */
.dungeon-card .dg-tabpane, .dg-inline .dg-tabpane { display: grid; gap: 6px; align-content: start; min-height: 0; grid-auto-rows: max-content; }
.dg-tabmenu { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding-top: 8px; border-top: 1px solid currentColor; flex: none; }
.dg-tabmenu button { min-height: 40px; font-weight: 700; }
.dg-tabmenu button.on { outline: 2px solid var(--jade, #2c6b59); }
/* (While a run is under way: the window a column, its page scrolling between the ways out and the menu at its foot.) */
.menu-panel > section.dungeon-card:has(> .dg-tabpane) { display: flex; flex-direction: column; overflow: hidden; }
.menu-panel > section.dungeon-card:has(> .dg-tabpane) > * { flex: none; }
.menu-panel > section.dungeon-card > .dg-tabpane { flex: 1 1 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }

/* ---- The Affiliation tab (proposal, the owner 2026-11-13): a compact head, main buttons of one size. ---- */
.aff-head { display: grid; gap: 6px; margin-bottom: 8px; }
.aff-head h3 { margin: 0; }
.aff-chips { display: grid; gap: 6px; }
.aff-chip { display: grid; gap: 1px; padding: 6px 10px; border: 1px solid var(--line); border-left: 4px solid var(--jade, #2c6b59); border-radius: 8px; }
.aff-chip small { color: var(--muted); }
.aff-btns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.aff-btn { min-height: 64px; padding: 6px 4px; font-weight: 700; font-size: 0.86rem; line-height: 1.2; white-space: normal; overflow-wrap: anywhere; }
/* (Every button of the grid one size, however long its words: the rows share the tallest one's height.) */
.aff-btns { grid-auto-rows: 1fr; }
.aff-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; }
/* What each button opens: a plain line under its name, folded until the "?" opens them all (players 2026-11-14). */
.aff-btn .aff-why { display: none; font-weight: 400; font-size: 0.72rem; line-height: 1.25; color: var(--muted); }
.aff-btns.explain .aff-why { display: block; }
.aff-help-toggle { justify-self: end; margin: 0 0 6px auto; display: block; min-height: 28px; padding: 2px 8px; font-size: 0.8rem; }
/* The treasury's page in the tab itself (players 2026-11-14): a bar back to the buttons, then the exchange. */
.aff-page { display: grid; gap: 8px; min-width: 0; }
.aff-page-bar { display: flex; align-items: center; gap: 10px; min-width: 0; }
.aff-page-bar .aff-back { flex: none; min-height: 36px; padding: 4px 12px; }
.aff-page-bar strong { min-width: 0; overflow-wrap: anywhere; }
.aff-page > p { margin: 0; }
.aff-page .aff-here { color: var(--jade, #2c6b59); font-weight: 600; font-size: 0.85rem; }
.aff-page section.treasury { margin: 0; display: grid; gap: 8px; }
.aff-page section.treasury > * { min-height: min-content; }
.aff-pop .cx-tabs { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.aff-pop .cx-tabs > button { flex: none; white-space: nowrap; }
.treasury-view .icon-cell { color: inherit; }
/* The treasury's exchange (players 2026-11-14: "hard to read"): one plain page, not a box in a box; its rows of
   tabs at their full height (a section's own height limit squeezed them to a sliver); the pieces as tiles. */
.menu-panel section.treasury { display: grid; gap: 8px; max-height: none !important; height: auto; overflow: visible; margin: 0; padding: 0; border: 0; box-shadow: none; background: transparent; }
.menu-panel section.treasury > * { min-height: min-content; }
.treasury .cx-tabs.sub.tiers { border-left-color: var(--jade, #2c6b59); }

/* A window never stands taller than the screen holding it (players 2026-11-14, Android: "the treasury's exchange
   won't scroll to the end"): the browser's own bars can leave the screen shorter than --vh says, and the card's
   foot then sat under them, out of reach, its own scroll ending before its last row. It is capped by the panel
   itself, whatever --vh says. */
.menu-panel:not(.world-map-panel) { display: flex; align-items: center; justify-content: center; }
/* (Clear of a phone's status bar or island and its home bar, so the close button is never under them.) */
.menu-panel { padding-top: max(16px, calc(env(safe-area-inset-top, 0px) / var(--zoom, 1))); padding-bottom: max(16px, calc(env(safe-area-inset-bottom, 0px) / var(--zoom, 1))); }
.menu-panel.name-ask { align-items: flex-end; }
.menu-panel:not(.world-map-panel) > section { max-height: 100% !important; flex: 0 1 auto; }

/* The treasury's pieces as tiles: three to a row on a phone (more on a wider window), the picture and name,
   its grade, the exchange button under it, and why not in small words. */
.treasury-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px 8px; }
.treasury-row.treasury-tile { display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 6px 4px; border: 1px solid rgb(232 200 120 / 0.25); border-radius: 8px; min-width: 0; }
.treasury-tile > .icon-cell { width: 100%; min-width: 0; }
.treasury-tile .icon-cell .name { overflow-wrap: anywhere; font-size: 0.8rem; line-height: 1.2; }
.treasury-tile > button { width: 100%; min-height: 34px; padding: 2px 4px; font-size: 0.9rem; }
.treasury-tile > .treasury-words { text-align: center; }
.treasury-tile > .treasury-words strong { display: none; }
.treasury-tile > .treasury-words small { font-size: 0.7rem; line-height: 1.25; }
.treasury-tile > .treasury-words small:empty { display: none; }
.treasury-row.treasury-tile.locked > .icon-cell { opacity: 0.6; }

/* Clear of a phone's home bar and status bar (UI audit 2026-11-14): the title's foot (terms, warning, menu) and the
   tutorial's card. (The insets are screen pixels; a zoomed page divides them by its zoom.) */
:root { --sat: calc(env(safe-area-inset-top, 0px) / var(--zoom, 1)); --sab: calc(env(safe-area-inset-bottom, 0px) / var(--zoom, 1)); }
.title-legal { bottom: calc(4px + var(--sab)); }
.title-screen:has(.title-legal) .warning { bottom: calc(20px + var(--sab)); }
.title-screen:has(.title-legal) .title-menu { bottom: calc(44px + var(--sab)); }
@media (max-width: 619px) and (orientation: portrait) {
  .title-screen:has(.title-legal) .warning { bottom: calc(18px + var(--sab)); }
  .title-screen:has(.title-legal) .title-menu { bottom: calc(40px + var(--sab)); }
}
.tut-card.below { bottom: calc(16px + var(--sab)); }
.tut-card.above { top: calc(16px + var(--sat)); }
.tut-card { max-height: calc(100% - 32px - var(--sat) - var(--sab)); }

/* The classic layout (the owner, 2026-11-14; ui.js uiClassic): the Bag's pages in the page under the scene, the
   Sect's pages opened below its buttons. */
body.ui-classic .bag-tabs:not([hidden]) { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; margin: 0 0 8px; }
body.ui-classic .aff-btn.active { outline: 2px solid var(--jade, #2c6b59); background: color-mix(in srgb, var(--jade, #2c6b59) 14%, transparent); }
body.ui-classic .aff-inline { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); display: grid; gap: 10px; min-width: 0; }
body.ui-classic .aff-inline > * { min-width: 0; min-height: min-content; }

/* Every popup's ✕ at its top left (the owner, 2026-11-14). */
.corner-x { position: sticky; top: 0; float: left; z-index: 3; min-width: 40px; min-height: 40px; margin: 0 8px 4px 0; padding: 0; font-size: 1.15rem; line-height: 1; }
.pop-head .pop-x { order: -1; }
.bc-sh-head .bc-sh-close { order: -1; }
/* The dungeon's option rows (players 2026-11-14, reports 4928 4968 5001): a grid of equal buttons that wraps, never a
   sideways strip; inside the run's scrolling page a strip shrank to a 4px sliver (the floor up/down, the camp's watch). */
.dg-row, .dg-inline .dg-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, max(96px, calc((100% - 12px) / 3))), 1fr)); gap: 6px; overflow: visible; }
.dg-row > button, .dg-inline .dg-row > button { flex: none; width: 100%; min-width: 0; min-height: 44px; white-space: normal; overflow-wrap: anywhere; line-height: 1.25; padding: 6px 8px; }
.dg-floor { display: grid; gap: 6px; padding: 8px; border: 1px solid #7b6450; border-radius: 6px; }
.dg-floor > h3, .dg-floor > h4 { margin: 0; }
.dg-inline .dg-floor { border-color: var(--line); }
.dg-outs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dg-outs > button { min-height: 48px; min-width: 0; white-space: normal; line-height: 1.25; padding: 6px 8px; }
/* The plan's Settings inside the dark dungeon window (report 4968: "the words are sunken, hard to press"): the dark
   window's own colours, not the page's light boxes with pale words on them; the chosen one gold, as in the run. */
.menu-panel .dg-inline .dg-fold, .menu-panel .dg-inline .dg-supply, .menu-panel .dg-inline .dg-secret { background: rgb(255 255 255 / 0.04); border: 1px solid #7b6450; color: #f1e9d2; }
.menu-panel .dg-inline .dg-fold > summary { color: #f1e9d2; }
.menu-panel .dg-inline h4 { border-top-color: #7b6450; color: #e8d9b0; }
.menu-panel .dg-inline .dg-row button.on { background: #c98f22; color: #1b1517; border-color: #f1e9d2; font-weight: 700; }
.menu-panel .dg-inline .town-track { background: #3a2e2a; border-color: #7b6450; }
.menu-panel .dg-supply { grid-template-columns: minmax(0, 1fr) 44px 2.4em 44px; }
.menu-panel .dg-supply button { min-height: 44px; font-size: 1.1rem; }
.menu-panel .dg-num { font-weight: 700; }
.menu-panel button.danger:hover:not(:disabled), .menu-panel button.danger:focus-visible { background: #a3453a; color: #fff; border-color: #f1e9d2; }
/* Joining a sect (players 2026-11-14: "the sect's name disappears", "the list won't scroll to the end"): the ways in
   took the row's width and squeezed the name into a sliver a letter wide, each sect a screen tall. The name and its
   words on their own lines, the ways in under them, buttons of one size. */
.sect-outside .treasury-row { flex-wrap: wrap; align-items: stretch; padding: 8px 0; border-bottom: 1px solid rgb(127 127 127 / 0.25); }
.sect-outside .treasury-row > .treasury-words { flex: 1 1 100%; }
.sect-outside .trial-ways { flex: 1 1 100%; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.sect-outside .trial-ways > button { white-space: normal; overflow-wrap: anywhere; line-height: 1.25; }
/* An inn's or a teahouse's lines have no picture: the words take the row, the price at its end (the words had fallen
   into the picture's 44px column, a word to a line). */
.shop-row.tavern-row { grid-template-columns: minmax(0, 1fr) auto; }
/* An Auto switch's label is the box and its name only, not the card's whole width: a tap beside it (a tab row just
   under it, redrawn) no longer flips a chore on (players 2026-11-14: "the treasury exchanged by itself"). */
.auto-card .auto-head { display: inline-flex; max-width: 100%; }
/* A match for a grown child (players 2026-11-14): who asks, in one row under the go-between's words. */
#choice .match-who { display: flex; align-items: center; gap: 10px; margin: 6px 0 8px; padding: 6px 8px; border: 1px solid var(--line); border-left: 4px solid var(--gold, #c9a54a); border-radius: 8px; min-width: 0; }
#choice .match-who img { width: 48px; height: 48px; flex: none; image-rendering: pixelated; border-radius: 6px; background: var(--paper-2, rgba(0, 0, 0, 0.04)); }
#choice .match-who-words { display: grid; gap: 1px; flex: 1; min-width: 0; text-align: left; }
#choice .match-who-words strong { overflow-wrap: anywhere; }
#choice .match-who-words small { color: var(--muted); font-size: 0.78rem; line-height: 1.3; overflow-wrap: anywhere; }
#choice .match-who-open { flex: none; min-height: 36px; padding: 4px 10px; font-size: 0.82rem; }

/* The People list (players 2026-11-14): what each one is, a mark on one who can teach the hero, a name search. */
.face .face-role { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; line-height: 1.2; font-size: 0.66rem; color: var(--ink); opacity: 0.8; }
.face .face-meta .teach-mark { padding: 0 4px; border-radius: 6px; white-space: nowrap; color: #1d1a16; background: var(--gold, #d8c27a); font-weight: 700; }
.people-search { display: flex; gap: 6px; align-items: center; margin: 0 0 8px; }
.people-search input { flex: 1 1 auto; min-width: 0; max-width: 320px; min-height: 34px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--ink); font: inherit; font-size: 16px; }
/* (On the treasury's page every kind, group and grade shows at once: the rows wrap, none scrolled out of sight.) */
.aff-page .treasury .cx-tabs { flex-wrap: wrap !important; overflow: visible; }
.people-tools { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin: 4px 0 8px; }
.people-tools > .people-town { margin: 0; flex: 1 1 150px; min-width: 0; }
.people-tools > .people-search { margin: 0; flex: 1 1 150px; min-width: 0; }
.face .face-home { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; line-height: 1.2; }

/* The top bar's realm, age and chapter cut with "…" on one line again, as before (the owner, 2026-11-14:
   "don't touch the new UI; if it shortens, let it shorten"; the wrap made the realm a narrow column). */
.topbar .who-line #realm, .topbar .who-line #age, .topbar .who-line #arc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; min-width: 0; }
.topbar .who-line .hero-title { overflow: hidden; }
/* (A card laid out as a grid stretched its corner ✕ into a full-width bar: a small square at the top left.) */
.overlay .card > .corner-x { justify-self: start; align-self: start; width: 40px; max-width: 40px; height: 40px; flex: none; }
/* The two modes on the new-life panel (src/life-mode.js): two buttons of one size side by side. */
.mode-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0 6px; }
.menu-panel .mode-pick .mode-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 64px; min-width: 0; width: 100%; padding: 8px 6px; }
.mode-btn small { font-family: var(--font-body, inherit); font-weight: 400; font-size: .78rem; opacity: .85; line-height: 1.2; }
.mode-btn.on { outline: 2px solid #f0b45a; outline-offset: 2px; }
.create-mode { display: block; font-size: .8rem; opacity: .85; }
.mode-badge { font-size: 0.8rem; padding: 0 6px; border: 1px solid currentColor; border-radius: 6px; text-decoration: none; }
.mode-badge.mode-creative { color: #8fb7e0; }
/* The buy / sit button and the scene / estate switch both sat at the scene's top right, one over the
   other (players, 2026-11-15): with the switch shown, the button goes just under it. */
.estate-switch:not([hidden]) ~ .scene-buy { top: calc(8px + 52px); }

/* กระดานเทพเซียน (src/lobby-cards.js, src/card-face.js): the album, decks, card shop and the card faces. */
.lobby .lb-bag-tabs, .lobby .cd-modes { display: flex; gap: 6px; }
.lobby .lb-bag-tab, .lobby .cd-mode { flex: 1 1 0; }
.lobby .lb-bag-tab.on, .lobby .cd-mode.on { background: #3a2d2a; color: #ffe08a; border-color: #e2d6b8; }
.lobby .cd-title { margin: 0; font-family: var(--font-display); color: #ffe08a; font-size: 1rem; }
.lobby .cd-filters { display: flex; flex-wrap: wrap; gap: 4px; }
.lobby .cd-chip { min-height: 28px; padding: 2px 8px; font-size: 0.8rem; background: #241c1f; color: var(--star, #f1e9d2); border: 1px solid #4a3e3a; }
.lobby .cd-chip.on { background: #3a2d2a; border-color: #ffe08a; }
.lobby .cd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.lobby .cd-nav { display: flex; justify-content: center; align-items: center; gap: 10px; }
.cf { position: relative; display: block; width: 100%; padding: 0; border: 0; background: none; color: #2a1f1d; cursor: pointer; aspect-ratio: 120 / 168; touch-action: manipulation; container-type: inline-size; border-radius: 3.5%; overflow: hidden; -webkit-user-select: none; user-select: none; }
.cf .cf-art, .cf-back { display: block; width: 100%; height: 100%; image-rendering: pixelated; image-rendering: crisp-edges; pointer-events: none; }
.cf .cf-name { position: absolute; left: 11.5%; right: 11.5%; top: 57.6%; height: 10.4%; display: flex; align-items: center; justify-content: center; overflow: hidden; font-size: 9.6cqw; line-height: 1.02; text-align: center; font-weight: 700; color: #3a2216; letter-spacing: -0.01em; }
.cf .cf-name.mid { font-size: 8.2cqw; }
.cf .cf-name.long { font-size: 6.6cqw; line-height: 1.08; }
.cf .cf-type { position: absolute; left: 14%; right: 14%; top: 70.6%; height: 6.4%; display: flex; align-items: center; justify-content: center; overflow: hidden; white-space: nowrap; font-size: 6.4cqw; font-weight: 600; color: #ffe8c8; text-shadow: 0 1px 0 rgb(0 0 0 / 0.6); }
.cf .cf-kw { position: absolute; left: 21%; right: 21%; top: 87.4%; height: 6.4%; display: flex; align-items: center; justify-content: center; overflow: hidden; white-space: nowrap; font-size: 6cqw; font-weight: 700; color: #9fe8ff; text-shadow: 0 1px 0 rgb(0 0 0 / 0.7); }
.cf .cf-n, .cf .cf-price { position: absolute; top: 16%; right: 8%; padding: 0 0.35em; border-radius: 0.6em; background: rgb(20 14 16 / 0.85); border: 1px solid rgb(255 224 138 / 0.5); color: #fff; font-size: max(0.62rem, 9cqw); font-weight: 700; }
.cf .cf-price { top: auto; bottom: 1%; right: 50%; transform: translateX(50%); color: #ffe08a; }
.cf.cf-dim { filter: grayscale(1) brightness(0.45); }
.cf.sel { outline: 3px solid #ffe08a; outline-offset: 1px; }
/* A 5★ card's foil in the album and the zoomed view: a band of light sweeping across, stepped (no blur), on the compositor only. */
.cf.cf-foil::after { content: ""; position: absolute; inset: -20% -60%; pointer-events: none; background: linear-gradient(105deg, transparent 0 42%, rgb(255 250 220 / 0.18) 42% 45%, rgb(255 255 240 / 0.36) 45% 49%, rgb(255 250 220 / 0.18) 49% 52%, transparent 52% 100%); mix-blend-mode: screen; transform: translateX(-60%); animation: cffoil 3.2s steps(24) infinite; }
@keyframes cffoil { 0% { transform: translateX(-60%); } 55%, 100% { transform: translateX(60%); } }
@media (prefers-reduced-motion: reduce) { .cf.cf-foil::after { animation: none; display: none; } }
/* A card zoomed (tapped in the album, the shop or a match): its face large, what it is and does beside or under it. */
.cz { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 14px; background: rgb(6 4 10 / 0.78); overflow: auto; }
.cz-box { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 320px); gap: 16px; align-items: start; max-width: 680px; width: 100%; color: #f1e9d2; }
.cz-box > .cf { width: 100%; max-width: 300px; justify-self: center; cursor: default; box-shadow: 0 6px 30px rgb(0 0 0 / 0.6); }
.cz-info { display: grid; gap: 6px; align-content: start; padding: 12px; background: #1d1619; border: 1px solid #4a3e3a; border-radius: 8px; font-size: 0.92rem; }
.cz-info .cd-name { color: #ffe08a; font-size: 1.15rem; font-weight: 700; }
.cz-info .cd-meta, .cz-info .cd-stats, .cz-info .cd-own { color: #cbbd9c; }
.cz-info .cd-kw { color: #9fdcf0; }
.cz-info .cd-text { margin: 0; line-height: 1.5; }
.cz-info .lb-shop-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cz-x { justify-self: end; }
@media (max-width: 560px) { .cz { align-items: start; } .cz-box { grid-template-columns: 1fr; gap: 10px; } .cz-box > .cf { width: min(64vw, 300px); } }
.lobby .cd-detail { display: grid; grid-template-columns: 110px 1fr; gap: 10px; padding: 8px; background: #241c1f; border: 1px solid #4a3e3a; border-radius: 6px; }
.lobby .cd-info { display: grid; gap: 4px; align-content: start; font-size: 0.85rem; }
.lobby .cd-name { color: #ffe08a; font-size: 0.95rem; }
.lobby .cd-meta, .lobby .cd-stats, .lobby .cd-kw, .lobby .cd-own { color: #cbbd9c; }
.lobby .cd-kw { color: #9fdcf0; }
.lobby .cd-text { margin: 0; }
.lobby .cd-starters { display: grid; gap: 6px; }
.lobby .cd-starter { flex-wrap: wrap; }
.lobby .cd-deckhead { justify-content: flex-start; }
.lobby .cd-deckname { flex: 1 1 auto; min-width: 0; min-height: 32px; color: #2a1f1d; background: #f6f1e4; }
.lobby .cd-count { color: #e89a40; font-weight: 700; }
.lobby .cd-count.ok { color: #8ee6a8; }
.lobby .cd-decklist { display: flex; flex-wrap: wrap; gap: 4px; max-height: 150px; overflow: auto; }
.lobby .cd-deckrow { min-height: 28px; padding: 2px 8px; font-size: 0.78rem; border-left: 4px solid var(--star); }
.lobby .lb-line.lb-cardline { color: #ffe08a; }
/* กระดานเทพเซียน's match view (src/card-board.js). */
.lobby .cg { position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column; background: #120e10; }
.lobby .cg-bar { display: flex; align-items: center; gap: 6px; padding: 4px 8px; flex-wrap: wrap; font-size: 0.8rem; }
.lobby .cg-bar .lb-btn { min-height: 32px; padding: 2px 10px; }
.lobby .cg-name { max-width: 30%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lobby .cg-them .cg-name { color: #ff9a8a; }
.lobby .cg-mine .cg-name { color: #8ac8ff; }
.lobby .cg-heart { display: flex; align-items: center; gap: 4px; flex: 1 1 90px; min-width: 90px; }
.lobby .cg-heart-ic { color: #5fc8a0; }
.lobby .cg-heart-bar { flex: 1 1 auto; height: 8px; background: #3a2a2a; border: 1px solid #000; }
.lobby .cg-heart-fill { display: block; height: 100%; background: #5fc8a0; transition: width 0.4s steps(5); }
.lobby .cg-them .cg-heart-fill { background: #e86a5a; }
.lobby .cg-info { color: #cbbd9c; }
.lobby .cg-qi b { color: #9fdcf0; margin-left: 3px; }
.lobby .cg-clock { color: #cbbd9c; min-width: 40px; }
.lobby .cg-clock.low { color: #ff6a50; font-weight: 700; }
.lobby .cg-practice { flex: none; padding: 1px 6px; border: 1px solid #6a8a5a; border-radius: 4px; color: #b8e0a0; background: #1e2a1a; font-size: 0.7rem; font-weight: 700; }
.lobby .cg-practice-note { color: #b8e0a0; font-size: 0.8rem; }
/* The sparring monk's panel (src/card-practice.js). */
.lobby .cgp-levels, .lobby .cgp-decks { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.lobby .cgp-levels .lb-btn.on, .lobby .cgp-decks .lb-btn.on { background: #f2d24a; color: #2a1f1d; border-color: #f2d24a; }
.lobby .cgp-decks .lb-btn[disabled] { opacity: 0.45; }
.lobby .cgp-head { margin: 6px 0 2px; font-weight: 700; color: #ffe08a; }
.lobby .cgp-note { color: #cbbd9c; font-size: 0.8rem; margin: 2px 0 8px; }
.lobby .cg-stage { position: relative; flex: 1 1 auto; width: 100%; min-height: 180px; margin: 0 auto; overflow: hidden; }
/* The log: a strip of its last two lines (the owner 2026-11-15, "not very needed"), tapped open over the board's foot. */
.lobby .cg-log { position: relative; flex: none; height: calc(2 * 1.25em + 6px); overflow: hidden; margin: 2px 8px; padding: 3px 26px 3px 8px; font-size: 0.72rem; line-height: 1.25; color: #cbbd9c; background: #1b1517; border: 1px solid #3a2e2c; border-radius: 6px; cursor: pointer; display: flex; flex-direction: column; justify-content: flex-end; }
.lobby .cg-log::after { content: "▴"; position: absolute; right: 8px; top: 3px; color: #8a7e70; }
.lobby .cg-log.open { height: auto; max-height: 34vh; overflow: auto; justify-content: flex-start; }
.lobby .cg-log.open::after { content: "▾"; }
.lobby .cg-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: none; }
.lobby .cg-log.open .cg-line { white-space: normal; }
.lobby .cg-mine { flex-wrap: nowrap; }
.lobby .cg-mine .cg-name { max-width: 22%; }
.lobby .cg-mine .cg-heart { min-width: 44px; flex-basis: 60px; }
.lobby .cg-mine .lb-btn { padding: 2px 8px; flex: none; }
.lobby .cg-mine .cg-concede { font-size: 0.72rem; padding: 2px 6px; }
.lobby .cg-zoom { position: absolute; right: 6px; bottom: 6px; display: flex; flex-direction: column; gap: 4px; z-index: 1; }
.lobby .cg-zoom .lb-btn { min-width: 34px; min-height: 34px; padding: 0; font-size: 1.1rem; font-weight: 700; line-height: 1; color: #ffe08a; background: rgb(27 21 23 / 0.85); border-color: #6a5a4a; }
.lobby .cg-zoom:not(.zoomed) .lb-btn:nth-child(n+2) { display: none; }
.lobby .cg-backs { display: flex; align-items: center; flex: none; }
.lobby .cg-backs .cf-back { width: 13px; height: 18px; margin-left: -5px; border-radius: 1px; box-shadow: 0 0 0 1px #000; }
.lobby .cg-backs .cf-back:first-child { margin-left: 0; }
.lobby .cg-line.mine { color: #8ac8ff; }
.lobby .cg-line.trap { color: #f2d24a; }
.lobby .cg-line.die { color: #c8a0a0; }
.lobby .cg-line.heart { color: #ff8a6a; font-weight: 700; }
.lobby .cg-line.turn { color: #8a7e70; }
.lobby .cg-cv { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; image-rendering: crisp-edges; touch-action: none; }
.lobby .cg-turn { position: absolute; top: 4px; left: 0; right: 0; text-align: center; font-size: 0.8rem; color: #cbbd9c; pointer-events: none; }
.lobby .cg-turn.mine { color: #ffe08a; font-weight: 700; }
.lobby .cg-banner { position: absolute; left: 50%; top: 32%; transform: translate(-50%, -50%); display: flex; gap: 8px; align-items: center; padding: 6px 10px; background: rgb(20 14 16 / 0.92); border: 2px solid #f2d24a; border-radius: 8px; pointer-events: none; color: #ffe08a; max-width: 92%; }
.lobby .cg-banner[hidden] { display: none; }
.lobby .cg-banner .cf { width: 60px; flex: none; }
.lobby .cg-banner.go { animation: cgpop 1.1s steps(8) both; }
@keyframes cgpop { 0% { transform: translate(-50%, -50%) scale(0.6); opacity: 0; } 15% { transform: translate(-50%, -50%) scale(1); opacity: 1; } 85% { opacity: 1; } 100% { opacity: 0; } }
.lobby .cg-tip { min-height: 30px; max-height: 52px; overflow: auto; padding: 2px 8px; font-size: 0.76rem; color: #efe4c8; flex: none; }
.lobby .cg-hint { color: #9fdcf0; font-style: normal; }
.lobby .cg-more { min-height: 24px; padding: 0 8px; margin-left: 6px; font-size: 0.72rem; }
/* The hand: big cards in a row that scrolls sideways (swipe; wheel or drag on a desktop). */
.lobby .cg-hand { display: flex; gap: 6px; overflow-x: auto; overflow-y: hidden; padding: 4px 10px 10px; flex: none; scroll-snap-type: x proximity; overscroll-behavior-x: contain; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.lobby .cg-hand .cf { flex: 0 0 clamp(108px, 31vw, 136px); width: clamp(108px, 31vw, 136px); scroll-snap-align: start; transition: transform 0.12s steps(3); }
.lobby .cg-hand .cf.sel { transform: translateY(-6px); }
@media (min-height: 900px) { .lobby .cg-hand .cf { flex-basis: 150px; width: 150px; } }
.lobby .cg-mull, .lobby .cg-endbox { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%); width: min(320px, 90%); padding: 12px; background: #1b1517; border: 2px solid #e2d6b8; border-radius: 8px; display: grid; gap: 8px; text-align: center; z-index: 2; }
.lobby .cg-mull { top: auto; bottom: 220px; transform: translateX(-50%); }
.lobby .cg-mull p, .lobby .cg-endbox p { margin: 0; }
.lobby .cg-endbox h3 { margin: 0; font-size: 1.4rem; color: #e86a5a; }
.lobby .cg-endbox h3.won { color: #ffe08a; }

/* The costume shop of the gathering place (src/lobby-boutique.js, src/lobby.js; the owner 2026-11-16):
   the seller's, the gacha cabinet's and the wardrobe's panels, the draw's reveal, the launch gift's note,
   and the moment's dark going in and out of the shop. */
.lobby .lb-stage.lb-fade::after { content: ""; position: absolute; inset: 0; background: #120c10; pointer-events: none; animation: lbFade 0.4s ease-out forwards; }
@keyframes lbFade { from { opacity: 1; } to { opacity: 0; } }
/* The floating garden (src/lobby-home.js, src/lobby-house.js, the owner 2026-11-16). */
.lobby .gd-hud { position: absolute; left: 6px; top: 6px; z-index: 1; max-width: calc(100% - 110px); display: flex; flex-wrap: wrap; gap: 2px 8px; padding: 3px 8px; border-radius: 10px; background: rgb(20 14 16 / 0.72); color: #f6f1e4; font-size: 0.74rem; pointer-events: none; }
.lobby .gd-hud-t { color: #cbbd9c; }
.lobby .gd-isle { top: auto; bottom: 6px; opacity: 0.85; }
/* The fish aura event (src/lobby-aura.js): the notice at the top of the square, a find in the chat, the finder's moment. */
.lobby .lb-aura-chip { position: absolute; top: 6px; left: 6px; z-index: 2; display: flex; align-items: center; gap: 6px; max-width: calc(100% - 24px); padding: 3px 10px 3px 6px; border: 1px solid #f2d24a; border-radius: 999px; background: rgb(28 18 40 / 0.82); color: #fff3c4; font: inherit; font-size: 0.74rem; white-space: nowrap; cursor: pointer; box-shadow: 0 0 0 2px rgb(242 210 74 / 0.25); }
.lobby .lb-aura-chip[hidden] { display: none; }
.lobby .lb-aura-fish { display: flex; gap: 1px; }
.lobby .lb-aura-ico { width: auto; height: 11px; image-rendering: pixelated; }
.lobby .lb-aura-words { overflow: hidden; text-overflow: ellipsis; }
.lobby .lb-line.lb-auraline { color: #fff0b0; font-weight: 600; }
.lobby .lb-aura-win { z-index: 8; }
.lobby .lb-aura-win section { text-align: center; justify-items: center; border-color: var(--aura, #f2d24a); box-shadow: 0 0 0 3px var(--aura, #f2d24a), 0 0 28px var(--aura, #f2d24a); animation: lb-aura-pop 0.45s steps(5) both; }
.lobby .lb-aura-win h3 { margin: 4px 0 2px; color: #fff6d0; }
.lobby .lb-aura-win p { margin: 0; font-size: 0.88rem; color: #e2d6b8; }
.lobby .lb-aura-kicker { color: var(--aura, #f2d24a) !important; font-weight: 700; letter-spacing: 0.04em; }
.lobby .lb-aura-cv { width: 300px; height: 255px; max-width: 76vw; image-rendering: pixelated; }
@keyframes lb-aura-pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .lobby .lb-aura-win section { animation: none; } }
.lobby .gd-bar { position: absolute; right: 6px; top: 6px; z-index: 2; display: flex; flex-direction: column; gap: 4px; }
.lobby .gd-bar .lb-btn { min-height: 34px; padding: 4px 10px; font-size: 0.8rem; }
.lobby .gd-bar .lb-btn.on { background: #f2d24a; color: #2a1f1d; }
.lobby .gd-strip { display: flex; gap: 6px; align-items: center; overflow-x: auto; min-height: 52px; padding: 4px 8px; background: #1e181b; border-top: 1px solid #3a3034; }
.lobby .gd-strip[hidden] { display: none; }
.lobby .gd-strip .lb-btn.on { background: #f2d24a; color: #2a1f1d; }
.lobby .gd-strip-name { color: #ffe08a; font-size: 0.82rem; white-space: nowrap; }
.lobby .gd-item { flex: none; display: grid; justify-items: center; gap: 1px; min-width: 50px; padding: 2px; border: 1px solid #4a3e3a; border-radius: 6px; background: #2a2226; color: #f6f1e4; font: inherit; font-size: 0.7rem; }
.lobby .gd-item.on { border-color: #ffe08a; box-shadow: 0 0 0 2px #ffe08a inset; }
.lobby .gd-item canvas { width: 40px; height: 40px; image-rendering: pixelated; }
.lobby .gd-pic { display: block; width: 56px; height: 56px; image-rendering: pixelated; }
.lobby .gd-pic.big { width: 112px; height: 112px; margin: 0 auto; }
.lobby .gd-card .bq-buy + .bq-buy { margin-top: 2px; }
.lobby .gd-packs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; width: 100%; }
.lobby .gd-packs .bq-buy { padding: 2px 0; }
.lobby .gd-biome { display: flex; gap: 8px; align-items: center; padding: 4px; border: 1px solid #3a3034; border-radius: 6px; }
.lobby .gd-biome.on { border-color: #ffe08a; }
.lobby .gd-biome-pic { width: 50%; max-width: 240px; aspect-ratio: 240 / 50; image-rendering: pixelated; border-radius: 4px; }
.lobby .gd-biome-side { display: grid; gap: 4px; flex: 1; min-width: 0; font-size: 0.82rem; }
.lobby .gd-plot { display: flex; gap: 8px; align-items: center; }
.lobby .gd-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.lobby .gd-petshow .lb-shop-box { text-align: center; display: grid; gap: 6px; }
.lobby .gd-pet-name { margin: 0; font-weight: 700; color: #ffe08a; }
/* The garden's people (round 2): their cards, hearts, a line, the gift grid, a moment's card over the view. */
.lobby .gd-hearts { color: #ff7a8a; font-size: 0.66rem; letter-spacing: -1px; white-space: nowrap; }
.lobby .gd-hearts.big { margin: 2px 0; font-size: 0.95rem; }
.lobby .gd-folk-top .gd-pic { width: 84px; height: 84px; flex: none; }
.lobby .gd-folk-line { margin: 2px 0 0; color: #f6ecd2; font-style: italic; font-size: 0.86rem; }
.lobby .gd-sub { margin: 10px 0 4px; font-size: 0.86rem; color: #ffe08a; }
.lobby .gd-help { font-size: 0.66rem; line-height: 1.25; }
.lobby .gd-folk-card { font: inherit; color: inherit; }
.lobby .gd-moment { position: absolute; left: 50%; bottom: 8px; z-index: 3; transform: translateX(-50%); width: min(92%, 420px); padding: 6px 10px; border: 2px solid #c8a040; border-radius: 10px; background: rgb(255 250 238 / 0.96); color: #3a2a22; font-size: 0.8rem; line-height: 1.35; box-shadow: 0 2px 8px rgb(0 0 0 / 0.4); cursor: pointer; }
.lobby .gd-moment[hidden] { display: none; }
.lobby .gd-moment p { margin: 2px 0; }
.lobby .gd-moment-h { display: block; color: #8a5a1a; font-size: 0.72rem; }
.lobby .gd-moment-g { display: block; color: #3f6a4a; font-weight: 700; font-size: 0.74rem; }
/* Visits (round 3, src/lobby-visit.js): the bar's buttons in two columns when many, rows of gardens and visitors, the log, the guestbook. */
.lobby .gd-bar { max-height: calc(100% - 12px); flex-wrap: wrap-reverse; align-content: flex-end; }
.lobby .gd-bar .lb-btn[hidden] { display: none; }
.lobby .gd-likes { margin: 6px 0; color: #ff9aa8; font-weight: 700; font-size: 0.86rem; }
.lobby .gd-row { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 4px 6px; border-bottom: 1px solid #3a3034; font-size: 0.84rem; }
.lobby .gd-row-info { display: grid; gap: 1px; min-width: 0; }
.lobby .gd-row-sub, .lobby .gd-row-why { color: #cbbd9c; font-size: 0.72rem; }
.lobby .gd-row-why { color: #f0a090; }
.lobby .gd-row .lb-btn { flex: none; min-height: 32px; }
.lobby .gd-log, .lobby .gd-book { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: 0.8rem; }
.lobby .gd-log li, .lobby .gd-book li { display: flex; gap: 6px; align-items: baseline; padding: 2px 4px; border-radius: 4px; }
.lobby .gd-log li.new { background: rgb(242 210 74 / 0.14); }
.lobby .gd-log-i { flex: none; width: 1.2em; text-align: center; }
.lobby .gd-log-t, .lobby .gd-book li span:first-of-type { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.lobby .gd-log-at { flex: none; color: #9a8e7a; font-size: 0.68rem; }
.lobby .gd-book b { flex: none; color: #ffe08a; }
.lobby .gd-note { width: 100%; box-sizing: border-box; resize: none; padding: 6px; border-radius: 6px; border: 1px solid #4a3e3a; background: #1e181b; color: #f6f1e4; font: inherit; font-size: 0.86rem; }
.lobby .gd-note-send { margin: 4px 0 6px; }
.lobby .gd-person { z-index: 5; }
.lobby .gd-kick { background: #6a2a2a; color: #ffe0d8; }
.friends-list .friend-garden { white-space: nowrap; }
.lobby .bq-panel section.lb-shop-box { width: min(520px, 100%); }
.lobby .bq-purse { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.lobby .bq-tix { margin-left: auto; padding: 1px 8px; border: 1px solid rgb(240 200 96 / 0.6); border-radius: 10px; color: #ffe08a; font-size: 0.82rem; white-space: nowrap; }
.lobby .bq-slot { display: grid; gap: 6px; }
.lobby .bq-slot h4, .lobby .bq-odds h4 { margin: 0; font-size: 0.88rem; color: #e2d6b8; }
.lobby .bq-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 6px; }
.lobby .bq-card { --tier: #9aa3ad; position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; padding: 5px 4px; border: 1px solid color-mix(in srgb, var(--tier) 55%, #3a3034); border-radius: 6px; background: linear-gradient(180deg, color-mix(in srgb, var(--tier) 16%, #221c1f), #1e181b 70%); color: #f6f1e4; font: inherit; text-align: center; }
button.bq-card { cursor: pointer; touch-action: manipulation; }
.lobby .bq-card.on { border-color: #ffe08a; box-shadow: 0 0 0 2px #ffe08a inset; }
.lobby .bq-card.own .bq-pic { opacity: 0.75; }
.lobby .bq-pic { display: block; width: 100%; max-width: 72px; aspect-ratio: 112 / 144; image-rendering: pixelated; }
.lobby .bq-pic.bust { aspect-ratio: 1; max-width: 64px; }
.lobby .bq-pic.wait { background: radial-gradient(circle, rgb(255 255 255 / 0.08), transparent 70%); }
.lobby .bq-name { font-size: 0.72rem; line-height: 1.2; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; min-height: 2.4em; overflow-wrap: anywhere; }
.lobby .bq-sub { font-size: 0.68rem; color: #cbbd9c; }
.lobby .bq-card .bq-buy { width: 100%; min-height: 30px; padding: 2px 4px; font-size: 0.72rem; white-space: nowrap; }
.lobby .bq-card .bq-buy[disabled] { opacity: 0.55; }
.lobby .bq-card .bq-go { background: #f2d24a; color: #2a1f1d; border-color: #f2d24a; }
.lobby .bq-off .bq-x { display: grid; place-items: center; width: 100%; max-width: 64px; aspect-ratio: 1; font-size: 1.6rem; color: #8a7e72; }
.lobby .bq-none { margin: 0; font-size: 0.8rem; }
.lobby .bq-to-wardrobe { justify-self: start; }
.lobby .bq-pack, .lobby .bq-pulls { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.lobby .bq-pulls .lb-btn { min-height: 44px; font-weight: 700; }
.lobby .bq-tickets { display: grid; gap: 6px; }
.lobby .bq-odds { display: grid; gap: 6px; padding: 8px; border: 1px solid #3a3034; border-radius: 6px; background: #221c1f; }
.lobby .bq-odds table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.lobby .bq-odds th, .lobby .bq-odds td { padding: 3px 4px; text-align: right; border-bottom: 1px solid #3a3034; white-space: nowrap; }
.lobby .bq-odds th:first-child, .lobby .bq-odds td:first-child { text-align: left; }
.lobby .bq-odds th { color: #cbbd9c; font-weight: 600; }
.lobby .bq-tier { font-weight: 700; }
.lobby .bq-stage { display: flex; gap: 10px; align-items: center; padding: 6px; border: 1px solid #3a3034; border-radius: 6px; background: radial-gradient(ellipse at 30% 60%, #3a2a30, #1e181b 70%); }
.lobby .bq-stage .bq-pic.big { width: 112px; max-width: 34%; flex: none; }
.lobby .bq-worn { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; font-size: 0.8rem; min-width: 0; }
.lobby .bq-worn dt { color: #cbbd9c; }
.lobby .bq-worn dd { margin: 0; overflow-wrap: anywhere; }
/* The draw's reveal: the pearl's flash in the best tier's colour, then the cards turning over one by one. */
.lobby .bq-reveal { --tier: #9aa3ad; position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; padding: 12px; background: rgb(8 6 10 / 0.82); }
.lobby .bq-flash { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.lobby .bq-orb { width: 90px; height: 90px; border-radius: 50%; background: radial-gradient(circle, #fff 0 18%, var(--tier) 45%, transparent 70%); opacity: 0; animation: bqOrb 1.1s ease-out forwards; }
.lobby .bq-rays { position: absolute; width: 260px; height: 260px; border-radius: 50%; background: repeating-conic-gradient(var(--tier) 0 6deg, transparent 6deg 24deg); -webkit-mask: radial-gradient(circle, transparent 18%, #000 30%, transparent 70%); mask: radial-gradient(circle, transparent 18%, #000 30%, transparent 70%); opacity: 0; animation: bqRays 1.1s ease-out forwards; }
.lobby .bq-reveal.legend .bq-orb { width: 140px; height: 140px; animation-duration: 1.6s; }
.lobby .bq-reveal.legend .bq-rays { width: 420px; height: 420px; animation-duration: 1.6s; }
@keyframes bqOrb { 0% { opacity: 0; transform: scale(0.3); } 30% { opacity: 1; transform: scale(1); } 55% { opacity: 1; transform: scale(1.5); } 100% { opacity: 0; transform: scale(2.6); } }
@keyframes bqRays { 0% { opacity: 0; transform: scale(0.4) rotate(0deg); } 40% { opacity: 0.9; } 100% { opacity: 0; transform: scale(1.4) rotate(40deg); } }
.lobby .bq-reveal-box { position: relative; width: min(560px, 100%); max-height: 100%; overflow: auto; display: grid; gap: 10px; padding: 12px; background: #1b1517; border: 2px solid var(--tier); border-radius: 8px; opacity: 0; animation: bqIn 0.3s ease-out 0.8s forwards; }
.lobby .bq-reveal.legend .bq-reveal-box { animation-delay: 1.25s; }
@keyframes bqIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.lobby .bq-got { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 6px; }
.lobby .bq-got.one { grid-template-columns: minmax(120px, 160px); justify-content: center; }
.lobby .bq-got .bq-card { border-width: 2px; border-color: var(--tier); box-shadow: 0 0 10px color-mix(in srgb, var(--tier) 45%, transparent); }
.lobby .bq-got .bq-pic.bust { max-width: 72px; }
.lobby .bq-flip { opacity: 0; transform: rotateY(90deg); animation: bqFlip 0.35s ease-out forwards; animation-delay: calc(0.95s + var(--i) * 0.14s); }
.lobby .bq-reveal.legend .bq-flip { animation-delay: calc(1.4s + var(--i) * 0.14s); }
@keyframes bqFlip { to { opacity: 1; transform: none; } }
.lobby .bq-got [data-tier="legendary"], .lobby .bq-got [data-tier="epic"] { animation-name: bqFlip, bqShine; animation-duration: 0.35s, 1.6s; animation-iteration-count: 1, infinite; }
@keyframes bqShine { 50% { box-shadow: 0 0 18px var(--tier); } }
.lobby .bq-got .bq-tier { font-size: 0.72rem; color: var(--tier); }
.lobby .bq-dup { font-size: 0.7rem; color: #bfe8ff; }
.lobby .bq-new { font-size: 0.7rem; color: #ffe08a; font-weight: 700; }
.lobby .bq-reveal-acts { justify-content: flex-end; }
.lobby .bq-refund { margin-right: auto; font-size: 0.82rem; color: #bfe8ff; }
.lobby .bq-reveal.still .bq-orb, .lobby .bq-reveal.still .bq-rays { display: none; }
.lobby .bq-reveal.still .bq-reveal-box, .lobby .bq-reveal.still .bq-flip { animation: none; opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .lobby .lb-stage.lb-fade::after { display: none; }
  .lobby .bq-orb, .lobby .bq-rays { display: none; }
  .lobby .bq-reveal-box, .lobby .bq-flip, .lobby .bq-got [data-tier] { animation: none !important; opacity: 1; transform: none; }
}
/* The launch gift's note. */
.lobby .bq-gift { z-index: 7; }
.lobby .bq-gift section { text-align: center; justify-items: center; border-color: #f2d24a; }
.lobby .bq-gift p { margin: 0; font-size: 0.88rem; color: #e2d6b8; }
.lobby .bq-gift-tix { display: block; width: 64px; height: 36px; background: linear-gradient(90deg, #f2d24a 0 22%, #c8302a 22% 26%, #f2d24a 26%); -webkit-mask: radial-gradient(circle at 0 50%, transparent 7px, #000 8px) left / 51% 100% no-repeat, radial-gradient(circle at 100% 50%, transparent 7px, #000 8px) right / 51% 100% no-repeat; mask: radial-gradient(circle at 0 50%, transparent 7px, #000 8px) left / 51% 100% no-repeat, radial-gradient(circle at 100% 50%, transparent 7px, #000 8px) right / 51% 100% no-repeat; }
.lobby .bq-more summary { cursor: pointer; font-size: 0.78rem; color: #cbbd9c; list-style: none; }
.lobby .bq-more summary::before { content: "▸ "; }
.lobby .bq-more[open] summary::before { content: "▾ "; }
.lobby .bq-more p { margin-top: 4px; }
.lobby .bq-pack .lb-btn { white-space: nowrap; font-size: 0.85rem; padding: 4px 6px; }
/* The gacha's "see what each tier holds" (players asked 2026-11-16). */
.lobby .bq-aura-note { color: #e6c8ff; }
.lobby .bq-pools { display: grid; gap: 8px; }
.lobby .bq-pools-btn { justify-self: stretch; }
.lobby .bq-tier-tabs .lb-bag-tab { min-width: 0; padding: 4px 2px; font-size: 0.8rem; color: var(--tier); }
.lobby .bq-tier-tabs .lb-bag-tab.on { color: var(--tier); border-color: var(--tier); box-shadow: 0 0 0 1px var(--tier) inset; }
.lobby .bq-pool-head { color: #e2d6b8; }
.lobby .bq-slot.bq-aura { padding: 6px; border: 1px solid #a35ce0; border-radius: 6px; background: rgb(163 92 224 / 0.1); }
.lobby .bq-slot.bq-aura h4 { color: #e6c8ff; }
.lobby .bq-has { font-size: 0.68rem; font-weight: 700; color: #9fe3a6; }
/* The chairs (src/lobby-chairs.js): cards show the chair's whole box, the stage the hero seated on the chosen one. */
.lobby .ch-pic { display: block; width: 100%; max-width: 76px; aspect-ratio: 256 / 272; image-rendering: pixelated; }
.lobby .ch-not .bq-name { color: #8a7e72; }
.lobby .ch-stage .ch-live { width: 160px; max-width: 46%; flex: none; aspect-ratio: 256 / 272; image-rendering: pixelated; }
.lobby .ch-info { display: grid; gap: 6px; justify-items: start; min-width: 0; }
.lobby .ch-info b { font-size: 0.95rem; color: #f6f1e4; }
.lobby .ch-reveal .bq-got.one .ch-pic { max-width: 140px; }
.lobby .lb-sit.on { background: #4a5a2a; border-color: #c8e070; color: #f4ffd8; }
/* The life's chapters folded to the one now (players 2026-11-16), and the sect's giving picker's counts. */
.arc-path li[hidden] { display: none; }
.arc-toggle { margin: 2px 0 6px; }
.bulk-row.give > span:not(.bulk-cnt, .pxicon) { flex: 1 1 auto; min-width: 0; }
.bulk-row .bulk-cnt { flex: 0 0 92px; display: flex; align-items: center; justify-content: flex-end; gap: 3px; font-size: 0.85rem; color: var(--muted); }
.bulk-row .bulk-cnt .bulk-n { width: 54px; height: 28px; flex: none; }
.filter-chips .kind-tabs { margin: 0 0 4px; }
.bulk-row .bulk-cnt small { min-width: 26px; }
/* The yearly sect council (ui.js showChoice, councilWhy): what each decree does, folded under one switch. */
#choice .council-help { display: block; margin: 4px 0 2px; padding: 4px 0; min-height: 32px; font-size: 0.85rem; text-align: left; }
#choice .council-why { display: none; font-weight: 400; font-size: 0.8rem; opacity: 0.85; }
#choice.council-open .council-why { display: block; }
