@font-face { font-family: 'Jost'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('/assets/fonts/jost.woff2') format('woff2'); }
:root {
  --bg: #efe8d0;
  --surface: #fbf7ea;
  --surface-2: #f3ecd6;
  --text: #171717;
  --muted: #645f52;
  --line: #d3c9a8;
  --ink: #111111;
  --accent: #ed1b24;
  --accent-2: #1fb25a;
  --board: #cde5c9;
  --cell: #fbf7ea;
  --danger: #c0151c;
  --shadow: 0 1px 2px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --board-size: calc(100vh - 170px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #181b18; --surface: #22261f; --surface-2: #2b3027; --text: #efe9d6; --muted: #aaa591; --line: #3d4337; --ink: #e8e2cc;
    --accent: #ff3b42; --accent-2: #37d27a; --board: #1f3b2a; --cell: #2b3a2d; --danger: #ff6b61;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.35);
  }
}
:root[data-theme="dark"] {
  --bg: #181b18; --surface: #22261f; --surface-2: #2b3027; --text: #efe9d6; --muted: #aaa591; --line: #3d4337; --ink: #e8e2cc;
  --accent: #ff3b42; --accent-2: #37d27a; --board: #1f3b2a; --cell: #2b3a2d; --danger: #ff6b61;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.35);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.45 "Jost", "Kabel", "Futura", "Century Gothic", system-ui, sans-serif; padding: 0 16px 32px; }
h1 { font-size: 20px; margin: 0; font-weight: 700; letter-spacing: .01em; }
h1 small { font-weight: 400; color: var(--muted); font-size: 13px; margin-left: 6px; }
h2 { font-size: 18px; margin: 0 0 10px; font-weight: 700; }
h3 { font-size: 13px; margin: 14px 0 6px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
a { color: var(--accent); }
.muted { color: var(--muted); font-size: 13px; }
.hidden { display: none !important; }
.plate { display: inline-block; background: var(--accent); color: #fff; padding: 1px 10px 0; border: 2px solid var(--ink); border-radius: 4px; font-weight: 800; letter-spacing: .06em; transform: rotate(-3deg); margin-right: 6px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; }
.logo { width: 28px; height: 28px; border-radius: 7px; background: var(--accent) url('/favicon.svg') center/cover; display: inline-block; }
.names { position: relative; }
.names-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 8px; width: 320px; max-width: calc(100vw - 32px); }
.names-pop input { margin-bottom: 4px; }
.names-pop ul { list-style: none; margin: 4px 0; padding: 0; max-height: 280px; overflow: auto; }
.names-pop li { padding: 6px 8px; border-radius: 6px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; align-items: baseline; font-size: 14px; }
.names-pop li:hover, .names-pop li.active { background: var(--surface-2); }
.names-pop li.current b { color: var(--accent); }
.names-pop li.none { color: var(--muted); cursor: default; }
.names-pop .region { color: var(--muted); font-size: 12px; }
.names-pop .cur { font-weight: 700; color: var(--muted); }
.names-pop p { margin: 4px 2px 0; font-size: 12px; }
.cmid .note { font-size: clamp(10px, 1.6vmin, 14px); color: var(--muted); max-width: 80%; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 10px; border: 1px solid var(--line); max-width: 100%; }
.tab { border: 0; background: transparent; color: var(--muted); padding: 7px 14px; border-radius: 7px; cursor: pointer; font: inherit; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; font-size: 12px; text-decoration: none; }
.tab.active { background: var(--accent); color: #fff; box-shadow: var(--shadow); }
.panel { display: none; }
.panel.active { display: block; }
main { max-width: 1500px; margin: 0 auto; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }
.form label, .row label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.row { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0; align-items: flex-end; }
.row > label { min-width: 140px; flex: 1; }
label.check { flex-direction: row; align-items: center; gap: 6px; color: var(--text); min-width: 0; }
label.check.small { font-size: 12px; }
input[type=text], input[type=number], input[type=password], input[type=url], select, textarea {
  font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; width: 100%;
}
textarea { resize: vertical; }
input[type=color] { width: 40px; height: 32px; padding: 2px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); }
.btn { font: inherit; font-weight: 600; background: var(--surface-2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 7px 14px; cursor: pointer; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.danger { color: var(--danger); }
.btn.file { display: inline-block; }
.btn[disabled] { opacity: .5; cursor: default; }
.btn.small { padding: 3px 8px; font-size: 12px; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- the game view: the board fills the window height, the feeds beside it, the players beneath ---------- */
.notice { background: var(--surface); border: 1px solid var(--accent); border-left-width: 6px; border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; font-size: 14px; }
.gamebar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.gamebar-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gamebar-right { display: flex; gap: 10px; align-items: center; }
.gamebar-right label { font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.gamebar-right select { width: auto; }
.gtitle { font-weight: 700; font-size: 16px; }
.status { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .1em; padding: 2px 8px; border-radius: 4px; border: 1px solid var(--line); color: var(--muted); min-width: 0; }
.status:empty { display: none; }
.status.live { background: var(--accent); color: #fff; border-color: var(--accent); animation: pulse 1.6s ease-in-out infinite; }
.status.done { background: var(--accent-2); color: #fff; border-color: var(--accent-2); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
.replay { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.replay select { width: auto; padding: 4px 6px; font-size: 12px; }
.replay input[type=range] { flex: 1; min-width: 160px; accent-color: var(--accent); }
.replay #r-info { font-size: 12px; white-space: nowrap; }
.replay .btn.small { min-width: 34px; }
.pchip { display: inline-block; border-left: 6px solid var(--pc); padding: 0 5px; font-size: 12px; background: var(--surface-2); border-radius: 3px; margin: 1px 0; }
td.players-cell { max-width: 420px; }
tr[data-id] { cursor: pointer; }
tr[data-id]:hover td { background: var(--surface-2); }
.narrator { margin-top: 14px; }
.narrator .recap { font-size: 15px; line-height: 1.5; white-space: pre-wrap; margin: 6px 0 10px; }
.narrator .ask { display: grid; gap: 8px; margin-bottom: 8px; }
.narrator .answer { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; white-space: pre-wrap; line-height: 1.5; }
.tiles.wide { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 8px 0 12px; }
.tiles.wide .tile { padding: 8px 6px; }
.tiles.wide .tile .v { font-size: 20px; }
.tiles.wide .tile .k { font-size: 10px; }
.bigroll .rollchart text { font-size: 9px; }
.heat-wrap { max-width: 640px; margin: 10px auto; }
.heat { display: grid; aspect-ratio: 1; width: 100%; border: 2px solid var(--ink); background: var(--ink); gap: 1px; container-type: inline-size; }
.hcell { background: linear-gradient(rgba(237,27,36,var(--heat, 0)), rgba(237,27,36,var(--heat, 0))), var(--cell); display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 2px; font-size: clamp(6px, 1.2cqw, 11px); line-height: 1.1; overflow: hidden; }
.hcell .hn { font-weight: 600; text-transform: uppercase; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hcell .hv { font-weight: 800; font-size: 1.15em; }
.hcentre { grid-column: 2 / -2; grid-row: 2 / -2; background: var(--board); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.hcentre .k { font-size: clamp(9px, 1.6cqw, 14px); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
table.models td.mk { font-size: 12px; }
.sw { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border: 1px solid rgba(0,0,0,.3); vertical-align: middle; }
.mini-rolls { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.mini .k { font-size: 12px; margin-bottom: 2px; }
.about p { font-size: 15px; line-height: 1.55; max-width: 72ch; }
.about code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.play-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.board-wrap { container-type: inline-size; background: var(--board); border-radius: 4px; padding: 6px; border: 3px solid var(--ink); width: 100%; max-width: min(100%, var(--board-size)); margin: 0 auto; }
.board { display: grid; gap: 0; aspect-ratio: 1; width: 100%; border: 1px solid var(--ink); background: var(--ink); }
.cell { background: var(--cell); position: relative; overflow: hidden; font-size: clamp(6px, 1.25cqw, 12px); line-height: 1.1; padding: 2px 3px; display: flex; flex-direction: column; justify-content: flex-end; outline: 1px solid var(--ink); color: var(--text); }
.cell.prop { cursor: pointer; }
.cell .band { position: absolute; background: var(--gc, transparent); border: 0 solid var(--ink); }
.cell.bottom .band { top: 0; left: 0; right: 0; height: 22%; border-bottom-width: 1px; }
.cell.top .band { bottom: 0; left: 0; right: 0; height: 22%; border-top-width: 1px; }
.cell.left .band { right: 0; top: 0; bottom: 0; width: 22%; border-left-width: 1px; }
.cell.right .band { left: 0; top: 0; bottom: 0; width: 22%; border-right-width: 1px; }
.cell.bottom { padding-top: 24%; }
.cell.top { padding-bottom: 24%; justify-content: flex-start; }
.cell.left { padding-right: 24%; }
.cell.right { padding-left: 24%; }
.cell .own { position: absolute; background: var(--owner); }
.cell.bottom .own { bottom: 0; left: 0; right: 0; height: 5px; }
.cell.top .own { top: 0; left: 0; right: 0; height: 5px; }
.cell.left .own { left: 0; top: 0; bottom: 0; width: 5px; }
.cell.right .own { right: 0; top: 0; bottom: 0; width: 5px; }
.cell .name { font-weight: 600; overflow: hidden; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; text-transform: uppercase; letter-spacing: .01em; }
.cell .price { color: var(--muted); font-size: .9em; }
.cell .bld { font-size: .9em; color: var(--accent); font-weight: 700; }
.cell.corner { font-weight: 700; justify-content: center; align-items: center; text-align: center; font-size: 1em; padding: 2px; }
.cell.corner .name { -webkit-line-clamp: 3; white-space: normal; overflow-wrap: normal; }
.cell.mort { background: repeating-linear-gradient(45deg, var(--cell), var(--cell) 4px, rgba(0,0,0,.1) 4px, rgba(0,0,0,.1) 8px); }
.cell.focus { outline: 2px solid var(--accent); z-index: 2; }
.cell.pinned { box-shadow: inset 0 0 0 2px var(--accent); }
.cell .tokens { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); display: flex; flex-wrap: wrap; gap: 1px; max-width: 70%; justify-content: center; z-index: 1; }
.tok { width: 14px; height: 14px; border-radius: 50%; color: #fff; font-size: 8px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,.8); box-shadow: 0 0 0 1px rgba(0,0,0,.5); }
@media (max-width: 1000px) { .play-grid { grid-template-columns: 1fr; } .board-wrap { max-width: 100%; } }
@media (max-width: 600px) { .cell { padding: 1px 2px; } .cell .price, .cell .bld { display: none; } .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* the centre: the edition line at the top, the match or a property in the middle, the dice box at the bottom */
.centre { grid-column: 2 / -2; grid-row: 2 / -2; background: var(--board); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 4px; padding: 2.5%; min-height: 0; min-width: 0; text-align: center; }
.cline { font-size: clamp(9px, 1.4vmin, 13px); color: var(--muted); }
.cmid { min-height: 0; overflow: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.mlogo span { display: inline-block; background: var(--accent); color: #fff; font-weight: 800; letter-spacing: .08em; font-size: clamp(13px, 3vmin, 30px); padding: .1em .6em 0; border: 2px solid var(--ink); border-radius: 4px; transform: rotate(-4deg); }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; width: 100%; }
.tile { background: var(--cell); border: 1px solid var(--ink); border-radius: 4px; padding: 4px 2px; min-width: 0; }
.tile .v { font-weight: 700; font-size: clamp(10px, 1.7vmin, 16px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .k { font-size: clamp(7px, 1.1vmin, 10px); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rolls .k { font-size: clamp(8px, 1.2vmin, 11px); color: var(--muted); }
.rollchart { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.rollchart rect { fill: var(--pc, var(--accent)); opacity: .85; }
.rollchart polyline { stroke: var(--ink); stroke-width: 1.2; }
.rollchart text { font: 7px "Jost", sans-serif; fill: var(--muted); }
.cbox { background: var(--cell); border: 2px solid var(--ink); border-radius: 6px; padding: 6px 8px; }
.cbox .dice { font-size: clamp(14px, 3vmin, 28px); font-weight: 700; line-height: 1.1; }
.cbox .last { font-size: clamp(9px, 1.4vmin, 13px); color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cbox .winner { color: var(--accent); font-weight: 800; font-size: clamp(11px, 2vmin, 18px); margin-top: 2px; }
.deed { width: min(100%, 300px); background: var(--cell); border: 2px solid var(--ink); border-radius: 4px; text-align: left; font-size: clamp(9px, 1.4vmin, 13px); }
.deed-head { background: var(--gc); color: var(--deed-ink, #fff); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; text-align: center; padding: 6px 8px; border-bottom: 2px solid var(--ink); }
.deed-body { padding: 6px 10px 8px; }
.deed .line { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px dotted var(--line); padding: 2px 0; }
.deed .line span:first-child { color: var(--muted); }
.deed .state { color: var(--accent); font-weight: 600; margin-left: 6px; }
.deed .sub { margin-top: 6px; font-size: .85em; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.deed ul { list-style: none; margin: 2px 0 0; padding: 0; }
.deed li { padding: 1px 0; }
.deed .earners li b { float: right; }
.deed .ledger li { border-bottom: 1px dotted var(--line); }
.deed .ledger .r { color: var(--muted); font-size: .85em; margin-right: 4px; }
.deed .none { color: var(--muted); font-style: italic; }
.deed .hint { margin-top: 6px; font-size: .8em; color: var(--muted); text-align: center; }
.dot { display: inline-block; width: .7em; height: .7em; border-radius: 50%; margin-right: 4px; vertical-align: baseline; border: 1px solid rgba(0,0,0,.3); }

/* the players beneath the board */
.player-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 10px; margin-top: 14px; }
.pcard { border: 1px solid var(--line); border-top: 6px solid var(--pc); border-radius: 8px; padding: 8px 10px; background: var(--surface); font-size: 13px; }
.pcard.current { outline: 2px solid var(--accent); }
.pcard.bankrupt { opacity: .5; }
.pcard .n { font-weight: 700; display: flex; justify-content: space-between; font-size: 15px; }
.pcard .m { color: var(--muted); font-size: 11px; }
.pcard .props { font-size: 11px; margin-top: 6px; display: flex; flex-wrap: wrap; gap: 3px; }
.pcard .chip { display: inline-block; border-left: 8px solid var(--gc); padding: 1px 5px; background: var(--surface-2); border-radius: 3px; border-top: 1px solid var(--line); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pcard .chip i { font-style: normal; font-weight: 700; color: var(--accent); }
.pcard .none { color: var(--muted); font-style: italic; }
.pcard .income { margin-top: 6px; font-size: 12px; }
.pcard .tot b { font-weight: 700; }
.pcard .src { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1px 12px; font-size: 11px; }
.pcard .src li { display: flex; justify-content: space-between; gap: 6px; border-bottom: 1px dotted var(--line); }
.pcard .src.per { margin-top: 4px; grid-template-columns: 1fr; }
.pcard .src .sw { display: inline-block; width: 8px; height: 8px; margin-right: 4px; background: var(--gc); border: 1px solid rgba(0,0,0,.3); flex: none; align-self: center; }
.pcard .rolls { margin-top: 6px; --pc: var(--pc); }
.pcard .rolls .k { font-size: 11px; }
.pcard .reason { font-size: 11px; color: var(--muted); font-style: italic; margin-top: 4px; }

.side { min-width: 0; }
.feed-head { display: flex; justify-content: space-between; align-items: center; }
.feed-head h3 { margin: 0 0 6px; }
.feed { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; height: 280px; overflow: auto; font-size: 12px; padding: 6px 8px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; margin-bottom: 12px; }
.feed div { padding: 1px 0; border-bottom: 1px dotted var(--line); white-space: pre-wrap; word-break: break-word; }
.feed .ev-bankrupt, .feed .ev-game_end { color: var(--accent); font-weight: 700; }
.feed .ev-purchase, .feed .ev-auction_won, .feed .ev-build { color: var(--accent-2); }
.feed.llm { height: 220px; }
.feed.chat { height: 220px; font-family: inherit; font-size: 13px; }
.feed.chat .who { font-weight: 700; color: var(--c); }
.feed.chat .priv { color: var(--muted); font-style: italic; }
.feed.llm .err { color: var(--danger); }
details summary { cursor: pointer; margin: 10px 0 6px; font-weight: 600; }

table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow: auto; }
.chart { width: 100%; max-width: 900px; height: auto; margin: 8px 0 16px; display: block; }
.chart text { font: 11px "Jost", sans-serif; fill: var(--muted); }
.chart .axis { stroke: var(--line); }
.chart .grid { stroke: var(--line); stroke-dasharray: 2 3; }
.legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; margin-bottom: 6px; }
.legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--c); margin-right: 5px; vertical-align: middle; }
pre.json { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px; overflow: auto; max-height: 400px; font-size: 12px; }
footer { text-align: center; margin-top: 24px; }

.page-404 main { display: flex; justify-content: center; padding-top: 40px; }
.notfound { max-width: 420px; text-align: center; border-top: 8px solid var(--accent); }
.notfound .chance { color: var(--accent); font-weight: 800; letter-spacing: .2em; margin: 0 0 8px; }
