/**
 * Battle21 platform chrome — shared stylesheet.
 *
 * Pre-addendum polish pass (2026-04-20). Placeholder aesthetic before the
 * designer delivers (Stage 5). Clean dark theme; server-rendered; no JS
 * framework dependencies. data-* hooks are preserved — styling only.
 *
 * Conventions:
 *   .b21-*        — shared primitive classes (buttons, cards, banners, pills)
 *   .battle21-*   — legacy selectors from before this pass; kept for
 *                   integration-test compatibility, progressively removed
 *   CSS custom properties on :root — all colors reference variables so
 *   palette tuning is a one-file change (P-25 from the polish report).
 */

:root {
  /* Palette — softened 2026-04-20 per operator feedback: "less depressing,
   * less black." Moved from pure-black base to a warm slate blue so the
   * viewer feels like a real game lobby, not a debug console. */
  --bg-base:          #1a1f2e;
  --bg-raised:        #232a3d;
  --bg-card:          #2a3249;
  --bg-card-hover:    #323b55;
  --bg-input:         #1e2333;
  --border-subtle:    #384260;
  --border-strong:    #4a567a;

  --text-primary:     #e8ecf5;
  --text-secondary:   #a8b0c4;
  --text-muted:       #7d859b;
  --text-on-accent:   #ffffff;

  --accent-primary:   #6aa9ff;
  --accent-primary-hover: #8bbdff;
  --accent-success:   #4ade80;
  --accent-warning:   #fbbf24;
  --accent-danger:    #f87171;
  --accent-orange:    #fb923c;
  --accent-purple:    #a78bfa;

  --radius-sm: 3px;
  --radius-md: 6px;
  --radius-lg: 10px;

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;

  --shadow-card:  0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow-float: 0 6px 18px rgba(0, 0, 0, 0.35);

  --font-ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', Menlo, Consolas, monospace;
}

/* ─── Reset ──────────────────────────────────────────────────────────── */

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

body {
  font-family: var(--font-ui);
  background: radial-gradient(ellipse at top, #252d44 0%, var(--bg-base) 60%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.55;
  font-size: 16px;
}

a { color: var(--accent-primary); text-decoration: none; }
a:hover { color: var(--accent-primary-hover); text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 2px; border-radius: var(--radius-sm); }

button { font-family: inherit; }

/* Skip-to-content link for a11y (P-29) */
.b21-skip-link {
  position: absolute; top: -40px; left: 8px;
  background: var(--accent-primary); color: var(--text-on-accent);
  padding: 8px 16px; border-radius: var(--radius-md);
  z-index: 10000; font-weight: 600;
}
.b21-skip-link:focus { top: 8px; }

/* ─── Layout shell ───────────────────────────────────────────────────── */

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg);
}
.page-full {
  width: 100%;
  min-height: 100vh;
  padding: 0;
}

h1 { color: var(--text-on-accent); margin-bottom: var(--space-lg); font-size: 32px; font-weight: 700; letter-spacing: -0.01em; }
h2 { color: var(--text-on-accent); margin-bottom: var(--space-md); font-size: 22px; font-weight: 600; }
h3 { color: var(--text-on-accent); margin-bottom: var(--space-sm); font-size: 18px; font-weight: 600; }

/* ─── Header + nav (P-2) ─────────────────────────────────────────────── */

.b21-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 var(--space-lg);
  height: 60px;
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  position: sticky;
  top: 0;
  z-index: 100;
}
.b21-header__brand {
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.b21-header__nav {
  display: flex;
  gap: var(--space-md);
  flex: 1;
}
.b21-header__nav a {
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 500;
}
.b21-header__nav a:hover { color: var(--text-on-accent); background: var(--bg-card-hover); text-decoration: none; }
.b21-header__right { display: flex; align-items: center; gap: var(--space-md); }
.b21-user-chip {
  background: var(--bg-base);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  font-size: 14px;
  color: var(--text-primary);
}
.b21-user-chip strong { color: var(--accent-primary); }
.b21-wallet-chip {
  font-variant-numeric: tabular-nums;
  color: var(--accent-success);
  font-size: 14px;
  font-weight: 600;
  background: rgba(34,197,94,0.08);
  border: 1px solid rgba(34,197,94,0.25);
  padding: 4px 10px;
  border-radius: var(--radius-md);
}

/* ─── Breadcrumbs (P-19) ─────────────────────────────────────────────── */

.b21-breadcrumbs {
  padding: var(--space-sm) var(--space-lg);
  color: var(--text-muted);
  font-size: 13px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-base);
}
.b21-breadcrumbs a { color: var(--text-secondary); }
.b21-breadcrumbs a:hover { color: var(--accent-primary); text-decoration: none; }
.b21-breadcrumbs .sep { margin: 0 6px; color: var(--text-muted); }

/* ─── Buttons (P-20) ─────────────────────────────────────────────────── */

.btn, .b21-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease, transform 0.05s ease;
  text-decoration: none;
  font-family: inherit;
  line-height: 1.2;
}
.btn:active:not(:disabled), .b21-btn:active:not(:disabled) { transform: scale(0.97); }
.btn:focus-visible, .b21-btn:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}
.btn:disabled, .b21-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary, .b21-btn--primary {
  background: linear-gradient(135deg, var(--accent-primary) 0%, #4f8edb 100%);
  color: #0b1528;
  box-shadow: 0 2px 8px rgba(106, 169, 255, 0.25);
}
.btn-primary:hover:not(:disabled), .b21-btn--primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--accent-primary-hover) 0%, #6aa9ff 100%);
  box-shadow: 0 4px 12px rgba(106, 169, 255, 0.4);
}

.btn-secondary, .b21-btn--secondary {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text-primary);
}
.btn-secondary:hover:not(:disabled), .b21-btn--secondary:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: var(--text-secondary);
}

.btn-danger, .b21-btn--danger {
  background: var(--accent-danger);
  color: var(--text-on-accent);
}
.btn-danger:hover:not(:disabled), .b21-btn--danger:hover:not(:disabled) {
  background: #c0392b;
}

.btn-success, .b21-btn--success {
  background: linear-gradient(135deg, var(--accent-success) 0%, #3aa864 100%);
  color: #052012;
  box-shadow: 0 2px 8px rgba(74, 222, 128, 0.25);
}
.btn-success:hover:not(:disabled), .b21-btn--success:hover:not(:disabled) {
  background: linear-gradient(135deg, #6ee89d 0%, var(--accent-success) 100%);
  box-shadow: 0 4px 12px rgba(74, 222, 128, 0.35);
}

/* ─── Cards (generic) ────────────────────────────────────────────────── */

.b21-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-card);
}

/* ─── Claim-state pill (P-4) ─────────────────────────────────────────── */

.b21-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.b21-pill--signin   { background: #475569; color: #f1f5f9; }
.b21-pill--seated   { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); color: #eff6ff; }
.b21-pill--atcap    { background: #9a3412; color: #fed7aa; }
.b21-pill--wshort   { background: #a16207; color: #fef3c7; }
.b21-pill--claim    { background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%); color: #f0fdf4; box-shadow: 0 0 12px rgba(74, 222, 128, 0.3); }

/* ─── Lobby card grid (P-3) ──────────────────────────────────────────── */

.b21-lobby-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}
.b21-lobby-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
  box-shadow: var(--shadow-card);
}
.b21-lobby-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}
.b21-lobby-card__title {
  color: var(--text-on-accent);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: var(--space-md);
  letter-spacing: -0.005em;
}
.b21-lobby-card__stats {
  display: flex; gap: var(--space-sm); flex-wrap: wrap;
  margin-bottom: var(--space-md);
  font-size: 14px;
  color: var(--text-secondary);
}
.b21-lobby-card__stat {
  background: var(--bg-base);
  padding: 4px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  font-weight: 500;
}
.b21-lobby-card__seats {
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
  padding: var(--space-sm) 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}
.b21-lobby-card__seats-count {
  font-size: 32px;
  font-weight: 800;
  color: var(--accent-primary);
  margin-right: 6px;
  line-height: 1;
}
.b21-lobby-card__footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-md);
}

/* ─── Empty state (P-5) ──────────────────────────────────────────────── */

.b21-empty-state {
  text-align: center;
  padding: var(--space-xl) var(--space-lg);
  color: var(--text-secondary);
}
.b21-empty-state__icon { font-size: 48px; margin-bottom: var(--space-md); opacity: 0.5; }
.b21-empty-state__title { color: var(--text-primary); font-size: 18px; margin-bottom: var(--space-sm); }
.b21-empty-state__body { font-size: 14px; margin-bottom: var(--space-md); }
.b21-empty-state__actions { display: flex; gap: var(--space-sm); justify-content: center; }

/* ─── Skeleton loader (P-17) ─────────────────────────────────────────── */

.b21-skeleton {
  background: linear-gradient(90deg, var(--bg-card) 0%, var(--bg-card-hover) 50%, var(--bg-card) 100%);
  background-size: 200% 100%;
  animation: b21-skeleton-shimmer 1.6s ease-in-out infinite;
  border-radius: var(--radius-md);
  height: 80px;
}
@keyframes b21-skeleton-shimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* ─── Table-detail seat tiles (P-6) ──────────────────────────────────── */

.b21-seat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  margin-top: var(--space-md);
}
.b21-seat-tile {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  min-height: 100px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.b21-seat-tile--mine { border-color: var(--accent-primary); box-shadow: 0 0 0 1px var(--accent-primary); }
.b21-seat-tile__num { color: var(--text-secondary); font-size: 12px; font-weight: 600; letter-spacing: 0.1em; }
.b21-seat-tile__name { color: var(--text-on-accent); font-size: 15px; font-weight: 600; }
.b21-seat-tile__phase { color: var(--text-secondary); font-size: 12px; }
.b21-seat-tile__icons { display: flex; gap: 4px; font-size: 11px; color: var(--text-muted); margin-top: auto; }
.b21-seat-tile__you {
  position: absolute; top: 4px; right: 4px;
  background: var(--accent-primary); color: #0a0a0a;
  padding: 1px 6px; border-radius: var(--radius-sm);
  font-size: 10px; font-weight: 700;
}
.b21-seat-tile { position: relative; }

/* ─── Banners (P-26) ─────────────────────────────────────────────────── */

.b21-banner {
  position: fixed;
  z-index: 10001;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-family: var(--font-ui);
  font-size: 14px;
  min-width: 320px;
  text-align: center;
  box-shadow: var(--shadow-float);
}
.b21-banner--warning {
  background: var(--bg-card);
  color: #fde68a;
  border: 1px solid var(--accent-warning);
}
.b21-banner--danger {
  background: var(--bg-card);
  color: #fef3c7;
  border: 1px solid var(--accent-orange);
}
.b21-banner--topup {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--accent-warning);
  min-width: 360px;
  padding: 12px 18px;
}
.b21-banner__actions { display: flex; gap: 10px; justify-content: center; margin-top: 8px; }
.b21-banner__meta { opacity: 0.55; font-size: 11px; margin-top: 8px; }

.b21-toast {
  position: fixed;
  z-index: 10002;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  box-shadow: var(--shadow-float);
  opacity: 1;
  transition: opacity 0.4s ease-out;
}
.b21-toast--success {
  background: #14532d;
  color: #dcfce7;
  border: 1px solid var(--accent-success);
}

/* ─── Forms (P-8, P-21) ──────────────────────────────────────────────── */

.b21-auth-card {
  max-width: 420px;
  margin: 48px auto;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-card);
}
.b21-form-row { margin-bottom: var(--space-md); }
.b21-form-row label { display: block; margin-bottom: 4px; color: var(--text-secondary); font-size: 13px; font-weight: 600; }
.b21-form-row input[type="text"],
.b21-form-row input[type="email"],
.b21-form-row input[type="password"] {
  width: 100%;
  padding: 8px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-on-accent);
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.12s ease;
}
.b21-form-row input:focus {
  outline: none;
  border-color: var(--accent-primary);
}
.b21-form-row--error input { border-color: var(--accent-danger); }
.b21-form-error { color: #fca5a5; font-size: 12px; margin-top: 4px; }

.b21-checkbox-row { display: flex; align-items: flex-start; gap: 8px; margin-bottom: var(--space-md); }
.b21-checkbox-row input { margin-top: 3px; }
.b21-checkbox-row label { color: var(--text-secondary); font-size: 13px; }

/* ─── Wallet history typography (P-9) ────────────────────────────────── */

.b21-wallet-table { width: 100%; border-collapse: collapse; }
.b21-wallet-table th,
.b21-wallet-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
  font-size: 14px;
}
.b21-wallet-table th { color: var(--text-secondary); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
.b21-wallet-table td.amt {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}
.b21-wallet-table td.amt--credit { color: var(--accent-success); }
.b21-wallet-table td.amt--debit { color: var(--text-muted); }

/* ─── Error / recovery (P-7, P-18) ───────────────────────────────────── */

.b21-error-card {
  max-width: 560px;
  margin: 64px auto;
  background: var(--bg-card);
  border: 1px solid var(--accent-orange);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
  box-shadow: var(--shadow-card);
}
.b21-error-card__icon { font-size: 48px; margin-bottom: var(--space-md); }
.b21-error-card__title { color: var(--text-on-accent); font-size: 20px; margin-bottom: var(--space-sm); }
.b21-error-card__body { color: var(--text-secondary); margin-bottom: var(--space-md); font-size: 14px; }
.b21-error-card__actions { display: flex; gap: var(--space-sm); justify-content: center; }

/* ─── Responsive breakpoints (P-15) ──────────────────────────────────── */

@media (max-width: 1024px) {
  .b21-lobby-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .b21-lobby-grid { grid-template-columns: 1fr; }
  .b21-seat-grid { grid-template-columns: repeat(2, 1fr); }
  .b21-header { padding: 0 var(--space-md); gap: var(--space-sm); }
  .b21-header__nav { gap: var(--space-sm); }
  .b21-user-chip { font-size: 12px; padding: 2px 6px; }
  .page { padding: var(--space-md); }
}

/* ─────────────────────────────────────────────────────────────────────────
   Rev 4 (2026-04-26, Bug #6.5): instant-feedback control standard.
   Native CSS :active gives the press cue within one frame — no React /
   DOM-handler roundtrip needed. data-pending is set by the addendum
   surface controllers when an async action is in flight.

   Applied as opt-in via .b21-instant-control AND blanket-applied to
   buttons inside the addendum root and the platform chrome buttons so
   the addendum's many DOM-rendered buttons get press feedback without
   needing every createElement('button') site to add the class.
   ───────────────────────────────────────────────────────────────────────── */
.b21-instant-control,
#addendum-root button,
#addendum-root [role="button"],
.b21-btn,
.b21-page button {
  transition: transform 80ms ease, filter 80ms ease, opacity 80ms ease;
}
.b21-instant-control:active,
#addendum-root button:active,
#addendum-root [role="button"]:active,
.b21-btn:active,
.b21-page button:active {
  transform: translateY(1px) scale(0.98);
  filter: brightness(1.15);
}
.b21-instant-control[data-pending="true"],
#addendum-root button[data-pending="true"],
.b21-btn[data-pending="true"] {
  opacity: 0.75;
}
.b21-instant-control:disabled,
.b21-instant-control[aria-disabled="true"],
#addendum-root button:disabled,
.b21-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ─────────────────────────────────────────────────────────────────────
 * Rev 6 visual-design pass (B21_VISUAL_DESIGN_REPORT §3) — addendum
 * modal class system. Replaces hand-typed inline `style.cssText` in
 * renderAddendum.ts with shared tokens so modals match the rest of
 * the platform chrome (palette, spacing, focus rings).
 * ─────────────────────────────────────────────────────────────────── */

.b21-modal-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(8, 12, 22, 0.62);
  pointer-events: auto;
  /* Fade in over 120ms so the overlay lands smoothly behind the modal */
  animation: b21-modal-overlay-in 120ms ease-out;
}
@keyframes b21-modal-overlay-in {
  from { background: rgba(8, 12, 22, 0); }
  to   { background: rgba(8, 12, 22, 0.62); }
}

.b21-modal {
  position: relative;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float);
  width: min(520px, 92vw);
  padding: var(--space-lg) var(--space-xl);
  pointer-events: auto;
  animation: b21-modal-in 180ms ease-out;
  overflow: hidden;
}
.b21-modal--narrow { width: min(440px, 92vw); }
@keyframes b21-modal-in {
  from { transform: translateY(8px) scale(0.98); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

.b21-modal__progress {
  position: absolute; top: 0; left: 0;
  height: 4px;
  background: currentColor;
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  transition: width 200ms linear, background-color 200ms ease;
}
.b21-modal__progress--ok     { color: var(--accent-success); }
.b21-modal__progress--warn   { color: var(--accent-warning); }
.b21-modal__progress--danger { color: var(--accent-danger); }

.b21-modal__header {
  display: flex; align-items: center; gap: var(--space-md);
  margin: 4px 0 var(--space-sm);
}
.b21-modal__icon {
  font-size: 26px; line-height: 1;
  flex-shrink: 0;
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(106, 169, 255, 0.10);
  color: var(--accent-primary);
}
.b21-modal__title-block { display: flex; flex-direction: column; gap: 2px; }
.b21-modal__title {
  font-size: 22px; font-weight: 700;
  color: var(--text-on-accent);
  margin: 0; letter-spacing: -0.01em;
}
.b21-modal__subtitle {
  font-size: 13px; color: var(--text-secondary);
  margin: 0;
}

.b21-modal__timer {
  font-family: var(--font-mono);
  font-size: 30px; font-weight: 800; line-height: 1;
  margin: var(--space-md) 0;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.b21-modal__timer--ok     { color: var(--accent-success); }
.b21-modal__timer--warn   { color: var(--accent-warning); }
.b21-modal__timer--danger { color: var(--accent-danger); }

.b21-modal__stats {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  margin: var(--space-md) 0;
  padding: var(--space-md);
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}
.b21-modal__stat-label {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-secondary); margin-bottom: 4px;
}
.b21-modal__stat-value {
  font-size: 24px; font-weight: 700; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.b21-modal__stat-value--need    { color: var(--accent-warning); }
.b21-modal__stat-value--have    { color: var(--accent-success); }
.b21-modal__stat-value--neutral { color: var(--text-on-accent); }
.b21-modal__stat-value--danger  { color: var(--accent-danger); }

.b21-modal__row {
  display: flex; align-items: center; gap: var(--space-sm);
  margin: var(--space-sm) 0;
  font-size: 13px;
  color: var(--text-secondary);
}
.b21-modal__row--checkbox {
  padding: var(--space-sm) 0;
  cursor: pointer;
}
.b21-modal__row--checkbox input[type="checkbox"] {
  accent-color: var(--accent-primary);
  width: 16px; height: 16px;
  margin: 0; flex-shrink: 0;
}
.b21-modal__hint {
  font-size: 12px; color: var(--text-muted);
  font-style: italic;
  margin-top: 2px;
}

.b21-modal__footnote {
  font-size: 12px; color: var(--text-muted);
  margin: 6px 0 var(--space-md);
  line-height: 1.4;
}

.b21-modal__short-warn {
  margin: var(--space-md) 0;
  padding: var(--space-md);
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.30);
  border-radius: var(--radius-md);
}
.b21-modal__short-warn-title {
  color: var(--accent-danger);
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 14px;
}
.b21-modal__short-warn-body {
  font-size: 13px;
  color: var(--text-secondary);
}

.b21-modal__actions {
  display: flex; gap: var(--space-sm);
  margin-top: var(--space-md);
}
.b21-modal__actions--column {
  flex-direction: column;
}
.b21-modal__btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 18px;
  font-size: 14px; font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: filter 120ms ease, transform 120ms ease, background 120ms ease;
  font-family: inherit;
}
.b21-modal__btn:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}
.b21-modal__btn:active { transform: translateY(1px); }
.b21-modal__btn--primary {
  flex: 1;
  background: linear-gradient(145deg, #4ade80, #16a34a);
  color: #0a1f0e;
  border-color: rgba(255, 255, 255, 0.15);
}
.b21-modal__btn--primary:hover { filter: brightness(1.08); }
.b21-modal__btn--secondary {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-subtle);
}
.b21-modal__btn--secondary:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
}
.b21-modal__btn--danger {
  background: transparent;
  color: var(--accent-danger);
  border-color: rgba(248, 113, 113, 0.40);
}
.b21-modal__btn--danger:hover {
  background: rgba(248, 113, 113, 0.08);
}
.b21-modal__btn--full { flex: 1 1 auto; width: 100%; }

/* Hand History panel + minicard polish (Visual Report §4, Rev 6
 * hot-fix 2026-04-27 sized up per operator feedback to match the
 * reference screenshot — larger, prominent rank + suit, soft shadow). */
.b21-mini-card {
  display: inline-flex; align-items: center; justify-content: center;
  flex-direction: column;
  width: 38px; height: 52px;
  background: #f6f6f6; color: #1a1a1a;
  border: 1px solid #cfcfcf;
  border-radius: 5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  flex-shrink: 0;
  padding: 4px 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.05);
}
.b21-mini-card--red { color: #c0392b; }
.b21-mini-card--back {
  background: linear-gradient(135deg, #2a3249 0%, #1a1f2e 100%);
  color: var(--accent-primary);
  border-color: var(--border-subtle);
  font-size: 14px;
}
.b21-mini-card__rank { font-size: 18px; letter-spacing: -0.02em; }
.b21-mini-card__suit { font-size: 14px; margin-top: 3px; }
[data-b21-card-row] { display: flex !important; gap: 4px !important; }

.b21-hh-tab {
  font-weight: 600; padding: 8px 14px;
  color: var(--text-secondary); cursor: pointer;
  border-bottom: 2px solid transparent;
  background: none; border-left: none; border-right: none; border-top: none;
  font-family: inherit; font-size: 14px;
  transition: color 120ms ease, border-color 120ms ease;
}
.b21-hh-tab:hover { color: var(--text-primary); }
.b21-hh-tab[aria-selected="true"] {
  color: var(--text-on-accent);
  border-bottom-color: var(--accent-warning);
}

.b21-hh-row {
  cursor: pointer;
  transition: background 120ms ease;
}
.b21-hh-row:hover {
  background: rgba(106, 169, 255, 0.06);
}

/* Lobby polish (Visual Report §6). */
.b21-lobby-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin: -8px 0 var(--space-lg);
}

.b21-lobby-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(106, 169, 255, 0.15), var(--shadow-card);
}

/* Wallet history tile-up (Visual Report §8). */
.b21-wallet-summary {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin: 0 0 var(--space-lg);
}
.b21-wallet-summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-md);
}
.b21-wallet-summary-card__label {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.b21-wallet-summary-card__value {
  font-size: 24px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-on-accent);
  line-height: 1;
}
.b21-wallet-summary-card__value--success { color: var(--accent-success); }
.b21-wallet-summary-card__value--warning { color: var(--accent-warning); }
@media (max-width: 720px) {
  .b21-wallet-summary { grid-template-columns: 1fr; }
}

.b21-wallet-row[data-category="buy_in"]    { box-shadow: inset 3px 0 0 var(--accent-primary); }
.b21-wallet-row[data-category="cashout_return"]
                                            { box-shadow: inset 3px 0 0 var(--accent-success); }
.b21-wallet-row[data-category="free_chip"] { box-shadow: inset 3px 0 0 var(--accent-warning); }
.b21-wallet-row[data-category="settlement"] { box-shadow: inset 3px 0 0 var(--text-secondary); }

/* Player Card popover polish (Visual Report §5). */
.b21-player-card {
  width: min(360px, 92vw);
}
.b21-player-card__avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; color: var(--accent-primary);
  flex-shrink: 0;
}
.b21-player-card__close {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: transparent; border: 1px solid transparent;
  color: var(--text-secondary); cursor: pointer;
  font-size: 16px; line-height: 1;
}
.b21-player-card__close:hover {
  background: var(--bg-base);
  color: var(--text-primary);
}

/* In-table chrome links (Visual Report §9). */
.b21-table-chrome-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  font-size: 13px; font-weight: 600;
  color: var(--text-secondary);
  background: rgba(26, 31, 46, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: color 120ms ease, border-color 120ms ease;
}
.b21-table-chrome-link:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
  text-decoration: none;
}

/* Per-mode accent theming hooks (Visual Report §11.3). The page-level
 * data attribute on body or container element opt-in scopes the
 * accent without reflowing the rest of the palette. */
[data-table-mode="cash_6max"] { --accent-primary: #6aa9ff; }
[data-table-mode="hu"]        { --accent-primary: #f87171; }
[data-table-mode="cash_9max"] { --accent-primary: #4ade80; }

/* Recent activity ticker (Visual Report §11.4). */
.b21-ticker {
  display: flex; align-items: center; gap: var(--space-sm);
  padding: 6px var(--space-md);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
  overflow: hidden;
  font-size: 13px; color: var(--text-secondary);
  white-space: nowrap;
}
.b21-ticker__label {
  font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.06em;
  font-size: 11px;
}
.b21-ticker__items {
  display: inline-block;
  animation: b21-ticker-scroll 35s linear infinite;
}
@keyframes b21-ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* Hand History loading shimmer (Visual Report §11.6) — already a
 * platform pattern via .b21-skeleton, this is a wrap with row sizing. */
.b21-hh-skeleton-row {
  height: 56px; margin: 6px 0;
  background: linear-gradient(90deg, var(--bg-base) 0%, var(--bg-card) 50%, var(--bg-base) 100%);
  background-size: 200% 100%;
  animation: b21-shimmer 1.4s linear infinite;
  border-radius: var(--radius-sm);
}
@keyframes b21-shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ── B21_PLAYER_CARD_RESULTS_RESCUE — greenlit real-data Player Card design, ported to the LIVE table
   card. Source: Research/player-card-preview/player-card-preview.css (mirrors Battle21_Home_Shell →
   Player profile). Scoped under .b21-player-card so its generic class names (.cell/.grid/.badge) can't
   collide with other surfaces. The live card is now a CENTERED profile-card, not a thin right drawer. */
.b21-player-card{
  --pc-surface2:#1C2230; --pc-surface3:#222A3A; --pc-border:#2A3142; --pc-border2:#3A4258;
  --pc-muted:#8A93A6; --pc-dim:#808CA6; --pc-text:#E5E9F0; --pc-gold:#C8A56C;
  --pc-gold-soft:rgba(200,165,108,0.12); --pc-pos:#4ADE80; --pc-neg:#F87171; --pc-r:8px; --pc-r2:12px;
  --pc-shadow:0 1px 0 rgba(255,255,255,0.04) inset, 0 8px 24px rgba(0,0,0,0.35);
  position:absolute; inset:0; display:flex; align-items:flex-start; justify-content:center;
  padding:36px 16px; overflow-y:auto; background:rgba(3,7,18,0.55); pointer-events:auto;
}
.b21-player-card .profile-card{position:relative;background:var(--pc-surface2);border:1px solid var(--pc-border);
  border-radius:var(--pc-r2);padding:20px;max-width:480px;width:100%;box-shadow:var(--pc-shadow);color:var(--pc-text);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif}
.b21-player-card .profile-head{display:flex;gap:14px;align-items:flex-start;margin-bottom:14px}
.b21-player-card .profile-head .av{width:56px;height:56px;border-radius:50%;background:linear-gradient(135deg,#5a4a2a,#3a4258);
  color:var(--pc-gold);font-size:18px;font-weight:700;display:flex;align-items:center;justify-content:center;
  border:1px solid var(--pc-border2);flex:0 0 auto}
.b21-player-card .profile-head .who{flex:1 1 auto;min-width:0}
.b21-player-card .profile-head .nm{font-size:18px;font-weight:700}
.b21-player-card .profile-head .ms{font-size:14px;color:var(--pc-muted)}
.b21-player-card .profile-head .badges{display:flex;gap:6px;margin-top:6px;flex-wrap:wrap}
.b21-player-card .badge{font-size:10px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;
  padding:3px 7px;border-radius:5px;border:1px solid var(--pc-border2);color:var(--pc-muted);background:var(--pc-surface3)}
.b21-player-card .badge.role{color:var(--pc-gold);border-color:#5a4a2a;background:var(--pc-gold-soft)}
.b21-player-card .pc-vol{font-size:13px;color:var(--pc-muted);margin-top:2px}
.b21-player-card .pc-vol b{color:var(--pc-text);font-weight:700}
.b21-player-card .this-table{padding:8px 12px;background:var(--pc-gold-soft);border:1px solid #5a4a2a;border-radius:var(--pc-r);
  font-size:13px;color:var(--pc-gold);font-weight:600;display:flex;justify-content:space-between;margin-top:10px;align-items:center}
.b21-player-card .this-table.muted{background:var(--pc-surface3);border-color:var(--pc-border);color:var(--pc-muted)}
.b21-player-card .this-table .tt-hands{font-size:11px;opacity:.8;font-weight:500;margin-left:6px}
.b21-player-card .stat-block{margin-top:16px}
.b21-player-card .stat-block .lbl{font-size:13px;color:var(--pc-muted);text-transform:uppercase;letter-spacing:.06em;
  font-weight:600;margin-bottom:8px;display:flex;justify-content:space-between}
.b21-player-card .grid{display:grid;gap:8px}
.b21-player-card .row2{grid-template-columns:repeat(2,1fr)}
.b21-player-card .row3{grid-template-columns:repeat(3,1fr)}
.b21-player-card .cell{background:var(--pc-surface3);border:1px solid var(--pc-border);border-radius:6px;padding:8px 10px}
.b21-player-card .cell .v{font-size:15px;font-weight:700;font-variant-numeric:tabular-nums}
.b21-player-card .cell .v.pos{color:var(--pc-pos)} .b21-player-card .cell .v.neg{color:var(--pc-neg)}
.b21-player-card .cell .l{font-size:12px;color:var(--pc-muted);text-transform:uppercase;letter-spacing:.06em;margin-top:2px}
.b21-player-card .recent-hands{display:grid;gap:6px}
.b21-player-card .hand-row{display:grid;grid-template-columns:62px 44px 1fr 56px 64px;gap:10px;padding:8px 12px;
  background:var(--pc-surface2);border:1px solid var(--pc-border);border-radius:var(--pc-r);align-items:center;font-size:13px}
.b21-player-card .hand-row .when{color:var(--pc-dim);font-size:13px}
.b21-player-card .hand-row .role{font-size:11px;font-weight:700;letter-spacing:.06em;color:var(--pc-muted)}
.b21-player-card .hand-row .role.dealer{color:var(--pc-gold)}
.b21-player-card .hand-row .cards{display:flex;align-items:center}
.b21-player-card .hand-row .out{font-size:10px;font-weight:700;letter-spacing:.05em;color:var(--pc-muted);
  border:1px solid var(--pc-border2);border-radius:4px;padding:1px 5px;justify-self:start}
.b21-player-card .hand-row .res{font-weight:700;text-align:right;font-variant-numeric:tabular-nums}
.b21-player-card .hand-row .res.pos{color:var(--pc-pos)} .b21-player-card .hand-row .res.neg{color:var(--pc-neg)}
.b21-player-card .card-mini{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;
  width:34px;height:46px;background:#fafafa;color:#1b1b1f;border-radius:5px;font-weight:800;padding:2px;margin-right:4px;
  font-family:"Cambria","Hoefler Text","Times New Roman",Georgia,serif;box-shadow:0 1px 2px rgba(0,0,0,.30);border:1px solid #c0c0c0;gap:0}
.b21-player-card .card-mini.red{color:#c92a2a}
.b21-player-card .card-mini .rank{font-size:22px;font-weight:800;line-height:1;letter-spacing:-.04em}
.b21-player-card .card-mini .pip{font-size:15px;font-weight:600;line-height:1;margin-top:1px;opacity:.9}
.b21-player-card .privacy-note{font-size:11px;color:var(--pc-dim);margin-top:10px;font-style:italic}
.b21-player-card__close{position:absolute;top:12px;right:12px;background:none;border:none;color:var(--pc-muted);
  font-size:22px;line-height:1;cursor:pointer;padding:2px 6px;border-radius:6px;z-index:1}
.b21-player-card__close:hover{background:var(--pc-surface3);color:var(--pc-text)}
.b21-player-card .pc-status{margin-top:14px;padding:12px;text-align:center;opacity:.6;font-size:13px}
