:root {
  --bg: #0f1216; --panel: #14171c; --bar: #1b1f24; --line: #2d333b; --card: #1f242b;
  --text: #e8e6df; --muted: #9aa3ad; --faint: #6b7480; --gold: #d4a24c;
  --amber: #e0a84a; --purple: #b58ad8; --red: #e06c5a;
  --teal: #5fb3a8; --green: #7fbf6a; --rust: #e39a6b; --storm: #8fa7c9; --pink: #e58fb3; --frost: #cfe0f5;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 12px/1.45 ui-monospace, Menlo, monospace; }
button, select { font: inherit; color: inherit; }
.shell { max-width: 920px; margin: 16px auto; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel); }
.topbar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--bar); flex-wrap: wrap; }
.tabs { display: flex; gap: 2px; }
.tab { background: none; border: 0; padding: 4px 10px; border-radius: 6px; color: var(--muted); cursor: pointer; }
.tab.on { background: var(--line); color: #fff; }
.sp { flex: 1; }
.pill { background: var(--line); border: 0; padding: 3px 8px; border-radius: 10px; }
button.pill { cursor: pointer; }
.speed.on { background: var(--gold); color: #1b1f24; }
.live { background: #3a3f47; }
.live.on { background: #c0392b; color: #fff; }
#run-picker { background: var(--line); border: 0; border-radius: 6px; padding: 3px 6px; max-width: 360px; }
.caption { padding: 4px 10px; color: var(--muted); background: var(--bar); border-top: 1px solid var(--line); min-height: 22px; }
#timeline { width: 100%; margin: 0; display: block; accent-color: var(--gold); background: var(--bar); }
.view.hidden { display: none; }
.map-wrap { position: relative; }
#map { width: 100%; display: block; image-rendering: pixelated; cursor: pointer; }
.waiting { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(15,18,22,.75); font-size: 16px; }
.waiting.gone { display: none; }
.row { display: grid; grid-template-columns: 1.25fr 1fr; border-top: 1px solid var(--line); }
@media (max-width: 760px) { .row { grid-template-columns: 1fr; } }
.panel { padding: 10px; min-width: 0; }
.panel h4 { margin: 0 0 6px; font-size: 11px; letter-spacing: 1px; color: var(--muted); text-transform: uppercase; }
.panel h4 small { text-transform: none; letter-spacing: 0; color: var(--faint); margin-left: 6px; }
.cards8 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.vc { background: var(--card); border: 1px solid var(--line); border-radius: 5px; padding: 5px 6px; cursor: pointer; }
.vc.sel { border-color: var(--gold); }
.vc.dead { opacity: .45; }
.vc b { display: flex; justify-content: space-between; font-size: 12px; }
.vc b span { color: var(--gold); font-weight: normal; }
.vc .act { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { height: 4px; background: var(--line); border-radius: 2px; margin-top: 3px; }
.bar i { display: block; height: 100%; border-radius: 2px; }
.bar .h { background: #e67e22; } .bar .e { background: #3498db; }
.feed-panel { border-left: 1px solid var(--line); }
.feed { max-height: 300px; overflow-y: auto; }
.feed div { padding: 3px 0; border-bottom: 1px dashed var(--line); overflow-wrap: anywhere; }
.feed .t { color: var(--faint); margin-right: 6px; }
.feed .nar { color: var(--amber); } .feed .hid { color: var(--purple); } .feed .death { color: var(--red); }
.feed .inner { color: var(--purple); font-style: italic; }
.feed .world { color: var(--teal); } .feed .law { color: var(--gold); } .feed .justice { color: var(--rust); }
.feed .arrival { color: var(--green); } .feed .rising { color: var(--red); font-weight: 700; }
.feed .social { color: var(--pink); }
.caption { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { border: 1px solid var(--line); border-radius: 10px; padding: 0 7px; line-height: 18px; color: var(--text); }
.chip.law { border-color: #6b5426; color: var(--gold); } .chip.world { border-color: #2f5a55; color: var(--teal); }
.chip.weather { border-color: #3d4c66; color: var(--storm); } .chip.season { border-color: #3d4c66; color: var(--frost); }
.chip.raid { border-color: #6b2a22; color: var(--red); } .chip.fire { border-color: #6b3a22; color: var(--rust); }
.hidden { display: none !important; }
.interview { border-top: 1px solid var(--line); padding: 10px; }
.interview h4 { margin: 0 0 2px; font-size: 11px; letter-spacing: 1px; color: var(--muted); text-transform: uppercase; }
.hint { margin: 0 0 8px; color: var(--faint); }
.interview-log { max-height: 220px; overflow-y: auto; display: grid; gap: 4px; margin-bottom: 8px; }
.interview-log:empty { display: none; }
.interview-log .you { color: var(--muted); }
.interview-log .them { color: var(--text); padding-left: 10px; border-left: 2px solid var(--gold); white-space: pre-wrap; }
#interview-form { display: flex; gap: 6px; }
#interview-q { flex: 1; min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: 6px;
  color: var(--text); font: inherit; padding: 5px 8px; }
#interview-q:focus-visible, .tab:focus-visible, .pill:focus-visible, .node:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.error { color: var(--red); min-height: 0; margin-top: 4px; }
.feelings { padding: 14px; }
.grudge-wrap { display: grid; grid-template-columns: minmax(0, 460px) 1fr; gap: 18px; align-items: start; }
@media (max-width: 760px) { .grudge-wrap { grid-template-columns: 1fr; } }
.grudge { width: 100%; height: auto; display: block; }
.grudge text { fill: var(--text); font: 11px ui-monospace, Menlo, monospace; pointer-events: none; }
.grudge .node { cursor: pointer; }
.grudge-side h4 { margin: 0 0 2px; font-size: 14px; color: var(--text); }
.grudge-side .mood { margin: 0 0 10px; color: var(--muted); font-style: italic; }
.grudge-side .op { padding: 5px 0; border-bottom: 1px dashed var(--line); }
.grudge-side .op b { font-weight: normal; }
.compare-wrap { padding: 14px; overflow-x: auto; }
table.compare { border-collapse: collapse; width: 100%; font-size: 11px; }
table.compare th { text-align: left; color: var(--muted); font-weight: normal; padding: 4px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.compare td { padding: 4px 8px; border-bottom: 1px dashed var(--line); white-space: nowrap; }
table.compare .n { text-align: right; font-variant-numeric: tabular-nums; }
table.compare tr.cur td { background: #232016; }
table.compare a { color: var(--gold); }
.gazette-list, .gallery, .graveyard { padding: 14px; display: grid; gap: 14px; }
.gazette { background: #f3ecd9; color: #2b2416; font-family: Georgia, serif; padding: 14px; border-radius: 4px; }
.gazette .mast { text-align: center; font-weight: bold; font-size: 20px; letter-spacing: 3px; border-bottom: 2px solid #2b2416; padding-bottom: 4px; }
.gazette .date { text-align: center; font-size: 12px; margin: 4px 0 8px; }
.gazette h3 { margin: 6px 0; font-size: 18px; }
.gazette .sub { font-style: italic; margin: 2px 0; }
.gazette p { margin: 6px 0 0; font-size: 14px; line-height: 1.5; }
.gallery { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.art { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 10px; }
.art .frame { background: #6b4a2b; padding: 6px; border-radius: 2px; width: fit-content; margin: 0 auto 8px; }
.art canvas { display: block; width: 128px; height: 128px; image-rendering: pixelated; }
.art .title { font-weight: bold; } .art .meta { color: var(--muted); } .art .why { margin-top: 4px; font-style: italic; color: var(--muted); }
.grave { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 10px; }
.grave b { font-size: 14px; } .grave .meta { color: var(--muted); }
.empty { color: var(--muted); padding: 20px; text-align: center; }
