/* ════════════════════════════════════════════════════
   BarTrivia — Shared Design Tokens
   ════════════════════════════════════════════════════ */
:root {
  --bg: #080b14;
  --surface: #0f1623;
  --surface2: #172030;
  --border: #1e2d42;
  --gold: #f0c040;
  --amber: #f07020;
  --green: #30cc70;
  --red: #ee3355;
  --blue: #4080ff;
  /* Lighter tinted variants used for inline status text. The base
   * colors above work as accents/fills; for body-text usage where a
   * saturated brand color is too loud (error rows, success
   * confirmations, top-banner warnings) use these instead. Each was an
   * ad-hoc hex sprinkled through inline styles before — now the palette
   * lives in one place. */
  --success-text: #c3f1d4;
  --danger-text: #ffb5b5;
  --warning-text: #ffd54a;
  --text: #e8eef8;
  /* --text2 is the body-size secondary text color (~5.6:1 on --surface,
     clears WCAG AA at any size). --muted bumped from the legacy
     #5a7090 (3.2:1, fails AA-body but passed AA-large by a hair) to
     #7d92b2 (~5.3:1) so every existing var(--muted) usage clears AA
     for normal body text without needing a per-rule audit. Visually
     stays in the same blue-gray family — slightly more readable but
     still semantically "less important than --text". */
  --text2: #9aa9c0;
  --muted: #7d92b2;
}

/* ── Accessibility: skip link + global focus ring ── */
/* Visually hidden by default; only revealed for keyboard users
   (focus-visible), so mouse clicks never surface it. */
.skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  z-index: 10000;
}
.skip-link:focus-visible {
  position: fixed;
  top: 8px;
  left: 8px;
  width: auto;
  height: auto;
  padding: 10px 16px;
  margin: 0;
  overflow: visible;
  clip: auto;
  background: var(--gold);
  color: #000;
  border-radius: 6px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  text-decoration: none;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

*:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 2px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Powered by Trivia Fun (Starter plan badge) ── */
.powered-by {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 500;
  pointer-events: none;
  z-index: 50;
  font-family: 'DM Sans', sans-serif;
  opacity: 0.7;
  white-space: nowrap;
}
.powered-by.hidden { display: none; }
.powered-by .pb-brand {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 0.9rem;
  letter-spacing: 2px;
  background: linear-gradient(135deg, var(--gold), var(--amber));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-left: 4px;
}

/* ── Password strength meter ─────────────────────────────────────────── */
.pw-meter { display:flex; flex-direction:column; gap:4px; margin-top:-2px; }
.pw-meter-bars { display:flex; gap:4px; height:6px; }
.pw-meter-seg { flex:1; background:var(--surface2); border-radius:3px; transition:background 0.2s ease; }
.pw-meter[data-score="1"] .pw-meter-seg.active { background:#e74c3c; }
.pw-meter[data-score="2"] .pw-meter-seg.active { background:#e67e22; }
.pw-meter[data-score="3"] .pw-meter-seg.active { background:#f1c40f; }
.pw-meter[data-score="4"] .pw-meter-seg.active { background:#2ecc71; }
.pw-meter-label { font-size:0.75rem; color:var(--muted); letter-spacing:0.5px; }

/* ── Login/Register tab toggle ───────────────────────────────────────── */
.auth-form-tabs {
  display:flex; gap:4px; background:var(--surface2); border-radius:10px;
  padding:3px; margin-bottom:8px;
}
.auth-tab {
  flex:1; background:transparent; border:none; padding:8px 12px; border-radius:8px;
  color:var(--muted); font-weight:700; font-size:0.9rem; cursor:pointer;
  font-family:inherit; transition:all 0.15s; touch-action:manipulation;
}
.auth-tab.active { background:var(--surface); color:var(--text); }

/* ── Auth form links/footer (shared by /play form + / venue modals) ── */
.auth-link {
  background:transparent; border:none; color:var(--gold); font-weight:700;
  cursor:pointer; padding:4px 2px; font-family:inherit; font-size:inherit;
  text-decoration:underline; touch-action:manipulation;
}
.auth-link:active { opacity:0.7; }
.auth-dismiss { align-self:center; font-size:0.8rem; margin-top:2px; text-decoration:none; color:var(--text2); }
.auth-form-foot { display:flex; justify-content:space-between; gap:12px; margin-top:4px; font-size:0.82rem; }

/* ── Coexistence indicator: small floating pill on the host dashboard
   that surfaces when Open Play is running alongside whatever else
   the host is doing (Game Night, browsing the Venue panel, etc.).
   Click → showOpenPlayStatus(). Suppressed when the host is already
   on the openPlayStatus screen. */
.op-status-pill {
  position: fixed;
  bottom: 18px; right: 18px;
  z-index: 60;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: rgba(46, 204, 113, 0.16);
  border: 1px solid rgba(46, 204, 113, 0.45);
  color: #6ee784;
  font-weight: 700; font-size: 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  transition: transform 0.12s ease, background 0.12s ease;
  font-family: inherit;
}
.op-status-pill:hover { background: rgba(46, 204, 113, 0.24); transform: translateY(-1px); }
.op-status-pill:active { transform: translateY(0); }
.op-status-pill .op-pill-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #2ecc71;
  box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7);
  animation: opPillPulse 2s infinite;
  display: inline-block;
}
@keyframes opPillPulse {
  0%   { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.6); }
  70%  { box-shadow: 0 0 0 10px rgba(46, 204, 113, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}

/* ── Emcee Night setup mode — hides the curated/voting controls in the
   shared #nightSetupModal so the host sees a focused emcee-only flow.
   showEmceeNight() (host-emcee.js) toggles `emcee-night-mode` on the
   modal element; closeNightSetup() removes it. */
.modal-bg.emcee-night-mode .gn-only { display: none !important; }
/* Mirror rule: emcee-only controls (e.g. "+ Emcee Round") are hidden
   in regular Game Night setup. Emcee author-as-you-go rounds and
   curated rounds don't mix in the same night — emcee lives in its
   own dedicated flow via the Emcee Night home card. */
.modal-bg:not(.emcee-night-mode) .emcee-only { display: none !important; }

/* ── Practice-mode warning banner for patrons (play.html).
   Sticky-top across every screen the patron might see while a
   Practice round is active. Distinct from host's .practice-banner
   (host.css) — different audience, different message. */
.practice-banner-patron {
  position: sticky;
  top: 0;
  z-index: 80;
  background: rgba(139,92,246,0.18);
  border-bottom: 1px solid rgba(139,92,246,0.35);
  color: #c4b5fd;
  padding: 10px 14px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ── First-time onboarding wizard (#onboardingModal).
   Six-step modal that walks new venues through logo / template /
   smoke test / practice / preview. Reuses .modal-bg + .modal from
   host.css for visibility + popIn animation; styles below cover
   wizard-specific chrome (progress bar, step indicator, body layout). */
.onboarding-modal { max-width: 560px; gap: 18px; }
.onboarding-progress {
  --onb-progress: 0%;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.08);
  position: relative;
  overflow: hidden;
}
.onboarding-progress::after {
  content: "";
  position: absolute; inset: 0 auto 0 0;
  width: var(--onb-progress);
  background: linear-gradient(90deg, var(--gold), #f4d35e);
  transition: width 0.25s ease;
}
.onboarding-step-indicator {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text2);
  font-weight: 600;
}
.onboarding-body { display: flex; flex-direction: column; gap: 14px; }
.onboarding-lead { font-size: 1rem; line-height: 1.55; color: var(--text); margin: 0; }
.onboarding-sub { font-size: 0.88rem; color: var(--text2); margin: 0; line-height: 1.5; }
.onboarding-checklist { margin: 4px 0 0; padding-left: 4px; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.onboarding-checklist li { padding: 8px 12px; background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 8px; font-size: 0.92rem; }
.onboarding-label { font-size: 0.85rem; font-weight: 600; color: var(--text2); }
.onboarding-select {
  width: 100%; padding: 10px 12px; border-radius: 8px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  color: var(--text); font-size: 0.95rem;
}
.onboarding-status { font-size: 0.88rem; color: var(--text2); min-height: 1.2em; }
.onboarding-logo-preview {
  display: flex; align-items: center; justify-content: center;
  width: 140px; height: 140px;
  border: 1px dashed var(--border); border-radius: 12px;
  background: rgba(255,255,255,0.03);
  margin: 4px 0;
}
.onboarding-logo-preview img { max-width: 100%; max-height: 100%; border-radius: 8px; }
.onboarding-logo-placeholder { font-size: 0.85rem; color: var(--text2); }
.onboarding-smoke-result { margin-top: 4px; }
.onboarding-smoke-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.onboarding-smoke-list li {
  padding: 8px 12px; border-radius: 8px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  font-size: 0.9rem; line-height: 1.4;
}
.onboarding-smoke-list li.onboarding-smoke-fail { background: rgba(239,68,68,0.10); border-color: rgba(239,68,68,0.35); }
.onboarding-smoke-list li.onboarding-smoke-warn { background: rgba(232,152,32,0.10); border-color: rgba(232,152,32,0.35); }
.onboarding-smoke-list li.onboarding-smoke-ok   { background: rgba(46,204,113,0.10); border-color: rgba(46,204,113,0.30); }
.onboarding-preview-btns { display: flex; gap: 12px; flex-wrap: wrap; }
.onboarding-preview-btns .btn { flex: 1; min-width: 160px; }
.onboarding-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.onboarding-foot-right { display: flex; gap: 10px; align-items: center; }
.btn.btn-link { background: transparent; border: none; color: var(--text2); font-size: 0.9rem; padding: 8px 6px; cursor: pointer; text-decoration: underline; }
.btn.btn-link:hover { color: var(--text); }
@media (max-width: 520px) {
  .onboarding-modal { padding: 22px; max-height: calc(100vh - 24px); }
  .onboarding-preview-btns .btn { flex: 1 1 100%; }
}

/* ── Shared empty-state component ───────────────────────────────────────
   Used wherever a configuration-style list has zero rows: Active Ads,
   Regulars, Emcee Question list, Recent Venues. Distinct from
   .empty-lobby in host.css — that one is the small italic "Waiting
   for players…" message for in-game transient empties. This is the
   bigger card-style placeholder for "you haven't set this up yet".
   The optional CTA slot lets each surface point at the right next-step. */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 28px 16px;
  background: rgba(255,255,255,0.02);
  border: 1px dashed var(--border);
  border-radius: 12px;
  color: var(--muted);
}
.empty-state-icon {
  font-size: 2rem;
  opacity: 0.6;
  line-height: 1;
}
.empty-state-title {
  font-weight: 700;
  color: var(--text);
  font-size: 0.95rem;
}
.empty-state-sub {
  font-size: 0.85rem;
  color: var(--muted);
  max-width: 320px;
  line-height: 1.45;
  margin: 0;
}
.empty-state-cta {
  margin-top: 4px;
}
