/* ===================================================================
   STS web client. Four themes share one set of tokens.
   =================================================================== */
:root, [data-theme="midnight"] {
  --bg: #0a0d13;
  --bg-glow-1: rgba(94, 234, 212, .10);
  --bg-glow-2: rgba(167, 139, 250, .08);
  --surface: #11161f;
  --surface-2: #161d29;
  --surface-3: #1c2433;
  --border: #232d3e;
  --text: #e2e8f0;
  --muted: #8a96aa;
  --faint: #5b667a;
  --accent: #5eead4;
  --accent-ink: #042f2a;
  --accent-soft: rgba(94, 234, 212, .12);
  --amber: #fbbf24;
  --priv: #f0abfc;
  --priv-soft: rgba(240, 171, 252, .08);
  --conf: #93c5fd;
  --mention-soft: rgba(251, 191, 36, .10);
  --danger: #f87171;
  --ok: #4ade80;
  --ui: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --chat-font: var(--ui);
  --radius: 14px;
  --glow: none;
  --term-bg: #000;
  --term-fg: #c8ccd2;
  /* ANSI colors used in command output */
  --a30: #5c6370; --a31: #e06c75; --a32: #98c379; --a33: #d19a66; --a34: #61afef; --a35: #c678dd; --a36: #56b6c2; --a37: #c8ccd2;
  --a90: #7f8796; --a91: #ff7b86; --a92: #b5e890; --a93: #ffd479; --a94: #82c1ff; --a95: #e19cff; --a96: #7ee7f0; --a97: #ffffff;
}
[data-theme="phosphor"] {
  --bg: #010603; --bg-glow-1: rgba(57, 255, 122, .08); --bg-glow-2: rgba(57, 255, 122, .04);
  --surface: #031008; --surface-2: #05170c; --surface-3: #082112; --border: #0f3d20;
  --text: #8dffa8; --muted: #3fae62; --faint: #2a7a44;
  --accent: #39ff7a; --accent-ink: #012a0f; --accent-soft: rgba(57, 255, 122, .10);
  --amber: #c6ff4d; --priv: #b8ffcf; --priv-soft: rgba(57, 255, 122, .07); --conf: #8dffa8;
  --mention-soft: rgba(198, 255, 77, .09); --danger: #ff6b6b; --ok: #39ff7a;
  --chat-font: var(--mono); --glow: 0 0 6px rgba(57, 255, 122, .45);
  --term-bg: #010603; --term-fg: #7dff9b;
  --a30: #2a7a44; --a31: #7dff9b; --a32: #39ff7a; --a33: #c6ff4d; --a34: #5cff96; --a35: #9dffb9; --a36: #66ffa3; --a37: #8dffa8;
  --a90: #3fae62; --a91: #b8ffcf; --a92: #6dff9a; --a93: #e0ff8a; --a94: #8affb6; --a95: #c2ffd6; --a96: #9dffc4; --a97: #d8ffe3;
}
[data-theme="amber"] {
  --bg: #0b0600; --bg-glow-1: rgba(255, 176, 0, .09); --bg-glow-2: rgba(255, 120, 0, .05);
  --surface: #140b01; --surface-2: #1b1003; --surface-3: #241604; --border: #3d2707;
  --text: #ffc56b; --muted: #b58232; --faint: #7d5a22;
  --accent: #ffb000; --accent-ink: #2b1a00; --accent-soft: rgba(255, 176, 0, .10);
  --amber: #ffd27a; --priv: #ffe0a8; --priv-soft: rgba(255, 176, 0, .07); --conf: #ffc56b;
  --mention-soft: rgba(255, 210, 122, .10); --danger: #ff7a59; --ok: #ffd27a;
  --chat-font: var(--mono); --glow: 0 0 6px rgba(255, 176, 0, .40);
  --term-bg: #0b0600; --term-fg: #ffc56b;
  --a30: #7d5a22; --a31: #ff9a5c; --a32: #ffc56b; --a33: #ffd27a; --a34: #ffb347; --a35: #ffcf8f; --a36: #ffbb55; --a37: #ffc56b;
  --a90: #b58232; --a91: #ffb27d; --a92: #ffd699; --a93: #ffe2a8; --a94: #ffc477; --a95: #ffdcae; --a96: #ffcd80; --a97: #fff0d6;
}
[data-theme="daylight"] {
  --bg: #f4f6fb; --bg-glow-1: rgba(13, 148, 136, .08); --bg-glow-2: rgba(124, 58, 237, .05);
  --surface: #ffffff; --surface-2: #f6f8fc; --surface-3: #eef2f8; --border: #dfe4ee;
  --text: #1b2333; --muted: #5a6478; --faint: #8a93a6;
  --accent: #0d9488; --accent-ink: #ffffff; --accent-soft: rgba(13, 148, 136, .10);
  --amber: #b45309; --priv: #a21caf; --priv-soft: rgba(162, 28, 175, .06); --conf: #1d4ed8;
  --mention-soft: rgba(245, 158, 11, .14); --danger: #dc2626; --ok: #16a34a;
  --term-bg: #0b0f17; --term-fg: #d6dbe4;
  --a30: #6b7280; --a31: #c2410c; --a32: #15803d; --a33: #a16207; --a34: #1d4ed8; --a35: #9333ea; --a36: #0e7490; --a37: #374151;
  --a90: #4b5563; --a91: #dc2626; --a92: #16a34a; --a93: #b45309; --a94: #2563eb; --a95: #a21caf; --a96: #0891b2; --a97: #111827;
}

:root { color-scheme: dark; }
[data-theme="daylight"] { color-scheme: light; }
@supports (height: 100dvh) {
  .modal { max-height: calc(100dvh - 40px); }
  .modal.wide { height: calc(100dvh - 32px); }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  background:
    radial-gradient(1000px 600px at 90% -10%, var(--bg-glow-1), transparent 60%),
    radial-gradient(800px 500px at -10% 110%, var(--bg-glow-2), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--ui);
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
code, kbd { font-family: var(--mono); font-size: .9em; background: var(--surface-3); border: 1px solid var(--border); border-radius: 5px; padding: 0 5px; }
h2 { margin: 0 0 10px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); display: flex; align-items: center; gap: 8px; }

/* ---------- shared bits ---------- */
.badge { font: 600 12px var(--mono); letter-spacing: .04em; color: var(--accent-ink); background: var(--accent); border-radius: 7px; padding: 5px 8px; white-space: nowrap; box-shadow: var(--glow); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand.small { gap: 10px; }
.bname { font-weight: 700; letter-spacing: -.01em; text-shadow: var(--glow); }
.bsub { color: var(--muted); font-size: 12px; }
.pill { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; background: var(--surface); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.on { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.card { background: linear-gradient(180deg, rgba(255,255,255,.025), transparent 40%), var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.primary { font-weight: 700; color: var(--accent-ink); background: var(--accent); border: 0; border-radius: 11px; padding: 12px 22px; box-shadow: 0 8px 28px var(--accent-soft), var(--glow); transition: transform .08s, filter .15s; }
.primary:hover { filter: brightness(1.07); }
.primary:active { transform: translateY(1px); }
.primary.small { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.ghost { background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 7px 12px; font-size: 13px; transition: border-color .15s, background .15s; }
.ghost:hover { border-color: var(--muted); background: var(--surface-3); }
.ghost.small { padding: 5px 10px; font-size: 12px; }
.ghost.danger, .iconbtn.danger { color: var(--danger); }
.iconbtn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 1px solid transparent; background: transparent; font-size: 16px; line-height: 1; transition: background .15s, border-color .15s; }
.iconbtn:hover { background: var(--surface-3); border-color: var(--border); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; }
.linkbtn:hover { text-decoration: underline; }
.count { font: 600 11px var(--mono); color: var(--accent-ink); background: var(--accent); border-radius: 999px; padding: 0 7px; letter-spacing: 0; }
.mobonly { display: none; }
.phoneonly { display: none; }

/* ---------- landing ---------- */
.landing { min-height: 100%; display: flex; flex-direction: column; padding-bottom: 40px; }
.lbar { display: flex; justify-content: space-between; align-items: center; padding: 16px 28px; }
.lgrid { width: 100%; max-width: 1120px; margin: 4vh auto 0; padding: 0 24px; display: grid; grid-template-columns: 1.25fr 1fr; gap: 28px; align-items: center; }
.eyebrow { margin: 0 0 12px; color: var(--amber); font: 600 12px var(--mono); text-transform: uppercase; letter-spacing: .14em; }
.hero h1 { margin: 0 0 16px; font-size: clamp(36px, 5vw, 58px); line-height: 1.02; letter-spacing: -.03em; font-weight: 800; text-shadow: var(--glow);
  background: linear-gradient(120deg, var(--text) 30%, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
[data-theme="phosphor"] .hero h1, [data-theme="amber"] .hero h1 { background: none; color: var(--text); font-family: var(--mono); }
.lede { margin: 0 0 28px; color: var(--muted); font-size: 16px; max-width: 54ch; }
.stats { list-style: none; margin: 0; padding: 0; display: flex; gap: 34px; flex-wrap: wrap; }
.stats li { display: flex; flex-direction: column; }
.stats strong { font: 600 26px var(--mono); text-shadow: var(--glow); }
.stats span { color: var(--muted); font-size: 12px; }
#stLinkWrap strong { color: var(--ok); }
.join { padding: 24px; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; padding: 4px; margin-bottom: 18px; }
.tab { border: 0; background: none; border-radius: 8px; padding: 8px; font-weight: 600; color: var(--muted); }
.tab[aria-selected="true"] { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 0 rgba(255,255,255,.04), 0 2px 8px rgba(0,0,0,.2); }
.jform { display: flex; flex-direction: column; gap: 8px; }
.jform label { font-size: 12px; font-weight: 600; color: var(--muted); }
.jform input { width: 100%; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 11px 13px; font-size: 16px; }
.jform input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.jform .primary { margin-top: 6px; }
.row2 { display: flex; gap: 10px; }
.row2 > div { display: flex; flex-direction: column; gap: 6px; width: 92px; }
.row2 .grow { flex: 1; width: auto; }
.fine { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.jerr { margin: 10px 0 0; color: var(--danger); font-size: 13px; min-height: 1em; }
.classiclink { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border); font-size: 13px; color: var(--muted); }
.telnet code { font-size: 11.5px; }
.lcards { width: 100%; max-width: 1120px; margin: 34px auto 0; padding: 0 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* people lists */
.people, .people-list { list-style: none; margin: 0; padding: 0; font-size: 14px; }
ul.people { max-height: 240px; overflow: auto; }
.people li, .people-list li { display: flex; align-items: baseline; gap: 8px; padding: 6px 8px; border-radius: 8px; min-width: 0; }
.people-list li[data-line] { cursor: pointer; }
.people-list li[data-line]:hover { background: var(--surface-3); }
.ln { font: 600 12px var(--mono); color: var(--amber); flex: none; }
.hn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.meta { color: var(--muted); font-size: 12px; white-space: nowrap; flex: none; }
.meta.on { color: var(--ok); }
.tagchip { font: 600 10.5px var(--mono); border-radius: 5px; padding: 1px 5px; flex: none; }
.tagchip.sysop { color: var(--amber); background: var(--mention-soft); }
.tagchip.visitor { color: var(--muted); background: var(--surface-3); }
.tagchip.pending { color: var(--amber); background: var(--mention-soft); }
/* The one-time password card after signing up. */
.modal.signup { width: min(460px, calc(100vw - 24px)); }
.su-code { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: baseline; margin: 14px 0; padding: 14px 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.su-code .su-lbl { font-size: 12px; font-weight: 600; color: var(--muted); }
.su-code b { font: 700 24px/1.2 var(--mono); letter-spacing: .06em; user-select: all; }
.su-acts { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; }
.su-acts form { margin: 0; }
.empty { color: var(--muted); }
.dim .hn { font-weight: 500; }

/* ---------- modern app ---------- */
.app { height: 100%; display: grid; grid-template-columns: 256px minmax(0, 1fr) minmax(390px, 30%); }
.side, .people { background: var(--surface); border-right: 1px solid var(--border); min-height: 0; overflow: auto; display: flex; flex-direction: column; }
.people { border-right: 0; border-left: 1px solid var(--border); padding: 16px 12px; gap: 18px; }
.station { display: flex; gap: 12px; align-items: center; padding: 16px; border-bottom: 1px solid var(--border); }
.sinfo { min-width: 0; }
.sinfo .bname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linkstate { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-top: 2px; }
.sect { padding: 14px 10px 6px; }
.secthead { display: flex; justify-content: space-between; align-items: center; padding: 0 6px 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.secthead .iconbtn { width: 26px; height: 26px; font-size: 15px; }
.newchan { display: grid; grid-template-columns: 58px 1fr auto; gap: 6px; padding: 0 6px 8px; }
.newchan input { min-width: 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; font-size: 13px; }
.chans { list-style: none; margin: 0; padding: 0; }
.chan { width: 100%; display: flex; align-items: center; gap: 10px; padding: 7px 8px; border: 0; background: none; border-radius: 9px; text-align: left; color: var(--muted); }
.chan:hover { background: var(--surface-2); color: var(--text); }
.chan.on { background: var(--accent-soft); color: var(--text); }
.chan .cid { font: 600 11px var(--mono); min-width: 26px; text-align: center; padding: 2px 0; border-radius: 6px; background: var(--surface-3); color: var(--text); }
.chan.on .cid { background: var(--accent); color: var(--accent-ink); box-shadow: var(--glow); }
.chan .cn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.chan .ci { font-size: 11px; }
.chan .cc { font: 600 11px var(--mono); color: var(--muted); }
.chan.busy .cc { color: var(--accent); }
.gamebtns { display: flex; flex-direction: column; gap: 6px; padding: 0 6px; }
.gamebtns .ghost { text-align: left; }
.me { margin-top: auto; display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--border); background: var(--surface-2); }
.meinfo { flex: 1; min-width: 0; }
.mehandle { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mesub { font-size: 12px; color: var(--muted); font-family: var(--mono); }

.main { position: relative; display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.chead { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 70%, transparent); backdrop-filter: blur(8px); }
.ctitle { flex: 1; min-width: 0; }
.cname { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.cname .cid { font: 600 12px var(--mono); color: var(--accent-ink); background: var(--accent); border-radius: 6px; padding: 2px 7px; box-shadow: var(--glow); }
.cnote { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cacts { display: flex; align-items: center; gap: 4px; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 3px; margin-right: 6px; }
.segbtn { border: 0; background: none; border-radius: 6px; padding: 4px 10px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.segbtn.on { background: var(--surface-3); color: var(--text); }

/* game card */
.gamecard { margin: 12px 16px 0; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; background:
  linear-gradient(135deg, var(--accent-soft), transparent 60%), var(--surface); position: relative; overflow: hidden; }
.gc-top { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.gc-title { font-weight: 800; color: var(--text); font-size: 13px; letter-spacing: .02em; }
.gc-cat { font: 600 11px var(--mono); color: var(--amber); background: var(--mention-soft); border-radius: 5px; padding: 1px 6px; }
.gc-round { margin-left: auto; font-family: var(--mono); }
.gc-prompt { margin: 8px 0 4px; font-size: 18px; font-weight: 700; line-height: 1.35; text-shadow: var(--glow); }
.gc-prompt.board { font: 600 clamp(16px, 2.4vw, 24px)/1.4 var(--mono); letter-spacing: .08em; white-space: pre-wrap; word-break: break-word; }
.gc-hint { font: 13px var(--mono); color: var(--muted); }
.gc-answer { margin-top: 6px; font-weight: 700; color: var(--ok); }
.gc-scores { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.gc-score { font-size: 12px; background: var(--surface-3); border-radius: 999px; padding: 2px 9px; }
.gc-score b { font-family: var(--mono); margin-left: 4px; }
.gc-bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--accent); box-shadow: var(--glow); transition: width .25s linear; }

/* stream */
.stream { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 16px 6px; font-family: var(--chat-font); scroll-behavior: auto; }
.row { position: relative; display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 6px; padding: 3px 8px; border-radius: 9px; line-height: 1.5; }
.row:hover { background: var(--surface-2); }
.row .time { font: 11px var(--mono); color: var(--faint); padding-top: 3px; opacity: 0; text-align: right; }
.row:hover .time, .times .row .time { opacity: 1; }
.row .content { min-width: 0; overflow-wrap: anywhere; }
.tag { font-family: var(--mono); font-size: 13.5px; white-space: nowrap; cursor: pointer; }
.tag .tl { color: var(--amber); }
.tag .tb { color: var(--faint); }
.tag .tc { color: var(--accent); }
.tag .th { font-weight: 600; color: var(--text); text-shadow: var(--glow); }
.tag:hover .th { text-decoration: underline; text-underline-offset: 3px; }
.body { margin-left: 6px; text-shadow: var(--glow); }
.body .mention { background: var(--mention-soft); color: var(--amber); border-radius: 4px; padding: 0 3px; font-weight: 600; }
.body a { color: var(--accent); }
.chip { font: 700 10.5px var(--mono); border-radius: 5px; padding: 1px 5px; margin-right: 6px; vertical-align: 1px; }
.row.priv { background: var(--priv-soft); box-shadow: inset 3px 0 0 var(--priv); }
.row.priv .chip { color: var(--priv); background: color-mix(in srgb, var(--priv) 14%, transparent); }
.row.priv .body { color: var(--priv); }
.row.conf .chip { color: var(--conf); background: color-mix(in srgb, var(--conf) 14%, transparent); }
.row.mention { background: var(--mention-soft); box-shadow: inset 3px 0 0 var(--amber); }
.row.self .th::after { content: " · you"; font-weight: 400; color: var(--faint); font-family: var(--ui); font-size: 11px; }
.row.sys { color: var(--muted); font-size: 13.5px; }
.row.sys .sysp { font: 600 11px var(--mono); color: var(--accent); margin-right: 8px; opacity: .85; }
.row.sys.on .sysp::before, .row.sys.off .sysp::before { content: "●"; margin-right: 5px; }
.row.sys.on .sysp::before { color: var(--ok); }
.row.sys.off .sysp::before { color: var(--faint); }
.row.sys.game { color: var(--text); }
.row.mon { color: var(--faint); font-size: 13px; font-style: italic; }
.row.out .cmd { font: 600 12px var(--mono); color: var(--accent); margin-bottom: 4px; }
.row.out pre { margin: 0; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; font: 12.5px/1.45 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); text-shadow: var(--glow); }
.row.privsent .body { color: var(--priv); }
.row.privsent .chip { color: var(--priv); background: color-mix(in srgb, var(--priv) 14%, transparent); }
.gif { display: block; margin: 6px 0 2px 0; max-width: min(320px, 100%); max-height: 240px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); }
.welcome { margin: 6px 8px 12px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: linear-gradient(135deg, var(--accent-soft), transparent 70%), var(--surface); font-family: var(--ui); }
.welcome b { text-shadow: var(--glow); }
.welcome .wsub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.daysep { display: flex; align-items: center; gap: 10px; color: var(--faint); font: 11px var(--mono); margin: 10px 8px; }
.daysep::before, .daysep::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.newpill { position: absolute; left: 50%; bottom: 92px; transform: translateX(-50%); z-index: 4; border: 0; border-radius: 999px; padding: 6px 14px; font-size: 12.5px; font-weight: 700; background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 24px rgba(0,0,0,.35); }

/* ANSI in command output */
.f30 { color: var(--a30); } .f31 { color: var(--a31); } .f32 { color: var(--a32); } .f33 { color: var(--a33); }
.f34 { color: var(--a34); } .f35 { color: var(--a35); } .f36 { color: var(--a36); } .f37 { color: var(--a37); }
.f90 { color: var(--a90); } .f91 { color: var(--a91); } .f92 { color: var(--a92); } .f93 { color: var(--a93); }
.f94 { color: var(--a94); } .f95 { color: var(--a95); } .f96 { color: var(--a96); } .f97 { color: var(--a97); }
.b1 { font-weight: 600; }

/* composer */
.typing { height: 20px; padding: 0 26px; font-size: 12px; color: var(--muted); font-style: italic; }
.composer { position: relative; display: flex; align-items: center; gap: 6px; margin: 0 16px 16px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.18); transition: border-color .15s, box-shadow .15s; }
.composer:focus-within { border-color: color-mix(in srgb, var(--accent) 60%, var(--border)); box-shadow: 0 0 0 3px var(--accent-soft), 0 10px 30px rgba(0,0,0,.18); }
.composer input { flex: 1; min-width: 0; border: 0; background: none; outline: none; padding: 8px 4px; font-size: 15px; font-family: var(--chat-font); }
.composer input::placeholder { color: var(--faint); }
.composer.prompting { border-color: var(--amber); }
.gifbtn { font: 700 11px var(--mono); width: auto; padding: 0 9px; border: 1px solid var(--border); }
.send { width: 36px; height: 36px; border: 0; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-size: 15px; box-shadow: var(--glow); }
.acpop { position: absolute; left: 6px; right: 6px; bottom: calc(100% + 8px); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 6px; box-shadow: 0 16px 40px rgba(0,0,0,.4); max-height: 300px; overflow: auto; z-index: 6; }
.acitem { display: flex; gap: 12px; align-items: baseline; padding: 6px 10px; border-radius: 8px; cursor: pointer; }
.acitem.on, .acitem:hover { background: var(--accent-soft); }
.acitem .ak { font: 600 13px var(--mono); color: var(--accent); min-width: 92px; }
.acitem .ad { font-size: 13px; color: var(--muted); }

/* popovers */
.popover { position: fixed; z-index: 20; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 10px; box-shadow: 0 20px 50px rgba(0,0,0,.5); }
.emojigrid { display: grid; grid-template-columns: repeat(10, 34px); gap: 2px; }
.emojigrid button { background: none; border: 0; border-radius: 7px; font-size: 20px; line-height: 34px; height: 34px; }
.emojigrid button:hover { background: var(--surface-3); }
.gifpop { width: min(460px, calc(100vw - 24px)); }
.gifpop input { width: 100%; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 9px 11px; }
.gifpop { display: flex; flex-direction: column; }
.gifgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; max-height: 320px; min-height: 0; overflow: auto; flex: 1; }
.gifgrid button { padding: 0; border: 1px solid transparent; border-radius: 8px; background: var(--surface-2); aspect-ratio: 1; overflow: hidden; }
.gifgrid button:hover { border-color: var(--accent); }
.gifgrid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gifgrid .msg { grid-column: 1 / -1; color: var(--muted); font-size: 13px; padding: 10px 2px; }
.giphy { margin-top: 6px; text-align: right; font: 700 10px var(--ui); letter-spacing: .06em; color: var(--muted); }

/* settings dialog */
.modal { width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 40px); padding: 0; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); color: var(--text); box-shadow: 0 40px 100px rgba(0,0,0,.6); }
.modal::backdrop { background: rgba(0,0,0,.5); backdrop-filter: blur(3px); }
.mhead { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); margin: 0; position: sticky; top: 0; z-index: 2; background: var(--surface); border-radius: 18px 18px 0 0; }
.mtoast { display: none; position: sticky; bottom: 10px; margin: 8px 14px 12px; padding: 8px 12px; border-radius: 10px; background: var(--surface-3); border: 1px solid color-mix(in srgb, var(--accent) 60%, var(--border)); font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.35); pointer-events: none; }
.mtoast.show { display: block; }
.gi-owned { font: 600 10.5px var(--mono); color: var(--muted); background: var(--surface-3); border-radius: 5px; padding: 2px 6px; align-self: center; white-space: nowrap; }
.mhead h2 { margin: 0; font-size: 15px; letter-spacing: 0; text-transform: none; color: var(--text); }
.mbody { padding: 6px 20px 20px; overflow: auto; }
.mbody section { padding: 14px 0; border-bottom: 1px solid var(--border); }
.mbody section:last-child { border-bottom: 0; }
.mbody h3 { margin: 0 0 10px; font-size: 13px; color: var(--muted); font-weight: 600; }
.preview { font: 15px var(--mono); margin-bottom: 10px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); }
.swatch.on { border-color: var(--text); }
.customcolor { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.customcolor input[type=color] { width: 40px; height: 30px; border: 1px solid var(--border); border-radius: 8px; background: none; padding: 2px; }
.themes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.theme { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); font-size: 12.5px; font-weight: 600; }
.theme.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.tsw { width: 100%; height: 34px; border-radius: 8px; border: 1px solid rgba(255,255,255,.08); }
.tsw.midnight { background: linear-gradient(135deg, #0a0d13 55%, #5eead4); }
.tsw.phosphor { background: linear-gradient(135deg, #010603 55%, #39ff7a); }
.tsw.amber { background: linear-gradient(135deg, #0b0600 55%, #ffb000); }
.tsw.daylight { background: linear-gradient(135deg, #f4f6fb 55%, #0d9488); }
.tog { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 14px; }
.tog input { width: 18px; height: 18px; accent-color: var(--accent); }
.morebtns { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- classic ---------- */
.classic { height: 100%; display: flex; flex-direction: column; padding: 0 16px 12px; }
.clbar { display: flex; justify-content: space-between; align-items: center; padding: 10px 2px; gap: 10px; }
.clacts { display: flex; gap: 6px; }
.termwrap { position: relative; flex: 1; min-height: 0; display: flex; background: var(--term-bg); border: 1px solid var(--border); border-radius: 12px; padding: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
#term { flex: 1; min-width: 0; min-height: 0; }
.clkeys { padding: 8px 2px 0; color: var(--muted); font: 12px var(--mono); }
.gifstack { position: absolute; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; max-width: 45%; pointer-events: none; }
.gifcard { pointer-events: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 6px; box-shadow: 0 10px 30px rgba(0,0,0,.5); cursor: pointer; }
.gifcard img { display: block; max-width: 100%; max-height: 180px; border-radius: 6px; }
.gifcard .who { font: 12px var(--mono); color: var(--muted); padding: 4px 2px 0; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .app { grid-template-columns: 240px minmax(0, 1fr); }
  .people { position: fixed; right: 0; top: 0; bottom: 0; width: min(400px, 90vw); z-index: 30; transform: translateX(100%); transition: transform .2s ease; box-shadow: -20px 0 60px rgba(0,0,0,.4); }
  .people.open { transform: none; }
}
@media (min-width: 1181px) { #openPeople { display: none; } }
@media (max-width: 820px) {
  .lgrid, .lcards { grid-template-columns: 1fr; }
  .lbar { padding: 12px 16px; }
  .lgrid { margin-top: 10px; padding: 0 16px; }
  .lcards { padding: 0 16px; }
  .bsub { display: none; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: min(290px, 86vw); z-index: 30; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 20px 0 60px rgba(0,0,0,.4); }
  .side.open { transform: none; }
  .mobonly { display: inline-grid; }
  .phoneonly { display: inline-block; }
  .seg { display: none; }
  .chead { padding: 8px 10px; gap: 6px; }
  .stream { padding: 10px 6px 6px; }
  .row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .row .time { display: none; }
  .composer { margin: 0 8px 10px; }
  .gamecard { margin: 8px 8px 0; }
  .classic { padding: 0 8px 8px; }
  .clkeys { display: none; }
}
.scrim { position: fixed; inset: 0; z-index: 25; background: rgba(0,0,0,.45); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---- The World ---------------------------------------------------------- */
.row.world { font-size: 14px; }
.row.world .wn { font-weight: 650; color: var(--text); }
.row.world.emote .wtext { font-style: italic; }
.row.world.move .wtext, .row.world.info .wtext { color: var(--muted); font-style: italic; font-size: 13.5px; }
.row.world.shout .wtext { color: var(--amber); font-weight: 600; }
.row.world.whisper .wtext { color: var(--priv); }
.row.world.party .wtext { color: var(--ok); }
.row.world.guild .wtext { color: color-mix(in srgb, var(--priv) 70%, var(--text)); }
.hb.gt { font: 600 10.5px var(--mono); color: var(--muted); }
.tagchip.crown { color: #b45309; background: color-mix(in srgb, #fbbf24 22%, transparent); }
.tagchip.guild { color: var(--text); }
.wc-strip { margin: 0; padding: 7px 10px; border-radius: 10px; font-size: 13px; background: var(--surface-2); border: 1px solid var(--border); }
.wc-duel { display: grid; gap: 5px; background: color-mix(in srgb, #f59e0b 9%, var(--surface-2)); border-color: color-mix(in srgb, #f59e0b 45%, var(--border)); }
.wd-head small { color: var(--muted); }
.wc-ask { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; border-color: color-mix(in srgb, var(--accent) 60%, var(--border)); }
.wc-ask > span { flex: 1 1 160px; }
.wc-party { display: grid; gap: 4px; font-size: 12.5px; border-color: color-mix(in srgb, var(--ok) 35%, var(--border)); }
.wp-head { display: flex; align-items: center; gap: 8px; font-weight: 650; }
.wp-head small { flex: 1; color: var(--muted); font-weight: 500; }
.wp-m { display: grid; grid-template-columns: minmax(0, 1fr) 90px; align-items: center; gap: 8px; }
.wp-m > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wp-m small { color: var(--muted); }
.wp-m.away { opacity: .65; }
.wbar.mini { height: 6px; }
.wc-throne { background: color-mix(in srgb, #fbbf24 10%, var(--surface-2)); border-color: color-mix(in srgb, #fbbf24 45%, var(--border)); }
.wc-throne small { color: var(--muted); }
.wmap .dot.party .body { stroke: var(--ok); stroke-width: 3; }
.wmap .dot.crown .body { stroke: #fbbf24; stroke-width: 3; }
.row.world.self .wtext { opacity: .85; }
.tagchip.world { color: var(--ok); background: color-mix(in srgb, var(--ok) 13%, transparent); }
.worldbtn .wcount { font: 600 10.5px var(--mono); color: var(--ok); margin-left: 6px; }
.chead.inworld { box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--ok) 45%, transparent); }

/* ---- The World: live map ------------------------------------------------ */
.mapsect h2 { margin-bottom: 6px; }
.maptoggle { background: none; border: 0; padding: 0; font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.maptoggle:hover { color: var(--text); }
.mapbig { margin-left: auto; width: 26px; height: 26px; font-size: 14px; }
.minimap { border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); padding: 6px; cursor: zoom-in; }
.minimap svg { display: block; width: 100%; height: auto; }
.mapfoot { font-size: 12.5px; color: var(--muted); padding: 7px 4px 0; line-height: 1.45; }
.mapfoot b { color: var(--text); font-weight: 600; }
.wmap { overflow: visible; user-select: none; }
.wmap .lvl { font: 700 8px var(--sans, system-ui); letter-spacing: .14em; text-transform: uppercase; fill: var(--faint); }
.wmap.big .lvl { font-size: 12px; }
.wmap .zlabel { font: 700 11px var(--sans, system-ui); letter-spacing: .04em; opacity: .85; paint-order: stroke; stroke: var(--surface-2); stroke-width: 3px; }
.wmap .links line, .wmap .links path { stroke: var(--border-strong, var(--faint)); stroke-width: 2; fill: none; }
.wmap .links .stairs { stroke-dasharray: 4 4; }
.wmap .links .locked { stroke: var(--danger); stroke-dasharray: 3 4; opacity: .8; }
.wmap .room .base { fill: var(--surface-2); }
.wmap .room .tint { fill-opacity: .16; stroke-width: 1.5; stroke-opacity: .75; transition: fill-opacity .2s, stroke-width .2s; }
.wmap .room.busy .tint { fill-opacity: .3; stroke-opacity: 1; }
.wmap .room.here .tint { fill-opacity: .42; stroke-width: 3; stroke-opacity: 1; }
.wmap .room.near { cursor: pointer; }
.wmap .room.near .tint { stroke-dasharray: 3 2; stroke-opacity: 1; }
.wmap .room.near:hover .tint { fill-opacity: .4; }
.wmap .ico { pointer-events: none; }
.wmap .rname { font: 600 10.5px var(--sans, system-ui); fill: var(--muted); pointer-events: none; }
.wmap .dot { transition: transform .55s cubic-bezier(.3, .7, .3, 1); }
.wmap .dot .body { stroke: var(--surface); stroke-width: 2; }
.wmap .dot.nocolor .body { fill: var(--accent); }
.wmap .dot .pulse { fill: none; stroke: var(--text); stroke-width: 2; opacity: 0; }
.wmap .dot.me .body { stroke: var(--text); stroke-width: 2.5; }
.wmap .dot.me .pulse { animation: mappulse 1.8s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.wmap .ini { font: 800 11px var(--sans, system-ui); fill: #0b0d10; pointer-events: none; }
@keyframes mappulse { 0% { opacity: .7; transform: scale(1); } 100% { opacity: 0; transform: scale(2.4); } }
@media (prefers-reduced-motion: reduce) { .wmap .dot { transition: none; } .wmap .dot.me .pulse { animation: none; } }
.modal.wide { width: calc(100vw - 32px); max-width: none; height: calc(100vh - 32px); max-height: none; flex-direction: column; }
.modal.wide[open] { display: flex; }
.modal.wide .mbody { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.bigmap { flex: 1; min-height: 160px; margin: 12px 0 4px; overflow: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); cursor: grab; }
.bigmap svg { display: block; margin: 8px; }
.bigmap.fit { overflow: hidden; cursor: default; padding: 8px; }
.bigmap.fit svg { width: 100%; height: 100%; margin: 0; }
.mapbar { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 8px 0 10px; border-bottom: 1px solid var(--border); flex: none; }
.mapbar .ghost { flex: none; white-space: nowrap; }
.maplegend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--muted); }
.lgdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--text); vertical-align: -1px; margin-right: 3px; }
.mapbottom { display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 10px 8px 0 0; flex: none; max-height: 120px; overflow: auto; }
.mapbottom .people-list { flex: 1; min-width: 0; columns: 3 200px; }
.mapbottom .primary { flex: none; padding: 10px 18px; }
@media (max-width: 820px) {
  .mapbottom { flex-direction: column-reverse; align-items: stretch; max-height: 160px; }
  .mapbottom .primary { width: 100%; }
  .mapbar { flex-wrap: wrap; gap: 8px; }
  .maplegend { display: none; flex-basis: 100%; order: 3; }
  .maplegend.open { display: flex; }
  .bigmap { min-height: 220px; }
}

/* ---- The World: character card, gear and shops ---------------------------- */
.worldcard { margin: 10px 16px 0; border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; background: linear-gradient(180deg, color-mix(in srgb, var(--ok) 6%, var(--surface)), var(--surface)); box-shadow: var(--glow); display: flex; flex-direction: column; gap: 10px; }
.wc-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; }
.wc-id { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.wc-id b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.wc-lvl { font: 600 12px var(--ui); color: var(--accent); }
.wc-bars { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.wbar { position: relative; height: 18px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.wbar i { position: absolute; inset: 0 auto 0 0; border-radius: 6px; transition: width .45s ease; }
.wbar span { position: relative; display: block; font: 600 11px/18px var(--mono); padding: 0 8px; color: var(--text); text-shadow: 0 1px 2px rgba(0,0,0,.6); white-space: nowrap; }
.wbar.hp i { background: linear-gradient(90deg, #16a34a, #4ade80); }
.wbar.hp.mid i { background: linear-gradient(90deg, #ca8a04, #facc15); }
.wbar.hp.low i { background: linear-gradient(90deg, #b91c1c, #f87171); animation: lowpulse 1.2s ease-in-out infinite; }
.wbar.xp i { background: linear-gradient(90deg, #6d28d9, #a78bfa); }
.wbar.foe i { background: linear-gradient(90deg, #991b1b, #ef4444); }
@keyframes lowpulse { 50% { opacity: .55; } }
.wc-nums { display: flex; gap: 10px; font: 600 13px var(--mono); white-space: nowrap; }
.wc-nums small { color: var(--muted); font-weight: 500; }
.wc-fight { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; background: color-mix(in srgb, var(--danger) 9%, var(--surface-2)); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.wf-name small { color: var(--muted); }
.wc-main { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-start; }
.wc-here { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 320px; min-width: 0; order: 1; }
.wc-dirs { order: 2; }
.wc-tools { display: flex; flex-wrap: wrap; gap: 5px; padding-top: 8px; border-top: 1px dashed var(--border); flex: 1 1 100%; order: 3; }
@media (min-width: 1500px) {
  .wc-tools { flex: 0 1 auto; margin-left: auto; padding-top: 0; border-top: 0; order: 2; justify-content: flex-end; }
  .wc-dirs { order: 3; }
}
.wbtn.tool { padding: 4px 8px; font-size: 12px; }
.wbtn.tool small { font-size: 10px; }
.wbtn.chip { border-radius: 999px; margin-left: auto; }
.wc-min { border: 0; background: none; color: var(--muted); font-size: 14px; padding: 0 2px; cursor: pointer; }
.wc-min:hover { color: var(--text); }
.worldcard.min { gap: 6px; }
.worldcard.min .wc-gear, .worldcard.min .wc-tools, .worldcard.min .wc-note, .worldcard.min .wc-story, .worldcard.min .wc-weather { display: none; }
.worldcard.min .wbar { height: 14px; }
.worldcard.min .wbar span { line-height: 14px; font-size: 10px; }
.stancepop { width: min(340px, calc(100vw - 16px)); display: flex; flex-direction: column; gap: 6px; }
.stancepop .sp-h { font: 600 10.5px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }
.stancepop .sp-d { margin: 0; font-size: 12.5px; color: var(--muted); }
.stancepop .wc-buffs { padding: 0; }
.stonepop { max-height: min(420px, 60vh); overflow: auto; }
.stonepop .sp-h span { float: right; text-transform: none; letter-spacing: 0; }
.stonelist { display: flex; flex-direction: column; gap: 4px; }
.stonepick { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; text-align: left; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: 9px; padding: 7px 10px; font-size: 13.5px; cursor: pointer; }
.stonepick:hover { border-color: var(--accent); background: var(--surface-3); }
.stonepick small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.wc-quiet { color: var(--muted); font-size: 13px; align-self: center; }
.wbtn { border: 1px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: 9px; padding: 6px 10px; font-size: 13px; line-height: 1.2; transition: background .15s, border-color .15s, transform .08s; }
.wbtn:hover { background: var(--surface-3); border-color: var(--accent); }
.wbtn:active { transform: translateY(1px); }
.wbtn small { color: var(--muted); font: 600 10.5px var(--mono); }
.wbtn:disabled { opacity: .45; cursor: not-allowed; border-color: var(--border); background: var(--surface-2); }
.wbtn.danger { border-color: color-mix(in srgb, var(--danger) 55%, var(--border)); }
.wbtn.danger.tough { background: color-mix(in srgb, var(--danger) 14%, var(--surface-2)); border-color: var(--danger); }
.wbtn.boss { font-weight: 700; }
.wbtn.primary { border-color: color-mix(in srgb, var(--accent) 60%, var(--border)); background: color-mix(in srgb, var(--accent) 10%, var(--surface-2)); }
.wbtn.good { border-color: color-mix(in srgb, var(--ok) 50%, var(--border)); }
.wbtn.glow { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); animation: lowpulse 1.6s ease-in-out infinite; }
.wbtn.loot { border-style: dashed; }
.wc-dirs { display: grid; grid-template-columns: repeat(3, 24px); grid-template-rows: repeat(3, 22px); gap: 2px; flex: none; grid-template-areas: "u n d" "w . e" ". s ."; }
.wdir { border: 1px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: 6px; font-size: 12px; line-height: 1; padding: 0; }
.wdir:hover { border-color: var(--accent); background: var(--surface-3); }
.wdir.off { border: 0; background: none; }
.wdir.d-n { grid-area: n; } .wdir.d-s { grid-area: s; } .wdir.d-e { grid-area: e; } .wdir.d-w { grid-area: w; } .wdir.d-u { grid-area: u; } .wdir.d-d { grid-area: d; }
.wc-note { font-size: 13px; color: var(--ok); }
.r-common { color: var(--text); } .r-uncommon { color: #4ade80; } .r-rare { color: #60a5fa; } .r-epic { color: #c084fc; } .r-legendary { color: #fbbf24; } .r-gold { color: var(--amber); }
[data-theme="daylight"] .r-uncommon { color: #15803d; } [data-theme="daylight"] .r-rare { color: #1d4ed8; } [data-theme="daylight"] .r-epic { color: #7e22ce; } [data-theme="daylight"] .r-legendary { color: #b45309; }
.row.world.combat .wtext { font-size: 13.5px; opacity: .92; }
.row.world.hurt .wtext { color: var(--danger); }
.row.world.win .wtext { color: var(--ok); font-weight: 600; }
.row.world.loot .wtext { color: var(--amber); }
.modal.gear { width: min(680px, calc(100vw - 24px)); }
.gtabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 0 8px; }
.gtabs button { border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); border-radius: 9px; padding: 7px 12px; font-weight: 600; white-space: nowrap; }
.gtabs button.on { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.gstats { font: 600 12.5px var(--mono); color: var(--muted); padding: 4px 0 6px; }
.gnote { font-size: 13px; color: var(--muted); margin: 4px 0 8px; }
.modal.gear h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 14px 0 6px; display: flex; align-items: center; gap: 10px; }
.glist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.gitem { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.gitem.empty { opacity: .6; }
.gi-slot { font: 600 10.5px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); width: 54px; flex: none; }
.gi-main { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.gi-name { font-weight: 650; }
.gi-name small { color: var(--muted); font-weight: 500; }
.gi-bonus { font: 12px var(--mono); color: var(--muted); }
.gi-desc { flex-basis: 100%; font-size: 12.5px; color: var(--faint); }
.gi-none { color: var(--muted); font-size: 13px; }
.gi-up { font: 700 10.5px var(--mono); border-radius: 5px; padding: 1px 5px; }
.gi-up.better { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.gi-up.worse { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.gi-up.mixed { color: var(--amber); background: color-mix(in srgb, var(--amber) 14%, transparent); }
.gi-cmp { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 8px; margin-top: 2px; padding: 4px 8px; border-radius: 7px; background: var(--surface-3); font-size: 12.5px; }
.cmp-vs { color: var(--muted); }
.cmp-vs b { font-weight: 650; }
.cmp-vs small { font: 11px var(--mono); color: var(--faint); margin-left: 2px; }
.cmp-ds { display: inline-flex; flex-wrap: wrap; gap: 3px 4px; }
.cmp-d { font: 600 11.5px var(--mono); border-radius: 5px; padding: 0 5px; white-space: nowrap; }
.cmp-d.up { color: var(--ok); background: color-mix(in srgb, var(--ok) 13%, transparent); }
.cmp-d.down { color: var(--danger); background: color-mix(in srgb, var(--danger) 13%, transparent); }
.cmp-d.side { color: var(--amber); background: color-mix(in srgb, var(--amber) 12%, transparent); }
.gi-up.same { color: var(--muted); background: var(--surface-3); }
.gi-acts { display: flex; gap: 5px; flex: none; }
.gbtn { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 8px; padding: 5px 10px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.gbtn:hover:not(:disabled) { border-color: var(--accent); }
.gbtn:disabled { opacity: .4; cursor: not-allowed; }
.gbtn.buy, .gbtn.good { border-color: color-mix(in srgb, var(--ok) 55%, var(--border)); }
.gbtn.ghostly { color: var(--muted); }
.wmap .mob circle { fill: var(--danger); stroke: var(--surface); stroke-width: 1.5; }
.wmap .mob.boss circle { fill: #7f1d1d; }
.wmap .mob text { font: 800 9px var(--sans, system-ui); fill: #fff; pointer-events: none; }
.wmap .mob.boss text { font-size: 10px; }
.wmap .dot.fighting .body { stroke: var(--danger); stroke-width: 3; }
.lgmob { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; background: var(--danger); color: #fff; font: 800 9px system-ui; font-style: normal; margin-right: 3px; vertical-align: -2px; }
@media (max-width: 820px) {
  .worldcard { margin: 8px 8px 0; padding: 10px; gap: 8px; }
  .wc-top { grid-template-columns: minmax(0, 1fr) auto; }
  .wc-bars { grid-column: 1 / -1; order: 3; }
  .wc-id b { max-width: 120px; }
  .gitem { flex-wrap: wrap; }
  .gi-acts { width: 100%; justify-content: flex-end; }
}

/* ---- badges in chat, the Thornvale panel, profiles, the character creator ---- */
.hb { display: inline-block; font: 700 10.5px var(--mono); border-radius: 5px; padding: 1px 5px; margin-left: 5px; vertical-align: 1px; white-space: nowrap; line-height: 1.4; }
.hb.lv { color: var(--text); background: var(--surface-3); border: 1px solid var(--border); }
.hb.lv.c-warrior { border-color: #f59e0b; } .hb.lv.c-rogue { border-color: #a3e635; } .hb.lv.c-mage { border-color: #a78bfa; } .hb.lv.c-cleric { border-color: #fde68a; } .hb.lv.c-ranger { border-color: #4ade80; }
.hb.tt { color: var(--amber); background: var(--mention-soft); font-style: italic; font-weight: 600; }
.tag { cursor: pointer; }
.tag:hover .th { text-decoration: underline; }
.people-list li .hb { margin-left: 2px; }
.people-list li[data-profile] { cursor: pointer; }
.people-list li[data-profile]:hover { background: var(--surface-3); }
.side .sect .people-list { padding: 0 2px; }
.side .sect .people-list li { padding: 4px 6px; font-size: 13.5px; }
.side .sect .people-list.dim li { padding: 3px 6px; font-size: 12.5px; }
.secthead .count { margin-left: auto; }
.today { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 8px; padding: 8px 10px; margin: 0 6px; border-radius: 10px; font-size: 13px; line-height: 1.4; background: color-mix(in srgb, var(--amber) 9%, var(--surface-2)); border: 1px solid color-mix(in srgb, var(--amber) 40%, var(--border)); }
.today .ti { font-size: 16px; }
.today .nt { display: block; color: var(--faint); font: 10.5px var(--mono); }

.tv { padding: 12px 12px 16px; gap: 14px; }
.tvhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.tvtitle { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-weight: 800; font-size: 14px; letter-spacing: .02em; flex: 1; min-width: 0; }
.tvhead .worldbtn { flex: none; }
.worldbtn { padding: 7px 12px !important; border-radius: 9px !important; }
.worldbtn.leave { background: var(--surface-3) !important; color: var(--text) !important; box-shadow: none !important; }
.maptools { display: flex; gap: 6px; padding-top: 6px; }
.maptools .ghost { flex: 1; }
.adv li { font-size: 13.5px; }
.adv .meta { margin-left: auto; font: 11.5px var(--mono); color: var(--muted); white-space: nowrap; }
.adv .fightdot { width: 7px; height: 7px; border-radius: 50%; background: var(--danger); flex: none; box-shadow: 0 0 6px var(--danger); }
.newslist, .herolist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.newslist li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 6px; font-size: 12.5px; line-height: 1.4; padding: 4px 6px; border-radius: 8px; background: var(--surface-2); }
.newslist li .nt { color: var(--faint); font: 10.5px var(--mono); display: block; }
.newslist li.boss { background: color-mix(in srgb, var(--danger) 10%, var(--surface-2)); }
.newslist li.ach { background: color-mix(in srgb, var(--amber) 9%, var(--surface-2)); }
.newslist li.empty, .herolist li.empty { display: block; color: var(--muted); font-size: 13px; background: none; padding: 4px 6px; }
.herolist li { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 6px; align-items: center; font-size: 13px; padding: 4px 6px; border-radius: 8px; cursor: pointer; }
.herolist li:hover { background: var(--surface-3); }
.herolist .rank { font: 700 11px var(--mono); color: var(--muted); }
.herolist .hname { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.herolist .hname small { color: var(--amber); font-weight: 600; font-style: italic; }
.herolist .hlv { font: 600 11px var(--mono); color: var(--muted); white-space: nowrap; }
.herolist li.on .hname::after { content: "●"; color: var(--ok); font-size: 8px; margin-left: 5px; vertical-align: 2px; }

/* avatar */
.avatar { display: inline-block; vertical-align: middle; border-radius: 50%; background: var(--surface-3); flex: none; }
.avatar svg { display: block; width: 100%; height: 100%; }

/* the character card: avatar, gear strip, abilities */
.wc-id { flex-direction: row !important; align-items: center; gap: 10px; }
.wc-id .avatar { width: 44px; height: 44px; }
.wc-idtext { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.wc-gear { display: flex; flex-wrap: wrap; gap: 4px 10px; font: 12.5px var(--ui); color: var(--muted); cursor: pointer; padding: 0 2px; }
.wc-gear:hover { color: var(--text); }
.wc-gear span { white-space: nowrap; }
.wc-gear b { font-weight: 600; }
.wc-gear .none { color: var(--faint); }
.wbtn.ab { position: relative; border-color: color-mix(in srgb, #a78bfa 55%, var(--border)); background: color-mix(in srgb, #a78bfa 10%, var(--surface-2)); }
.wbtn.ab:disabled { opacity: .45; border-color: color-mix(in srgb, #a78bfa 30%, var(--border)); background: var(--surface-2); }
.wbtn.ab .cd { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--surface-3); border: 1px solid var(--border); font: 700 10px/16px var(--mono); color: var(--text); text-align: center; }
.wc-create { display: flex; align-items: center; gap: 14px; }
.wc-create .avatar { width: 56px; height: 56px; }
.wc-create p { margin: 0 0 6px; }

/* the profile card */
.modal.profile { width: min(620px, calc(100vw - 24px)); }
.pf-head { display: flex; gap: 16px; align-items: center; padding: 14px 0 12px; border-bottom: 1px solid var(--border); }
.pf-head .avatar { width: 88px; height: 88px; }
.pf-name { font-size: 20px; font-weight: 800; line-height: 1.15; }
.pf-name small { display: block; font-size: 13px; font-weight: 600; color: var(--amber); font-style: italic; }
.pf-sub { color: var(--muted); font-size: 13px; margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.pf-look { color: var(--muted); font-size: 12.5px; margin-top: 6px; font-style: italic; }
.pf-acts { margin-left: auto; display: flex; flex-direction: column; gap: 6px; align-self: flex-start; }
.pf-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 12px 0; }
.pf-stat { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; text-align: center; }
.pf-stat b { display: block; font-size: 18px; font-weight: 800; }
.pf-stat span { font: 600 10px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.pf-sect { padding: 8px 0 10px; }
.pf-sect h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.pf-sect h3 small { font-weight: 500; letter-spacing: 0; text-transform: none; font-size: 12px; }
.pf-gear { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; }
.pf-gear div { display: flex; flex-direction: column; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 6px 9px; min-width: 0; }
.pf-gear .slot { font: 600 10px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.pf-gear .nm { font-weight: 650; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-gear .bn { font: 11px var(--mono); color: var(--muted); }
.pf-ach { display: flex; flex-wrap: wrap; gap: 6px; }
.pf-ach span { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; padding: 4px 9px; border-radius: 999px; background: color-mix(in srgb, var(--amber) 12%, var(--surface-2)); border: 1px solid color-mix(in srgb, var(--amber) 40%, var(--border)); cursor: default; }
.pf-ach span.locked { background: var(--surface-2); border-color: var(--border); color: var(--faint); filter: grayscale(1); opacity: .7; }
.pf-ab { display: flex; flex-wrap: wrap; gap: 6px; }
.pf-ab span { font-size: 12.5px; padding: 4px 9px; border-radius: 8px; background: color-mix(in srgb, #a78bfa 12%, var(--surface-2)); border: 1px solid color-mix(in srgb, #a78bfa 45%, var(--border)); }
.pf-ab span small { color: var(--muted); }
.pf-none { color: var(--muted); font-size: 13.5px; padding: 14px 0; }
.pf-title select { font: inherit; font-size: 13px; padding: 5px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); }
.xpbar { position: relative; height: 10px; border-radius: 5px; background: var(--surface-3); overflow: hidden; margin: 6px 0 2px; }
.xpbar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #6d28d9, #a78bfa); border-radius: 5px; }

/* the character creator */
.modal.create { width: min(860px, calc(100vw - 24px)); }
.cr-grid { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 22px; padding: 14px 0 6px; }
.cr-look { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.cr-look .avatar { width: 170px; height: 170px; box-shadow: var(--glow); }
.cr-name { font-weight: 800; font-size: 17px; text-align: center; }
.cr-name small { display: block; color: var(--muted); font-weight: 500; font-size: 12.5px; }
.cr-rows { width: 100%; display: flex; flex-direction: column; gap: 5px; }
.cr-row { display: grid; grid-template-columns: 70px 28px minmax(0, 1fr) 28px; align-items: center; gap: 4px; font-size: 13px; }
.cr-row label { font: 600 10.5px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.cr-row .val { text-align: center; text-transform: capitalize; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cr-row button { width: 28px; height: 26px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: 7px; padding: 0; }
.cr-row button:hover { border-color: var(--accent); }
.cr-classes { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; align-content: start; }
.cr-class { text-align: left; border: 2px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 5px; transition: border-color .15s, transform .08s; }
.cr-class:hover { border-color: var(--muted); }
.cr-class.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cr-class .ci { font-size: 24px; line-height: 1; }
.cr-class .cn { font-weight: 800; font-size: 15px; }
.cr-class .cb { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.cr-class .cs { font: 600 11px var(--mono); color: var(--text); display: flex; gap: 8px; flex-wrap: wrap; }
.cr-class .ca { font-size: 12px; color: var(--muted); }
.cr-class .ca b { color: var(--text); font-weight: 600; }
.cr-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0 4px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.cr-foot .hint { color: var(--muted); font-size: 13px; }
@media (max-width: 820px) {
  .cr-grid { grid-template-columns: 1fr; }
  .cr-look .avatar { width: 130px; height: 130px; }
  .pf-stats { grid-template-columns: repeat(2, 1fr); }
  .pf-head { flex-wrap: wrap; }
  .pf-acts { margin-left: 0; flex-direction: row; width: 100%; }
}

/* ---- The Deep, monster portraits, encounter cards ---------------------------- */
.mportrait { display: inline-block; vertical-align: middle; border-radius: 50%; flex: none; }
.mportrait svg { display: block; width: 100%; height: 100%; }
.mportrait.thumb { margin: -3px 4px -3px -3px; }
.wbtn.mob { display: inline-flex; align-items: center; gap: 2px; }
.row.encounter .content { max-width: 100%; }
.enc { display: flex; flex-direction: column; gap: 6px; }
.enc-m { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; background: color-mix(in srgb, var(--danger) 7%, var(--surface)); border: 1px solid color-mix(in srgb, var(--danger) 30%, var(--border)); }
.enc-m.boss { border-color: #fbbf24; background: color-mix(in srgb, #fbbf24 8%, var(--surface)); }
.enc-t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.enc-t b { font-size: 15px; }
.enc-t small { color: var(--muted); font: 600 11.5px var(--mono); }
.enc-d { font-size: 12.5px; color: var(--muted); font-style: italic; margin-top: 3px; }
.wc-fight { grid-template-columns: auto auto minmax(0, 1fr) !important; }
.wc-fight .mportrait { width: 52px; height: 52px; }
.pf-stats { grid-template-columns: repeat(3, 1fr); }
.pf-tog { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-top: 8px; }
.pf-you { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.wmap .fcell { cursor: default; }
.wmap .fcell rect { fill-opacity: .35; stroke-width: 1; stroke-opacity: .9; transition: fill-opacity .2s; }
.wmap .fcell.busy rect { fill-opacity: .75; }
.wmap .fcell.here rect { fill-opacity: .9; stroke: var(--text); stroke-width: 2; }
.wmap .fcell.picked rect { stroke: var(--accent); stroke-width: 2; }
.wmap.big .fcell { cursor: pointer; }
.wmap.big .fcell:hover rect { fill-opacity: .8; }
.wmap .fcell .fn { font: 700 8px var(--mono); fill: var(--text); pointer-events: none; opacity: .75; }
.wmap .fcell .fc { font: 800 9px var(--sans, system-ui); fill: #fff; pointer-events: none; }
.wmap.big .fcell .fc { font-size: 11px; }
.wmap .fcell .fb { pointer-events: none; }
.wmap .deeplabel { font: 700 8px var(--sans, system-ui); letter-spacing: .14em; text-transform: uppercase; fill: var(--faint); }
.wmap.big .deeplabel { font-size: 12px; }
.wmap .tname { font: 600 7px var(--sans, system-ui); fill: var(--muted); pointer-events: none; }
.wmap.big .tname { font-size: 10px; }
@media (max-width: 820px) { .pf-stats { grid-template-columns: repeat(2, 1fr); } .enc-m { flex-wrap: wrap; } }

/* ---- people, quests, the tavern, the living world ---------------------------- */
.row.npc .content { max-width: 100%; }
.npc { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--ok) 6%, var(--surface)); border: 1px solid color-mix(in srgb, var(--ok) 30%, var(--border)); }
.mportrait.friendly svg circle:first-child { stroke: color-mix(in srgb, var(--ok) 60%, var(--border)) !important; }
.npc-t { flex: 1; min-width: 0; }
.npc-t b { font-size: 15px; }
.npc-say { font-style: italic; color: var(--text); margin: 3px 0 6px; line-height: 1.45; }
.npc-q { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13.5px; }
.npc-q .qname { font-weight: 700; }
.npc-q .qrew { color: var(--amber); font: 600 12px var(--mono); }
.npc-q.done { opacity: .75; }
.npc-q.locked { color: var(--muted); }
.npc-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.wbtn .q { color: var(--amber); font-weight: 800; }
.tvbanner { border-radius: 12px; padding: 8px 10px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.tvbanner.raid { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, var(--surface-2)); animation: lowpulse 1.4s ease-in-out infinite; }
.tvbanner.night { border-color: #6a4aff; background: color-mix(in srgb, #6a4aff 10%, var(--surface-2)); }
.tvbanner.merchant, .tvbanner.chest, .tvbanner.bounty, .tvbanner.healer { border-color: color-mix(in srgb, var(--amber) 50%, var(--border)); }
.tvmain { display: flex; align-items: center; gap: 8px; }
.tvicon { font-size: 18px; flex: none; }
.tvtext { flex: 1; min-width: 0; line-height: 1.35; }
.tvleft { font: 600 11px var(--mono); color: var(--muted); flex: none; }
.tvev { font-size: 12px; color: var(--muted); padding-left: 2px; }
.tvev small { font: 600 10.5px var(--mono); }
.tvclock { font: 600 11px var(--mono); color: var(--muted); margin-left: 0; white-space: nowrap; flex-basis: 100%; overflow: hidden; text-overflow: ellipsis; }
.wmap.night .room .tint { fill-opacity: .08; }
.wmap.night .room.busy .tint { fill-opacity: .2; }
.wmap.night .room .base { fill: #080a12; }
.wmap.night .links line, .wmap.night .links path { opacity: .5; }
.wmap .mob.wander circle { fill: #6a4aff; }
.wmap .mob.raid circle { fill: var(--danger); animation: lowpulse 1s ease-in-out infinite; }
.wmap .room.raidroom .tint { stroke: var(--danger); stroke-width: 3; fill-opacity: .4; }
.qlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.qitem { padding: 8px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.qitem.complete { border-color: color-mix(in srgb, var(--ok) 55%, var(--border)); }
.qitem .qh { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-weight: 700; }
.qitem .qo { font-size: 12.5px; color: var(--muted); margin: 3px 0; }
.qitem .qp { position: relative; height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; margin: 6px 0 4px; }
.qitem .qp i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #16a34a, #4ade80); border-radius: 4px; }
.qitem .qs { font: 11.5px var(--mono); color: var(--muted); display: flex; justify-content: space-between; }

/* ---- companions, the bestiary, cottages --------------------------------------- */
.wc-pet { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; }
.wc-pet .mportrait { width: 30px; height: 30px; }
.wc-pet small { font: 600 10px var(--mono); color: var(--muted); line-height: 1.1; display: flex; flex-direction: column; }
.wmap .petdot { fill: #ffb000; stroke: var(--surface); stroke-width: 1; }
.modal.bestiary { width: min(1000px, calc(100vw - 24px)); }
.bgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; padding: 12px 0; max-height: 46vh; overflow: auto; }
.btile { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); cursor: pointer; text-align: center; }
.btile:hover { border-color: var(--accent); }
.btile.boss { border-color: #fbbf24; }
.btile.unknown { cursor: default; opacity: .6; }
.btile .mportrait { width: 56px; height: 56px; }
.btile .mportrait.dim svg { filter: brightness(.3); }
.btile .bn { font-weight: 700; font-size: 12.5px; line-height: 1.2; }
.btile small { font: 10.5px var(--mono); color: var(--muted); }
.bdetail { border-top: 1px solid var(--border); padding: 12px 0 4px; color: var(--muted); font-size: 13.5px; }
.bd { display: flex; gap: 16px; align-items: flex-start; color: var(--text); }
.bd .mportrait { width: 96px; height: 96px; flex: none; }
.bd b { font-size: 16px; }
.bd small { color: var(--muted); }
.bd p { margin: 4px 0 8px; font-style: italic; color: var(--muted); }
.bdl { display: grid; grid-template-columns: 72px 1fr; gap: 8px; font-size: 13px; padding: 2px 0; }
.bdl span { font: 600 10.5px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding-top: 2px; }
.pf-pets, .pf-troph { display: flex; flex-wrap: wrap; gap: 8px; }
.pf-pets span, .pf-troph span { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12.5px; }
.pf-pets .mportrait, .pf-troph .mportrait { width: 28px; height: 28px; }
.pf-troph span { border-color: color-mix(in srgb, #fbbf24 50%, var(--border)); }
.pf-troph small, .pf-pets small { color: var(--muted); }

/* ---- mounts and waystones ---- */
.wmap .stone { fill: #c9b8ff; stroke: var(--surface); stroke-width: .8; }
.wmap .mountdot { fill: #b07a3c; stroke: var(--surface); stroke-width: 1; }
.stonekey { fill: #c9b8ff; vertical-align: -1px; margin-right: 2px; }
.wc-hint { font-size: 12px; color: var(--muted); align-self: center; }
.wc-mount { margin-left: 4px; }

/* ---- crafting and gathering ---- */
.wc-buffs { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 2px; }
.wc-buffs .buff { font: 600 11px var(--mono); color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 2px 8px; }
.wc-buffs .buff small { color: var(--muted); margin-left: 3px; }
.gitem.locked .gi-name { color: var(--muted); }
.gi-desc.needs .ok { color: var(--ok); }
.gi-desc.needs .short { color: var(--muted); }
.gi-desc.needs .lvl { color: var(--amber); }
.gi-desc.needs span { margin-right: 8px; }
.gi-desc.needs .src { color: var(--faint); font-style: italic; }

/* ---- deeper combat ---- */
.wc-fight.windup { border-color: var(--amber); box-shadow: 0 0 0 1px color-mix(in srgb, var(--amber) 40%, transparent); animation: windup .8s ease-in-out infinite alternate; }
@keyframes windup { from { background: color-mix(in srgb, var(--danger) 9%, var(--surface-2)); } to { background: color-mix(in srgb, var(--amber) 18%, var(--surface-2)); } }
.wf-warn { display: block; font: 600 11px var(--mono); color: var(--amber); margin-top: 2px; }
.ftags { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-left: 6px; vertical-align: middle; }
.ftag { font: 600 10px var(--mono); font-style: normal; border-radius: 999px; padding: 1px 6px; background: var(--surface-3); color: var(--muted); }
.ftag.weak { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.ftag.bad { color: var(--danger); background: color-mix(in srgb, var(--danger) 14%, transparent); }
.ftag.good { color: var(--ok); }
.wc-stances { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.stance { border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); border-radius: 999px; padding: 4px 10px; font: 600 12px var(--mono); cursor: pointer; }
.stance.on { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.wc-buffs .buff.bad { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.wc-buffs .buff.dim { color: var(--muted); background: var(--surface-3); }
.enc-d.tricks { color: var(--amber); }

/* ---- the story and the weather ---- */
.wc-story { padding: 0 2px; font-size: 12.5px; color: var(--text); }
.wc-story small { color: var(--muted); font-family: var(--mono); }
.wc-weather { padding: 0 2px; font-size: 12px; color: var(--muted); }
.story { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin: 4px 0 10px; background: var(--surface-2); }
.story .sh { font-weight: 700; margin-bottom: 6px; }
.ssteps { margin: 0; padding-left: 18px; font-size: 13px; }
.ssteps li.done { color: var(--muted); text-decoration: line-through; }
.ssteps li.now { color: var(--text); font-weight: 600; }
.tvbanner.flight { border-color: color-mix(in srgb, var(--danger) 55%, var(--border)); }
.tvbanner.flight .tvicon { animation: pulse 1.2s ease-in-out infinite alternate; }
.wmap .mob.flight circle { fill: color-mix(in srgb, var(--danger) 25%, var(--surface)); stroke: var(--danger); }
