[hidden] { display: none !important; }
:root { --bg: #15121a; --panel: #211c28; --ink: #e8e0ee; --dim: #8d8399; --line: #3b3346; --accent: #c0392b;
  --f0: #5b8fd6; --f1: #d6a35b; --lt: #e04a6a; --army: #7fb4ff; --hero: #ffd34d; --fog: 0.28; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 system-ui, sans-serif; }
header { display: flex; flex-wrap: wrap; gap: 14px; align-items: baseline; padding: 10px 16px; border-bottom: 1px solid var(--line); }
header h1 { margin: 0; font-size: 20px; color: var(--accent); letter-spacing: 0.06em; }
#join { max-width: 640px; margin: 24px auto; padding: 0 16px; }
#join label { display: block; margin: 10px 0; }
input, select, button { font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; }
button { cursor: pointer; }
button:hover { border-color: var(--accent); }
button.big { width: 100%; padding: 10px; margin: 8px 0; background: #3a1f24; }
button.big.on { background: #1f3a28; }
#seats button { display: block; width: 100%; text-align: left; margin: 6px 0; }
#seats button:disabled { opacity: 0.5; cursor: default; }
.error { color: #ff7b72; min-height: 1.2em; }
main { display: grid; grid-template-columns: minmax(300px, 1.2fr) minmax(300px, 1fr) minmax(220px, 0.6fr); gap: 16px; padding: 12px 16px; }
@media (max-width: 1000px) { main { grid-template-columns: 1fr; } }
#map { width: 100%; background: #1b1722; border: 1px solid var(--line); border-radius: 8px; }
#map text { font-size: 2.6px; fill: var(--ink); pointer-events: none; }
#map .road { stroke: #4b4258; stroke-width: 0.5; }
#map .road-days { font-size: 2px; fill: var(--dim); }
#map .site { cursor: pointer; }
#map .hit { fill: transparent; }
#map .fogged { opacity: var(--fog); }
#map .f0 { fill: var(--f0); } #map .f1 { fill: var(--f1); } #map .wild { fill: #7c6f8a; }
#map .lair { fill: var(--accent); } #map .outpost { fill: #e67e22; }
#map .burned { stroke: #ff5a2a; stroke-width: 0.8; }
#map .walls { stroke: #ddd; stroke-width: 0.5; }
#map .mark { fill: #ffb347; stroke: #ffb347; stroke-width: 0.4; }
#map .u-lt { fill: var(--lt); } #map .u-army { fill: var(--army); } #map .u-hero { fill: var(--hero); }
.u-lt { color: var(--lt); } .u-army { color: var(--army); } .u-hero { color: var(--hero); }
.legend { color: var(--dim); font-size: 13px; }
pre { white-space: pre-wrap; line-height: 1.5; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 8px; font-size: 13px; margin: 6px 0; }
#news:empty { display: none; }
#news { border-color: var(--accent); }
#lines li { margin: 4px 0; }
#lines .preview { color: var(--dim); font-size: 13px; }
#lines button { padding: 0 6px; margin-left: 6px; }
#cmdform, #chatform { display: flex; gap: 6px; }
#cmdform input, #chatform input { flex: 1; min-width: 0; }
#offers button { display: block; width: 100%; text-align: left; margin: 4px 0; }
#offers small { color: var(--dim); }
#chat { height: 50vh; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 6px; font-size: 14px; }
#chat .sys { color: var(--dim); font-style: italic; }
#chat b { color: var(--accent); }
h3 { margin: 12px 0 4px; font-size: 16px; }
.r-yes { color: #6fd38a; } .r-no { color: var(--dim); }
#cmdlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
#cmdlist button.cmd { text-align: left; padding: 6px 8px; }
#cmdlist .args { color: var(--dim); font-family: ui-monospace, monospace; font-size: 13px; }
#cmdlist .what { color: var(--dim); font-size: 12px; line-height: 1.3; }
.hint { color: var(--dim); font-size: 13px; margin: 2px 0 6px; }
#allcmds h4 { margin: 10px 0 4px; font-size: 14px; color: var(--accent); }
#allcmds table { width: 100%; border-collapse: collapse; font-size: 13px; }
#allcmds td { padding: 3px 6px; vertical-align: top; border-top: 1px solid var(--line); }
#allcmds td:first-child { white-space: nowrap; font-family: ui-monospace, monospace; }
#allcmds td:first-child span { color: var(--dim); }
#allcmds td:last-child { color: var(--dim); overflow-wrap: anywhere; }
@media (max-width: 520px) { #allcmds td:first-child { white-space: normal; } }
dialog#guide { max-width: 720px; width: calc(100% - 32px); max-height: calc(100vh - 48px); padding: 0 20px 20px;
  background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; }
dialog#guide::backdrop { background: rgba(0, 0, 0, 0.6); }
.guidehead { display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; background: var(--panel); padding-top: 14px; }
.guidehead h2 { margin: 0; color: var(--accent); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; position: sticky; top: 48px; background: var(--panel); padding-bottom: 6px; }
.tab.on { border-color: var(--accent); background: #3a1f24; }
.gpage li { margin: 4px 0; }
.gpage code { background: var(--bg); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.classcard { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--lt); border-radius: 6px;
  padding: 8px 10px; margin: 6px 0; font-size: 14px; }
.classcard b { color: var(--ink); }
.classcard div { color: var(--dim); margin-top: 3px; }
#join .classcard { max-width: 100%; }
.markkey { color: #ffb347; }
