/* Venly Odds: racetrack tote board (big screen) and carbon-copy betting slips (phone). */

:root {
  --felt: #0f3d30;
  --felt-deep: #0a2b22;
  --felt-line: #1d5443;
  --paper: #e9f0ea;
  --paper-raised: #fbfdfb;
  --ink: #262358;
  --ink-soft: #5b5986;
  --ink-faint: rgba(38, 35, 88, 0.14);
  --chalk: #f4efe2;
  --chalk-soft: #b9c9bf;
  --yes: #3b6cf6;
  --yes-ink: #2346b8;
  --yes-lit: #86a6ff;
  --no: #f2762e;
  --no-ink: #a9480c;
  --no-lit: #ff9f63;
  --won: #1d7a4e;
  --lost: #c0352b;
  --void: #6b6f7a;
  --display: 'Big Shoulders Display', 'Oswald', 'Arial Narrow', sans-serif;
  --body: 'Barlow', 'Helvetica Neue', Arial, sans-serif;
  --code: 'JetBrains Mono', ui-monospace, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--body); font-size: 16px; line-height: 1.45; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--yes); 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; }

.wordmark {
  font-family: var(--display);
  font-weight: 900;
  letter-spacing: 0.01em;
  line-height: 0.9;
  display: inline-flex;
  align-items: baseline;
  gap: 0.18em;
}
.wordmark .mark {
  display: inline-grid;
  place-items: center;
  flex: none;
  align-self: center;
  width: 1.36em;
  height: 1.36em;
  border-radius: 50%;
  background: var(--chalk);
  color: var(--felt);
  font-size: 0.58em;
  line-height: 1;
}

.yes-text { color: var(--yes-ink); }
.no-text { color: var(--no-ink); }
.mono { font-family: var(--code); font-size: 0.82em; }

/* Price bar shared by phone and host */
.bar { display: flex; height: 10px; border-radius: 3px; overflow: hidden; background: var(--ink-faint); }
.bar .y { background: var(--yes); transition: width 400ms ease; }
.bar .n { background: var(--no); transition: width 400ms ease; flex: 1; }

/* Status chips: Finance resource statuses, as returned */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--ink-faint);
  color: var(--ink);
  white-space: nowrap;
}
.chip.busy { background: #fff3c4; color: #6b5200; }
.chip.held { background: #e3e1fb; color: var(--ink); }
.chip.good { background: #d6efe2; color: var(--won); }
.chip.bad { background: #f8dcd8; color: var(--lost); }
.chip.dim { background: #e6e7ea; color: var(--void); }
.chip.busy::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 900ms ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.2; } }

/* ---------------------------------------------------------------------------------------------------------------
   Under the hood: the Finance calls behind each action (phone drawer, host log, big-screen wire)
   --------------------------------------------------------------------------------------------------------------- */
.calls { list-style: none; margin: 0; padding: 0; }
.call { border-bottom: 1px solid var(--ink-faint); }
.call > button {
  width: 100%;
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 8px;
  align-items: baseline;
  text-align: left;
  background: none;
  border: 0;
  padding: 9px 2px;
}
.call .verb { font-family: var(--code); font-size: 12px; font-weight: 600; }
.call .verb.GET { color: var(--ink-soft); }
.call .verb.POST { color: var(--yes-ink); }
.call .verb.PATCH { color: var(--no-ink); }
.call .verb.NOTE { color: var(--won); }
.call .path { font-family: var(--code); font-size: 12.5px; overflow-wrap: anywhere; }
.call .why { grid-column: 2 / 4; font-size: 13px; color: var(--ink-soft); }
.call .status { font-family: var(--code); font-size: 12px; font-weight: 600; }
.call .status.ok { color: var(--won); }
.call .status.err { color: var(--lost); }
.call .detail { padding: 0 2px 12px; display: grid; gap: 8px; }
.call .detail h4 { margin: 4px 0 2px; font-size: 13px; font-weight: 600; }
.call pre {
  margin: 0;
  padding: 10px;
  background: var(--felt-deep);
  color: var(--chalk);
  border-radius: 6px;
  font-family: var(--code);
  font-size: 11.5px;
  line-height: 1.5;
  overflow: auto;
  max-height: 340px;
}
.calls-empty { padding: 14px 2px; color: var(--ink-soft); }

/* ---------------------------------------------------------------------------------------------------------------
   Phone
   --------------------------------------------------------------------------------------------------------------- */
.page-phone { background: var(--paper); color: var(--ink); min-height: 100vh; }
.page-phone .app { max-width: 520px; margin: 0 auto; padding-bottom: 72px; }

.band {
  background: var(--felt);
  color: var(--chalk);
  padding: 14px 16px 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 5;
}
.band .wordmark { font-size: 30px; }
.band .who { font-size: 13px; color: var(--chalk-soft); margin-top: 4px; }
.purse { text-align: right; }
.purse .cash { font-family: var(--display); font-weight: 800; font-size: 34px; line-height: 1; font-variant-numeric: tabular-nums; }
.purse .held { font-size: 13px; color: var(--chalk-soft); }
.purse .held svg { width: 11px; height: 11px; vertical-align: -1px; }

.join {
  min-height: 100vh;
  background: var(--felt);
  color: var(--chalk);
  display: grid;
  align-content: center;
  padding: 32px 20px;
  gap: 22px;
}
.join .wordmark { font-size: clamp(64px, 20vw, 104px); }
.join p { margin: 0; max-width: 36ch; color: var(--chalk-soft); }
.join form { display: grid; gap: 10px; max-width: 420px; }
.join label { font-weight: 600; }
.join input {
  padding: 14px 14px;
  border-radius: 8px;
  border: 2px solid var(--felt-line);
  background: var(--felt-deep);
  color: var(--chalk);
  font-size: 20px;
}
.join .error { color: #ffc2b8; min-height: 1.4em; }

.btn {
  border: 0;
  border-radius: 8px;
  padding: 13px 18px;
  font-weight: 700;
  font-size: 17px;
  background: var(--felt);
  color: var(--chalk);
}
.btn.chalk { background: var(--chalk); color: var(--felt); }
.btn:disabled { opacity: 0.55; cursor: progress; }

.section-head { display: flex; justify-content: space-between; align-items: baseline; padding: 22px 16px 6px; }
.section-head h2 { margin: 0; font-family: var(--display); font-weight: 800; font-size: 26px; }
.section-head span { font-size: 13px; color: var(--ink-soft); }

.market { padding: 16px; border-bottom: 1px solid var(--ink-faint); }
.market h3 { margin: 0 0 4px; font-family: var(--display); font-weight: 700; font-size: 25px; line-height: 1.05; }
.market .meta { display: flex; gap: 14px; font-size: 13px; color: var(--ink-soft); margin-bottom: 10px; }
.market .bar { margin-bottom: 12px; }
.market .picks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pick {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 11px 14px;
  border-radius: 8px;
  border: 2px solid currentColor;
  background: var(--paper-raised);
  font-weight: 700;
  font-size: 17px;
}
.pick b { font-family: var(--display); font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pick.yes { color: var(--yes-ink); }
.pick.no { color: var(--no-ink); }
.pick:disabled { opacity: 0.45; cursor: not-allowed; }
.market.settled h3 { color: var(--ink-soft); }
.market .verdict { font-weight: 700; }

.empty { padding: 18px 16px; color: var(--ink-soft); }

/* Join: two names, as on the ID */
.join .names { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.join .names label { display: grid; gap: 6px; }
.join .names input { width: 100%; min-width: 0; font-size: 18px; }
.join .fine { font-size: 14px; color: var(--chalk-soft); margin: 0; }
.btn.ghost { background: transparent; color: var(--felt); border: 2px solid var(--felt); }

/* KYC: the step between joining and betting */
.kyc {
  margin: 14px 16px 6px;
  padding: 16px;
  background: var(--paper-raised);
  border-radius: 10px;
  border-left: 6px solid var(--yes);
  display: grid;
  gap: 10px;
}
.kyc.bad { border-left-color: var(--lost); }
.kyc h2 { margin: 0; font-family: var(--display); font-weight: 800; font-size: 28px; line-height: 1; }
.kyc p { margin: 0; }
.kyc .fine { font-size: 13px; color: var(--ink-soft); }
.kyc-actions { display: grid; gap: 8px; }
.steps { list-style: none; margin: 2px 0; padding: 0; display: grid; gap: 6px; counter-reset: step; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 24px 1fr; gap: 8px; align-items: center; font-size: 15px; color: var(--ink-soft); }
.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--ink-faint);
  font-size: 12px;
  font-weight: 700;
}
.steps li.done { color: var(--ink); }
.steps li.done::before { content: '✓'; background: var(--won); border-color: var(--won); color: #fff; }
.steps li.now { color: var(--ink); font-weight: 700; }
.steps li.now::before { border-color: var(--yes); color: var(--yes-ink); animation: pulse 1200ms ease-in-out infinite; }

/* Slips: tickets with a torn stub and a rubber stamp */
.slips { display: grid; gap: 12px; padding: 4px 16px 8px; }
.slip {
  position: relative;
  display: grid;
  grid-template-columns: 78px 1fr;
  background: var(--paper-raised);
  border-radius: 6px;
  box-shadow: 0 1px 0 rgba(38, 35, 88, 0.18);
  overflow: hidden;
}
.slip .stub {
  padding: 12px 10px;
  border-right: 2px dashed var(--ink-faint);
  display: grid;
  align-content: start;
  gap: 2px;
  font-weight: 700;
}
.slip .stub .side { font-family: var(--display); font-size: 26px; font-weight: 900; line-height: 1; }
.slip .stub .qty { font-size: 13px; color: var(--ink-soft); font-weight: 500; }
.slip.yes .stub .side { color: var(--yes-ink); }
.slip.no .stub .side { color: var(--no-ink); }
.slip .body { padding: 12px 12px 12px 14px; display: grid; gap: 6px; min-width: 0; }
.slip .q { font-weight: 600; line-height: 1.25; padding-right: 64px; }
.slip .figures { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--ink-soft); }
.slip .figures b { color: var(--ink); font-variant-numeric: tabular-nums; }
.slip .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.slip .actions button {
  border: 1.5px solid var(--ink);
  background: none;
  border-radius: 6px;
  padding: 5px 12px;
  font-weight: 600;
  font-size: 14px;
}
.slip .pr { font-size: 12px; color: var(--ink-soft); }
.stamp {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border: 2.5px solid currentColor;
  border-radius: 5px;
  font-family: var(--display);
  font-weight: 900;
  font-size: 19px;
  line-height: 1.1;
  transform: rotate(-8deg);
  opacity: 0.88;
  background: var(--paper-raised);
}
.stamp svg { width: 13px; height: 13px; }
.stamp.held { color: var(--ink); }
.stamp.won { color: var(--won); }
.stamp.lost { color: var(--lost); }
.stamp.void, .stamp.sold { color: var(--void); }
.stamp.thunk { animation: thunk 420ms cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes thunk {
  0% { transform: rotate(-8deg) scale(1.9); opacity: 0; }
  100% { transform: rotate(-8deg) scale(1); opacity: 0.88; }
}

/* Trade sheet */
.scrim { position: fixed; inset: 0; background: rgba(10, 43, 34, 0.55); z-index: 20; }
.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(520px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: var(--paper);
  border-radius: 18px 18px 0 0;
  padding: 18px 16px 24px;
  z-index: 21;
  display: grid;
  gap: 14px;
  animation: rise 220ms ease-out;
}
@keyframes rise { from { transform: translate(-50%, 24px); opacity: 0; } }
.sheet .grab { justify-self: center; width: 44px; height: 4px; border-radius: 2px; background: var(--ink-faint); }
.sheet h3 { margin: 0; font-family: var(--display); font-weight: 800; font-size: 26px; line-height: 1.05; }
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--ink-faint); border-radius: 8px; padding: 3px; gap: 3px; }
.segmented button { border: 0; background: none; border-radius: 6px; padding: 9px; font-weight: 700; }
.segmented button[aria-pressed='true'] { background: var(--paper-raised); box-shadow: 0 1px 0 rgba(38, 35, 88, 0.2); }
.segmented button.yes[aria-pressed='true'] { color: var(--yes-ink); }
.segmented button.no[aria-pressed='true'] { color: var(--no-ink); }
.amount { font-family: var(--display); font-weight: 900; font-size: 60px; line-height: 1; font-variant-numeric: tabular-nums; }
.amount small { font-size: 22px; font-weight: 700; color: var(--ink-soft); margin-left: 6px; }
input[type='range'] { width: 100%; accent-color: var(--felt); height: 28px; }
.quick { display: flex; gap: 8px; flex-wrap: wrap; }
.quick button { border: 1.5px solid var(--ink-faint); background: var(--paper-raised); border-radius: 6px; padding: 5px 12px; font-weight: 600; }
.preview { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 0; font-size: 15px; }
.preview dt { color: var(--ink-soft); }
.preview dd { margin: 0; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.sheet .btn { width: 100%; font-size: 18px; padding: 15px; }
.sheet .error { color: var(--lost); font-weight: 600; }
.receipt { display: grid; gap: 8px; }
.receipt .op { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 12px; background: var(--paper-raised); border-radius: 6px; }
.receipt .op .lbl { font-weight: 600; }
.receipt .op .ep { grid-column: 1 / 3; font-family: var(--code); font-size: 12px; color: var(--ink-soft); overflow-wrap: anywhere; }
.receipt .op .tx { grid-column: 1 / 3; font-family: var(--code); font-size: 12px; overflow-wrap: anywhere; }

/* Under-the-hood drawer (phone) */
.hood-bar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(520px, 100%);
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border: 0;
  background: var(--felt-deep);
  color: var(--chalk);
  font-weight: 600;
  text-align: left;
}
.hood-bar .last { font-family: var(--code); font-size: 12px; color: var(--chalk-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hood {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(520px, 100%);
  height: 78vh;
  z-index: 31;
  background: var(--paper);
  border-radius: 18px 18px 0 0;
  display: grid;
  grid-template-rows: auto 1fr;
  animation: rise 220ms ease-out;
}
.hood header { padding: 16px 16px 8px; display: grid; gap: 6px; border-bottom: 1px solid var(--ink-faint); }
.hood header h3 { margin: 0; font-family: var(--display); font-weight: 800; font-size: 24px; }
.hood header p { margin: 0; font-size: 13px; color: var(--ink-soft); }
.hood header .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; }
.hood .scroll { overflow: auto; padding: 0 14px 24px; }
.close-x { border: 0; background: none; font-size: 15px; font-weight: 700; color: var(--ink); padding: 4px 0; }

/* ---------------------------------------------------------------------------------------------------------------
   Big screen: the tote board
   --------------------------------------------------------------------------------------------------------------- */
.page-screen {
  background: var(--felt);
  color: var(--chalk);
  min-height: 100vh;
  overflow-x: hidden;
}
.tote {
  height: 100vh;
  min-height: 600px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: clamp(12px, 1.6vw, 28px);
  padding: clamp(16px, 2vw, 36px) clamp(16px, 2.4vw, 44px);
}
.tote-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.tote-head .wordmark { font-size: clamp(48px, 5.4vw, 104px); }
.tote-head .join-hint { font-size: clamp(15px, 1.15vw, 22px); color: var(--chalk-soft); }
.tote-head .join-hint b { color: var(--chalk); font-weight: 600; }
.tote-head .bank { display: flex; gap: clamp(16px, 2.2vw, 40px); }
.bank .fig { text-align: right; }
.bank .fig b { display: block; font-family: var(--display); font-weight: 800; font-size: clamp(26px, 2.4vw, 46px); line-height: 1; font-variant-numeric: tabular-nums; }
.bank .fig span { font-size: clamp(12px, 0.9vw, 16px); color: var(--chalk-soft); }
.mode-pill { display: inline-block; padding: 2px 10px; border: 1.5px solid var(--chalk-soft); border-radius: 999px; font-size: 13px; color: var(--chalk-soft); margin-left: 8px; vertical-align: middle; }

.tote-main { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(280px, 1fr); gap: clamp(16px, 2vw, 36px); min-height: 0; overflow: hidden; }
.boards { display: grid; gap: clamp(12px, 1.4vw, 24px); align-content: start; }
.board {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 24px;
  padding: clamp(14px, 1.4vw, 26px) clamp(16px, 1.6vw, 30px);
  background: var(--felt-deep);
  border-radius: 10px;
  border: 1px solid var(--felt-line);
}
.board h2 { margin: 0; font-family: var(--display); font-weight: 800; font-size: clamp(26px, 2.6vw, 54px); line-height: 1; align-self: center; }
.board .state { font-size: clamp(13px, 0.95vw, 18px); color: var(--chalk-soft); margin-top: 6px; display: flex; gap: 16px; }
.board .state .resolved { color: var(--chalk); font-weight: 700; }
.board .odds { display: flex; gap: clamp(14px, 1.6vw, 30px); align-items: end; }
.board .side { display: grid; justify-items: center; gap: 4px; }
.board .side .label { font-size: clamp(13px, 1vw, 19px); font-weight: 700; }
.board .side.yes .label { color: var(--yes-lit); }
.board .side.no .label { color: var(--no-lit); }
.board .spark { grid-column: 1 / 3; height: clamp(40px, 5vw, 86px); }
.board .spark svg { width: 100%; height: 100%; display: block; overflow: visible; }
.board.done { opacity: 0.62; }

.flaps { display: inline-flex; gap: 4px; perspective: 400px; }
.flap {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: clamp(34px, 3.3vw, 68px);
  height: clamp(48px, 4.6vw, 94px);
  border-radius: 6px;
  background: linear-gradient(#123a2e 50%, #0c2d23 50%);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.35), 0 2px 0 rgba(0, 0, 0, 0.25);
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(34px, 3.4vw, 72px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.flap::after { content: ''; position: absolute; left: 0; right: 0; top: calc(50% - 1px); height: 2px; background: rgba(0, 0, 0, 0.5); }
.flaps.yes .flap { color: var(--yes-lit); }
.flaps.no .flap { color: var(--no-lit); }
.flaps .pct { align-self: end; font-family: var(--display); font-weight: 800; font-size: clamp(18px, 1.6vw, 32px); color: var(--chalk-soft); margin-left: 2px; }
.flap.flip { animation: flip 380ms ease-in-out; }
@keyframes flip {
  0% { transform: rotateX(0); }
  50% { transform: rotateX(-90deg); }
  100% { transform: rotateX(0); }
}

.side-col { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: clamp(14px, 1.6vw, 28px); min-height: 0; overflow: hidden; }
.boards { overflow: hidden; min-height: 0; }
.panel h3 { margin: 0 0 8px; font-family: var(--display); font-weight: 800; font-size: clamp(22px, 1.7vw, 34px); }
.leaders { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.leaders li {
  display: grid;
  grid-template-columns: 2ch 14px 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--felt-line);
  font-size: clamp(15px, 1.15vw, 22px);
}
.leaders .rank { font-family: var(--display); font-weight: 800; color: var(--chalk-soft); text-align: right; }
.leaders .dot { width: 12px; height: 12px; border-radius: 50%; }
.leaders .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leaders .worth { font-family: var(--display); font-weight: 800; font-size: 1.15em; font-variant-numeric: tabular-nums; }
.leaders .pnl { font-size: 0.85em; font-variant-numeric: tabular-nums; min-width: 6ch; text-align: right; }
.leaders .pnl.up { color: #8fe0b4; }
.leaders .pnl.down { color: #ffad9f; }

.tape { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; overflow: hidden; align-content: start; }
.tape li { padding: 9px 12px; background: var(--felt-deep); border-radius: 8px; border-left: 4px solid var(--felt-line); display: grid; gap: 3px; }
.tape li.yes { border-left-color: var(--yes); }
.tape li.no { border-left-color: var(--no); }
.tape li.fresh { animation: fresh 1600ms ease-out; }
@keyframes fresh { from { background: #1f5c49; } }
.tape .line { font-size: clamp(14px, 1.05vw, 20px); font-weight: 600; }
.tape .q { font-size: clamp(12px, 0.85vw, 16px); color: var(--chalk-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tape .ops { display: grid; gap: 2px; }
.tape .op { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: clamp(11px, 0.8vw, 15px); color: var(--chalk-soft); }
.tape .op .tx { font-family: var(--code); color: var(--chalk); }
.page-screen .chip { background: rgba(244, 239, 226, 0.12); color: var(--chalk); }
.page-screen .chip.busy { background: #5c4a0a; color: #ffe08a; }
.page-screen .chip.held { background: #34306f; color: #d6d3ff; }
.page-screen .chip.good { background: #1b5a3c; color: #a6f0c8; }
.page-screen .chip.bad { background: #6a2620; color: #ffc4b9; }

.wire {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
  padding: 10px 14px;
  background: var(--felt-deep);
  border-radius: 8px;
  font-size: clamp(12px, 0.85vw, 16px);
}
.wire > b { font-family: var(--display); font-weight: 800; font-size: 1.35em; }
.wire ol { list-style: none; margin: 0; padding: 0; display: flex; gap: 18px; overflow: hidden; white-space: nowrap; }
.wire li { font-family: var(--code); color: var(--chalk-soft); }
.wire li .st { font-weight: 600; margin-right: 6px; }
.wire li .st.ok { color: #8fe0b4; }
.wire li .st.err { color: #ffad9f; }
.wire li:first-child { color: var(--chalk); }

.screen-empty { padding: 24px; border: 2px dashed var(--felt-line); border-radius: 10px; color: var(--chalk-soft); font-size: clamp(16px, 1.3vw, 24px); }

/* ---------------------------------------------------------------------------------------------------------------
   Host
   --------------------------------------------------------------------------------------------------------------- */
.page-host { background: var(--paper); color: var(--ink); }
.host { max-width: 1280px; margin: 0 auto; padding: 0 16px 48px; }
.host-band { background: var(--felt); color: var(--chalk); }
.host-band .inner { max-width: 1280px; margin: 0 auto; padding: 16px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.host-band .wordmark { font-size: 34px; }
.host-band nav { display: flex; gap: 16px; font-weight: 600; }
.host-band a { color: var(--chalk); }
.host-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 28px; margin-top: 20px; }
.host h2 { margin: 0 0 10px; font-family: var(--display); font-weight: 800; font-size: 28px; }
.host section { margin-bottom: 28px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; font-size: 15px; }
.facts dt { color: var(--ink-soft); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.notice { padding: 10px 12px; border-radius: 6px; background: #fff3c4; color: #5a4500; font-size: 14px; margin-top: 10px; }
.notice.bad { background: #f8dcd8; color: var(--lost); }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.hbtn { border: 1.5px solid var(--ink); background: var(--paper-raised); border-radius: 6px; padding: 7px 13px; font-weight: 600; font-size: 14px; }
.hbtn.primary { background: var(--felt); border-color: var(--felt); color: var(--chalk); }
.hbtn.yes { border-color: var(--yes-ink); color: var(--yes-ink); }
.hbtn.no { border-color: var(--no-ink); color: var(--no-ink); }
.hbtn.danger { border-color: var(--lost); color: var(--lost); }
.hbtn:disabled { opacity: 0.45; cursor: not-allowed; }
.host table { width: 100%; border-collapse: collapse; font-size: 14px; }
.host th { text-align: left; font-weight: 600; color: var(--ink-soft); padding: 6px 8px 6px 0; border-bottom: 1.5px solid var(--ink-faint); }
.host td { padding: 8px 8px 8px 0; border-bottom: 1px solid var(--ink-faint); vertical-align: top; font-variant-numeric: tabular-nums; }
.host .mk { padding: 14px 0; border-bottom: 1px solid var(--ink-faint); display: grid; gap: 8px; }
.host .mk .top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.host .mk h3 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 22px; line-height: 1.1; }
.host .mk .nums { font-size: 13px; color: var(--ink-soft); display: flex; gap: 14px; flex-wrap: wrap; }
.host form.create { display: grid; grid-template-columns: 1fr 110px auto; gap: 8px; align-items: end; }
.host label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.host input[type='text'], .host input[type='number'] { padding: 8px 10px; border-radius: 6px; border: 1.5px solid var(--ink-faint); background: var(--paper-raised); color: var(--ink); font-size: 15px; }
.host .log-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.host .log-head label { display: flex; gap: 6px; align-items: center; font-size: 14px; color: var(--ink); font-weight: 500; }
.host .log { max-height: 560px; overflow: auto; background: var(--paper-raised); border-radius: 8px; padding: 0 12px; }
.host .fine { font-size: 13px; color: var(--ink-soft); margin: 6px 0 0; }
.host td .sub { font-size: 12px; color: var(--ink-soft); margin-top: 3px; }
.host-band nav { flex-wrap: wrap; }
.house-card {
  margin-top: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) auto minmax(220px, 1fr);
  gap: 18px 28px;
  align-items: start;
  padding: 18px 20px;
  background: var(--paper-raised);
  border-radius: 10px;
  border-left: 6px solid var(--won);
}
.house-card.unfunded { border-left-color: var(--no); background: #fff7f0; }
.house-card h2 { margin: 0 0 4px; }
.house-card .addr { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.house-card .addr code { font-family: var(--code); font-size: clamp(14px, 1.5vw, 19px); font-weight: 600; background: var(--ink-faint); padding: 6px 10px; border-radius: 6px; overflow-wrap: anywhere; }
.house-card code { font-family: var(--code); font-size: 12px; overflow-wrap: anywhere; }
.house-figs { display: grid; gap: 10px; }
.house-figs > div { display: grid; gap: 2px; }
.house-figs b { font-family: var(--display); font-weight: 800; font-size: 34px; line-height: 1; font-variant-numeric: tabular-nums; }
.house-figs span { font-size: 13px; color: var(--ink-soft); }
.house-asset select { width: 100%; padding: 8px 10px; border-radius: 6px; border: 1.5px solid var(--ink-faint); background: var(--paper-raised); color: var(--ink); font-size: 14px; }
.house-card.sc { grid-template-columns: minmax(0, 2.2fr) minmax(220px, 1fr); }
.house-steps { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; }
.hstep { border: 1.5px solid var(--ink-faint); border-radius: 8px; padding: 10px 12px; background: var(--paper); }
.hstep.now { border-color: var(--yes); background: var(--paper-raised); }
.hstep.done { opacity: 0.8; }
.hstep-head { display: flex; gap: 10px; align-items: center; }
.hstep-head h3 { margin: 0; font-family: var(--display); font-weight: 800; font-size: 20px; flex: 1; }
.hstep-head .n { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--ink-faint); font-weight: 700; font-size: 13px; }
.hstep.now .hstep-head .n { border-color: var(--yes); color: var(--yes-ink); }
.hstep.done .hstep-head .n { background: var(--won); border-color: var(--won); color: #fff; }
.hstep input[type='text'] { padding: 7px 9px; border-radius: 6px; border: 1.5px solid var(--ink-faint); background: var(--paper-raised); color: var(--ink); font-size: 14px; min-width: 0; flex: 1 1 220px; }
.hstep .big { font-family: var(--display); font-weight: 800; font-size: 26px; }
.fallback { margin-top: 8px; font-size: 14px; }
.fallback summary { cursor: pointer; font-weight: 600; }
.backup { display: grid; gap: 8px; padding: 10px; border: 1.5px dashed var(--ink-faint); border-radius: 8px; }
.backup p { margin: 0; font-size: 14px; }
.backup.shown { border-color: var(--lost); background: #fff6f4; }
.backup code { display: block; word-break: break-all; font-family: var(--code); font-size: 12px; background: var(--felt-deep); color: var(--chalk); padding: 8px; border-radius: 6px; user-select: all; }
@media (max-width: 960px) { .house-card.sc { grid-template-columns: 1fr; } }
.linkish { border: 0; background: none; padding: 0; color: var(--yes-ink); text-decoration: underline; font-size: 12px; cursor: pointer; }
@media (max-width: 960px) {
  .house-card { grid-template-columns: 1fr; }
  .house-figs { grid-auto-flow: column; justify-content: start; gap: 22px; }
}
.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; justify-items: end; z-index: 50; }
.toast { max-width: 420px; padding: 12px 14px; border-radius: 8px; background: var(--ink); color: #fff; font-size: 14px; }

@media (max-width: 960px) {
  .tote { height: auto; }
  .tote-main { grid-template-columns: 1fr; overflow: visible; }
  .side-col { overflow: visible; }
  .host-grid { grid-template-columns: 1fr; }
  .host form.create { grid-template-columns: 1fr 90px; }
  .host form.create button { grid-column: 1 / 3; }
}
@media (max-width: 560px) {
  .board { grid-template-columns: 1fr; }
  .board .spark { grid-column: 1; }
  .tote-head .bank { width: 100%; justify-content: space-between; }
  .bank .fig { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Money on its way: accepted by Finance, not yet in the wallet, so not yet bettable. */
.purse .onway-total { color: #ffd59e; margin-top: 2px; }
.onway { margin: 12px 16px 0; padding: 12px 14px; border: 1px dashed var(--ink-soft); border-radius: 12px; background: var(--paper-raised, #fff); }
.onway h3 { margin: 0; font-size: 15px; }
.onway .onway-note { margin: 2px 0 8px; font-size: 13px; color: var(--ink-soft); }
.onway ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.onway li b { font-variant-numeric: tabular-nums; }
.onway li .q { color: var(--ink-soft); }
.slip .onway-fig b { color: #9a5b00; }
.slip .error { color: var(--lost, #b3261e); font-size: 13px; font-weight: 600; margin-top: 4px; }
.leaders .otw { display: block; font-size: 0.7em; font-weight: 500; color: var(--chalk-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Joining with an invite code; a removed player; a player the host has paused. */
.join .notice { color: var(--chalk); background: rgba(255, 213, 158, 0.12); border-left: 4px solid #ffd59e; padding: 10px 12px; border-radius: 0 8px 8px 0; }
.join input#invite { text-transform: uppercase; letter-spacing: 0.08em; font-family: var(--mono, ui-monospace, Menlo, monospace); }
.blocked { margin: 12px 16px 0; padding: 12px 14px; border-radius: 12px; background: #fdecea; border: 1px solid #f3b8b0; color: #7a1f14; }
.blocked h3 { margin: 0 0 4px; font-size: 16px; }
.blocked p { margin: 0; font-size: 14px; }

/* /host: the invite code and the per-player controls. */
.invite { display: grid; gap: 6px; margin: 0 0 12px; padding: 10px 12px; border: 1px dashed var(--ink-soft); border-radius: 10px; }
.invite .invite-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.invite .invite-url { overflow-wrap: anywhere; font-size: 13px; }
.invite .invite-off { margin: 0; color: var(--lost); font-weight: 600; }
.host tr.player-row td { border-bottom: 0; }
.host tr.controls td { padding-top: 0; }
.host tr.controls .row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.host .fund-amount { width: 6.5em; padding: 6px 8px; border: 1.5px solid var(--ink-faint, #ccc); border-radius: 6px; font: inherit; font-size: 14px; }

/* Save my access (phone), re-issued access (/host): the resume link as text and as a QR. */
.access-open { margin-top: 6px; border: 1px solid var(--felt-line); background: transparent; color: var(--chalk); border-radius: 999px; padding: 4px 12px; font: 600 13px var(--body); }
.access .access-body { padding: 14px 16px 18px; display: grid; gap: 12px; overflow-y: auto; }
.warn { margin: 0; padding: 10px 12px; border-radius: 8px; background: #fff4ec; border-left: 4px solid var(--no, #f2762e); font-size: 14px; }
.warn.strong { background: #fdecea; border-left-color: var(--lost); }
.qr { background: #fff; padding: 6px; border-radius: 8px; justify-self: center; width: min(260px, 70vw); line-height: 0; }
.qr svg { width: 100%; height: auto; display: block; }
.access-link { width: 100%; font: 13px var(--mono, ui-monospace, Menlo, monospace); padding: 8px; border-radius: 6px; border: 1px solid var(--ink-faint, #ccc); resize: none; overflow-wrap: anywhere; }
.join.moved h2 { margin: 0; font-family: var(--display); font-size: 30px; color: var(--chalk); }
.reissued { display: grid; gap: 10px; margin: 0 0 12px; padding: 12px; border: 2px solid var(--lost); border-radius: 10px; background: #fffaf5; }
.reissued .qr { width: 200px; justify-self: start; border: 1px solid var(--ink-faint, #ddd); }
.reissued p { margin: 0; font-size: 14px; }
