/* PvP: a tournament chess hall by day. The page is the hall's pale plaster, panels are printed score sheets (ivory,
   ruled, numbered lines), the header is the arbiter's printed sheet. The lobby hero is the hall itself: a walnut-panelled
   wall and two rows of tournament tables with analog chess clocks (walnut case, brass bezels, red flags) and paper
   board cards carrying the coins of the next cup (face.js). The cup clock is an ivory clock card set in a walnut case;
   a red flag in its corner shows the state (up: taking entries, level: in play, fallen: final). The standings are the
   printed standings sheet: each entrant a pawn in its colour, the bar a rank of squares filled to its value, the red
   marker the 1 SOL start. Rufina for the name and titles, Anuphan for reading, Sofia Sans Condensed for every figure. */
@font-face { font-family: 'Rufina'; font-weight: 400; src: url(/fonts/rufina-400.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Rufina'; font-weight: 700; src: url(/fonts/rufina-700.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Anuphan'; font-weight: 100 700; src: url(/fonts/anuphan.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Sofia Sans Condensed'; font-weight: 1 1000; src: url(/fonts/sofia-sans-condensed.woff2) format('woff2'); font-display: swap; }

:root {
  --hall: #e9e6df; --sheet: #fbfaf5; --sheet-lo: #f3f0e7; --ink: #19181b; --muted: #67625b; --rule: #dcd7cc; --hair: rgba(25, 24, 27, .14);
  --wal-0: #2e1c12; --wal-1: #43291a; --wal-2: #5a3925; --wal-3: #7b5236; --wal-4: #a57a55;
  --brass: #c4a463; --brass-hi: #efd99b; --brass-lo: #8f7136; --ivory: #f5efe2;
  --flag: #c2362b; --flag-hi: #dd5a45; --flag-lo: #8e2219;
  --sq-1: #efe7d2; --sq-2: #ddd1b3;
  --up: #2f7a4f; --up-hi: #3f9564; --down: #b9382c; --down-hi: #d4513f;
  --show: 'Rufina', Georgia, 'Times New Roman', serif;
  --text: 'Anuphan', 'Helvetica Neue', Arial, sans-serif;
  --fig: 'Sofia Sans Condensed', 'Arial Narrow', 'Helvetica Neue', sans-serif;
  --lift: 0 0 0 1px var(--hair), 0 1px 1px rgba(25, 24, 27, .06), 0 8px 18px -10px rgba(46, 28, 18, .28);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .045 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  /* walnut panelling: long grain stretched along the boards */
  --wood: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='600'%3E%3Cfilter id='w'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.0035 .09' numOctaves='3' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 .16 0 0 0 0 .09 0 0 0 0 .05 0 0 0 .55 -.08'/%3E%3C/filter%3E%3Crect width='900' height='600' filter='url(%23w)'/%3E%3C/svg%3E");
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--ink); font: 400 16px/1.6 var(--text); font-variant-numeric: tabular-nums lining-nums; min-height: 100vh; background: var(--grain), var(--hall); }
a { color: inherit; }
img { max-width: 100%; }
.ico { width: 1em; height: 1em; vertical-align: -0.12em; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.up { color: var(--up); } .down { color: var(--down); }
code { font: 500 0.88em/1 ui-monospace, 'SF Mono', Menlo, monospace; background: var(--sheet-lo); padding: 2px 5px; border-radius: 2px; overflow-wrap: anywhere; box-shadow: inset 0 0 0 1px var(--rule); }
h1, h2, h3 { margin: 0; font-weight: 700; }
[hidden] { display: none !important; }

/* ---------- header: the arbiter's printed sheet, double rule underneath ---------- */
.top { position: sticky; top: 0; z-index: 20; background: var(--sheet); box-shadow: 0 1px 0 var(--ink), 0 3px 0 var(--sheet), 0 4px 0 var(--ink), 0 10px 18px -12px rgba(46, 28, 18, .35); }
.top-in { max-width: 1240px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 22px; }
.logo { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); font: 700 34px/1 var(--show); letter-spacing: -.01em; }
.logo-mark { width: 46px; height: 46px; filter: drop-shadow(0 2px 2px rgba(46, 28, 18, .25)); }
.nav { display: flex; gap: 4px; margin-left: 14px; flex: 1; }
.nav a { color: var(--muted); text-decoration: none; font: 600 15px/1 var(--text); letter-spacing: .01em; padding: 12px 12px 10px; border-radius: 2px; }
.nav a:hover { color: var(--ink); background: var(--sheet-lo); }
.nav a.on { color: var(--ink); box-shadow: inset 0 -3px 0 var(--flag); border-radius: 2px 2px 0 0; }
.x-link { color: var(--ink); display: grid; place-items: center; width: 38px; height: 38px; border-radius: 2px; font-size: 18px; }
.x-link:hover { background: var(--sheet-lo); }
.mode-strip { background: var(--sheet); color: var(--ink); font-size: 13.5px; text-align: center; padding: 8px 16px; border-bottom: 1px solid var(--rule); }
.ca-strip { background: var(--wal-1); color: var(--ivory); display: flex; gap: 12px; align-items: center; justify-content: center; padding: 9px 16px; flex-wrap: wrap; }
.ca-strip b { font: 700 19px/1 var(--show); color: var(--brass-hi); }
.ca-strip span { overflow-wrap: anywhere; font: 600 14px/1.3 ui-monospace, 'SF Mono', Menlo, monospace; }
.ca-strip a, .ca-strip button { color: var(--ivory); }

/* ---------- buttons: pressed like the button of a chess clock. Primary = black piece, ivory text ---------- */
.btn { --bg: var(--sheet); --fg: var(--ink); --edge: #c8c0ae;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; text-decoration: none;
  background: var(--bg); color: var(--fg); font: 600 16px/1.1 var(--text); padding: 14px 24px 12px; border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(25, 24, 27, .16), inset 0 -4px 0 var(--edge), 0 1px 2px rgba(46, 28, 18, .18);
  transition: transform .08s, box-shadow .08s, filter .15s; }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(2px); box-shadow: inset 0 0 0 1px rgba(25, 24, 27, .16), inset 0 -2px 0 var(--edge); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn:focus-visible { outline: 3px solid var(--flag); outline-offset: 2px; }
.btn-chip { --bg: var(--ink); --fg: var(--ivory); --edge: #000; }
.btn-ivory, .btn-paper { --bg: var(--sheet); --fg: var(--ink); --edge: #cfc6b2; }
.btn-ink { --bg: var(--ink); --fg: #fff; --edge: #000; }
.btn-buy { --bg: var(--up); --fg: #fff; --edge: #1d5636; }
.btn-sell { --bg: var(--down); --fg: #fff; --edge: var(--flag-lo); }
.btn-small { padding: 9px 15px 8px; font-size: 14.5px; }
.btn-big { padding: 17px 30px 15px; font-size: 17.5px; }
.btn-wide { width: 100%; }
.btn-wallet { padding: 10px 18px 9px; font-size: 14.5px; white-space: nowrap; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); font-weight: 700; text-decoration: underline; text-decoration-color: var(--flag); text-underline-offset: 3px; cursor: pointer; }
.cta-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }

/* ---------- layout and sheets ---------- */
main { max-width: 1240px; margin: 0 auto; padding: 36px 24px 64px; display: block; }
.placard { background: var(--sheet); border-radius: 2px; padding: 22px 24px; position: relative; box-shadow: var(--lift); }
.placard-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.placard-head h2 { font: 700 26px/1.1 var(--show); color: var(--ink); }
.placard h3 { font: 700 16px/1.3 var(--text); margin: 18px 0 8px; }

/* ---------- hero: the hall. Walnut panelling; face.js draws the tables, clocks and board cards into .chart ---------- */
.hero { position: relative; isolation: isolate; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 56px; align-items: start;
  padding: 60px 72px 340px; border-radius: 3px; overflow: hidden; color: var(--ivory); margin-bottom: 18px;
  background: repeating-linear-gradient(90deg, transparent 0 238px, rgba(20, 11, 6, .5) 238px 240px, rgba(255, 220, 180, .07) 240px 242px), var(--wood), linear-gradient(180deg, #4d3020, #5d3c27 60%, #4a2e1e);
  box-shadow: 0 0 0 1px rgba(46, 28, 18, .4), 0 22px 40px -20px rgba(46, 28, 18, .6); }
.hero > :not(.chart) { position: relative; z-index: 2; }
.hero h1 { text-wrap: balance; font: 700 clamp(42px, 4.7vw, 68px)/1.02 var(--show); letter-spacing: -.012em; }
.hero h1 span { display: inline-block; margin-top: 16px; color: var(--brass-hi); font: 400 clamp(24px, 2.5vw, 34px)/1.15 var(--show); letter-spacing: 0; }
.lede { font-size: 17.5px; line-height: 1.62; max-width: 33em; margin: 22px 0 30px; }
.hero .lede { color: #eadfcb; }
.hero .btn-chip { --bg: var(--ivory); --fg: var(--ink); --edge: #b9ab8e; }
.hero .btn-ivory { --bg: transparent; --fg: var(--ivory); --edge: transparent; box-shadow: inset 0 0 0 1.5px rgba(245, 239, 226, .6); }
.chart { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.chart svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.chart .card-label { font: 700 15px/1 var(--fig); fill: var(--ink); letter-spacing: .03em; }

/* ---------- the clock: an ivory clock card in a walnut case; the corner flag shows the state ---------- */
.hero-clock { position: relative; filter: drop-shadow(0 18px 20px rgba(20, 10, 4, .45)) drop-shadow(0 2px 2px rgba(20, 10, 4, .35)); }
.clock { --flag-rot: -58deg; position: relative; color: var(--ink); padding: 26px 34px 30px; border-radius: 5px; background: var(--sheet);
  box-shadow: inset 0 0 0 10px var(--wal-2), inset 0 0 0 11px var(--wal-0), inset 0 0 0 12.5px var(--brass), inset 0 -16px 0 0 var(--wal-2); }
.clock::before { content: ''; position: absolute; top: 24px; right: 30px; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); z-index: 2; }
.clock::after { content: ''; position: absolute; top: 15px; right: 24px; width: 19px; height: 25px; background: var(--flag);
  clip-path: polygon(50% 100%, 0 0, 100% 18%); transform-origin: 50% 88%; transform: rotate(var(--flag-rot)); transition: transform .6s cubic-bezier(.3, 1.4, .5, 1); }
.clock[data-state='registering'] { --flag-rot: -24deg; }
.clock[data-state='running'] { --flag-rot: 62deg; }
.clock[data-state='counting'], .clock[data-state='settled'], .clock[data-state='cancelled'] { --flag-rot: 160deg; }
.clock-screen { position: relative; }
.clock-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font: 700 21px/1.15 var(--show); padding-right: 34px; }
.clock-name { min-width: 0; }
.clock-state { font: 600 13.5px/1.2 var(--text); color: var(--muted); white-space: nowrap; }
.clock-time { display: flex; flex-direction: column; margin: 6px 0 12px; padding: 2px 0 10px; border-bottom: 1px solid var(--ink); box-shadow: 0 3px 0 var(--sheet), 0 4px 0 var(--ink); }
.clock-label { font: 500 14px/1.2 var(--text); color: var(--muted); }
.clock-digits { font: 800 clamp(70px, 7.6vw, 112px)/.95 var(--fig); letter-spacing: -.01em; color: var(--ink); }
.clock-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 6px 10px; margin: 8px 0 0; padding: 0 0 10px; }
.clock-grid div { display: flex; flex-direction: column; }
.clock-grid dt { color: var(--muted); font-size: 13px; font-weight: 500; }
.clock-grid dd { margin: 0; font: 700 26px/1.15 var(--fig); }
.clock-pay { display: flex; gap: 18px; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--rule); font-size: 14.5px; color: var(--muted); }
.clock-pay b { font-weight: 700; color: var(--ink); }

/* ---------- lobby: each cup is a score sheet: double rule on top, numbered ruled lines ---------- */
.band { margin-top: 50px; }
.band-title { font: 700 34px/1.1 var(--show); color: var(--ink); margin: 0 0 18px; letter-spacing: -.01em; }
.band-empty { color: var(--muted); }
.placards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 22px; }
.tplacard { display: flex; flex-direction: column; gap: 10px; padding: 22px 22px 22px; border-top: 6px double var(--ink); }
.tp-name { text-decoration: none; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.tp-name h3 { font: 700 30px/1.05 var(--show); color: var(--ink); margin: 0; }
.tp-time { font: 700 16px/1.1 var(--fig); color: var(--muted); letter-spacing: .02em; }
.tp-clock { margin: 2px 0 0; font-size: 14.5px; color: var(--muted); }
.tp-clock b { font: 800 34px/1 var(--fig); margin-left: 4px; color: var(--ink); }
.tp-kv { counter-reset: move; display: grid; grid-template-columns: 22px auto 1fr; gap: 0 10px; margin: 4px 0 6px; font-size: 14.5px; line-height: 30px; border-top: 1px solid var(--ink); }
.tp-kv dt { color: var(--muted); grid-column: 2; border-bottom: 1px solid var(--rule); }
.tp-kv dt::before { counter-increment: move; content: counter(move); position: absolute; margin-left: -32px; width: 22px; text-align: right; font: 600 12.5px/30px var(--fig); color: #a59d8d; }
.tp-kv dd { margin: 0; font: 700 18px/30px var(--fig); text-align: right; border-bottom: 1px solid var(--rule); }
.tp-kv dt { position: relative; }
.tp-kv { padding-left: 0; }
.tp-kv::before { content: ''; grid-column: 1; grid-row: 1 / span 6; border-right: 1px solid var(--rule); }
.tp-cta { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.tp-more { font-size: 14px; color: var(--ink); text-align: center; font-weight: 600; text-decoration-color: var(--flag); text-underline-offset: 3px; }
.runcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 22px; }
.runcard { text-decoration: none; display: block; border-top: 6px double var(--ink); }
.rc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.rc-head h3 { font: 700 25px/1.1 var(--show); margin: 0; }
.rc-clock b { font: 800 28px/1 var(--fig); color: var(--ink); }
.results { display: flex; flex-direction: column; gap: 0; padding: 8px 24px; }
.result-row { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--rule); text-decoration: none; flex-wrap: wrap; }
.result-row:last-child { border-bottom: 0; }
.result-row > b { font: 700 20px/1.1 var(--show); }
.rr-win { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.rr-win .row-chip { width: 16px; height: 20px; margin: 0; }

/* ---------- standings: the printed standings sheet ---------- */
.board.placard { padding: 18px 20px 20px; }
.board .placard-head { border-bottom: 1px solid var(--ink); box-shadow: 0 3px 0 var(--sheet), 0 4px 0 var(--ink); padding-bottom: 10px; margin-bottom: 8px; }
.board .placard-head .muted { font: 500 14px/1.2 var(--text); }
.board-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.row { display: grid; grid-template-columns: 42px 22px minmax(96px, 150px) minmax(0, 1fr) 112px 104px; gap: 12px; align-items: center; padding: 10px 6px; color: var(--ink); will-change: transform;
  border-bottom: 1px solid var(--rule); background: var(--sheet); }
.row:nth-child(even) { background: #f7f4ec; }
.row:last-child { border-bottom: 0; }
.runcard .row, .results .row { background: transparent; padding-left: 0; padding-right: 0; }
.row.mine { background: linear-gradient(90deg, rgba(196, 164, 99, .26), rgba(196, 164, 99, .06)); box-shadow: inset 4px 0 0 var(--brass); }
.row.dq { opacity: .5; }
.row-place { font: 700 30px/1 var(--show); text-align: center; color: var(--ink); }
.runcard .row-place, .results .row-place { font-size: 24px; }
/* each entrant is a pawn in its colour */
.row-chip { width: 20px; height: 25px; display: inline-block; background: linear-gradient(100deg, var(--hi) 0 38%, var(--c) 62%);
  -webkit-mask: var(--pawn) center / contain no-repeat; mask: var(--pawn) center / contain no-repeat; filter: drop-shadow(0 1px 0 rgba(25, 24, 27, .35)); }
:root { --pawn: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 25'%3E%3Ccircle cx='10' cy='5' r='4.2'/%3E%3Cpath d='M6.6 9.2h6.8l-.9 1.6c1.2 2.6 1.9 5.5 2.6 8.4H4.9c.7-2.9 1.4-5.8 2.6-8.4z'/%3E%3Crect x='2.2' y='19.6' width='15.6' height='4.6' rx='1.6'/%3E%3C/svg%3E"); }
.seat-card { display: inline-block; padding: 4px 12px 2px; border-radius: 2px; font: 700 17px/1.3 var(--fig); letter-spacing: .05em; color: var(--spot); background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18), inset 0 -3px 0 rgba(0, 0, 0, .18); }
.row-who { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.row-who b { font: 700 19px/1.1 var(--fig); letter-spacing: .04em; }
.row-who em { font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--brass-lo); }
.row-wallet { font-size: 12px; color: var(--muted); }
/* a rank of squares; the entrant's value fills it from the left; the red flag marks the 1 SOL start */
.row-bar { position: relative; height: 22px; border-radius: 1px; background: repeating-linear-gradient(90deg, var(--sq-1) 0 22px, var(--sq-2) 22px 44px); box-shadow: inset 0 0 0 1px rgba(46, 28, 18, .16); }
.stack { position: absolute; left: 0; top: 4px; height: 14px; width: calc(var(--w) * 100%); min-width: 10px; background: linear-gradient(180deg, var(--hi) 0 40%, var(--c) 40%); border-radius: 0 2px 2px 0;
  box-shadow: 0 1px 1px rgba(25, 24, 27, .35); transition: width .7s cubic-bezier(.2, .8, .2, 1); }
.start-line { position: absolute; top: -4px; bottom: -4px; left: calc(var(--start) * 100%); width: 2px; margin-left: -1px; background: var(--flag); }
.start-line::after { content: ''; position: absolute; left: 2px; top: 0; width: 8px; height: 7px; background: var(--flag); clip-path: polygon(0 0, 100% 50%, 0 100%); }
.row-val { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.05; }
.row-val b { font: 700 23px/1.1 var(--fig); }
.row-pnl { font: 700 17px/1.2 var(--fig); }
.row-meta { font: 500 13px/1.2 var(--text); color: var(--muted); text-align: right; }
.row-empty { padding: 18px; color: var(--muted); text-align: center; font: 500 15px/1.4 var(--text); }
.board-rows.mini .row { grid-template-columns: 30px 18px minmax(70px, 110px) minmax(0, 1fr) 84px; padding: 7px 0; }
.board-rows.mini .row-meta { display: none; }
.board-rows.mini .row-chip { width: 16px; height: 20px; }
/* entrant colours (the engine's chip names map to them): --c the colour, --hi its lit side */
.chip-claret { --c: #8e2a2a; --hi: #c24d45; --spot: #fff; } .chip-teal { --c: #1f6a62; --hi: #3b9286; --spot: #fff; }
.chip-mustard { --c: #c58d1e; --hi: #e8bb55; --spot: #19181b; } .chip-onyx { --c: #19181b; --hi: #4a4648; --spot: #fff; }
.chip-ivory { --c: #d9cfb8; --hi: #f6f0e0; --spot: #19181b; } .chip-slate { --c: #4b5a6f; --hi: #7a8aa0; --spot: #fff; }
.chip-orange { --c: #c9622a; --hi: #ea8d52; --spot: #19181b; } .chip-plum { --c: #5d3557; --hi: #8a5c82; --spot: #fff; }

/* ---------- cup page ---------- */
.tpage-head { margin-bottom: 18px; }
.back { color: var(--ink); font-weight: 600; text-decoration: none; font-size: 15px; }
.back::before { content: '‹ '; color: var(--flag); }
.tpage-title { font: 700 clamp(38px, 4.4vw, 58px)/1.02 var(--show); color: var(--ink); margin: 8px 0 8px; letter-spacing: -.01em; }
.tpage-title span { color: var(--wal-3); }
.tgrid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 22px; margin-top: 24px; align-items: start; }
.tmain, .tside { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.tpage .clock { box-shadow: inset 0 0 0 8px var(--wal-2), inset 0 0 0 9px var(--wal-0), inset 0 0 0 10.5px var(--brass), inset 0 -12px 0 0 var(--wal-2); padding: 22px 28px 24px; }
.seat-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.seat-sum div { display: flex; flex-direction: column; background: var(--sheet-lo); border-radius: 2px; padding: 8px 10px; box-shadow: inset 0 0 0 1px var(--rule); }
.seat-sum span { font-size: 12.5px; color: var(--muted); }
.seat-sum b { font: 700 21px/1.3 var(--fig); }
.warn { color: var(--down); font-weight: 700; }
.result { font: 700 25px/1.25 var(--show); color: var(--ink); }
.trade { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; padding: 14px; border-radius: 2px; background: var(--sheet-lo); box-shadow: inset 0 0 0 1px var(--rule); }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: #e4dfd3; border-radius: 3px; padding: 4px; gap: 4px; }
.seg button { border: 0; background: none; padding: 10px 9px 9px; border-radius: 2px; font: 600 15px/1 var(--text); cursor: pointer; color: var(--ink); }
.seg button.on { background: var(--ink); color: var(--ivory); box-shadow: inset 0 -2px 0 #000; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 13.5px; color: var(--muted); font-weight: 600; }
select, .amt { font: 600 17px/1.2 var(--fig); color: var(--ink); background: #fff; border: 1.5px solid #cbc3b1; border-radius: 3px; padding: 11px 12px 10px; width: 100%; min-width: 0; }
select { font-family: var(--text); font-size: 16px; }
select:focus, .amt:focus { outline: 2px solid var(--brass); outline-offset: 1px; border-color: var(--ink); }
.presets { display: flex; gap: 8px; flex-wrap: wrap; }
.est { min-height: 1.4em; margin: 0; }
.bags, .fills, .payouts, .checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.bags li { display: grid; grid-template-columns: 22px auto 1fr auto; gap: 8px; align-items: center; font-size: 15px; }
.bags img, .coin-name img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.coin-dot { width: 22px; height: 22px; border-radius: 50%; background: var(--rule); display: inline-block; }
.fills li { display: flex; flex-direction: column; font-size: 14px; padding: 6px 0; border-bottom: 1px solid var(--rule); }
.payouts li { font-size: 14px; padding: 4px 0; overflow-wrap: anywhere; }
.checks li { font-weight: 700; }
.checks .ok { color: var(--up); }
.checks .bad { color: var(--down); }
.coin-table { display: flex; flex-direction: column; margin-top: 8px; }
.coin-row { display: grid; grid-template-columns: minmax(0, 2fr) 1fr 1fr 1fr; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--rule); font-size: 14.5px; }
.coin-row > span { text-align: right; font: 700 16.5px/1.2 var(--fig); }
.coin-headrow { font-size: 12.5px; color: var(--muted); font-weight: 600; border-bottom-color: var(--ink); }
.coin-headrow > span { font: 600 12.5px/1.2 var(--text); }
.coin-name { display: flex; gap: 8px; align-items: center; text-decoration: none; min-width: 0; }
.coin-name b { font-weight: 700; }
.coin-name .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }

/* ---------- text pages: printed regulations ---------- */
.prose { max-width: 780px; margin: 0 auto; border-top: 6px double var(--ink); }
.prose.wide { max-width: 980px; }
.prose h1 { font: 700 clamp(38px, 4.4vw, 56px)/1.05 var(--show); color: var(--ink); margin-bottom: 12px; letter-spacing: -.01em; }
.prose h2 { font: 700 25px/1.2 var(--show); color: var(--ink); margin: 28px 0 6px; padding-bottom: 4px; border-bottom: 1px solid var(--rule); }
.prose p { margin: 10px 0; }
.prose .lede { font-size: 17.5px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 12px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 700; }
.kv-row { grid-template-columns: repeat(4, auto 1fr); }
.verify-out { margin-top: 18px; }

/* ---------- footer: walnut panel; dialogs, toast ---------- */
.foot { position: relative; background: var(--wood), var(--wal-0); color: #d9ccb4; margin-top: 26px; box-shadow: inset 0 3px 0 var(--wal-3), inset 0 4px 0 var(--brass-lo); }
.foot-in { max-width: 1240px; margin: 0 auto; padding: 30px 24px 34px; font-size: 14px; }
.foot-links { display: flex; gap: 18px; flex-wrap: wrap; }
.foot-links a { color: var(--ivory); }
.dlg { border: 0; padding: 0; border-radius: 3px; width: min(460px, calc(100vw - 32px)); background: var(--sheet); color: var(--ink); box-shadow: 0 30px 80px rgba(30, 16, 8, .45); overflow: hidden; }
.dlg::backdrop { background: rgba(30, 18, 10, .5); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px 12px; background: var(--wood), var(--wal-2); color: var(--ivory); box-shadow: inset 0 -2px 0 var(--brass); }
.dlg-head h2 { font: 700 24px/1.2 var(--show); }
.dlg-x { background: none; border: 0; color: inherit; font-size: 20px; cursor: pointer; padding: 4px; }
.dlg-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 10px; }
.dlg-body p { margin: 0; }
.wallets { display: flex; flex-direction: column; gap: 8px; }
.wallets button { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 3px; border: 1.5px solid #cbc3b1; background: #fff; font: 600 15.5px/1 var(--text); cursor: pointer; color: var(--ink); }
.wallets button:hover { border-color: var(--ink); }
.wallets img { width: 28px; height: 28px; border-radius: 6px; }
.addr { overflow-wrap: anywhere; font: 500 14.5px/1.3 ui-monospace, 'SF Mono', Menlo, monospace; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px 10px; border-radius: 3px; z-index: 60; max-width: calc(100vw - 32px); box-shadow: 0 10px 30px rgba(30, 16, 8, .35); border-left: 5px solid var(--flag); }

@media (prefers-reduced-motion: reduce) { .stack, .clock::after { transition: none; } }

/* ---------- narrow screens ---------- */
@media (max-width: 1000px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 36px; padding: 56px 56px 330px; }
  .hero-clock { max-width: 540px; width: 100%; }
  .tgrid { display: flex; flex-direction: column; }
  .tmain, .tside { display: contents; }
  .tgrid .board { order: 1; } .tgrid .seat { order: 2; } .tgrid .coins { order: 3; } .tgrid .record { order: 4; }
}
@media (max-width: 720px) {
  .top-in { padding: 8px 16px; gap: 10px; flex-wrap: wrap; }
  .logo { font-size: 29px; gap: 8px; } .logo-mark { width: 40px; height: 40px; }
  .nav { order: 3; flex-basis: 100%; margin: 0; overflow-x: auto; }
  .nav a { padding: 8px 10px 7px; font-size: 14.5px; }
  .x-link { margin-left: auto; width: 32px; }
  .btn-wallet { padding: 8px 13px 7px; font-size: 13.5px; }
  main { padding: 20px 10px 48px; }
  .hero { padding: 40px 20px 290px; gap: 28px; }
  .hero h1 { font-size: 40px; }
  .hero h1 span { font-size: 24px; }
  .lede { font-size: 16px; }
  .placard { padding: 18px 16px; }
  .clock, .tpage .clock { padding: 20px 22px 24px; box-shadow: inset 0 0 0 7px var(--wal-2), inset 0 0 0 8px var(--wal-0), inset 0 0 0 9.5px var(--brass), inset 0 -11px 0 0 var(--wal-2); }
  .clock::before { top: 19px; right: 23px; } .clock::after { top: 10px; right: 17px; }
  .clock-digits { font-size: 72px; }
  .clock-top { font-size: 18px; flex-wrap: wrap; }
  .runcards { grid-template-columns: minmax(0, 1fr); }
  .board.placard { padding: 14px 12px; }
  .row { grid-template-columns: 32px 20px minmax(0, 1fr) 88px; grid-template-areas: 'p c w v' 'b b b b'; gap: 6px 8px; padding: 9px 4px 11px; }
  .row-place { grid-area: p; font-size: 26px; } .row-chip { grid-area: c; } .row-who { grid-area: w; flex-direction: row; gap: 6px; align-items: baseline; flex-wrap: wrap; }
  .row-val { grid-area: v; } .row-bar { grid-area: b; height: 20px; } .row-meta { display: none; }
  .board-rows.mini .row { grid-template-columns: 26px 18px minmax(0, 1fr) 76px; }
  .coin-row { grid-template-columns: minmax(0, 1.6fr) 1fr 1fr; } .coin-row > :nth-child(3) { display: none; }
  .kv-row { grid-template-columns: auto 1fr; }
  .clock-grid dd { font-size: 23px; }
  .seat-sum b { font-size: 19px; }
  .band-title { font-size: 30px; }
}
