/* === COMPONENTS — chips, score panel, opponent hand, animations === */

/* App shell root */
.app-shell {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "Inter", system-ui, sans-serif;
}

/* ── Lobby ───────────────────────────────────────────────────────────────── */
.lobby {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  width: 100%;
  height: 100%;
  background: var(--bg);
  font-family: "Inter", system-ui, sans-serif;
}

.lobby__brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lobby__brand-icon {
  width: 48px; height: 48px;
  border-radius: 10px;
  background: var(--spade);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  line-height: 1;
}

.lobby__brand-name {
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.5px;
}

/* Floating menu hamburger on the splash. The drawer auto-opens on first
   connect, but once it's closed the user needs a way back in. */
.lobby__menu-btn {
  position: absolute;
  top: clamp(12px, 2vh, 24px);
  right: clamp(12px, 2vw, 24px);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid color-mix(in oklab, var(--ink) 12%, transparent);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  transition: background 0.12s, transform 0.1s;
  font-family: inherit;
  z-index: 8;
}
.lobby__menu-btn:hover { background: color-mix(in oklab, var(--ink) 6%, var(--paper)); }
.lobby__menu-btn:active { transform: translateY(1px); }

.lobby__create-btn {
  padding: 14px 36px;
  border-radius: 999px;
  background: var(--spade);
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  font-family: "Inter", system-ui, sans-serif;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  transition: transform 0.1s, box-shadow 0.1s;
}
.lobby__create-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.4); }
.lobby__create-btn:disabled { opacity: 0.65; cursor: default; }

.lobby__actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  width: min(320px, 88vw);
}

.lobby__join {
  display: flex;
  gap: 8px;
}
.lobby__join-input {
  flex: 1;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid color-mix(in oklab, var(--ink) 20%, transparent);
  background: var(--paper);
  color: var(--ink);
  font-size: 17px;
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-align: center;
  text-transform: uppercase;
  min-width: 0;
}
.lobby__join-input::placeholder {
  letter-spacing: 0.05em;
  font-weight: 500;
  color: var(--ink-soft);
  text-transform: none;
}
.lobby__join-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.lobby__join-btn {
  padding: 0 20px;
  border-radius: 8px;
  background: var(--accent);
  color: #1f1208;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.1s;
}
.lobby__join-btn:hover:not(:disabled) { transform: translateY(-1px); }
.lobby__join-btn:disabled { opacity: 0.4; cursor: default; }

.lobby__or {
  text-align: center;
  font-size: 12px;
  color: var(--ink-soft);
  letter-spacing: 0.1em;
  margin: 4px 0;
}

.lobby__demo-btn {
  padding: 10px 20px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid color-mix(in oklab, var(--ink) 25%, transparent);
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 500;
  font-family: "Inter", system-ui, sans-serif;
  cursor: pointer;
  transition: background 0.1s;
}
.lobby__demo-btn:hover:not(:disabled) { background: color-mix(in oklab, var(--ink) 6%, transparent); }
.lobby__demo-btn:disabled { opacity: 0.5; cursor: default; }

/* Quick-rejoin chip — sits above the Create button when the user has a
   "last room" code stashed (set by forgetRoomCode() on leave). Sized to
   feel secondary to Create — accent fill but smaller, with a dismiss × on
   the right. Per chat2 §06 "kids especially will leave and immediately
   want back in." */
.lobby__rejoin {
  display: flex;
  align-items: stretch;
  gap: 6px;
  align-self: stretch;
}
.lobby__rejoin-btn {
  flex: 1;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--accent);
  color: #1f1208;
  font-weight: 600;
  font-size: 14px;
  font-family: "Inter", system-ui, sans-serif;
  cursor: pointer;
  border: 1px solid color-mix(in oklab, var(--accent) 70%, var(--ink) 30%);
  transition: transform 0.1s;
}
.lobby__rejoin-btn:hover:not(:disabled) { transform: translateY(-1px); }
.lobby__rejoin-btn:disabled { opacity: 0.5; cursor: default; }
.lobby__rejoin-dismiss {
  width: 34px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid color-mix(in oklab, var(--ink) 18%, transparent);
  color: var(--ink-soft);
  font-size: 13px;
  cursor: pointer;
}
.lobby__rejoin-dismiss:hover:not(:disabled) { background: color-mix(in oklab, var(--ink) 6%, transparent); }
.lobby__rejoin-dismiss:disabled { opacity: 0.4; cursor: default; }

.lobby__status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 15px;
}

.lobby__error {
  color: #991b1b;
  font-size: 14px;
  margin: 0;
}

/* ── Sprint 3 — Public lobby browser ─────────────────────────────────────── */
.lobby__public {
  /* Sprint 12 L5 — align width with .lobby__actions above so the
     open-tables card doesn't visually overhang the Create/Join CTAs. */
  width: min(320px, 88vw);
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--paper);
  border: 1px solid color-mix(in oklab, var(--ink) 12%, transparent);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lobby__public-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.lobby__public-empty {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
}
.lobby__public-cta {
  align-self: flex-start;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--accent);
  color: #1f1208;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid color-mix(in oklab, var(--accent) 70%, var(--ink) 30%);
}
.lobby__public-cta:disabled { opacity: 0.5; cursor: default; }
.lobby__public-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
}
.lobby__public-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: color-mix(in oklab, var(--ink) 4%, transparent);
  font-size: 13px;
  flex-wrap: wrap;
}
.lobby__public-code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--ink);
}
.lobby__public-host {
  flex: 1;
  min-width: 60px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lobby__public-meta {
  font-size: 12px;
  color: var(--ink-soft);
}
.lobby__public-variant {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  /* FROD3-WARN-5 / SCR5-NOTE-1 — bump accent-to-paper mix from 30→50%
     and tighten the outline so the pill doesn't blur into the row
     background at default theme (gold/cream). Mirror change in
     .owner-panel__variant below for cross-surface consistency. */
  background: color-mix(in oklab, var(--accent) 50%, var(--paper));
  color: var(--ink);
  border: 1px solid color-mix(in oklab, var(--accent) 70%, transparent);
}
.lobby__public-kid {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in oklab, #16a34a 30%, var(--paper));
  color: var(--ink);
  border: 1px solid color-mix(in oklab, #16a34a 40%, transparent);
}
.lobby__public-join {
  margin-left: auto;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--spade);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  border: 0;
}
.lobby__public-join:disabled { opacity: 0.5; cursor: default; }

/* Sprint 3 — lobby header bar: title left, kid-safe filter right
   (SAUR3-WARN-8). */
.lobby__public-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.lobby__public-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-soft);
  cursor: pointer;
}
.lobby__public-filter input[type="checkbox"] {
  width: 14px;
  height: 14px;
  cursor: pointer;
}

/* FROD3-WARN-1 / FROD3-WARN-2 — mobile breakpoint for the public-room
   list. At ≤559px each row stacks into a column so a 320px screen
   doesn't wrap-soup the seven children. Join button gets a 44px
   minimum touch target per Apple HIG / Material guidelines. */
@media (max-width: 559px) {
  .lobby__public-row {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 10px 12px;
  }
  .lobby__public-host {
    min-width: 0;
  }
  .lobby__public-join {
    margin-left: 0;
    min-height: 44px;
    padding: 10px 16px;
    font-size: 14px;
    align-self: stretch;
  }
  .lobby__public-cta {
    min-height: 44px;
    padding: 10px 16px;
    font-size: 14px;
  }
}

/* Owner-panel rule-variant readout (also used by RoomCreateModal hint
   paragraph). Mostly a styled inline chip. FROD3-WARN-5 mix bump. */
.owner-panel__variant {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--accent) 50%, var(--paper));
  color: var(--ink);
  border: 1px solid color-mix(in oklab, var(--accent) 70%, transparent);
}
.room-create-modal__hint {
  margin: 4px 0 0 0;
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.4;
}

/* Sprint 3 — Mirror/Whiz bid controls. Single-tap primary action with
   a rule caption above it. No two-tap-to-confirm (no ambiguity to
   resolve — Mirror has exactly one legal bid, Whiz has two visible
   pills). */
.bid-controls--variant {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.bid-controls__variant-caption {
  font-size: 12px;
  color: var(--ink-soft);
  text-align: center;
}
.bid-controls__variant-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.bid-btn--variant-primary,
.bid-btn--variant-nil {
  min-height: 44px;
  padding: 10px 22px;
  font-weight: 700;
  font-size: 14px;
}

/* Pulse animation for turn indicator */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.45; }
}

/* Sprint 14 Phase G — user request: restore the floating turn-pulse
   dot. Sprint 8 retired it (chip-glow box-shadow was deemed sufficient)
   but the user wants the extra cue back. Small accent-colored dot in
   the chip's top-right corner; pulse cadence shared with @keyframes
   pulse above. */
/* Sprint 14 Phase G — Frodo vaporwave-shot fix: the dot was painting
   in var(--accent), but the .seat-chip--turn parent already paints a
   2-5px box-shadow halo in the SAME var(--accent). Same color + same
   color halo = the dot disappears against its own glow. Switched the
   dot to a contrasting paper-bg + accent border so it reads as a
   crisp ring against the halo, regardless of theme accent. */
.pulse-dot {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--paper);
  border: 2.5px solid var(--accent);
  box-shadow: 0 0 0 1.5px var(--bg, #000), 0 1px 3px rgba(0, 0, 0, 0.35);
  animation: pulse 1.6s ease-in-out infinite;
  pointer-events: none;
  z-index: 2;
}
@media (prefers-reduced-motion: reduce) {
  .pulse-dot { animation: none !important; opacity: 0.85; }
}

/* ── SeatChip ────────────────────────────────────────────────────────────── */
.seat-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
  background: var(--paper);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  transition: box-shadow 0.2s;
  position: relative;
  font-family: "Inter", system-ui, sans-serif;
}

.seat-chip--sm {
  gap: 6px;
  padding: 5px 9px 5px 5px;
}

/* Sprint 8 polish (user feedback): the chip-glow is the primary "this
   seat's turn" cue. Softer inner ring + a wider accent halo + a subtle
   lift-shadow reads as "active" without the harsh stark border the
   original 2px solid was producing. The previous floating .pulse-dot
   on the top-right corner was redundant against this glow and has been
   removed from the render tree. */
.seat-chip--turn {
  box-shadow:
    0 0 0 2px var(--accent),
    0 0 0 5px color-mix(in oklab, var(--accent) 28%, transparent),
    0 6px 16px color-mix(in oklab, var(--accent) 22%, transparent);
}

.seat-chip--interactive {
  cursor: pointer;
}
.seat-chip--interactive:hover {
  box-shadow: 0 0 0 2px var(--ink-soft), 0 4px 12px rgba(0,0,0,0.15);
}
.seat-chip--interactive:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.seat-chip--interactive.seat-chip--turn:hover {
  box-shadow: 0 0 0 2px var(--accent), 0 4px 16px var(--accent-soft);
}

.seat-chip__avatar {
  width: clamp(22px, 2.1vw, 36px);
  height: clamp(22px, 2.1vw, 36px);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(13px, 1.25vw, 28px); /* 1.25vw hits source 16px at 1280; cap 28 for 4K */
  flex-shrink: 0;
  overflow: hidden; /* clips img to the circle */
}
.seat-chip__avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.seat-chip__avatar--ns { background: var(--team-ns); color: var(--ink-on-team-ns); }
.seat-chip__avatar--ew { background: var(--team-ew); color: var(--ink-on-team-ew); }

/* Avatar identity border — silver for bots, themed (--accent) for
   humans. The team-color background still reads "this seat plays for
   NS/EW"; the border ring layers on top to signal "this seat is
   bot/human". Sprint 8 themes recolor --accent, so the human ring
   tracks the chosen theme automatically; bots stay silver across all
   themes (a themed-silver bot would dilute the "definitely a bot"
   read). The inset shadow under the silver ring helps it pop off
   dark-felt theme backgrounds without going neon. */
.seat-chip__avatar--bot {
  /* --bot-border (tokens.css) — silver. Urukhai-3 Wave 2 extracted
     the previous hardcoded #c0c0c0 to a token so themes can override
     without forking the .seat-chip rule. */
  border: 2px solid var(--bot-border);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}
.seat-chip__avatar--human {
  border: 2px solid var(--accent);
}

.seat-chip--sm .seat-chip__avatar {
  width: 22px; height: 22px;
  font-size: 13px;
}

.seat-chip__info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding-right: 4px;
}

.seat-chip--sm .seat-chip__info { padding-right: 2px; }

/* BRB held-seat pill — sits below the seat chip with the held-for
   user's name. Per chat2 §03 + the wf-kit "held" Mono style: dashed
   accent border, slightly muted text, tiny chair glyph as a hint
   that this seat is reserved. */
.seat-chip--held {
  outline: 1px dashed color-mix(in oklab, var(--accent) 60%, transparent);
  outline-offset: 2px;
}
/* Per-turn countdown drain — sits flush against the bottom inside-edge
   of the pill-shaped chip and shrinks left → right as the turn timer
   runs out. Industry-standard pace cue (Spades Plus / WoCG / CardzMania).
   Three-tier color shift (ok → warn → urgent) so color-blind players
   still get a luminance + saturation cue, and screen-readers get the
   timer text via role="timer" + aria-label.
   Sprint 8 polish (user feedback): the previous incarnation was a flat
   3px slab hanging off the chip's bottom edge that read as a stark
   "underline" beneath the chip. Now: a thinner, rounded, semi-translucent
   drain tucked just inside the bottom curve, with a soft gradient so it
   reads as a progress meter rather than a stamped underline. The chip's
   own --turn glow announces "active" — this strip is just the timer. */
.seat-chip__ring {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 3px;
  height: 2px;
  border-radius: 999px;
  pointer-events: none;
  opacity: 0.78;
  /* Width is driven by --turn-fill, a UNITLESS ratio in [0,1] (1 = full,
     0 = empty). The old code used scaleX(calc(var(--ring-deg)/360deg)) —
     dividing an angle by an angle is invalid CSS, so scaleX got a junk
     value, was dropped, and the bar sat frozen at full width (never
     animated). A plain unitless var feeds scaleX directly. Left-anchored
     so the user sees the bar shrink left → right as time elapses. */
  background: linear-gradient(90deg,
    color-mix(in oklab, var(--accent) 65%, transparent),
    var(--accent));
  transform-origin: left center;
  transform: scaleX(var(--turn-fill, 1));
  transition: transform 0.25s linear, background 0.25s linear, opacity 0.25s linear;
}
.seat-chip__ring--ok      {
  background: linear-gradient(90deg,
    color-mix(in oklab, var(--accent) 65%, transparent),
    var(--accent));
}
.seat-chip__ring--warn    {
  background: linear-gradient(90deg,
    color-mix(in oklab, var(--amber) 65%, transparent),
    var(--amber));
}
.seat-chip__ring--urgent  {
  background: linear-gradient(90deg,
    color-mix(in oklab, var(--red, #c0392b) 70%, transparent),
    var(--red, #c0392b));
  opacity: 1;
  animation: ring-urgent-pulse 1s ease-in-out infinite;
}
@keyframes ring-urgent-pulse {
  0%, 100% { opacity: 1.0; }
  50%      { opacity: 0.55; }
}

/* Bot identity used to live in a floating .seat-chip__bot-tag badge
   over the avatar. It moved into the avatar slot itself: the bot's
   emoji (per-name from botEmojiFor() for heuristic bots, or the
   assigned player.avatar for LLM bots) renders where the human
   monogram normally goes, and the .seat-chip__avatar--bot border
   variant gives it a silver ring. See components/SeatChip.js
   renderAvatar() and the .seat-chip__avatar--bot rule above. */

/* BRB held-pill — sits under the seat chip while a seat is bot-covered.
   Two variants:
     - --readonly: dashed border, dim text. Shown to other viewers; not
       interactive. Just signals "this seat is held."
     - --action: colored pill, gentle pulse, tappable. Shown ONLY to
       the heldFor user themselves (server zeroes the username for
       other viewers). Doubles as the "I'm back" button — onClick
       fires seat:reclaim. Stays visible across phases (lobby /
       bidding / playing / roundOver / gameOver) so the reclaim
       affordance is always within reach. */
.seat-chip__held-pill {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translate(-50%, 6px);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  z-index: 4;
  font-family: inherit;
}

/* Read-only variant — informational, not interactive. */
.seat-chip__held-pill--readonly {
  background: var(--paper);
  color: var(--ink-soft);
  border: 1px dashed color-mix(in oklab, var(--accent) 50%, transparent);
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
  pointer-events: none;
}

/* Action variant — the "I'm back" button for the held user.
   Colored pill with the accent so it reads as a CTA even at a glance,
   plus a gentle pulse so the user's eye snaps to it on any phase
   transition. */
.seat-chip__held-pill--action {
  background: var(--accent);
  color: #1f1208;
  border: 1px solid color-mix(in oklab, var(--accent) 70%, var(--ink) 30%);
  padding: 5px 12px 5px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  pointer-events: auto;
  /* Gentle attention pulse — same cadence as .pulse-dot (1.6s). */
  animation: held-pill-pulse 1.6s ease-in-out infinite;
}
.seat-chip__held-pill--action:hover {
  filter: brightness(1.06);
  box-shadow: 0 3px 10px rgba(0,0,0,0.22);
}
.seat-chip__held-pill--action:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.seat-chip__held-pill--action:active {
  transform: translate(-50%, 7px); /* preserves the centering offset */
  filter: brightness(0.96);
}
.seat-chip__held-pill--action[aria-busy="true"] {
  opacity: 0.7;
  cursor: progress;
  animation: none;
}

/* Sprint 8 mega-batch (Bellows B4): BRB pill dot — adds a shape cue
   (▶ triangle) on top of the red color so color-blind users get a
   non-color affordance for the "I'm back" CTA. WCAG 1.4.1 (use of
   color) requires that color not be the sole means of conveying info.
   Implementation: keep the .seat-chip__held-pill-dot <span> element
   (no markup churn in SeatChip.js) and draw the triangle via ::before
   instead of using a filled circle. The pulse box-shadow is retained
   so the visual rhythm matches the active-turn chip. */
.seat-chip__held-pill-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 8px;
  height: 8px;
  color: #c0392b;
  flex: 0 0 auto;
  line-height: 1;
}
.seat-chip__held-pill-dot::before {
  content: '▶';
  font-size: 8px;
  line-height: 1;
}
.seat-chip__held-pill-label { line-height: 1; }
.seat-chip__held-pill-timer {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  opacity: 0.75;
  font-size: 10px;
  padding-left: 4px;
  border-left: 1px solid color-mix(in oklab, #1f1208 25%, transparent);
}

@keyframes held-pill-pulse {
  0%, 100% { box-shadow: 0 2px 6px rgba(0,0,0,0.15); }
  50%      { box-shadow: 0 2px 12px color-mix(in oklab, var(--accent) 55%, transparent); }
}
@media (prefers-reduced-motion: reduce) {
  .seat-chip__held-pill--action { animation: none; }
}

.seat-chip__name {
  font-size: clamp(10px, 0.9vw, 13px);
  font-weight: 600;
  color: var(--ink);
  line-height: 1;
  letter-spacing: 0.2px;
}
/* Friend-badge sits inline with the name text. We DON'T flex the
   .seat-chip__name container — that was collapsing it to content
   width on narrow viewports and breaking the seat-chip's info
   column layout. Inline children flow naturally; a small left margin
   on the badge gives it some breathing room from the name. */
.seat-chip__friends { margin-left: 5px; vertical-align: middle; }

/* Invite-URL row under the room-code chip. Click selects the entire
   URL so desktop users can grab it for a paste. user-select:all
   handles single-click select on desktop, mobile users still get the
   chip's clipboard copy. */
.drawer-row--invite-url {
  padding-top: 0;
  padding-bottom: 6px;
}
.drawer-invite-url {
  display: block;
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  color: var(--ink-soft);
  background: color-mix(in oklab, var(--ink) 6%, transparent);
  padding: 6px 8px;
  border-radius: 6px;
  word-break: break-all;
  cursor: text;
  user-select: all;
  -webkit-user-select: all;
}
.drawer-invite-url:hover {
  background: color-mix(in oklab, var(--ink) 10%, transparent);
}

/* ── WonTrickStack ──────────────────────────────────────────────────────── */
/* Mini-fan of the just-won trick's cards, parked next to the winning
   seat ("just to their left" from each player's perspective). Replaces
   the LastTrickChip-only display, which wasn't reaching mobile. */
.won-trick-stack {
  position: absolute;
  display: flex;
  pointer-events: none;
  z-index: 4;
  /* Cards inside use --cw, which we shrink to ~30% of hand size. */
  --cw: clamp(18px, calc(var(--hand-cw) * 0.32), 36px);
  animation: won-trick-pop-in 320ms cubic-bezier(0.18, 0.7, 0.36, 1);
}

/* Heavy horizontal overlap so the 4-card stack reads as one cluster. */
.won-trick-stack__card { margin-left: calc(var(--cw) * -0.55); }
.won-trick-stack__card:first-child { margin-left: 0; }

/* Last-trick views are mutually exclusive by viewport. The corner
   LastTrickChip lives in the rails, which only appear at >=900px
   (layout.css hides .rail below that). So the next-to-the-name
   WonTrickStack row must hide at that SAME breakpoint — otherwise
   desktop renders BOTH (the duplication introduced with the mobile
   layout). Below 900px the rails are gone and this row is the only
   last-trick view. Exactly one shows on each side of 900px. */
@media (min-width: 900px) {
  .won-trick-stack { display: none; }
}

/* Food-fight arsenal — floats above the hand when the active player has
   stalled, for everyone else at the table. */
.throw-bar {
  position: fixed;
  left: 50%;
  bottom: 88px;
  transform: translateX(-50%);
  z-index: 8500;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: rgba(20, 16, 16, 0.92);
  border: 1px solid #7a201a;
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}
.throw-bar__label {
  color: #e8c9c4;
  font: 600 12px system-ui, sans-serif;
  margin-right: 3px;
  white-space: nowrap;
}
.throw-bar__btn {
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 8px;
  transition: transform 0.1s ease, background 0.1s ease;
}
.throw-bar__btn:hover { transform: scale(1.25); background: rgba(255, 255, 255, 0.08); }
.throw-bar__btn:active { transform: scale(0.9); }

/* Per-seat placement. Each seat's container is position:absolute, so
   we anchor inside it. "Their left" = each player's left as if they
   were seated facing the table. */
/* South stack flows inline next to the chip via .seat--south__cluster.
   Override the absolute positioning used for the other 3 seats — the
   south seat container is full-width (left:0; right:0), so absolute
   positioning relative to it would push the stack off-screen right.
   Static positioning lets the cluster (display:inline-flex) place it
   to the right of the chip naturally. */
.seat--south .won-trick-stack--south {
  position: static;
  transform: none;
  margin: 0;
}
.seat--south__cluster {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

/* On-table POV arrows that flank the south SeatChip while spectating
   the llamabots. Tap targets are larger than visual size for thumb
   reach on mobile. Style follows .drawer-btn so they sit naturally
   in the table chrome. */
.pov-arrow {
  appearance: none;
  background: var(--surface-2, #1f2937);
  color: var(--text-primary, #f9fafb);
  border: 1px solid var(--border, rgba(255,255,255,0.16));
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  min-width: 36px;
  min-height: 36px;
}
.pov-arrow:hover { background: var(--surface-3, #374151); }
.pov-arrow:active { transform: translateY(1px); }

/* Stop-sim button parked at a table corner — only visible when the
   viewer is spectating all-bot HUHS play. Absolute-positioned so it
   doesn't shove the existing table layout around. */
.table-corner-btn {
  appearance: none;
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 5;
  background: rgba(220, 38, 38, 0.85);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.table-corner-btn:hover { background: rgba(220, 38, 38, 1); }
.table-corner-btn:active { transform: translateY(1px); }

/* Stand-up variant uses the neutral surface color rather than the
   destructive red — it's a benign action (you can sit back down). */
.table-corner-btn--stand {
  background: rgba(37, 99, 235, 0.85);  /* blue, action-positive */
}
.table-corner-btn--stand:hover { background: rgba(37, 99, 235, 1); }

/* Reboot variant — amber, opposite corner from Stop sim (bottom-LEFT
   instead of bottom-right). Restart action: clears scores + deals a
   fresh game without disturbing seats. */
.table-corner-btn--reboot {
  background: rgba(245, 158, 11, 0.9);  /* amber, action-warm */
  right: auto;
  left: 12px;
}
.table-corner-btn--reboot:hover { background: rgba(245, 158, 11, 1); }

/* On-table Start/Stop toggle — paired with Reset bottom-right. Color
   neutral so it doesn't compete with the destructive Reset and isn't
   confused with the previous "STOP nightmare" button (which is gone). */
.table-corner-btn--toggle {
  background: rgba(75, 85, 99, 0.92);  /* slate */
  bottom: 12px;
  right: 12px;
  /* Reset shifts to bottom-left via the existing --reboot rule, so the
     toggle inherits the default --stop position (bottom-right). */
}
.table-corner-btn--toggle:hover { background: rgba(107, 114, 128, 1); }

/* NIGHTMARE — admin-only red button parked top-right. Glows when ready
   to summon four 90s supercomputers for a max-CPU-speed PIMC marathon. */
.table-corner-btn--nightmare {
  background: rgba(190, 18, 60, 0.92);  /* deep red */
  color: #ffe4e6;
  border-color: rgba(255, 228, 230, 0.45);
  bottom: auto;
  top: 44px;            /* below the build badge */
  right: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-weight: 700;
  box-shadow: 0 0 0 1px rgba(190,18,60,0.4), 0 4px 14px rgba(190,18,60,0.5), inset 0 0 12px rgba(255,80,80,0.25);
  animation: nightmare-pulse 2.4s ease-in-out infinite;
}
.table-corner-btn--nightmare:hover {
  background: rgba(220, 38, 80, 1);
  box-shadow: 0 0 0 1px rgba(220,38,80,0.55), 0 6px 18px rgba(220,38,80,0.65), inset 0 0 14px rgba(255,100,100,0.35);
}
@keyframes nightmare-pulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(190,18,60,0.4), 0 4px 14px rgba(190,18,60,0.5), inset 0 0 12px rgba(255,80,80,0.25); }
  50%      { box-shadow: 0 0 0 1px rgba(255,80,80,0.6), 0 6px 22px rgba(255,80,80,0.7),  inset 0 0 18px rgba(255,140,140,0.4); }
}

/* STOP — replaces NIGHTMARE while a speed run is active. Same position,
   different color (yellow-red warning) so it reads as "in progress + halt". */
.table-corner-btn--nightmare-stop {
  background: rgba(202, 138, 4, 0.92);  /* amber-warning */
  color: #fff;
  border-color: rgba(255,255,255,0.5);
  bottom: auto;
  top: 44px;
  right: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-weight: 700;
}
.table-corner-btn--nightmare-stop:hover { background: rgba(234, 179, 8, 1); }
.table-corner-btn--nightmare-stop:disabled { opacity: 0.7; cursor: progress; }

/* Top-left ops badge: model + build version of what's serving this room.
   Small, dimmed, monospace — informational only, not interactive. */
.table-build-badge {
  position: absolute;
  top: 8px;
  left: 12px;
  z-index: 8;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(0, 0, 0, 0.6);
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.02em;
  pointer-events: auto;  /* allow title hover */
  user-select: text;
  white-space: nowrap;
  max-width: calc(100% - 24px);
  overflow: hidden;
  text-overflow: ellipsis;
}

.seat--north .won-trick-stack {
  top: 50%;
  right: 100%;
  margin-right: 12px;
  transform: translateY(-50%);
}
.seat--west .won-trick-stack {
  bottom: 100%;
  left: 50%;
  margin-bottom: 8px;
  transform: translateX(-50%);
}
.seat--east .won-trick-stack {
  top: 100%;
  right: 50%;
  margin-top: 8px;
  transform: translateX(50%);
}

@keyframes won-trick-pop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .won-trick-stack { animation: none; }
}

/* Tiny build-version stamp at the bottom of the drawer. Lets you
   confirm at a glance that you're on the latest build vs cached
   from before — invaluable for the cache-bust pipeline. Selectable
   so users can copy it into bug reports. */
.drawer-build {
  margin: 18px 12px 6px;
  padding-top: 10px;
  border-top: 1px solid color-mix(in oklab, var(--ink) 6%, transparent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  color: color-mix(in oklab, var(--ink) 50%, transparent);
  text-align: center;
  letter-spacing: 0.04em;
  user-select: text;
  -webkit-user-select: text;
}

.seat-chip--sm .seat-chip__name { font-size: 10px; }

/* Tiny friend-count badge, easter-egg only — server only sets player.friends
   for admin (42069); everyone else is 0 and the badge isn't rendered. */
.seat-chip__friends {
  display: inline-flex;
  align-items: center;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: color-mix(in oklab, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in oklab, var(--accent) 35%, transparent);
  border-radius: 999px;
  padding: 1px 5px;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}
.seat-chip--sm .seat-chip__friends { font-size: 8px; padding: 1px 4px; }

/* Brain-actually-running badge for bot seats in HUHS rooms. Shows the
   single-letter initial of the brain that produced the most recent
   bot decision (J = JS heuristic, P = PIMC, L = LLM). Server stamps
   player.brainActual from the meta.source string at decision time —
   it can only be set by the code path that just ran, so the badge
   reflects what's TRULY running, not what was intended (LLM-fallback-
   to-heuristic correctly renders as J, not L). */
.seat-chip__brain-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0;
  min-width: 14px;
  height: 14px;
  padding: 0 4px;
  margin-left: 5px;
  border-radius: 4px;
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
  text-transform: uppercase;
}
/* Sprint 14 Phase D — generalize the brain palette so the same J/P/L
   color scheme can be applied wherever (SeatChip badge, drawer Mixed
   row, future surfaces). The class chain is `brain-badge--<brain>`,
   parent class supplies the geometry (size, padding, border-radius). */
.brain-badge--js {
  color: #1f2937;
  background: rgba(156, 163, 175, 0.85);  /* slate-400, neutral */
  border: 1px solid rgba(156, 163, 175, 0.5);
}
.brain-badge--pimc {
  color: #fff;
  background: rgba(190, 18, 60, 0.92);    /* deep red, matches nightmare */
  border: 1px solid rgba(255, 228, 230, 0.45);
}
.brain-badge--llm {
  color: #1a1208;
  background: rgba(245, 158, 11, 0.95);   /* amber, matches LLM warm */
  border: 1px solid rgba(245, 158, 11, 0.5);
}
.brain-badge--2pimc {
  /* Phase F — 2PIMC margin-aware brain. Same family as nightmare PIMC
     (deep red) but darker + a thin gold rim to read as the "premium"
     bid+play upgrade variant. */
  color: #fff;
  background: rgba(120, 8, 35, 0.95);
  border: 1px solid rgba(217, 178, 80, 0.65);
}
.seat-chip--sm .seat-chip__brain-badge { font-size: 8px; min-width: 12px; height: 12px; padding: 0 3px; }

.seat-chip__stats {
  /* Sprint 14 Phase G user-tweak — bid/tricks readout 1pt larger. */
  font-size: clamp(10px, 0.85vw, 13px);
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.seat-chip--sm .seat-chip__stats { font-size: 10px; }

@media (max-width: 559px) {
  .seat-chip { gap: 6px; padding: 5px 9px 5px 5px; }
  .seat-chip .seat-chip__avatar { width: 22px; height: 22px; font-size: 13px; }
  .seat-chip .seat-chip__info { padding-right: 2px; }
  .seat-chip .seat-chip__name { font-size: 10px; }
  .seat-chip .seat-chip__stats { font-size: 10px; }
}

.seat-chip__score--made { font-weight: 600; color: var(--name-on-paper-ns); }
.seat-chip__score--miss { font-weight: 600; color: var(--ink-soft); }

/* .pulse-dot (Sprint 8: retired, Sprint 14 Phase G: restored). The on-chip dot renders at
   top-right when isTurn. Sprint 8 removed it as the chip-glow ring on
   .seat-chip--turn was deemed sufficient, but user feedback in Phase G
   prompted its restoration. The @keyframes pulse rule is kept because both
   the .pulse-dot and held-pill CTA reference the same cadence. */

/* ── BidPips ─────────────────────────────────────────────────────────────── */
.bid-pips {
  display: flex;
  gap: 2px;
}

.bid-pip {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: rgba(0,0,0,0.15);
}

/* Sprint 14 Phase F.2 — under/made/bag semantic.
   Blue while UNDER bid (filled but contract not yet reached),
   green when MADE (every dot once tricks ≥ bid), and red for
   BAG dots beyond bid. Colors come from tokens.css's
   --bid-pip-under / --bid-pip-made / --bid-pip-bag, themable
   per palette. The prior team-scoped --made rule retired because
   the state semantic carries more info than team-color framing —
   team identity is still on the chip via .seat-chip--team-* class. */
.bid-pip--under { background: var(--bid-pip-under); }
.bid-pip--made  { background: var(--bid-pip-made); }
.bid-pip--bag   { background: var(--bid-pip-bag); }

/* ── ScorePanel ──────────────────────────────────────────────────────────── */
.score-panel {
  background: var(--paper);
  border-radius: clamp(10px, 0.8vw, 14px);
  padding: clamp(10px, 1vw, 18px);
  font-family: "Inter", system-ui, sans-serif;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 4px 16px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  gap: 10px;
  contain: layout style;
}

.score-panel--compact {
  border-radius: 10px;
  padding: 8px 10px;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.score-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.score-panel__label {
  font-size: 10px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink-soft);
}

.score-panel__meta {
  font-size: 10px;
  color: var(--ink-soft);
}

/* ScoreRow */
.score-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.score-panel--compact .score-row {
  flex: 0 0 auto;
  min-width: 0;
}

.score-row__top {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.score-row__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.score-row__team {
  font-size: clamp(10px, 0.9vw, 13px);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.3px;
}


.score-row__score {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
  line-height: 1;
  font-size: clamp(16px, 1.7vw, 44px);
  font-weight: 700;
  color: var(--ink);
}

.score-panel--compact .score-row__score {
  font-size: clamp(14px, 1.3vw, 24px);
}

.score-row__bar {
  height: 3px;
  background: rgba(0,0,0,0.06);
  border-radius: 2px;
  overflow: hidden;
}

.score-row__fill {
  height: 100%;
  border-radius: 2px;
  /* width set inline as a percentage */
}

/* ── RoundChip ───────────────────────────────────────────────────────────── */
.round-chip {
  font-size: 11px;
  color: var(--ink-soft);
  font-family: "Inter", system-ui, sans-serif;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.round-chip b { color: var(--ink); font-weight: 700; }

/* ── TableTally ──────────────────────────────────────────────────────────── */
.table-tally {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(0,0,0,0.04);
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--ink-soft);
  font-family: "Inter", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.table-tally__label {
  font-size: 12px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink-soft);
}

.table-tally--compact {
  padding: 5px 10px;
  gap: 6px;
}

.table-tally--compact .table-tally__label {
  font-size: 11px;
  letter-spacing: 1px;
}

.table-tally__wins {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.table-tally__wins--ns { color: var(--name-on-paper-ns); }
.table-tally__wins--ew { color: var(--name-on-paper-ew); }
.table-tally__sep { color: var(--ink-soft); margin: 0 3px; }
.table-tally__games { font-size: 10px; color: var(--ink-soft); }

.table-tally--lifetime { gap: 6px; }
.table-tally__pair { font-size: 12px; font-weight: 600; }
.table-tally__pair--ns { color: var(--name-on-paper-ns); }
.table-tally__pair--ew { color: var(--name-on-paper-ew); }

/* ── OpponentHand ────────────────────────────────────────────────────────── */
.opp-hand { position: relative; }

.opp-hand__card {
  position: absolute;
  border-radius: var(--radius-card);
  background: var(--felt-mid);
  box-shadow: 0 1px 0 rgba(0,0,0,0.1), 0 2px 6px rgba(0,0,0,0.18);
  overflow: hidden;
}

.opp-hand__back {
  position: absolute;
  inset: 4px;
  border-radius: 4px;
  background-color: var(--felt-deep);
  background-image: var(--card-back-image);
  background-size: var(--card-back-size, 100% 100%);
  background-repeat: var(--card-back-repeat, no-repeat);
  background-position: var(--card-back-position, center);
  overflow: hidden;
}
/* Sprint 12 — masked emblem layer for opp-hand (mirror of
   .card--back::after). Default themes get the per-accent emblem;
   bespoke themes set --card-emblem-display: none to opt out so the
   bespoke ::before art isn't covered. */
.opp-hand__back::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: var(--card-emblem-color, var(--accent));
  -webkit-mask-image: var(--card-back-mask);
  mask-image: var(--card-back-mask);
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  pointer-events: none;
  display: var(--card-emblem-display, block);
}

/* ── Card (face-down — used by Hand concealed mode for blind-nil decision) ── */
.card--back {
  width: var(--cw, var(--card-w));
  height: calc(var(--cw, var(--card-w)) * 1.44);
  border-radius: var(--radius-card);
  background: var(--felt-mid);
  box-shadow: inset 0 0 0 0.5px rgba(0,0,0,0.15), 0 1px 3px rgba(0,0,0,0.18);
  position: relative;
  overflow: hidden;
}
/* Sprint 12 — per-card emblem rendering with two render paths:
     1. Mask path (default for every theme) — ::before paints the dark
        card-face base in felt-deep; ::after paints the accent-colored
        emblem cut from a mask SVG (spade silhouette + frame). The
        emblem color follows --accent per theme so every theme gets a
        themed emblem for free.
     2. Bespoke path — themes that ship their own full-color card back
        (highlander, hot-spades) set --card-back-image to an inline
        SVG with hardcoded colors; the ::after mask is suppressed via
        --card-back-mask: none so the bespoke art renders alone.
   overflow:hidden + border-radius on the pseudos clip any pixel-
   precise emblem bleed inside the card border. */
.card--back::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 6px;
  background-color: var(--felt-deep);
  background-image: var(--card-back-image);
  background-size: var(--card-back-size, 100% 100%);
  background-repeat: var(--card-back-repeat, no-repeat);
  background-position: var(--card-back-position, center);
  overflow: hidden;
}
.card--back::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 6px;
  background-color: var(--card-emblem-color, var(--accent));
  -webkit-mask-image: var(--card-back-mask);
  mask-image: var(--card-back-mask);
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  pointer-events: none;
  /* Bespoke-art themes (highlander, hot-spades) set their --card-back-
     mask to "none" because their ::before bg-image already carries the
     complete design. With mask-image:none the ::after has no mask =
     fully visible, which would paint solid --accent over the bespoke
     art. Use display:var(--card-emblem-display) so bespoke themes can
     opt out of the ::after layer entirely. */
  display: var(--card-emblem-display, block);
}

/* ── Card (face-up) ──────────────────────────────────────────────────────── */
.card {
  /* --cw falls back to --card-w; trick-zone overrides --cw to 0.95× */
  width: var(--cw, var(--card-w));
  height: calc(var(--cw, var(--card-w)) * 1.44);
  border-radius: var(--radius-card);
  background: var(--card-bg);
  box-shadow: inset 0 0 0 0.5px var(--card-border), 0 1px 3px rgba(0,0,0,0.18);
  position: relative;
  overflow: hidden; /* clips rotated --br corner that would otherwise escape card box */
  user-select: none;
  transition: transform 0.15s;
  font-family: "Inter", system-ui, sans-serif;
  flex-shrink: 0;
}

.card--red   { color: var(--red); }
.card--black { color: var(--spade); }

.card--dim {
  background: var(--card-dim-bg);
  box-shadow: inset 0 0 0 0.5px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.12);
}
.card--dim.card--red   { color: var(--card-dim-red); }
.card--dim.card--black { color: var(--card-dim-spade); }

.card--highlight {
  box-shadow: 0 0 0 2px var(--accent), 0 6px 16px var(--accent-soft);
}

.card--eligible {
  box-shadow:
    inset 0 0 0 0.5px var(--card-border),
    0 0 0 1.5px var(--accent-soft),
    0 4px 12px var(--accent-soft);
  transform: translateY(-4px);
}

.card--selected {
  box-shadow: 0 0 0 2px var(--accent), 0 6px 16px var(--accent-soft);
  transform: translateY(-14px);
}

.card--interactive { cursor: pointer; }

/* Sprint 8 Lane 3 — pixel-art face mode.
 *
 * When themePrefs.cardFace === 'pixel-art', Card.js renders a single
 * <img> child that fills the card box. The image carries the whole
 * face (corners + center pip grid) so we hide any sibling glyphs and
 * stretch the <img> to the card's content box. */
.card--pixel-art {
  /* The image already paints the white paper field — keep a faint
     border so dim/highlight states still read. The image's intrinsic
     viewBox is 100×140 (same aspect ratio as the card), and the
     "shape-rendering: crispEdges" attribute baked into the SVG keeps
     pixels chunky at small sizes. */
  background: transparent;
  padding: 0;
}
.card__face-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: inherit;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .card--eligible  { transform: none; }
  .card--highlight { box-shadow: 0 0 0 2px var(--accent); }
  .card--selected  { box-shadow: 0 0 0 2px var(--accent); transform: none; }
  .card            { transition: none; }
}

.card__corner {
  position: absolute;
  line-height: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}

.card__corner--tl {
  top: calc(var(--cw, var(--card-w)) * 0.10);
  left: calc(var(--cw, var(--card-w)) * 0.12);
}

.card__corner--br {
  bottom: calc(var(--cw, var(--card-w)) * 0.10);
  right: calc(var(--cw, var(--card-w)) * 0.12);
  transform: rotate(180deg);
  transform-origin: center;
}

.card__rank {
  font-size: calc(var(--cw, var(--card-w)) * 0.26);
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1;
}
/* Two-character ranks ("10") get tighter tracking + a slight scaleX so the
   glyph fits inside the exposed corner strip when cards are fanned. */
.card__rank--wide {
  letter-spacing: -2.5px;
  transform: scaleX(0.88);
  transform-origin: left center;
}

.card__suit-corner {
  font-size: calc(var(--cw, var(--card-w)) * 0.18);
  line-height: 0.9;
}

.card__suit-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--cw, var(--card-w)) * 0.42);
  opacity: 0.92;
  pointer-events: none;
}

/* ── Illegal-card feedback ───────────────────────────────────────────────── */
@keyframes illegal-shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  40%       { transform: translateX(6px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}

@keyframes illegal-flash {
  0%   { box-shadow: inset 0 0 0 0.5px var(--card-border), 0 1px 3px rgba(0,0,0,0.18), 0 0 0 2px var(--red); }
  60%  { box-shadow: inset 0 0 0 0.5px var(--card-border), 0 1px 3px rgba(0,0,0,0.18), 0 0 0 2px var(--red); }
  100% { box-shadow: inset 0 0 0 0.5px var(--card-border), 0 1px 3px rgba(0,0,0,0.18), 0 0 0 0px var(--red); }
}

.card--illegal-shake { animation: illegal-shake 200ms ease-in-out; }
.card--illegal-flash { animation: illegal-flash 400ms ease-out forwards; }

@media (prefers-reduced-motion: reduce) {
  /* Drop shake; keep static red flash */
  .card--illegal-shake { animation: none; }
  .card--illegal-flash {
    animation: none;
    box-shadow: inset 0 0 0 0.5px var(--card-border), 0 0 0 2px var(--red);
  }
}

/* ── Hand ────────────────────────────────────────────────────────────────── */
.hand {
  --hand-overlap: 0.7;
  --cw: var(--hand-cw); /* derives from :root --hand-cw; trick-zone derives 80% of this */
  --n: 13; /* card count — JS sets inline; container shrinks as cards play, keeping fan centered */
  position: relative;
  /* total fan width = cardW + (n - 1) * cardW * (1 - overlap) */
  width: calc(var(--cw) + (var(--n) - 1) * var(--cw) * (1 - var(--hand-overlap)));
  max-width: calc(100% - 32px);
  /* Arc-fan vertical extent: a 20°-rotated card pivoted at its bottom
     occupies ~1.52 × cw vertically (h·cos20 + w/2·sin20 with h = 1.44·cw).
     Add the center-card lift (~17px at radius 280) and breathing room
     → 1.75·cw + 30px. Cards anchor to `bottom: 0` so the apex grows
     up into the extra room and edges stay planted. Multiplier bumped
     1.65→1.75 alongside the radius 180→280 deepening so the lifted
     center cards (and the selected/staged --state-lift) don't clip. */
  height: calc(var(--cw) * 1.75 + 30px);
  margin: 0 auto;
}


.hand__card {
  position: absolute;
  /* Anchor to BOTTOM of .hand so the arc apex (center card lifted up
     by --arc-lift) grows upward into the extra hand-zone headroom,
     and edge cards stay planted near the baseline. Was: top: 0,
     which floated cards to the top of the (taller) hand container. */
  bottom: 0;
  /* --i set inline per card */
  left: calc(var(--i, 0) * var(--cw) * (1 - var(--hand-overlap)));
  /* Arc fan — gentle poker-hand curve. --arc-rot and --arc-lift are
     set inline per-card by Hand.js's arcStyle() helper:
       rotate: linear across the hand width, max ~20° at the edges
       lift  : (1 − cos(angle)) × radius, so edges sit lower than center.
     transform-origin: 50% 100% pivots from the BOTTOM EDGE so cards
     fan from their base — feels like physical cards held in a hand
     and keeps tap targets predictable (the bottom corner stays
     planted as the card rotates). --state-lift is the additional
     vertical pop layered on top by hover/selected/autoplay variants. */
  --arc-rot: 0deg;
  --arc-lift: 0px;
  --state-lift: 0px;
  transform-origin: 50% 100%;
  transform: translateY(var(--arc-lift)) translateY(var(--state-lift)) rotate(var(--arc-rot));
  transition: transform 0.15s ease;
  cursor: default;
}

/* hover lift — fine pointer (desktop) only. --state-lift composes with
   the arc transform so the card pops *out of its arc position* rather
   than overriding it (was: transform: translateY(-14px), which erased
   the arc). */
@media (pointer: fine) {
  .hand__card--legal:hover { --state-lift: -14px; }
}

.hand__card--selected { --state-lift: -22px; }
.hand__card--autoplay { --state-lift: -32px; }
.hand__card--autoplay-firing { --state-lift: -48px; }
@media (prefers-reduced-motion: reduce) {
  /* Keep the static arc layout but drop the lift animation. */
  .hand__card--autoplay,
  .hand__card--autoplay-firing { --state-lift: 0px; }
}

/* Ring lives on .card so it follows card border-radius, not the transparent wrapper */
.card--autoplay {
  box-shadow:
    inset 0 0 0 0.5px var(--card-border),
    0 0 0 2px #3aa055,
    0 6px 20px rgba(58, 160, 85, 0.55);
}

@keyframes autoplay-jiggle {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-4px); }
  40%      { transform: translateX(4px); }
  60%      { transform: translateX(-3px); }
  80%      { transform: translateX(3px); }
}

.card--autoplay-firing {
  box-shadow:
    inset 0 0 0 0.5px var(--card-border),
    0 0 0 2px #3aa055,
    0 8px 24px rgba(58, 160, 85, 0.7);
  animation: autoplay-jiggle 250ms ease-in-out;
}
@media (prefers-reduced-motion: reduce) {
  .card--autoplay-firing { animation: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hand__card { transition: none; }
}

/* ── BidControls ─────────────────────────────────────────────────────────── */
.bid-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.bid-controls__grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  max-width: min(480px, 90vw);
}

.bid-btn {
  min-width: clamp(36px, 3.8vw, 54px);
  height: clamp(36px, 3.8vw, 54px);
  border-radius: 999px;
  background: var(--spade);
  color: #fff;
  font-size: clamp(14px, 1.3vw, 20px);
  font-weight: 600;
  font-family: "Inter", system-ui, sans-serif;
  box-shadow: 0 0 0 2px var(--accent), 0 3px 10px rgba(0,0,0,0.4);
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  padding: 0 clamp(10px, 1vw, 16px);
}

.bid-btn:hover { transform: translateY(-3px); box-shadow: 0 0 0 2px var(--accent), 0 6px 16px rgba(0,0,0,0.5); }
.bid-btn:active { transform: translateY(0); }

.bid-btn--blind-nil {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 0 0 2px var(--accent), 0 3px 10px rgba(0,0,0,0.25);
  padding: 0 clamp(14px, 1.4vw, 22px);
}
.bid-btn--blind-nil:hover { box-shadow: 0 0 0 2px var(--accent), 0 6px 16px rgba(0,0,0,0.35); }

.bid-btn--pending { outline: 2px solid var(--accent); outline-offset: 2px; }

.bid-controls__confirm-hint {
  text-align: center;
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

/* Blind-nil decision mode: two big pills replace the bid grid when the
   viewer is eligible (≥100 down) and hasn't yet revealed their hand.
   Show Cards is the safer, neutral-styled option; Blind Nil keeps the
   accent-outlined look from the legacy single-button placement so the
   "this is the bold play" affordance reads as before. */
.bid-controls--decision { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.bid-controls__decision-hint {
  text-align: center;
  font-size: 13px;
  /* Sprint 12 contrast audit — this hint renders OVER the felt
     surface (not paper), where var(--ink-soft) at ~#5a5a5a measured
     ~2.7:1 on dark felt and was illegible in the screenshot. Use a
     near-white with a subtle drop shadow so it reads on any dark
     felt color (all five themes have dark felts). */
  color: rgba(255, 255, 255, 0.94);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  max-width: 28ch;
  line-height: 1.35;
}
.bid-controls__decision-pair {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.bid-btn--decision { padding: 0 clamp(18px, 2vw, 28px); min-width: 130px; font-weight: 700; }
.bid-btn--show-cards {
  background: color-mix(in oklab, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in oklab, var(--accent) 35%, transparent);
  color: var(--ink);
}
.bid-btn--show-cards:hover {
  background: color-mix(in oklab, var(--accent) 22%, transparent);
  box-shadow: none;
}

/* ── Between-games CTA (post-returnLobby vote) ───────────────────────────── */
.between-games {
  background: color-mix(in oklab, var(--paper) 92%, transparent);
  backdrop-filter: blur(6px);
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.22);
  padding: 14px 22px;
  font-family: "Inter", system-ui, sans-serif;
  color: var(--ink);
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: min(320px, 90vw);
}
.between-games__title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
}
.between-games__sub {
  font-size: 12px;
  color: var(--ink-soft);
  text-align: center;
  max-width: 30ch;
}
.between-games .bid-btn { margin-top: 4px; }

/* ── HoldOverlay (between-hand) ──────────────────────────────────────────── */
.hold-overlay {
  background: color-mix(in oklab, var(--paper) 92%, transparent);
  backdrop-filter: blur(6px);
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.25);
  padding: 14px 18px;
  font-family: "Inter", system-ui, sans-serif;
  color: var(--ink);
  pointer-events: auto;
}

/* Rematch overlay — gameOver auto-stay countdown. Per chat2 §06: "Where
   most apps lose people. 30s countdown auto-staying the same four." Sits
   inside .bid-controls-zone so it inherits the same centered, above-hand
   placement HoldOverlay uses. Drives a width-based progress bar via
   --rematch-progress (set by the component as a CSS variable). */
.rematch-overlay {
  background: color-mix(in oklab, var(--paper) 94%, transparent);
  backdrop-filter: blur(8px);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.32);
  padding: 18px 22px;
  min-width: 280px;
  max-width: min(420px, 90vw);
  font-family: "Inter", system-ui, sans-serif;
  color: var(--ink);
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  text-align: center;
}
.rematch-overlay__title {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.02em;
}
.rematch-overlay__result {
  font-size: 14px;
  color: var(--ink-soft);
}
.rematch-overlay__score {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--ink);
}
.rematch-overlay__countdown {
  font-size: 14px;
  color: var(--ink);
}
.rematch-overlay__countdown strong {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.rematch-overlay__bar {
  width: 100%;
  height: 4px;
  background: color-mix(in oklab, var(--ink) 8%, transparent);
  border-radius: 2px;
  overflow: hidden;
}
.rematch-overlay__bar-fill {
  height: 100%;
  background: var(--accent);
  width: calc(var(--rematch-progress, 1) * 100%);
  transition: width 0.25s linear;
}
.rematch-overlay__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 4px;
}
.rematch-overlay__btn {
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid color-mix(in oklab, var(--ink) 18%, transparent);
  background: var(--paper);
  color: var(--ink);
  transition: transform 0.1s, background 0.1s;
}
.rematch-overlay__btn:hover:not(:disabled) {
  transform: translateY(-1px);
  background: color-mix(in oklab, var(--ink) 5%, transparent);
}
.rematch-overlay__btn:disabled { opacity: 0.5; cursor: default; }
.rematch-overlay__btn--leave {
  border-color: color-mix(in oklab, var(--red, #c0392b) 50%, transparent);
  color: var(--red, #c0392b);
}

/* Modal sheet — bottom-sheet on mobile, centered card on desktop. Used
   by RoomCreateModal and the per-room owner panel. */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  animation: modal-backdrop-fade 0.15s ease-out;
}
@media (min-width: 640px) {
  .modal-backdrop { align-items: center; padding: 24px; }
}
@keyframes modal-backdrop-fade { from { opacity: 0; } to { opacity: 1; } }

.modal-sheet {
  background: var(--paper);
  color: var(--ink);
  border-radius: 16px 16px 0 0;
  padding: 18px;
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 -8px 32px rgba(0,0,0,0.3);
  font-family: "Inter", system-ui, sans-serif;
}
@media (min-width: 640px) {
  .modal-sheet { border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,0.32); }
}
.modal-sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.modal-sheet__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}
.modal-sheet__close {
  background: transparent;
  border: none;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 18px;
  padding: 4px 8px;
  border-radius: 6px;
}
.modal-sheet__close:hover { background: color-mix(in oklab, var(--ink) 6%, transparent); }
.modal-sheet__actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 4px;
}
.modal-sheet__btn {
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid color-mix(in oklab, var(--ink) 20%, transparent);
  background: var(--paper);
  color: var(--ink);
}
.modal-sheet__btn:hover:not(:disabled) { background: color-mix(in oklab, var(--ink) 6%, transparent); }
.modal-sheet__btn:disabled { opacity: 0.5; cursor: default; }
.modal-sheet__btn--primary {
  background: var(--accent);
  color: #1f1208;
  border-color: color-mix(in oklab, var(--accent) 80%, var(--ink) 20%);
}
.modal-sheet__btn--ghost { background: transparent; }

/* RoomCreateModal — segmented target score + boolean toggles. */
.room-create-modal__field {
  border: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.room-create-modal__field legend {
  font-size: 12px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
  padding: 0;
}
.room-create-modal__seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.room-create-modal__seg--3 {
  grid-template-columns: 1fr 1fr 1fr;
}
.room-create-modal__seg--4 {
  grid-template-columns: 1fr 1fr 1fr 1fr;
}
.room-create-modal__seg label {
  border: 1px solid color-mix(in oklab, var(--ink) 18%, transparent);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: background 0.1s, border-color 0.1s;
}
.room-create-modal__seg label.seg--on {
  border-color: var(--accent);
  background: color-mix(in oklab, var(--accent) 12%, transparent);
}
.room-create-modal__seg label input { position: absolute; opacity: 0; pointer-events: none; }
.room-create-modal__seg label span { font-size: 18px; font-weight: 700; }
.room-create-modal__seg label small { font-size: 11px; color: var(--ink-soft); }
.room-create-modal__toggle {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  cursor: pointer;
  border-top: 1px solid color-mix(in oklab, var(--ink) 6%, transparent);
}
.room-create-modal__toggle input {
  margin-top: 4px;
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}
.room-create-modal__toggle div { display: flex; flex-direction: column; gap: 2px; }
.room-create-modal__toggle span { font-weight: 600; font-size: 15px; }
.room-create-modal__toggle small { font-size: 12px; color: var(--ink-soft); }

/* Owner panel — drawer section visible only when room.isOwner. */
.owner-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  background: color-mix(in oklab, var(--accent) 6%, transparent);
  border: 1px dashed color-mix(in oklab, var(--accent) 35%, transparent);
  border-radius: 10px;
}
.owner-panel__title {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.owner-panel__hint {
  font-size: 11px;
  color: var(--ink-soft);
  line-height: 1.4;
}
.owner-panel__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 4px;
  font-size: 13px;
}
.owner-panel__row label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.owner-panel__row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.owner-panel__member {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-top: 1px solid color-mix(in oklab, var(--ink) 6%, transparent);
}
.owner-panel__member-name { font-weight: 600; font-size: 13px; }
.owner-panel__member-actions { display: flex; gap: 6px; }
.owner-panel__btn {
  background: var(--paper);
  border: 1px solid color-mix(in oklab, var(--ink) 18%, transparent);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.owner-panel__btn:hover:not(:disabled) { background: color-mix(in oklab, var(--ink) 6%, transparent); }
.owner-panel__btn--danger {
  border-color: color-mix(in oklab, var(--red, #c0392b) 40%, transparent);
  color: var(--red, #c0392b);
}
.owner-panel__btn:disabled { opacity: 0.5; cursor: default; }
.owner-panel__btn--on {
  background: var(--accent);
  color: #1f1208;
  border-color: color-mix(in oklab, var(--accent) 70%, var(--ink) 30%);
}

/* BRB banner — sits above the hand when the viewer's own seat is
   bot-covered (heldFor). Per the BRB state-machine: I see my hand
   read-only, bot drives play, prominent reclaim CTA. */
.brb-banner {
  position: absolute;
  left: 50%;
  /* Sits in the dedicated rhythm-banner-clear row above the hand-zone
     (gated on .play-surface[data-has-banner="true"]). Bottom is
     relative to .brb-banner-zone which ALREADY carries `bottom:
     var(--hand-lift)`, so we DO NOT add hand-lift here too — that
     would double the offset and stack the banner on top of the south
     chip when both are lifted. Uses --rhythm-banner-pad (adaptive
     clamp 12–22px) so the gap between the hand top and the banner
     equals the gap between the banner and the south chip — banner is
     symmetrically padded in the reserved row. */
  bottom: calc(var(--hand-zone-h) + var(--rhythm-banner-pad, 12px));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px 8px 16px;
  background: color-mix(in oklab, var(--paper) 92%, transparent);
  backdrop-filter: blur(6px);
  border: 1px dashed color-mix(in oklab, var(--accent) 50%, transparent);
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  font-family: "Inter", system-ui, sans-serif;
  color: var(--ink);
  font-size: 13px;
  pointer-events: auto;
  z-index: 10;
  max-width: 90vw;
}
.brb-banner__text {
  font-weight: 500;
  color: var(--ink-soft);
}
.brb-banner__reclaim {
  border: none;
  background: var(--accent);
  color: #1f1208;
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.brb-banner__reclaim:hover { filter: brightness(1.05); }

/* Idle-warning variant — red border + amber action so the user reads
   urgency at a glance, distinct from the calm "you're away" BRB pose. */
.brb-banner--idle {
  border-color: color-mix(in oklab, var(--red, #c0392b) 60%, transparent);
  animation: brb-banner-idle-pulse 1.6s ease-in-out infinite;
}
.brb-banner--idle .brb-banner__text strong {
  color: var(--red, #c0392b);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.brb-banner--idle .brb-banner__reclaim {
  background: var(--red, #c0392b);
  color: #fff;
}
/* Sprint 14 — screen-flash for the chime-flash timeout action. Body
   gets `.screen-flash` for 1.5s when the server emits timeout:remind
   to the AFK player. Inset box-shadow pulses red so the user notices
   even if their attention drifted; no layout shift. */
.screen-flash { animation: screen-flash-pulse 0.5s ease-in-out 3; }
@keyframes screen-flash-pulse {
  0%, 100% { box-shadow: inset 0 0 0 0 transparent; }
  50%      { box-shadow: inset 0 0 0 10px var(--red, #c0392b); }
}
body.screen-flash {
  /* fixed-positioned overlay technique would lose the body bg — instead
     attach the inset shadow to a transient ::before element so we don't
     fight existing body styling. */
  position: relative;
}
body.screen-flash::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  animation: screen-flash-pulse 0.5s ease-in-out 3;
}

@keyframes brb-banner-idle-pulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(0,0,0,0.2); }
  50%      { box-shadow: 0 4px 16px rgba(192,57,43,0.45); }
}

/* "Waiting for human" variant — informational, no urgent pulse. Shows
   when bots are disallowed and a seat is empty so the game can't
   proceed without explanation. */
.brb-banner--waiting {
  border-color: color-mix(in oklab, var(--ink) 18%, transparent);
}
.brb-banner--spectator {
  border-color: color-mix(in oklab, var(--accent) 50%, transparent);
}

/* Sprint 14 Phase E — LLM chirp bubble.
   Anchored to the played-bot's seat per POV direction (south/west/
   north/east), unlike the spoiler bubble which floats above the trick
   zone. Smaller + monospace-feeling so it reads as "bot's own
   thought" rather than third-party narration. Shorter linger (~4.5s
   total) since chirps fire per LLM play and would overlap in all-bot
   mode if held longer. */
.chirp-bubble {
  position: absolute;
  max-width: min(56vw, 320px);
  padding: 6px 10px;
  background: color-mix(in oklab, var(--ink) 80%, transparent);
  color: var(--paper);
  border: 1px solid color-mix(in oklab, var(--accent) 55%, transparent);
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.32;
  pointer-events: none;
  z-index: 9;
  display: inline-flex;
  flex-direction: column;
  gap: 1px;
  transition: opacity 0.35s ease;
}
.chirp-bubble__speaker {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.92;
}
.chirp-bubble__text { font-style: normal; }

/* Position per POV. War-council Frodo+Sauron caught that chirp-south
   at top:62% landed ON the played south trick card, and chirp-north
   at top:16% overlapped the spoiler-bubble at top:18%. Repositioned
   to nudge the bubbles OUT of trick-zone airspace:
     - south: pushed lower (75%) so it sits between trick zone and
       the south seat chip — not on the played card.
     - north: pushed higher (8%) so it sits above the trick zone
       and well above the spoiler bubble's 18%.
     - east/west: kept at 50% but moved further off the edge
       (16%/right-16%) so they don't touch east/west played cards. */
.chirp-bubble--south { left: 50%; top: 75%; transform: translateX(-50%); }
.chirp-bubble--north { left: 50%; top: 8%;  transform: translateX(-50%); }
.chirp-bubble--west  { left: 16%; top: 50%; transform: translateY(-50%); }
.chirp-bubble--east  { right: 16%; top: 50%; transform: translateY(-50%); }

.chirp-bubble--fade-in {
  opacity: 0;
  animation: chirp-fade-in 0.18s ease-out forwards;
}
.chirp-bubble--shown { opacity: 1; }
.chirp-bubble--fade-out { opacity: 0; }
@keyframes chirp-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Sprint 14 Phase 2 — HUHS spoiler bubble. Floats above the trick
   zone with LLM commentary about the most recent bot play. Three
   phases: fade-in (200ms) → shown → fade-out (400ms). Component
   re-mounts on each new spoiler.generatedAt so the animation restarts
   cleanly. pointer-events:none — never steal clicks.

   Position: top-center of the play-surface, ~64px above where the
   trick cards land. Doesn't overlap the south-stack or trick cards. */
.spoiler-bubble {
  position: absolute;
  left: 50%;
  top: calc(20% - 14px);
  transform: translateX(-50%);
  max-width: min(86vw, 520px);
  padding: 9px 14px;
  background: color-mix(in oklab, var(--paper) 95%, transparent);
  backdrop-filter: blur(8px);
  border: 1px solid color-mix(in oklab, var(--accent) 60%, transparent);
  border-radius: 14px;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.32);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--ink);
  pointer-events: none;
  z-index: 9;
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  transition: opacity 0.4s ease, transform 0.2s ease;
}
.spoiler-bubble__speaker {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.85;
}
.spoiler-bubble__text { font-style: italic; }
.spoiler-bubble--fade-in {
  opacity: 0;
  transform: translateX(-50%) translateY(-4px);
  animation: spoiler-fade-in 0.2s ease-out forwards;
}
.spoiler-bubble--shown { opacity: 1; }
.spoiler-bubble--fade-out {
  opacity: 0;
  transition: opacity 0.4s ease;
}
@keyframes spoiler-fade-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-4px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Sprint 14 — vote-kick variant. Distinct from idle pulse: amber border
   (caller wants attention) with a steady glow rather than a red pulse,
   to signal "we need your input" not "you're idle". Y/N buttons reuse
   .brb-banner__reclaim styling. */
.brb-banner--vote-kick {
  border-color: color-mix(in oklab, var(--amber, #f59e0b) 70%, transparent);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.3);
}
.brb-banner__reclaim--voted {
  opacity: 0.55;
  cursor: default;
}

.hold-overlay--countdown {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
}

@keyframes hold-countdown {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

.hold-overlay__bar {
  width: 80px;
  height: 4px;
  background: var(--accent);
  border-radius: 2px;
  transform-origin: left center;
  animation: hold-countdown 3.5s linear forwards;
}

@media (prefers-reduced-motion: reduce) {
  .hold-overlay__bar { animation: none; opacity: 0.7; }
}

.hold-overlay__text {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
}

.hold-overlay__hold-btn {
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  padding: 6px 18px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: transform 0.1s, filter 0.1s;
}
.hold-overlay__hold-btn:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.15); }
.hold-overlay__hold-btn:disabled { opacity: 0.4; cursor: default; }

.hold-overlay--held {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 22px;
  min-width: min(360px, 90vw);
}

.hold-overlay__title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
}
.hold-overlay__subtitle {
  font-size: 12px;
  color: var(--ink-soft);
  text-align: center;
}

.hold-overlay__votes {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 4px;
}

.hold-overlay__vote-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: var(--paper);
  /* explicit color so dark themes don't fall back to UA ButtonText */
  color: var(--ink);
  border: 1px solid color-mix(in oklab, var(--ink) 22%, transparent);
  border-radius: 10px;
  padding: 8px 14px;
  cursor: pointer;
  min-width: 92px;
  transition: transform 0.1s, box-shadow 0.1s, border-color 0.1s;
}
.hold-overlay__vote-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.hold-overlay__vote-btn:disabled { opacity: 0.4; cursor: default; }

.hold-overlay__vote-btn--mine {
  border-color: var(--accent);
  background: color-mix(in oklab, var(--accent) 14%, var(--paper));
}

.hold-overlay__vote-label {
  font-weight: 700;
  font-size: 14px;
}
.hold-overlay__vote-hint {
  font-size: 11px;
  color: var(--ink-soft);
}
.hold-overlay__vote-tally {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-top: 2px;
}
.hold-overlay__vote-btn--mine .hold-overlay__vote-tally { color: var(--ink); }

/* Mobile: stack vote buttons vertically when narrow */
@media (max-width: 559px) {
  .hold-overlay__votes { flex-direction: column; width: 100%; }
  .hold-overlay__vote-btn { width: 100%; flex-direction: row; justify-content: space-between; padding: 10px 14px; }
  .hold-overlay__vote-hint { font-size: 11px; }
  .hold-overlay--held { min-width: 0; width: min(360px, 92vw); }
}

/* ── BlindNilModal ───────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 50;
  cursor: pointer;
}

.blind-nil-modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 51;
  background: var(--paper);
  border-radius: clamp(12px, 1vw, 18px);
  padding: clamp(20px, 2.5vw, 36px);
  max-width: min(420px, 90vw);
  width: 100%;
  box-shadow: 0 8px 40px rgba(0,0,0,0.4);
  font-family: "Inter", system-ui, sans-serif;
}

.blind-nil-modal__title {
  font-size: clamp(18px, 1.6vw, 26px);
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 12px;
}

.blind-nil-modal__body {
  font-size: clamp(13px, 1.1vw, 16px);
  color: var(--ink-soft);
  line-height: 1.6;
  margin: 0 0 20px;
}

.blind-nil-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.blind-nil-modal__btn {
  padding: 10px 22px;
  border-radius: 999px;
  font-size: clamp(13px, 1.1vw, 16px);
  font-weight: 600;
  font-family: "Inter", system-ui, sans-serif;
  cursor: pointer;
}

.blind-nil-modal__btn--back {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid rgba(0,0,0,0.15);
}
.blind-nil-modal__btn--back:hover { background: rgba(0,0,0,0.05); }

.blind-nil-modal__btn--confirm {
  background: var(--spade);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.blind-nil-modal__btn--confirm:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.35); }

/* ── LastTrickChip ───────────────────────────────────────────────────────── */
.last-trick-chip {
  background: var(--paper);
  border-radius: clamp(8px, 0.7vw, 12px);
  padding: clamp(8px, 0.8vw, 14px);
  box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.06);
  font-family: "Inter", system-ui, sans-serif;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.last-trick-chip__header {
  font-size: 9px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink-soft);
}

.last-trick-chip__cross {
  --cw: clamp(22px, calc(var(--hand-cw) * 0.32), 32px);
  --tz-size: calc(var(--cw) * 2.5);
  position: relative;
  width: var(--tz-size);
  height: var(--tz-size);
  margin: 0 auto;
}

.last-trick-chip__slot { position: absolute; }
.last-trick-chip__slot--south { bottom: 0; left: 50%; transform: translateX(-50%); }
.last-trick-chip__slot--west  { left: 0; top: 50%; transform: translateY(-50%) rotate(-90deg); }
.last-trick-chip__slot--north { top: 0; left: 50%; transform: translateX(-50%); }
.last-trick-chip__slot--east  { right: 0; top: 50%; transform: translateY(-50%) rotate(90deg); }

.last-trick-chip__footer {
  font-size: clamp(10px, 0.85vw, 12px);
  color: var(--ink-soft);
}

.last-trick-chip__name--ns { color: var(--name-on-paper-ns); }
.last-trick-chip__name--ew { color: var(--name-on-paper-ew); }

/* Mobile compact pill */
.last-trick-chip--mobile {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 15px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

/* ── HandSummary ─────────────────────────────────────────────────────────── */
.hand-summary {
  background: var(--paper);
  border-radius: clamp(8px, 0.7vw, 12px);
  padding: clamp(8px, 0.8vw, 14px);
  box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.06);
  font-family: "Inter", system-ui, sans-serif;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hand-summary__header {
  font-size: 9px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink-soft);
}

.hand-summary__row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hand-summary__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.hand-summary__dot--ns { background: var(--team-ns); }
.hand-summary__dot--ew { background: var(--team-ew); }

.hand-summary__label {
  font-size: clamp(11px, 0.9vw, 13px);
  font-weight: 600;
  color: var(--ink);
  flex: 1;
}

.hand-summary__made {
  font-size: clamp(11px, 0.9vw, 13px);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--ink-soft);
}
.hand-summary__made--on-track { color: var(--name-on-paper-ns); }

.hand-summary__sep {
  font-size: 11px;
  color: var(--ink-soft);
}

.hand-summary__bid {
  font-size: clamp(11px, 0.9vw, 13px);
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
}

/* ── Sprint 9 Lane 2 — Solo (4-player) display variants ────────────────────
   Per-seat rows in ScorePanel + HandSummary, viewer-prominent TopBar
   score chip, and per-seat scoreboard in the RematchOverlay. Visuals
   reuse existing tokens (--team-ns/--team-ew/--ink/--paper) so themes
   carry over without per-shape overrides. The "self" row gets a subtle
   left-edge highlight so the viewer can scan their line at a glance. */
.score-panel--solo .score-row--solo {
  /* per-seat layout matches the team .score-row defaults; just leaves
     a hook for future tuning without touching ScoreRow. */
}
.score-row--self {
  position: relative;
}
.score-row--self::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 2px;
  background: var(--name-on-paper-ns, var(--team-ns));
}
.score-row__delta {
  margin-left: 6px;
  font-size: clamp(10px, 0.75vw, 12px);
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
}

.hand-summary--solo .hand-summary__dot--seat-0 { background: var(--team-ns); }
.hand-summary--solo .hand-summary__dot--seat-1 { background: var(--team-ew); }
.hand-summary--solo .hand-summary__dot--seat-2 { background: var(--team-ns); }
.hand-summary--solo .hand-summary__dot--seat-3 { background: var(--team-ew); }
.hand-summary__row--self {
  font-weight: 700;
}
.hand-summary__verdict {
  font-size: clamp(10px, 0.75vw, 12px);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-soft);
  margin-left: 4px;
}
.hand-summary__verdict--made,
.hand-summary__verdict--nil_made {
  color: var(--name-on-paper-ns, var(--team-ns));
}
.hand-summary__verdict--set,
.hand-summary__verdict--nil_set {
  color: var(--name-on-paper-ew, var(--team-ew));
}
.hand-summary__delta {
  font-size: clamp(10px, 0.75vw, 12px);
  font-variant-numeric: tabular-nums;
  margin-left: auto;
}
.hand-summary__delta--pos { color: var(--name-on-paper-ns, var(--team-ns)); }
.hand-summary__delta--neg { color: var(--name-on-paper-ew, var(--team-ew)); }

.top-bar__solo-scores {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "Inter", system-ui, sans-serif;
  /* pointer-events intentionally unset — BRB banner zone (z-index: 12) must retain pointer priority */
}
.top-bar__solo-self {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}
.top-bar__solo-self-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--ink-soft);
}
.top-bar__solo-self-score {
  font-size: clamp(16px, 1.4vw, 20px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.top-bar__solo-opps {
  display: inline-flex;
  gap: 8px;
}
.top-bar__solo-opp {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  font-size: 11px;
  color: var(--ink-soft);
}
.top-bar__solo-opp-name {
  max-width: 7ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.top-bar__solo-opp-score {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.rematch-overlay__result--solo {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rematch-overlay__winner {
  font-size: clamp(14px, 1.2vw, 17px);
  font-weight: 700;
}
.rematch-overlay__scoreboard {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 4px;
}
.rematch-overlay__scoreboard-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: clamp(12px, 1vw, 14px);
  font-variant-numeric: tabular-nums;
}
.rematch-overlay__scoreboard-row--winner {
  font-weight: 700;
  color: var(--name-on-paper-ns, var(--team-ns));
}

/* ── Mobile overrides ────────────────────────────────────────────────────── */
@media (max-width: 559px) {
  .score-panel--compact .score-row__score { font-size: 14px; }
  .score-row__team { font-size: 10px; }
  .top-bar__solo-self-score { font-size: 14px; }
  .top-bar__solo-opp { font-size: 10px; }
  .top-bar__solo-opp-name { max-width: 5ch; }
}

/* ── Drawer ──────────────────────────────────────────────────────────────── */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: color-mix(in oklab, black 40%, transparent);
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  width: min(380px, 92vw);
  background: var(--paper);
  color: var(--ink);
  border-left: 1px solid color-mix(in oklab, var(--ink) 12%, transparent);
  display: flex;
  flex-direction: column;
  isolation: isolate;
  transform: translateX(100%);
  transition: transform 0.22s ease;
  overflow: hidden;
}

@media (max-width: 480px) {
  .drawer { width: 100vw; }
}

.drawer--open { transform: translateX(0); }

@media (prefers-reduced-motion: reduce) {
  .drawer { transition: none; }
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid color-mix(in oklab, var(--ink) 10%, transparent);
  flex-shrink: 0;
}

.drawer-header__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 18px;
}

/* WCAG 2.1 §1.4.3: logos and brand names are exempt from contrast requirements. The ♠ glyph is the brand mark; gold-on-paper is intentional. */
.drawer-header__brand-icon { color: var(--accent); font-size: 22px; }

.drawer-header__close {
  background: none;
  border: none;
  color: var(--ink);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  opacity: 0.7;
}
.drawer-header__close:hover { opacity: 1; }

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 0 24px;
}

.drawer-section {
  padding: 16px 20px;
  border-bottom: 1px solid color-mix(in oklab, var(--ink) 8%, transparent);
}

.drawer-section__title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.5;
  margin: 0 0 12px;
}

.drawer-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
/* Sprint 14 — brain picker now has 4 buttons (Humans/LLMs/PIMCs/JS).
   On a narrow drawer (≤380px) the JS button overflows offscreen
   without wrap. Allow wrap so JS stays reachable. */
.drawer-row--brain { flex-wrap: wrap; }

/* Sprint 14 Phase D — Mixed-state row beneath the brain picker.
   Renders ONLY when room.seatBrain[] has any non-null entries. Shows
   four compass pips (N/E/S/W) each carrying the brain letter (J/P/L)
   that's actually running at that seat, plus an inline hint that
   tapping any brain above will unify. Uses the same brain-badge
   palette as SeatChip's J/P/L badge so the colors stay consistent
   across surfaces. */
.drawer-row--brain-mixed {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: -4px;
  margin-bottom: 8px;
}
.drawer-mixed-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.drawer-mixed-seat {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.drawer-mixed-seat__dir {
  color: var(--ink-soft);
  font-size: 9px;
  text-transform: uppercase;
}
.drawer-mixed-seat__brain {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 14px;
  height: 14px;
  padding: 0 4px;
  border-radius: 4px;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}
.drawer-mixed-hint {
  font-size: 10px;
  color: var(--ink-soft);
  opacity: 0.75;
  font-style: italic;
  margin-left: auto;
}
.drawer-row--actions { margin-top: 12px; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
.drawer-row--target { align-items: center; gap: 10px; }
.drawer-row--account {
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 8px;
  background: color-mix(in oklab, var(--ink) 5%, transparent);
}
.drawer-account__name { font-weight: 600; font-size: 13px; }
.drawer-account__friends {
  font-size: 12px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

/* Sprint 6 Lane 2 — drawer footer avatar thumb next to the username.
   Round, 28×28, falls back to a paper-toned circle with a centered
   spade glyph when neither avatarUrl nor avatar (built-in slug) is
   set. Sits at the START of the account row when present. */
.drawer-row--profile-footer { gap: 10px; }
.drawer-account__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: color-mix(in oklab, var(--ink) 6%, transparent);
  border: 1px solid color-mix(in oklab, var(--ink) 12%, transparent);
  flex-shrink: 0;
}
.drawer-account__avatar--placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--ink-soft);
}

.target-radio { display: flex; align-items: center; gap: 4px; font-size: 13px; cursor: pointer; color: var(--ink-soft); }
.target-radio input { accent-color: var(--accent); cursor: pointer; }

.drawer-label { opacity: 0.6; font-size: 13px; flex-shrink: 0; }

.drawer-chip {
  background: color-mix(in oklab, var(--ink) 7%, transparent);
  border: 1px solid color-mix(in oklab, var(--ink) 12%, transparent);
  border-radius: 6px;
  color: var(--ink);
  font-size: 13px;
  padding: 3px 10px;
  cursor: pointer;
  font-family: monospace;
}
.drawer-chip:hover { background: color-mix(in oklab, var(--ink) 12%, transparent); }

.drawer-input {
  flex: 1;
  background: color-mix(in oklab, var(--ink) 6%, transparent);
  border: 1px solid color-mix(in oklab, var(--ink) 15%, transparent);
  border-radius: 6px;
  color: var(--ink);
  font-size: 14px;
  padding: 6px 10px;
  outline: none;
}
.drawer-input:focus { border-color: var(--accent); }

.drawer-btn {
  background: color-mix(in oklab, var(--ink) 9%, transparent);
  border: 1px solid color-mix(in oklab, var(--ink) 15%, transparent);
  border-radius: 6px;
  color: var(--ink);
  font-size: 13px;
  padding: 6px 14px;
  cursor: pointer;
  white-space: nowrap;
}
.drawer-btn:hover { background: color-mix(in oklab, var(--ink) 15%, transparent); }
.drawer-btn:disabled { opacity: 0.4; cursor: default; }
.drawer-btn--primary {
  background: var(--accent);
  /* Accent colors are saturated mids/lights across themes — black always
     beats white for AA contrast. Pinning to #000 instead of inheriting
     prevents white-on-light-accent on dark theme (--ink is light there). */
  color: #000;
  border-color: transparent;
  font-weight: 600;
}
.drawer-btn--primary:hover { filter: brightness(1.1); }

.drawer-btn--cancel {
  background: color-mix(in oklab, var(--red) 10%, transparent);
  border-color: color-mix(in oklab, var(--red) 30%, transparent);
  /* Sprint 12 contrast audit — paper-aware danger color. Default
     light-paper themes get darkened red (~6.6:1 on cream); dark-paper
     themes (hot-spades) override --danger-text to a brightened red so
     the label doesn't vanish into the bg. See tokens.css. */
  color: var(--danger-text);
  font-weight: 600;
}

.drawer-btn--admin-link {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  margin: 4px 0;
  border-radius: 8px;
  background: color-mix(in oklab, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in oklab, var(--accent) 35%, transparent);
  color: var(--ink);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
}
.drawer-btn--admin-link:hover { background: color-mix(in oklab, var(--accent) 22%, transparent); }
.drawer-btn--cancel:hover { background: color-mix(in oklab, var(--red) 18%, transparent); }

/* End-game is a heavier action than redeal — distinct treatment so the two
   destructive buttons aren't visually identical when sitting next to each
   other in the drawer. Solid red fill, white text, sits below a divider. */
.drawer-btn--danger {
  /* Sprint 12 contrast audit — white on var(--red) measured 3.97:1
     (fails AA 4.5:1). Darken the red 75/25 toward black so white text
     lands at ~5.8:1 while keeping the danger-button identity. */
  background: color-mix(in oklab, var(--red) 75%, black);
  border-color: color-mix(in oklab, var(--red) 75%, black);
  color: #fff;
  font-weight: 700;
}
.drawer-btn--danger:hover { filter: brightness(1.08); }
.drawer-row--actions-divider {
  height: 1px;
  background: color-mix(in oklab, var(--ink) 8%, transparent);
  margin: 6px 0;
}

.drawer-btn--voted {
  background: var(--red);
  color: #fff;
  border-color: transparent;
}
.drawer-btn--voted:hover { filter: brightness(1.05); }

.drawer-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 14px;
  cursor: pointer;
  border-bottom: 1px solid color-mix(in oklab, var(--ink) 6%, transparent);
  gap: 12px;
}
.drawer-toggle:last-child { border-bottom: none; }

.drawer-empty {
  font-size: 13px;
  opacity: 0.45;
  padding: 12px 0;
  margin: 0;
  text-align: center;
}

/* ── Seat picker ─────────────────────────────────────────────────────────── */
/* 3×3 grid laid out as a compass — N top, S bottom, W/E sides — to mirror
   the table. Each seat shows position + occupant. Click empty/bot seats to
   take/swap; your own seat is disabled. */
.seat-picker {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: auto auto auto;
  gap: 6px;
  margin: 10px 0;
}
.seat-btn {
  border: 1px solid color-mix(in oklab, var(--ink) 15%, transparent);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  padding: 8px 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-family: "Inter", system-ui, sans-serif;
  transition: box-shadow 0.15s, transform 0.1s;
}
.seat-btn:hover:not(:disabled) {
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  transform: translateY(-1px);
}
.seat-btn:disabled { cursor: default; opacity: 0.85; }

.seat-btn__pos {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.seat-btn__who {
  font-size: 13px;
  font-weight: 600;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Compass placement: north=top-center, west=mid-left, east=mid-right, south=bottom-center */
.seat-btn[style*="--seat-grid: 2"] { grid-column: 2; grid-row: 1; }  /* N */
.seat-btn[style*="--seat-grid: 1"] { grid-column: 1; grid-row: 2; }  /* W */
.seat-btn[style*="--seat-grid: 3"] { grid-column: 3; grid-row: 2; }  /* E */
.seat-btn[style*="--seat-grid: 0"] { grid-column: 2; grid-row: 3; }  /* S */

/* Team coloring — left edge stripe via inset shadow, keeps text readable */
.seat-btn--ns { box-shadow: inset 4px 0 0 0 var(--team-ns); }
.seat-btn--ew { box-shadow: inset 4px 0 0 0 var(--team-ew); }

.seat-btn--you {
  background: color-mix(in oklab, var(--accent) 12%, var(--paper));
  border-color: var(--accent);
}
.seat-btn--open .seat-btn__who { color: var(--ink-soft); font-style: italic; }
.seat-btn--bot .seat-btn__who { color: var(--ink-soft); }

/* ── Theme tiles ─────────────────────────────────────────────────────────── */
.theme-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.theme-tile {
  background: color-mix(in oklab, var(--ink) 7%, transparent);
  border: 1px solid color-mix(in oklab, var(--ink) 15%, transparent);
  border-radius: 6px;
  color: var(--ink);
  font-size: 12px;
  padding: 5px 10px;
  cursor: pointer;
  text-transform: capitalize;
}
.theme-tile--active {
  border-color: var(--accent);
  background: color-mix(in oklab, var(--accent) 20%, transparent);
  font-weight: 600;
}

/* Sprint 12 — unified grid (legacy themes + palette overlays in one
   place). Tiles get a small swatch preview + label so the palette
   tiles (with felt+accent swatches) and the legacy tiles read in the
   same visual family. */
.theme-tiles--unified .theme-tile {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 4px;
}
.theme-tiles--unified .theme-tile__swatch {
  display: inline-block;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 1px solid color-mix(in oklab, var(--ink) 12%, transparent);
  flex-shrink: 0;
}
.theme-tiles--unified .theme-tile__label {
  font-size: 12px;
  white-space: nowrap;
}
.theme-tiles--unified .theme-tile:disabled {
  opacity: 0.55;
  cursor: default;
}

/* ── Theme tile groups (Light / Dark) ────────────────────────────────────── */
/* The picker partitions the 23 themes into Light and Dark sections so
   users can scan to the half they want at a glance. Group headings are
   small and quiet — the swatches do the talking. */
.theme-tile-groups {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.theme-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.theme-group__title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.4;
  margin: 0;
}

/* ── Theme preview (post-tap card-back + felt patch) ─────────────────────── */
/* Latches open on the first tile tap of a drawer session and stays
   visible until the drawer closes. Reads the active theme tokens via
   the body[data-theme] cascade — no scoped overrides needed because
   the preview lives inside the body that already has the theme on it. */
.theme-preview {
  margin-top: 12px;
  animation: theme-preview-expand 240ms ease-out;
  overflow: hidden;
}
@keyframes theme-preview-expand {
  from { opacity: 0; max-height: 0; transform: translateY(-4px); }
  to   { opacity: 1; max-height: 280px; transform: translateY(0); }
}
.theme-preview__table {
  position: relative;
  border-radius: 10px;
  padding: 18px 16px;
  background: var(--felt-mid);
  /* Echo the active theme's --tartan-pattern (set by tartan.css; unset
     elsewhere → empty stack, no overlay). Same overlay the real table
     uses, so the preview matches what the user is about to see. */
  background-image: var(--tartan-pattern, none);
  box-shadow:
    inset 0 0 0 1px color-mix(in oklab, var(--ink, #000) 25%, transparent),
    inset 0 14px 28px -20px rgba(0, 0, 0, 0.45),
    0 2px 8px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}
.theme-preview__cards {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  /* --cw drives .card and .card--back sizing — local override so the
     preview cards stay compact regardless of the active table's --card-w. */
  --cw: 46px;
}
.theme-preview__card {
  flex-shrink: 0;
}


/* ── Tabs ────────────────────────────────────────────────────────────────── */
.tabs { display: flex; flex-direction: column; }
.tabs__bar {
  display: flex;
  border-bottom: 1px solid color-mix(in oklab, var(--ink) 10%, transparent);
  padding: 0 20px;
}
.tabs__tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--ink);
  font-size: 13px;
  padding: 10px 14px;
  cursor: pointer;
  opacity: 0.55;
  margin-bottom: -1px;
}
.tabs__tab--active { opacity: 1; border-bottom-color: var(--accent); font-weight: 600; }
.tabs__panel { padding: 12px 20px; overflow-y: auto; max-height: 240px; }

/* ── Scoreboard tab ──────────────────────────────────────────────────────── */
.sb-heading { font-size: 11px; opacity: 0.45; text-transform: uppercase; letter-spacing: .06em; margin: 10px 0 4px; }
.sb-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; }
.sb-row__name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-row__stat { opacity: 0.6; font-size: 12px; flex-shrink: 0; }
.sb-row__pct { opacity: 0.4; font-size: 11px; flex-shrink: 0; min-width: 34px; text-align: right; }

/* ── Log tab ─────────────────────────────────────────────────────────────── */
.log-tab { display: flex; flex-direction: column; gap: 4px; }
.log-entry { font-size: 12px; opacity: 0.65; padding: 2px 0; border-bottom: 1px solid color-mix(in oklab, var(--ink) 5%, transparent); }
.log-entry__msg { }

/* ── Toast stack ─────────────────────────────────────────────────────────── */
.toast-stack {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  pointer-events: none;
}

.toast {
  background: var(--paper);
  border: 1px solid color-mix(in oklab, var(--ink) 15%, transparent);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
  pointer-events: auto;
  max-width: min(340px, 90vw);
}
.toast--error { border-color: var(--error, #e85555); }
.toast--action { border-color: var(--accent); }
.toast__msg { flex: 1; }
.toast__actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.toast__action {
  background: var(--accent);
  color: #1f1208;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 12px;
  padding: 4px 10px;
  cursor: pointer;
  flex-shrink: 0;
}
.toast__action:hover { filter: brightness(1.05); }
.toast__action--secondary {
  background: transparent;
  border: 1px solid color-mix(in oklab, var(--ink) 25%, transparent);
  color: var(--ink-soft);
  font-weight: 500;
}
.toast__action--secondary:hover { background: color-mix(in oklab, var(--ink) 8%, transparent); filter: none; }
.toast__close {
  background: none;
  border: none;
  color: var(--ink);
  cursor: pointer;
  opacity: 0.6;
  font-size: 12px;
  padding: 0 2px;
  flex-shrink: 0;
}
.toast__close:hover { opacity: 1; }

/* ── Settings screen ─────────────────────────────────────────────────────── */
.settings-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, sans-serif;
  overflow: hidden;
}

.settings-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid color-mix(in oklab, var(--ink) 10%, transparent);
  flex-shrink: 0;
  background: color-mix(in oklab, var(--ink) 15%, transparent);
}

.settings-topbar__title {
  flex: 1;
  font-weight: 600;
  font-size: 16px;
  text-align: center;
}

.settings-back {
  background: none;
  border: none;
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 0;
  white-space: nowrap;
}

.settings-signout {
  background: none;
  border: 1px solid color-mix(in oklab, var(--ink) 20%, transparent);
  border-radius: 6px;
  color: var(--ink);
  font-size: 13px;
  padding: 5px 12px;
  cursor: pointer;
  opacity: 0.7;
  white-space: nowrap;
}
.settings-signout:hover { opacity: 1; }

.settings-signin {
  background: var(--accent);
  border: none;
  border-radius: 6px;
  color: #000;
  font-size: 13px;
  font-weight: 600;
  padding: 5px 14px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.settings-signin:hover { filter: brightness(1.1); }

.settings-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 0 48px;
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
}

.settings-section {
  padding: 20px 24px;
  border-bottom: 1px solid color-mix(in oklab, var(--ink) 8%, transparent);
}

.settings-section__title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.5;
  margin: 0 0 14px;
}

.settings-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-input {
  flex: 1;
  background: color-mix(in oklab, var(--ink) 6%, transparent);
  border: 1px solid color-mix(in oklab, var(--ink) 15%, transparent);
  border-radius: 8px;
  color: var(--ink);
  font-size: 15px;
  padding: 9px 12px;
  outline: none;
  font-family: inherit;
}
.settings-input:focus { border-color: var(--accent); }

.settings-btn {
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: #000;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 18px;
  cursor: pointer;
  white-space: nowrap;
}
.settings-btn:disabled { opacity: 0.4; cursor: default; }

.settings-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  font-size: 15px;
  cursor: pointer;
  border-bottom: 1px solid color-mix(in oklab, var(--ink) 6%, transparent);
  gap: 16px;
}
.settings-toggle:last-child { border-bottom: none; }
.settings-toggle__label { flex: 1; }

/* ── SliderRow ────────────────────────────────────────────────────────────── */
.slider-row {
  display: flex;
  align-items: center;
  padding: 8px 0;
  font-size: 14px;
  gap: 10px;
  border-bottom: 1px solid color-mix(in oklab, var(--ink) 6%, transparent);
}
.slider-row__label { flex-shrink: 0; color: var(--ink-soft); font-size: 13px; min-width: 48px; }
.slider-row__input {
  flex: 1;
  accent-color: var(--accent);
  cursor: pointer;
}
.slider-row__value { flex-shrink: 0; font-size: 13px; color: var(--ink-soft); min-width: 28px; text-align: right; }

/* ── History panel (HUHS-style persistent room game archive) ─────────────── */
.history-panel-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.history-panel {
  background: var(--paper);
  color: var(--ink);
  border-radius: 14px;
  width: min(560px, 96vw);
  max-height: 86vh;
  display: flex; flex-direction: column;
  box-shadow: 0 18px 48px rgba(0,0,0,0.45);
}
.history-panel__header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid color-mix(in oklab, var(--ink) 8%, transparent);
}
.history-panel__title { font-size: 17px; font-weight: 700; flex: 1; margin: 0; }
.history-panel__close {
  background: none; border: none; cursor: pointer;
  color: var(--ink); font-size: 26px; line-height: 1;
  padding: 0 6px;
}
.history-panel__body { padding: 8px 12px; overflow-y: auto; overscroll-behavior: contain; }
.history-panel__filter {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 8px 4px 12px;
  border-bottom: 1px solid color-mix(in oklab, var(--ink) 6%, transparent);
  margin-bottom: 8px;
}
.history-panel__chip {
  background: var(--paper);
  border: 1px solid color-mix(in oklab, var(--ink) 14%, transparent);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  color: var(--ink);
  transition: background 0.1s, border-color 0.1s;
}
.history-panel__chip:hover:not(:disabled) {
  background: color-mix(in oklab, var(--ink) 5%, transparent);
}
.history-panel__chip--on {
  background: var(--accent);
  color: #1f1208;
  border-color: color-mix(in oklab, var(--accent) 70%, var(--ink) 30%);
}
.history-panel__chip:disabled { opacity: 0.4; cursor: default; }
.history-entry__playtype {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: color-mix(in oklab, var(--ink) 8%, transparent);
  color: var(--ink-soft);
}
.history-entry__playtype--humans { background: color-mix(in oklab, var(--team-ns, #2e7d32) 18%, transparent); color: var(--team-ns, #2e7d32); }
.history-entry__playtype--llms   { background: color-mix(in oklab, var(--accent) 20%, transparent); color: var(--ink); }
.history-entry__playtype--pimcs  { background: color-mix(in oklab, var(--red, #c0392b) 20%, transparent); color: var(--red, #c0392b); }
.history-entry__playtype--mixed  { background: color-mix(in oklab, var(--ink) 10%, transparent); color: var(--ink-soft); }
.history-panel__loading,
.history-panel__error,
.history-panel__empty {
  text-align: center; padding: 28px 12px;
  color: var(--ink-soft);
  font-size: 14px;
}
.history-panel__error { color: var(--red, #c0392b); }
.history-panel__list { list-style: none; margin: 0; padding: 0; }

.history-entry {
  border-bottom: 1px solid color-mix(in oklab, var(--ink) 6%, transparent);
}
.history-entry__row {
  width: 100%; background: none; border: none; cursor: pointer;
  display: grid; grid-template-columns: auto auto 1fr auto;
  gap: 10px; align-items: center;
  padding: 10px 8px; font-size: 14px; color: var(--ink); text-align: left;
}
.history-entry__row:hover { background: color-mix(in oklab, var(--ink) 4%, transparent); }
.history-entry__date { font-weight: 600; }
.history-entry__duration { color: var(--ink-soft); font-size: 12px; }
.history-entry__score { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.history-entry__score--ns-win { color: var(--team-a, #2e7d32); }
.history-entry__score--ew-win { color: var(--team-b, #c62828); }
.history-entry__chevron { color: var(--ink-soft); }
.history-entry__detail {
  padding: 6px 8px 16px;
  background: color-mix(in oklab, var(--ink) 3%, transparent);
}
.history-entry__hands {
  margin-top: 10px;
  font-size: 12px;
  display: flex; flex-direction: column; gap: 3px;
  font-variant-numeric: tabular-nums;
}
.history-entry__hand {
  display: grid; grid-template-columns: 70px 1fr auto; gap: 8px;
  padding: 3px 6px; border-radius: 6px;
}
.history-entry__hand:nth-child(odd) { background: color-mix(in oklab, var(--ink) 4%, transparent); }
.history-entry__delta { color: var(--ink-soft); }
.history-entry__live {
  margin-top: 8px; font-size: 12px; font-style: italic;
  color: var(--ink-soft); text-align: center;
}
.history-entry--in-progress .history-entry__row {
  background: color-mix(in oklab, var(--accent) 6%, transparent);
}

.history-chart { width: 100%; height: auto; display: block; color: var(--ink); }
.history-chart__empty { text-align: center; font-size: 12px; color: var(--ink-soft); padding: 18px 0; }

/* ── Sexy between-hands trend chart ─────────────────────────────────────────
   Opt-in (HistoryChart sexy=true). The default chart above is untouched. */
.history-chart--sexy {
  width: 100%;
  height: auto;
  display: block;
  animation: hc-rise 460ms cubic-bezier(.2,.7,.2,1) both;
}
@keyframes hc-rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.history-chart__grid {
  stroke: color-mix(in oklab, var(--ink) 12%, transparent);
  stroke-width: 1;
}
.history-chart__grid--zero {
  stroke: color-mix(in oklab, var(--ink) 26%, transparent);
}
.history-chart__grid--target {
  stroke: color-mix(in oklab, var(--accent) 70%, transparent);
  stroke-width: 1.5;
  stroke-dasharray: 5 4;
}
.history-chart__ylab,
.history-chart__xlab {
  fill: var(--ink-soft);
  font-size: 11px;
  font-family: "Inter", system-ui, sans-serif;
}
.history-chart__axis-title {
  fill: color-mix(in oklab, var(--ink) 55%, transparent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  font-family: "Inter", system-ui, sans-serif;
}
.history-chart__target-lab {
  fill: color-mix(in oklab, var(--accent) 90%, var(--ink));
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-family: "Inter", system-ui, sans-serif;
}
.history-chart__area { animation: hc-fade 700ms ease-out both; }
@keyframes hc-fade { from { opacity: 0; } to { opacity: 1; } }
.history-chart__line {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: hc-draw 760ms ease-out forwards;
}
.history-chart__line--a { filter: drop-shadow(0 1px 5px color-mix(in oklab, var(--team-a, #4caf50) 55%, transparent)); }
.history-chart__line--b { filter: drop-shadow(0 1px 5px color-mix(in oklab, var(--team-b, #ef5350) 55%, transparent)); animation-delay: 90ms; }
@keyframes hc-draw { to { stroke-dashoffset: 0; } }
.history-chart__dot {
  animation: hc-fade 520ms ease-out both;
  animation-delay: 520ms;
}
.history-chart__chip { animation: hc-fade 360ms ease-out both; animation-delay: 720ms; }
.history-chart__chip rect { filter: drop-shadow(0 1px 3px rgba(0,0,0,0.28)); }
.history-chart__chip-txt {
  fill: #fff;
  font-size: 11px;
  font-weight: 800;
  font-family: "Inter", system-ui, sans-serif;
}
@media (prefers-reduced-motion: reduce) {
  .history-chart--sexy,
  .history-chart__area,
  .history-chart__line,
  .history-chart__dot,
  .history-chart__chip { animation: none; }
  .history-chart__line { stroke-dashoffset: 0; }
}

/* Trend slot inside the between-hands overlay. Full-width so the
   countdown bar / Hold button wrap to their own row beneath it. */
.hold-overlay__trend {
  flex: 0 0 100%;
  width: min(540px, 86vw);
  margin: 2px auto 8px;
}
.hold-overlay--countdown { flex-wrap: wrap; justify-content: center; }
.hold-overlay--held .hold-overlay__trend { margin-bottom: 12px; }

/* ── Stats panel ────────────────────────────────────────────────────────── */
.stats-panel__loading {
  text-align: center;
  color: var(--ink-soft);
  font-size: 14px;
  margin: 0;
}
.stats-panel__table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  font-size: 14px;
}
.stats-panel__table th,
.stats-panel__table td {
  padding: 6px 8px;
  text-align: right;
  border-bottom: 1px solid color-mix(in oklab, var(--ink) 8%, transparent);
}
.stats-panel__table th[scope="col"] {
  text-align: right;
  font-weight: 600;
  color: var(--ink-soft);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stats-panel__table th[scope="row"] {
  text-align: left;
  font-weight: 500;
  color: var(--ink-soft);
}
.stats-panel__totals .stats-panel__table td { font-size: 18px; font-weight: 600; }
.stats-panel__empty {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--ink-soft);
  text-align: center;
}
.stats-panel__filterbar {
  display: flex;
  gap: 4px;
  background: color-mix(in oklab, var(--ink) 5%, transparent);
  border-radius: 10px;
  padding: 4px;
  margin: 0 0 12px;
  flex-wrap: wrap;
}
.stats-panel__chip {
  flex: 1 1 0;
  min-width: 60px;
  background: transparent;
  border: none;
  border-radius: 7px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
}
.stats-panel__chip--on {
  background: color-mix(in oklab, var(--accent, #4caf50) 18%, transparent);
  color: var(--ink);
}
.stats-panel__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.stats-panel__card {
  border: 1px solid color-mix(in oklab, var(--ink) 12%, transparent);
  border-radius: 10px;
  padding: 10px 12px;
  background: color-mix(in oklab, var(--ink) 3%, transparent);
}
.stats-panel__card--empty { opacity: 0.65; }
.stats-panel__card-title {
  font-weight: 600;
  font-size: 14px;
  margin: 0 0 6px;
  border-bottom: 1px solid color-mix(in oklab, var(--ink) 8%, transparent);
  padding-bottom: 4px;
}
.stats-panel__trends {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.stats-sparkline {
  border: 1px solid color-mix(in oklab, var(--ink) 12%, transparent);
  border-radius: 10px;
  padding: 8px 10px;
  background: color-mix(in oklab, var(--ink) 3%, transparent);
}
.stats-sparkline--empty .stats-sparkline__svg { opacity: 0.4; }
.stats-sparkline__title {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 4px;
}
.stats-sparkline__svg {
  display: block;
  width: 100%;
  height: auto;
  color: var(--ink);
}
.stats-sparkline__caption {
  font-size: 12px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
}

/* ── Avatar grid ─────────────────────────────────────────────────────────── */
.avatar-tabs {
  display: flex;
  gap: 4px;
  background: color-mix(in oklab, var(--ink) 5%, transparent);
  border-radius: 10px;
  padding: 4px;
  margin: 0 0 12px;
  flex-wrap: wrap;
}
.avatar-tab {
  flex: 1 1 0;
  min-width: 60px;
  background: transparent;
  border-radius: 7px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s, color 0.12s;
}
.avatar-tab:hover:not(.avatar-tab--active) {
  background: color-mix(in oklab, var(--ink) 6%, transparent);
}
.avatar-tab--active {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.avatar-loading {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 13px;
  color: var(--ink-soft);
  padding: 24px 0;
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 10px;
  min-height: 96px;
  /* Cap height so a large set (current temu+emoji rosters are ~18 each)
     doesn't stretch the page. The grid scrolls internally; the rest of
     the settings screen stays put. overscroll-behavior: contain prevents
     a fast inner scroll from chaining into a body scroll on touch. */
  max-height: clamp(220px, 40vh, 360px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  /* Subtle visual frame so the scrolling region reads as a contained
     drawer, not a continuous block of tiles. */
  padding: 8px;
  border-radius: 10px;
  background: color-mix(in oklab, var(--ink) 3%, transparent);
}
/* Slim scrollbar that doesn't shove the grid columns when it appears. */
.avatar-grid::-webkit-scrollbar { width: 8px; }
.avatar-grid::-webkit-scrollbar-thumb {
  background: color-mix(in oklab, var(--ink) 25%, transparent);
  border-radius: 4px;
}
.avatar-grid::-webkit-scrollbar-track { background: transparent; }

.avatar-tile {
  background: color-mix(in oklab, var(--ink) 6%, transparent);
  border: 2px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  transition: border-color 0.12s;
}
.avatar-tile:hover { border-color: var(--accent-soft, rgba(124,111,255,.4)); }
.avatar-tile--active { border-color: var(--accent); background: color-mix(in oklab, var(--accent) 15%, transparent); }
.avatar-tile:disabled { opacity: 0.5; cursor: default; }

.avatar-tile__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* ── Drawer sign-in / sign-out ───────────────────────────────────────────── */
.drawer-btn--signin {
  background: var(--accent);
  border: none;
  border-radius: 6px;
  color: #000;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.drawer-btn--signin:hover { filter: brightness(1.1); }

.drawer-btn--signout {
  background: none;
  border: 1px solid color-mix(in oklab, var(--ink) 20%, transparent);
  border-radius: 6px;
  color: var(--ink);
  font-size: 13px;
  padding: 6px 14px;
  cursor: pointer;
  opacity: 0.7;
  white-space: nowrap;
}
.drawer-btn--signout:hover { opacity: 1; }

/* ── Drawer settings link ────────────────────────────────────────────────── */
.drawer-btn--settings-link {
  margin-top: 10px;
  width: 100%;
  text-align: right;
  background: none;
  border: none;
  border-top: 1px solid color-mix(in oklab, var(--ink) 8%, transparent);
  border-radius: 0;
  color: var(--ink);
  font-size: 13px;
  padding: 10px 0 0;
  cursor: pointer;
}

/* ── Login screen ────────────────────────────────────────────────────────── */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: var(--bg);
  padding: 24px;
  font-family: "Inter", system-ui, sans-serif;
}

.login-card {
  background: var(--paper, #fff);
  border-radius: 16px;
  padding: 36px 32px 28px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
}

.login-brand__icon {
  width: 40px; height: 40px;
  border-radius: 8px;
  background: var(--spade, #1a1a2e);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}

.login-brand__name {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.3px;
}

.login-tabs {
  display: flex;
  gap: 4px;
  background: color-mix(in oklab, var(--ink) 5%, transparent);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 4px;
}
.login-tab {
  flex: 1;
  background: transparent;
  border: none;
  border-radius: 7px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s, color 0.12s;
}
.login-tab:hover:not(.login-tab--active) {
  background: color-mix(in oklab, var(--ink) 6%, transparent);
}
.login-tab--active {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.login-input--mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  letter-spacing: 0.02em;
  word-break: break-all;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.login-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft, #666);
  letter-spacing: 0.2px;
}

.login-input {
  background: var(--input-bg, rgba(0,0,0,.04));
  border: 1.5px solid var(--border, rgba(0,0,0,.12));
  border-radius: 8px;
  color: var(--ink);
  font-size: 15px;
  padding: 10px 12px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s;
}
.login-input:focus { border-color: var(--accent); }
.login-input:disabled { opacity: 0.6; }

.login-error {
  font-size: 13px;
  color: var(--error, #c0392b);
  margin: 0;
  padding: 8px 12px;
  background: color-mix(in oklab, var(--error, #c0392b) 8%, transparent);
  border-radius: 6px;
  border: 1px solid color-mix(in oklab, var(--error, #c0392b) 20%, transparent);
}

.login-submit {
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: #000;
  font-size: 15px;
  font-weight: 600;
  padding: 12px;
  cursor: pointer;
  margin-top: 4px;
  transition: filter 0.12s;
  font-family: inherit;
}
.login-submit:hover:not(:disabled) { filter: brightness(1.08); }
.login-submit:disabled { opacity: 0.5; cursor: default; }

.login-hint {
  font-size: 12px;
  color: var(--ink-soft, #888);
  margin: 0;
}
/* In-field hint: left-aligned under the input */
.login-field .login-hint {
  text-align: left;
  font-size: 11px;
  margin-top: 2px;
}

.login-guest-link {
  display: block;
  text-align: center;
  font-size: 13px;
  color: var(--ink-soft, #888);
  margin-top: 12px;
  text-decoration: underline;
}

.login-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

/* ── AdminScreen ─────────────────────────────────────────────────────────── */
.admin-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, sans-serif;
}

.admin-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--paper);
  border-bottom: 1px solid color-mix(in oklab, var(--ink) 10%, transparent);
}
.admin-topbar__title {
  flex: 1;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.2px;
}
.admin-version {
  font-size: 11px;
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.admin-back {
  background: transparent;
  color: var(--ink-soft);
  font-size: 14px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
}
.admin-back:hover { background: color-mix(in oklab, var(--ink) 6%, transparent); }

.admin-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 920px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.admin-card {
  background: var(--paper);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.admin-card--denied {
  text-align: center;
  max-width: 360px;
  margin: 64px auto;
  padding: 32px;
}

.admin-section__title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 12px;
}

.admin-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 12px;
}

.admin-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 64px 0;
  color: var(--ink-soft);
}

.admin-error {
  color: var(--red);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}
.admin-stat {
  background: color-mix(in oklab, var(--ink) 5%, transparent);
  border-radius: 10px;
  padding: 12px 14px;
}
.admin-stat__value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.admin-stat__label {
  font-size: 11px;
  color: var(--ink-soft);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.admin-stat--ok .admin-stat__value   { color: var(--team-ns, #4a7c5a); }
.admin-stat--warn .admin-stat__value { color: var(--red); }

.admin-chart {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 12px;
  background: color-mix(in oklab, var(--ink) 4%, transparent);
  border-radius: 8px;
  padding: 8px;
  box-sizing: border-box;
}
.admin-chart__seg--ok   { fill: var(--team-ns, #4a7c5a); }
.admin-chart__seg--reg  { fill: var(--accent); }
.admin-chart__seg--fail { fill: var(--red); }
.admin-chart__axis      { stroke: color-mix(in oklab, var(--ink) 20%, transparent); stroke-width: 0.5; }
.admin-chart__label     { font-size: 9px; fill: var(--ink-soft); font-family: inherit; }

.admin-actions {
  display: flex;
  gap: 8px;
  margin: 12px 0;
  flex-wrap: wrap;
}

.admin-btn {
  background: color-mix(in oklab, var(--ink) 8%, transparent);
  border: 1px solid color-mix(in oklab, var(--ink) 18%, transparent);
  border-radius: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  cursor: pointer;
  transition: filter 0.1s;
}
.admin-btn:hover:not(:disabled) { background: color-mix(in oklab, var(--ink) 14%, transparent); }
.admin-btn:disabled { opacity: 0.5; cursor: default; }

.admin-btn--primary {
  background: var(--accent);
  color: #000;
  border-color: transparent;
}
.admin-btn--primary:hover:not(:disabled) { filter: brightness(1.1); background: var(--accent); }

.admin-btn--small { font-size: 11px; padding: 4px 10px; }

.admin-btn--danger {
  background: color-mix(in oklab, var(--red) 12%, transparent);
  border-color: color-mix(in oklab, var(--red) 35%, transparent);
  color: var(--red);
}
.admin-btn--danger:hover:not(:disabled) { background: color-mix(in oklab, var(--red) 22%, transparent); }

.admin-empty {
  color: var(--ink-soft);
  font-size: 13px;
  font-style: italic;
  margin: 8px 0 0;
}

.admin-invites {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}
.admin-invite {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: color-mix(in oklab, var(--ink) 4%, transparent);
}
.admin-invite--used { opacity: 0.55; }
.admin-invite__main {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}
.admin-invite__token {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--ink-soft);
}
.admin-invite__status {
  font-size: 12px;
  font-weight: 600;
}
.admin-invite__note {
  font-size: 11px;
  color: var(--ink-soft);
  font-style: italic;
}
.admin-invite__actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

/* ── Admin: Users × Reserved-room access ─────────────────────────────────── */
.admin-card__hint {
  font-size: 12px;
  color: var(--ink-soft);
  margin: 0 0 10px;
  line-height: 1.4;
}
.admin-card__hint code {
  background: color-mix(in oklab, var(--ink) 6%, transparent);
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 11px;
}
.admin-user-filter {
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 10px;
  border: 1px solid color-mix(in oklab, var(--ink) 12%, transparent);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}
.admin-users-wrap {
  overflow-x: auto;
  border: 1px solid color-mix(in oklab, var(--ink) 8%, transparent);
  border-radius: 8px;
}
.admin-users {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.admin-users th,
.admin-users td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid color-mix(in oklab, var(--ink) 5%, transparent);
}
.admin-users th {
  background: color-mix(in oklab, var(--ink) 4%, transparent);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}
.admin-users tbody tr:last-child td { border-bottom: none; }
.admin-users__user { min-width: 160px; }
.admin-users__display { font-weight: 600; display: block; }
.admin-users__handle { font-size: 11px; color: var(--ink-soft); }
.admin-users__room { width: 130px; }
.admin-users__cell { text-align: center; }
.admin-toggle {
  border: 1px solid color-mix(in oklab, var(--ink) 14%, transparent);
  background: var(--paper);
  color: var(--ink);
  padding: 6px 10px;
  border-radius: 6px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.admin-toggle:hover:not(:disabled) {
  background: color-mix(in oklab, var(--ink) 5%, transparent);
}
.admin-toggle--on {
  background: color-mix(in oklab, var(--accent) 15%, transparent);
  border-color: color-mix(in oklab, var(--accent) 40%, transparent);
  color: var(--accent);
}
.admin-toggle--on:hover:not(:disabled) {
  background: color-mix(in oklab, var(--red) 15%, transparent);
  border-color: color-mix(in oklab, var(--red) 40%, transparent);
  color: var(--red);
}
.admin-toggle--on:hover:not(:disabled)::after {
  content: " (×)";
}
.admin-toggle:disabled { opacity: 0.5; cursor: default; }
.admin-empty {
  padding: 16px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 13px;
  font-style: italic;
}

/* ── Replay screen + player — Sprint 7 Lane 3 ──────────────────────────
   List view shares the modal-style chrome with HistoryPanel (similar
   pull-out shape over the table). Detail view is a full-bleed
   reconstruction of the table from the replay timeline. */
.replay-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: "Inter", system-ui, sans-serif;
}
.replay-screen__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid color-mix(in oklab, var(--ink) 12%, transparent);
}
.replay-screen__back {
  background: transparent;
  border: none;
  font-size: 22px;
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
  color: var(--ink);
}
.replay-screen__title {
  flex: 1;
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}
.replay-screen__body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}
.replay-screen__loading,
.replay-screen__empty,
.replay-screen__error {
  padding: 24px 12px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 14px;
}
.replay-screen__error { color: var(--red, #c0392b); }
.replay-screen__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.replay-screen__row { display: flex; }
.replay-screen__row-btn {
  flex: 1;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 10px;
  background: var(--bg-soft, color-mix(in oklab, var(--ink) 4%, transparent));
  border: 1px solid color-mix(in oklab, var(--ink) 10%, transparent);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--ink);
}
.replay-screen__row-btn:hover {
  background: color-mix(in oklab, var(--ink) 6%, transparent);
}
.replay-screen__row-date { font-size: 12px; color: var(--ink-soft); white-space: nowrap; }
.replay-screen__row-seats { font-size: 13px; font-weight: 600; }
.replay-screen__row-meta {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 11px;
  color: var(--ink-soft);
}
.replay-screen__row-variant,
.replay-screen__row-engine,
.replay-screen__row-score {
  padding: 1px 6px;
  border-radius: 3px;
  background: color-mix(in oklab, var(--ink) 8%, transparent);
}
.replay-screen__row-chevron { color: var(--ink-soft); font-size: 14px; }

.replay-screen__pager {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid color-mix(in oklab, var(--ink) 12%, transparent);
}
.replay-screen__pager-btn {
  background: var(--bg-soft, color-mix(in oklab, var(--ink) 4%, transparent));
  border: 1px solid color-mix(in oklab, var(--ink) 12%, transparent);
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}
.replay-screen__pager-btn:disabled { opacity: 0.4; cursor: default; }
.replay-screen__pager-status {
  flex: 1;
  text-align: center;
  font-size: 12px;
  color: var(--ink-soft);
}

/* Replay player (detail view) */
.replay-player {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.replay-player__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid color-mix(in oklab, var(--ink) 12%, transparent);
}
.replay-player__back {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--ink);
  font: inherit;
  padding: 6px 8px;
}
.replay-player__title {
  flex: 1;
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}
.replay-player__toggle {
  background: var(--bg-soft, color-mix(in oklab, var(--ink) 5%, transparent));
  border: 1px solid color-mix(in oklab, var(--ink) 14%, transparent);
  border-radius: 6px;
  padding: 5px 10px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  color: var(--ink);
}
.replay-player__toggle--on {
  background: color-mix(in oklab, var(--accent) 18%, transparent);
  border-color: color-mix(in oklab, var(--accent) 40%, transparent);
  color: var(--accent);
}

.replay-player__engine-banner {
  background: color-mix(in oklab, var(--accent) 14%, transparent);
  color: var(--accent);
  padding: 6px 12px;
  font-size: 12px;
  text-align: center;
}

/* Sprint 12 Lane 4 — ELO badge strip below the replay header. */
.replay-player__elo-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 12px;
  border-bottom: 1px solid color-mix(in oklab, var(--ink) 10%, transparent);
  background: color-mix(in oklab, var(--ink) 3%, transparent);
}
.replay-player__elo-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  border: 1px solid color-mix(in oklab, var(--ink) 14%, transparent);
  background: var(--bg);
  white-space: nowrap;
}
.replay-player__elo-badge--up {
  border-color: color-mix(in oklab, #22c55e 40%, transparent);
  background: color-mix(in oklab, #22c55e 8%, var(--bg));
}
.replay-player__elo-badge--down {
  border-color: color-mix(in oklab, #ef4444 40%, transparent);
  background: color-mix(in oklab, #ef4444 8%, var(--bg));
}
.replay-player__elo-badge--flat {
  opacity: 0.7;
}
.replay-player__elo-badge-name {
  font-weight: 600;
  color: var(--ink);
}
.replay-player__elo-badge-arrow {
  font-size: 10px;
}
.replay-player__elo-badge--up .replay-player__elo-badge-arrow { color: #22c55e; }
.replay-player__elo-badge--down .replay-player__elo-badge-arrow { color: #ef4444; }
.replay-player__elo-badge--flat .replay-player__elo-badge-arrow { color: var(--ink-soft); }
.replay-player__elo-badge-label {
  color: var(--ink-soft);
}

.replay-player__stage {
  flex: 1;
  position: relative;
  overflow: hidden;
}
.replay-player__seats {
  position: absolute;
  inset: 12px;
  pointer-events: none;
}
.replay-player__seat {
  position: absolute;
  pointer-events: auto;
}
.replay-player__seat--south { bottom: 8px; left: 50%; transform: translateX(-50%); }
.replay-player__seat--north { top: 8px; left: 50%; transform: translateX(-50%); }
.replay-player__seat--west { top: 50%; left: 8px; transform: translateY(-50%); }
.replay-player__seat--east { top: 50%; right: 8px; transform: translateY(-50%); }

.replay-player__annotation-slot {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: auto;
  z-index: 5;
}

.replay-player__handover {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  background: color-mix(in oklab, var(--bg) 60%, transparent);
  backdrop-filter: blur(2px);
}
.replay-player__handover-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 20px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid color-mix(in oklab, var(--ink) 12%, transparent);
  min-width: 120px;
}
.replay-player__handover-label { font-size: 12px; color: var(--ink-soft); }
.replay-player__handover-outcome { font-weight: 700; font-size: 14px; }
.replay-player__handover-delta { font-size: 18px; font-weight: 700; color: var(--accent); }

.replay-player__controls {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-top: 1px solid color-mix(in oklab, var(--ink) 12%, transparent);
  flex-wrap: wrap;
}
.replay-player__btn {
  background: var(--bg-soft, color-mix(in oklab, var(--ink) 5%, transparent));
  border: 1px solid color-mix(in oklab, var(--ink) 14%, transparent);
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
}
.replay-player__btn:disabled { opacity: 0.4; cursor: default; }
.replay-player__scrubber {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 200px;
}
.replay-player__scrubber input[type="range"] { flex: 1; }
.replay-player__scrubber-label {
  font-size: 12px;
  color: var(--ink-soft);
  white-space: nowrap;
  min-width: 80px;
  text-align: right;
}

/* PIMC annotation overlay — green/amber/red badges per the spec. */
.pimc-overlay {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 14px;
  background: var(--bg);
  border: 1px solid color-mix(in oklab, var(--ink) 14%, transparent);
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  font-size: 12px;
}
.pimc-overlay__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  font-family: inherit;
}
.pimc-overlay__badge--ok          { background: #2d9d4f; }   /* green */
.pimc-overlay__badge--suboptimal  { background: #d97706; }   /* amber */
.pimc-overlay__badge--blunder     { background: #b91c1c; }   /* red */
.pimc-overlay__badge--pending     {
  background: color-mix(in oklab, var(--ink) 18%, transparent);
  color: var(--ink);
}
.pimc-overlay--ok          { border-color: color-mix(in oklab, #2d9d4f 40%, transparent); }
.pimc-overlay--suboptimal  { border-color: color-mix(in oklab, #d97706 40%, transparent); }
.pimc-overlay--blunder     { border-color: color-mix(in oklab, #b91c1c 40%, transparent); }
.pimc-overlay__rationale {
  max-width: 380px;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.3;
  /* Default behavior on desktop: rationale visible inline; the
     button's focus/blur toggles open on touch where hover doesn't
     exist. Set --pimc-rationale-default-visible:0 in a future theme
     to flip the default if it's too noisy. */
}
.pimc-overlay__rationale--pending {
  color: var(--ink-soft);
  font-style: italic;
}
@media (hover: none) {
  /* Touch devices: hide rationale by default; tapping the badge
     toggles --open to show it. */
  .pimc-overlay__rationale { display: none; }
  .pimc-overlay__rationale--open { display: inline; }
  .pimc-overlay__rationale--pending { display: inline; }
}

/* Sprint 13 — theme-picker modal CSS removed (component deleted in Lane C). */
/* Was ~110 lines of .theme-picker* rules; nothing in the live tree references them. */

/* ── Sprint 11 L2 — Achievement toast stack ─────────────────────────────── */

@keyframes achievement-toast-in {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.achievement-toast-stack {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(340px, calc(100vw - 32px));
  pointer-events: none;
}

.achievement-toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid color-mix(in oklab, var(--accent) 35%, transparent);
  box-shadow: 0 4px 20px rgba(0,0,0,0.22);
  animation: achievement-toast-in 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
  cursor: pointer;
  pointer-events: auto;
  position: relative;
}

.achievement-toast__icon {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.achievement-toast__body {
  flex: 1;
  min-width: 0;
}

.achievement-toast__label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 2px;
}

.achievement-toast__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}

.achievement-toast__desc {
  font-size: 12px;
  color: color-mix(in oklab, var(--ink) 70%, transparent);
  line-height: 1.4;
  margin-top: 2px;
}

.achievement-toast__dismiss {
  flex-shrink: 0;
  background: none;
  border: none;
  color: color-mix(in oklab, var(--ink) 45%, transparent);
  font-size: 14px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  line-height: 1;
  align-self: flex-start;
}
.achievement-toast__dismiss:hover {
  color: var(--ink);
  background: color-mix(in oklab, var(--ink) 8%, transparent);
}

@media (prefers-reduced-motion: reduce) {
  .achievement-toast { animation: none; }
}

/* ── Sprint 11 L2 — Achievement panel (profile grid) ───────────────────── */

.achievement-panel {
  padding: 16px 0;
}

.achievement-panel__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 0 16px;
}

.achievement-panel__title {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}

.achievement-panel__count {
  font-size: 13px;
  color: color-mix(in oklab, var(--ink) 55%, transparent);
  font-variant-numeric: tabular-nums;
}

.achievement-panel__loading,
.achievement-panel__error,
.achievement-panel__empty {
  padding: 16px;
  font-size: 14px;
  color: color-mix(in oklab, var(--ink) 65%, transparent);
  text-align: center;
}
.achievement-panel__error {
  color: var(--red, #c0392b);
}

/* Category filter chip row */
.achievement-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 12px;
}

.achievement-filter__chip {
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in oklab, var(--ink) 20%, transparent);
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.1s, border-color 0.1s, color 0.1s;
}
.achievement-filter__chip:hover:not(.achievement-filter__chip--active) {
  background: color-mix(in oklab, var(--ink) 6%, transparent);
}
.achievement-filter__chip--active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--ink);
  font-weight: 700;
}

/* Achievement grid */
.achievement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  padding: 0 16px;
}

.achievement-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 10px;
  border-radius: 10px;
  border: 1px solid color-mix(in oklab, var(--ink) 14%, transparent);
  background: var(--paper);
  color: var(--ink);
  text-align: center;
  cursor: default;
  transition: box-shadow 0.1s;
}

.achievement-tile:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.achievement-tile--unlocked {
  border-color: color-mix(in oklab, var(--accent) 40%, transparent);
  background: color-mix(in oklab, var(--accent) 6%, var(--paper));
  box-shadow: 0 1px 6px color-mix(in oklab, var(--accent) 15%, transparent);
}

.achievement-tile--locked {
  opacity: 0.5;
  filter: grayscale(60%);
}

.achievement-tile__icon {
  font-size: 30px;
  line-height: 1;
}

.achievement-tile__body {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.achievement-tile__title {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}

.achievement-tile__desc {
  font-size: 11px;
  color: color-mix(in oklab, var(--ink) 65%, transparent);
  line-height: 1.4;
}

.achievement-tile__date {
  font-size: 10px;
  color: var(--accent);
  font-weight: 600;
  margin-top: 2px;
}

/* ── Sprint 11 L2 — Daily challenge banner (lobby) ─────────────────────── */

.daily-challenge-banner {
  width: 100%;
  border-radius: 8px;
  border: 1px solid color-mix(in oklab, var(--accent) 30%, transparent);
  background: color-mix(in oklab, var(--accent) 8%, var(--paper));
  padding: 10px 14px;
  box-sizing: border-box;
}

.daily-challenge-banner--loading {
  opacity: 0.6;
}

.daily-challenge-banner__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink);
}

.daily-challenge-banner__label {
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.daily-challenge-banner__text {
  flex: 1;
  line-height: 1.4;
}

.daily-challenge-banner__date {
  font-size: 11px;
  color: color-mix(in oklab, var(--ink) 50%, transparent);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ── Sprint 12 Lane 2 — Leaderboard panel ───────────────────────────── */

.leaderboard-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1200;
}

.leaderboard-panel {
  position: fixed;
  inset: 0;
  z-index: 1201;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: "Inter", system-ui, sans-serif;
  overflow: hidden;
}

@media (min-width: 600px) {
  .leaderboard-backdrop { z-index: 1200; }
  .leaderboard-panel {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    inset: auto;
    width: min(640px, 95vw);
    max-height: min(700px, 92vh);
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
  }
}

.leaderboard-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid color-mix(in oklab, var(--ink) 10%, transparent);
  flex-shrink: 0;
}

.leaderboard-panel__title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin: 0;
}

.leaderboard-panel__close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: color-mix(in oklab, var(--ink) 8%, transparent);
  color: var(--ink);
  border: none;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  transition: background 0.1s;
}
.leaderboard-panel__close:hover {
  background: color-mix(in oklab, var(--ink) 14%, transparent);
}
.leaderboard-panel__close:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.leaderboard-panel__body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Your-rank pill */
.leaderboard__your-rank {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  background: color-mix(in oklab, var(--accent) 10%, var(--paper));
  border: 1px solid color-mix(in oklab, var(--accent) 35%, transparent);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
}

.leaderboard__your-rank__label {
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

.leaderboard__your-rank__rating {
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.leaderboard__your-rank__rank {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  background: color-mix(in oklab, var(--ink) 8%, transparent);
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}

.leaderboard__your-rank__meta {
  font-size: 12px;
  color: var(--ink-soft);
  margin-left: auto;
  white-space: nowrap;
}

/* Controls bar (provisional toggle) */
.leaderboard__controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.leaderboard__provisional-toggle {
  font-size: 12px;
  font-family: inherit;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in oklab, var(--ink) 20%, transparent);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
}
.leaderboard__provisional-toggle:hover {
  background: color-mix(in oklab, var(--ink) 6%, transparent);
  color: var(--ink);
}
.leaderboard__provisional-toggle--active {
  background: color-mix(in oklab, var(--accent) 15%, transparent);
  border-color: color-mix(in oklab, var(--accent) 50%, transparent);
  color: var(--accent);
}
.leaderboard__provisional-toggle:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Table */
.leaderboard__table {
  font-size: 13px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid color-mix(in oklab, var(--ink) 10%, transparent);
}

.leaderboard__row {
  display: grid;
  grid-template-columns: 36px 1fr 72px 56px 72px;
  align-items: center;
  padding: 8px 12px;
  gap: 4px;
  transition: background 0.08s;
}

.leaderboard__row + .leaderboard__row {
  border-top: 1px solid color-mix(in oklab, var(--ink) 6%, transparent);
}

.leaderboard__row--header {
  background: color-mix(in oklab, var(--ink) 5%, transparent);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--ink-soft);
  padding-top: 6px;
  padding-bottom: 6px;
}

.leaderboard__row:not(.leaderboard__row--header):hover {
  background: color-mix(in oklab, var(--ink) 4%, transparent);
}

.leaderboard__row--self {
  background: color-mix(in oklab, var(--accent) 8%, transparent);
  position: relative;
}
.leaderboard__row--self::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  border-radius: 2px 0 0 2px;
}

.leaderboard__cell {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leaderboard__cell--rank {
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
  font-size: 12px;
  text-align: right;
  padding-right: 8px;
}

.leaderboard__row--self .leaderboard__cell--rank {
  font-weight: 700;
  color: var(--accent);
}

.leaderboard__cell--username {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
}

.leaderboard__cell--rating {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: right;
}

.leaderboard__cell--games,
.leaderboard__cell--peak {
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
  text-align: right;
}

/* Provisional badge */
.leaderboard__provisional-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: color-mix(in oklab, var(--accent) 18%, transparent);
  border: 1px solid color-mix(in oklab, var(--accent) 45%, transparent);
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0;
  flex-shrink: 0;
  cursor: help;
}

/* Loading / error / empty states */
.leaderboard__loading,
.leaderboard__empty,
.leaderboard__error {
  text-align: center;
  padding: 24px 16px;
  color: var(--ink-soft);
  font-size: 14px;
}

.leaderboard__error {
  color: var(--red, #c0392b);
}

/* Lobby entry-point button */
.lobby__leaderboard-btn {
  width: 100%;
  padding: 10px 16px;
  border-radius: 10px;
  background: color-mix(in oklab, var(--ink) 5%, transparent);
  border: 1px solid color-mix(in oklab, var(--ink) 14%, transparent);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  font-family: "Inter", system-ui, sans-serif;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s;
}
.lobby__leaderboard-btn:hover {
  background: color-mix(in oklab, var(--ink) 10%, transparent);
}

/* Drawer entry-point link (inside AccountSection) */
.drawer-btn--leaderboard {
  /* inherits .drawer-btn styles from base.css / components.css */
}

/* ── Sprint 12 P5.7 — SeatMenu (tap-a-seat action menu) ───────────── */

.seat-menu {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 100;
  width: min(320px, 92vw);
  max-height: 80vh;
  overflow-y: auto;
  background: var(--paper);
  border: 1px solid color-mix(in oklab, var(--ink) 14%, transparent);
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.25);
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.seat-menu__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid color-mix(in oklab, var(--ink) 10%, transparent);
  padding-bottom: 8px;
  margin-bottom: 4px;
}
.seat-menu__title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.02em;
}
.seat-menu__close {
  background: transparent;
  border: 0;
  font-size: 16px;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
}
.seat-menu__close:hover { color: var(--ink); background: color-mix(in oklab, var(--ink) 8%, transparent); }

.seat-menu__actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.seat-menu__btn {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  background: color-mix(in oklab, var(--ink) 4%, transparent);
  border: 1px solid color-mix(in oklab, var(--ink) 12%, transparent);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: "Inter", system-ui, sans-serif;
  transition: background 0.1s, border-color 0.1s;
}
.seat-menu__btn:hover {
  background: color-mix(in oklab, var(--ink) 9%, transparent);
  border-color: color-mix(in oklab, var(--ink) 20%, transparent);
}
.seat-menu__btn--nudge {
  background: color-mix(in oklab, var(--accent) 18%, var(--paper));
  border-color: color-mix(in oklab, var(--accent) 40%, transparent);
}
.seat-menu__btn--danger {
  color: #b91c1c;
  border-color: color-mix(in oklab, #b91c1c 30%, transparent);
}
.seat-menu__btn--danger:hover {
  background: color-mix(in oklab, #b91c1c 10%, var(--paper));
}
.seat-menu__btn--submenu {
  font-weight: 600;
}
.seat-menu__group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.seat-menu__submenu {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px 0 4px 8px;
  border-left: 2px solid color-mix(in oklab, var(--ink) 14%, transparent);
}
.seat-menu__btn--sub {
  flex: 1 1 auto;
  min-width: 64px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}
.seat-menu__btn--active {
  background: color-mix(in oklab, var(--spade) 18%, var(--paper));
  border-color: var(--spade);
  color: var(--spade);
}

/* ── Sprint 12 PWA — install modal + drawer button ───────────────── */

.install-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 100;
  width: min(360px, 92vw);
  max-height: 80vh;
  overflow-y: auto;
  background: var(--paper);
  border: 1px solid color-mix(in oklab, var(--ink) 14%, transparent);
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.25);
  padding: 14px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.install-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid color-mix(in oklab, var(--ink) 10%, transparent);
  padding-bottom: 8px;
}
.install-modal__title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}
.install-modal__close {
  background: transparent;
  border: 0;
  font-size: 16px;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
}
.install-modal__close:hover { color: var(--ink); background: color-mix(in oklab, var(--ink) 8%, transparent); }
.install-modal__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
  color: var(--ink);
}
.install-modal__lead {
  margin: 0;
  color: var(--ink);
}
.install-modal__steps {
  margin: 0;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.install-modal__steps li { line-height: 1.45; }
.install-modal__icon {
  display: inline-flex;
  vertical-align: middle;
  margin: 0 2px;
  color: var(--accent);
}
.install-modal__note {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
  padding-top: 4px;
  border-top: 1px dashed color-mix(in oklab, var(--ink) 12%, transparent);
}

/* Drawer install button — same family as Leaderboard / Friends links. */
.drawer-btn--install {
  /* inherits drawer-btn / drawer-btn--admin-link */
}
