/* ===========================================================================
   MARKET MAKER — by Moontower
   Moontower indigo, sharpened. The palette is unchanged from the terminal
   build — same accent, same reserved maroon, same semantic green and red — but
   the surface it sits on now has depth. Three real levels: the page, the panel,
   and the one card you are being asked to act on, which is genuinely raised off
   the page rather than outlined on it.

   Three typefaces, each with a job. Lexend names things, Inter says things,
   JetBrains Mono counts things. Every figure is mono, tabular, and tracked in
   at display size, which is what monospace needs to stop reading as a string of
   characters and start reading as a number.
   =========================================================================== */

/* Variable fonts, self-hosted — one file per family covers every weight used,
   and nothing on this page reaches for a CDN. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/fonts/jetbrains-mono.woff2") format("woff2");
}
@font-face {
  font-family: "Lexend";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/lexend.woff2") format("woff2");
}

:root {
  /* The three levels. Nothing on screen sits between them. */
  --bg: #06070C;
  --l1: #0B0D16;
  --l2: #11141F;
  --l3: #171B29;

  /* Kept under their old names — the panel and row surfaces are now levels. */
  --bg-panel: var(--l1);
  --bg-row: var(--l3);
  --bg-row-alt: var(--l1);

  /* Moontower purple, and the room around it. */
  --accent: #5863F8;
  --accent-bright: #838CFF;
  --accent-deep: #232866;
  --accent-glow: rgba(88, 99, 248, 0.16);
  --on-accent: #FFFFFF;

  /* Raising the surfaces raises the floor these have to clear. Measured against
     the *lightest* surface they ever sit on (--l3), not against black, which is
     the easy case: label 5.2:1, secondary 6.2:1, tertiary 4.8:1 — all past the
     4.5 needed at these sizes. The old #6B74D8 was 5.1:1 on black but only
     4.2:1 on a raised card, which is exactly the failure that measuring rather
     than eyeballing was meant to catch. */
  --accent-dim: #7C85E4;   /* every small-caps label */
  --grey: #949BB0;         /* secondary prose */
  --faint: #7F87A0;        /* tertiary: sub-labels, notes */
  --grey-dark: #2A3040;    /* disabled and placeholder only — never information */

  /* Reserved, per brand, for what is missing or owed. */
  --maroon: #C77F95;

  /* Semantic, and deliberately not the accent: profit and loss must stay
     unambiguous even on a screen that is otherwise entirely indigo. */
  --up: #35D07F;
  --down: #FF5E5B;
  --cyan: #63C7FF;

  --white: #F2F4F8;

  --rule: rgba(255, 255, 255, 0.07);
  --rule-bright: rgba(255, 255, 255, 0.11);

  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --disp: "Lexend", "Inter", ui-sans-serif, system-ui, sans-serif;

  --gap: 8px;
  --r: 12px;

  /* One raised surface, defined once: an inner highlight along the top edge and
     a long soft shadow beneath. This is most of the difference between a screen
     that is styled and one that is designed. */
  --lift: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 18px 40px -24px rgba(0, 0, 0, 0.9);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--white);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

body { overflow-x: hidden; }

#app { min-height: 100%; display: flex; flex-direction: column; }

/* --- Type ---------------------------------------------------------------- */

h1, h2, h3 { margin: 0; font-family: var(--disp); font-weight: 600; letter-spacing: -0.015em; }
h1 { font-size: 20px; }
h2 { font-size: 15px; }
a { color: var(--accent-bright); }

.dim   { color: var(--accent-dim); }
.grey  { color: var(--grey); }
.white { color: var(--white); }
.up    { color: var(--up); }
.down  { color: var(--down); }
.cyan  { color: var(--cyan); }

/* Every figure is mono and tracked in — see the file header. */
.num, .big, .huge, .qty, .n-v, .n-qty, .n-pip, .picked, .m, .p, .n-code, .code-in {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "zero" 1;
  letter-spacing: -0.028em;
}
.num   { text-align: right; }
.center{ text-align: center; }
.big   { font-size: 28px; font-weight: 500; }
.huge  { font-size: 46px; font-weight: 500; }
.tiny  { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; }
.strong{ font-weight: 600; }

/* A dollar amount is not a price. Shrinking and fading the symbol is what makes
   $112 read as money rather than as four characters. Display sizes only — in a
   table the symbol is doing column work. */
.cur { font-size: 0.72em; opacity: 0.62; margin-right: 1px; }

/* --- Top bar ------------------------------------------------------------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  font-size: 12px;
  color: var(--grey);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent);
  border-bottom: 1px solid var(--rule);
  flex-wrap: wrap;
}
.topbar .spacer { margin-left: auto; }
.topbar .chip {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--accent-glow);
  color: var(--accent-bright);
  padding: 3px 10px;
  border-radius: 999px;
}
.topbar .chip.live { background: rgba(53, 208, 127, 0.14); color: var(--up); }
.topbar .chip.off  { background: rgba(255, 94, 91, 0.14); color: var(--down); }
.topbar .phase { text-transform: uppercase; letter-spacing: 0.1em; font-size: 11px; }

/* The brand, and only the brand. The game is title case because it is a proper
   name; the house is lowercase because that is how moontower sets itself. */
.topbar .brand {
  font-family: var(--disp);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: #fff;
}
.topbar .by {
  font-family: var(--mono);
  font-size: 10px; letter-spacing: 0.1em;
  color: var(--faint); margin-left: -4px;
}

/* On a phone the bar is the wordmark, the table and the connection — the phase
   is already spelled out by the instruction bar underneath it. */
@media (max-width: 520px) {
  .topbar { gap: 9px; padding: 11px 13px; }
  .topbar .phase, .topbar .by { display: none; }
}

/* --- Layout -------------------------------------------------------------- */

.wrap  { padding: var(--gap); display: flex; flex-direction: column; gap: var(--gap); flex: 1; }
.cols  { display: grid; gap: var(--gap); grid-template-columns: 1fr 1fr; align-items: start; }
.cols3 { display: grid; gap: var(--gap); grid-template-columns: 1fr 1fr 1fr; align-items: start; }
.cols-2-1 { display: grid; gap: var(--gap); grid-template-columns: 2fr 1fr; align-items: start; }

@media (max-width: 900px) {
  .cols, .cols3, .cols-2-1 { grid-template-columns: 1fr; }
}

/* --- Panels -------------------------------------------------------------- */

.panel {
  border: 1px solid var(--rule);
  background: var(--l1);
  border-radius: var(--r);
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.panel > header {
  font-family: var(--disp);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #fff;
  padding: 11px 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent);
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  gap: 10px;
}
.panel > header .spacer { margin-left: auto; }
.panel > header .note {
  font-family: var(--mono);
  font-size: 11px; font-weight: 400; letter-spacing: 0;
  color: var(--faint);
}
.panel .body { padding: 12px 14px; }
.panel .body.flush { padding: 0; }
.panel.ghost > header { color: var(--grey); }

/* --- Tables -------------------------------------------------------------- */

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left;
  font-family: var(--mono);
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-dim);
  border-bottom: 1px solid var(--rule);
  padding: 8px 14px;
  white-space: nowrap;
}
td {
  padding: 8px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  white-space: nowrap;
}
tbody tr:first-child td { border-top: none; }
tbody tr.me td { background: var(--accent-glow); }
tbody tr.me td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
th.num, td.num { text-align: right; font-family: var(--mono); }
.scroll-x { overflow-x: auto; }

/* --- Controls ------------------------------------------------------------ */

button, .btn {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  background: var(--l3);
  color: var(--white);
  border: 1px solid var(--rule-bright);
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
button:hover:not(:disabled) { background: #1E2334; border-color: rgba(255, 255, 255, 0.16); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { color: var(--grey-dark); background: var(--l2); border-color: var(--rule); cursor: not-allowed; }
button:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 2px; }

/* The commit is a different species of button: a vertical gradient, an inner
   top highlight, a coloured shadow, and a real press. */
button.primary {
  background: linear-gradient(180deg, var(--accent-bright), var(--accent));
  color: var(--on-accent);
  border: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 10px 26px -12px rgba(88, 99, 248, 0.75);
  transition: transform 120ms ease, box-shadow 120ms ease;
}
button.primary:hover:not(:disabled) {
  background: linear-gradient(180deg, var(--accent-bright), var(--accent));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 14px 30px -12px rgba(88, 99, 248, 0.95);
}
button.primary:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
button.primary:disabled { background: var(--l2); color: var(--grey-dark); box-shadow: none; }

button.danger { background: transparent; color: var(--down); border-color: rgba(255, 94, 91, 0.4); }
button.danger:hover:not(:disabled) { background: rgba(255, 94, 91, 0.14); border-color: var(--down); }
button.ghost { background: transparent; color: var(--grey); border-color: var(--rule); }
button.ghost:hover:not(:disabled) { background: var(--l2); color: var(--white); }

button.buy  { background: transparent; color: var(--up); border-color: rgba(53, 208, 127, 0.4); }
button.buy:hover:not(:disabled) { background: rgba(53, 208, 127, 0.14); }
button.buy.on { background: var(--up); color: #04140A; border-color: var(--up); }
button.sell { background: transparent; color: var(--down); border-color: rgba(255, 94, 91, 0.4); }
button.sell:hover:not(:disabled) { background: rgba(255, 94, 91, 0.14); }
button.sell.on { background: var(--down); color: #1A0605; border-color: var(--down); }
button.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

button.wide { width: 100%; }
button.lg { font-size: 16px; padding: 15px 18px; }
button.tiny { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; padding: 5px 10px; }

input, select {
  font-family: var(--mono);
  font-size: 15px;
  background: rgba(0, 0, 0, 0.5);
  color: var(--white);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 10px 12px;
  width: 100%;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(88, 99, 248, 0.22);
}
input::placeholder { color: var(--grey-dark); }
input:disabled, select:disabled { color: var(--grey-dark); border-color: var(--rule); }
input.num { text-align: right; font-size: 20px; font-weight: 500; }

label.field { display: block; margin-bottom: 12px; }
label.field > span {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-dim);
  margin-bottom: 6px;
}

.row { display: flex; gap: var(--gap); align-items: center; flex-wrap: wrap; }
.row.tight { gap: 5px; }
.stack { display: flex; flex-direction: column; gap: var(--gap); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }

/* Price flash on a new print */
@keyframes flash-up   { from { background: rgba(53, 208, 127, 0.3); } to { background: transparent; } }
@keyframes flash-down { from { background: rgba(255, 94, 91, 0.3); }  to { background: transparent; } }
.flash-up   { animation: flash-up 700ms ease-out; }
.flash-down { animation: flash-down 700ms ease-out; }

/* --- The ladder ---------------------------------------------------------- */

.ladder { display: grid; grid-template-columns: repeat(5, 1fr); text-align: center; }
.ladder > div { border-right: 1px solid var(--rule); padding: 14px 6px; }
.ladder > div:last-child { border-right: none; }
.ladder .label {
  font-family: var(--mono);
  font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent-dim); margin-bottom: 6px;
}
.ladder .qty { font-family: var(--mono); font-size: 26px; font-weight: 500; letter-spacing: -0.028em; }
.ladder .bid   .qty { color: var(--up); }
.ladder .offer .qty { color: var(--down); }
.ladder .imb { background: var(--l2); }
.ladder .imb .qty { font-size: 30px; }

/* --- Status strip -------------------------------------------------------- */

.waiting { display: flex; gap: 6px; flex-wrap: wrap; }
.pill {
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 3px 11px;
  font-size: 12px;
  color: var(--grey);
}
.pill.ready { border-color: rgba(53, 208, 127, 0.45); color: var(--up); background: rgba(53, 208, 127, 0.1); }
.pill.late  { border-color: rgba(199, 127, 149, 0.5); color: var(--maroon); background: rgba(199, 127, 149, 0.1); }
.pill.gone  { border-color: var(--rule); color: var(--grey-dark); text-decoration: line-through; }

.tape {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--grey);
  max-height: 190px;
  overflow-y: auto;
  padding: 10px 14px;
}
.tape div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tape .t { color: var(--faint); margin-right: 8px; }

/* --- Home / join --------------------------------------------------------- */

.home { max-width: 460px; margin: 0 auto; padding: 48px 16px; width: 100%; }
.brand { text-align: center; margin-bottom: 30px; }
.brand .logo {
  font-family: var(--disp);
  font-size: 40px; font-weight: 300; letter-spacing: -0.03em; color: #fff;
}
.brand .by {
  font-family: var(--mono);
  font-size: 12px; letter-spacing: 0.18em; color: var(--accent-dim); margin-top: 4px;
}
.brand .sub {
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.24em; color: var(--faint);
  margin-top: 10px; text-transform: uppercase;
}
.brand .rule { border-top: 1px solid var(--rule); margin-top: 18px; }

/* The rules link. Quiet by default — it is a way out of the screen, not a
   call to action — but it has to be findable by somebody who is stuck, so it
   gets a real hit area and comes up to full accent on hover. */
.howto {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  font-size: 13px;
}
.howto a {
  color: var(--accent-dim);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 8px;
}
.howto a:hover,
.howto a:focus-visible { color: var(--accent-bright); background: rgba(88, 99, 248, 0.10); }
.howto .sep { color: var(--grey-dark); }

/* Inside the lobby card it sits under a banner rather than under a panel, so
   it needs less air above it. */
.n-act .howto { margin-top: 12px; }

.code-in { font-size: 34px; text-align: center; letter-spacing: 0.28em; text-transform: uppercase; }

.err {
  border: 1px solid rgba(255, 94, 91, 0.4);
  background: rgba(255, 94, 91, 0.1);
  color: var(--down);
  border-radius: 10px; padding: 10px 12px; font-size: 13px;
}
.ok {
  border: 1px solid rgba(53, 208, 127, 0.4);
  background: rgba(53, 208, 127, 0.1);
  color: var(--up);
  border-radius: 10px; padding: 10px 12px; font-size: 13px;
}

/* A waiting state is a slow pulse, not a terminal cursor. */
.blink::after {
  content: "";
  display: inline-block;
  width: 7px; height: 7px; border-radius: 999px;
  background: currentColor;
  margin-left: 9px; vertical-align: middle;
  animation: pulse-dot 2.4s ease-out infinite;
}
@keyframes pulse-dot {
  0%   { box-shadow: 0 0 0 0 rgba(131, 140, 255, 0.55); }
  70%  { box-shadow: 0 0 0 9px rgba(131, 140, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(131, 140, 255, 0); }
}

.banner {
  border-radius: var(--r);
  padding: 13px 15px;
  text-align: center;
  font-family: var(--disp);
  font-weight: 600; font-size: 15px; letter-spacing: -0.01em;
  color: #fff;
  background: radial-gradient(120% 180% at 0% 50%,
    rgba(88, 99, 248, 0.55), rgba(88, 99, 248, 0.14) 60%, transparent);
  border: 1px solid rgba(88, 99, 248, 0.42);
}
.banner.wait { background: var(--l2); border-color: var(--rule); color: var(--grey); }

@media print { body { background: #fff; color: #000; } }

/* ===========================================================================
   THE PLAYER SCREEN AND THE BIG BOARD
   Everything caps its width — full bleed was the original problem.
   =========================================================================== */

/* width and min-width are load-bearing, not belt-and-braces: these are flex
   items inside #app, and an auto-margined flex item with only a max-width will
   sit at that width even when the viewport is narrower, scrolling the page
   sideways on a phone. */
.n-wrap  { width: 100%; min-width: 0; max-width: 460px;  margin: 0 auto; padding: 0 0 24px; }
.n-board { width: 100%; min-width: 0; max-width: 1500px; margin: 0 auto; padding: 0 10px 24px; }

.n-lab {
  font-family: var(--mono);
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent-dim);
}

/* Section divider — a quiet rule, so the one lit element on screen can mean
   "this is what the table is waiting for". */
.n-rule {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 14px 8px;
  font-family: var(--mono);
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent-dim);
}
.n-rule span:last-child { color: var(--faint); letter-spacing: 0.06em; text-transform: none; }
.n-rule.wait { color: var(--faint); }

/* --- player: the standing readout ---------------------------------------- */

.n-strip {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  padding: 16px 16px 15px;
  background: linear-gradient(180deg, rgba(88, 99, 248, 0.05), transparent 70%);
}
.n-strip .n-v { font-size: 24px; font-weight: 500; line-height: 1.2; }

/* A second line under each figure. Nothing new is computed — long/short, the
   fill count and the rank are all on screen already, further down. Bringing
   them up means the strip answers "how am I doing" without a scroll. */
.n-sub { font-family: var(--mono); font-size: 11px; color: var(--faint); margin-top: 1px; }
/* .n-sub ties with a bare .up/.down and wins on order, so the sign colours have
   to be restated — otherwise the round's move reads grey. */
.n-sub.up   { color: var(--up); }
.n-sub.down { color: var(--down); }

/* The mark carries its own path. */
.markcell { display: flex; align-items: flex-end; gap: 8px; }
.spark { display: block; margin-bottom: 5px; flex: 0 0 auto; }

/* --- player: the action block -------------------------------------------- */

.n-act {
  margin: 14px;
  padding: 16px;
  border-radius: 14px;
  background: var(--l2);
  border: 1px solid var(--rule-bright);
  box-shadow: var(--lift);
}
.n-act.done  { background: var(--l1); }
.n-act.plain { background: var(--l1); box-shadow: none; }
.n-act .split { margin-bottom: 10px; }

/* One decision, one control: a two-state choice belongs in a single track, and
   the secondary choice is set smaller so it does not compete. */
.n-seg {
  display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--rule);
  border-radius: 999px;
  margin-bottom: 10px;
}
.n-seg.mode { margin-bottom: 12px; }
.n-seg button {
  font-size: 15px; font-weight: 600;
  background: transparent; color: var(--grey);
  border: none; border-radius: 999px; padding: 10px 0;
}
.n-seg.mode button { font-size: 13px; padding: 7px 0; font-weight: 500; }
.n-seg button:hover:not(:disabled) { background: rgba(255, 255, 255, 0.05); color: var(--white); border: none; }
.n-seg button.on { background: var(--accent); color: var(--on-accent); }
.n-seg button.on.buy  { background: var(--up);   color: #04140A; }
.n-seg button.on.sell { background: var(--down); color: #1A0605; }
/* :hover:not(:disabled) out-specifies a bare .on, so hovering the segment you
   have already chosen used to wash it grey — the selected state disappearing
   under the cursor that selected it. Restated at hover specificity. */
.n-seg button.on:hover:not(:disabled) { background: var(--accent); color: var(--on-accent); }
.n-seg button.on.buy:hover:not(:disabled)  { background: var(--up);   color: #04140A; }
.n-seg button.on.sell:hover:not(:disabled) { background: var(--down); color: #1A0605; }

.n-qty {
  font-size: 40px; font-weight: 500; text-align: right;
  padding: 8px 15px; margin-bottom: 11px;
  letter-spacing: -0.035em;
}

/* The economics read as a ledger, not as a sentence. */
.n-econ {
  display: grid; grid-template-columns: 1fr auto; gap: 5px 12px;
  padding: 2px 2px 14px;
  font-size: 13px;
}
.n-econ .k { color: var(--faint); }
.n-econ .k i { font-style: normal; opacity: 0.75; }
.n-econ .val {
  font-family: var(--mono); font-size: 16px; font-weight: 500;
  color: var(--white); text-align: right; letter-spacing: -0.028em;
}
.n-econ .val.up   { color: var(--up); }
.n-econ .val.down { color: var(--down); }
.n-econ .val.dim  { color: var(--grey); }

.n-go   { width: 100%; padding: 17px 0; font-size: 16px; border-radius: var(--r); }
.n-pass { margin-top: 8px; width: 100%; font-size: 13px; padding: 9px 0; }
.n-note { margin: 12px 0 0; font-size: 12px; line-height: 1.5; color: var(--faint); }

.n-done {
  display: flex; align-items: baseline; gap: 10px;
  font-size: 17px; font-weight: 600; margin-bottom: 12px;
}
.n-done .spacer { margin-left: auto; }
.n-winner {
  font-family: var(--mono); font-size: 24px; font-weight: 500;
  text-align: center; padding: 12px 0 2px; letter-spacing: -0.028em;
}

.n-waiting { padding: 4px 14px 8px; font-size: 12px; color: var(--faint); }

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

.n-cards, .n-hand { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.n-cards { margin-bottom: 14px; }
.n-hand  { padding: 0 14px; }
.n-card {
  background: var(--l3);
  border: 1px solid var(--rule);
  border-radius: 10px;
  text-align: center;
  padding: 8px 5px;
}
.n-card .g { font-size: 22px; font-weight: 500; line-height: 1.1; }
.n-card .picked { font-size: 17px; font-weight: 500; }
.n-card .held { font-family: var(--mono); font-size: 10px; color: var(--faint); margin-bottom: 5px; }
.n-card.spent { opacity: 0.35; }
.n-card.up   .g { color: var(--up); }
.n-card.down .g { color: var(--down); }
.n-card.multiply .g, .n-card.add .g { color: var(--cyan); }
.n-card .split { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; margin: 0; }
.n-card .split button { padding: 3px 0; font-size: 13px; border-radius: 7px; }

/* --- the arithmetic behind the print -------------------------------------- */

.n-flow {
  padding: 10px 14px; font-size: 12px; color: var(--faint);
  border-bottom: 1px solid var(--rule);
}
.n-flow b { font-family: var(--mono); color: var(--white); font-weight: 500; }
.n-flow i { font-style: normal; opacity: 0.8; }
.n-flow.big { font-size: 15px; padding: 14px 20px; border-block: 1px solid var(--rule); }

.n-legend {
  padding: 10px 14px;
  font-size: 12px; line-height: 1.5; color: var(--faint);
}
.n-legend .up, .n-legend .down { font-weight: 600; }

/* --- dashboard ------------------------------------------------------------ */

.n-top {
  display: grid; grid-template-columns: auto 1fr auto;
  align-items: center;
  background: linear-gradient(180deg, rgba(88, 99, 248, 0.05), transparent 70%);
  border-block: 1px solid var(--rule);
}
.n-mark { padding: 16px 22px; border-right: 1px solid var(--rule); }
.n-mark .markcell { align-items: flex-end; gap: 14px; }
.n-mark .m {
  font-family: var(--mono);
  font-size: 68px; font-weight: 500; line-height: 0.9;
  letter-spacing: -0.04em; color: #fff;
}
.n-mark .d { font-family: var(--mono); font-size: 20px; font-weight: 500; margin-top: 6px; }
.n-print {
  padding: 16px 22px; border-left: 1px solid var(--rule);
  text-align: right; min-width: 150px;
}
.n-print .p { font-family: var(--mono); font-size: 42px; font-weight: 500; line-height: 1; color: #fff; }
.n-top .ladder { border: none; }

.n-cols { display: grid; grid-template-columns: 1.1fr 0.9fr; }
.n-cols > div:first-child { border-right: 1px solid var(--rule); }
.n-pad { padding: 14px; }
.n-host { display: flex; flex-direction: column; gap: 10px; }
.n-host .row { gap: 8px; }

.n-lobby { text-align: center; padding: 26px 0 20px; border-bottom: 1px solid var(--rule); }
.n-code { font-size: 56px; font-weight: 500; letter-spacing: 0.24em; color: #fff; }
.n-seats { margin-top: 16px; display: flex; justify-content: center; }

.n-foot {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 14px 14px 0; margin-top: 14px;
  border-top: 1px solid var(--rule);
}
.n-foot .spacer { margin-left: auto; }

/* Read from across a room: the dashboard scales up, the player screen does not. */
.n-board { font-size: 16px; }
.n-board table { font-size: 15px; }
.n-board .ladder .qty { font-size: 34px; }
.n-board .ladder .imb .qty { font-size: 42px; }

@media (max-width: 900px) {
  .n-top  { grid-template-columns: 1fr; }
  .n-cols { grid-template-columns: 1fr; }
  .n-cols > div:first-child { border-right: none; }
  .n-mark, .n-print { border: none; text-align: left; }
}

/* ===========================================================================
   DICE BOARD
   A die alone says nothing. What matters is the roll, what the cards added, and
   which side of the line that lands on — so each face carries its own
   arithmetic and its own consequence in words.
   =========================================================================== */

.n-dice { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }

.n-die {
  border: 1px solid var(--rule);
  background: var(--l2);
  border-radius: var(--r);
  padding: 12px 7px 13px;
  text-align: center;
  display: flex; flex-direction: column; gap: 4px; align-items: center;
  min-height: 136px;
}
.n-die-cap {
  font-family: var(--mono);
  font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent-dim);
}
.n-pip { font-size: 36px; font-weight: 500; line-height: 1; color: var(--grey-dark); }
.n-die.locked         { border-color: var(--rule-bright); }
.n-die.locked .n-pip  { color: var(--accent-bright); }
.n-die.next {
  border-color: var(--accent);
  background: var(--l3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 0 3px rgba(88, 99, 248, 0.16);
}
.n-die.rolling .n-pip { animation: tumble 90ms steps(1) infinite; color: var(--accent-bright); }

@keyframes tumble {
  0%   { opacity: 1; transform: translateY(0); }
  50%  { opacity: 0.35; transform: translateY(-3px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* The arithmetic: roll, modifier, total, and the bar it had to clear. */
.n-die-sum { font-family: var(--mono); font-size: 11px; color: var(--faint); line-height: 1.35; }
.n-die-sum b { color: var(--white); font-weight: 500; }
.n-die-sum i { font-style: normal; opacity: 0.75; }

.n-die-verdict {
  font-family: var(--disp);
  font-size: 14px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.15;
}
.n-die-ask   { font-size: 11px; color: var(--faint); line-height: 1.4; }
.n-die-ask b { font-family: var(--mono); color: var(--accent-bright); font-weight: 500; }
.n-die-mod   { font-family: var(--mono); font-size: 10px; color: var(--accent-dim); }

/* Outcome colours have to beat the generic .up/.down utilities. */
.n-die-verdict.up   { color: var(--up); }
.n-die-verdict.down { color: var(--down); }
.n-die-verdict.cyan { color: var(--cyan); }
.n-die-verdict.dim  { color: var(--grey); }
.n-die.up   { border-color: rgba(53, 208, 127, 0.45); }
.n-die.down { border-color: rgba(255, 94, 91, 0.45); }

.n-outcome {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin-top: 10px; padding: 12px 14px;
  border: 1px solid var(--rule-bright);
  background: var(--l2);
  border-radius: var(--r);
  box-shadow: var(--lift);
  font-size: 15px; font-weight: 600;
}
.n-outcome .spacer { margin-left: auto; }
.n-outcome .dim    { font-weight: 400; }
.n-outcome b       { font-family: var(--mono); font-weight: 500; letter-spacing: -0.028em; }
/* A chip rather than a divider rule: on a narrow screen this wraps onto its own
   line, where a left border reads as a stray tick floating in space. */
.n-outcome .n-yours {
  font-family: var(--mono); font-weight: 500; letter-spacing: -0.028em;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  padding: 2px 11px;
}

.n-replay { padding: 0 14px 4px; }

/* ===========================================================================
   ATTENTION
   Exactly one thing on screen should be shouting at any moment — and it should
   read as lit rather than as an alert banner.
   =========================================================================== */

.n-cta {
  margin: 2px 14px 0;
  padding: 12px 15px;
  border-radius: var(--r);
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  font-weight: 600; font-size: 15px; letter-spacing: -0.01em;
  color: #fff;
  background: radial-gradient(120% 180% at 0% 50%,
    rgba(88, 99, 248, 0.55), rgba(88, 99, 248, 0.14) 60%, transparent);
  border: 1px solid rgba(88, 99, 248, 0.42);
  animation: cta-in 260ms ease-out;
}
@keyframes cta-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; } }

.n-cta .who { display: flex; align-items: center; min-width: 0; }
.n-cta .s {
  font-family: var(--mono); font-size: 12px; font-weight: 400;
  color: var(--accent-bright); white-space: nowrap;
}
.n-cta .dot {
  width: 7px; height: 7px; border-radius: 999px;
  background: var(--accent-bright);
  margin-right: 9px; flex: 0 0 auto;
  animation: pulse-dot 2.4s ease-out infinite;
}

/* Everything that is not the current move steps back until it is done. */
/* The book used to fade to 38% while you owed the table an action. Played at a
   real table, that meant the thing you were trying to read while deciding was
   the one thing you could not read. It stays lit. */
.n-secondary { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .n-cta, .n-cta .dot, .blink::after, .n-die.rolling .n-pip { animation: none; }
  button, button.primary { transition: none; }
  .flash-up, .flash-down { animation: none; }
}

@media (max-width: 460px) {
  .n-dice { grid-template-columns: repeat(2, 1fr); }
}

/* ===========================================================================
   OPTIONS
   A montage, laid out the way a board is: calls left, the strike spine down the
   middle, puts right, strikes increasing downward. Every price here was
   discovered by the auction — a contract it has not priced shows a dash, never
   a guess.
   =========================================================================== */

.o-tables { display: grid; gap: 10px; padding: 0 14px; }
@media (min-width: 900px) { .o-tables { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); } }

.o-table {
  background: var(--l1);
  border: 1px solid var(--ring);
  border-radius: var(--r);
  overflow: hidden;
}
/* The expiry currently on the block is the one thing lit. */
.o-table.live {
  background: var(--l2);
  border-color: rgba(88, 99, 248, 0.42);
  box-shadow: var(--lift);
}
.o-cap {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent-dim);
  border-bottom: 1px solid var(--ring);
}
.o-cap .dim { letter-spacing: 0.06em; text-transform: none; color: var(--faint); }
.o-live {
  margin-left: auto;
  background: var(--accent-glow); color: var(--accent-bright);
  border-radius: 999px; padding: 2px 9px; letter-spacing: 0.06em; text-transform: none;
}

.o-montage { font-size: 13px; }
.o-montage th { padding: 6px 10px; font-size: 9px; }
.o-montage td { padding: 5px 10px; border-top: 1px solid rgba(255, 255, 255, 0.04); }
.o-montage .o-kinds th {
  text-align: center; color: var(--faint); letter-spacing: 0.16em;
  border-bottom: 1px solid var(--ring);
}

/* The spine: the one column that is not a quote. */
.o-strike {
  text-align: center !important;
  font-family: var(--mono); font-weight: 600;
  color: var(--white);
  background: rgba(255, 255, 255, 0.03);
  border-inline: 1px solid var(--ring);
}
.o-montage tr.o-atm td { background: var(--accent-glow); }
.o-montage tr.o-atm .o-strike { color: var(--accent-bright); }

.o-px { font-family: var(--mono); color: var(--white); }
.o-side { text-align: center; font-family: var(--mono); font-size: 12px; width: 3.2em; }
.o-none { color: var(--grey-dark); }
/* The house has an order here, and will not say which way until the gate shuts. */
.o-ask { color: var(--accent-bright); font-weight: 600; }

/* --- quoting -------------------------------------------------------------- */

.o-quote {
  background: var(--l3);
  border: 1px solid var(--ring);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 8px;
}
.o-quote-cap {
  display: flex; align-items: center;
  font-family: var(--mono); font-size: 12px;
  margin-bottom: 8px;
}
.o-quote-cap .spacer { margin-left: auto; }
.o-quote-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.o-quote-grid input { font-size: 14px; padding: 8px 9px; text-align: right; border-radius: 8px; }
.o-quote-grid input::placeholder { font-size: 11px; letter-spacing: 0.06em; }

.o-setup { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); align-items: end; }

/* Sizes read as counts, prices read as money — so they are set differently and
   coloured differently, and the price carries its own dollar sign. */
.o-cur { color: var(--faint); margin-right: 1px; font-size: 0.82em; }

.o-quote-grid { align-items: stretch; }
.o-size {
  color: var(--white);
  font-size: 14px; padding: 8px 9px; text-align: right; border-radius: 8px;
}
.o-money {
  display: flex; align-items: center; gap: 1px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--ring);
  border-radius: 8px;
  padding-left: 8px;
}
.o-money:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(88, 99, 248, 0.22); }
.o-money .o-cur { font-size: 13px; }
.o-money input {
  background: none; border: none; box-shadow: none;
  padding: 8px 8px 8px 2px; font-size: 14px; text-align: right;
}
.o-money input:focus { box-shadow: none; }
.o-money.bid, .o-money.bid .o-cur, .o-money.bid input { color: var(--up); }
.o-money.ask, .o-money.ask .o-cur, .o-money.ask input { color: var(--down); }
.o-money.bid { border-color: rgba(53, 208, 127, 0.3); }
.o-money.ask { border-color: rgba(255, 94, 91, 0.3); }

/* Named once at the top of the block, not repeated under every contract. */
.o-quote-legend {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px;
  margin: 0 0 8px;
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--faint); text-align: center;
}

/* --- naming a contract, and flagging the house's side --------------------- */

/* Two different jobs, so two different registers. The name is a label and stays
   quiet; the side is live state and shouts. Sharing the palette is fine once
   the weight tells them apart. */
.o-kind {
  font-family: var(--mono); font-size: 10px; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 5px;
}
.o-kind.call { background: rgba(53, 208, 127, 0.15); color: var(--up); }
.o-kind.put  { background: rgba(255, 94, 91, 0.15); color: var(--down); }

.o-name {
  font-family: var(--mono); font-size: 14px; font-weight: 500;
  letter-spacing: -0.028em; color: var(--white); margin-left: 7px;
}
.o-exp {
  font-family: var(--mono); font-size: 11px; color: var(--faint); margin-left: 6px;
}

.o-flag {
  font-family: var(--mono); font-size: 10px; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}
.o-flag.buy     { background: var(--up);   color: #04140A; }
.o-flag.sell    { background: var(--down); color: #1A0605; }
.o-flag.unknown { background: var(--accent-glow); color: var(--accent-bright); }

.o-contract { white-space: nowrap; }
.o-contract.spent { opacity: 0.6; }

.o-setup { grid-template-columns: 1fr auto; align-items: end; }
.o-toggle { margin: 6px 0 0; min-width: 210px; }

/* --- setup: which rounds carry an expiry ---------------------------------- */

.o-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 7px 0 0; }
.o-chip {
  font-family: var(--mono);
  font-size: 13px; letter-spacing: 0.04em;
  padding: 7px 14px; border-radius: 999px;
  background: transparent; color: var(--grey);
  border: 1px solid var(--ring-hi);
}
.o-chip:hover:not(:disabled) { background: var(--l3); color: var(--white); }
.o-chip.on,
.o-chip.on:hover:not(:disabled) {
  background: var(--accent); color: var(--on-accent); border-color: var(--accent);
}

/* What each round will actually auction — the cost of a pick, before the table
   discovers it the hard way. */
.o-plan { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--rule); }
.o-gates { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.o-gate {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  min-width: 34px; padding: 5px 6px;
  border-radius: 8px; background: var(--l2); border: 1px solid var(--ring);
  font-family: var(--mono); font-size: 14px; font-weight: 500; color: var(--white);
}
.o-gate i {
  font-style: normal; font-size: 9px; letter-spacing: 0.1em; color: var(--faint);
}

/* ===========================================================================
   AFTER THE FIRST REAL TABLE
   The tape, the position montage, the default size, the way from a seat onto
   the wall, and the bots. Each one answers something a table could not work
   out from the screen in front of it.
   =========================================================================== */

/* --- a button that lives in the topbar ------------------------------------- */

.topbar .tb-btn {
  font-family: var(--disp); font-size: 12px; font-weight: 600;
  padding: 4px 11px; border-radius: 999px;
  background: transparent; color: var(--accent-bright);
  border: 1px solid rgba(88, 99, 248, 0.45);
}
.topbar .tb-btn:hover:not(:disabled) { background: var(--accent-glow); color: #fff; }
.topbar .tb-btn.on,
.topbar .tb-btn.on:hover:not(:disabled) { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

/* --- the bots --------------------------------------------------------------- */

.bot-tag {
  font-family: var(--mono); font-size: 9px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  padding: 1px 6px; border-radius: 4px; margin-left: 5px; vertical-align: 1px;
  background: rgba(99, 199, 255, 0.12); color: var(--cyan);
  border: 1px solid rgba(99, 199, 255, 0.28);
}

/* --- the default size ------------------------------------------------------- */

.o-default {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  margin: 0 0 10px; padding: 8px 10px;
  background: var(--l1); border: 1px solid var(--ring); border-radius: 8px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--accent-dim);
}
.o-default input {
  width: 3.6em; text-align: center; font-size: 14px; padding: 5px 6px;
  border-radius: 6px; color: var(--white); text-transform: none;
}
.o-default .dim { text-transform: none; letter-spacing: 0; font-family: var(--sans); font-size: 12px; }

/* --- the montage of positions ----------------------------------------------- */

.o-detail-cap {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--faint);
  padding: 12px 14px 4px;
}
/* Not full width: a montage with one expiry would otherwise spread its three
   columns across the whole panel and put the puts a hand's width from the
   strike. The columns hug the spine and the table sits centred. */
table.o-pos { width: auto; margin: 0 auto; font-size: 14px; }
.o-pos th, .o-pos td { min-width: 3.4em; white-space: nowrap; }
.o-pos th:last-child, .o-pos td:last-child { border-left: 1px solid var(--ring); }
.o-pos th { font-size: 9px; padding: 6px 10px; }
.o-pos td { padding: 6px 10px; }
.o-pos .o-kinds th {
  text-align: center; color: var(--faint); letter-spacing: 0.16em;
  border-bottom: 1px solid var(--ring);
}
.o-pos th.o-strike, .o-pos td.o-strike { text-align: center !important; }
.o-pos td.o-none { text-align: center; }
.o-pos tr.o-foot td {
  border-top: 1px solid var(--ring-hi);
  background: rgba(255, 255, 255, 0.025);
  font-size: 12px;
}
.o-books { display: grid; gap: 10px; padding: 0 14px; }
@media (min-width: 900px) { .o-books { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); } }
.o-book { background: var(--l1); border: 1px solid var(--ring); border-radius: var(--r); overflow: hidden; }

/* --- the tape --------------------------------------------------------------- */

.o-tape { margin: 0 14px 10px; background: var(--l1); border: 1px solid var(--ring); border-radius: var(--r); overflow: hidden; }
.o-tape.live { border-color: rgba(88, 99, 248, 0.42); background: var(--l2); }
.o-tape table { font-size: 13px; }
.o-tape td { padding: 6px 10px; white-space: nowrap; }
.o-house {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent-bright); background: var(--accent-glow);
  padding: 2px 7px; border-radius: 4px;
}
.o-me { color: var(--white); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }
.o-tape .tiny { font-size: 10px; }

/* An exercised fill is delivery, not a decision. */
tbody tr.exercised td { background: rgba(99, 199, 255, 0.05); }
tbody tr.exercised td:first-child { box-shadow: inset 2px 0 0 var(--cyan); }

/* A round with nothing to auction. */
.o-gate.none { color: var(--grey-dark); border-style: dashed; }

/* ===========================================================================
   THE SEAT ON A DESKTOP
   The seat view was built for a phone — one column, 460px, scroll. On a wide
   screen that wastes four-fifths of it and buries the book under the ticket.
   Past 1100px the same markup goes into columns: the thing you are being asked
   to do on the left, the board you read while doing it in the middle, your book
   on the right, itself in two columns so the whole round fits without scrolling
   on an ordinary laptop. The phone layout is untouched.
   =========================================================================== */

@media (min-width: 1100px) {
  .n-wrap {
    max-width: 1560px;
    padding: 0 16px 24px;
    display: grid;
    grid-template-columns: 420px minmax(0, 1fr);
    gap: 0 20px;
    align-items: start;
  }
  .n-wrap.has-board { grid-template-columns: 400px minmax(300px, 0.9fr) minmax(0, 1.5fr); }
  .n-wrap > .n-alerts, .n-wrap > .n-foot { grid-column: 1 / -1; }
  .n-wrap > .n-alerts:empty { display: none; }
  .n-col { min-width: 0; }
  .n-col-book {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 16px;
    align-content: start;
  }
  .n-sec { min-width: 0; }
  .n-sec.wide { grid-column: 1 / -1; }
  /* Inside a column the board's tables stack; side by side they would be too
     narrow to read. */
  .n-col-market .o-tables { grid-template-columns: 1fr; }
}

/* A footer row on the by-contract table, same register as the montage's. */
.o-detail-cap + .scroll-x tr.o-foot td { border-top: 1px solid var(--ring-hi); background: rgba(255, 255, 255, 0.025); }
.o-tape td .tiny { line-height: 1.2; }

/* The 0DTE row of the picker: the same chips, one step quieter. */
.o-zero { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--rule); }
.o-zero .o-chip.on, .o-zero .o-chip.on:hover:not(:disabled) { background: var(--cyan); border-color: var(--cyan); color: #04202c; }

/* The expired table's round filter: the picker's chips, a size down, on the
   caption line. */
.o-detail-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.o-chips.sm { margin: 0; gap: 4px; }
.o-chips.sm .o-chip { font-size: 11px; padding: 3px 9px; }

/* ===========================================================================
   Players, and the colours reserved away from them
   =========================================================================== */
.who { display: inline-flex; align-items: center; gap: 6px; }
.who-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; font-style: normal; }

/* Expiry is white and only white: no player, no P/L, no move shares it. */
.o-chip.exp.on,
.o-chip.exp.on:hover:not(:disabled) { background: var(--white); color: var(--bg); border-color: var(--white); }
.o-zero .o-chip.on, .o-zero .o-chip.on:hover:not(:disabled) {
  background: transparent; border-color: var(--white); color: var(--white);
}

/* Where you already stand, on the quote ticket. */
.o-netband {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 10px 12px; margin-bottom: 8px; border-radius: 8px;
  background: var(--accent-glow); border: 1px solid rgba(88, 99, 248, 0.3);
  font-size: 13px; color: var(--grey);
}
.o-netband b { font-family: var(--mono); font-size: 17px; font-weight: 700; }
.o-net { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--grey); margin: 2px 0 6px; }
.o-net b { font-family: var(--mono); font-weight: 700; }
.white { color: var(--white); }

/* The dice bar, previewed while you pick cards. */
.n-preview {
  margin: 0 0 14px; padding: 12px 14px; border-radius: 12px;
  background: var(--l1); border: 1px solid rgba(88, 99, 248, 0.42);
  display: flex; flex-direction: column; gap: 10px;
}
.n-preview .n-note { margin: 0; }
.n-need { display: grid; grid-template-columns: 92px auto minmax(0, 1fr); align-items: center; gap: 10px; }
.n-need .k { font-size: 13px; color: var(--grey); }
.n-need .v { font-family: var(--mono); font-size: 13px; text-align: right; }
.n-need .v s { color: var(--faint); }
.n-need .v i { font-style: normal; color: var(--faint); margin-left: 4px; }
.n-faces { display: inline-flex; gap: 3px; }
.n-faces i {
  width: 22px; height: 22px; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 11px; font-style: normal; background: var(--l3); color: var(--grey-dark);
}
.n-faces i.hit { color: var(--bg); font-weight: 700; }
.n-faces i.hit.up { background: var(--up); }
.n-faces i.hit.cyan { background: var(--cyan); }

/* How the print was built. */
.n-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 14px 0; }
.n-step {
  display: flex; flex-direction: column; gap: 2px; min-width: 64px;
  padding: 8px 10px; border-radius: 10px; background: var(--l2); border: 1px solid var(--rule);
}
.n-step .l { font-size: 11px; color: var(--grey); white-space: nowrap; }
.n-step b { font-family: var(--mono); font-size: 18px; font-weight: 700; }
.n-step .s { font-size: 10px; color: var(--faint); white-space: nowrap; }
.n-step.up b { color: var(--up); }
.n-step.down b { color: var(--down); }
.n-step.accent b { color: var(--accent-bright); }
.n-step.print { background: rgba(88, 99, 248, 0.22); border: 2px solid var(--accent); box-shadow: 0 0 0 4px var(--accent-glow); }
.n-op { font-family: var(--mono); color: var(--grey-dark); font-size: 16px; }
.n-flow-note { padding: 6px 14px 10px; font-size: 12px; color: var(--faint); }
.n-steps.big { gap: 10px; padding: 16px 20px 0; }
.n-steps.big .n-step { min-width: 104px; padding: 12px 14px; border-radius: 14px; }
.n-steps.big .n-step .l { font-size: 13px; }
.n-steps.big .n-step b { font-size: 30px; }
.n-steps.big .n-step .s { font-size: 12px; }
.n-steps.big .n-op { font-size: 22px; }
.n-steps.big + .n-flow-note { padding: 8px 20px 14px; font-size: 14px; border-bottom: 1px solid var(--rule); }

/* An expiry, told as what it did to you. White is expiry's colour. */
.n-expiry {
  margin: 0 0 12px; padding: 14px; border-radius: 14px; background: var(--l1);
  border: 1px solid rgba(242, 244, 248, 0.45); display: flex; flex-direction: column; gap: 8px;
}
.n-exp-head { display: flex; flex-direction: column; gap: 2px; }
.n-exp-head .t { font-family: var(--disp); font-size: 18px; font-weight: 600; }
.n-exp-head .t b { font-family: var(--mono); }
.n-exp-head .dim { font-size: 12px; }
.n-exp-line {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px;
  padding: 9px 12px; border-radius: 10px; background: var(--l2); border: 1px solid var(--rule);
  font-size: 13px;
}
.n-exp-line.into { border-color: rgba(242, 244, 248, 0.35); }
.n-exp-line b { font-family: var(--mono); font-size: 15px; }
.n-exp-line .r { text-align: right; font-size: 11px; }
.n-exp-to { color: var(--white); }
.n-exp-fut, .n-exp-total { display: flex; justify-content: space-between; align-items: baseline; padding: 4px 2px 0; }
.n-exp-fut b, .n-exp-total b { font-family: var(--mono); font-size: 20px; }
.n-exp-total span { font-size: 13px; color: var(--grey); }

/* The recap. Direction is the accent; time value is violet, its own colour. */
.n-recap { display: flex; flex-direction: column; gap: 14px; padding: 4px 0; }
.n-recap-key { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--grey); }
.n-recap-key .seg { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.seg.dir { background: var(--accent-bright); }
.seg.tv { background: #B9A6FF; }
.n-recap-row { display: grid; grid-template-columns: minmax(90px, 140px) 86px minmax(0, 1fr); gap: 12px; align-items: center; }
.n-recap-row .nm { font-family: var(--disp); font-weight: 600; font-size: 15px; }
.n-recap-row > b { font-family: var(--mono); font-size: 18px; text-align: right; }
.n-recap-row .bars { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.n-recap-row .track { position: relative; height: 24px; }
.n-recap-row .track .zero { position: absolute; top: -4px; bottom: -4px; width: 2px; background: rgba(255, 255, 255, 0.25); }
.n-recap-row .track .seg {
  position: absolute; top: 0; height: 24px; border-radius: 4px; border: 1px solid var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--bg);
}
.n-recap-row .line { font-size: 13px; color: var(--grey); }
.n-recap.big { gap: 20px; }
.n-recap.big .n-recap-key { font-size: 15px; }
.n-recap.big .n-recap-row { grid-template-columns: 180px 120px minmax(0, 1fr); gap: 18px; }
.n-recap.big .n-recap-row .nm { font-size: 22px; }
.n-recap.big .n-recap-row > b { font-size: 28px; }
.n-recap.big .n-recap-row .track, .n-recap.big .n-recap-row .track .seg { height: 32px; }
.n-recap.big .n-recap-row .track .seg { font-size: 13px; }
.n-recap.big .n-recap-row .line { font-size: 15px; }
.n-recap-wall { padding: 20px 24px; border-bottom: 1px solid var(--rule); }
.n-recap-wall h2 { margin: 0 0 16px; font-family: var(--disp); font-size: 28px; font-weight: 600; }
.n-recap-wall h2 b { font-family: var(--mono); }
.n-recap-mine { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.n-recap-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.n-recap-sum > div { background: var(--l2); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; }
.n-recap-sum b { font-family: var(--mono); font-size: 24px; }
.n-recap-said { margin: 0; font-size: 14px; color: var(--white); }
.n-recap-tbl .grp th { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; text-align: center; }
.n-recap-tbl .grp .dir { color: var(--accent-bright); border-bottom: 1px solid rgba(131, 140, 255, 0.4); }
.n-recap-tbl .grp .tv { color: #B9A6FF; text-align: right; }
.n-recap-tbl tfoot td { font-weight: 700; border-top: 1px solid rgba(255, 255, 255, 0.2); }

/* The lobby on the wall: scan, or type the code. */
.n-lobby { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 32px; align-items: center; text-align: left; padding: 28px 24px; }
.n-join { display: flex; align-items: center; gap: 28px; }
.n-qr { width: 200px; height: 200px; border-radius: 14px; flex: none; }
.n-join-txt { display: flex; flex-direction: column; gap: 4px; }
.n-url { font-family: var(--mono); font-size: 16px; color: var(--grey); }
.n-lobby .n-code { font-size: 84px; line-height: 1; letter-spacing: 0.12em; }
.n-seated { display: flex; flex-direction: column; gap: 12px; }
.n-avatars { display: flex; flex-wrap: wrap; gap: 10px; }
.n-avatar { display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 999px; background: var(--l2); }
.n-avatar i {
  width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: var(--disp); font-style: normal; font-weight: 700; color: var(--bg);
}
.n-avatar span { font-family: var(--disp); font-weight: 600; }
@media (max-width: 760px) {
  .n-lobby { grid-template-columns: 1fr; gap: 20px; padding: 20px 16px; }
  .n-join { flex-direction: column; align-items: flex-start; gap: 16px; }
  .n-qr { width: 160px; height: 160px; }
  .n-lobby .n-code { font-size: 56px; }
}

.o-net.quiet { color: var(--faint); }
.faint { color: var(--faint); }

/* The recap fits a phone: name and total on one line, the bar full width under it. */
.n-recap:not(.big) .n-recap-row { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; }
.n-recap:not(.big) .n-recap-row .bars { grid-column: 1 / -1; }
.n-recap-tbl { width: 100%; table-layout: fixed; }
.n-recap-tbl th:first-child, .n-recap-tbl td:first-child { width: auto; white-space: normal; }
.n-recap-tbl th:not(:first-child), .n-recap-tbl td:not(:first-child) { width: 68px; }
.n-recap-tbl td .tiny { white-space: normal; }
