/* Football Cup — styles
 * Daylight-first: solid fills, ink on chalk, four role colours.
 *   turf  = offense / app chrome     navy = defense
 *   red   = money INTO the cup       gold = money OUT of the cup
 */
:root {
  color-scheme: light;
  --bg: #FFFFFF;
  --ink: #0F1A14;
  --muted: #4A5A50;
  --faint: #7C8A81;
  --line: #D5DDD8;
  --surface: #F1F5F2;
  --surface-2: #E3EAE5;
  --turf: #115E33;
  --turf-ink: #FFFFFF;
  --navy: #1E3A5F;
  --navy-ink: #FFFFFF;
  --red: #B3122E;
  --red-ink: #FFFFFF;
  --gold: #F2C230;
  --gold-ink: #0F1A14;
  --gold-deep: #C99A12;
  --felt: #146B3A;
  --felt-hi: #23874D;
  --rail: #3E2814;
  --rail-line: #C99A12;
  --seat-bg: #FFFFFF;
  --seat-ink: #0F1A14;
  --scrim: rgba(15, 26, 20, 0.55);
  --shadow: 0 -2px 0 var(--line);
  --display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", "Helvetica Neue", Impact, sans-serif;
  --body: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 10px;
  --tap: 56px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0B1A11;
    --ink: #F3F7F4;
    --muted: #B3C2B8;
    --faint: #7E9086;
    --line: #26402F;
    --surface: #13261B;
    --surface-2: #1B3324;
    --turf: #1B7A43;
    --navy: #35619A;
    --red: #C81F39;
    --gold: #F5C842;
    --gold-deep: #E0B024;
    --felt: #0E4A28;
    --felt-hi: #1A6E3C;
    --rail: #2A1A0C;
    --rail-line: #E0B024;
    --seat-bg: #F3F7F4;
    --seat-ink: #0F1A14;
    --scrim: rgba(0, 0, 0, 0.65);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B1A11;
  --ink: #F3F7F4;
  --muted: #B3C2B8;
  --faint: #7E9086;
  --line: #26402F;
  --surface: #13261B;
  --surface-2: #1B3324;
  --turf: #1B7A43;
  --navy: #35619A;
  --red: #C81F39;
  --gold: #F5C842;
  --gold-deep: #E0B024;
  --felt: #0E4A28;
  --felt-hi: #1A6E3C;
  --rail: #2A1A0C;
  --rail-line: #E0B024;
  --seat-bg: #F3F7F4;
  --seat-ink: #0F1A14;
  --scrim: rgba(0, 0, 0, 0.65);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.35;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
  min-height: 100%;
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}
button:disabled { cursor: default; }
input {
  font: inherit;
  color: var(--ink);
  background: var(--bg);
}
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.display { font-family: var(--display); font-weight: 800; letter-spacing: 0.01em; }
.num { font-family: var(--display); font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: 0; }

/* ------------------------------------------------------------ money pills */
.amt {
  display: inline-block;
  font-family: var(--display);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  padding: 0 0.4em;
  border-radius: 6px;
  line-height: 1.35;
  white-space: nowrap;
}
.amt.take { background: var(--gold); color: var(--gold-ink); }
.amt.put { background: var(--red); color: var(--red-ink); }
.amt.zero { background: var(--surface-2); color: var(--ink); }

/* ------------------------------------------------------------ setup screen */
.screen-setup {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 560px;
  margin: 0 auto;
}
.setup-body { padding: 18px 18px 8px; flex: 1; }
.wordmark {
  font-family: var(--display);
  font-weight: 800;
  font-size: 44px;
  line-height: 0.95;
  text-transform: uppercase;
  margin: 8px 0 4px;
  letter-spacing: 0.01em;
}
.wordmark .cup { color: var(--red); }
.tagline { color: var(--muted); margin: 0 0 22px; font-size: 17px; }
.setup-section { margin: 0 0 22px; }
.setup-section h2 {
  font-family: var(--display);
  font-weight: 800;
  font-size: 22px;
  text-transform: uppercase;
  margin: 0 0 8px;
  letter-spacing: 0.02em;
}
.setup-section p.help { color: var(--muted); margin: 0 0 10px; font-size: 15px; }
.seat-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.seat {
  display: grid;
  grid-template-columns: var(--tap) 1fr auto auto;
  align-items: center;
  gap: 4px;
  min-height: 60px;
  background: var(--surface);
  border-radius: var(--radius);
  padding-right: 4px;
}
.seat.holder { box-shadow: inset 0 0 0 2px var(--red); }
.seat-cup {
  height: 100%;
  min-height: 60px;
  display: grid;
  place-items: center;
  border-radius: var(--radius) 0 0 var(--radius);
  color: var(--faint);
}
.seat.holder .seat-cup { color: var(--red); }
.seat-cup svg { width: 26px; height: 26px; }
.seat-name {
  font-family: var(--display);
  font-weight: 800;
  font-size: 24px;
  border: 0;
  background: transparent;
  min-width: 0;
  width: 100%;
  padding: 8px 6px;
  border-radius: 6px;
}
.seat-name:focus { background: var(--bg); outline: 3px solid var(--gold-deep); }
.seat-move { display: flex; }
.icon-btn {
  width: 48px; height: 56px;
  display: grid; place-items: center;
  border-radius: 8px;
  color: var(--muted);
}
.icon-btn:disabled { opacity: 0.3; }
.icon-btn svg { width: 22px; height: 22px; }
.add-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 8px; }
.add-row input {
  min-height: var(--tap);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 0 14px;
  font-size: 18px;
}
.add-row input:focus { border-color: var(--turf); outline: none; }
.btn {
  min-height: var(--tap);
  padding: 0 18px;
  border-radius: var(--radius);
  font-family: var(--display);
  font-weight: 800;
  font-size: 20px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: filter 150ms;
}
.btn:active { filter: brightness(0.85); }
.btn:disabled { opacity: 0.45; }
.btn-turf { background: var(--turf); color: var(--turf-ink); }
.btn-navy { background: var(--navy); color: var(--navy-ink); }
.btn-red { background: var(--red); color: var(--red-ink); }
.btn-gold { background: var(--gold); color: var(--gold-ink); }
.btn-ghost { background: var(--bg); color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.btn-ink { background: var(--ink); color: var(--bg); }
.btn-soft { background: var(--surface-2); color: var(--ink); }
.btn-text { background: transparent; color: var(--muted); text-transform: none; font-family: var(--body); font-weight: 600; font-size: 16px; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.segmented .btn { text-transform: none; font-size: 18px; flex-direction: column; line-height: 1.1; padding: 10px 8px; }
.segmented .btn small { font-family: var(--body); font-weight: 400; font-size: 13px; color: inherit; opacity: 0.85; }
.segmented .btn.on { background: var(--ink); color: var(--bg); }
.segmented .btn:not(.on) { background: var(--surface); color: var(--ink); }
.setup-foot {
  position: sticky;
  bottom: 0;
  background: var(--bg);
  padding: 10px 18px calc(12px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow);
}
.setup-foot .btn { width: 100%; min-height: 76px; font-size: 24px; flex-direction: column; gap: 0; }
.setup-foot .btn small { font-family: var(--body); text-transform: none; font-weight: 400; font-size: 14px; opacity: 0.9; letter-spacing: 0; }
.setup-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 2px; margin-top: 4px; }
.setup-foot .setup-links .btn { width: auto; min-height: 44px; padding: 0 10px; font-size: 15px; white-space: nowrap; flex-direction: row; }
.banner {
  background: var(--gold);
  color: var(--gold-ink);
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
}

/* ------------------------------------------------------------- game screen */
.screen-game {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: row;
  justify-content: center;
  overflow: hidden;
}
.game-col {
  flex: 0 1 560px;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom);
}
.side-panel { display: none; }
@media (min-width: 900px) {
  .screen-game { justify-content: stretch; gap: 0; }
  .game-col { flex: 0 0 520px; box-shadow: 1px 0 0 var(--line); }
  .side-panel {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 320px;
    height: 100%;
    overflow: hidden;
    background: var(--surface);
  }
  .side-panel .panel { padding: 16px 20px; overflow: auto; }
  .side-panel .panel:first-child { flex: 0 1 auto; max-height: 50%; }
  .side-panel .panel + .panel { flex: 1; box-shadow: inset 0 1px 0 var(--line); }
  .side-panel h2 {
    font-family: var(--display); font-weight: 800; font-size: 22px; text-transform: uppercase;
    margin: 0 0 10px; letter-spacing: 0.02em;
  }
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(6px + env(safe-area-inset-top)) 16px 6px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 17px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.topbar .brand { color: var(--red); font-weight: 800; }
.topbar { gap: 8px; }
.topbar .status { margin-left: auto; }
.topbar-btn {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  box-shadow: inset 0 0 0 2px var(--line);
  color: var(--ink);
  font-family: var(--display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.topbar-btn:active { background: var(--surface-2); }
.topbar .brand span { color: var(--ink); }
/* the table: an oval of felt, seats around it, the cup in the middle */
.table-zone {
  position: relative;
  flex: 1 1 auto;
  min-height: 178px;
  margin: 4px 10px 6px;
  --seat-w: 88px;
}
.felt {
  position: absolute;
  left: 15%; right: 15%; top: 17%; bottom: 17%;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 38%, var(--felt-hi) 0%, var(--felt) 68%);
  box-shadow: 0 0 0 5px var(--rail), 0 0 0 6px var(--rail-line), 0 8px 20px rgba(0, 0, 0, 0.28), inset 0 0 40px rgba(0, 0, 0, 0.28);
}
.pot {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center;
  color: #FFFFFF;
  padding: 4px 18px;
  border-radius: 16px;
}
.pot:active { background: rgba(255, 255, 255, 0.12); }
.pot-label { font-family: var(--display); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: 0.1em; opacity: 0.85; line-height: 1; }
.pot-num {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(40px, 8.5vh, 76px);
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
  display: flex; align-items: baseline; gap: 4px;
}
.pot-num .dollar { font-size: 0.5em; color: var(--gold); }
.tseat {
  position: absolute;
  transform: translate(-50%, -50%);
  width: var(--seat-w);
  min-height: 44px;
  padding: 5px 6px 4px;
  border-radius: 12px;
  background: var(--seat-bg);
  color: var(--seat-ink);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
  transition: box-shadow 200ms;
  z-index: 1;
}
.tseat.holder { box-shadow: 0 0 0 3px var(--gold), 0 3px 12px rgba(0, 0, 0, 0.35); z-index: 2; }
.tseat.gone { opacity: 0.45; }
.tseat-name { font-family: var(--display); font-weight: 800; font-size: 15px; line-height: 1; text-transform: uppercase; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tseat .amt { font-size: 13px; padding: 0 5px; line-height: 1.35; }
.cupmark { position: absolute; top: -11px; left: -9px; width: 24px; height: 24px; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); }
.cupmark svg { width: 14px; height: 14px; }
.sidemark {
  position: absolute; top: -10px; right: -9px;
  font-family: var(--display); font-weight: 800; font-size: 11px; line-height: 1; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 4px 6px; border-radius: 999px;
  background: var(--seat-ink); color: #fff;
}
.tseat.offense .sidemark { background: var(--turf); }
.tseat.defense .sidemark { background: var(--navy); }
.grid-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 0 14px 4px; min-height: 24px; }
.gh-main { font-family: var(--display); font-weight: 800; font-size: 18px; text-transform: uppercase; letter-spacing: 0.02em; white-space: nowrap; }
.grid-head.offense .gh-main { color: var(--turf); }
.grid-head.defense .gh-main { color: var(--navy); }
.gh-sub { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
@media (max-height: 700px) {
  .table-zone { min-height: 158px; margin-top: 2px; }
  .pot-label { display: none; }
  .tseat-name { font-size: 13px; }
  .gh-sub { display: none; }
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 12px 8px;
}
.grid .ev { min-height: clamp(50px, 8.5vh, 84px); }
.grid .wide { grid-column: 1 / -1; }
.ev {
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 6px 12px;
  text-align: left;
  line-height: 1.05;
  position: relative;
  overflow: hidden;
  transition: filter 150ms;
}
.ev:active { filter: brightness(0.85); }
.ev .lbl {
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.ev .val {
  font-family: var(--display);
  font-weight: 800;
  font-size: 28px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin-top: 3px;
}
.ev .hint { font-family: var(--body); font-size: 12px; opacity: 0.85; margin-top: 2px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid .ev.slim { min-height: 48px; flex-direction: row; align-items: center; gap: 10px; }
.grid .ev.slim .hint { margin: 0; }
@media (max-height: 700px) { .game-col .grid .ev .hint { display: none; } .game-col .grid .ev.slim .hint { display: inline; } }
.sheet .grid .ev:nth-child(odd):nth-last-child(2) { grid-column: 1 / -1; }
.ev.take { background: var(--gold); color: var(--gold-ink); }
.ev.put { background: var(--red); color: var(--red-ink); }
.ev.neutral { background: var(--bg); color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.ev.pot {
  background: var(--gold);
  color: var(--gold-ink);
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  box-shadow: inset 0 0 0 3px var(--gold-deep);
}
.ev.pot .text { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.ev.pot .lbl { font-size: 19px; }
.ev.pot .val { font-size: 22px; letter-spacing: 0.04em; }
.ev.pot .ring {
  position: absolute; inset: 0;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  opacity: 0.18;
  pointer-events: none;
}
.ev.pot.holding .ring { animation: fill-ring 600ms linear forwards; }
@keyframes fill-ring { to { transform: scaleX(1); } }
.ev.pot.holding { filter: brightness(0.95); }

.side-pick { display: grid; gap: 8px; padding: 0 12px 8px; }
.side-pick .btn { min-height: clamp(72px, 12vh, 104px); font-size: 26px; flex-direction: column; gap: 0; }
.side-pick .btn small { font-family: var(--body); text-transform: none; font-weight: 400; font-size: 15px; letter-spacing: 0; opacity: 0.9; }

/* dock */
.dock { margin-top: auto; box-shadow: var(--shadow); background: var(--bg); }
.strip {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 3px;
  min-height: 44px;
}
.strip-text { min-width: 0; }
.strip-main {
  font-family: var(--display);
  font-weight: 800;
  font-size: 19px;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1.05;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.strip-main.error { color: var(--red); }
.strip-sub { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.undo {
  min-height: 48px;
  padding: 4px 14px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.undo .big { font-family: var(--display); font-weight: 800; font-size: 18px; text-transform: uppercase; letter-spacing: 0.04em; }
.undo .sub { font-size: 11px; color: var(--muted); margin-top: 3px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.undo:disabled { opacity: 0.4; }
.undo-group { display: flex; gap: 6px; }
.sheet-foot .cancel { width: 100%; min-height: 44px; margin-top: 4px; }
.btn small.blk { display: block; width: 100%; text-align: center; font-family: var(--body); text-transform: none; font-weight: 400; font-size: 13px; letter-spacing: 0; opacity: 0.9; }
.sheet-foot .btn { flex-wrap: wrap; }
/* short viewports (phones in landscape): let the game screen scroll */
@media (max-height: 560px) {
  .screen-game { height: auto; min-height: 100dvh; overflow: visible; }
  .game-col { height: auto; }
  .table-zone { min-height: 150px; }
}
.utility { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 4px 12px; }
.utility .btn { min-height: 50px; font-size: 18px; flex-direction: column; gap: 0; line-height: 1.05; padding: 6px 10px; }
.utility .btn small { font-family: var(--body); text-transform: none; font-weight: 400; font-size: 12px; letter-spacing: 0; opacity: 0.85; white-space: nowrap; }
.pass-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 4px 12px 10px;
}
.pass-row .btn {
  min-height: clamp(60px, 9vh, 84px);
  flex-direction: column;
  gap: 2px;
  line-height: 1;
  font-size: 22px;
}
.pass-row .btn small { font-family: var(--body); font-weight: 400; text-transform: none; font-size: 13px; letter-spacing: 0; opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.pass-row .more { min-width: 64px; font-size: 26px; }
.pass-row.locked .btn { opacity: 0.45; }
.pass-hint { grid-column: 1 / -1; text-align: center; color: var(--muted); font-size: 14px; }

/* ------------------------------------------------------------------ sheets */
.scrim {
  cursor: pointer;
  position: fixed; inset: 0;
  background: var(--scrim);
  z-index: 20;
}
.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  margin: 0 auto;
  max-width: 560px;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px - env(safe-area-inset-top));
  background: var(--bg);
  color: var(--ink);
  border-radius: 16px 16px 0 0;
  z-index: 21;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -1px 0 var(--line);
}
@media (prefers-reduced-motion: no-preference) {
  .sheet { animation: sheet-in 160ms ease-out; }
  @keyframes sheet-in { from { transform: translateY(24px); opacity: 0.6; } }
}
.sheet-head {
  padding: 14px 18px 8px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.sheet-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: 26px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 0;
  line-height: 1;
}
.sheet-kicker { color: var(--muted); font-size: 14px; }
.sheet-body { padding: 4px 18px 12px; overflow: auto; -webkit-overflow-scrolling: touch; }
.sheet-foot { padding: 8px 18px calc(12px + env(safe-area-inset-bottom)); }
.sheet-foot .btn { width: 100%; min-height: 60px; }
.sheet .grid { padding: 0; }
.note { color: var(--muted); font-size: 14px; margin: 0 0 10px; }
.stack { display: grid; gap: 8px; }
.row-btn {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 8px 14px;
  border-radius: var(--radius);
  background: var(--surface);
  text-align: left;
  width: 100%;
}
.row-btn .t, .row-btn .d { display: block; }
.row-btn .t { font-family: var(--display); font-weight: 800; font-size: 22px; text-transform: uppercase; letter-spacing: 0.02em; line-height: 1; }
.row-btn .d { color: var(--muted); font-size: 14px; margin-top: 3px; }
.row-btn.danger .t { color: var(--red); }
.row-btn.next { box-shadow: inset 0 0 0 2px var(--gold-deep); }
.row-btn:active { filter: brightness(0.9); }
.pick-row {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) 1fr 1fr;
  gap: 6px;
  align-items: stretch;
  min-height: 68px;
}
.pick-row .who {
  display: flex; flex-direction: column; justify-content: center;
  padding: 6px 10px;
  border-radius: var(--radius);
  background: var(--surface);
}
.pick-row .who.next { box-shadow: inset 0 0 0 2px var(--gold-deep); }
.pick-row .who .t { font-family: var(--display); font-weight: 800; font-size: 22px; text-transform: uppercase; line-height: 1; }
.pick-row .who .d { color: var(--muted); font-size: 12px; margin-top: 3px; }
.pick-row .btn { font-size: 18px; min-height: 68px; }
.ledger { display: grid; gap: 6px; }
.ledger-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  min-height: 60px;
  padding: 6px 4px 6px 12px;
  border-radius: var(--radius);
  background: var(--surface);
}
.ledger-row.inactive { opacity: 0.6; }
.ledger-row .name { font-family: var(--display); font-weight: 800; font-size: 22px; text-transform: uppercase; line-height: 1; display: flex; align-items: center; gap: 8px; }
.ledger-row .name svg { width: 18px; height: 18px; color: var(--red); }
.ledger-row .name .tag { font-family: var(--body); font-weight: 400; text-transform: none; font-size: 12px; color: var(--muted); }
.ledger-row .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.ledger-row .amt { font-size: 24px; padding: 2px 10px; }
.ledger-row .more-btn { width: 44px; height: 48px; display: grid; place-items: center; color: var(--muted); border-radius: 8px; }
.log { list-style: none; margin: 0; padding: 0; }
.log-period {
  font-family: var(--display); font-weight: 800; font-size: 16px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); padding: 12px 0 4px;
  position: sticky; top: 0; background: var(--bg);
}
.log-entry { padding: 7px 0; box-shadow: inset 0 -1px 0 var(--line); display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: baseline; }
.log-entry .d { font-size: 15px; }
.log-entry .d.muted { color: var(--muted); }
.log-entry .p { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.log-entry .p b { color: var(--ink); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  box-shadow: inset 0 0 0 2px var(--line);
  min-height: 48px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  display: inline-flex; align-items: center;
}
.chip.on { background: var(--ink); color: var(--bg); box-shadow: none; }
.chip:disabled { opacity: 0.4; }
.field { margin: 12px 0; }
.field label { display: block; font-weight: 600; font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.field input { width: 100%; min-height: 52px; border: 2px solid var(--line); border-radius: var(--radius); padding: 0 12px; font-size: 17px; }
.field input:focus { border-color: var(--turf); outline: none; }
.rules h3 { font-family: var(--display); font-weight: 800; font-size: 20px; text-transform: uppercase; margin: 16px 0 6px; letter-spacing: 0.02em; }
.rules ul { margin: 0 0 8px; padding-left: 20px; }
.rules li { margin: 4px 0; font-size: 15px; }
.rules p { font-size: 15px; margin: 6px 0; }
.rules .fn { color: var(--muted); font-size: 13px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* ------------------------------------------------------------- end screen */
.screen-end { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; }
.end-body { padding: 18px; flex: 1; }
.final-tag { font-family: var(--display); font-weight: 800; font-size: 20px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--red); }
.final-line { font-family: var(--display); font-weight: 800; font-size: 34px; line-height: 1; text-transform: uppercase; margin: 2px 0 6px; }
.final-sub { color: var(--muted); margin: 0 0 18px; }
.end-foot { position: sticky; bottom: 0; background: var(--bg); padding: 10px 18px calc(12px + env(safe-area-inset-bottom)); box-shadow: var(--shadow); display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
.end-foot .btn { min-height: 60px; }
details.settle { margin-top: 18px; }
details.settle summary { font-family: var(--display); font-weight: 800; font-size: 20px; text-transform: uppercase; cursor: pointer; padding: 8px 0; min-height: 44px; display: flex; align-items: center; gap: 8px; }
details.settle summary::before { content: "B8"; font-size: 18px; color: var(--muted); }
details.settle[open] summary::before { content: "BE"; }
details.settle summary::-webkit-details-marker { display: none; }
details.settle ul { list-style: none; padding: 0; margin: 6px 0; }
details.settle li { padding: 8px 0; box-shadow: inset 0 -1px 0 var(--line); font-size: 17px; display: flex; justify-content: space-between; }
.summary-box { width: 100%; min-height: 160px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; border: 2px solid var(--line); border-radius: var(--radius); padding: 10px; background: var(--surface); color: var(--ink); white-space: pre; overflow: auto; }

/* --------------------------------------------------------- pot moment */
.moment {
  cursor: pointer;
  position: fixed; inset: 0;
  background: var(--gold);
  color: var(--gold-ink);
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}
@media (prefers-reduced-motion: no-preference) {
  .moment { animation: moment-in 200ms ease-out; }
  @keyframes moment-in { from { opacity: 0; } }
}
.moment .who { font-family: var(--display); font-weight: 800; font-size: 34px; text-transform: uppercase; line-height: 1; }
.moment .big { font-family: var(--display); font-weight: 800; font-size: clamp(80px, 22vw, 160px); line-height: 1; font-variant-numeric: tabular-nums; }
.moment .after { font-size: 18px; margin-top: 12px; max-width: 28ch; }

/* ------------------------------------------------------------ live watch */
.watch-pill {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 30px; padding: 0 10px; border-radius: 999px;
  background: var(--red); color: #fff;
  font-family: var(--display); font-weight: 700; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase;
  white-space: nowrap;
}
.watch-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.watch-pill.lost { background: var(--surface-2); color: var(--ink); }
.watch-pill.lost::before { background: var(--muted); }
.watch-foot { margin-top: auto; padding: 8px 12px calc(12px + env(safe-area-inset-bottom)); box-shadow: var(--shadow); display: grid; gap: 8px; }
.watch-foot .two-col .btn { min-height: 56px; }
.watch-wait { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; gap: 8px; }
.watch-wait .big { font-family: var(--display); font-weight: 800; font-size: 30px; text-transform: uppercase; line-height: 1; }
.share-box { background: var(--surface); border-radius: var(--radius); padding: 12px 14px; }
.share-box .url { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 15px; word-break: break-all; }



.stepper { display: grid; grid-template-columns: 60px 1fr 60px; gap: 8px; align-items: stretch; }
.stepper.solo { grid-template-columns: 1fr; }
.stepper .btn { min-height: 56px; font-size: 28px; font-family: var(--display); font-weight: 800; }
.stepper-val { display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--surface); border-radius: var(--radius); min-height: 56px; font-family: var(--display); font-weight: 800; font-size: 30px; font-variant-numeric: tabular-nums; line-height: 1; }
.stepper-val small { font-family: var(--body); font-weight: 400; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-top: 3px; }


/* -------------------------------------------------- settings sheet */
.set-group { font-family: var(--display); font-weight: 800; font-size: 15px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 16px 0 6px; }
.set-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding: 7px 0; box-shadow: inset 0 -1px 0 var(--line); }
.set-label { font-size: 15px; }
.set-controls { display: flex; align-items: center; gap: 8px; }
.mini-stepper { display: inline-flex; align-items: center; gap: 6px; }
.mini-stepper .btn { min-height: 40px; width: 40px; padding: 0; font-size: 22px; font-family: var(--display); font-weight: 800; }
.mini-val { min-width: 42px; text-align: center; font-family: var(--display); font-weight: 800; font-size: 19px; font-variant-numeric: tabular-nums; }
.set-controls .chip { min-height: 40px; font-size: 15px; padding: 0 12px; }
.switch { width: 46px; height: 28px; border-radius: 999px; background: var(--surface-2); position: relative; flex: 0 0 auto; transition: background 150ms; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--bg); box-shadow: 0 1px 2px rgba(0,0,0,0.3); transition: left 150ms; }
.switch.on { background: var(--turf); }
.switch.on::after { left: 21px; }
.row-btn[disabled] { opacity: 0.55; }
.set-label { display: flex; flex-direction: column; gap: 2px; }
.set-dir { font-family: var(--display); font-weight: 700; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; }
.set-dir.take { color: var(--gold-deep); }
.set-dir.put { color: var(--red); }
.stepper-val { flex-direction: row; gap: 1px; }
.dollar-pre { font-family: var(--display); font-weight: 800; }
.stepper-input { width: 62px; background: transparent; border: 0; color: var(--ink); font: inherit; text-align: center; font-variant-numeric: tabular-nums; padding: 0; }
.stepper-input:focus-visible { outline: 3px solid var(--gold-deep); outline-offset: 2px; border-radius: 6px; }
.mini-val { display: inline-flex; align-items: center; }
.mini-input { width: 40px; background: transparent; border: 0; color: var(--ink); font: inherit; text-align: center; font-variant-numeric: tabular-nums; padding: 0; }
.mini-input:focus-visible { outline: 3px solid var(--gold-deep); outline-offset: 1px; border-radius: 4px; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }

/* ------------------------------------------------------- rooms UI */
.mode-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0 0 20px; background: var(--surface); padding: 4px; border-radius: 12px; }
.mode-tab {
  min-height: 48px; border-radius: 9px;
  font-family: var(--display); font-weight: 800; font-size: 17px; text-transform: uppercase; letter-spacing: 0.02em;
  color: var(--muted);
}
.mode-tab.on { background: var(--bg); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,0.18); }
.room-code {
  font-family: var(--display); font-weight: 800; font-size: 48px; letter-spacing: 0.14em;
  text-align: center; color: var(--red); background: var(--surface);
  border-radius: var(--radius); padding: 14px 8px; margin: 0 0 8px;
  font-variant-numeric: tabular-nums; user-select: all;
}
.host-note {
  margin: 0 14px 6px; padding: 6px 12px; border-radius: 8px;
  background: var(--gold); color: var(--gold-ink);
  font-family: var(--display); font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: 0.03em;
}
.waiting {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 22px 16px; margin: 0 12px 8px; gap: 4px;
  background: var(--surface); border-radius: var(--radius);
}
.waiting-big { font-family: var(--display); font-weight: 800; font-size: 26px; text-transform: uppercase; line-height: 1; }
.tseat.me { box-shadow: 0 0 0 2px var(--turf), 0 2px 6px rgba(0,0,0,0.22); }
.tseat.me.holder { box-shadow: 0 0 0 3px var(--gold), 0 0 0 5px var(--turf), 0 3px 12px rgba(0,0,0,0.35); }

/* ------------------------------------------------------ how-to intro */
.intro {
  position: fixed; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 560px;
  background: var(--bg); color: var(--ink); z-index: 32;
  border-radius: 16px 16px 0 0; box-shadow: 0 -1px 0 var(--line);
  padding: 22px 22px calc(20px + env(safe-area-inset-bottom)); text-align: center;
}
@media (prefers-reduced-motion: no-preference) { .intro { animation: sheet-in 160ms ease-out; } }
@media (min-width: 560px) { .intro { bottom: auto; top: 50%; transform: translateY(-50%); border-radius: 18px; max-width: 460px; } }
.intro-ic { font-size: 46px; line-height: 1; margin-bottom: 6px; }
.intro-step { font-family: var(--display); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.intro-title { font-family: var(--display); font-weight: 800; font-size: 26px; text-transform: uppercase; letter-spacing: 0.01em; margin: 3px 0 8px; }
.intro-text { font-size: 16px; line-height: 1.45; margin: 0 auto 14px; max-width: 42ch; }
.intro-ex-cap { font-family: var(--display); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 6px; }
.intro-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 14px; }
.ipill { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px; background: var(--surface); color: var(--ink); font-family: var(--display); font-weight: 700; font-size: 16px; }
.ipill.turf { background: var(--turf); color: var(--turf-ink); }
.ipill.navy { background: var(--navy); color: var(--navy-ink); }
.intro .amt { font-size: 16px; padding: 4px 12px; }
.intro-dots { display: flex; gap: 7px; justify-content: center; margin: 2px 0 14px; }
.intro-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--surface-2); }
.intro-dots i.on { background: var(--red); }
.intro-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; }
.intro-actions .btn { min-height: 56px; }

/* ----------------------------------------------------------------- toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(180px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  z-index: 40;
  max-width: calc(100vw - 32px);
  text-align: center;
}
