/* =============================================================================
   Parions Potes — styles.css
   A trading floor for people who are not traders: dark, dense, live.
   Phone first (this gets used in an amphi, under a desk), no framework, no CDN,
   no external fonts. Everything below is one system: tokens, then components.
   ========================================================================== */

/* ---------------------------------------------------------------- tokens -- */

:root {
  /* Surfaces — near-black, warmed by a hint of blue so green/red stay honest. */
  --bg: #06080c;
  --bg-glow: #0b1017;
  --surface: #111620;
  --surface-2: #171d2a;
  --surface-3: #1e2635;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .13);

  /* Ink */
  --text: #e9eef7;
  --muted: #8e99ad;
  --dim: #5b6579;

  /* The only two colours that matter */
  --yes: #17d989;
  --yes-ink: #0b2f22;
  --yes-soft: rgba(23, 217, 137, .14);
  --no: #ff4d6d;
  --no-ink: #360913;
  --no-soft: rgba(255, 77, 109, .14);

  /* Money and attention */
  --gold: #ffc954;
  --gold-soft: rgba(255, 201, 84, .13);
  --focus: #7dd3ff;

  --radius: 16px;
  --radius-sm: 11px;
  --radius-lg: 22px;

  --tap: 48px;                       /* never smaller than a thumb */
  --pad: 16px;
  --shell: 640px;

  --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 12px 30px -18px #000;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --tabbar-h: calc(60px + var(--safe-b));

  --ease: cubic-bezier(.22, .78, .28, 1);
}

/* ------------------------------------------------------------------ base -- */

*, *::before, *::after { box-sizing: border-box; }

/* `hidden` must win over the display values set below — the tab bar, the sheet and the
   payout overlay are all laid out with flex/grid and would otherwise ignore it. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  max-width: 100%;
  overflow-x: hidden;                /* an amphi phone never scrolls sideways */
}

html { -webkit-text-size-adjust: 100%; }

body {
  min-height: 100dvh;
  background:
    radial-gradient(120% 60% at 50% -10%, var(--bg-glow) 0%, transparent 70%),
    var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}

h1, h2, h3, p, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

a { color: inherit; text-decoration: none; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 8px; left: 8px;
  z-index: 90;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--gold);
  color: #201400;
  font-weight: 700;
  transform: translateY(-160%);
  transition: transform .18s var(--ease);
}
.skip-link:focus { transform: translateY(0); }

/* Focus: one ring, everywhere, impossible to miss. */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}

::selection { background: var(--gold); color: #201400; }

/* --------------------------------------------------------------- app bar -- */

.appbar {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: calc(var(--safe-t) + 10px) calc(var(--pad) + var(--safe-r)) 10px calc(var(--pad) + var(--safe-l));
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}

.appbar-in {
  max-width: var(--shell);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.brand-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-sub {
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--dim);
}

.chip-code {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 10px;
  border: 1px dashed var(--line-2);
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .1em;
  cursor: pointer;
}
.chip-code svg { width: 15px; height: 15px; }
.chip-code:active { background: var(--surface-2); }
.chip-code.is-done { color: var(--yes); border-color: var(--yes); border-style: solid; }

.purse {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.1;
}
.purse-value {
  font-size: 17px;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: -.01em;
}
.purse-label {
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dim);
}
.purse-value.bump { animation: bump .5s var(--ease); }
@keyframes bump {
  0% { transform: scale(1); }
  35% { transform: scale(1.16); }
  100% { transform: scale(1); }
}

/* --------------------------------------------------------------- tab bar -- */

.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 45;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 6px calc(8px + var(--safe-r)) calc(6px + var(--safe-b)) calc(8px + var(--safe-l));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px) saturate(140%);
  border-top: 1px solid var(--line);
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: var(--tap);
  padding: 6px 4px;
  border-radius: 12px;
  color: var(--dim);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .01em;
  transition: color .15s var(--ease), background .15s var(--ease);
}
.tab-ico { width: 22px; height: 22px; }
.tab[aria-current="page"] { color: var(--text); background: var(--surface); }
.tab[aria-current="page"] .tab-ico { color: var(--gold); }
.tab:active { background: var(--surface-2); }

/* ----------------------------------------------------------------- shell -- */

.view {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 14px calc(var(--pad) + var(--safe-r)) calc(var(--tabbar-h) + 28px) calc(var(--pad) + var(--safe-l));
}
.view:focus { outline: none; }
body.no-tabbar .view { padding-bottom: calc(28px + var(--safe-b)); }

.stack { display: grid; gap: 12px; }
.stack-lg { display: grid; gap: 20px; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 22px 2px 10px;
}
.section-head:first-child { margin-top: 4px; }
.section-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}
.section-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--dim);
}
.section-rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}

/* --------------------------------------------------------------- buttons -- */

.btn {
  --btn-bg: var(--surface-2);
  --btn-fg: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 12px 18px;
  border: 1px solid var(--line-2);
  border-radius: 13px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.01em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s var(--ease), filter .15s var(--ease), background .15s var(--ease);
}
.btn:active { transform: scale(.975); filter: brightness(1.1); }
.btn[disabled] { opacity: .4; cursor: not-allowed; transform: none; }
.btn svg { width: 18px; height: 18px; }

.btn-block { width: 100%; }

.btn-primary {
  --btn-bg: linear-gradient(180deg, #ffd97a, var(--gold));
  --btn-fg: #241700;
  border-color: transparent;
  font-weight: 800;
}
.btn-yes { --btn-bg: var(--yes); --btn-fg: var(--yes-ink); border-color: transparent; font-weight: 800; }
.btn-no  { --btn-bg: var(--no);  --btn-fg: #fff;           border-color: transparent; font-weight: 800; }
.btn-ghost { --btn-bg: transparent; border-color: var(--line-2); color: var(--muted); }
.btn-danger { --btn-bg: transparent; border-color: var(--no); color: var(--no); }

.btn-icon {
  width: var(--tap);
  min-width: var(--tap);
  height: var(--tap);
  padding: 0;
  border-radius: 13px;
}

.link-btn {
  border: 0;
  background: none;
  padding: 8px 2px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* ------------------------------------------------------------ onboarding -- */

.hero-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 26px 0 4px;
}
.hero-bars { display: flex; gap: 4px; align-items: flex-end; height: 34px; }
.hero-bars i { width: 8px; border-radius: 3px; display: block; }
.hero-bars i:nth-child(1) { height: 34px; background: var(--yes); }
.hero-bars i:nth-child(2) { height: 20px; background: var(--no); }
.hero-bars i:nth-child(3) { height: 27px; background: var(--yes); opacity: .55; }

.hero-title {
  font-size: clamp(30px, 9vw, 40px);
  font-weight: 900;
  letter-spacing: -.035em;
  line-height: 1;
}
.hero-title em { font-style: normal; color: var(--gold); }

.hero-tag {
  margin-top: 12px;
  color: var(--muted);
  font-size: 16px;
  max-width: 34ch;
}
.hero-note {
  margin-top: 8px;
  color: var(--dim);
  font-size: 13px;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin: 26px 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.segmented button {
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}
.segmented button[aria-selected="true"] { background: var(--surface-3); color: var(--text); }

.field { display: grid; gap: 7px; }
.field > label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.field input, .field textarea, .field select {
  width: 100%;
  min-height: var(--tap);
  padding: 12px 14px;
  border: 1px solid var(--line-2);
  border-radius: 13px;
  background: var(--surface);
  color: var(--text);
  font-size: 16px;                   /* 16px or iOS zooms on focus */
}
.field textarea { min-height: 92px; resize: vertical; line-height: 1.4; }
.field input::placeholder, .field textarea::placeholder { color: var(--dim); }
.field input:focus, .field textarea:focus { border-color: var(--focus); outline: none; box-shadow: 0 0 0 3px rgba(125, 211, 255, .16); }
.field .hint { font-size: 12px; color: var(--dim); }
.code-input {
  text-transform: uppercase;
  letter-spacing: .34em;
  font-weight: 800;
  font-size: 22px !important;
  text-align: center;
}

/* ---------------------------------------------------------- market cards -- */

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), var(--bg-glow));
  box-shadow: var(--shadow);
}

.mcard {
  display: block;
  width: 100%;
  text-align: left;
  padding: 14px 14px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), var(--bg-glow));
  box-shadow: var(--shadow);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .13s var(--ease), border-color .15s var(--ease);
}
.mcard:active { transform: scale(.985); border-color: var(--line-2); }

.mcard-q {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -.015em;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mcard-body {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  margin: 12px 0 10px;
}

.pct {
  display: flex;
  align-items: baseline;
  gap: 2px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.045em;
  line-height: .86;
  color: var(--yes);
}
.pct-lg { font-size: clamp(40px, 13vw, 54px); }
.pct-xl { font-size: clamp(52px, 17vw, 72px); }
.pct sup {
  font-size: .34em;
  font-weight: 800;
  letter-spacing: 0;
  top: 0;
  align-self: flex-start;
  margin-left: 1px;
}
.pct-side {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding-bottom: 4px;
}
.pct-side b { color: var(--yes); }

.mcard-spark { margin-left: auto; width: 84px; height: 34px; }

/* Odds bar — the one graphic the whole app is built around. */
.odds {
  display: flex;
  height: 12px;
  border-radius: 99px;
  overflow: hidden;
  background: var(--no);
  isolation: isolate;
}
.odds-yes {
  height: 100%;
  background: linear-gradient(90deg, #0fbe76, var(--yes));
  border-right: 2px solid var(--bg);
  transition: width .55s var(--ease);
}
.odds-lg { height: 16px; }

.odds-legend {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  font-variant-numeric: tabular-nums;
}
.odds-legend .l-yes { color: var(--yes); }
.odds-legend .l-no { color: var(--no); }

.meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 11px;
  font-size: 12.5px;
  color: var(--dim);
}
.meta-row .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .6; }
.meta-row svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 3px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 99px;
  border: 1px solid var(--line-2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.badge-soon { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 45%, transparent); background: var(--gold-soft); }
.badge-wait { color: #b39bff; border-color: rgba(179, 155, 255, .4); background: rgba(179, 155, 255, .12); }
.badge-yes { color: var(--yes); border-color: color-mix(in srgb, var(--yes) 45%, transparent); background: var(--yes-soft); }
.badge-no { color: var(--no); border-color: color-mix(in srgb, var(--no) 45%, transparent); background: var(--no-soft); }
.badge-void { color: var(--muted); }
.badge-mine { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 40%, transparent); }

.mcard.is-resolved { opacity: .82; }
.mcard.is-resolved .pct { color: var(--muted); }

/* ------------------------------------------------------------ empty/error -- */

.empty {
  padding: 34px 20px;
  text-align: center;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  color: var(--muted);
}
.empty strong { display: block; color: var(--text); font-size: 16px; margin-bottom: 6px; }
.empty p { font-size: 14px; }

.skeleton {
  height: 132px;
  border-radius: var(--radius);
  background: linear-gradient(100deg, var(--surface) 30%, var(--surface-3) 50%, var(--surface) 70%);
  background-size: 260% 100%;
  animation: shimmer 1.3s linear infinite;
}
@keyframes shimmer { from { background-position: 140% 0; } to { background-position: -40% 0; } }

/* --------------------------------------------------------- market detail -- */

.detail-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.mq {
  font-size: clamp(21px, 6.2vw, 27px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.025em;
  overflow-wrap: anywhere;
}

.hero-odds {
  padding: 18px 16px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 120% at 0% 0%, var(--yes-soft), transparent 55%),
    radial-gradient(120% 120% at 100% 100%, var(--no-soft), transparent 55%),
    var(--surface);
}
.hero-odds-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.hero-move {
  font-size: 12.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  padding-bottom: 6px;
}
.up { color: var(--yes); }
.down { color: var(--no); }
.flat { color: var(--dim); }

.spark { width: 100%; height: 58px; display: block; margin: 14px 0 2px; overflow: visible; }
.spark-empty { color: var(--dim); font-size: 12.5px; text-align: center; padding: 14px 0 4px; }

/* Bet panel */
.panel {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.panel-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 11px;
}

.side-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.side-btn {
  position: relative;
  min-height: 62px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 1.5px solid var(--line-2);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 900;
  font-size: 17px;
  letter-spacing: .04em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s var(--ease), border-color .15s var(--ease), background .15s var(--ease), color .15s var(--ease);
}
.side-btn small { font-size: 12px; font-weight: 700; letter-spacing: 0; opacity: .85; font-variant-numeric: tabular-nums; }
.side-btn:active { transform: scale(.97); }
.side-btn[aria-pressed="true"][data-side="YES"] { background: var(--yes-soft); border-color: var(--yes); color: var(--yes); }
.side-btn[aria-pressed="true"][data-side="NO"] { background: var(--no-soft); border-color: var(--no); color: var(--no); }

.amounts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.amt {
  min-height: 46px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 800;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s var(--ease), background .15s var(--ease);
}
.amt:active { transform: scale(.95); }
.amt[aria-pressed="true"] { background: var(--gold); color: #241700; border-color: transparent; }
.amt[disabled] { opacity: .35; }
.amt-all { font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }

.preview {
  margin-top: 12px;
  padding: 12px;
  border-radius: 13px;
  background: var(--bg);
  border: 1px solid var(--line);
  display: grid;
  gap: 9px;
}
.preview-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.preview-gain {
  font-size: 27px;
  font-weight: 900;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  color: var(--gold);
}
.preview-mult {
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.preview-line { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.preview-line b { color: var(--text); font-weight: 700; }
.preview-warn { color: var(--no); font-size: 13px; font-weight: 700; }

.mine {
  display: grid;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--gold-soft), transparent);
}
.mine-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.mine-label { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 800; }
.mine-value { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.mine-sub { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Lists (trades, positions, leaderboard, portfolio) */
.rows { display: grid; gap: 1px; background: var(--line); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 13px;
  background: var(--surface);
  min-height: 56px;
}
.row-main { flex: 1; min-width: 0; }
.row-title { font-size: 14.5px; font-weight: 700; overflow-wrap: anywhere; }
.row-sub { font-size: 12.5px; color: var(--dim); font-variant-numeric: tabular-nums; }
.row-end { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-amount { font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.row.is-me { background: color-mix(in srgb, var(--gold) 7%, var(--surface)); }

.avatar {
  width: 34px; height: 34px;
  min-width: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .02em;
}
.rank {
  width: 26px;
  min-width: 26px;
  text-align: center;
  font-size: 14px;
  font-weight: 900;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}
.rank-1 { color: var(--gold); }
.rank-2 { color: #cfd6e4; }
.rank-3 { color: #d8a06a; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .04em;
}
.pill-yes { background: var(--yes-soft); color: var(--yes); }
.pill-no { background: var(--no-soft); color: var(--no); }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.stat {
  padding: 13px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  min-width: 0;
}
.stat-label {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-value {
  margin-top: 3px;
  font-size: clamp(17px, 5.4vw, 22px);
  font-weight: 800;
  letter-spacing: -.025em;
  font-variant-numeric: tabular-nums;
}
.stat-value.gold { color: var(--gold); }

/* --------------------------------------------------------- bottom sheet -- */

.sheet-root {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet-scrim {
  position: absolute;
  inset: 0;
  background: rgba(2, 4, 8, .66);
  backdrop-filter: blur(3px);
  animation: fade .2s var(--ease);
  border: 0;
  width: 100%;
}
.sheet {
  position: relative;
  width: 100%;
  max-width: var(--shell);
  max-height: 88dvh;
  overflow-y: auto;
  padding: 10px calc(var(--pad) + var(--safe-r)) calc(20px + var(--safe-b)) calc(var(--pad) + var(--safe-l));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border-top: 1px solid var(--line-2);
  background: var(--surface);
  box-shadow: 0 -20px 60px -20px #000;
  animation: sheet-up .3s var(--ease);
}
.sheet-grip {
  width: 40px; height: 4px;
  border-radius: 99px;
  background: var(--line-2);
  margin: 2px auto 14px;
}
.sheet h2 { font-size: 20px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 4px; }
.sheet .sheet-sub { color: var(--muted); font-size: 14px; margin-bottom: 16px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 42px;
  padding: 8px 14px;
  border: 1px solid var(--line-2);
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--gold); color: #241700; border-color: transparent; }

@keyframes sheet-up { from { transform: translateY(18%); opacity: .5; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* --------------------------------------------------------------- toasts -- */

.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + 12px);
  z-index: 70;
  transform: translateX(-50%);
  width: min(92vw, 460px);
  display: grid;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 12px 14px;
  border-radius: 13px;
  border: 1px solid var(--line-2);
  background: var(--surface-3);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 18px 40px -20px #000;
  animation: toast-in .24s var(--ease);
}
.toast-err { border-color: var(--no); background: color-mix(in srgb, var(--no) 20%, var(--surface-3)); }
.toast-ok { border-color: var(--yes); background: color-mix(in srgb, var(--yes) 18%, var(--surface-3)); }
@keyframes toast-in { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ------------------------------------------------- the payout moment --- */

.payout-root {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: calc(24px + var(--safe-t)) 20px calc(24px + var(--safe-b));
  overflow: hidden;
  animation: fade .2s var(--ease);
}
.payout-root.win { background: radial-gradient(90% 60% at 50% 42%, rgba(23, 217, 137, .22), rgba(3, 6, 10, .96) 70%), rgba(3, 6, 10, .97); }
.payout-root.loss { background: radial-gradient(90% 60% at 50% 42%, rgba(255, 77, 109, .18), rgba(3, 6, 10, .96) 70%), rgba(3, 6, 10, .97); }
.payout-root.void { background: rgba(3, 6, 10, .97); }

.payout {
  position: relative;
  z-index: 2;
  width: min(100%, 440px);
  text-align: center;
  display: grid;
  gap: 14px;
  justify-items: center;
}
.payout-kicker {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--muted);
}
.payout-title {
  font-size: clamp(30px, 10vw, 44px);
  font-weight: 900;
  letter-spacing: -.04em;
  line-height: .98;
}
.payout-amount {
  font-size: clamp(62px, 22vw, 108px);
  font-weight: 900;
  letter-spacing: -.06em;
  line-height: .92;
  font-variant-numeric: tabular-nums;
}
.win .payout-amount { color: var(--gold); text-shadow: 0 0 42px rgba(255, 201, 84, .45); animation: slam .55s var(--ease) both; }
.loss .payout-amount { color: var(--no); animation: slump .8s var(--ease) both; }
.void .payout-amount { color: var(--muted); }
.payout-q {
  font-size: 15px;
  color: var(--muted);
  max-width: 30ch;
  overflow-wrap: anywhere;
}
.payout-quip {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  max-width: 28ch;
}
.payout-detail {
  font-size: 13px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}
.payout .btn { margin-top: 6px; min-width: 210px; }

@keyframes slam {
  0% { transform: scale(2.4) rotate(-6deg); opacity: 0; filter: blur(6px); }
  60% { transform: scale(.92); opacity: 1; filter: blur(0); }
  80% { transform: scale(1.05); }
  100% { transform: scale(1); }
}
@keyframes slump {
  0% { transform: translateY(-26px) rotate(-3deg); opacity: 0; }
  55% { transform: translateY(6px) rotate(1deg); opacity: 1; }
  100% { transform: translateY(0) rotate(-1.5deg); opacity: 1; }
}

.confetti, .rain {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}
.confetti i {
  position: absolute;
  top: -12vh;
  left: var(--x);
  width: 9px;
  height: 15px;
  border-radius: 2px;
  background: var(--c);
  transform: rotate(var(--r));
  animation: fall var(--dur) linear var(--delay) forwards;
}
@keyframes fall {
  0% { transform: translateY(0) rotate(var(--r)); opacity: 1; }
  100% { transform: translateY(118vh) rotate(calc(var(--r) + 900deg)); opacity: .9; }
}
.rain i {
  position: absolute;
  top: -10vh;
  left: var(--x);
  font-size: var(--s);
  opacity: .8;
  animation: drift var(--dur) linear var(--delay) forwards;
}
@keyframes drift {
  0% { transform: translateY(0) rotate(0); opacity: 0; }
  12% { opacity: .85; }
  100% { transform: translateY(115vh) rotate(38deg); opacity: .1; }
}

/* --------------------------------------------------------------- footer -- */

.foot {
  margin-top: 26px;
  text-align: center;
  color: var(--dim);
  font-size: 12px;
  line-height: 1.6;
}

/* ------------------------------------------------------------- desktop -- */

@media (min-width: 700px) {
  .tabbar {
    left: 50%;
    right: auto;
    bottom: 18px;
    transform: translateX(-50%);
    width: min(var(--shell), 92vw);
    border: 1px solid var(--line-2);
    border-radius: 18px;
    padding: 6px;
  }
  .toasts { bottom: 96px; }
  .sheet { border-radius: var(--radius-lg); margin-bottom: 8vh; }
  .sheet-root { align-items: center; }
}

/* --------------------------------------------------- reduced motion --- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .confetti, .rain { display: none; }
  .btn:active, .mcard:active, .side-btn:active, .amt:active { transform: none; }
}

/* Windows high-contrast / forced colours: keep the semantics, drop the paint. */
@media (forced-colors: active) {
  .odds-yes { background: Highlight; }
  .mcard, .card, .panel, .row { border-color: CanvasText; }
}
