:root { --bg: #0b0e14; --panel: #121724; --panel2: #171d2c; --line: #232b3d; --text: #e6e9f0; --dim: #8c95a8; --red: #f0555b; --blue: #4b8dff; --gold: #f5c542; --green: #46c98b; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 13px/1.45 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: inherit; text-decoration: none; } a:hover { text-decoration: underline; }
.red { color: var(--red); } .blue { color: var(--blue); } .dim { color: var(--dim); } .gold { color: var(--gold); }
code, .mono { font: 12px ui-monospace, Menlo, monospace; }

header { display: flex; align-items: center; gap: 18px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: #0d111a; }
.brand { display: flex; align-items: baseline; gap: 10px; white-space: nowrap; } .brand:hover { text-decoration: none; }
.brand b { font-size: 20px; letter-spacing: .02em; } .brand span { color: var(--dim); }
#status { flex: 1 1 auto; margin: 0; color: var(--dim); text-align: center; } #status b { color: var(--text); font-weight: 600; }
nav { display: flex; gap: 14px; white-space: nowrap; } nav a { color: var(--dim); } nav a:hover { color: var(--text); text-decoration: none; }
#notice { margin: 12px 16px 0; padding: 10px 14px; border: 1px solid #6b5a1e; background: #2a2410; color: var(--gold); border-radius: 10px; }

/* three columns on a wide screen: the board (as tall as the window at most), the match's panel (panel.css), the
   lists; on a narrower one the board keeps its size and the lists go under it, side by side */
main { display: grid; grid-template-columns: minmax(520px, 1fr) 580px 500px; gap: 16px; padding: 16px; align-items: start; max-width: 2480px; margin: 0 auto; }
#stage { justify-self: center; width: 100%; max-width: calc((100vh - 110px) * 1240 / 1100); min-width: 0; }
#lists { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
@media (max-width: 1800px) {
  main { grid-template-columns: minmax(420px, 1fr) 580px; }
  #lists { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); align-items: start; }
}
@media (max-width: 1060px) { main { grid-template-columns: minmax(0, 1fr); } #lists { grid-template-columns: minmax(0, 1fr); } }
canvas { width: 100%; display: block; }
#board { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
section { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
h2 { margin: 0 0 10px; font-size: 11px; letter-spacing: .14em; color: var(--dim); text-transform: uppercase; font-weight: 600; }
h3 { margin: 0 0 8px; font-size: 14px; }
select, button, input { background: #0d1220; color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font: inherit; }
button { cursor: pointer; } button:hover { border-color: var(--dim); } button:disabled { opacity: .4; cursor: default; }
button.on { background: var(--text); color: #0b0e14; border-color: var(--text); }

/* which game this is: under the line that names it - its round, its seed, how it ended, and whether this page got
   the chain's record */
#match { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; min-height: 20px; }
#match .meta { color: var(--dim); }
.badge { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .04em; border: 1px solid var(--line); color: var(--dim); }
.badge.verified { color: var(--green); border-color: #1f5a41; background: #0f2219; }
.badge.mismatch { color: #fff; border-color: var(--red); background: #6a1d22; }
.badge.other { color: var(--gold); border-color: #6b5a1e; background: #2a2410; }

kbd { font: 11px ui-monospace, Menlo, monospace; background: #0d1220; border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; color: var(--text); }

#boardWrap { position: relative; }
#boardNote { position: absolute; inset: 0; margin: 0; display: grid; place-items: center; text-align: center; padding: 40px; font-size: 16px; color: var(--dim); background: rgba(11, 14, 20, .82); border-radius: 14px; }
#boardNote[hidden] { display: none; }
#legend { color: var(--dim); margin: 6px 2px 0; } #legend b { color: var(--text); font-weight: 600; }
.swatch { display: inline-block; min-width: 30px; padding: 0 4px; margin-right: 2px; border-radius: 4px; color: #fff; text-align: center; font-weight: 700; }

/* the lists */
table.list { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.list th { text-align: left; font-weight: 500; color: var(--dim); font-size: 11px; padding: 0 8px 6px 0; white-space: nowrap; }
table.list td { padding: 5px 8px 5px 0; border-top: 1px solid var(--line); vertical-align: baseline; white-space: nowrap; }
table.list td.name { white-space: normal; } table.list td.num, table.list th.num { text-align: right; padding-right: 0; padding-left: 8px; }
table.list tr.now td { background: #19223a; } table.list tr.void td { color: var(--dim); }
table.list a.dna { font-weight: 700; } table.list small { color: var(--dim); }
.winner { font-weight: 800; } .loser { opacity: .62; }
.ok { color: var(--green); } .bad { color: #ff7a80; font-weight: 700; } table.list td.mark { width: 1%; padding-left: 10px; }
.more { flex-wrap: wrap; }
.more { margin-top: 10px; display: flex; gap: 8px; align-items: center; color: var(--dim); }
#round .due { font-size: 15px; font-weight: 700; margin-bottom: 8px; } #round .pair { padding: 3px 0; border-top: 1px solid var(--line); }
.empty { color: var(--dim); margin: 0; }


/* how to enter, and the foot */
#how { margin: 0 16px 16px; } .how { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 22px; }
.how p, .how li { color: #c5cbd9; } .how ol { margin: 0; padding-left: 18px; } .how li { margin-bottom: 5px; } .how b { color: var(--text); }
footer { padding: 4px 18px 26px; color: var(--dim); font-size: 12px; } footer .mono { color: var(--dim); }


/* the king's card and the lists of the hill */
#king .name { font-size: 20px; font-weight: 800; } #king .name small { color: var(--dim); font-weight: 400; font-size: 12px; margin-left: 6px; }
#king dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; margin: 8px 0 0; } #king dt { color: var(--dim); } #king dd { margin: 0; font-variant-numeric: tabular-nums; }
#king .big { font: 800 22px/1.1 ui-monospace, Menlo, monospace; }
table.list td.result { white-space: nowrap; } .took { color: var(--green); font-weight: 700; } .lost { color: var(--dim); } .drawn { color: var(--gold); } .broken { color: #ff7a80; } .waiting { color: var(--dim); font-style: italic; }
.badge.matches { color: var(--green); border-color: #1f5a41; background: #0f2219; }
