/* Sat Pools — app style "true-black flat" (tasteskill v2 app sheet, seed 140021767). Its face comes from the product:
   pool-water aqua as the only data hue, on a cool near-black. Elevation by lightness alone; no shadows on resting
   cards; the primary control is a white pill; colour stays on data (tiles, stakes, returns), never on chrome.
   Grid: one centred column, max 1120px, 24px gutters on desktop (16px on phones); a 6-column body grid with one 16px
   gap: 6 × 173.3 + 5 × 16 = 1120, so every card edge lands on the column edges.
   Type scale (8 sizes): 11 tile meta · 12 meta · 13 labels · 14 body · 16 section / inputs · 20 card figures ·
   24 titles and KPIs · 32 the live pot. One family, Inter 400/500/600, tabular figures on every number.
   Motion is feedback only (press, hover, a sheet or menu opening) plus a short native cross-fade between pages. */
@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url(/fonts/inter-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 500; font-display: swap; src: url(/fonts/inter-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url(/fonts/inter-latin-600-normal.woff2) format('woff2'); }

:root {
  color-scheme: dark;
  --ground: #0b0c0e; --surface: #141619; --raised: #22252a; --active: #2a2e33;
  --border: #1d2024; --rule: #1f2226; --control: #464a50;
  --text: #ffffff; --muted: #b4b4b4; --faint: #949494;
  --accent: #3ad0e6; --accent-soft: rgba(58, 208, 230, .12); --accent-ink: #062a30;
  --positive: #3fc07a; --negative: #e5566f; --warning: #e5a93b;
  --pill-positive-bg: #172a1d; --pill-positive-ink: #3fc07a; --pill-negative-bg: #2c1a20; --pill-negative-ink: #e5566f;
  --pill-warning-bg: #2b2414; --pill-warning-ink: #e5a93b; --pill-neutral-bg: #24272b; --pill-neutral-ink: #ffffff;
  --pill-accent-bg: #12292d; --pill-accent-ink: #3ad0e6;
  --chart-1: #3ad0e6; --chart-2: #e6e6e6; --chart-3: #6b6b6b; --chart-muted: #4a4e54; --grid: #24272b; --axis-ink: #949494; --ink: #ffffff; --chart-span: .12; --chart-track: #22252a;
  --radius-card: 20px; --radius-panel: 12px; --radius-tile: 10px; --radius-control: 999px;
  --gap: 16px; --pad: 24px; --control-height: 36px; --bar-h: 56px; --tab-h: 60px; --maxw: 1120px; --gutter: 24px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--text); font: 400 14px/20px var(--font); -webkit-font-smoothing: antialiased; min-height: 100dvh; overflow-x: hidden; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--faint); }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent); color: var(--accent-ink); }
[hidden] { display: none !important; }
a, button, summary, .tile, .pick, .option { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.up { color: var(--positive); } .down { color: var(--negative); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.small { font-size: 13px; } .xs { font-size: 12px; } .light { font-weight: 400; } .strong { font-weight: 600; }
.m0 { margin: 0; } .note { margin: 14px 0 0; } .gap-sm { margin: 6px 0 16px; }
.gap-b { margin-bottom: 12px; } .gap-t { margin-top: var(--gap); } .gap-t-sm { margin-top: 16px; }

/* ---------- Shell: a plain top bar over one centred column; a tab bar on phones ---------- */
.topbar { position: sticky; top: 0; z-index: 40; height: var(--bar-h); background: var(--ground); transition: box-shadow .2s; view-transition-name: topbar; }
.topbar.scrolled { box-shadow: 0 1px 0 var(--border); }
.topbar-inner, .main, .footer-inner { width: 100%; max-width: calc(var(--maxw) + 2 * var(--gutter)); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.topbar-inner { height: 100%; display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font: 600 16px/1 var(--font); letter-spacing: -.01em; text-decoration: none !important; flex-shrink: 0; }
.brand img { width: 26px; height: 26px; }
.nav { display: none; gap: 24px; }
.nav a { color: var(--muted); font: 500 14px/1 var(--font); text-decoration: none; padding: 8px 0; transition: color .15s; }
.nav a:hover, .nav a[aria-current='page'] { color: var(--text); }
.bar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.account { display: inline-flex; align-items: center; gap: 8px; height: var(--control-height); padding: 0 14px 0 6px; border-radius: 999px; background: var(--surface); border: 0; color: var(--text); font: 500 14px/1 var(--font); transition: background .15s; }
.account:hover { background: var(--raised); }
.account .av { width: 24px; height: 24px; }
.account.signed-out { padding: 0 16px; background: var(--text); color: #000; font-weight: 600; }
.account .bal { color: var(--muted); font-variant-numeric: tabular-nums; margin-left: 4px; }
.main { padding-top: 24px; padding-bottom: 96px; min-height: calc(100dvh - var(--bar-h) - 120px); }
.footer { padding: 28px 0 40px; color: var(--faint); font-size: 12px; }
.footer-inner { display: flex; gap: 12px 28px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.footer .brand { font-size: 14px; } .footer .brand img { width: 20px; height: 20px; }
.footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; } .footer nav a { color: var(--muted); }
.tabbar { display: none; }
#progress { position: fixed; z-index: 45; top: var(--bar-h); left: 0; right: 0; height: 2px; pointer-events: none; opacity: 0; transition: opacity .2s; overflow: hidden; }
#progress::before { content: ''; position: absolute; inset: 0; width: 40%; background: var(--accent); transform: translateX(-100%); animation: loadbar 1s var(--ease) infinite; }
#progress.on { opacity: 1; }
@keyframes loadbar { to { transform: translateX(260%); } }

/* ---------- Avatars: a stable initial on a pale tint of the person's own hue ---------- */
.av { --h: 190; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: hsl(var(--h) 30% 22%); color: hsl(var(--h) 70% 82%); font: 600 12px/1 var(--font); flex-shrink: 0; }
.av.lg { width: 56px; height: 56px; font-size: 20px; }
.av.party { border-radius: 12px; width: 40px; height: 40px; font-size: 14px; }

/* ---------- Type ---------- */
h1, h2, h3 { margin: 0; font-family: var(--font); font-weight: 600; color: var(--text); text-wrap: balance; }
h1 { font-size: 24px; line-height: 30px; letter-spacing: -.02em; }
h2 { font-size: 20px; line-height: 26px; letter-spacing: -.01em; }
h3 { font-size: 16px; line-height: 22px; letter-spacing: -.01em; }
p { text-wrap: pretty; }
.title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 0 0 20px; }
.title-row p { margin: 6px 0 0; color: var(--muted); max-width: 64ch; }
.card-head a, .linkish { color: var(--muted); font-weight: 500; background: none; border: 0; padding: 0; transition: color .15s; white-space: nowrap; }
.card-head > a, .card-head > .linkish { flex: none; }
.card-head p a { color: var(--text); }
.card-head a:hover, .linkish:hover { color: var(--text); }

/* ---------- Controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--control-height); padding: 0 16px; border-radius: var(--radius-control); border: 1px solid transparent; background: var(--text); color: #000; font: 600 14px/1 var(--font); white-space: nowrap; text-decoration: none !important; transition: transform .12s var(--ease), background .15s, border-color .15s, opacity .15s; }
.btn:hover { background: #e8e8e8; }
.btn:active { transform: scale(.97); }
.btn svg { width: 16px; height: 16px; }
.btn.outline { background: transparent; color: var(--text); border-color: var(--control); }
.btn.outline:hover { border-color: #6a6e74; background: rgba(255, 255, 255, .04); }
.btn.quiet { background: var(--raised); color: var(--text); }
.btn.quiet:hover { background: var(--active); }
.btn.danger, .btn.danger-text { background: transparent; color: var(--negative); border-color: #4a2a31; }
.btn.danger:hover, .btn.danger-text:hover { background: rgba(229, 86, 111, .08); border-color: #6a3540; }
.btn.lg { height: 44px; padding: 0 22px; font-size: 16px; }
.btn.sm { height: 32px; padding: 0 14px; font-size: 13px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .4; cursor: not-allowed; transform: none; }
.icon-btn { width: 32px; height: 32px; border-radius: 999px; border: 0; background: var(--raised); color: var(--muted); display: inline-grid; place-items: center; transition: background .15s, color .15s; }
.icon-btn:hover { color: var(--text); background: var(--active); }
.icon-btn svg { width: 16px; height: 16px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--surface); }
.seg button { height: 30px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: 500 13px/1 var(--font); transition: color .15s, background .15s; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed='true'] { background: var(--text); color: #000; }
.seg .short { display: none; }
.tabs { display: flex; gap: 24px; box-shadow: inset 0 -1px 0 var(--rule); margin: 20px 0 16px; overflow-x: auto; scrollbar-width: none; }
.tabs button { height: 40px; padding: 0; border: 0; background: none; color: var(--muted); font: 500 14px/1 var(--font); white-space: nowrap; transition: color .15s, box-shadow .15s; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-pressed='true'] { color: var(--text); box-shadow: inset 0 -2px 0 var(--text); }

/* A More menu: a native <details> popover (it floats, so it may carry a shadow). */
.more { position: relative; }
.more > summary { list-style: none; cursor: pointer; }
.more > summary::-webkit-details-marker { display: none; }
.more[open] > summary { background: var(--active); color: var(--text); }
.more .menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 220px; padding: 6px; border-radius: var(--radius-panel); background: var(--raised); box-shadow: 0 16px 40px rgba(0, 0, 0, .5); display: grid; animation: menu-in .14s var(--ease); }
.more .menu a, .more .menu button { display: flex; align-items: center; height: 40px; padding: 0 12px; border: 0; border-radius: 8px; background: none; color: var(--text); font: 500 14px/1 var(--font); text-align: left; text-decoration: none; white-space: nowrap; }
.more .menu a:hover, .more .menu button:hover { background: var(--active); }
.more .menu .neg { color: #f27a8e; } /* lighter than --negative so it reads 4.5:1 on the menu */
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } }

/* ---------- Surfaces ---------- */
.card { background: var(--surface); border-radius: var(--radius-card); padding: var(--pad); min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.card-head.pad { padding: var(--pad) var(--pad) 0; }
.panel { background: var(--raised); border-radius: var(--radius-panel); padding: 14px 16px; }
.grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--gap); }
.c2 { grid-column: span 2; } .c3 { grid-column: span 3; } .c4 { grid-column: span 4; } .c6 { grid-column: 1 / -1; }
.side-stack { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
/* A card that fills its column: content on top, its one action or total pinned to the foot. */
.card.fill { flex: 1; display: flex; flex-direction: column; justify-content: space-between; gap: 16px; align-items: flex-start; }
.card.fill > div { width: 100%; }
.card.flush.fill { gap: 0; }
.pad-x { padding: 0 var(--pad) var(--pad); width: 100%; }
.foot-total { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 14px var(--pad) var(--pad); box-shadow: inset 0 1px 0 var(--rule); }
.foot-total b { font-weight: 600; }
.self-start { align-self: start; }
.cell { min-width: 0; } .cell.flex { display: flex; align-items: center; gap: 10px; }
.empty { padding: 32px var(--pad); text-align: left; }
.empty h3 { margin-bottom: 6px; } .empty p { color: var(--muted); margin: 0 0 16px; max-width: 52ch; }
.empty.tight { padding-top: 8px; padding-bottom: 24px; } .empty.tight p:last-child { margin-bottom: 0; }
.skeleton { background: var(--surface); animation: breathe 1.6s infinite ease-in-out; border-radius: var(--radius-card); }
@keyframes breathe { 50% { opacity: .55; } }

/* KPIs as type in one divided card */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border-radius: var(--radius-card); }
.kpis.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* 2×2 in a side column: dividers between the four cells */
.kpis.k2 { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; }
.kpis.k2 .kpi { padding: 16px 20px; }
.kpis.k2 .kpi:nth-child(3) { box-shadow: inset 0 1px 0 var(--rule); }
.kpis.k2 .kpi:nth-child(4) { box-shadow: inset 1px 0 0 var(--rule), inset 0 1px 0 var(--rule); }
.kpis.fill { flex: 1; }
.kpi { padding: 20px var(--pad); min-width: 0; }
.kpi + .kpi { box-shadow: inset 1px 0 0 var(--rule); }
.kpi .k { color: var(--muted); font-size: 13px; line-height: 18px; }
.kpi .v { font: 600 24px/30px var(--font); font-variant-numeric: tabular-nums; margin-top: 6px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .v.sm-v { font-size: 16px; }
.kpi .v .unit, .kpi .v .faint.light { font-size: 14px; font-weight: 500; color: var(--faint); margin-left: 4px; letter-spacing: 0; }
.kpi .s { color: var(--faint); font-size: 12px; margin-top: 2px; }

/* Count cards that filter a list */
.counts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: var(--gap); }
.count { height: 62px; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1.5px solid transparent; text-align: left; color: var(--text); transition: background .15s, border-color .15s; }
.count .k { color: var(--muted); font-size: 13px; line-height: 16px; display: block; }
.count .v { font: 600 16px/20px var(--font); font-variant-numeric: tabular-nums; display: block; margin-top: 4px; }
.count:hover { background: var(--raised); }
.count[aria-pressed='true'] { border-color: var(--accent); background: var(--accent-soft); }

/* Pills: inside rows and beside values only */
.pill { display: inline-flex; flex: none; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px; font: 500 12px/1 var(--font); background: var(--pill-neutral-bg); color: var(--pill-neutral-ink); white-space: nowrap; vertical-align: middle; }
.pill.pos { background: var(--pill-positive-bg); color: var(--pill-positive-ink); }
.pill.neg { background: var(--pill-negative-bg); color: var(--pill-negative-ink); }
.pill.warn { background: var(--pill-warning-bg); color: var(--pill-warning-ink); }
.pill.live { background: var(--pill-accent-bg); color: var(--pill-accent-ink); }
.pill.live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: blink 2s infinite; }
@keyframes blink { 50% { opacity: .35; } }

/* Lists and tables: rules and alignment */
.rows { display: grid; }
.row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; min-height: 64px; padding: 10px var(--pad); box-shadow: inset 0 -1px 0 var(--rule); color: var(--text); text-decoration: none !important; transition: background .15s; }
.row:last-child { box-shadow: none; }
a.row:hover, button.row:hover { background: rgba(255, 255, 255, .03); }
.row.two { grid-template-columns: minmax(0, 1fr) auto; }
.row.flat { padding-left: 0; padding-right: 0; }
.row .t { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .m { color: var(--muted); font-size: 13px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .r { text-align: right; font-variant-numeric: tabular-nums; }
.row .r .m { text-align: right; }
.table-wrap { overflow-x: auto; margin-top: 6px; }
.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th { text-align: left; color: var(--faint); font: 500 12px/16px var(--font); padding: 12px 12px 10px; }
.table td { padding: 14px 12px; box-shadow: inset 0 -1px 0 var(--rule); vertical-align: middle; }
.table tr:last-child td { box-shadow: none; }
.table .n, .table th.n { text-align: right; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover td { background: rgba(255, 255, 255, .025); }
.table a { font-weight: 500; }
.table .pl { padding-left: var(--pad); } .table .pr { padding-right: var(--pad); }
.table .right { text-align: right; } .table .w-rounds { width: 140px; }
.rank { color: var(--faint); width: 28px; }
.party-cell { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--text); text-decoration: none !important; }
.party-cell .meta { min-width: 0; }
.party-cell .t { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.party-cell .m { color: var(--muted); font-size: 13px; }
.show-xs { display: none; }
.bar { height: 4px; border-radius: 4px; background: var(--raised); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }

/* ---------- The pool: the live SatRush board (signature element) ---------- */
#live-root { display: flex; flex-direction: column; }
#live-root .vault-strip { margin-top: auto; padding-top: 16px; }
.round { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.round .pot { font: 600 32px/36px var(--font); letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 4px; }
.round .pot.off { font-size: 20px; line-height: 26px; letter-spacing: -.01em; }
.round .meta { color: var(--muted); margin-top: 6px; display: flex; gap: 14px; flex-wrap: wrap; }
.round .clock { text-align: right; }
.round .clock b { font: 600 24px/30px var(--font); font-variant-numeric: tabular-nums; }
.reveal-line { color: var(--text); font-weight: 500; animation: drop .3s var(--ease); }
.reveal-line.hit { color: var(--accent); }
.timebar { height: 4px; border-radius: 4px; background: var(--raised); margin: 16px 0; overflow: hidden; }
.timebar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 1s linear; }
.board-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.tile { position: relative; aspect-ratio: 1 / .92; min-height: 0; padding: 8px 9px; border: 0; border-radius: var(--radius-tile); background: var(--raised); color: var(--text); display: flex; flex-direction: column; justify-content: space-between; text-align: left; overflow: hidden; transition: transform .15s var(--ease), background .2s; isolation: isolate; }
.tile::before { content: ''; position: absolute; inset: 0; background: var(--accent); opacity: var(--heat, 0); z-index: -1; }
button.tile:hover { transform: translateY(-2px); background: var(--active); }
button.tile:active { transform: scale(.97); }
.tile .id { color: var(--faint); font: 500 11px/1 var(--font); font-variant-numeric: tabular-nums; }
.tile .v { font: 600 14px/1 var(--font); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.tile .v .short { display: none; }
.tile .w { color: var(--muted); font: 500 11px/1 var(--font); font-variant-numeric: tabular-nums; }
.tile.mine { box-shadow: inset 0 0 0 1.5px var(--accent); }
.tile.mine .id { color: var(--accent); }
.tile.won { box-shadow: inset 0 0 0 1.5px var(--text); }
.tile.won .w { color: var(--text); }
.tile.mine.won { box-shadow: inset 0 0 0 1.5px var(--text), inset 0 0 0 3px var(--accent); }
.tile.flash { animation: flash .9s var(--ease); }
.tile.reveal { animation: reveal 1.4s var(--ease) 2; }
@keyframes flash { 0% { background: #3a4048; } 100% { background: var(--raised); } }
@keyframes reveal { 0% { transform: scale(1); } 30% { transform: scale(1.08); background: #3a4048; } 100% { transform: scale(1); } }
.board-foot { display: flex; gap: 8px 18px; flex-wrap: wrap; margin-top: 14px; color: var(--muted); font-size: 12px; }
.board-foot span { display: inline-flex; align-items: center; gap: 6px; }
.key { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.key.heat { background: var(--accent); opacity: .5; } .key.mine { box-shadow: inset 0 0 0 1.5px var(--accent); } .key.won { box-shadow: inset 0 0 0 1.5px var(--text); }
.winners { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin-top: 14px; }
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip { min-width: 28px; height: 24px; padding: 0 6px; border-radius: 7px; background: var(--raised); color: var(--muted); font: 500 12px/24px var(--font); text-align: center; font-variant-numeric: tabular-nums; }
.chip.latest { box-shadow: inset 0 0 0 1.5px var(--text); color: var(--text); }
.chip.hit { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.vault-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.vault-strip .panel { display: grid; gap: 2px; align-content: start; }
.jackpot b { font: 600 20px/26px var(--font); font-variant-numeric: tabular-nums; }
.jackpot .short { display: none; }

/* ---------- Home ---------- */
.intro { display: grid; gap: 20px; align-items: end; margin: 8px 0 24px; grid-template-columns: minmax(0, 1fr); }
.intro h1 { font-size: 32px; line-height: 38px; letter-spacing: -.025em; max-width: 20ch; }
.intro p { margin: 10px 0 0; color: var(--muted); font-size: 16px; line-height: 24px; max-width: 54ch; }
.pot-line { font: 600 24px/30px var(--font); letter-spacing: -.01em; }
.podium { display: grid; }
.place { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; min-height: 44px; box-shadow: inset 0 -1px 0 var(--rule); font-size: 13px; }
.place:last-child { box-shadow: none; }
.place .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; font-size: 14px; }
.place b { text-align: right; font-weight: 600; }
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.steps b { display: block; font-weight: 600; margin: 0 0 6px; }
.steps p { margin: 0; color: var(--muted); font-size: 13px; line-height: 19px; }

/* ---------- Party ---------- */
.object { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.cover { width: 50px; height: 62px; border-radius: 8px; background: var(--raised); padding: 5px; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(7, 1fr); gap: 2px; flex-shrink: 0; }
.cover i { border-radius: 1.5px; background: #33373d; transition: background .15s; }
.cover i.on { background: var(--accent); }
.object .name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.object .meta { color: var(--muted); font-size: 13px; margin-top: 6px; display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; }
.object .actions { margin-left: auto; }
.desc { margin: 16px 0 0; max-width: 72ch; }
.autominer { display: flex; flex-direction: column; }
.autominer .card-head { margin-bottom: 14px; }
.segs { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; margin: 0 0 16px; }
.segs i { height: 4px; border-radius: 4px; background: var(--raised); }
.segs i.on { background: var(--accent); opacity: .55; }
.segs i.now { opacity: 1; animation: blink 2s infinite; }
.am-tiles { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-bottom: 4px; }
.am-tiles span { height: 30px; display: grid; place-items: center; border-radius: 8px; background: var(--raised); color: var(--faint); font: 500 12px/1 var(--font); font-variant-numeric: tabular-nums; }
.am-tiles span.on { background: var(--pill-accent-bg); color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); font-weight: 600; }
.am-foot { margin-top: auto; }
.am-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-top: 16px; }
.am-actions.one { grid-template-columns: 1fr; }
.am-actions .btn { width: 100%; height: 44px; }
.am-actions .pill, .am-wait { justify-self: center; align-self: center; }
.am-votes { margin-top: 12px; }
.am-note { margin: 14px 0 0; }
.am-error { color: var(--warning); margin: 12px 0 0; overflow-wrap: anywhere; }
.reward-amts { display: flex; gap: 24px; flex-wrap: wrap; }
.reward-amts div { display: grid; gap: 2px; }
.reward-amts b { font: 600 20px/26px var(--font); font-variant-numeric: tabular-nums; }
.reward-amts span { color: var(--muted); font-size: 12px; }
.votes { display: flex; gap: 4px; align-items: center; }
.votes i { width: 22px; height: 6px; border-radius: 3px; background: var(--raised); }
.votes i.y { background: var(--accent); }
.votes i.need { background: #33373d; }
.votes .xs { margin-left: 8px; }
.vote-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.chart-empty { margin: 0; padding: 40px 0; }
.invite-foot { width: 100%; display: grid; gap: 10px; }
/* Hashrate: the party wallet's HR, your share, and the vaults it can enter. */
.hr-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; }
.hr-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.hr-big { display: flex; align-items: baseline; gap: 10px; }
.hr-big b { font: 600 32px/38px var(--font); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.hr-big span { color: var(--muted); font-size: 13px; }
.hr-actions { margin-top: auto; padding-top: 4px; }
.hr-actions .btn { flex: 1; height: 44px; }
.hr-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.vault-mini { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.vault-mini .panel { display: grid; gap: 2px; align-content: start; }
.vault-mini b { font: 600 20px/26px var(--font); font-variant-numeric: tabular-nums; }
.hr-entries { margin: 0 calc(-1 * var(--pad)); }
.hr-entries .row { min-height: 56px; }
.entry-r { display: grid; justify-items: end; gap: 4px; }
.top-rule { box-shadow: inset 0 1px 0 var(--rule); padding-top: 18px; }
.card-total { width: 100%; display: flex; justify-content: space-between; align-items: baseline; padding-top: 14px; box-shadow: inset 0 1px 0 var(--rule); }
.card-total b { font-weight: 600; }
.back-row { display: grid; gap: 8px; margin-top: 14px; }
.back-list { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.back { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.back .av { width: 24px; height: 24px; font-size: 11px; }

/* ---------- Forms ---------- */
.field { display: grid; gap: 8px; margin-bottom: 16px; }
.field > span, .field > label { color: var(--muted); font-size: 13px; font-weight: 500; }
.field small { color: var(--faint); font-size: 12px; }
/* 16px text: iPhones zoom into any field set smaller when it's tapped. */
.input { width: 100%; height: 44px; padding: 0 14px; background: var(--raised); border: 1px solid transparent; border-radius: 12px; color: var(--text); font: 400 16px/1 var(--font); transition: border-color .15s, background .15s; }
.input:hover { background: var(--active); }
.input::placeholder { color: var(--faint); }
.input:focus { outline: none; border-color: var(--control); background: var(--raised); }
.input.num { font-variant-numeric: tabular-nums; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5l5-5' stroke='%23b4b4b4' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.fields-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form .input { flex: 1; min-width: 0; }
.name-form .input { width: 240px; flex: none; }
.choice { display: grid; gap: 8px; }
.option { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; padding: 14px 16px; border-radius: 14px; background: var(--raised); border: 1.5px solid transparent; cursor: pointer; transition: background .15s, border-color .15s; }
.option:hover { background: var(--active); }
.option input { position: absolute; opacity: 0; }
.option .dot { grid-row: span 2; width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--control); margin-top: 1px; transition: box-shadow .15s; }
.option b { font-weight: 600; } .option small { color: var(--muted); font-size: 13px; line-height: 18px; }
.option:has(input:checked) { border-color: var(--text); }
.option:has(input:checked) .dot { box-shadow: inset 0 0 0 5px var(--text); }
.option:has(input:focus-visible) { outline: 2px solid var(--text); outline-offset: 2px; }
.picker { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; max-width: 440px; }
.pick { height: 40px; border: 0; border-radius: 10px; background: var(--raised); color: var(--muted); font: 500 13px/1 var(--font); font-variant-numeric: tabular-nums; transition: background .12s, color .12s, transform .12s var(--ease); }
button.pick:hover { background: var(--active); color: var(--text); }
button.pick:active { transform: scale(.94); }
.pick[aria-pressed='true'] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.picker.static { max-width: none; }
.picker.static .pick { display: grid; place-items: center; }
.summary { display: grid; gap: 0; }
.summary div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 12px 0; box-shadow: inset 0 -1px 0 var(--rule); font-size: 14px; }
.summary div:last-child { box-shadow: none; }
.summary span { color: var(--muted); } .summary b { font-weight: 500; text-align: right; }
.summary.cols { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
.summary.cols div:nth-last-child(2) { box-shadow: none; }
.narrow { max-width: 640px; } .short { max-width: 260px; }
/* Create: the preview of the party being made stays beside the form. */
.preview-col { min-width: 0; }
.preview { position: sticky; top: calc(var(--bar-h) + 16px); }
.pv-head { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.pv-head .cell { display: grid; gap: 2px; }
.pv-name { font: 600 16px/22px var(--font); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Layers: dialogs, sheets and toasts float, so they carry a shadow ---------- */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .6); opacity: 0; animation: fade .18s var(--ease) forwards; }
@keyframes fade { to { opacity: 1; } }
.dialog { position: fixed; z-index: 70; left: 50%; top: 50%; width: min(460px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); overflow: auto; background: var(--surface); border-radius: var(--radius-card); padding: 24px; box-shadow: 0 24px 60px rgba(0, 0, 0, .55); transform: translate(-50%, -48%); opacity: 0; animation: pop .22s var(--ease) forwards; }
@keyframes pop { to { transform: translate(-50%, -50%); opacity: 1; } }
.dialog h2 { margin-bottom: 8px; } .dialog > p, .dialog .lead { color: var(--muted); margin: 0 0 16px; }
.dialog .btn-row { margin-top: 20px; justify-content: flex-end; }
.sheet { position: fixed; z-index: 61; left: 0; right: 0; bottom: 0; max-height: 90dvh; overflow: auto; background: var(--surface); border-radius: 22px 22px 0 0; padding: 10px 16px calc(24px + env(safe-area-inset-bottom)); transform: translateY(100%); animation: rise .26s var(--ease) forwards; box-shadow: 0 -20px 50px rgba(0, 0, 0, .5); }
@keyframes rise { to { transform: none; } }
.sheet .grab { width: 40px; height: 4px; border-radius: 4px; background: var(--control); margin: 4px auto 14px; }
.sheet-inner { max-width: 560px; margin: 0 auto; }
.sheet-nav { display: grid; }
.sheet nav a { display: flex; align-items: center; min-height: 52px; padding: 0 4px; box-shadow: inset 0 -1px 0 var(--rule); font-weight: 500; font-size: 16px; }
.sheet-user { display: flex; align-items: center; gap: 12px; padding: 4px 4px 16px; text-decoration: none !important; }
.sheet-user .av { width: 44px; height: 44px; font-size: 16px; }
.sheet-user .cell { display: grid; gap: 2px; }
.sheet-user b { font: 600 16px/22px var(--font); }
.stack-sm { display: grid; gap: 8px; }
.share { display: flex; gap: 8px; align-items: center; min-width: 0; padding: 4px 4px 4px 14px; border-radius: 999px; background: var(--raised); }
.share span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 13px; }
.share .btn { flex-shrink: 0; }
.toasts { position: fixed; z-index: 80; left: 50%; bottom: 24px; transform: translateX(-50%); width: min(420px, calc(100vw - 32px)); display: grid; gap: 8px; pointer-events: none; }
.toast { padding: 12px 16px; border-radius: 14px; background: var(--text); color: #000; font-weight: 500; box-shadow: 0 16px 40px rgba(0, 0, 0, .5); pointer-events: auto; animation: drop .25s var(--ease); }
.toast.bad { background: #2c1a20; color: #ffb3c0; }
@keyframes drop { from { transform: translateY(8px); opacity: 0; } }
.burst { position: fixed; inset: 0; pointer-events: none; z-index: 90; overflow: hidden; }
.burst i { position: absolute; left: 50%; top: 45%; width: 6px; height: 10px; border-radius: 2px; }
#layer.closing .scrim { animation: fadeout .14s var(--ease) forwards; }
#layer.closing .dialog { animation: popout .14s var(--ease) forwards; }
#layer.closing .sheet { animation: sink .16s var(--ease) forwards; }
@keyframes fadeout { from { opacity: 1; } to { opacity: 0; } }
@keyframes popout { from { opacity: 1; transform: translate(-50%, -50%); } to { opacity: 0; transform: translate(-50%, -48%); } }
@keyframes sink { from { transform: none; } to { transform: translateY(100%); } }

/* ---------- Page changes: a short native cross-fade; the bars stay put ---------- */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .16s; animation-timing-function: var(--ease); }
::view-transition-group(topbar), ::view-transition-group(tabbar) { animation: none; }

/* ---------- Widths ---------- */
@media (min-width: 900px) {
  .nav { display: flex; }
  .intro { grid-template-columns: minmax(0, 1fr) auto; }
}
@media (max-width: 899px) {
  :root { --gutter: 16px; --pad: 18px; --gap: 14px; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .c2, .c3, .c4, .c6 { grid-column: 1 / -1; }
  .side-stack .card.fill { flex: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis .kpi:nth-child(3) { box-shadow: inset 0 1px 0 var(--rule); }
  .kpis .kpi:nth-child(4) { box-shadow: inset 1px 0 0 var(--rule), inset 0 1px 0 var(--rule); }
  .kpis.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpis.k3 .kpi:nth-child(3) { box-shadow: inset 1px 0 0 var(--rule); }
  .counts { display: flex; overflow-x: auto; scrollbar-width: none; margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter)); padding: 0 var(--gutter); }
  .counts .count { flex: 0 0 auto; min-width: 116px; }
  .account .bal, .account .nm { display: none; }
  .account { padding: 0 6px; }
  .account.signed-out { padding: 0 16px; }
  .hide-sm { display: none; }
  .table th, .table td { padding-left: 8px; padding-right: 8px; }
  .tile { padding: 6px; aspect-ratio: 1 / 1.05; }
  .tile .v { font-size: 12px; }
  .tile .v .full { display: none; } .tile .v .short { display: inline; }
  .tile .w { display: none; }
  .jackpot b { font-size: 16px; line-height: 22px; } .jackpot .xs { display: none; }
  .jackpot .full { display: none; } .jackpot .short { display: inline; }
  .object .actions { margin-left: 0; width: 100%; }
  .name-form { width: 100%; } .name-form .input { width: auto; flex: 1; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary.cols { grid-template-columns: 1fr; } .summary.cols div:nth-last-child(2) { box-shadow: inset 0 -1px 0 var(--rule); }
  .hr-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .hr-big b { font-size: 28px; line-height: 34px; }
  .preview { position: static; }
  .intro h1 { font-size: 28px; line-height: 34px; }
  /* The tab bar replaces the hamburger: Pool, Parties, Create, Ranks, Menu. */
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--ground); box-shadow: inset 0 1px 0 var(--border); view-transition-name: tabbar; }
  .tabbar a, .tabbar button { display: grid; justify-items: center; align-content: center; gap: 4px; border: 0; background: none; color: var(--faint); font: 500 11px/1 var(--font); text-decoration: none !important; transition: color .15s; }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar .on { color: var(--text); }
  .tabbar a:active svg, .tabbar button:active svg { transform: scale(.9); }
  .main { padding-top: 16px; padding-bottom: calc(var(--tab-h) + 48px + env(safe-area-inset-bottom)); }
  .footer { padding-bottom: calc(var(--tab-h) + 24px + env(safe-area-inset-bottom)); }
  .toasts { bottom: calc(var(--tab-h) + 12px + env(safe-area-inset-bottom)); }
}
@media (max-width: 640px) {
  .hide-xs { display: none; }
  .show-xs { display: inline; }
  .table .av.party { display: none; }
  .title-row .btn-row { width: 100%; }
  .title-row .btn-row .btn { flex: 1; }
  .seg .full { display: none; } .seg .short { display: inline; }
  /* Three KPIs don't fit a phone row: two side by side, the third full width. */
  .kpis.k3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis.k3 .kpi:nth-child(3) { grid-column: 1 / -1; box-shadow: inset 0 1px 0 var(--rule); }
}
@media (max-width: 420px) { .fields-2 { grid-template-columns: 1fr; } .kpi .v { font-size: 20px; } .vault-strip { gap: 6px; } .vault-strip .panel { padding: 10px 12px; } .kpi { padding: 16px var(--pad); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* Deploy rules: preset cards, then three groups of optional rules. */
.presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.preset { display: grid; gap: 4px; align-content: start; text-align: left; padding: 12px 14px; border-radius: 14px; border: 1.5px solid transparent; background: var(--raised); color: var(--text); font: inherit; cursor: pointer; transition: background .15s, border-color .15s; }
.preset:hover { background: var(--active); }
.preset b { font-weight: 600; font-size: 14px; }
.preset small { color: var(--muted); font-size: 12px; line-height: 16px; }
.preset[aria-pressed='true'] { border-color: var(--text); }
.preset:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.rl-body { margin-top: 16px; display: grid; gap: 14px; }
.rl-group { border: 0; margin: 0; padding: 16px; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--rule); min-width: 0; }
.rl-group legend { float: left; width: 100%; padding: 0; margin-bottom: 12px; font-weight: 600; font-size: 14px; color: var(--text); }
.rl-match { margin-bottom: 14px; }
.rl-grid { clear: both; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.rl { display: grid; gap: 6px; align-content: start; min-width: 0; }
.rl-label { color: var(--text); font-size: 13px; font-weight: 500; }
.rl small { color: var(--faint); font-size: 12px; line-height: 16px; }
.rl-now { color: var(--muted); white-space: nowrap; }
.rl-input { position: relative; display: flex; align-items: center; }
.rl-input .input { width: 100%; }
.rl-input i { position: absolute; left: 12px; font-style: normal; color: var(--muted); pointer-events: none; }
.rl-input i + .input { padding-left: 24px; }
.rl-input em { position: absolute; right: 12px; font-style: normal; color: var(--faint); font-size: 12px; pointer-events: none; }
.rl-input .input::placeholder { color: var(--faint); }
.rl-hours { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.rl-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.rl-days .pick { height: 34px; font-size: 12px; }
.rl-bool { grid-template-columns: auto 1fr; column-gap: 10px; cursor: pointer; }
.rl-bool input { position: absolute; opacity: 0; }
.rl-bool .rl-check { grid-row: span 2; width: 18px; height: 18px; margin-top: 1px; border-radius: 6px; box-shadow: inset 0 0 0 1.5px var(--control); transition: box-shadow .15s, background .15s; }
.rl-bool input:checked + .rl-check { background: var(--text); box-shadow: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.rl-bool input:focus-visible + .rl-check { outline: 2px solid var(--text); outline-offset: 2px; }
.rl-dot { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--control); vertical-align: 1px; }
.rl-dot.ok { background: var(--accent); }
@media (max-width: 640px) {
  .presets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rl-grid { grid-template-columns: minmax(0, 1fr); }
  .rl-group { padding: 14px; }
}
