/* Carolina Hold 'em -- felt, brass and bone. */

:root {
  --felt-1: #0d2a1f;
  --felt-2: #071811;
  --felt-rail: #1d3d2e;
  --brass: #d8b45c;
  --brass-dim: #8d7434;
  --bone: #f4efe2;
  --ink: #10151a;
  --red: #c8384a;
  --muted: rgba(244, 239, 226, 0.56);
  --line: rgba(216, 180, 92, 0.22);
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  --radius: 16px;
  --font: 'Georgia', 'Iowan Old Style', 'Times New Roman', serif;
  --sans: ui-sans-serif, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--felt-2);
  color: var(--bone);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

body {
  background:
    radial-gradient(120% 90% at 50% -10%, #17402f 0%, var(--felt-1) 45%, var(--felt-2) 100%);
  background-attachment: fixed;
}

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

/* ------------------------------------------------------------------ atoms */

.btn {
  font: 600 1rem/1 var(--sans);
  padding: 0.95rem 1.35rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #2a5843, #1b3a2c);
  color: var(--bone);
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
  touch-action: manipulation;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; filter: none; }

.btn.primary {
  background: linear-gradient(180deg, var(--brass), #b0893c);
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.25);
  font-weight: 700;
}
.btn.ghost { background: transparent; }
.btn.danger { background: linear-gradient(180deg, #5c2630, #3d1a21); }
/* A Call that only exists because someone raised. Brass-lit rather than solid
   brass, so it reads as "this one changed" without competing with the primary
   action next to it. Transform-only nudge -- fading in from 0 here would be
   pinned invisible by the next broadcast. */
.btn.raised {
  background: linear-gradient(180deg, rgba(216, 180, 92, 0.34), rgba(216, 180, 92, 0.12));
  border-color: var(--brass);
  color: var(--bone);
  box-shadow: 0 0 0 2px rgba(216, 180, 92, 0.45), 0 0 20px rgba(216, 180, 92, 0.3);
  animation: nudge 0.25s ease-out;
}
.btn.wide { width: 100%; }

.muted { color: var(--muted); font-size: 0.85rem; }
.brass { color: var(--brass); }

h1, h2, h3 { font-family: var(--font); font-weight: 600; letter-spacing: 0.01em; }

.wordmark {
  font-family: var(--font);
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  color: var(--brass);
  letter-spacing: 0.06em;
}
.wordmark small { display: block; font-size: 0.42em; color: var(--muted); letter-spacing: 0.22em; text-transform: uppercase; }

/* ------------------------------------------------------------- playing card */

/* Two-faced so cards can be dealt back-up and flipped over. The container holds
   the geometry; the faces hold the ink. */
.card {
  --w: 74px;
  width: var(--w);
  height: calc(var(--w) * 1.42);
  position: relative;
  flex: none;
  perspective: 900px;
}
.card .c3d {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: rotateY(180deg); /* front showing by default */
}
.card.down .c3d { transform: rotateY(0deg); } /* back showing */

.card .face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: calc(var(--w) * 0.11);
  display: grid;
  place-items: center;
  font-family: var(--font);
}
.card .face.back {
  transform: rotateY(0deg);
  background: repeating-linear-gradient(45deg, #2f5f49 0 6px, #26503d 6px 12px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45), inset 0 0 0 2px var(--brass-dim);
}
.card .face.back::after {
  content: '\2660';
  color: rgba(216, 180, 92, 0.5);
  font-size: calc(var(--w) * 0.4);
}
.card .face.front {
  transform: rotateY(180deg);
  background: linear-gradient(160deg, #fffdf7, #ece5d3);
  color: var(--ink);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}
.card .face.front.red { color: var(--red); }

.card .pip { font-size: calc(var(--w) * 0.52); line-height: 1; }
.card .corner {
  position: absolute;
  top: 6%; left: 8%;
  font-size: calc(var(--w) * 0.26);
  font-weight: 700;
  line-height: 1;
  text-align: center;
}
.card .corner .s { display: block; font-size: 0.86em; }

/* Deal face down, hold, then turn over. Driven by a keyframe rather than a
   transition because the view re-renders wholesale on every broadcast; a
   negative animation-delay resumes it mid-flip instead of restarting. */
.card.flip .c3d { animation: flipover 1100ms ease-in-out both; }
@keyframes flipover {
  0%, 42% { transform: rotateY(0deg); }
  100%    { transform: rotateY(180deg); }
}
/* Turning face down again -- the same motion in reverse, without the initial
   hold, since there is nothing to wait for when you're covering up. */
.card.down.flip .c3d { animation: flipback 460ms ease-in-out both; }
@keyframes flipback {
  0%   { transform: rotateY(180deg); }
  100% { transform: rotateY(0deg); }
}

.card.small { --w: 44px; }
.card.tiny { --w: 32px; }
.card.reveal { --w: 62px; }   /* opponents' cards once the hand is over */
.card.big { --w: clamp(64px, 8.5vw, 118px); }
.card.dim { filter: brightness(0.55) saturate(0.6); }

.cards { display: flex; gap: 0.55rem; }

/* ------------------------------------------------------------------ screens */

.center-screen {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.panel {
  width: min(440px, 100%);
  background: rgba(8, 24, 18, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  text-align: center;
}
.panel h1 { margin-bottom: 0.4rem; }
.panel .stack { display: grid; gap: 0.75rem; margin-top: 1.5rem; }

input[type='text'] {
  width: 100%;
  padding: 0.95rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.3);
  color: var(--bone);
  font-size: 1.05rem;
  font-family: var(--sans);
  text-align: center;
}
input[type='text']:focus { outline: 2px solid var(--brass-dim); }

.err {
  margin-top: 0.9rem;
  color: #ffb4b4;
  font-size: 0.9rem;
  min-height: 1.2em;
}

/* running commentary -- its own column on the main screen */
.activity-col { background: rgba(5, 18, 13, 0.6); padding: 1rem 1.1rem; overflow-y: auto; }
.activity-head {
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.activity .entry {
  /* Sized to be read from the sofa, not from the laptop driving the TV. Now
     that it has a column to itself there is room to go up again; the
     line-height also keeps Georgia's descenders on the street lines clear of
     the rule underneath. */
  font-size: 1.3rem;
  line-height: 1.35;
  padding: 0.42rem 0;
  color: var(--muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  /* No fade-in here. The sidebar is re-rendered on every broadcast, so an
     opacity-from-0 keyframe restarts on all entries at once and leaves the
     history washed out and unreadable. Only the newest line moves. */
  opacity: 1;
}
/* newest first: the eye lands in the same place every time */
.activity .entry.newest { color: var(--bone); font-weight: 600; animation: nudge 0.3s ease-out; }
.activity .entry.street { color: var(--brass); font-family: var(--font); }
.activity .entry.result { color: var(--brass); font-weight: 600; }
@keyframes slidein { from { opacity: 0; transform: translateY(-6px); } }

/* status line above the board */
.headline {
  font-family: var(--font);
  font-size: clamp(1.1rem, 2.2vw, 1.8rem);
  color: var(--brass);
  letter-spacing: 0.02em;
  text-align: center;
  max-width: 80%;
  /* Same reason as .lock-notice: never fade in from 0 on a re-rendered node. */
  opacity: 1;
  animation: nudge 0.35s ease-out;
}

/* names the action that just changed the buttons underneath it */
.lock-notice {
  text-align: center;
  font-family: var(--font);
  color: var(--brass);
  font-size: 0.95rem;
  padding: 0.5rem;
  /* Slide, but never fade in: this view is re-rendered wholesale on every
     broadcast, which restarts the animation. An opacity-from-0 keyframe left
     the text permanently invisible. */
  opacity: 1;
  animation: nudge 0.25s ease-out;
}
@keyframes nudge { from { transform: translateY(-6px); } }
.actions.locked .btn { opacity: 0.35; pointer-events: none; }

/* -------------------------------------------------------------- main screen */

/* Seats, felt, activity. The felt gets minmax(0, 1fr) so the board sets its own
   width rather than forcing the two sidebars past their share. */
.tv {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(290px, 23%) minmax(0, 1fr) minmax(270px, 21%);
  gap: 1px;
  background: var(--line);
}

.roster { background: rgba(5, 18, 13, 0.6); padding: 1rem; overflow-y: auto; }
.roster-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}
/* Three controls in a narrow sidebar: keep each label on one line rather than
   letting "End game" break in half and push the wordmark into a wrap too. */
.roster-head .btn { white-space: nowrap; }

.seat {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem 0.6rem;
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  border: 1px solid transparent;
  margin-bottom: 0.5rem;
  background: rgba(255, 255, 255, 0.035);
  transition: border-color 0.2s, opacity 0.2s;
}
.seat.folded { opacity: 0.38; }
.seat.allin { border-color: var(--brass); }
.seat.winner {
  border-color: var(--brass);
  background: linear-gradient(90deg, rgba(216, 180, 92, 0.22), rgba(216, 180, 92, 0.04));
  animation: pulse 1.1s ease-in-out infinite alternate;
}
@keyframes pulse { to { box-shadow: 0 0 22px rgba(216, 180, 92, 0.35); } }

.seat .name { font-weight: 600; display: flex; align-items: center; gap: 0.4rem; }
.seat .chips { font-family: var(--font); color: var(--brass); font-size: 1.15rem; }
.seat .tag {
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.15rem 0.4rem;
  border-radius: 5px;
  background: rgba(216, 180, 92, 0.2);
  color: var(--brass);
}
.seat .offline { width: 7px; height: 7px; border-radius: 50%; background: #7a4a4a; }

/* Remove-a-seat X. Faint by default and only fully lit on hover -- it is
   destructive, so it shouldn't invite a stray click. Not hover-to-appear: the
   main screen may be a tablet, where nothing ever hovers. */
.seat-x {
  margin-left: auto;
  width: 22px;
  height: 22px;
  flex: none;
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  opacity: 0.3;
  transition: opacity 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.seat:hover .seat-x, .seat-x:focus-visible { opacity: 1; }
.seat-x:hover, .seat-x:focus-visible {
  color: #e2807a;
  border-color: rgba(226, 128, 122, 0.5);
  background: rgba(226, 128, 122, 0.1);
}
/* A folded seat is dimmed as a whole; don't let that hide the control. */
.seat.folded:hover { opacity: 0.75; }

/* stack and, once known, what they're holding -- both right of the boxes */
.seat .meta { display: flex; flex-direction: column; align-items: flex-end; gap: 0.1rem; min-width: 4.4rem; }
.seat .handlabel {
  font-family: var(--font);
  font-size: 0.84rem;
  color: var(--brass);
  white-space: nowrap;
}
/* Who is ahead mid-run-out, so an all-in has something to follow between cards. */
.seat .handlabel.leading { color: #f0d98a; font-weight: 600; }
.seat .lead-tag {
  margin-left: 0.4rem;
  font-family: var(--sans);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.1rem 0.32rem;
  border-radius: 5px;
  background: rgba(216, 180, 92, 0.28);
  color: var(--bone);
  vertical-align: middle;
}

/* betting boxes sit next to the player's remaining stack, so what they've put
   in and what they have left read as one line */
.betrow {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.15rem;
}
.stackchip {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.05;
  min-width: 3.2rem;
}
.stackchip .lbl {
  font-size: 0.56rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.stackchip strong {
  font-family: var(--font);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--brass);
}

/* four betting boxes, one per street */
.boxes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.box {
  min-height: 26px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(0, 0, 0, 0.24);
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-family: var(--font);
  color: var(--muted);
}
.box.filled { background: rgba(216, 180, 92, 0.16); color: var(--bone); border-color: var(--line); }
.box.active { border-color: var(--brass); }
/* a split box marks the capped portion a short all-in could actually match */
.box.split { display: grid; grid-template-rows: 1fr 1fr; gap: 1px; padding: 0; }
.box.split span { display: grid; place-items: center; font-size: 0.68rem; }
.box.split span:first-child { background: rgba(216, 180, 92, 0.26); border-radius: 5px 5px 0 0; }
.box.split span:last-child { background: rgba(255, 255, 255, 0.07); border-radius: 0 0 5px 5px; }

.seat .hole { grid-column: 1 / -1; display: flex; gap: 0.3rem; margin-top: 0.3rem; }
.seat .handlabel { grid-column: 1 / -1; font-size: 0.74rem; color: var(--brass); font-family: var(--font); }

/* table centre */
.felt {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.4rem;
  padding: 1.5rem;
  background: radial-gradient(70% 60% at 50% 45%, rgba(35, 92, 68, 0.55), transparent 70%);
}
.felt-head { position: absolute; top: 1.1rem; left: 0; right: 0; display: flex; justify-content: space-between; padding: 0 1.4rem; align-items: center; }

/* Someone shoved. Sits above the board rather than over it, and takes itself
   off screen when the keyframe ends -- ten of these in one hand is a real
   possibility, so it has to be brief and it must never cover the cards.
   Opacity only ever goes 1 -> 0: starting a fade at 0 leaves the element
   pinned invisible when the next broadcast restarts the animation. */
.allin-flare {
  position: absolute;
  top: 3.6rem;
  left: 50%;
  z-index: 5;
  pointer-events: none;
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  font-family: var(--font);
  padding: 0.6rem 2rem;
  border-radius: 99px;
  border: 1px solid var(--brass);
  background: linear-gradient(180deg, rgba(216, 180, 92, 0.26), rgba(8, 24, 18, 0.9));
  box-shadow: 0 0 44px rgba(216, 180, 92, 0.45), var(--shadow);
  animation: flare 2200ms ease-out both;
}
.allin-flare .who { color: var(--bone); font-size: 2rem; }
.allin-flare .cry {
  color: var(--brass);
  font-size: 2rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}
/* One pass of brass across the pill. Transform-only, so a re-render mid-sweep
   resumes with the parent rather than flashing a second time. */
.allin-flare::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 240, 200, 0.34) 50%, transparent 62%);
  animation: sweep 2200ms ease-out both;
  /* The negative delay lives in an inline style on the parent; inherit it or a
     re-render restarts the sweep on its own and shimmers twice. */
  animation-delay: inherit;
}
@keyframes sweep {
  0%        { transform: translateX(-100%); }
  40%, 100% { transform: translateX(100%); }
}
@keyframes flare {
  0%   { transform: translateX(-50%) scale(0.8); opacity: 1; }
  12%  { transform: translateX(-50%) scale(1.08); }
  22%  { transform: translateX(-50%) scale(1); }
  84%  { transform: translateX(-50%) scale(1); opacity: 1; }
  100% { transform: translateX(-50%) scale(1.04); opacity: 0; }
}

.board { display: flex; gap: 0.7rem; min-height: 1px; }
.board .slot {
  width: clamp(64px, 8.5vw, 118px);
  aspect-ratio: 1 / 1.42;
  border-radius: 10px;
  border: 1px dashed rgba(255, 255, 255, 0.1);
}

.pot { text-align: center; }
.pot .amount {
  font-family: var(--font);
  font-size: clamp(2rem, 5vw, 3.4rem);
  color: var(--brass);
  /* Georgia sets old-style figures: 3, 4, 5, 7 and 9 hang below the baseline,
     and it ships no lining-figure table, so font-variant-numeric can't fix it.
     The clearance has to come from the line box instead -- at line-height 1
     those descenders ran straight into the POT label underneath. */
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}
.pot .label { font-size: 0.72rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--muted); }

.street-name { font-family: var(--font); font-size: 1.1rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }

/* countdown */
.clock { display: flex; align-items: center; gap: 0.8rem; }
.clock .bar { width: min(420px, 45vw); height: 8px; border-radius: 99px; background: rgba(0, 0, 0, 0.4); overflow: hidden; }
.clock .fill { height: 100%; background: linear-gradient(90deg, var(--brass), #f0d98a); transition: width 0.1s linear; }
.clock.urgent .fill { background: linear-gradient(90deg, #d8574a, #ff8a6a); }
.clock .secs {
  font-family: var(--font);
  font-size: 1.5rem;
  text-align: right;
  /* Lining, fixed-width figures on a fixed box. Georgia's default old-style
     figures have descenders and vary in width, so the countdown changed height
     and shuffled everything below it once a second. */
  font-variant-numeric: tabular-nums;
  min-width: 2.4ch;
  /* Fixed box: Georgia's old-style figures differ in height and depth, so
     without this the countdown resized once a second and shuffled the buttons
     underneath it. */
  line-height: 1.35;
  height: 1.35em;
}
.clock.urgent .secs { color: #ff9d84; }

.banner {
  text-align: center;
  font-family: var(--font);
  padding: 1rem 1.6rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(8, 24, 18, 0.8);
  box-shadow: var(--shadow);
  max-width: 90%;
}
.banner h2 { color: var(--brass); font-size: clamp(1.3rem, 3vw, 2rem); }
.banner .line { color: var(--muted); font-size: 0.92rem; margin-top: 0.35rem; }

/* A paused table reads as deliberately stopped, not as a stalled clock. */
.paused-pill {
  font-family: var(--font);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.82rem;
  color: var(--brass);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 0.5rem 1.1rem;
  background: rgba(0, 0, 0, 0.35);
}

/* ------------------------------------------------------------ player screen */

.player { flex: 1; display: grid; grid-template-rows: auto 1fr auto; gap: 0.75rem; padding: 0.9rem; }

.player-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
/* Three controls plus a name is tight at 390px -- keep each label on one line
   and let the row itself wrap rather than breaking a button in half. */
.player-head .btn { white-space: nowrap; }
.player-head .stack-amt { font-family: var(--font); font-size: 1.6rem; color: var(--brass); }

.hole-zone {
  display: grid;
  place-items: center;
  /* pack the rows together -- without this they spread across the tall
     container and the hint drifts far below the cards */
  align-content: center;
  gap: 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(5, 18, 13, 0.5);
  padding: 1.2rem;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.hole-zone .hint { font-size: 0.76rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
/* Your own two cards are the focal point of the phone -- size them for a
   glance across a lit room, not to the shared-board scale. */
.hole-zone .card { --w: clamp(104px, 30vw, 160px); }

.actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
.actions .btn { padding: 1.15rem 0.6rem; font-size: 1.02rem; }
.actions .btn.span { grid-column: 1 / -1; }

.waiting { display: grid; place-items: center; gap: 0.6rem; text-align: center; padding: 2rem 1rem; }
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid rgba(216, 180, 92, 0.25);
  border-top-color: var(--brass);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* -------------------------------------------------------------- qr overlay */

.overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.78);
  display: grid; place-items: center;
  z-index: 50;
  padding: 1.5rem;
  backdrop-filter: blur(6px);
}
.overlay[hidden] { display: none; }
.overlay-card {
  background: var(--bone);
  color: var(--ink);
  border-radius: 20px;
  padding: 1.75rem;
  text-align: center;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow);
}
.overlay-card h2 { margin-bottom: 1rem; }
.overlay-card .muted { color: rgba(16, 21, 26, 0.6); }
.overlay-card .btn { margin-top: 1.1rem; border-color: rgba(0,0,0,0.2); background: #e6dfcd; color: var(--ink); }
/* The join code stays on screen for the whole night so a latecomer can always
   scan in. Large while waiting, tucked into the corner once cards are out. */
.qr-dock {
  position: absolute;
  right: 1.4rem;
  bottom: 1.4rem;
  text-align: center;
  transition: width 0.3s ease;
  width: 132px;
}
.qr-dock .plate { background: #fff; padding: 8px; border-radius: 10px; box-shadow: var(--shadow); }
.qr-dock .plate svg { width: 100%; height: auto; display: block; }
.qr-dock .cap {
  margin-top: 0.4rem;
  font-family: var(--font);
  font-size: 0.78rem;
  color: var(--muted);
  word-break: break-all;
}
/* In the lobby it is the main event: centred and large. */
.qr-dock.large {
  position: static;
  width: min(300px, 30vw);
  margin: 0 auto;
}
.qr-dock.large .cap { font-size: 1.05rem; color: var(--bone); }

.qr { width: min(300px, 68vw); margin: 0 auto; }
.qr svg { width: 100%; height: auto; display: block; border-radius: 8px; }
.join-url { font-family: var(--font); font-size: 1.05rem; margin-top: 0.9rem; word-break: break-all; }

/* --------------------------------------------------------------- standings */

.standings { display: grid; gap: 0.4rem; margin-top: 1rem; text-align: left; }
.standings .row { display: flex; justify-content: space-between; padding: 0.5rem 0.75rem; border-radius: 8px; background: rgba(255,255,255,0.05); }
.standings .row.top { background: rgba(216, 180, 92, 0.18); color: var(--brass); }

/* ------------------------------------------------------- past-game results */

/* Sits on the bone overlay card, so this is the one place the standings are
   drawn on a light background rather than on felt. */
.history {
  text-align: left;
  max-height: 60vh;
  overflow-y: auto;
}
.past-game + .past-game { margin-top: 1.1rem; border-top: 1px solid rgba(16, 21, 26, 0.15); padding-top: 1.1rem; }
.past-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.6rem;
}
.past-head .who { font-family: var(--font); font-size: 1.05rem; }
/* Georgia's figures have descenders, so the clearance comes from line-height. */
.past-head .when { font-size: 0.78rem; color: rgba(16, 21, 26, 0.55); line-height: 1.6; white-space: nowrap; }
.past-sub {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(16, 21, 26, 0.5);
  margin: 0.15rem 0 0.5rem;
}
.history .row {
  display: flex;
  justify-content: space-between;
  padding: 0.34rem 0.6rem;
  border-radius: 7px;
  background: rgba(16, 21, 26, 0.05);
  line-height: 1.7;
}
.history .row + .row { margin-top: 0.25rem; }
.history .row.top { background: rgba(140, 105, 20, 0.16); font-weight: 600; }

.toast {
  position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%);
  background: rgba(0,0,0,0.85); border: 1px solid var(--line);
  padding: 0.7rem 1.1rem; border-radius: 10px; font-size: 0.9rem; z-index: 60;
}

/* ------------------------------------------------------------- narrow phone */

@media (max-width: 820px) {
  .tv { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; }
  .roster { max-height: 38vh; }
  /* Stacked, the log is a footnote again -- back to sidebar size. */
  .activity-col { max-height: 26vh; }
  .activity .entry { font-size: 1.02rem; }
  .clock .bar { width: 55vw; }
}
