:root {
  --bg: #f4f1ea; --panel: #fffdf8; --ink: #2b2a27; --muted: #77736b; --line: #d9d3c7; --accent: #2f6f8f;
  --sea: #9cc3d5; --hi: #ffd34d;
  --RED: #c8463d; --BLUE: #3a6fc4; --ORANGE: #e08a2e; --WHITE: #f7f7f2;
  --WOOD: #4f7f3a; --BRICK: #b5603b; --SHEEP: #9ccc65; --WHEAT: #e6c24a; --ORE: #8a8f98; --DESERT: #d9c8a0;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #1d1f22; --panel: #26292d; --ink: #ece8df; --muted: #a29d93; --line: #3a3e44; --sea: #2c4f63; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.4 system-ui, -apple-system, sans-serif; }
header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
h1 { font-size: 18px; margin: 0; }
h2 { font-size: 17px; margin: 0 0 8px; }
.status { color: var(--muted); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.start { max-width: 640px; margin: 24px auto; }
.levels { display: grid; gap: 6px; margin: 12px 0; }
.levels label { display: flex; gap: 8px; align-items: baseline; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.levels small { color: var(--muted); }
.consent { display: block; color: var(--muted); font-size: 13px; margin: 8px 0 12px; }
button { font: inherit; padding: 6px 12px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
main { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 12px; padding: 12px; max-width: 1200px; margin: 0 auto; }
@media (max-width: 860px) { main { grid-template-columns: 1fr; } }
.board-wrap { background: var(--sea); border-radius: 10px; }
#board { width: 100%; height: auto; display: block; max-height: calc(100vh - 80px); }
aside { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.player { display: grid; grid-template-columns: 14px 1fr auto; gap: 2px 8px; align-items: center; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); margin-bottom: 4px; }
.player.to-move { outline: 2px solid var(--accent); }
.player .dot { width: 12px; height: 12px; border-radius: 50%; border: 1px solid #0005; }
.player .vp { font-weight: 600; font-size: 18px; }
.player .meta { grid-column: 2 / 4; color: var(--muted); font-size: 12px; }
.prompt { font-weight: 600; margin-bottom: 8px; }
.hand, .devs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.card { min-width: 44px; padding: 4px 6px; border-radius: 5px; text-align: center; font-size: 12px; color: #111; border: 1px solid #0003; }
.card b { display: block; font-size: 16px; }
.dev { background: var(--bg); color: var(--ink); }
.buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.dialog:not(:empty) { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.dialog .row { width: 100%; display: flex; gap: 6px; align-items: center; }
.log { list-style: none; margin: 0; padding: 8px 12px; max-height: 240px; overflow: auto; font-size: 13px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.log li.mine { color: var(--ink); }
/* board */
.tile { stroke: #0004; stroke-width: .05; }
.token, .num, .pip, .robber, .dice, .port { pointer-events: none; }
.token { fill: #f8f2e2; stroke: #0005; stroke-width: .03; }
.num { font: 600 .55px system-ui; text-anchor: middle; dominant-baseline: central; fill: #222; }
.num.red { fill: #c0392b; }
.pip { fill: #222; }
.road { stroke-linecap: round; stroke-width: .22; }
.edge-hit { stroke: transparent; stroke-width: .35; stroke-linecap: round; }
.edge-hit.legal { stroke: var(--hi); stroke-opacity: .75; cursor: pointer; }
.node-hit { fill: transparent; }
.node-hit.legal { fill: var(--hi); fill-opacity: .85; stroke: #0007; stroke-width: .04; cursor: pointer; }
.tile.legal { stroke: var(--hi); stroke-width: .18; cursor: pointer; }
.piece { stroke: #000a; stroke-width: .05; }
.port { font: 600 .36px system-ui; text-anchor: middle; dominant-baseline: central; fill: #1d2b33; }
.robber { fill: #333; stroke: #fff; stroke-width: .04; }
.dice { font: 700 .5px system-ui; fill: #fff; }
footer { max-width: 1200px; margin: 8px auto 24px; padding: 0 16px; color: var(--muted); font-size: 12px; }
a { color: var(--accent); }
.tag { color: var(--muted); }
.doc { max-width: 680px; margin: 24px auto; padding: 0 16px; }
.doc code { background: var(--panel); padding: 1px 4px; border-radius: 4px; }
.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 4px; }
.form .kinds { display: flex; gap: 16px; }
.form .kinds label, .form label.consent { flex-direction: row; align-items: baseline; gap: 6px; }
textarea, input:not([type]), input[type=text] { font: inherit; padding: 6px 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); max-width: 100%; }
.row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
