/* SWARDBOW app.css: layouts for the DOM pages /round, /outlaw, /ledger, /docs and 404 (no 3D here). Needs base.css first.
   Tournament-poster feel: big blackletter titles on a chalk poster, scoreboard tables, wooden-sign buttons, chalk cards.
   The 3D pages (/, /play) do not load it; they may borrow single classes by importing it, read-only. */

.page { padding-top: 36px; }
.poster {
  position: relative; display: grid; gap: 12px; margin-bottom: 28px; padding: 26px 28px 24px;
  background: var(--chalk); border: 2px solid var(--wood); border-radius: 18px; box-shadow: var(--shadow), inset 0 0 0 6px var(--chalk), inset 0 0 0 7px var(--line);
}
.poster::before, .poster::after {
  content: ''; position: absolute; top: 12px; width: 12px; height: 12px; border-radius: 50%; background: var(--wood); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35);
}
.poster::before { left: 14px; } .poster::after { right: 14px; }
.poster h1 { max-width: 18ch; }
.poster .lead { margin: 0; }
.poster-row { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; }
.poster-row .meta { font-size: 15px; color: var(--muted); }
.hl { background: linear-gradient(transparent 58%, var(--gold) 58%, var(--gold) 90%, transparent 90%); padding: 0 .06em; }
.hl-red { background: linear-gradient(transparent 60%, var(--bounty-wash) 60%, var(--bounty-wash) 92%, transparent 92%); padding: 0 .06em; }
.hl-green { background: linear-gradient(transparent 58%, var(--meadow) 58%, var(--meadow) 90%, transparent 90%); padding: 0 .06em; }
.section { margin-top: 44px; }
.section-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 14px; }
.section-h h2 { font-size: clamp(26px, 3vw, 34px); }
.section-h .meta { font-size: 15px; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.stack { display: grid; gap: 12px; }
.grid-2 > *, .grid-3 > *, .grid-main > *, .stack > * { min-width: 0; }
.live-pill { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; color: var(--muted); }
.addr-line { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; font-size: 16px; }
.addr-line .num { overflow-wrap: anywhere; }
.hash { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; word-break: break-all; }
.sm-only { display: none; }
.big-num { font: 400 clamp(34px, 5vw, 56px)/1 var(--display); }
.pot-line { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.pot-line .big-num { color: var(--ink); }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; }

/* round steps (commit → play → settle → claim) */
.round-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0; padding: 0; list-style: none; }
.round-steps li { padding: 10px 12px; border-radius: 10px; background: var(--chalk-2); border: 1px solid var(--line); font-size: 14px; min-width: 0; }
.round-steps li b { display: block; font-size: 15px; }
.round-steps li.done { background: var(--ok-wash); border-color: #A9D9BC; }
.round-steps li.now { background: var(--gold-wash); border-color: var(--gold); }
.round-steps li.skip { opacity: .55; }

/* standing / scoreboard */
.score .tbl td.nm-cell { min-width: 150px; }
.score .tbl .amt { font-weight: 700; }
.score .tbl tr.is-bot .nm { color: var(--muted); }

/* proofs */
.proofs details { border-top: 1px solid var(--line); }
.proofs summary { cursor: pointer; padding: 12px 0; list-style: none; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 44px; }
.proofs summary::-webkit-details-marker { display: none; }
.proofs summary .amt { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.proofs .proof { padding: 0 0 14px; display: grid; gap: 6px; }
.proofs .proof code { display: block; font-size: 12.5px; word-break: break-all; padding: 4px 8px; }

/* verify */
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.checks li {
  display: grid; grid-template-columns: 30px 1fr; gap: 4px 12px; align-items: start; padding: 12px 14px; border-radius: 12px;
  background: var(--chalk); border: 1px solid var(--line-2);
}
.checks .ic { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--chalk-2); }
.checks .ic svg { width: 16px; height: 16px; }
.checks li.ok { border-color: #A9D9BC; background: linear-gradient(90deg, var(--ok-wash), var(--chalk) 60%); }
.checks li.ok .ic { background: var(--ok); color: #fff; }
.checks li.bad { border-color: #F0B9C0; background: linear-gradient(90deg, var(--bounty-wash), var(--chalk) 60%); }
.checks li.bad .ic { background: var(--bad); color: #fff; }
.checks li.skip .ic { background: var(--chalk-2); color: var(--muted); }
.checks .nm { font-weight: 700; }
.checks .dt { grid-column: 2; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; word-break: break-word; }
.checks .dt code { font-size: 12.5px; word-break: break-all; }
.verdict { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-radius: 14px; font-size: 18px; }
.verdict.ok { background: var(--ok-wash); border: 1.5px solid #A9D9BC; }
.verdict.bad { background: var(--bounty-wash); border: 1.5px solid #F0B9C0; }
.verdict.wait { background: var(--gold-wash); border: 1.5px solid var(--gold); }
.verdict b { font: 400 26px/1 var(--display); }
pre.code {
  margin: 0; padding: 14px 16px; border-radius: 12px; background: var(--chalk-2); border: 1px solid var(--line); overflow: auto; max-height: 460px;
  font: 500 13.5px/1.55 var(--body); font-variant-numeric: tabular-nums; color: var(--ink); white-space: pre;
}

/* replay player (2D canvas) */
.replay { display: grid; gap: 10px; }
.replay-stage { position: relative; border-radius: 12px; overflow: hidden; border: 2px solid var(--wood); background: var(--meadow); box-shadow: var(--shadow); }
.replay-stage canvas { width: 100%; height: auto; aspect-ratio: 44 / 32; display: block; touch-action: none; }
.replay-hud { position: absolute; left: 10px; top: 10px; display: flex; gap: 6px; flex-wrap: wrap; pointer-events: none; }
.replay-hud .pill { padding: 4px 9px; border-radius: 8px; background: rgba(251, 248, 238, .92); border: 1px solid var(--line-2); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.replay-ctl { display: grid; grid-template-columns: auto auto 1fr auto; gap: 10px; align-items: center; }
.replay-ctl input[type="range"] { width: 100%; accent-color: var(--wood); min-width: 0; }
.replay-ctl .t { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 7ch; text-align: right; }
.replay-board { display: flex; flex-wrap: wrap; gap: 6px; }
.replay-board .pl { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 8px; background: var(--chalk); border: 1px solid var(--line-2); font-size: 14px; }
.replay-board .pl .sw { width: 12px; height: 12px; border-radius: 3px; flex: none; border: 1px solid rgba(30, 42, 22, .4); }
.replay-board .pl.out { opacity: .55; text-decoration: line-through; }
.replay-board .pl.lead { box-shadow: 0 0 0 2px var(--bounty); }
.replay-log { max-height: 280px; overflow: auto; }

/* outlaw */
.paste-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; max-width: 620px; }
.claim-list { display: grid; gap: 8px; }
.claim-row { display: grid; grid-template-columns: auto 1fr auto auto; gap: 10px 14px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--chalk); border: 1.5px solid var(--line-2); }
.claim-row .rn { font: 400 24px/1 var(--display); min-width: 3ch; }
.claim-row .amt { font-weight: 700; font-variant-numeric: tabular-nums; }
.claim-row .st { font-size: 14px; color: var(--muted); }

/* ledger */
.buckets { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; align-items: stretch; }
.flow .fl { padding: 12px 14px; border-radius: 12px; background: var(--chalk); border: 1.5px solid var(--line-2); position: relative; }
.flow .fl b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.flow .fl .label { display: block; margin-bottom: 4px; }
.flow .fl:not(:last-child)::after { content: '→'; position: absolute; right: -14px; top: 50%; transform: translateY(-50%); z-index: 1; width: 20px; height: 20px; border-radius: 50%; background: var(--gold); display: grid; place-items: center; font-size: 12px; font-weight: 700; }

/* docs */
.doc { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 48px; align-items: start; }
.doc-toc { position: sticky; top: calc(var(--nav-h) + var(--banner-h) + 20px); display: grid; gap: 2px; font-size: 15.5px; }
.doc-toc a { display: block; padding: 6px 10px; border-radius: 8px; text-decoration: none; color: var(--muted); }
.doc-toc a:hover { background: var(--chalk); color: var(--ink); }
.doc-toc a.on { color: var(--ink); background: var(--chalk); box-shadow: inset 3px 0 0 var(--gold), 0 0 0 1px var(--line-2); }
.prose { max-width: 74ch; min-width: 0; }
.prose h2 { font-size: clamp(28px, 3.4vw, 36px); margin: 60px 0 14px; display: flex; align-items: baseline; gap: 12px; }
.prose h2:first-child { margin-top: 0; }
.prose h2 .n { font: 400 19px/1 var(--display); color: var(--chalk); background: var(--wood); border-radius: 8px; min-width: 34px; height: 34px; display: inline-grid; place-items: center; flex: none; transform: translateY(-4px); }
.prose h3 { margin: 28px 0 8px; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin: 4px 0; }
.prose .tbl-scroll { margin: 12px 0 18px; }
.steps { list-style: none; counter-reset: s; padding: 0 !important; display: grid; gap: 10px; }
.steps li { counter-increment: s; position: relative; padding: 12px 14px 12px 52px; border-radius: 12px; background: var(--chalk); border: 1.5px solid var(--line-2); margin: 0 !important; }
.steps li::before { content: counter(s); position: absolute; left: 14px; top: 12px; width: 26px; height: 26px; border-radius: 50%; background: var(--gold); display: grid; place-items: center; font: 400 15px/1 var(--display); }
.steps li > b:first-child { display: block; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 14px 0; font-weight: 700; font-size: 18px; list-style: none; display: flex; justify-content: space-between; gap: 12px; min-height: 44px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font: 400 24px/1 var(--display); color: var(--muted); }
.faq details[open] summary::after { content: '–'; }
.faq details > div { padding: 0 0 16px; }
.formula { padding: 14px 16px; border-radius: 12px; background: var(--chalk-2); border: 1px solid var(--line-2); font: 500 14px/1.6 var(--body); font-variant-numeric: tabular-nums; overflow-x: auto; white-space: pre; }
.checker { display: grid; gap: 10px; padding: 16px; border-radius: 14px; background: var(--chalk); border: 1.5px solid var(--line-2); box-shadow: var(--shadow-sm); }
.checker .row .input { flex: 1; min-width: 220px; }
.rule-list li { margin: 6px 0; }

/* 404 */
.nf { min-height: calc(100vh - var(--nav-h) - 260px); display: grid; align-content: center; padding-top: 56px; padding-bottom: 56px; }
.nf .poster { max-width: 680px; }
.nf .mark { width: 64px; height: 64px; transform: rotate(-8deg); }

@media (max-width: 960px) {
  .doc { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .doc-toc { position: static; display: flex; flex-wrap: wrap; gap: 6px; }
  .doc-toc a { background: var(--chalk); border: 1px solid var(--line-2); padding: 8px 12px; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-main { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .page { padding-top: 24px; }
  .poster { padding: 22px 18px 20px; }
  .round-steps { grid-template-columns: 1fr 1fr; }
  .flow { grid-template-columns: 1fr; }
  .flow .fl:not(:last-child)::after { content: '↓'; right: auto; left: 50%; top: auto; bottom: -14px; transform: translateX(-50%); }
  .paste-form { grid-template-columns: 1fr; }
  .checks .dt code { font-size: 11.5px; }
  pre.code, .formula { white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; overflow-x: hidden; }
  .claim-row { grid-template-columns: auto 1fr; }
  .claim-row .btn { grid-column: 1 / -1; }
  .replay-ctl { grid-template-columns: auto auto 1fr; }
  .replay-ctl .t { grid-column: 1 / -1; text-align: left; }
}
@media (max-width: 600px) {
  .verdict { flex-direction: column; align-items: flex-start; gap: 6px; font-size: 16px; padding: 14px 16px; }
  .verdict b { font-size: 22px; }
  pre.code { font-size: 12px; }
  .formula { font-size: 12.5px; }
  .tbl-stack .sm-only { display: inline; }
  .poster h1 { font-size: clamp(36px, 11vw, 48px); }
}
