/* RAT RACE v5: a 1970s board game on a baize games table. The page is the green cloth; every section is a
   printed cream component laid on it (the lid, the board, the bank tray, the pension book, the rules booklet).
   Cheddar for the cheese and the CTA, teal for the track, red for tickets, green only where money was paid.
   Bowlby One (the chunky lid lettering) for display, Karla for body, Space Mono for figures. */

:root {
  --card: #EFE6D2;
  --card-2: #F6EFDF;
  --card-3: #E6DBC2;
  --ink: #1E1912;
  --ink-70: rgba(30, 25, 18, 0.72);
  --ink-50: rgba(30, 25, 18, 0.5);
  --ink-25: rgba(30, 25, 18, 0.25);
  --ink-12: rgba(30, 25, 18, 0.12);
  --ink-06: rgba(30, 25, 18, 0.06);
  --cheddar: #E39B1E;
  --cheddar-soft: rgba(227, 155, 30, 0.18);
  --teal: #1F6F78;
  --teal-soft: rgba(31, 111, 120, 0.12);
  --red: #C8372D;
  --red-soft: rgba(200, 55, 45, 0.12);
  --green: #2E5E3E;
  --green-soft: rgba(46, 94, 62, 0.12);
  --pencil: #7B7468;
  --baize: #1F4A39;
  --baize-2: #17392C;
  --cream: #F2E8D3;
  --cream-70: rgba(242, 232, 211, 0.74);
  --cream-50: rgba(242, 232, 211, 0.5);
  --display: "Bowlby One", "Cooper Black", "Arial Black", sans-serif;
  --body: "Karla", "Helvetica Neue", Arial, sans-serif;
  --mono: "Space Mono", ui-monospace, Menlo, Consolas, monospace;
  --w: 1200px;
  --gutter: 24px;
  --radius: 4px;
  --shadow-card: 5px 6px 0 rgba(10, 30, 22, 0.45);
}

/* ---- base ---------------------------------------------------------------------------------- */
* { box-sizing: border-box; }
html { background: var(--baize); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--baize); color: var(--ink);
  font: 400 16px/1.55 var(--body); -webkit-font-smoothing: antialiased; overflow-x: hidden;
  position: relative;
}
/* felt grain: a quiet noise sheet over the cloth */
body {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.02  0 0 0 0 0.08  0 0 0 0 0.05  0 0 0 0.22 0'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>");
  background-size: 160px 160px;
}
main, header, footer { position: relative; z-index: 1; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }
p a, .note a, .ribbon a, .foot-chain a, dd a, .help a { text-decoration: underline; text-decoration-color: var(--ink-25); text-underline-offset: 3px; }
p a:hover, .note a:hover, .ribbon a:hover, .foot-chain a:hover, dd a:hover { text-decoration-color: currentColor; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
strong, b { font-weight: 700; }
code { font-family: var(--mono); font-size: 0.92em; }
.tnum { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--cheddar); outline-offset: 3px; }
[hidden] { display: none !important; }
.wrap { max-width: var(--w); margin: 0 auto; padding-inline: var(--gutter); }

h1, h2, h3, .display {
  font-family: var(--display); font-weight: 400; letter-spacing: 0.005em; line-height: 1.06;
}
h2 { font-size: 22px; }
h3 { font-size: 18px; }

.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--teal); margin-bottom: 14px; }
.lede { font-size: 19px; line-height: 1.5; color: var(--ink-70); max-width: 62ch; }
.help { font-size: 14px; color: var(--ink-70); line-height: 1.5; }
.note { margin-top: 14px; padding: 12px 14px; font-size: 14px; color: var(--ink-70); background: var(--ink-06); border-radius: var(--radius); line-height: 1.5; }
.dash { color: var(--pencil); font-style: italic; }
.paid { color: var(--green); }
.preview-tag, .is-preview { display: inline-block; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--pencil); border: 1px solid var(--ink-25); border-radius: 3px; padding: 1px 6px; vertical-align: middle; }

/* ---- buttons -------------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: var(--radius); font-weight: 600; font-size: 15px; line-height: 1;
  border: 1.5px solid var(--ink); background: var(--cheddar); color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  white-space: nowrap; font-weight: 700;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary { background: var(--cheddar); color: var(--ink); }
.btn-ghost { background: var(--card); color: var(--ink); border-color: var(--ink); box-shadow: 2px 2px 0 var(--ink-25); }
.btn-ghost:hover { box-shadow: 3px 3px 0 var(--ink-25); }
.btn-sm { padding: 8px 12px; font-size: 13px; }
.btn-big { padding: 15px 24px; font-size: 16px; }
.btn-addr { background: var(--card); color: var(--ink); border-color: var(--ink); font-family: var(--mono); font-weight: 400; font-size: 13px; box-shadow: 2px 2px 0 var(--ink-25); }

/* ---- header --------------------------------------------------------------------------------- */
.top { position: sticky; top: 0; z-index: 30; background: var(--card); border-bottom: 3px solid var(--ink); box-shadow: 0 4px 0 rgba(10, 30, 22, 0.35); }
.top-inner { max-width: var(--w); margin: 0 auto; padding: 12px var(--gutter); display: flex; align-items: center; gap: 22px; }
.brand { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.brand-mark { width: 40px; height: 40px; border-radius: 50%; background: var(--cheddar); overflow: hidden; flex: none; box-shadow: 0 0 0 2px var(--ink); }
.brand-mark img { width: 40px; height: 40px; object-fit: cover; }
.brand-word { font-family: var(--display); font-weight: 400; font-size: 20px; letter-spacing: 0.01em; }
.nav { display: flex; gap: 4px; margin-left: 6px; }
.nav a { padding: 8px 12px; border-radius: 3px; font-weight: 700; font-size: 15px; color: var(--ink-70); transition: color .12s; }
.nav a:hover { color: var(--ink); }
.nav a.active { color: var(--ink); background: var(--cheddar); box-shadow: 2px 2px 0 var(--ink); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.xlink { width: 36px; height: 36px; border-radius: 3px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); border: 1.5px solid var(--ink); transition: background .12s; }
.xlink:hover { background: var(--ink-06); }
.xlink svg { width: 16px; height: 16px; fill: currentColor; }
.chip { display: inline-flex; align-items: center; gap: 10px; padding: 6px 8px 6px 12px; border-radius: 3px; background: var(--card); border: 1.5px solid var(--ink); font-size: 13px; font-weight: 700; color: var(--ink-70); transition: box-shadow .12s; }
.chip:hover { box-shadow: 2px 2px 0 var(--ink-25); }
.chip-time { font-family: var(--mono); font-weight: 700; font-size: 14px; color: var(--cream); background: var(--ink); padding: 3px 8px; border-radius: 2px; }

/* ---- hero: the lid, edge to edge, then the table ------------------------------------------ */
.lid { position: relative; background: var(--ink); border-bottom: 3px solid var(--ink); }
.lid picture, .lid img { display: block; width: 100%; }
.lid img { height: auto; max-height: min(78vh, 760px); object-fit: cover; object-position: center 40%; background: #d9a72c; }
.lid::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 -40px 60px -40px rgba(10, 30, 22, 0.6); pointer-events: none; }
.table { color: var(--cream); padding: 52px 0 14px; text-align: center; }
.table .eyebrow { color: var(--cheddar); }
.table h1 { font-size: clamp(34px, 4.8vw, 66px); max-width: 15ch; margin: 0 auto; color: var(--cream); text-shadow: 3px 3px 0 var(--baize-2); }
.table .lede { margin: 22px auto 0; color: var(--cream-70); max-width: 58ch; font-size: 19px; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 22px; margin-top: 30px; }
.hero-next { font-size: 15px; color: var(--cream-70); font-weight: 700; }
.hero-next .tnum { font-family: var(--mono); font-weight: 700; font-size: 16px; color: var(--ink); background: var(--cheddar); padding: 4px 9px; border-radius: 2px; margin-left: 6px; box-shadow: 2px 2px 0 var(--ink); }
.hero-live {
  display: inline-block; margin: 30px auto 0; font-size: 14px; color: var(--ink-70); background: var(--card-2); border: 1.5px solid var(--ink);
  padding: 10px 18px; border-radius: 3px; box-shadow: var(--shadow-card); max-width: 64ch;
}
body.ready .table > * { animation: rise .6s cubic-bezier(.2,.7,.2,1) both; }
body.ready .table > *:nth-child(2) { animation-delay: .05s; }
body.ready .table > *:nth-child(3) { animation-delay: .1s; }
body.ready .table > *:nth-child(4) { animation-delay: .15s; }
body.ready .table > *:nth-child(5) { animation-delay: .2s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { body.ready .table > * { animation: none; } }

/* ---- ribbon --------------------------------------------------------------------------------- */
.ribbon { margin: 8px 0 22px; padding: 12px 16px; border-radius: var(--radius); background: var(--card-2); border: 1.5px solid var(--ink); border-left: 8px solid var(--cheddar); font-size: 14px; color: var(--ink); box-shadow: var(--shadow-card); }
.ribbon b { font-weight: 700; }

/* ---- three moves ---------------------------------------------------------------------------- */
.moves { padding: 34px 0 8px; }
.moves-head { font-family: var(--display); font-weight: 400; font-size: 22px; margin-bottom: 18px; color: var(--cream); }
.moves-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.card { background: var(--card-2); border: 1.5px solid var(--ink); border-radius: var(--radius); padding: 24px 24px 26px; box-shadow: var(--shadow-card); transition: transform .18s ease, box-shadow .18s ease; }
.card:hover { transform: translate(-2px, -2px); box-shadow: 7px 8px 0 rgba(10, 30, 22, 0.45); }
.card-kicker { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--teal); margin-bottom: 10px; }
.card h3 { margin-bottom: 10px; }
.card p { font-size: 15px; color: var(--ink-70); }

/* ---- panels --------------------------------------------------------------------------------- */
.panel { background: var(--card-2); border: 1.5px solid var(--ink); border-radius: var(--radius); padding: 24px; margin: 22px 0; box-shadow: var(--shadow-card); }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--ink-12); }
.panel-meta { font-family: var(--mono); font-size: 12.5px; color: var(--pencil); display: inline-flex; gap: 10px; flex-wrap: wrap; }
.panel-note { font-size: 14px; color: var(--ink-70); margin-bottom: 12px; }
.page-head { padding: 46px 0 8px; color: var(--cream); }
.page-head .lede { color: var(--cream-70); }
.page-head .eyebrow { color: var(--cheddar); }
.page-title { font-size: clamp(28px, 3.4vw, 44px); max-width: 22ch; text-shadow: 3px 3px 0 var(--baize-2); }
.page-head .lede { margin-top: 14px; }

/* ---- mint ----------------------------------------------------------------------------------- */
.mint-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: start; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.mint-grid .help { margin-top: 12px; }
.mint-grid .row + .help + .row, .drawer .row + .help + .row { margin-top: 14px; }
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--ink); border-radius: var(--radius); overflow: hidden; background: var(--card); }
.stepper button { width: 38px; height: 40px; font-weight: 600; font-size: 18px; }
.stepper button:hover { background: var(--ink-06); }
.stepper output { min-width: 40px; text-align: center; font-family: var(--mono); font-weight: 500; font-size: 16px; border-inline: 1.5px solid var(--ink); line-height: 40px; }
.toggle { display: inline-flex; border: 1.5px solid var(--ink); border-radius: var(--radius); overflow: hidden; }
.toggle button { padding: 0 14px; height: 40px; font-size: 13px; font-weight: 600; color: var(--ink-70); }
.toggle button + button { border-left: 1.5px solid var(--ink); }
.toggle button.on { background: var(--ink); color: var(--card); }
.toggle button:disabled { opacity: 0.4; cursor: not-allowed; }
.total { font-size: 14px; color: var(--ink-70); }
.total b { color: var(--ink); font-family: var(--mono); font-weight: 500; }
.mint-preview { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px; background: var(--card); border: 1px dashed var(--ink-25); border-radius: var(--radius); }
.mint-preview svg { image-rendering: pixelated; }
.mint-closed { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.mint-closed .big { font-family: var(--display); font-weight: 400; font-size: 20px; }
.mint-closed + .help { margin-top: 14px; }

/* ---- rat cards ------------------------------------------------------------------------------ */
.rat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.rat-card { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; background: var(--card); border: 1px solid var(--ink-25); border-radius: var(--radius); padding: 16px; position: relative; }
.rat-card.is-retired { border-color: var(--green); background: var(--green-soft); }
.rat-art { border-radius: var(--radius); background: var(--card-3); padding: 0; align-self: start; }
.rat-art svg { image-rendering: pixelated; width: 96px; height: 96px; }
.rat-title { font-family: var(--display); font-weight: 400; font-size: 17px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.badge { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; padding: 2px 7px; border-radius: 3px; background: var(--cheddar); color: var(--ink); font-weight: 500; }
.is-retired .badge { background: var(--green); color: var(--card); }
.badge-ink { background: var(--ink); color: var(--card); }
.hustle { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 13px; color: var(--ink-70); }
.hustle-bar, .lb .bar { flex: 1; height: 8px; background: var(--ink-12); border-radius: 999px; overflow: hidden; }
.hustle-bar i, .lb .bar i { display: block; height: 100%; background: var(--cheddar); border-radius: 999px; }
.rat-stats { font-size: 13px; color: var(--ink-70); margin-top: 6px; }
.claimables { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; }
.claimables li { display: inline-flex; align-items: center; gap: 6px; }
.claimables li small { color: var(--pencil); }
.claimables .none { color: var(--pencil); font-style: italic; }
.rat-actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.drawer { grid-column: 1 / -1; border-top: 1px dashed var(--ink-25); padding-top: 14px; }
.drawer .help { margin-top: 10px; }

/* ---- cheese tags ---------------------------------------------------------------------------- */
.cheese-tag { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 12.5px; font-weight: 500; color: var(--ink); background: var(--ink-06); padding: 2px 8px 2px 6px; border-radius: 3px; vertical-align: middle; }
.cheese-tag i { width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--ink)); }

/* ---- the board (races) ---------------------------------------------------------------------- */
.board {
  margin-top: 22px; background: var(--card-2); border: 1.5px solid var(--ink); border-radius: 8px; padding: 6px; box-shadow: var(--shadow-card);
  position: relative;
}
.board::before { content: ""; position: absolute; inset: 6px; border: 1px solid var(--ink-25); border-radius: 5px; pointer-events: none; }
.board-top { display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 6px; padding: 18px 18px 0; }
.board-cell { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.board-k { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--pencil); }
.board-v { font-family: var(--display); font-weight: 400; font-size: 28px; line-height: 1; }
.board-clock { align-items: center; text-align: center; background: var(--ink); color: var(--card); border-radius: 6px; }
.board-clock .board-k { color: rgba(239, 230, 210, 0.6); }
.board-time { font-family: var(--mono); font-weight: 700; font-size: 40px; letter-spacing: 0.02em; color: var(--cheddar); }
.board.closing .board-time { color: var(--red); }
.board.closing .board-clock .board-k { color: #f0b5ae; }
.board.settling .board-time { animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.35; } }
.board-sub { padding: 14px 34px 0; font-size: 15px; color: var(--ink-70); }
.board-sub .cheese-tag { margin: 0 2px 0 4px; }
.board-sub b { color: var(--ink); font-family: var(--mono); font-weight: 500; }
.board-sub .hints { font-size: 13px; color: var(--pencil); margin-left: 4px; }
.board-sub .hints::before { content: "("; } .board-sub .hints::after { content: ")"; }
.board-foot { padding: 0 34px 20px; font-size: 13.5px; color: var(--ink-70); }

.track-wrap { padding: 18px 34px 12px; }
.track { position: relative; height: 128px; --lane: var(--teal); }
.track-line { position: absolute; left: 0; right: 0; top: 78px; height: 22px; background: var(--lane); border-radius: 3px; opacity: 0.9;
  background-image: repeating-linear-gradient(90deg, transparent 0 22px, rgba(239, 230, 210, 0.55) 22px 34px); background-size: 34px 2px; background-repeat: repeat-x; background-position: 0 10px; }
.track-tick { position: absolute; top: 72px; width: 2px; height: 34px; background: var(--ink-25); }
.track-station { position: absolute; top: 106px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--pencil); }
.track-rat { position: absolute; top: 44px; transition: left 2.2s cubic-bezier(.3,.6,.3,1); }
.track-rat.row2 { top: 22px; }
.track-rat svg { image-rendering: pixelated; width: 34px; height: 34px; filter: drop-shadow(0 1px 0 rgba(30, 25, 18, 0.3)); }
.track.run .track-rat { transition: left 2.2s cubic-bezier(.3,.6,.3,1); }
.track-empty { position: absolute; left: 0; right: 0; top: 30px; text-align: center; font-size: 14px; color: var(--pencil); font-style: italic; }
.track-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 13px; color: var(--ink-70); margin-top: 6px; }
.track-legend .legend-k { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--pencil); margin-right: 4px; }
.track-legend b { font-family: var(--mono); font-weight: 500; color: var(--ink); }

.races-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.races-grid .panel { margin: 22px 0 0; }
.races-side .panel + .panel { margin-top: 22px; }

.results li { display: grid; grid-template-columns: 210px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--ink-12); }
.results li:last-child { border-bottom: 0; }
.results li.new { animation: rise .5s ease both; }
.results .empty, .lb .empty, .retirees .empty { display: block; color: var(--pencil); font-style: italic; font-size: 14px; padding: 14px 0; }
.res-id .cheese-tag { white-space: nowrap; font-size: 12px; }
.res-id { font-family: var(--display); font-weight: 400; font-size: 15px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.res-id small { font-family: var(--body); font-weight: 400; font-size: 12.5px; color: var(--pencil); }
.res-winners { display: flex; flex-direction: column; gap: 6px; }
.res-win { display: grid; grid-template-columns: 30px 26px auto minmax(0, 1fr); align-items: center; gap: 8px; font-size: 14px; }
.res-win svg { image-rendering: pixelated; }
.res-win .place { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--pencil); }
.res-win .id { font-family: var(--mono); font-weight: 500; }
.res-win .amt { font-family: var(--mono); font-size: 13.5px; }
.res-win .amt small { color: var(--pencil); margin-left: 6px; }
.res-tx { font-family: var(--mono); font-size: 12px; color: var(--teal); text-decoration: underline; text-underline-offset: 3px; }
.res-tx.is-preview { text-decoration: none; }

.lb li { display: grid; grid-template-columns: 22px 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--ink-12); }
.lb li:last-child { border-bottom: 0; }
.lb .rank { font-family: var(--mono); font-size: 12px; color: var(--pencil); }
.lb svg { image-rendering: pixelated; }
.lb .name { font-family: var(--mono); font-weight: 500; font-size: 14px; }
.lb .name small { font-family: var(--body); font-weight: 400; color: var(--pencil); margin-left: 8px; font-size: 12px; }
.lb .bar { margin-top: 6px; height: 6px; }
.lb .togo { text-align: right; font-size: 12px; color: var(--pencil); }
.lb .togo b { display: block; font-family: var(--mono); font-weight: 500; color: var(--ink); font-size: 14px; }

.retirees li { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--ink-12); }
.retirees li:last-child { border-bottom: 0; }
.retirees .art { background: var(--green-soft); border-radius: var(--radius); }
.retirees .art svg { image-rendering: pixelated; }
.retirees .name { font-family: var(--mono); font-weight: 500; font-size: 15px; }
.retirees .meta { font-size: 12.5px; color: var(--ink-70); }

/* ---- the bank tray (fund) ------------------------------------------------------------------- */
.vault-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; }
.vault { background: var(--card); border: 1px solid var(--ink-25); border-top: 4px solid var(--c, var(--ink)); border-radius: var(--radius); padding: 16px; }
.vault .sym { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.vault .bal { font-family: var(--display); font-weight: 400; font-size: 24px; margin-top: 12px; line-height: 1; }
.vault .usd { font-size: 12.5px; color: var(--pencil); margin-top: 6px; font-family: var(--mono); }
.vault .pot { font-size: 13px; color: var(--ink-70); margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--ink-25); }
.vault .pot b { font-family: var(--mono); font-weight: 500; color: var(--ink); }
.fund-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; align-items: start; }
.fund-grid.has-token { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fund-grid .panel { margin: 0; }
.big-stat { margin: 4px 0 14px; }
.big-stat .v { font-family: var(--display); font-weight: 400; font-size: 32px; line-height: 1; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.big-stat .v small { font-family: var(--mono); font-weight: 500; font-size: 13px; color: var(--pencil); letter-spacing: 0.06em; }
.big-stat .usd { font-family: var(--mono); font-size: 13px; color: var(--pencil); margin-top: 8px; }
.stat-list { display: flex; flex-direction: column; }
.stat { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--ink-12); font-size: 14px; }
.stat:last-child { border-bottom: 0; }
.stat .k { color: var(--ink-70); }
.stat .v { font-family: var(--mono); font-weight: 500; text-align: right; }
.stat .v small { color: var(--pencil); margin-left: 6px; font-weight: 400; }
.links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

/* ---- the pension book (holders) ------------------------------------------------------------- */
.holders-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 22px; align-items: start; margin-top: 22px; }
.holders-grid .panel { margin: 0; }
.panel-book { background: var(--card-2); background-image: repeating-linear-gradient(180deg, transparent 0 29px, var(--ink-06) 29px 30px); background-position: 0 6px; }
.panel-book .panel-head { background: var(--card-2); }
.panel-book p { font-size: 15px; line-height: 30px; }
.panel-book p + p { margin-top: 0; }
.book-lead { font-family: var(--display); font-weight: 400; font-size: 20px !important; line-height: 30px !important; }
.book-note { color: var(--pencil); font-style: italic; }
.totals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.total-cell { background: var(--card); border: 1px solid var(--ink-25); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.total-cell .k { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--pencil); }
.total-cell .v { font-family: var(--mono); font-weight: 500; font-size: 15px; overflow-wrap: anywhere; }
.ledger-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ledger { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 620px; }
.ledger th { text-align: left; font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--pencil); font-weight: 500; padding: 8px 10px; border-bottom: 1.5px solid var(--ink); }
.ledger td { padding: 10px; border-bottom: 1px solid var(--ink-12); vertical-align: top; }
.ledger .num { text-align: right; font-family: var(--mono); white-space: nowrap; }
.ledger .hash { font-family: var(--mono); color: var(--teal); text-decoration: underline; text-underline-offset: 3px; }
.ledger tr.empty td { color: var(--pencil); font-style: italic; }
.mine-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.mine-card { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 14px; background: var(--green-soft); border: 1px solid var(--green); border-radius: var(--radius); padding: 14px; }
.mine-card .art { background: var(--card); border-radius: var(--radius); }
.mine-card .art svg { image-rendering: pixelated; }
.mine-card .name { font-family: var(--mono); font-weight: 500; font-size: 15px; }
.mine-card .meta { font-size: 13px; color: var(--ink-70); margin-top: 4px; }
.mine-card .meta b { font-family: var(--mono); font-weight: 500; color: var(--ink); }
.mine-card .btn { margin-top: 10px; }
.source .stat .v { overflow-wrap: anywhere; text-align: left; }
.source .stat { flex-direction: column; align-items: flex-start; gap: 4px; }
.source + p { font-size: 14px; color: var(--ink-70); margin-top: 14px; }
.source a { color: var(--teal); text-decoration: underline; text-underline-offset: 3px; }

/* ---- the booklet (rules) -------------------------------------------------------------------- */
.booklet-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; align-items: start; padding: 20px 0 40px; }
.booklet-main { background: var(--card-2); border: 1.5px solid var(--ink); border-radius: var(--radius); padding: 6px 30px 20px; box-shadow: var(--shadow-card); }
.rule { padding: 26px 0; border-top: 1px solid var(--ink-25); }
.rule:first-child { border-top: 0; }
.rule h2 { margin-bottom: 12px; }
.rule p { font-size: 15.5px; color: var(--ink-70); max-width: 70ch; }
.rule p + p { margin-top: 12px; }
.faults div, .faq div { padding: 12px 0; border-bottom: 1px dashed var(--ink-25); }
.faults div:last-child, .faq div:last-child { border-bottom: 0; }
.faults dt, .faq dt { font-weight: 600; font-size: 15.5px; }
.faults dd, .faq dd { margin-top: 4px; font-size: 14.5px; color: var(--ink-70); max-width: 70ch; }
.roadmap li { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; font-size: 15px; color: var(--ink-70); }
.state { flex: none; font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; padding: 3px 8px; border-radius: 3px; margin-top: 3px; white-space: nowrap; }
.state-done { background: var(--green-soft); color: var(--green); }
.state-building { background: var(--cheddar-soft); color: #8a5a06; }
.state-todo { background: var(--ink-06); color: var(--pencil); }
.booklet-side { position: sticky; top: 84px; }
.numbers-panel { margin: 0; }
.numbers div { display: flex; justify-content: space-between; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--ink-12); font-size: 14px; }
.numbers div:last-child { border-bottom: 0; }
.numbers dt { color: var(--ink-70); }
.numbers dd { font-family: var(--mono); font-weight: 500; text-align: right; }

/* ---- footer --------------------------------------------------------------------------------- */
.foot { margin-top: 64px; background: var(--ink); color: var(--card); padding: 44px 0 40px; border-top: 3px solid var(--cheddar); }
.foot-inner { display: flex; flex-direction: column; gap: 14px; }
.foot-brand { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.foot .brand-word { font-size: 24px; }
.foot-line { font-size: 14px; color: rgba(239, 230, 210, 0.7); }
.foot-addrs { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: rgba(239, 230, 210, 0.7); }
.foot-addrs code { color: var(--card); margin-left: 8px; overflow-wrap: anywhere; }
.copy { margin-left: 10px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--cheddar); }
.foot-chain { font-size: 13px; color: rgba(239, 230, 210, 0.7); }
.foot-chain a { color: var(--card); text-decoration-color: rgba(239, 230, 210, 0.4); }
.foot-risk { font-size: 12.5px; color: rgba(239, 230, 210, 0.55); max-width: 78ch; line-height: 1.55; margin-top: 8px; }

/* ---- toasts + wallet picker ----------------------------------------------------------------- */
#toasts { position: fixed; right: 18px; bottom: 18px; z-index: 60; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 36px)); }
.toast { background: var(--ink); color: var(--card); padding: 12px 14px; border-radius: var(--radius); font-size: 14px; box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.5); animation: rise .25s ease both; }
.toast a { color: var(--cheddar); text-decoration: underline; }
.toast.ok { border-left: 4px solid var(--green); }
.toast.err { border-left: 4px solid var(--red); }
.picker { position: fixed; inset: 0; z-index: 70; background: rgba(30, 25, 18, 0.55); display: flex; align-items: center; justify-content: center; padding: 20px; }
.picker-card { background: var(--card-2); color: var(--ink); border: 1px solid var(--ink-25); border-radius: 8px; padding: 22px; width: min(420px, 100%); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.6); }
.picker-card h3 { margin-bottom: 6px; }
.picker-card p { font-size: 14px; color: var(--ink-70); margin-bottom: 14px; }
.picker-opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 1px solid var(--ink-25); border-radius: var(--radius); margin-bottom: 8px; background: var(--card); text-align: left; }
.picker-opt:hover { border-color: var(--ink); }
.picker-opt img { width: 22px; height: 22px; }
.picker-opt .warn { margin-left: auto; font-size: 11px; color: var(--red); font-family: var(--mono); }
.picker-cancel { width: 100%; margin-top: 4px; }

/* ---- responsive ----------------------------------------------------------------------------- */
@media (max-width: 1080px) {
  .board-top { grid-template-columns: 1fr 1fr; }
  .board-clock { grid-column: 1 / -1; order: -1; }
  .races-grid { grid-template-columns: 1fr; }
  .fund-grid, .fund-grid.has-token { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .booklet-grid { grid-template-columns: 1fr; }
  .booklet-side { position: static; }
  .totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .top-inner { flex-wrap: wrap; gap: 10px 14px; padding: 10px var(--gutter); }
  .nav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 7px 10px; font-size: 14px; white-space: nowrap; }
  .top-right { gap: 8px; }
  .chip .chip-label { display: none; }
  .chip { padding: 5px 6px 5px 10px; }
  .table { padding-top: 34px; }
  .booklet-main { padding-inline: 18px; }
  .moves-grid { grid-template-columns: 1fr; }
  .mint-grid { grid-template-columns: 1fr; }
  .fund-grid, .fund-grid.has-token { grid-template-columns: 1fr; }
  .holders-grid { grid-template-columns: 1fr; }
  .results li { grid-template-columns: 1fr; gap: 8px; }
  .res-id { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
  .res-tx { justify-self: start; }
  .board-top { grid-template-columns: 1fr; padding: 12px 12px 0; }
  .board-clock { order: -1; }
  .board-sub, .board-foot { padding-inline: 22px; }
  .track-wrap { padding-inline: 22px; }
  .rat-card { grid-template-columns: 72px minmax(0, 1fr); }
  .rat-art svg { width: 72px; height: 72px; }
  .totals { grid-template-columns: 1fr; }
  .page-head { padding-top: 30px; }
}
@media (max-width: 420px) {
  :root { --gutter: 16px; }
  .table h1 { font-size: 32px; }
  .lid img { max-height: none; aspect-ratio: 1; }
  .board-time { font-size: 38px; }
  .btn-big { padding: 13px 18px; }
  .cta-row { gap: 14px; }
  .stat { flex-direction: column; align-items: flex-start; gap: 2px; }
  .stat .v { text-align: left; }
  .numbers div { flex-direction: column; gap: 2px; }
  .numbers dd { text-align: left; }
}
