/* host.css — TV display, built on the Couch Party design system (cp-tokens.css).
 *
 * The TV is one of the system's two surfaces: always dark (data-cp-theme="dark"
 * on <html>), typeset on the fluid --cp-tv-* scale, elevated by the tonal
 * surface-container ramp (shadows are nearly invisible on a dark panel from
 * across a room), and animated on the M3E spring tokens.
 *
 * Color language:  primary = action / "it's your turn"
 *                  secondary = host chrome, join instructions, focus
 *                  tertiary (amber) = scores, streaks, winners — "something good"
 *                  error = timers running out, losses
 * A result is never encoded by color alone — outlines, icons and text carry it.
 */
:root {
  /* Local rounded faces only: the CSP (default-src 'self') deliberately blocks
     web fonts, so Roboto Flex falls through to ui-rounded / system faces. */
  --cp-font-plain: "Roboto Flex", ui-rounded, "SF Pro Rounded",
    "Hiragino Maru Gothic ProN", "Varela Round", "Segoe UI Variable Display",
    system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --cp-font-brand: var(--cp-font-plain);

  /* Legacy aliases — every pre-system rule that still says var(--accent) now
     resolves to a token role. Do not add new uses; use the --cp-* role. */
  --bg: var(--cp-surface);
  --bg2: var(--cp-surface-container-low);
  --card: var(--cp-surface-container);
  --ink: var(--cp-on-surface);
  --muted: var(--cp-on-surface-variant);
  --accent: var(--cp-primary);
  --accent2: var(--cp-secondary);
  --good: var(--cp-tertiary);
  --radius: var(--cp-shape-large-increased);
  --gap: var(--cp-space-6);
}

/* CRITICAL: class rules like .screen{display:flex} override the HTML `hidden`
   attribute (the UA rule [hidden]{display:none} loses on specificity), which
   silently renders every "hidden" screen. This must stay. */
[hidden] { display: none !important; }

/* Pixel avatar sprites — sized 1em so they inherit the slot's font-size, crisp. */
img.av { width: 1em; height: 1em; image-rendering: pixelated; display: inline-block; vertical-align: middle; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--cp-font-plain);
  color: var(--cp-on-surface);
  background: radial-gradient(120% 120% at 50% 0%, var(--cp-surface-container-low), var(--cp-surface));
  overflow: hidden;
}
/* Overscan: critical content stays inside a ~5% inset on every edge. */
.tv { height: 100vh; display: flex; flex-direction: column; padding: clamp(24px, 4vw, 56px); }
.topbar { display: flex; align-items: center; justify-content: space-between; }
/* The trademark couch wordmark (shared SVG asset); brand-fixed colors. */
.brand { width: clamp(260px, 24vw, 460px); }
.brand img { width: 100%; height: auto; display: block; }
.code-chip { display: flex; flex-direction: column; align-items: flex-end; }
.code-label { font-size: var(--cp-tv-label-large-size); color: var(--cp-on-surface-variant); letter-spacing: .3em; text-transform: uppercase; }
.code { font-family: var(--cp-font-mono); font-size: var(--cp-tv-display-medium-size); font-weight: 700;
  letter-spacing: .12em; line-height: 1; font-variant-numeric: tabular-nums; text-transform: uppercase;
  color: var(--cp-primary); }
.center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--cp-space-4); }
.spinner { width: 54px; height: 54px; border-radius: var(--cp-shape-full);
  border: 6px solid var(--cp-surface-container-highest); border-top-color: var(--cp-primary); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.lobby { flex: 1; display: grid; grid-template-columns: 1.6fr 1fr; gap: var(--gap); min-height: 0; }
.lobby-left { display: flex; flex-direction: column; min-height: 0; }
.lobby h1 { font-size: var(--cp-tv-headline-large-size); line-height: var(--cp-tv-headline-large-line);
  font-weight: var(--cp-tv-headline-large-weight); margin: .2em 0 .4em; }
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--gap); overflow: auto; padding-bottom: 8px; }
.game-tile { position: relative; background: var(--cp-surface-container); border: 3px solid transparent;
  border-radius: var(--radius); padding: 22px; color: var(--cp-on-surface); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  transition: transform var(--cp-spring-spatial-fast-duration) var(--cp-spring-spatial-fast),
    border-color var(--cp-spring-effects-fast-duration) var(--cp-spring-effects-fast),
    background var(--cp-spring-effects-fast-duration) var(--cp-spring-effects-fast); }
.game-tile:hover { transform: translateY(-4px); background: var(--cp-surface-container-high); }
.game-tile.selected { border-color: var(--cp-primary); background: var(--cp-surface-container-high); }
.game-tile.soon { opacity: .55; }
.game-tile .thumb { font-size: clamp(40px, 5vw, 68px); }
.game-tile .title { font-weight: 700; font-size: var(--cp-tv-title-medium-size); }
.soon-tag { position: absolute; top: 10px; right: 10px; font-size: 11px; text-transform: uppercase;
  letter-spacing: .1em; background: var(--cp-surface-container-lowest); padding: 3px 8px;
  border-radius: var(--cp-shape-full); color: var(--cp-on-surface-variant); }
.host-actions { margin-top: 20px; }

/* Buttons — M3 filled / outlined with the M3E press morph (corners square
   up while held, on a spatial-fast spring). */
.btn { font: inherit; font-weight: 700; border: none; border-radius: var(--cp-shape-button);
  padding: 16px 30px; cursor: pointer; font-size: var(--cp-tv-title-medium-size); min-height: var(--cp-touch-target);
  transition: border-radius var(--cp-spring-spatial-fast-duration) var(--cp-spring-spatial-fast),
    transform var(--cp-spring-spatial-fast-duration) var(--cp-spring-spatial-fast); }
.btn:active { border-radius: var(--cp-shape-button-pressed); transform: scale(.97); }
.btn.primary { background: var(--cp-primary); color: var(--cp-on-primary); }
.btn.primary:disabled { opacity: .38; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--cp-on-surface); border: 2px solid var(--cp-outline); }
:focus-visible { outline: 3px solid var(--cp-secondary); outline-offset: 2px; }

.roster { background: var(--cp-surface-container); border-radius: var(--cp-shape-extra-large); padding: 22px; display: flex;
  flex-direction: column; min-height: 0; }
.join-hint { color: var(--cp-on-surface-variant); font-size: var(--cp-tv-body-medium-size); margin-bottom: 12px; }
.mini-code { color: var(--cp-secondary); font-family: var(--cp-font-mono); font-weight: 700; letter-spacing: .12em; }
.roster h2 { display: flex; justify-content: space-between; align-items: baseline; margin: 6px 0 14px; }
.count { color: var(--cp-on-surface-variant); font-size: .7em; }
.roster-list { list-style: none; margin: 0; padding: 0; overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.roster-item { display: flex; align-items: center; gap: 14px; background: var(--cp-surface-container-high); border-radius: var(--cp-shape-large); padding: 10px 14px; }
.roster-item.offline { opacity: .45; }
.roster-item .avatar { font-size: 30px; }
.roster-item .pname { font-weight: 700; font-size: var(--cp-tv-body-medium-size); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roster-item .kick { background: var(--cp-error-container); color: var(--cp-on-error-container); border: none; border-radius: var(--cp-shape-small);
  width: 30px; height: 30px; cursor: pointer; font-weight: 700; }
.muted { color: var(--cp-on-surface-variant); }

/* The TV's mute toggle — the shared screen is the room speaker, so the
   control lives where a remote-wielding host can find it. Overscan-safe. */
.tv-sound-toggle { position: fixed; left: clamp(24px, 4vw, 56px); bottom: clamp(24px, 4vw, 56px); z-index: 60;
  width: 52px; height: 52px; border-radius: var(--cp-shape-full); border: 1px solid var(--cp-outline-variant);
  background: var(--cp-surface-container); color: var(--cp-on-surface); font-size: 22px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; opacity: .9; }
.tv-sound-toggle.off { opacity: .5; }

/* --- Updated flow: select screen + QR join card --------------------- */
.select { gap: 28px; }
.select h1 { font-size: var(--cp-tv-headline-large-size); line-height: var(--cp-tv-headline-large-line); margin: 0; }
.select .game-grid { width: min(1100px, 92vw); max-height: 60vh; }
.game-tile:disabled { cursor: not-allowed; }

/* Join card: the join URL reads in secondary; the room code sits in
   primary-container tiles at the M3E large-increased radius. */
.join-card { background: var(--cp-surface-container); border-radius: var(--cp-shape-extra-large); padding: 26px;
  display: flex; flex-direction: column; align-items: center; gap: 12px; }
.join-title { font-size: var(--cp-tv-title-medium-size); font-weight: 700; color: var(--cp-on-surface-variant); }
.qr-box { background: #fff; border-radius: var(--cp-shape-large); padding: 14px; width: min(340px, 42vh);
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center; }
.qr-box svg { width: 100%; height: 100%; display: block; }
.join-or { color: var(--cp-on-surface-variant); font-size: var(--cp-tv-body-medium-size); text-transform: uppercase; letter-spacing: .2em; }
.join-url { font-size: var(--cp-tv-title-medium-size); font-weight: 600; color: var(--cp-secondary); }
.join-code-row { display: flex; align-items: baseline; gap: 12px; }
.join-code-label { color: var(--cp-on-surface-variant); text-transform: uppercase; letter-spacing: .2em; font-size: var(--cp-tv-label-large-size); }
.join-code { font-family: var(--cp-font-mono); font-size: var(--cp-tv-display-small-size); font-weight: 700; letter-spacing: .12em;
  font-variant-numeric: tabular-nums; text-transform: uppercase;
  color: var(--cp-on-primary-container); background: var(--cp-primary-container);
  border-radius: var(--cp-shape-large-increased); padding: .05em .35em; }
.host-actions { display: flex; gap: 16px; margin-top: 22px; flex-wrap: wrap; }
.selected-game { font-weight: 800; font-size: var(--cp-tv-title-large-size); margin-bottom: 6px; color: var(--cp-primary); }

/* --- Circular 10-seat lobby ----------------------------------------- */
.roster { align-items: center; justify-content: flex-start; }
.seat-ring { position: relative; width: min(58vh, 560px); aspect-ratio: 1; margin: 8px auto 0; }
.ring-center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; text-align: center; }
.ring-center .rc-count { font-size: var(--cp-tv-display-small-size); font-weight: 800; line-height: 1;
  color: var(--cp-primary); font-variant-numeric: tabular-nums; }
.ring-center .rc-label { color: var(--cp-on-surface-variant); text-transform: uppercase; letter-spacing: .25em;
  font-size: clamp(11px, 1vw, 15px); margin-top: 4px; }

/* A seat joining lands on a spatial-default spring. */
.seat { position: absolute; transform: translate(-50%, -50%); width: 19%;
  display: flex; flex-direction: column; align-items: center; }
.seat-av { width: 100%; aspect-ratio: 1; border-radius: var(--cp-shape-full); display: flex; align-items: center;
  justify-content: center; font-size: clamp(24px, 4.2vh, 46px); box-sizing: border-box; }
.seat.filled { animation: seatIn var(--cp-spring-spatial-default-duration) var(--cp-spring-spatial-default) both; }
@keyframes seatIn { from { transform: translate(-50%, -50%) scale(.6); opacity: 0; }
  to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
/* The filled circle takes the player's seat color (falls back to secondary). */
.seat.filled .seat-av { background: var(--cp-surface-container-high);
  border: 3px solid var(--cp-seat-color, var(--cp-secondary)); }
.seat.filled .seat-name { color: var(--cp-seat-color, var(--cp-on-surface)); }
.seat.empty .seat-av { background: var(--cp-surface-container-low); border: 3px dashed var(--cp-outline-variant); color: var(--cp-outline); }
.seat.offline { opacity: .4; }
.seat-name { margin-top: 8px; font-weight: 700; font-size: clamp(12px, 1.5vh, 18px);
  max-width: 130%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat-kick { position: absolute; top: -4px; right: 6%; z-index: 2; width: 26px; height: 26px;
  border: none; border-radius: var(--cp-shape-full); background: var(--cp-error); color: var(--cp-on-error); cursor: pointer;
  font-weight: 700; line-height: 1; opacity: 0;
  transition: opacity var(--cp-spring-effects-fast-duration) var(--cp-spring-effects-fast); }
.seat.filled:hover .seat-kick { opacity: 1; }

/* --- In-game (Trivia Rush) TV view ---------------------------------- */
.ingame { height: 100vh; display: flex; flex-direction: column; padding: clamp(24px,4vw,56px); }
/* Persistent join chip: code + QR stay visible through the whole game so a
   latecomer can seat themselves. Bottom corner, inside the overscan inset. */
.ingame-join { position: fixed; right: clamp(24px, 4vw, 56px); bottom: clamp(24px, 4vw, 56px); z-index: 5;
  display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px;
  background: var(--cp-surface-container); border-radius: var(--cp-shape-large);
  border: 1px solid var(--cp-outline-variant); opacity: .92; }
.ij-qr { width: clamp(56px, 5vw, 96px); aspect-ratio: 1; background: #fff; border-radius: var(--cp-shape-small); padding: 4px; }
.ij-qr svg { width: 100%; height: 100%; display: block; }
.ij-text { display: flex; flex-direction: column; }
.ij-url { color: var(--cp-secondary); font-size: clamp(12px, 1vw, 20px); font-weight: 600; }
.ij-code { font-family: var(--cp-font-mono); font-weight: 700; letter-spacing: .12em;
  font-variant-numeric: tabular-nums; text-transform: uppercase;
  color: var(--cp-on-surface); font-size: clamp(20px, 1.8vw, 40px); line-height: 1.2; }
.game-host { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.ingame-footer { display: flex; justify-content: center; padding-top: 12px; }
.tq-head { display: flex; align-items: center; gap: 16px; }
.tq-cat { background: var(--cp-secondary-container); color: var(--cp-on-secondary-container); font-weight: 700;
  padding: 6px 16px; border-radius: var(--cp-shape-full); font-size: var(--cp-tv-label-large-size);
  text-transform: uppercase; letter-spacing: .1em; }
.tq-round { color: var(--cp-on-surface-variant); font-weight: 700; font-size: var(--cp-tv-label-large-size); }
/* "You asked for AI, you're getting the bank" — visible, not alarming. */
.tq-ainote { background: var(--cp-surface-container-high); color: var(--cp-on-surface-variant);
  border: 1px solid var(--cp-outline-variant); font-weight: 600; padding: 6px 14px;
  border-radius: var(--cp-shape-full); font-size: clamp(12px, 1vw, 18px); }
/* Countdown: secondary while comfortable, tertiary as it tightens, error +
   pulse under 5s. The number itself (not just its color) carries the state. */
.tq-timer { margin-left: auto; font-size: var(--cp-tv-display-small-size); font-weight: 800; min-width: 1.6em; text-align: right;
  color: var(--cp-secondary); font-variant-numeric: tabular-nums;
  transition: color var(--cp-spring-effects-fast-duration) var(--cp-spring-effects-fast); }
.tq-timer.warn { color: var(--cp-tertiary); }
.tq-timer.urgent { color: var(--cp-error); display: inline-block;
  animation: tqPulse var(--cp-duration-extra-long1) ease-in-out infinite; }
@keyframes tqPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .tq-timer.urgent { animation: none; } }
.tq-question { font-size: var(--cp-tv-headline-large-size); line-height: var(--cp-tv-headline-large-line);
  font-weight: var(--cp-tv-headline-large-weight); margin: .3em 0 .5em; }
.tq-options { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(12px,1.6vw,22px); }
.tq-opt { display: flex; align-items: center; gap: 16px; padding: clamp(14px,1.6vw,24px);
  border-radius: var(--cp-shape-large); font-size: var(--cp-tv-title-medium-size); font-weight: 600; position: relative;
  transition: opacity var(--cp-spring-effects-default-duration) var(--cp-spring-effects-default),
    transform var(--cp-spring-spatial-default-duration) var(--cp-spring-spatial-default); }
/* Options live on container roles; the A-D letter, not the color, is identity. */
.tq-opt.c0 { background: var(--cp-primary-container); color: var(--cp-on-primary-container); }
.tq-opt.c1 { background: var(--cp-secondary-container); color: var(--cp-on-secondary-container); }
.tq-opt.c2 { background: var(--cp-tertiary-container); color: var(--cp-on-tertiary-container); }
.tq-opt.c3 { background: var(--cp-surface-container-highest); color: var(--cp-on-surface); }
/* Neutral answer card — used when the answers are colour words, so the button
   colour can't contradict the label. Letters stay distinct. */
.tq-opt.neutral { background: var(--cp-surface-container-high); color: var(--cp-on-surface); }
.tq-letter { width: 1.7em; height: 1.7em; flex: none; display: flex; align-items: center; justify-content: center;
  border-radius: var(--cp-shape-medium); font-weight: 800; }
.tq-opt.c0 .tq-letter { background: var(--cp-primary); color: var(--cp-on-primary); }
.tq-opt.c1 .tq-letter { background: var(--cp-secondary); color: var(--cp-on-secondary); }
.tq-opt.c2 .tq-letter { background: var(--cp-tertiary); color: var(--cp-on-tertiary); }
.tq-opt.c3 .tq-letter { background: var(--cp-outline); color: var(--cp-surface); }
.tq-opt.neutral .tq-letter { background: var(--cp-secondary); color: var(--cp-on-secondary); }
/* The correct answer: amber ring + a check icon — never color alone. */
.tq-opt.right { outline: 4px solid var(--cp-tertiary); background: var(--cp-tertiary-container); color: var(--cp-on-tertiary-container); }
.tq-opt.right::after { content: '✓'; margin-left: auto; font-weight: 900; color: var(--cp-tertiary); }
.tq-opt.dim { opacity: .4; }
.tq-tally { margin-left: auto; font-weight: 800; color: var(--cp-on-surface-variant); }
.tq-opt.right .tq-tally { margin-left: 0; }
.tq-answered { text-align: center; color: var(--cp-on-surface-variant); font-size: var(--cp-tv-body-medium-size); margin-top: 16px; }
.tq-scores { margin-top: 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 8px; overflow: auto; }
.tq-score { display: flex; align-items: center; gap: 10px; background: var(--cp-surface-container); border-radius: var(--cp-shape-medium); padding: 8px 12px; }
.tq-score.ok { background: var(--cp-tertiary-container); color: var(--cp-on-tertiary-container); }
.ts-av { font-size: 24px; } .ts-name { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts-gain { color: var(--cp-tertiary); font-weight: 700; }
.tq-score.ok .ts-gain { color: var(--cp-on-tertiary-container); }
.ts-total { font-weight: 800; min-width: 2.4em; text-align: right; font-variant-numeric: tabular-nums; }
.tq-final-title { text-align: center; font-size: var(--cp-tv-display-small-size); line-height: var(--cp-tv-display-small-line);
  font-weight: var(--cp-tv-display-small-weight); }
.tq-final { max-width: 720px; margin: 0 auto; width: 100%; display: flex; flex-direction: column; gap: 10px; overflow: auto; }
.tq-final-row { display: flex; align-items: center; gap: 16px; background: var(--cp-surface-container); border-radius: var(--cp-shape-large);
  padding: 14px 20px; font-size: var(--cp-tv-title-medium-size);
  animation: rowLand var(--cp-spring-spatial-slow-duration) var(--cp-spring-spatial-slow) both; }
@keyframes rowLand { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
/* The winner is amber — the one color reserved for "something good happened". */
.tq-final-row.win { background: var(--cp-tertiary-container); color: var(--cp-on-tertiary-container);
  outline: 3px solid var(--cp-tertiary); }
.tf-rank { font-weight: 800; min-width: 2em; } .tf-av { font-size: 32px; } .tf-name { flex: 1; font-weight: 700; }
.tf-score { font-weight: 800; font-variant-numeric: tabular-nums; }

/* --- Game setup panel + open-ended TV bits --------------------------- */
.game-setup { display: flex; flex-direction: column; gap: 12px; margin: 8px 0 4px; }
.setup-row { display: flex; align-items: center; gap: 14px; }
.setup-label { color: var(--cp-on-surface-variant); font-weight: 700; text-transform: uppercase; letter-spacing: .12em;
  font-size: clamp(12px,1.1vw,16px); min-width: 90px; }
.seg { display: inline-flex; background: var(--cp-surface-container-low); border-radius: var(--cp-shape-full); padding: 4px; gap: 4px; }
.seg-btn { border: none; background: transparent; color: var(--cp-on-surface); font: inherit; font-weight: 700;
  padding: 8px 18px; border-radius: var(--cp-shape-full); cursor: pointer; font-size: clamp(13px,1.2vw,18px);
  transition: background var(--cp-spring-effects-fast-duration) var(--cp-spring-effects-fast); }
.seg-btn.on { background: var(--cp-secondary-container); color: var(--cp-on-secondary-container); }
.setup-select { font: inherit; font-weight: 700; padding: 10px 14px; border-radius: var(--cp-shape-medium);
  border: 2px solid var(--cp-outline-variant); background: var(--cp-surface-container); color: var(--cp-on-surface); font-size: clamp(13px,1.2vw,18px); }
.tq-diff { background: var(--cp-tertiary-container); color: var(--cp-on-tertiary-container); font-weight: 700;
  padding: 6px 14px; border-radius: var(--cp-shape-full); font-size: clamp(12px,1.2vw,18px); }
.tq-open-hint { text-align: center; font-size: var(--cp-tv-headline-small-size); color: var(--cp-on-surface-variant); padding: clamp(20px,4vh,60px) 0; }
.tq-answerline { display: flex; align-items: baseline; gap: 16px; margin: 8px 0 16px; }
.tq-answerlabel { color: var(--cp-on-surface-variant); text-transform: uppercase; letter-spacing: .15em; font-weight: 700; font-size: var(--cp-tv-label-large-size); }
.tq-answertext { font-size: var(--cp-tv-headline-medium-size); font-weight: 800; color: var(--cp-tertiary); }
.tq-subs { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap: 8px; margin-bottom: 12px; overflow: auto; }
.tq-sub { display: flex; align-items: center; gap: 10px; background: var(--cp-surface-container); border-radius: var(--cp-shape-medium); padding: 8px 12px; }
.tq-sub.ok { background: var(--cp-tertiary-container); color: var(--cp-on-tertiary-container); }
.tsub-name { font-weight: 700; color: var(--cp-on-surface-variant); }
.tq-sub.ok .tsub-name { color: var(--cp-on-tertiary-container); }
.tsub-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tsub-mark { font-weight: 800; }

/* round points pill */
.tq-pts { background: var(--cp-tertiary-container); color: var(--cp-on-tertiary-container); font-weight: 800;
  padding: 6px 14px; border-radius: var(--cp-shape-full); font-size: clamp(12px,1.2vw,18px); }

/* lobby status / start-gate message */
.lobby-status { margin: 10px 2px 0; color: var(--cp-on-surface-variant); font-weight: 600; font-size: var(--cp-tv-body-medium-size); min-height: 1.4em; }
.lobby-status.err { color: var(--cp-error); }

/* --- TV attach screen + shared-screen extras -------------------------- */
.attach-hint { color: var(--cp-on-surface-variant); font-size: var(--cp-tv-body-large-size); margin: 0; }
/* Room-code entry: mono, wide-tracked, ambiguity-free — the code style. */
.tv-code-input { font-family: var(--cp-font-mono); font-size: clamp(48px,8vw,110px); font-weight: 700; letter-spacing: .18em;
  font-variant-numeric: tabular-nums; text-align: center; text-transform: uppercase; width: min(560px, 80vw); padding: 12px 20px;
  border-radius: var(--cp-shape-large-increased); border: 4px solid var(--cp-outline-variant);
  background: var(--cp-surface-container-high); color: var(--cp-on-surface);
  transition: border-color var(--cp-spring-effects-fast-duration) var(--cp-spring-effects-fast); }
.tv-code-input:focus { outline: none; border-color: var(--cp-primary); }
.error { color: var(--cp-error); font-weight: 700; font-size: var(--cp-tv-body-medium-size); }
.tv-hint { text-align: center; font-size: var(--cp-tv-body-medium-size); margin-top: 14px; }
.seat-crown { position: absolute; top: -6px; left: 6%; font-size: clamp(14px,1.4vw,20px); z-index: 2; }

/* Paused overlay on the TV: the room must be able to read it from the sofa. */
.paused-overlay { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center;
  justify-content: center; background: color-mix(in srgb, var(--cp-scrim) 78%, transparent); backdrop-filter: blur(8px);
  animation: pausedIn var(--cp-spring-effects-default-duration) var(--cp-spring-effects-default) both; }
@keyframes pausedIn { from { opacity: 0; } to { opacity: 1; } }
.paused-card { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.paused-icon { font-size: clamp(60px,9vw,140px); line-height: 1; animation: pausedPulse 2.4s ease-in-out infinite; }
@keyframes pausedPulse { 0%,100% { opacity: .85; transform: scale(1); } 50% { opacity: 1; transform: scale(1.06); } }
.paused-title { font-size: var(--cp-tv-display-medium-size); line-height: var(--cp-tv-display-medium-line); font-weight: 800; }
.paused-sub { color: var(--cp-on-surface-variant); font-size: var(--cp-tv-body-large-size); font-weight: 600; }
.paused-time { color: var(--cp-secondary); font-weight: 800; font-size: var(--cp-tv-body-large-size); font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .paused-icon { animation: none; } }

/* ===================================================================== *
 * Crowd Control — TV / shared screen
 * The 0-100 track is the spine of every phase so the room reads the round
 * as one continuous object. Sized for 6-12ft viewing; nothing flush to the
 * frame edge (overscan safe zone).
 * ===================================================================== */
.ch-guesser { display: flex; align-items: center; justify-content: center; gap: 14px;
  margin: 8px 0 4px; }
.ch-gav { font-size: clamp(32px, 4vw, 52px); }
.ch-gname { font-size: var(--cp-tv-headline-medium-size); font-weight: 800; color: var(--cp-secondary); }

/* Circular gauge (GUESS phase) — mirrors the phone dial for the room. */
.ch-gaugewrap { position: relative; width: clamp(220px, 30vh, 380px); aspect-ratio: 1; margin: clamp(10px, 2vh, 24px) auto; }
.ch-gauge { width: 100%; height: 100%; display: block; overflow: visible; }
.ch-gauge-bg { fill: none; stroke: var(--cp-surface-container-highest); stroke-width: 10; }
.ch-gauge-fill { fill: none; stroke: url(#chGrad); stroke-width: 10; stroke-linecap: round; }
.ch-gauge-lever line { stroke: var(--cp-on-surface); stroke-width: 4; stroke-linecap: round; }
.ch-gauge-lever circle { fill: var(--cp-on-surface); stroke: var(--cp-surface); stroke-width: 2; }
.ch-gauge-hub { fill: var(--cp-surface-container); stroke: var(--cp-outline-variant); stroke-width: 2; }
.ch-gauge-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: clamp(48px, 7vw, 110px); font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums;
  color: var(--cp-secondary); }

.ch-track { position: relative; height: clamp(18px, 2.2vh, 30px); margin: clamp(40px, 6vh, 70px) 4% clamp(30px, 4vh, 50px);
  border-radius: var(--cp-shape-full); background: var(--cp-surface-container-high); border: 2px solid var(--cp-outline-variant); }
.ch-tick { position: absolute; top: calc(100% + 10px); font-size: clamp(14px, 1.3vw, 22px);
  color: var(--cp-on-surface-variant); font-weight: 700; }
.ch-tick.t0 { left: 0; }
.ch-tick.t50 { left: 50%; transform: translateX(-50%); }
.ch-tick.t100 { right: 0; }
.ch-gap { position: absolute; top: 0; bottom: 0; width: 0; background: var(--cp-surface-container-highest);
  transition: left var(--cp-spring-spatial-slow-duration) var(--cp-spring-spatial-slow),
    width var(--cp-spring-spatial-slow-duration) var(--cp-spring-spatial-slow); }

.ch-mark { position: absolute; top: 50%; width: 8px; height: clamp(48px, 6vh, 78px);
  border-radius: var(--cp-shape-extra-small); transform: translate(-50%, -50%);
  transition: left var(--cp-spring-spatial-slow-duration) var(--cp-spring-spatial-slow); }
.ch-mark.guess { background: var(--cp-outline); }
.ch-mark.guess.live { background: var(--cp-primary); box-shadow: 0 0 24px var(--cp-primary);
  transition: left .18s ease-out; }
.ch-mark.small { width: 5px; height: clamp(34px, 4vh, 52px); opacity: .8; }
.ch-mark.truth { background: var(--cp-secondary); box-shadow: 0 0 34px var(--cp-secondary); width: 10px; }
.ch-mark.truth.spot { background: var(--cp-tertiary); box-shadow: 0 0 44px var(--cp-tertiary); }
.ch-marklabel { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  font-size: clamp(14px, 1.4vw, 24px); font-weight: 800; white-space: nowrap; color: var(--cp-on-surface); }

.ch-big { text-align: center; font-size: var(--cp-tv-display-large-size); line-height: var(--cp-tv-display-large-line);
  font-weight: var(--cp-tv-display-large-weight); font-variant-numeric: tabular-nums; color: var(--cp-primary); }
.ch-big.landed { animation: ch-land var(--cp-spring-spatial-slow-duration) var(--cp-spring-spatial-slow); }
@keyframes ch-land { from { transform: scale(.82); opacity: .4; } to { transform: scale(1); opacity: 1; } }
.ch-truthlabel { text-align: center; font-size: clamp(15px, 1.5vw, 26px); font-weight: 800;
  letter-spacing: .18em; text-transform: uppercase; color: var(--cp-on-surface-variant); }

.ch-hl { display: flex; align-items: center; justify-content: center; gap: clamp(20px, 4vw, 60px);
  font-size: var(--cp-tv-headline-medium-size); font-weight: 900; }
.ch-hl-l { color: var(--cp-primary); }
.ch-hl-h { color: var(--cp-secondary); }
.ch-hl-or { color: var(--cp-on-surface-variant); font-size: .6em; font-weight: 600; }

.ch-spot { text-align: center; font-size: var(--cp-tv-headline-medium-size); font-weight: 900;
  color: var(--cp-tertiary); margin: 10px 0; animation: ch-land var(--cp-spring-spatial-slow-duration) var(--cp-spring-spatial-slow); }
.ch-nogo { text-align: center; font-size: var(--cp-tv-headline-small-size); color: var(--cp-on-surface-variant); margin: 10px 0; }
.ch-finalbanner { text-align: center; font-size: var(--cp-tv-headline-small-size); font-weight: 900;
  letter-spacing: .16em; color: var(--cp-primary); }
.ch-late { min-height: 1px; }
.ts-call { min-width: 3ch; text-align: center; color: var(--cp-on-surface-variant); font-weight: 800; }

@media (prefers-reduced-motion: reduce) {
  .ch-gap, .ch-mark, .ch-big.landed, .ch-spot { transition: none; animation: none; }
}

/* --- Round 2: four-way call on the TV --- */
.ch-hl.four { flex-wrap: wrap; gap: clamp(12px, 2vw, 32px); font-size: var(--cp-tv-headline-small-size); }
.ch-hl-much_higher { color: var(--cp-secondary); }
.ch-hl-higher { color: var(--cp-on-secondary-container); }
.ch-hl-lower { color: var(--cp-on-primary-container); }
.ch-hl-much_lower { color: var(--cp-primary); }
.ch-hl .much { text-shadow: 0 0 18px currentColor; }
.ch-riskhint { text-align: center; font-size: clamp(14px, 1.4vw, 24px); font-weight: 700;
  color: var(--cp-on-surface-variant); letter-spacing: .04em; }

/* --- Round 3: the survey board, 3x3 --- */
.ch-board { display: grid; grid-template-columns: repeat(3, 1fr);
  gap: clamp(8px, 1.2vw, 18px); margin: clamp(12px, 2vh, 26px) 2%; }
.ch-cell { display: flex; align-items: center; gap: clamp(8px, 1vw, 16px);
  padding: clamp(10px, 1.4vh, 20px) clamp(12px, 1.4vw, 22px);
  border-radius: var(--cp-shape-large); background: var(--cp-surface-container); border: 2px solid var(--cp-outline-variant);
  font-size: clamp(15px, 1.6vw, 28px); font-weight: 700; min-height: clamp(56px, 8vh, 92px); }
.ch-cellnum { color: var(--cp-on-surface-variant); font-weight: 900; font-variant-numeric: tabular-nums; }
.ch-celltext { flex: 1; }
.ch-cellshare { font-weight: 900; font-variant-numeric: tabular-nums; color: var(--cp-secondary);
  font-size: clamp(18px, 2vw, 36px); }
.ch-cellwho { flex-basis: 100%; font-size: clamp(11px, 1vw, 18px); font-weight: 600;
  color: var(--cp-on-surface-variant); }
.ch-board.revealed .ch-cell { opacity: 0; animation: ch-flip var(--cp-spring-spatial-default-duration) var(--cp-spring-spatial-default) forwards; }
.ch-board.revealed .ch-cell.top { background: var(--cp-secondary-container); color: var(--cp-on-secondary-container);
  border-color: var(--cp-secondary); }
.ch-board.revealed .ch-cell.top .ch-cellwho, .ch-board.revealed .ch-cell.top .ch-cellnum { color: var(--cp-on-secondary-container); }
@keyframes ch-flip { from { opacity: 0; transform: rotateX(-70deg) scale(.94); }
  to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .ch-board.revealed .ch-cell { animation: none; opacity: 1; }
}

/* --- Punchline (TV) ----------------------------------------------------- */
.pu-tv-status { font-size: var(--cp-tv-headline-large-size); line-height: var(--cp-tv-headline-large-line); text-align: center; margin: .4em 0 .2em; }
.pu-tv-sub { text-align: center; color: var(--cp-on-surface-variant); font-size: var(--cp-tv-body-medium-size); }
.pu-tv-duel { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(14px,2vw,28px); margin-top: clamp(10px,2vh,24px); }
.pu-tv-ans { display: flex; flex-direction: column; gap: 10px; padding: clamp(16px,2vw,28px);
  border-radius: var(--cp-shape-extra-large); font-size: var(--cp-tv-title-large-size); font-weight: 700;
  min-height: clamp(120px,20vh,220px); justify-content: center; align-items: center; text-align: center; position: relative; }
.pu-tv-ans.da { background: var(--cp-primary-container); color: var(--cp-on-primary-container); border: 2px solid var(--cp-primary); }
.pu-tv-ans.db { background: var(--cp-secondary-container); color: var(--cp-on-secondary-container); border: 2px solid var(--cp-secondary); }
.pu-tv-letter { position: absolute; top: 8px; left: 14px; font-size: clamp(20px,2vw,30px); font-weight: 900; opacity: .6; }
.pu-tv-ans.reveal.win { outline: 4px solid var(--cp-tertiary); }
.pu-tv-ans.reveal.win::after { content: '🏆'; position: absolute; top: 8px; right: 14px; font-size: clamp(20px,2vw,32px); }
.pu-tv-ans.reveal.lose { opacity: .7; }
.pu-tv-by { display: flex; align-items: center; gap: 8px; opacity: .85; font-size: clamp(14px,1.4vw,22px); font-weight: 700; }
.pu-tv-byav { font-size: 1.4em; }
.pu-tv-tally { font-weight: 800; font-size: clamp(16px,1.6vw,26px); }
.pu-tv-gain { font-weight: 900; color: var(--cp-tertiary); font-size: clamp(20px,2vw,34px); }
.pu-tv-ans.reveal.win .pu-tv-gain { color: inherit; }
.pu-tv-shout { text-align: center; font-weight: 900; color: var(--cp-primary); font-size: var(--cp-tv-headline-small-size); margin-top: 14px; }
.pu-tv-finalbanner { text-align: center; font-weight: 900; letter-spacing: .1em; color: var(--cp-secondary); font-size: var(--cp-tv-headline-small-size); }
.pu-tv-finallist { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.pu-tv-finalcell { background: var(--cp-surface-container); border-radius: var(--cp-shape-medium); padding: clamp(10px,1.4vw,18px);
  font-size: clamp(16px,1.8vw,26px); font-weight: 600; text-align: center; }
.pu-tv-finalboard { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.pu-tv-fbrow { display: flex; align-items: center; gap: 14px; background: var(--cp-surface-container); border-radius: var(--cp-shape-large);
  padding: clamp(8px,1.2vh,16px) clamp(12px,1.5vw,22px); opacity: 0;
  animation: puFb var(--cp-spring-spatial-default-duration) var(--cp-spring-spatial-default) forwards;
  font-size: clamp(16px,1.8vw,28px); }
.pu-tv-fbrow.top { background: var(--cp-tertiary-container); color: var(--cp-on-tertiary-container); outline: 3px solid var(--cp-tertiary); }
@keyframes puFb { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
.pu-tv-fbrank { font-weight: 900; color: var(--cp-on-surface-variant); min-width: 2.4ch; }
.pu-tv-fbrow.top .pu-tv-fbrank { color: inherit; }
.pu-tv-fbav { font-size: 1.5em; }
.pu-tv-fbname { font-weight: 800; color: var(--cp-secondary); min-width: 5ch; }
.pu-tv-fbrow.top .pu-tv-fbname { color: inherit; }
.pu-tv-fbtext { flex: 1; font-weight: 600; }
.pu-tv-fbvotes { color: var(--cp-secondary); font-weight: 800; }
.pu-tv-fbgain { font-weight: 900; color: var(--cp-tertiary); }
.pu-tv-fbrow.top .pu-tv-fbvotes, .pu-tv-fbrow.top .pu-tv-fbgain { color: inherit; }
@media (prefers-reduced-motion: reduce) { .pu-tv-fbrow { animation: none; opacity: 1; } }

/* ===================================================================== *
 * War — shared TV screen
 * Playing cards and the felt stay literal — a card should read as a real
 * card, not a themed rectangle. Chrome around them uses the tokens.
 * ===================================================================== */
.wr-tv-head { display: flex; align-items: baseline; justify-content: center; gap: 20px; margin-bottom: 10px; }
.wr-tv-title { font-size: var(--cp-tv-headline-medium-size); font-weight: 900; letter-spacing: .02em; color: var(--cp-primary); }
.wr-tv-round { font-size: var(--cp-tv-title-medium-size); font-weight: 700; color: var(--cp-on-surface-variant); }
.wr-tv-timer { font-size: var(--cp-tv-headline-small-size); font-weight: 900; color: var(--cp-secondary); min-width: 1.5em; text-align: center;
  font-variant-numeric: tabular-nums; }
.wr-tv-timer.urgent { color: var(--cp-error); }
.wr-tv-cue { text-align: center; font-size: var(--cp-tv-body-medium-size); font-weight: 800; color: var(--cp-on-surface-variant); margin-bottom: 18px; }

.wr-table { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 18px;
  justify-items: center; max-width: 1100px; margin: 0 auto; }
.wr-seat { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px;
  border-radius: var(--cp-shape-large-increased); border: 2px solid transparent;
  transition: border-color var(--cp-spring-effects-default-duration) var(--cp-spring-effects-default),
    transform var(--cp-spring-spatial-default-duration) var(--cp-spring-spatial-default),
    background var(--cp-spring-effects-default-duration) var(--cp-spring-effects-default); }
.wr-seat.ready { border-color: var(--cp-outline-variant); }
.wr-seat.winner { border-color: var(--cp-tertiary); background: var(--cp-tertiary-container); color: var(--cp-on-tertiary-container);
  transform: translateY(-4px); }
.wr-seat-name { display: flex; align-items: center; gap: 8px; font-size: clamp(16px,1.6vw,22px); font-weight: 800; }
.wr-seat-av { font-size: 26px; }
.wr-seat-won { font-size: clamp(13px,1.3vw,17px); color: var(--cp-on-surface-variant); font-weight: 700; }
.wr-seat.winner .wr-seat-won { color: inherit; }

.wr-tv-card { position: relative; width: 104px; height: 146px; border-radius: 14px; background: #fbfbff;
  box-shadow: 0 10px 26px #0008; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.wr-tv-card.red { color: #e5484d; } .wr-tv-card.black { color: #1b1b2e; }
.wr-tv-card .wr-tv-rank { font-size: 52px; font-weight: 900; line-height: 1; }
.wr-tv-card .wr-tv-suit { font-size: 34px; }
/* Burgundy printed back — matches the shared card face in cards.css. */
.wr-tv-card.back { background: radial-gradient(circle at 50% 50%, #a03040 0 30%, #7a1f2b 100%); color: #ffffffb0;
  box-shadow: inset 0 0 0 5px #fbfaf6, 0 10px 26px #0008; }
.wr-tv-card .wr-tv-back { font-size: 54px; }
.wr-tv-card.up { animation: wrTvFlip var(--cp-spring-spatial-fast-duration) var(--cp-spring-spatial-fast) both; }
@keyframes wrTvFlip { from { transform: rotateY(90deg); } to { transform: none; } }

.wr-tv-banner { display: flex; align-items: center; justify-content: center; gap: 14px; font-size: var(--cp-tv-headline-small-size);
  font-weight: 900; margin: 6px 0 18px; }
.wr-tv-banner.war { color: var(--cp-tertiary); }
.wr-tv-warbadge { font-size: 34px; animation: warPulse var(--cp-spring-spatial-fast-duration) var(--cp-spring-spatial-fast); }
@keyframes warPulse { 0% { transform: scale(.6); } 60% { transform: scale(1.2); } 100% { transform: scale(1); } }

.wr-tv-final { text-align: center; margin: 20px 0; }
.wr-tv-crown { font-size: 70px; }
.wr-tv-winav { font-size: 90px; display: block; margin: 6px auto; }
.wr-tv-winname { font-size: var(--cp-tv-headline-large-size); font-weight: 900; }
.wr-tv-winsub { font-size: var(--cp-tv-body-medium-size); color: var(--cp-on-surface-variant); font-weight: 700; }

/* Generic TV leaderboard (shared by card games) */
.tv-board { max-width: 640px; margin: 22px auto 0; display: flex; flex-direction: column; gap: 8px; }
.tv-brow { display: grid; grid-template-columns: 3em 1.6em 1fr auto; align-items: center; gap: 12px;
  background: var(--cp-surface-container); border-radius: var(--cp-shape-medium); padding: 10px 16px;
  font-size: var(--cp-tv-body-medium-size); font-weight: 700; }
.tv-brank { color: var(--cp-on-surface-variant); font-weight: 800; }
.tv-bav { font-size: 26px; } .tv-bname { font-weight: 800; } .tv-bscore { font-weight: 900; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .wr-tv-card.up, .wr-tv-warbadge { animation: none; } }

/* ===================================================================== *
 * Blackjack — shared TV screen
 * The felt table is printed scenery (literal casino materials, like the
 * card faces); state around it — acting, won, lost — speaks token roles
 * and always pairs color with an outline, delta sign, or badge.
 * ===================================================================== */
.bj-shoe-badge { font-size: 15px; font-weight: 900; color: var(--cp-on-tertiary-container); background: var(--cp-tertiary-container);
  border: 1px solid var(--cp-tertiary); border-radius: var(--cp-shape-full); padding: 4px 12px; }
.bj-tv-dealer { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 18px; }
.bj-tv-dealer-label { font-size: var(--cp-tv-body-medium-size); font-weight: 800; color: var(--cp-on-surface-variant); }
.bj-tv-hand { display: flex; gap: 6px; justify-content: center; }
.bj-tv-card { width: 66px; height: 92px; border-radius: 10px; background: #fbfbff; box-shadow: 0 6px 16px #0007;
  display: flex; flex-direction: column; align-items: center; justify-content: center; }
.bj-tv-card.red { color: #e5484d; } .bj-tv-card.black { color: #1b1b2e; }
.bj-tv-card .bj-tv-rank { font-size: 30px; font-weight: 900; line-height: 1; }
.bj-tv-card .bj-tv-suit { font-size: 20px; }
.bj-tv-card.back { background: radial-gradient(circle at 50% 50%, #a03040 0 30%, #7a1f2b 100%); color: #ffffffb0;
  box-shadow: inset 0 0 0 4px #fbfaf6, 0 6px 16px #0007; }
.bj-tv-card .bj-tv-back { font-size: 34px; }

/* The static blackjack table (item 6): a felt oval; ten designated seat
 * spots along the bottom curve, position 1 on the RIGHT (deal order). */
.bj-felt { position: relative; max-width: 1250px; margin: 0 auto; padding: 26px 18px 34px;
  transform: perspective(1600px) rotateX(7deg); transform-origin: 50% 100%;
  border-radius: 46% 46% 24px 24px / 32% 32% 24px 24px;
  background:
    url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.07 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(ellipse at 50% 0%, #1d6b46 0%, #14532d 55%, #0e3b21 100%);
  border: 8px solid #7a1f2b;
  box-shadow: inset 0 0 64px #00000073, inset 0 8px 12px -8px #ffffff2b, 0 12px 30px #0008; }
/* Stitched seam where the leather rail meets the felt. */
.bj-felt::after { content: ''; position: absolute; inset: 3px; border-radius: inherit;
  border: 1.5px dashed #ffffff2b; pointer-events: none; }
.bj-arc { display: flex; justify-content: center; align-items: flex-start; gap: 10px; flex-wrap: nowrap; }
.bj-pod { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 8px;
  border-radius: var(--cp-shape-large); border: 2px solid #ffffff14; background: #0000002a; min-width: 96px; flex: 1 1 0; }
.bj-pod.won { border-color: var(--cp-tertiary); background: #f2bf3924; }
.bj-pod.lost { border-color: #ffb4ab55; background: #ffb4ab14; opacity: .88; }
.bj-pod.push { border-color: #ffffff55; }
.bj-pod.sitout { opacity: .5; }
.bj-pod.acting { border-color: var(--cp-primary); background: #ffb0ca1c;
  box-shadow: 0 0 22px #ffb0ca4d; }
@media (prefers-reduced-motion: no-preference) {
  .bj-pod.acting { animation: bjActPulse 1.4s ease-in-out infinite; }
  @keyframes bjActPulse { 50% { box-shadow: 0 0 34px #ffb0ca80; } }
}
.bj-pod.empty { border-style: dashed; border-color: #ffffff10; background: transparent; min-height: 64px;
  justify-content: center; opacity: .45; }
.bj-open-spot { font-size: 15px; font-weight: 900; color: #ffffff38; border: 2px dashed #ffffff2c;
  border-radius: var(--cp-shape-full); width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; }
.bj-seat-name { display: flex; align-items: center; gap: 6px; font-size: 16px; font-weight: 800;
  max-width: 118px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bj-seat-av { font-size: 20px; }
.bj-seat-meta { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 800; }
.bj-seat-total { font-weight: 900; font-variant-numeric: tabular-nums; }
.bj-seat-bet { color: #d9f7e6; font-weight: 700; }
.bj-seat-delta { font-weight: 900; font-variant-numeric: tabular-nums; }
.bj-pod.won .bj-seat-delta { color: var(--cp-tertiary); } .bj-pod.lost .bj-seat-delta { color: var(--cp-error); }
.bj-seat-chips { font-size: 13px; color: #d9f7e6cc; font-weight: 700; }
@media (max-width: 1100px) { .bj-arc { flex-wrap: wrap; } .bj-pod { flex: 0 1 140px; } }

/* Session chip ledger (item 8.3) — pinned under the table on the host screen. */
.bj-ledger { max-width: 900px; margin: 16px auto 0; border-radius: var(--cp-shape-large);
  border: 1px solid var(--cp-outline-variant); background: var(--cp-surface-container-low); padding: 10px 16px; }
.bj-ledger-title { font-size: 14px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase;
  color: var(--cp-on-surface-variant); margin-bottom: 6px; }
.bj-ledger-rows { display: flex; flex-direction: column; gap: 3px; }
.bj-ledger-row { display: grid; grid-template-columns: 28px 1fr auto auto 72px; align-items: center;
  gap: 10px; font-size: 16px; padding: 3px 0; }
.bj-ledger-av { font-size: 20px; }
.bj-ledger-name { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bj-ledger-chips { font-weight: 900; font-variant-numeric: tabular-nums; }
.bj-ledger-buy { font-size: 13px; color: var(--cp-on-surface-variant); font-weight: 700; }
.bj-ledger-net { font-weight: 900; text-align: right; color: var(--cp-on-surface-variant); font-variant-numeric: tabular-nums; }
.bj-ledger-net.up { color: var(--cp-tertiary); } .bj-ledger-net.down { color: var(--cp-error); }

/* War — round meter + DOUBLE banner */
.wr-tv-meter { max-width: 520px; height: 8px; margin: 4px auto 18px; border-radius: var(--cp-shape-full);
  background: var(--cp-surface-container-highest); overflow: hidden; }
.wr-tv-meter i { display: block; height: 100%; border-radius: var(--cp-shape-full);
  background: linear-gradient(90deg, var(--cp-secondary), var(--cp-primary));
  transition: width var(--cp-spring-spatial-slow-duration) var(--cp-spring-spatial-slow); }
.wr-tv-banner.doubled { color: var(--cp-tertiary); }
