/*!
 * Bot Broker Battle desk UI (board W44).
 *
 * The game used to be a separate design: 11.6 KB of inline CSS in game.html
 * with its own palette, its own reset and its own page background, and none of
 * the site's chrome. It read as a different product, which it is not.
 *
 * This file is the same rules, minus four of them. Gone: the :root palette
 * (below it is remapped onto the brand tokens instead), the `*` reset, the
 * `html, body` and `body` rules, and the full-page scanline overlay -- the
 * site's own layers own all of that now, and the scanline was most of why the
 * page felt foreign.
 *
 * Nothing else changed. Checked before merging: 60 class selectors here, zero
 * of them collide with Bootstrap. Loads after css/fullloop.css.
 *
 * game.js is untouched and depends on these staying put: 26 ids, the
 * `.gate-tabs button` and `.seg button` selectors, and the `.sym`/`.symbol-tip`
 * classes it writes into the tape.
 */

:root {
  /* Neutrals now come from the brand layer, so the desk sits on the same
     ground as every other page rather than its own near-black. */
  --bg: var(--fl-bg);
  --bg-2: var(--fl-panel-2);
  --panel: var(--fl-panel);
  --panel-2: #131c2e;
  --line: var(--fl-line);
  --text: var(--fl-ink);
  --muted: var(--fl-muted);
  --dim: rgba(167, 179, 200, 0.62);

  /* These carry meaning and are deliberately NOT brand colours: the two
     players are told apart by them, and the trade colours are read at a
     glance. Changing them to gold and cyan would make the board unreadable. */
  --claude: #e8a54b;
  --claude-dim: rgba(232, 165, 75, 0.14);
  --grok: #4fd6c4;
  --grok-dim: rgba(79, 214, 196, 0.12);
  --up: #3dd68c;
  --down: #ff5d6c;
  --buy: #3dd68c;
  --sell: #ff8a4c;
  --warn: var(--fl-gold);

  --mono: "Cascadia Code", "Segoe UI Mono", "IBM Plex Mono", Consolas, monospace;
  --sans: inherit;
}

/* The board is a wide table surface; let it use the full container. */
.fl-game-shell { padding-top: 1.5rem; padding-bottom: 2.5rem; }
.mast {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}
.kicker {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--warn);
}
.mast h1 {
  margin: 2px 0 0;
  font-size: 28px;
  letter-spacing: 0.16em;
  font-weight: 650;
}
.sub { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.clock {
  display: grid;
  grid-template-columns: repeat(5, minmax(88px, 1fr));
  gap: 10px 18px;
  margin: 0;
}
.clock div { min-width: 0; }
.clock dt {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}
.clock dd { margin: 2px 0 0; font-variant-numeric: tabular-nums; font-size: 14px; }
.pill {
  display: inline-block;
  padding: 1px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.pill.open { color: var(--up); border-color: var(--up); }
.pill.pre, .pill.post { color: var(--warn); border-color: #66551f; }
.pill.closed { color: var(--muted); }
.muted { color: var(--muted); font-size: 12px; }

.floor {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) 1.4fr;
  gap: 10px;
  margin: 16px 0;
}
.kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 12px 14px 10px;
  min-height: 108px;
}
.kpi h2 {
  margin: 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.fig {
  margin: 10px 0 4px;
  font-size: 26px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  font-weight: 620;
}
.kpi .meta { margin: 0; color: var(--muted); font-size: 12px; }
.spark-card canvas { width: 100%; height: 72px; margin-top: 8px; display: block; }
.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--text); }

.toolbar {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  margin: 4px 0 14px;
}
.search { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.search input {
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 7px 10px;
  width: 240px;
  font-family: var(--mono);
  font-size: 12px;
}
.seg { display: flex; border: 1px solid var(--line); }
.seg button {
  background: transparent;
  color: var(--muted);
  border: 0;
  border-right: 1px solid var(--line);
  padding: 7px 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--panel-2); color: var(--text); }
.refresh { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--dim); }

.seats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.seats:has(> .seat:only-child) {
  grid-template-columns: 1fr;
}
.seat {
  background: var(--panel);
  border: 1px solid var(--line);
  min-width: 0;
}
.seat.claude { box-shadow: inset 3px 0 0 var(--claude); }
.seat.grok { box-shadow: inset 3px 0 0 var(--grok); }
.seat .head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
.who .seat-kicker {
  margin: 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.seat.claude .who .seat-kicker { color: var(--claude); }
.seat.grok .who .seat-kicker { color: var(--grok); }
.who { min-width: 140px; flex: 1 1 auto; }
.who h2 { margin: 2px 0 0; font-size: 22px; letter-spacing: 0.04em; }
.who .role { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.stats {
  display: grid;
  grid-template-columns: repeat(3, 108px);
  gap: 6px 16px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  margin-left: auto;
  flex: 0 0 auto;
}
.stats dt { color: var(--dim); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; font-family: var(--mono); }
.stats dd { margin: 0; font-size: 15px; font-weight: 620; }
.mandate {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 14px 10px; }
.chip {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  border: 1px solid var(--line);
  padding: 2px 7px;
  color: var(--muted);
}
.empty {
  margin: 0;
  padding: 22px 14px;
  color: var(--muted);
  font-size: 13px;
}
.empty code { color: var(--text); }

.block { border-top: 1px solid var(--line); }
.block h3 {
  margin: 0;
  padding: 8px 14px 6px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.table-wrap { overflow: auto; max-height: 280px; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th, td {
  padding: 6px 10px;
  border-bottom: 1px solid #1b2430;
  text-align: left;
  white-space: nowrap;
}
th {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
  position: sticky;
  top: 0;
  background: var(--panel);
}
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); }
/* The ticker used to be `<td class="sym">`. The hover-tooltip change moved the
   class onto a `<span>` inside a plain `<td>`, so this rule stopped matching and
   the ticker column silently lost its monospace weight. Match both. */
td.sym, .sym { font-family: var(--mono); font-weight: 650; letter-spacing: 0.04em; }

/* Tell people the symbol is hoverable. game.js writes `sym symbol-tip` and sets
   a native title; without an affordance nobody discovers it.
   NOT `cursor: help` -- that renders as an arrow-with-question-mark, which on a
   ticker reads as "something is wrong here" rather than "there is more to see".
   The dotted underline carries the same signal and leaves the pointer alone. */
.symbol-tip {
  border-bottom: 1px dotted rgba(167, 179, 200, 0.45);
}
.symbol-tip:hover { border-bottom-color: var(--fl-gold); }
.side-buy { color: var(--buy); font-family: var(--mono); font-weight: 650; }
.side-sell { color: var(--sell); font-family: var(--mono); font-weight: 650; }
.thesis { max-width: 280px; overflow: hidden; text-overflow: ellipsis; color: var(--muted); white-space: nowrap; }
tr.dim { opacity: 0.35; }
tr.hit { background: rgba(232, 165, 75, 0.08); }

.lower {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 14px;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  min-width: 0;
}
.panel > header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.panel > header h2 { margin: 0; font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; }
.panel > header p { margin: 0; color: var(--muted); font-size: 12px; }
#tape-panel .table-wrap { max-height: 420px; }

.hint {
  margin-top: 18px;
  color: var(--dim);
  font-size: 12px;
  line-height: 1.5;
}
.hint code { color: var(--muted); font-family: var(--mono); }

@media (max-width: 1100px) {
  .floor { grid-template-columns: 1fr 1fr; }
  .seats, .lower, .clock { grid-template-columns: 1fr; }
  .spark-card { grid-column: 1 / -1; }
  .seat .head { flex-wrap: wrap; }
}

/* ==========================================================================
 * Spectator wall additions (gate, teaser, auth) - not in the local desk.
 * ==========================================================================*/
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin-bottom: 10px;
}
.topbar a { color: var(--muted); font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; }
.topbar a:hover { color: var(--text); }
.session-line { display: flex; align-items: center; gap: 10px; font-family: var(--mono);
  font-size: 11px; color: var(--dim); }
.session-line button {
  background: transparent; color: var(--muted); border: 1px solid var(--line);
  padding: 4px 10px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em;
  text-transform: uppercase; cursor: pointer;
}
.session-line button:hover { color: var(--text); border-color: var(--muted); }

/* Gate: shown to logged-out visitors. Blurred board image behind, card in front. */
#gate { position: relative; margin-top: 16px; }
.teaser-wrap {
  position: relative; overflow: hidden; border: 1px solid var(--line);
  min-height: 420px; background: var(--panel-2);
}
.teaser-wrap img {
  width: 100%; display: block; user-select: none; -webkit-user-drag: none;
  pointer-events: none;
}
.teaser-wrap::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(7,9,12,0.35), rgba(7,9,12,0.85));
}
.gate-card {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: flex-start; gap: 18px;
  padding: 28px 24px 24px; z-index: 3;
}
.gate-inner {
  width: 100%; max-width: 380px; background: var(--panel);
  border: 1px solid var(--line); padding: 22px 22px 24px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.55);
}
.gate-inner h2 { margin: 0 0 4px; font-size: 20px; letter-spacing: 0.02em; }
.gate-inner .lede { margin: 0 0 16px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.gate-tabs { display: flex; border: 1px solid var(--line); margin-bottom: 14px; }
.gate-tabs button {
  flex: 1; background: transparent; color: var(--muted); border: 0;
  border-right: 1px solid var(--line); padding: 8px; font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer;
}
.gate-tabs button:last-child { border-right: 0; }
.gate-tabs button.on { background: var(--panel-2); color: var(--text); }
.gate-form { display: flex; flex-direction: column; gap: 10px; }
.gate-form label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--dim); }
.gate-form input {
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text);
  padding: 10px 12px; font-size: 14px; width: 100%; font-family: var(--sans);
}
.gate-form input:focus { outline: none; border-color: var(--grok); }
.gate-form button.submit {
  margin-top: 4px; background: var(--grok); color: #04211d; border: 0;
  padding: 11px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em;
  text-transform: uppercase; font-weight: 700; cursor: pointer;
}
.gate-form button.submit:hover { filter: brightness(1.08); }
.gate-form button.submit:disabled { opacity: 0.55; cursor: default; }
.gate-msg { min-height: 16px; font-size: 12px; color: var(--down); margin: 2px 0 0; }
.gate-foot { margin: 12px 0 0; color: var(--dim); font-size: 11px; line-height: 1.5; text-align: center; }

/* ------------------------------------------------------- W44 adjustments
   The page header above the board now carries the title, so the mast is just
   the live clock strip. */
.topbar { display: flex; justify-content: space-between; align-items: center; }
/* Pull the clock strip to the right only where there is room; on a phone it
   stacks, and right-aligning it left the whole left half empty. */
@media (min-width: 768px) {
  .mast { justify-content: flex-end; }
}

/* The desk's own accent was teal, which read as a second brand next to the
   site's gold primary. The submit button is the one control a visitor is meant
   to press, so it follows the site. */
/* Matches the original selector's specificity (.gate-form button.submit);
   a plain .gate-form .submit loses to it whatever the order. */
.gate-form button.submit {
  background: var(--fl-gold);
  color: #0b1220;
}
.gate-form button.submit:hover { background: #ffe07a; filter: none; }
