/* =====================================================================
   CLANKOFF · JAPANDI
   Scandinavian calm meets Japanese restraint: warm stone-white surfaces,
   charcoal ink, hairline borders, soft corners, a muted natural palette
   (aizome indigo, sage, oak, clay) used sparingly. One sans, one mono.
   ===================================================================== */
:root {
  --bg: #161513; --surface: #201f1c; --surface-2: #292825; --sunk: #33312d; --hover: #2a2926;
  --ink: #ebe6dd; --text: #ebe6dd; --text-2: #d0cac0; --muted: #aaa499;
  --line: #34322e; --line-2: #2b2a27; --rule: #ebe6dd;
  --indigo: #8ea3c4; --indigo-2: #aabcd8; --sage: #96ae8b; --oak: #cba872; --clay: #d48c74;
  --accent: var(--indigo); --ok: var(--sage); --warn: var(--oak); --err: var(--clay);
  /* aliases used by the per-game styles */
  --signal: var(--indigo); --signal-ink: var(--indigo-2); --pen: var(--indigo); --redpen: var(--clay);
  --paper: var(--bg); --paper-2: var(--surface); --paper-3: var(--surface-2); --panel: var(--surface); --panel-border: var(--line);
  --radius: 12px; --r-sm: 8px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.04);
  --sans: 'Geist', system-ui, sans-serif; --body: var(--sans);
  --mono: 'Geist Mono', ui-monospace, monospace;
  /* read by the chart canvas in arena.js */
  --chart-grid: rgba(235,230,221,.06); --chart-zero: rgba(235,230,221,.25); --chart-axis: #a29c91;
  --bar-h: 64px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font: 14px/1.55 var(--sans); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
::selection { background: rgba(142,163,196,.16); }
[hidden] { display: none !important; }
#gl { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 5; pointer-events: none; }
* { scrollbar-color: #3d3a35 transparent; scrollbar-width: thin; }

/* ---------- buttons / inputs ---------- */
button {
  font: 500 13.5px/1.2 var(--sans); padding: 8px 14px; border-radius: var(--r-sm); cursor: pointer; white-space: nowrap;
  border: 1px solid var(--line); color: var(--ink); background: var(--surface); transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
button:hover:not(:disabled) { border-color: #4e4b46; background: var(--hover); }
button:focus-visible { outline: 2px solid rgba(142,163,196,.35); outline-offset: 2px; }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary { background: var(--ink); border-color: var(--ink); color: #161513; }
button.primary:hover:not(:disabled) { background: #ffffff; border-color: #ffffff; }
button.secondary { background: var(--surface); }
button.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
button.ghost:hover:not(:disabled) { background: var(--surface-2); border-color: transparent; color: var(--ink); }
button.danger { background: transparent; border-color: rgba(212,140,116,.4); color: var(--clay); }
button.danger:hover:not(:disabled) { background: rgba(212,140,116,.08); border-color: var(--clay); }
button.wide { width: 100%; }
button.icon { padding: 4px 8px; font-size: 12px; background: transparent; border-color: var(--line); color: var(--text-2); border-radius: 6px; }
button.icon:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }
input, select { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; font: 14px var(--sans); outline: none; min-width: 0; transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover { border-color: #46433e; }
input:focus, select:focus { border-color: var(--indigo); box-shadow: 0 0 0 3px rgba(142,163,196,.12); }
input::placeholder { color: #6b665d; }
a { color: var(--indigo); text-decoration: none; }
a:hover { color: var(--indigo-2); }
small { color: var(--muted); font-weight: 400; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 10; height: var(--bar-h); display: flex; align-items: center; gap: 28px; padding: 0 28px; background: rgba(22,21,19,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand b { font: 600 16.5px var(--sans); letter-spacing: -.01em; }
.logo { display: grid; grid-template-columns: repeat(3, 6px); gap: 1.5px; padding: 3px; background: var(--ink); border-radius: 4px; }
.logo span { width: 6px; height: 6px; border-radius: 1px; background: #00a050; }
.logo span:nth-child(2), .logo span:nth-child(9) { background: #c8102e; }
.logo span:nth-child(4) { background: #ffcf00; }
.logo span:nth-child(6), .logo span:nth-child(7) { background: #f2f2ee; }
.logo span:nth-child(5) { background: #0046ad; }
.logo span:nth-child(3) { background: #ff6a00; }
.batch-info { flex: 1; min-width: 0; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.batch-info b { color: var(--ink); font-weight: 600; }
.batch-info code { font-family: var(--mono); font-size: 12px; color: var(--text-2); }
.bar-actions { display: flex; align-items: center; gap: 8px; }
.link { color: var(--text-2); margin-left: 6px; font-size: 13px; }
.link:hover { color: var(--ink); }
.conn { width: 7px; height: 7px; border-radius: 50%; background: var(--clay); margin-right: 4px; }
.conn.on { background: var(--sage); }

.tabs { display: flex; gap: 22px; align-self: stretch; }
.tabs a { display: flex; align-items: center; color: var(--muted); font-weight: 500; border-bottom: 1.5px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); border-bottom-color: var(--ink); }

.replaybar { position: sticky; top: var(--bar-h); z-index: 9; display: flex; align-items: center; gap: 14px; padding: 10px 28px; background: var(--surface); border-bottom: 1px solid var(--line); }
.replaybar input[type=range] { flex: 1; accent-color: var(--ink); border: 0; box-shadow: none; padding: 0; }
.replaybar output { font-family: var(--mono); color: var(--text-2); min-width: 120px; text-align: right; }
.speeds { display: flex; gap: 2px; padding: 2px; background: var(--surface-2); border-radius: var(--r-sm); }
.speeds button { padding: 4px 9px; font-size: 12px; background: transparent; border: 0; color: var(--muted); border-radius: 6px; }
.speeds button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.1); }

/* ---------- grid + tiles ---------- */
main { padding: 28px 28px 56px; }
.grid { display: grid; gap: 20px; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); }
.tile { --lane: var(--indigo); height: var(--tile-h, 560px); display: flex; flex-direction: column; position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.tile header { display: flex; align-items: center; gap: 10px; padding: 12px 14px 11px; }
.tile .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--lane); flex: none; }
.who { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.who b { font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who small { font-size: 12px; }
.rank { font-weight: 600; font-size: 13px; color: var(--oak); }
.badge, .seat .out, .run .badge { font: 500 12px/1 var(--sans); padding: 4px 8px; border-radius: 6px; background: var(--surface-2); color: var(--muted); white-space: nowrap; border: 0; }
.tile[data-outcome=running] .badge, .tile.duel[data-outcome=running] .badge { background: rgba(142,163,196,.1); color: var(--indigo); }
.tile[data-outcome=running] .badge::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--indigo); margin-right: 6px; vertical-align: 1px; animation: pulse 1.6s ease-in-out infinite; }
.tile[data-outcome=solved] .badge, .seat[data-outcome=won] .out { background: rgba(150,174,139,.13); color: #adc4a2; }
.tile[data-outcome=error] .badge, .tile[data-outcome=gave_up] .badge, .seat[data-outcome=lost] .out, .seat[data-outcome=error] .out { background: rgba(212,140,116,.1); color: var(--clay); }
.tile .view { position: relative; flex: 1 1 auto; min-height: 150px; cursor: grab; touch-action: none; margin: 0 10px; border-radius: 9px; background: radial-gradient(ellipse 65% 70% at 50% 42%, #35332f 0%, #252421 62%, #1b1a18 100%); }
.tile .view:active { cursor: grabbing; }
.overlay { position: absolute; left: 10px; bottom: 10px; padding: 4px 10px; border-radius: 6px; background: rgba(32,31,28,.92); color: var(--text-2); font-size: 12px; pointer-events: none; z-index: 6; max-width: calc(100% - 20px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.overlay:empty { display: none; }
.overlay.thinking::before, .seat-state.thinking::before, .mm-status.thinking::before, .cd-status.thinking::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--lane, var(--seat, var(--indigo))); margin-right: 7px; vertical-align: 1px; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.meta { display: flex; gap: 16px; padding: 14px 14px 8px; align-items: center; }
.net { display: grid; grid-template-columns: repeat(12, 1fr); gap: 1.5px; width: 126px; flex: none; }
.net i { aspect-ratio: 1; border-radius: 1.5px; }
.net i.blank { visibility: hidden; }
.stats { flex: 1; min-width: 0; }
.bar-row { display: flex; align-items: center; gap: 12px; }
.bar-row b { font: 500 15px var(--mono); min-width: 54px; }
.bar { flex: 1; height: 5px; background: var(--sunk); border-radius: 99px; overflow: hidden; }
.bar div { height: 100%; width: 0; background: var(--lane); border-radius: 99px; transition: width .4s ease; }
dl { display: flex; gap: 22px; margin: 10px 0 0; }
dl div { display: flex; flex-direction: column; }
dt { font-size: 12px; color: var(--muted); }
dd { margin: 0; font: 500 15px var(--mono); }
.thoughts { height: 92px; overflow-y: auto; padding: 2px 14px 12px; display: flex; flex-direction: column; gap: 6px; flex: none; }
.th { padding: 7px 10px; border-radius: var(--r-sm); background: var(--surface-2); font-size: 12.5px; line-height: 1.5; color: var(--text-2); }
.th.err { background: rgba(212,140,116,.08); color: #e6a48d; }
.th-meta { display: flex; justify-content: space-between; font: 12px var(--mono); color: var(--muted); margin-bottom: 2px; }
.th-meta b { font-weight: 500; } .th-meta b.up { color: var(--sage); } .th-meta b.down { color: var(--clay); }
.mv { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }
.chip { font: 500 12px var(--mono); padding: 1px 6px; border-radius: 5px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); }

/* ---------- empty state ---------- */
.empty-state { max-width: 640px; margin: 12vh auto; padding: 0 8px; color: var(--text-2); }
.empty-state h2 { margin: 0 0 14px; color: var(--ink); font: 600 clamp(34px, 4.6vw, 46px)/1.08 var(--sans); letter-spacing: -.025em; }
.empty-state h2 em { font-style: normal; }
.empty-state p { margin: 0 0 22px; font-size: 16px; max-width: 54ch; }
.empty-state .card-games { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 28px; }
.empty-state .card-games span { padding: 4px 11px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; color: var(--text-2); }
.empty-state button.primary { padding: 10px 18px; font-size: 14px; }

/* ---------- chart ---------- */
.chart-box { margin-top: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 16px; box-shadow: var(--shadow); }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.chart-head h3 { margin: 0; font: 600 14px var(--sans); color: var(--ink); }
.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: 0; }
#chart { width: 100%; height: 220px; display: block; margin-top: 12px; }

/* ---------- drawers ---------- */
.scrim { position: fixed; inset: 0; z-index: 19; background: rgba(0,0,0,.22); backdrop-filter: blur(2px); }
.drawer { position: fixed; top: 0; bottom: 0; z-index: 20; width: min(460px, 100vw); display: flex; flex-direction: column; background: var(--surface); box-shadow: 0 0 0 1px var(--line), 0 12px 48px rgba(0,0,0,.14); }
.drawer.left { left: 0; }
.drawer.right { right: 0; width: min(540px, 100vw); }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px 16px; }
.drawer-head h2 { margin: 0; font: 600 20px var(--sans); letter-spacing: -.015em; }
.drawer-head h2 small { font-size: 13px; margin-left: 6px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 0 24px 24px; }
.drawer-body h3 { display: flex; align-items: baseline; gap: 10px; margin: 24px 0 10px; font: 600 14px var(--sans); color: var(--ink); }
.drawer-body h3 small { font-weight: 400; font-size: 12.5px; }
.drawer-foot { padding: 16px 24px; border-top: 1px solid var(--line); }
.drawer-foot button.primary { padding: 11px 14px; font-size: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; color: var(--text-2); font-size: 13px; font-weight: 500; }
.field > small { font-weight: 400; font-size: 12px; line-height: 1.45; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.lanes { display: flex; flex-direction: column; gap: 8px; }
.lane { display: grid; grid-template-columns: 10px 1fr 1fr auto; grid-template-rows: auto auto auto; gap: 6px 8px; align-items: center; padding: 10px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line-2); }
.lane .sw { width: 4px; height: 34px; border-radius: 99px; justify-self: center; }
.lane .l-label { grid-column: 2 / 4; }
.lane .l-btns { display: flex; gap: 4px; grid-row: 1 / 3; grid-column: 4; }
.error { color: var(--clay); margin: 12px 0 0; }

.drawer-search { display: flex; gap: 8px; padding: 0 24px 14px; border-bottom: 1px solid var(--line); }
.drawer-search input { flex: 1; }
.h-list { flex: 1; overflow-y: auto; padding: 14px 24px; display: flex; flex-direction: column; gap: 10px; }
.h-item { padding: 13px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); display: grid; gap: 8px; transition: border-color .15s; }
.h-item:hover { border-color: #46433e; }
.h-item.current { border-color: var(--indigo); box-shadow: 0 0 0 3px rgba(142,163,196,.08); }
.h-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.h-top b { font-weight: 600; font-size: 14px; }
.h-meta { color: var(--muted); font-size: 12px; }
.h-chips { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.h-chip { font-size: 12px; padding: 2px 9px; border-radius: 99px; background: var(--surface-2); color: var(--text-2); }
.h-chip.solved, .h-chip.won { background: rgba(150,174,139,.13); color: #adc4a2; }
.h-chip.win { box-shadow: inset 0 0 0 1px rgba(150,174,139,.5); font-weight: 500; }
.h-chip.error, .h-chip.gave_up { background: rgba(212,140,116,.1); color: var(--clay); }
.h-chip.running { background: rgba(142,163,196,.1); color: var(--indigo); }
.h-chip.draw { color: var(--ink); }
.h-btns { display: flex; gap: 6px; }
.h-btns button { padding: 4px 10px; font-size: 12.5px; }
.live-pill, .t-pill, .g-pill { font: 500 12px/1 var(--sans); padding: 3px 7px; border-radius: 5px; vertical-align: 1px; white-space: nowrap; }
.live-pill { background: rgba(142,163,196,.1); color: var(--indigo); }
.t-pill { background: rgba(203,168,114,.14); color: #d9b985; }
.g-pill { background: var(--surface-2); color: var(--text-2); }
.h-empty { color: var(--muted); text-align: center; padding: 36px 0; }
.h-vs { color: var(--muted); font-size: 12px; align-self: center; }

@media (max-width: 900px) {
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 16px; gap: 8px 16px; }
  .tabs { order: 2; align-self: auto; }
  .tabs a { padding: 4px 0; margin-bottom: 0; }
  .bar-actions { flex-wrap: wrap; }
  .batch-info { order: 3; flex-basis: 100%; }
  .grid { grid-template-columns: 1fr !important; }
  .tile { height: 540px !important; }
  .replaybar { position: relative; top: 0; padding: 10px 16px; }
  main { padding: 18px 16px 40px; }
}
.lane .sw { grid-row: 1 / 4; height: 100%; min-height: 34px; }
.lane input[data-f=model], .lane .l-label { grid-column: 2 / 4; }
.lane .l-btns { grid-row: 1 / 4; align-self: start; }

/* ---------- games ---------- */
.hint { color: var(--muted); font-size: 12.5px; margin: 14px 0 0; line-height: 1.5; }
.hint-inline { color: var(--muted); font-size: 12px; }
.check { display: block; margin-top: 14px; color: var(--text-2); font-size: 13px; }
.check input { margin: 0 7px 0 0; vertical-align: -2px; accent-color: var(--ink); }
.game-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.game-card { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; white-space: normal; padding: 11px 13px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; font-weight: 400; font-size: 13px; }
.game-card:hover:not(.on) { background: var(--hover); }
.game-card b { font-weight: 600; font-size: 14px; }
.game-card small { font-size: 12px; line-height: 1.4; }
.game-card.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); background: var(--hover); }
.vs-row { display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); font-size: 12.5px; margin: 2px 0; }
.lane.seat-lane { grid-template-columns: 10px 1fr 1fr; }
.lane.seat-lane .seat-tag { grid-column: 2 / 4; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.lane.seat-lane .sw { grid-row: 1 / 5; }
.seat-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.tile .dot, .seat-dot, .legend i, .lane .sw { box-shadow: 0 0 0 1px rgba(0,0,0,.12); }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 50; background: var(--ink); color: #161513; padding: 11px 16px; border-radius: 10px; max-width: 80vw; box-shadow: 0 8px 30px rgba(0,0,0,.25); font-size: 13.5px; }

/* ---------- a duel tile (Connect Four; other duel games restyle the board) ---------- */
.tile.duel { --lane: var(--text); border-top-color: transparent; border-image: linear-gradient(90deg, #ef4444 50%, #facc15 50%) 1; border-image-width: 3px 0 0 0; }
.tile.duel header .who b { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.tile.duel header .who b small { color: var(--muted); font-weight: 500; }
.tile.duel header .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.tile.duel[data-outcome=running] .badge { background: rgba(239,95,23,.18); color: var(--signal-ink); }
.tile.duel .clock { font: 600 13px var(--mono); color: var(--text-2); min-width: 54px; text-align: right; }
.duel-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 1.25fr) minmax(0, 1fr); grid-template-areas: "s0 board s1"; gap: 14px; padding: 4px 14px 14px; }
.seat { grid-area: s0; display: flex; flex-direction: column; min-height: 0; border-radius: var(--radius); background: rgba(28,29,31,.03); border: 1px solid var(--panel-border); padding: 10px 12px; transition: border-color .2s, box-shadow .2s; }
.seat[data-seat="1"] { grid-area: s1; }
.seat.to-move { border-color: var(--seat); box-shadow: 0 0 0 1px var(--seat), 0 0 24px color-mix(in srgb, var(--seat) 18%, transparent); }
.seat-head { display: flex; align-items: center; gap: 9px; }
.disc-icon { width: 22px; height: 22px; border-radius: 50%; flex: none; background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--seat) 60%, #fff), var(--seat) 55%, color-mix(in srgb, var(--seat) 70%, #000)); box-shadow: inset 0 -2px 3px rgba(0,0,0,.35); }
.seat .out { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; padding: 2px 8px; border-radius: 1px; background: rgba(28,29,31,.08); color: var(--muted); white-space: nowrap; }
.seat[data-outcome=won] .out { background: rgba(44,122,53,.18); color: var(--ok); }
.seat[data-outcome=lost] .out, .seat[data-outcome=error] .out { background: rgba(198,42,31,.16); color: var(--err); }
.seat[data-outcome=won] { border-color: rgba(44,122,53,.45); }
.seat-state { min-height: 18px; margin-top: 6px; font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat-state.thinking::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--seat); margin-right: 7px; animation: pulse 1.3s infinite; }
.seat dl { margin: 6px 0 4px; }
.seat .thoughts { flex: 1 1 auto; height: auto; min-height: 60px; padding: 4px 0 0; }

.board-wrap { grid-area: board; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 0; gap: 6px; }
.col-nums, .board { width: min(100%, calc((var(--tile-h, 560px) - 150px) * 7 / 6)); }
.col-nums { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font: 600 12px var(--mono); color: var(--muted); padding: 0 10px; }
.board { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; padding: 10px; border-radius: var(--radius); background: linear-gradient(180deg, #2d4fd6, #1e3aa8); box-shadow: inset 0 2px 0 rgba(255,255,255,.15), inset 0 -4px 0 rgba(0,0,0,.25), 0 10px 30px rgba(0,0,0,.45); overflow: hidden; }
.cell { aspect-ratio: 1; border-radius: 50%; background: #0c1020; box-shadow: inset 0 3px 6px rgba(0,0,0,.7); position: relative; }
.disc { position: absolute; inset: 0; border-radius: 50%; z-index: 1; }
.disc.s0 { --c: #ef4444; }
.disc.s1 { --c: #facc15; }
.disc { background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c) 55%, #fff), var(--c) 50%, color-mix(in srgb, var(--c) 70%, #000)); box-shadow: inset 0 -3px 5px rgba(0,0,0,.35), inset 0 0 0 4px color-mix(in srgb, var(--c) 80%, #000 20%); }
.disc.last { outline: 2px solid rgba(255,255,255,.85); outline-offset: -2px; }
.disc.drop { animation: drop .3s cubic-bezier(.5, 0, .75, 0) both; }
@keyframes drop { from { transform: translateY(calc(var(--fall) * -112%)); } to { transform: translateY(0); } }
.disc.win { animation: win 1s ease-in-out infinite; outline: 3px solid #fff; outline-offset: -3px; }
@keyframes win { 50% { filter: brightness(1.45); transform: scale(.9); } }
.verdict { min-height: 22px; font-weight: 700; font-size: 14px; color: var(--signal-ink); text-align: center; }

@media (max-width: 1100px) {
  .duel-body { grid-template-columns: 1fr 1fr; grid-template-areas: "board board" "s0 s1"; overflow-y: auto; }
  .tile.duel { height: auto !important; min-height: var(--tile-h, 560px); }
  .col-nums, .board { width: min(100%, 520px); }
  .seat .thoughts { max-height: 180px; }
}
@media (max-width: 640px) {
  .duel-body { grid-template-columns: 1fr; grid-template-areas: "board" "s0" "s1"; }
  .game-pick { grid-template-columns: 1fr; }
}

/* ---------- a Mastermind lane ---------- */
.mm-body { flex: 1 1 auto; min-height: 120px; display: flex; flex-direction: column; gap: 8px; padding: 2px 12px 4px;
  background: radial-gradient(ellipse 80% 70% at 50% 40%, #3a2d20 0%, #1c1611 70%); }
.mm-secret { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: var(--radius); background: rgba(0,0,0,.3); border: 1px dashed var(--line); flex: none; }
.mm-secret > span { font: 11.5px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); width: 54px; }
.mm-secret.hidden .pegs { filter: blur(6px) saturate(.4); opacity: .55; transition: filter .2s, opacity .2s; }
.mm-secret.hidden:hover .pegs { filter: none; opacity: 1; }
.mm-rows { list-style: none; margin: 0; padding: 0 2px; flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: thin; position: relative;
  display: flex; flex-direction: column; gap: 4px; counter-reset: row; }
.mm-rows li { display: flex; align-items: center; gap: 12px; padding: 3px 10px 3px 4px; border-radius: var(--radius); counter-increment: row; flex: none; }
.mm-rows li::before { content: counter(row); font: 11.5px var(--mono); color: var(--muted); width: 50px; text-align: right; }
.mm-rows li.empty { opacity: .45; }
.mm-rows li.win { background: rgba(44,122,53,.12); box-shadow: inset 0 0 0 1px rgba(44,122,53,.4); }
.mm-rows li.drop { animation: mm-in .35s ease-out; }
@keyframes mm-in { from { opacity: 0; transform: translateY(-6px); } }
.mm-body .pegs { display: flex; gap: 6px; }
.peg { --c: #555; width: 22px; height: 22px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c) 55%, #fff) 0%, var(--c) 45%, color-mix(in srgb, var(--c) 70%, #000) 100%);
  box-shadow: 0 1px 2px rgba(0,0,0,.6), inset 0 -1px 2px rgba(0,0,0,.35); }
.peg.hole { background: rgba(0,0,0,.45); box-shadow: inset 0 1px 3px rgba(0,0,0,.8); width: 12px; height: 12px; margin: 4px; }
.keys { display: grid; grid-template-rows: repeat(2, 8px); grid-auto-flow: column; gap: 3px; }
.key { width: 8px; height: 8px; border-radius: 50%; background: rgba(28,29,31,.06); }
.key.b { background: #0b0b0e; box-shadow: 0 0 0 1px rgba(255,255,255,.55); }
.key.w { background: #f8fafc; box-shadow: 0 0 0 1px rgba(0,0,0,.5); }
.mm-status { font-size: 12px; color: var(--text-2); padding: 2px 0 2px; min-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: none; }
.mm-status.thinking::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--lane); margin-right: 7px; animation: pulse 1.3s infinite; }

/* ---------- a Battleship game (inside a duel tile) ---------- */
.tile.duel.bs .duel-body { grid-template-columns: minmax(0, 1fr) minmax(380px, 2fr) minmax(0, 1fr); }
.oceans { display: flex; justify-content: center; gap: 14px; width: 100%; }
.ocean { flex: 0 1 calc(var(--tile-h, 560px) - 190px); }
.ocean { display: flex; flex-direction: column; gap: 5px; min-width: 0; padding: 8px; border-radius: var(--radius); background: rgba(28,29,31,.025); border: 1px solid var(--panel-border); border-top: 3px solid var(--seat); }
.oc-head { display: flex; align-items: center; gap: 7px; font-size: 12px; }
.oc-head .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--seat); }
.oc-head small { margin-left: auto; font: 12px var(--mono); }
.oc-foot { text-align: center; font-size: 11.5px; }
.oc-grid { display: grid; grid-template-columns: 14px repeat(var(--n), 1fr); gap: 2px; padding: 6px; border-radius: var(--radius);
  background: linear-gradient(180deg, #0f2a4a, #0a1d36); box-shadow: inset 0 2px 8px rgba(0,0,0,.5); }
.oc-grid .lbl { font: 10px var(--mono); color: #6f86a8; display: flex; align-items: center; justify-content: center; }
.sq { aspect-ratio: 1; border-radius: 3px; background: rgba(120,170,230,.08); position: relative; }
.sq.ship { background: #6b7686; box-shadow: inset 0 1px 0 rgba(255,255,255,.25), inset 0 -2px 0 rgba(0,0,0,.3); border-radius: 2px; }
.sq.ship.h.head { border-radius: 50% 2px 2px 50%; } .sq.ship.h.tail { border-radius: 2px 50% 50% 2px; }
.sq.ship.v.head { border-radius: 50% 50% 2px 2px; } .sq.ship.v.tail { border-radius: 2px 2px 50% 50%; }
.sq.miss::after { content: ''; position: absolute; inset: 34%; border-radius: 50%; background: rgba(226,236,250,.75); }
.sq.hit { background: #b91c1c; }
.sq.hit::after { content: ''; position: absolute; inset: 22%; border-radius: 50%; background: radial-gradient(circle, var(--signal-ink) 0%, #f97316 55%, transparent 75%); }
.sq.sunk { background: #4a1414; box-shadow: inset 0 0 0 1px #ef4444; }
.sq.sunk::after { inset: 32%; background: #ef4444; }
.sq.last { outline: 2px solid #fff; outline-offset: 1px; z-index: 1; }
.sq.boom { animation: boom .45s ease-out; }
@keyframes boom { 0% { transform: scale(1.7); filter: brightness(2.2); } 100% { transform: none; } }
@media (max-width: 1100px) { .tile.duel.bs .duel-body { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .tile.duel.bs .duel-body { grid-template-columns: 1fr; } .oceans { flex-direction: column; align-items: center; } .ocean { flex: none; width: min(100%, 360px); } }

/* ---------- a Connect6 game (inside a duel tile) ---------- */
.tile.duel.c6 { border-image: linear-gradient(90deg, #475569 50%, #f1f5f9 50%) 1; }
.tile.duel.c6 .duel-body { grid-template-columns: minmax(0, 1fr) minmax(340px, 1.8fr) minmax(0, 1fr); }
.c6-board { width: min(100%, calc(var(--tile-h, 560px) - 110px)); padding: 6px; border-radius: var(--radius);
  background: linear-gradient(160deg, #e2b96f, #c8964a); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), inset 0 -3px 0 rgba(0,0,0,.18), 0 10px 30px rgba(0,0,0,.45); }
.c6-grid { display: grid; grid-template-columns: 12px repeat(var(--n), 1fr) 12px; align-items: center; }
.c6-grid .lbl { font: 600 8.5px var(--mono); color: rgba(60,38,10,.85); text-align: center; line-height: 12px; }
.pt { aspect-ratio: 1; position: relative; display: block; }
.pt::before, .pt::after { content: ''; position: absolute; background: rgba(55,34,8,.78); }
.pt::before { left: 0; right: 0; top: 50%; height: 1px; transform: translateY(-.5px); }
.pt::after { top: 0; bottom: 0; left: 50%; width: 1px; transform: translateX(-.5px); }
.pt.l::before { left: 50%; } .pt.r::before { right: 50%; }
.pt.t::after { top: 50%; } .pt.b::after { bottom: 50%; }
.pt.star { background: radial-gradient(circle, rgba(55,34,8,.9) 0 13%, transparent 15%); }
.stone { position: absolute; inset: 5%; border-radius: 50%; z-index: 1; }
.stone.s0 { background: radial-gradient(circle at 35% 30%, #6b7280 0%, #1f2937 38%, #030712 75%); box-shadow: 0 1px 2px rgba(0,0,0,.55); }
.stone.s1 { background: radial-gradient(circle at 35% 30%, #ffffff 0%, #f1f5f9 45%, #a8b0bd 100%); box-shadow: 0 1px 2px rgba(0,0,0,.45); }
.stone.last::after { content: ''; position: absolute; inset: 33%; border-radius: 50%; background: #ef4444; box-shadow: 0 0 0 1px rgba(255,255,255,.55); }
.stone.place { animation: c6-place .22s ease-out both; }
@keyframes c6-place { from { transform: scale(1.5); opacity: 0; } }
.stone.win { animation: c6-win 1s ease-in-out infinite; box-shadow: 0 0 0 2px var(--signal), 0 0 10px var(--signal); }
@keyframes c6-win { 50% { transform: scale(.82); filter: brightness(1.35); } }
@media (max-width: 1100px) { .tile.duel.c6 .duel-body { grid-template-columns: 1fr 1fr; } .c6-board { width: min(100%, 560px); } }
@media (max-width: 640px) { .tile.duel.c6 .duel-body { grid-template-columns: 1fr; } }

/* ---------- a Liar's Dice game (inside a duel tile) ---------- */
.tile.duel.ld .duel-body { grid-template-columns: minmax(0, 1fr) minmax(320px, 1.4fr) minmax(0, 1fr); }
.ld-table { width: 100%; display: flex; flex-direction: column; gap: 10px; min-height: 0; flex: 1 1 auto; }
.ld-cup { padding: 9px 12px; border-radius: var(--radius); background: radial-gradient(ellipse at 50% 0%, #3a2a1c 0%, #22180f 80%); border: 1px solid rgba(0,0,0,.4); border-left: 3px solid var(--seat); }
.ld-cup.out { opacity: .5; }
.ld-head { display: flex; align-items: center; gap: 7px; font-size: 12px; margin-bottom: 7px; }
.ld-head .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--seat); }
.ld-head small { margin-left: auto; font: 12px var(--mono); }
.ld-dice { display: flex; gap: 8px; flex-wrap: wrap; min-height: 34px; }
.die { width: 32px; height: 32px; border-radius: 7px; background: linear-gradient(145deg, #fdfdfb, #dcdcd4); box-shadow: 0 2px 4px rgba(0,0,0,.5), inset 0 -2px 0 rgba(0,0,0,.15);
  display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 4px; flex: none; }
.die span { width: 6px; height: 6px; border-radius: 50%; background: #1f2430; place-self: center; }
.die.match { box-shadow: 0 0 0 2px var(--signal), 0 0 14px rgba(239,95,23,.55); }
.die.dim { opacity: .38; }
.die.gone { background: transparent; border: 2px dashed rgba(198,42,31,.6); box-shadow: none; }
.die.roll { animation: ld-roll .45s ease-out; }
.die.flip { animation: ld-flip .4s ease-out; }
@keyframes ld-roll { 0% { transform: rotate(-200deg) scale(.4); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes ld-flip { 0% { transform: rotateY(90deg); } 100% { transform: none; } }
.ld-bids .die, .ld-reveal .die { width: 18px; height: 18px; padding: 2px; border-radius: 4px; vertical-align: middle; display: inline-grid; }
.ld-bids .die span { width: 3.5px; height: 3.5px; }
.ld-mid { flex: 1 1 auto; min-height: 90px; display: flex; flex-direction: column; gap: 6px; }
.ld-round { font: 11.5px var(--mono); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); text-align: center; }
.ld-bids { list-style: none; margin: 0; padding: 0 4px; flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: thin; display: flex; flex-direction: column; gap: 3px; }
.ld-bids li { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); padding: 3px 8px; border-radius: 7px; background: rgba(28,29,31,.03); }
.ld-bids li .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--seat); flex: none; }
.ld-bids li b { margin-left: auto; display: flex; align-items: center; gap: 6px; font: 600 13px var(--mono); color: var(--text); }
.ld-bids li.top { background: rgba(28,29,31,.08); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--seat) 60%, transparent); }
.ld-bids li.call b { color: var(--err); letter-spacing: .08em; }
.ld-bids li.empty { justify-content: center; color: var(--muted); background: none; }
.ld-reveal { font-size: 12.5px; text-align: center; color: var(--text); min-height: 0; }
.ld-reveal.on { padding: 6px 10px; border-radius: var(--radius); background: rgba(239,95,23,.08); border: 1px solid rgba(239,95,23,.3); animation: mm-in .3s ease-out; }

/* ---------- a Countdown lane ---------- */
.cd-body { flex: 1 1 auto; min-height: 120px; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 4px 12px;
  background: radial-gradient(ellipse 80% 70% at 50% 30%, #3a2d20 0%, #1a140f 75%); }
.cd-target { font: 700 34px var(--mono); letter-spacing: .08em; color: var(--signal-ink); padding: 2px 16px; border-radius: var(--radius); background: #0a0e1a; box-shadow: inset 0 0 0 1px rgba(253,230,138,.25), 0 0 20px rgba(253,230,138,.08); }
.cd-nums { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.cd-nums span { min-width: 38px; padding: 5px 6px; text-align: center; font: 700 15px var(--mono); border-radius: 6px; background: #2a3a66; color: var(--text); box-shadow: inset 0 -2px 0 rgba(0,0,0,.3); }
.cd-nums span.big { background: #3b4f8a; }
.cd-nums span.used { background: var(--lane); color: var(--ink); }
.cd-attempts { list-style: none; margin: 0; padding: 0; width: 100%; flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: thin; display: flex; flex-direction: column; gap: 4px; counter-reset: att; }
.cd-attempts li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 5px 9px; border-radius: var(--radius); background: rgba(28,29,31,.04); counter-increment: att; font-size: 12px; }
.cd-attempts li::before { content: counter(att); font: 11.5px var(--mono); color: var(--muted); width: 12px; }
.cd-attempts li.empty { color: var(--muted); background: rgba(28,29,31,.02); }
.cd-attempts li code { font: 12.5px var(--mono); color: var(--text); flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.cd-attempts li b { font: 600 13px var(--mono); white-space: nowrap; }
.cd-attempts li b small { font-weight: 400; }
.cd-attempts li.exact { background: rgba(44,122,53,.12); box-shadow: inset 0 0 0 1px rgba(44,122,53,.4); }
.cd-attempts li.exact b { color: var(--ok); }
.cd-attempts li.bad b { color: var(--err); }
.cd-attempts li .why { flex-basis: 100%; padding-left: 22px; color: var(--redpen); }
.cd-attempts li.drop { animation: mm-in .35s ease-out; }
.cd-status { font-size: 12px; color: var(--text-2); min-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; align-self: stretch; }
.cd-status.thinking::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--lane); margin-right: 7px; animation: pulse 1.3s infinite; }

/* ---------- japandi: games ---------- */
.tile.duel { border: 1px solid var(--line); border-image: none; }
.tile.duel header .who b { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.tile.duel header .who b small { color: var(--muted); font-weight: 400; font-size: 13px; }
.tile.duel header .dot { width: 9px; height: 9px; }
.tile.duel .clock { font: 500 14px var(--mono); font-variant-numeric: tabular-nums; color: var(--ink); min-width: 70px; text-align: center; padding: 4px 10px; background: var(--surface-2); border-radius: 6px; }
.duel-body { gap: 16px; padding: 4px 14px 14px; }
.seat { background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px; padding: 12px; transition: border-color .2s, box-shadow .2s, background .2s; }
.seat.to-move { background: var(--surface); border-color: color-mix(in srgb, var(--seat) 55%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--seat) 14%, transparent); }
.seat[data-outcome=won] { border-color: rgba(150,174,139,.45); background: var(--surface); }
.seat-head b { font-weight: 600; font-size: 14px; }
.disc-icon { width: 18px; height: 18px; background: var(--seat); box-shadow: inset 0 -2px 3px rgba(0,0,0,.15), 0 0 0 1px rgba(0,0,0,.12); }
.seat-state { font-size: 12.5px; color: var(--text-2); }
.seat .thoughts { padding: 4px 0 0; }
.verdict { font: 600 16px var(--sans); color: var(--ink); letter-spacing: -.01em; }
.col-nums { color: var(--muted); font-family: var(--mono); font-weight: 400; }

/* Connect Four: a muted indigo board, softer discs */
.board { background: #3f5577; border-radius: 14px; box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 6px 20px rgba(0,0,0,.12); gap: 7px; }
.cell { background: var(--bg); box-shadow: inset 0 2px 4px rgba(0,0,0,.25); }
.disc.s0 { --c: #c4533c; } .disc.s1 { --c: #e2b13c; }
.disc { background: radial-gradient(circle at 38% 32%, color-mix(in srgb, var(--c) 70%, #fff), var(--c) 55%, color-mix(in srgb, var(--c) 85%, #000)); box-shadow: inset 0 -2px 4px rgba(0,0,0,.18); }
.disc.last { outline: 2px solid rgba(255,255,255,.9); }
.disc.win { outline: 3px solid #fff; animation: win 1.4s ease-in-out infinite; }

/* Connect6 */
.c6-board { border-radius: 10px; background: linear-gradient(160deg, #dcc196, #c9a874); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 6px 20px rgba(0,0,0,.14); }
.stone.s0 { background: radial-gradient(circle at 35% 30%, #5b5a57 0%, #2a2926 45%, #151412 80%); }
.stone.s1 { background: radial-gradient(circle at 35% 30%, #ffffff 0%, #f4f1ea 50%, #c9c3b6 100%); }
.stone.last::after { background: var(--clay); }
.stone.win { box-shadow: 0 0 0 2px var(--oak), 0 0 8px rgba(203,168,114,.7); }

/* Mastermind */
.mm-body { background: transparent; padding: 4px 14px; }
.mm-secret { background: var(--bg); border: 1px dashed #46433e; border-radius: var(--r-sm); }
.mm-secret > span { font: 12px var(--sans); text-transform: none; letter-spacing: 0; color: var(--muted); }
.mm-rows li { border-radius: 6px; }
.mm-rows li::before { font: 12px var(--mono); }
.mm-rows li.win { background: rgba(150,174,139,.1); box-shadow: inset 0 0 0 1px rgba(150,174,139,.45); }
.peg { box-shadow: 0 1px 2px rgba(0,0,0,.25), inset 0 -1px 2px rgba(0,0,0,.2); }
.peg.hole { background: var(--sunk); box-shadow: inset 0 1px 2px rgba(0,0,0,.18); }
.key { background: var(--sunk); }
.key.b { background: var(--ink); box-shadow: none; }
.key.w { background: var(--hover); box-shadow: 0 0 0 1px #9a958a; }
.mm-status, .cd-status { font-size: 12.5px; color: var(--text-2); }

/* Countdown */
.cd-body { background: transparent; padding: 6px 14px; }
.cd-target { font: 500 38px/1 var(--mono); letter-spacing: .04em; color: var(--ink); background: var(--surface-2); border: 0; border-radius: 10px; padding: 8px 20px; box-shadow: none; text-shadow: none; }
.cd-nums span { border-radius: 7px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: none; font: 500 15px var(--mono); }
.cd-nums span.big { background: var(--surface-2); }
.cd-nums span.used { background: var(--lane); border-color: var(--lane); color: #fff; }
.cd-attempts li { border-radius: var(--r-sm); background: var(--surface-2); border: 0; }
.cd-attempts li.empty { background: transparent; border: 1px dashed var(--line); }
.cd-attempts li.exact { background: rgba(150,174,139,.1); box-shadow: inset 0 0 0 1px rgba(150,174,139,.45); }
.cd-attempts li .why { color: var(--clay); }

/* Battleship */
.ocean { background: var(--bg); border: 1px solid var(--line-2); border-top: 1px solid var(--line-2); border-radius: 10px; }
.oc-head { font-weight: 600; }
.oc-grid { border-radius: var(--r-sm); background: linear-gradient(180deg, #34506f, #2a425e); }
.sq.ship { background: #8b939b; }
.sq.hit { background: #b2604a; }
.sq.sunk { background: #5e3226; box-shadow: inset 0 0 0 1px #c4533c; }
.sq.sunk::after { background: #d9826b; }

/* Liar's Dice */
.ld-cup { border-radius: 10px; background: linear-gradient(180deg, #6b4f35, #523b27); border: 0; border-left: 3px solid var(--seat); }
.ld-cup .ld-head, .ld-cup .ld-head small { color: #f4efe6; }
.ld-round { font: 500 12px var(--sans); text-transform: none; letter-spacing: 0; }
.ld-bids li { border-radius: 7px; background: var(--surface-2); color: var(--text-2); }
.ld-bids li.top { background: var(--surface); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--seat) 50%, var(--line)); }
.ld-bids li.call b { letter-spacing: 0; }
.ld-reveal.on { border-radius: var(--r-sm); background: rgba(203,168,114,.1); border: 1px solid rgba(203,168,114,.4); color: var(--ink); }
.die.match { box-shadow: 0 0 0 2px var(--oak), 0 0 10px rgba(203,168,114,.5); }
.rank:empty { display: none; }
.seat .out, .badge { text-transform: none; letter-spacing: 0; }
.tile.duel.c6 { border-image: none; }

/* ---------- dark japandi: things that must not invert ---------- */
:root { --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.18); }
.logo { background: #0b0b0a; box-shadow: 0 0 0 1px var(--line); }
.key.b { background: #0b0b0a; box-shadow: 0 0 0 1px #6b665d; }
.tile .dot, .seat-dot, .legend i, .lane .sw, .disc-icon, .m-disc { box-shadow: 0 0 0 1px rgba(235,230,221,.16); }
.scrim { background: rgba(0,0,0,.5); }
.cd-nums span.used { color: #161513; }
.game-card.on { border-color: var(--text-2); box-shadow: inset 0 0 0 1px var(--text-2); background: var(--hover); }
.drawer { box-shadow: 0 0 0 1px var(--line), 0 12px 48px rgba(0,0,0,.5); }
.board { box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 6px 20px rgba(0,0,0,.35); }
.tile .view { margin: 0 10px; }

/* ---------- legibility on dark ---------- */
body { font-size: 14.5px; }
.th { font-size: 13.5px; line-height: 1.6; color: var(--text-2); padding: 8px 11px; }
.th-meta { font-size: 12px; margin-bottom: 3px; }
.thoughts { gap: 7px; }
dt { font-size: 12px; }
.who small, .h-meta, .hint, .field > small, .game-card small { font-size: 12.5px; }
.batch-info { font-size: 13.5px; color: var(--text-2); }
.seat-state, .mm-status, .cd-status { font-size: 13px; }
.overlay { font-size: 12.5px; color: var(--text); }
.chip { font-size: 12px; }
.badge, .seat .out { font-size: 12px; }
.legend { font-size: 13px; }
input::placeholder { color: #827d73; }
