/* ============================================================
   POLARITY — global theme
   Dark purple / black / white with a lighter-purple accent.
   Used by every screen: lobby, watch, play, host, survey.
   ============================================================ */

@font-face {
  font-family: "Handel Gothic";
  src: url("../assets/fonts/handel-gothic.woff2") format("woff2"),
       url("../assets/fonts/handel-gothic.ttf") format("truetype");
  font-weight: 400 900;
  font-display: swap;
}

:root {
  /* ---- ground + panels ---- */
  --ground: #0a0710;
  --ground-2: #0f0918;
  --panel: #150b26;
  --panel-2: #1b1030;
  --panel-3: #241542;

  /* ---- lines ---- */
  --line: rgba(166, 120, 255, 0.16);
  --line-strong: rgba(166, 120, 255, 0.34);

  /* ---- brand purples ---- */
  --deep: #3b0f6e;
  --deep-2: #521a8f;
  --accent: #a678ff;
  --accent-bright: #c4a6ff;
  --accent-dim: #7b5bc4;

  /* ---- semantic ---- */
  --good: #63e6b8;
  --warn: #ffcf6b;
  --bad: #ff6b8b;
  --live: #ff4d6d;

  /* ---- text ---- */
  --fg: #ffffff;
  --body: #c7bdd9;
  --muted: #8f84a8;
  --faint: #8078a0; /* WCAG AA (~4.9:1 on --ground); was #6b6383 (failed at ~3.5:1) */

  /* ---- type ---- */
  --display: "Handel Gothic", "Arial Narrow", system-ui, sans-serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* ---- shape ---- */
  --radius: 14px;
  --radius-lg: 20px;
  --radius-sm: 9px;
  --maxw: 1240px;

  --shadow: 0 24px 60px -34px rgba(120, 60, 200, 0.6);
}

* { box-sizing: border-box; }
html { scroll-padding-top: 78px; } /* keep #anchor targets clear of the sticky header */

/* scrollbar-gutter: reserve the vertical scrollbar space always, so switching
   between short/tall views (e.g. Control Room tabs) never shifts the layout. */
html { -webkit-text-size-adjust: 100%; overflow-x: clip; scrollbar-gutter: stable; }
body { overflow-x: clip; }
/* sticky footer: main fills the viewport so the footer anchors to the bottom */
body > main { flex: 1 0 auto; width: 100%; }
.site-footer { flex-shrink: 0; }
img, svg, video, canvas { max-width: 100%; }

/* Visible keyboard focus for every interactive control (game cells, answer
   options, buzzers, pickers, links, inputs). Outline doesn't affect layout,
   so this is safe globally; :focus-visible keeps it off mouse clicks. */
:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 2px; border-radius: 3px; }
/* Screen-reader-only: present in the a11y tree, invisible on screen. */
.sr-only {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
/* Header sound toggle (🔊/🔇) */
.snd-slot { display: flex; align-items: center; }
.snd-toggle { padding-left: 9px; padding-right: 9px; line-height: 1; }

/* Sound settings (profile) */
.setting-head { display: flex; align-items: center; gap: 10px; }
.snd-master-label { display: inline-flex; align-items: center; gap: 7px; font-family: var(--display); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); cursor: pointer; }
.snd-master-label input { accent-color: var(--accent); width: 16px; height: 16px; }
.vol-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.vol-ic { font-size: 15px; width: 20px; text-align: center; flex: none; }
.vol-name { width: 62px; flex: none; color: var(--body); font-size: 13.5px; }
.vol-slider { flex: 1; min-width: 0; accent-color: var(--accent); height: 4px; cursor: pointer; }

/* Audio review tab (Control Room) */
.audio-list { display: flex; flex-direction: column; gap: 10px; }
.audio-row { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; background: var(--panel); }
.audio-row-head { display: flex; align-items: center; gap: 10px; }
.audio-row-id { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.audio-row-label { color: var(--fg); font-weight: 600; }
.audio-row-file { color: var(--faint); font-size: 11.5px; font-family: var(--mono); }
.audio-approvals { margin-left: auto; color: var(--good); font-size: 12.5px; font-family: var(--display); letter-spacing: .04em; white-space: nowrap; }
.audio-player-wrap { display: flex; align-items: center; gap: 10px; margin: 10px 0; flex-wrap: wrap; }
.audio-player { width: 100%; max-width: 420px; height: 34px; }
.audio-missing { color: var(--warn); font-size: 12px; white-space: nowrap; }
.audio-row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.audio-suggest { margin-top: 10px; }
.audio-suggest-list { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.audio-suggest-item { font-size: 13px; color: var(--body); background: var(--ground-2); border-radius: var(--radius-sm); padding: 7px 10px; }
.linklike { background: none; border: 0; color: var(--accent-bright); cursor: pointer; font-size: 12px; padding: 0; text-decoration: underline; }

/* Audio suggestions inbox (superadmin profile) */
.audio-inbox { display: flex; flex-direction: column; gap: 10px; }
.inbox-item { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; background: var(--panel); }
.inbox-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inbox-msg { margin: 8px 0 10px; color: var(--body); }
.inbox-actions { display: flex; gap: 8px; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1100px 620px at 50% -10%, rgba(59, 15, 110, 0.5), transparent 60%),
    radial-gradient(760px 520px at 90% 8%, rgba(166, 120, 255, 0.1), transparent 55%),
    var(--ground);
  background-attachment: fixed;
  color: var(--body);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent-bright); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { color: var(--fg); text-wrap: balance; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

/* ---------- utility ---------- */
.display { font-family: var(--display); }
.eyebrow {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 11px;
  color: var(--muted);
}
.tnum { font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.hidden { display: none !important; }

/* ============================================================
   Home hero
   ============================================================ */
.hero { text-align: center; padding: 20px 0 38px; }
.hero-logo {
  display: block; width: min(360px, 82%); height: auto; margin: 0 auto -6px;
  filter: drop-shadow(0 16px 50px rgba(166, 120, 255, 0.4));
}
@media (prefers-reduced-motion: no-preference) {
  .hero-logo { animation: heroFloat 6.5s ease-in-out infinite; }
}
@keyframes heroFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
/* Reserve the crash box's exact footprint up front (matches crash.js fit():
   width min(560px,92vw), 760:475 box) so the animation mounting doesn't shift
   the page down — this was the biggest CLS source. */
.hero-crash { width: min(560px, 92vw); aspect-ratio: 760 / 475; margin: 0 auto 2px; }
.hero-eyebrow { letter-spacing: .26em; margin: 0; }
.hero-headline {
  font-size: clamp(28px, 6.4vw, 52px); text-transform: uppercase; letter-spacing: .03em; line-height: 1.02;
  margin: 16px 0 0; text-wrap: balance;
  background: linear-gradient(174deg, #fff 32%, var(--accent-bright) 80%, var(--accent) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-lede { max-width: 56ch; margin: 18px auto 0; color: var(--body); font-size: 17px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; margin-top: 26px; flex-wrap: wrap; }
.hero-note { color: var(--faint); font-size: 12.5px; margin-top: 14px; }

/* ============================================================
   Site header / brand
   ============================================================ */
/* Reserve the header's height on the empty shell so content doesn't jump
   down when brand.js mounts the bar (CLS). */
#site-header { min-height: 59px; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(10px);
  background: linear-gradient(180deg, rgba(10, 7, 16, 0.92), rgba(10, 7, 16, 0.72));
  border-bottom: 1px solid var(--line);
}
.site-header .bar {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--fg);
}
.brand:hover { text-decoration: none; }
.brand .mark { height: 30px; width: auto; flex: none; filter: drop-shadow(0 3px 10px rgba(166, 120, 255, 0.45)); }
.brand .word {
  font-family: var(--display);
  font-weight: 900;
  font-size: 21px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg);
}
.brand .word .beam {
  background: linear-gradient(180deg, #fff 30%, var(--accent-bright) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.site-header .spacer { flex: 1; }
.site-header nav { display: flex; align-items: center; gap: 6px; }
/* hamburger — hidden on desktop, shown on mobile via the media query below */
.nav-toggle {
  display: none;
  align-items: center; justify-content: center;
  width: 40px; height: 34px; flex: none;
  background: transparent; color: var(--fg);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  font-size: 17px; line-height: 1; cursor: pointer;
}
.nav-toggle:hover { border-color: var(--accent); }

/* header on small screens — keep everything on one row without overflow */
@media (max-width: 600px) {
  .site-header .bar { padding: 10px 12px; gap: 8px; }
  .brand { gap: 8px; }
  .brand .mark { height: 25px; }
  .brand .word { font-size: 16px; letter-spacing: .05em; }
  .account { gap: 7px; }
  .account-name { max-width: 72px; font-size: 12px; }
}
@media (max-width: 430px) {
  .brand .word { display: none; }
  .account-name { display: none; }
}

/* ---- mobile: collapse the nav links into a hamburger dropdown ---- */
@media (max-width: 680px) {
  .nav-toggle { display: inline-flex; }
  .site-header .bar { position: relative; }
  .site-header nav {
    position: absolute; top: calc(100% + 6px); right: 12px; left: 12px;
    flex-direction: column; align-items: stretch; gap: 6px;
    padding: 10px; margin: 0;
    background: var(--panel-2); border: 1px solid var(--line-strong);
    border-radius: var(--radius); box-shadow: var(--shadow);
    display: none; z-index: 45;
  }
  .site-header nav.open { display: flex; }
  .site-header nav .btn { width: 100%; justify-content: flex-start; padding: 11px 13px; font-size: 12.5px; letter-spacing: .05em; }
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 13px;
  font-weight: 700;
  color: var(--fg);
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  line-height: 1;
  text-decoration: none;
}
.btn:hover { border-color: var(--accent); background: var(--panel-3); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 2px; }
.btn[disabled], .btn.is-disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

.btn.primary {
  background: linear-gradient(135deg, var(--deep-2), var(--deep));
  border-color: var(--accent);
  box-shadow: 0 10px 30px -14px rgba(166, 120, 255, 0.8);
}
.btn.primary:hover { background: linear-gradient(135deg, #6322a8, #45148a); box-shadow: 0 14px 34px -12px rgba(166, 120, 255, 0.95); }

.btn.ghost { background: transparent; }
.btn.big { font-size: 15px; padding: 14px 26px; }
.btn.sm { font-size: 11px; padding: 7px 12px; }

/* Google sign-in */
.btn.google { background: #fff; color: #1a1a1a; border-color: #fff; }
.btn.google:hover { background: #f1f1f1; border-color: #f1f1f1; }
.btn.google svg { width: 16px; height: 16px; }
.btn.apple { background: #000; color: #fff; border-color: #000; }
.btn.apple:hover { background: #1a1a1a; border-color: #1a1a1a; }
.btn.apple svg { width: 16px; height: 16px; }

/* ============================================================
   Cards / panels
   ============================================================ */
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel), var(--ground-2));
  padding: 18px;
}
.card.hover { transition: border-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease; }
.card.hover:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: var(--shadow); }

.grid { display: grid; gap: 14px; }
.grid > * { min-width: 0; }   /* let grid children shrink instead of overflowing their card */
.grid.cols-2 { grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); }
/* games overview — 3 across on desktop, 2 on tablet, 1 on mobile (card size held) */
.games-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr)); }

/* ============================================================
   Badges / pills / status
   ============================================================ */
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--display); text-transform: uppercase; letter-spacing: 0.12em;
  font-size: 10.5px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line-strong); color: var(--accent-bright);
  background: rgba(166, 120, 255, 0.08);
}
.pill.live { color: #fff; border-color: rgba(255, 77, 109, 0.6); background: rgba(255, 77, 109, 0.14); }
.pill.live .dot { background: var(--live); }
.pill.scheduled { color: var(--warn); border-color: rgba(255, 207, 107, 0.4); background: rgba(255, 207, 107, 0.08); }
.pill.ended { color: var(--muted); }
.pill .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
}
.pill.live .dot { animation: pulse 2s ease-out infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 77, 109, 0.6); }
  70% { box-shadow: 0 0 0 7px rgba(255, 77, 109, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 77, 109, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .pill.live .dot { animation: none; }
}

/* game-type tag */
.tag-game {
  font-family: var(--display); text-transform: uppercase; letter-spacing: 0.1em;
  font-size: 10px; color: var(--deep); background: var(--accent-bright);
  padding: 3px 8px; border-radius: 5px; font-weight: 700;
}
/* lobby cards wear their game's accent (matches the games page identity) */
.tag-game.themed { background: var(--game-accent, var(--accent-bright)); color: #0a0710; }
.lobby-card { border-top: 3px solid var(--game-accent, var(--accent)); }
.lobby-card:hover, .lobby-card:focus-visible { border-color: var(--game-accent, var(--accent)); }

/* ============================================================
   Notice / empty states
   ============================================================ */
.notice {
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--warn);
  background: linear-gradient(180deg, rgba(255, 207, 107, 0.06), rgba(255, 207, 107, 0.02));
  border-radius: var(--radius);
  padding: 16px 18px;
}
.notice.info { border-left-color: var(--accent); background: linear-gradient(180deg, rgba(166,120,255,0.07), rgba(166,120,255,0.02)); }
.notice .lbl {
  font-family: var(--display); text-transform: uppercase; letter-spacing: 0.16em;
  font-size: 11px; color: var(--warn); margin-bottom: 6px;
}
.notice.info .lbl { color: var(--accent-bright); }
.notice code { font-family: var(--mono); font-size: 12.5px; color: var(--accent-bright); background: rgba(0,0,0,0.35); padding: 1px 6px; border-radius: 5px; }

.empty {
  text-align: center; color: var(--muted);
  padding: 46px 20px;
  border: 1px dashed var(--line-strong); border-radius: var(--radius);
}
.empty .big { font-family: var(--display); text-transform: uppercase; letter-spacing: 0.1em; color: var(--body); font-size: 16px; }

/* ============================================================
   Live game board (spectator + player share this)
   ============================================================ */
.stage {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(600px 300px at 50% 0%, rgba(59, 15, 110, 0.4), transparent 70%),
    linear-gradient(180deg, var(--panel), var(--ground-2));
  box-shadow: var(--shadow);
  overflow: hidden;
}
.stage-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px; border-bottom: 1px solid var(--line);
}
.stage-head .title { font-family: var(--display); text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg); font-size: 15px; }
.stage-body { padding: clamp(20px, 4vw, 44px); }

.prompt {
  font-family: var(--display);
  font-size: clamp(22px, 4.4vw, 40px);
  line-height: 1.18;
  color: var(--fg);
  text-align: center;
  text-wrap: balance;
  margin: 0 auto;
  max-width: 20ch;
}

/* Tractor Beam answer options */
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: clamp(20px, 4vw, 40px); }
.opt {
  display: flex; align-items: center; gap: 14px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border-radius: 999px;
  padding: 14px 22px;
  color: var(--fg);
  font-size: clamp(15px, 2.2vw, 20px);
  min-height: 58px;
}
.opt .letter {
  font-family: var(--display); font-weight: 800; color: var(--accent-bright);
  font-size: clamp(15px, 2.2vw, 20px); min-width: 1.4em;
}
.opt.correct { border-color: var(--good); background: linear-gradient(180deg, rgba(99,230,184,0.22), rgba(99,230,184,0.08)); }
.opt.correct .letter { color: var(--good); }
.opt.eliminated { opacity: 0.28; }
@media (max-width: 620px) { .options { grid-template-columns: 1fr; } }

/* scoreboard */
.scoreboard { display: flex; flex-wrap: wrap; gap: 10px; }
.score-chip {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 8px 6px 14px;
  background: var(--panel-2);
}
.score-chip .name { color: var(--fg); font-size: 14px; }
.score-chip .val { font-family: var(--display); font-variant-numeric: tabular-nums; color: var(--accent-bright); background: var(--ground); border-radius: 999px; padding: 4px 10px; font-size: 13px; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 40px;
  padding: 26px 0 50px;
  color: var(--faint);
  font-size: 12.5px;
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.site-footer .spacer { flex: 1; }
.site-footer .footer-grid { display: grid !important; grid-template-columns: 1.6fr 1fr 1fr 1.3fr; gap: 28px 28px; align-items: start !important; }
/* Tablet & down: brand on its own row; Explore · POLARITY · Follow share one row. */
@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-col { min-width: 0; }                          /* let each column shrink so all three fit one row */
  .footer-follow { grid-column: auto; margin-top: 0; }
}
@media (max-width: 640px) {
  .footer-grid { gap: 20px 10px; }
  .footer-col a { white-space: nowrap; }                 /* keep "Help & FAQ", "Terms of Use" on one line */
  /* Icons wrap inside the narrow Follow column instead of forcing it wider
     (repeat(3,max-content) gave the column a rigid width that pushed it to its own row). */
  .social-grid { display: flex; flex-wrap: wrap; gap: 10px 10px; }
  .social-link svg { width: 19px; height: 19px; }
  .site-footer .footer-legal { flex-direction: column; align-items: flex-start; gap: 6px; }
  .site-footer .footer-legal .spacer { display: none; }
}
/* footer social icons — 3-across grid in the Follow column (12 icons → 3×4) */
.social-grid { display: grid; grid-template-columns: repeat(3, max-content); gap: 12px 16px; margin-top: 4px; }
.social-link { color: var(--muted); display: inline-flex; transition: color 0.15s ease, transform 0.1s ease; }
.social-link svg { width: 21px; height: 21px; display: block; }
.social-link:hover, .social-link:focus-visible { color: var(--accent-bright); transform: translateY(-2px); }
.social-link.soon { opacity: .5; }
.social-link.soon:hover, .social-link.soon:focus-visible { opacity: 1; }
/* brand block as a single row: ship + wordmark on the left, tagline inline to the right */
.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer-brand .brand { margin-bottom: 0; flex: none; }
.footer-tag { color: var(--muted); font-size: 12.5px; line-height: 1.45; margin: 0; flex: 1; min-width: 0; }
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-h { font-family: var(--display); text-transform: uppercase; letter-spacing: .1em; font-size: 10.5px; color: var(--accent-bright); margin-bottom: 2px; }
.footer-col a { color: var(--body); text-decoration: none; font-size: 13px; }
.footer-col a:hover { color: var(--fg); }
.footer-legal { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 16px; color: var(--faint); }

/* ---- native app safe areas (viewport-fit=cover; env() = 0 in normal browsers) ---- */
@supports (top: env(safe-area-inset-top)) {
  #site-header { padding-top: env(safe-area-inset-top); }
  .site-footer { padding-bottom: env(safe-area-inset-bottom); }
  /* keep side content off rounded corners / landscape notches without shrinking the default gutter */
  body > main.wrap { padding-left: max(var(--wrap-pad, 20px), env(safe-area-inset-left)); padding-right: max(var(--wrap-pad, 20px), env(safe-area-inset-right)); }
}

/* ---- native app feel (html.is-native is set when running inside Capacitor) ---- */
html.is-native { -webkit-tap-highlight-color: transparent; }   /* no grey flash on tap */
html.is-native a, html.is-native button, html.is-native .btn,
html.is-native img, html.is-native svg, html.is-native .nav-toggle {
  -webkit-touch-callout: none;                                  /* no long-press image/link menu */
  -webkit-user-select: none; user-select: none;                 /* buttons/links feel native (text stays selectable) */
}
/* Add-to-Home-Screen + cookie banners are web-only, and the floating feedback
   bubble overlaps content — hide all three inside the native app. */
html.is-native .pwa-install, html.is-native .cookie-bar, html.is-native .fb-fab,
html.is-native .beta-banner, html.is-native .beta-footer-link { display: none !important; }

/* ---- mobile-beta signup banner (TEMPORARY; web only) ---- */
.beta-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; margin: 0 0 2px;
  background: linear-gradient(90deg, rgba(166,120,255,.16), rgba(166,120,255,.05));
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  font-size: 13.5px; color: var(--body);
}
.beta-banner-txt { flex: 1; min-width: 0; }
.beta-banner-cta {
  appearance: none; border: 0; background: none; cursor: pointer; padding: 0;
  font: inherit; color: var(--accent-bright); font-weight: 700; text-decoration: underline;
  text-underline-offset: 2px;
}
.beta-banner-cta:hover { color: var(--fg); }
.beta-banner-x {
  appearance: none; border: 0; background: none; cursor: pointer;
  color: var(--muted); font-size: 20px; line-height: 1; padding: 0 2px; flex: none;
}
.beta-banner-x:hover { color: var(--fg); }

/* ============================================================
   Document / legal + about pages
   ============================================================ */
.doc { max-width: 760px; margin: 0 auto; }
.doc-head { margin-bottom: 8px; }
.doc-title { font-family: var(--display); font-size: clamp(30px, 7vw, 46px); text-transform: uppercase; letter-spacing: .03em; margin: 8px 0 0; color: var(--fg); }
.doc-updated { color: var(--muted); font-size: 13px; margin-top: 10px; }
.doc-note { margin: 18px 0 26px; }
.doc-body { color: var(--body); line-height: 1.7; }
.doc-body h2 { font-family: var(--display); text-transform: uppercase; letter-spacing: .04em; font-size: 19px; color: var(--fg); margin: 34px 0 10px; scroll-margin-top: 84px; }
.doc-body h3 { color: var(--fg); font-size: 15.5px; margin: 20px 0 6px; }
.doc-body p, .doc-body li { font-size: 15px; }
.doc-body ul { padding-left: 20px; margin: 8px 0; }
.doc-body li { margin: 6px 0; }
.doc-body a { color: var(--accent-bright); }
.doc-body strong { color: var(--fg); }

/* about page bits */
.doc-wide { max-width: 1040px; }
.about-hero { text-align: center; padding: 8px 0 10px; }
.about-logo { width: min(180px, 44vw); height: auto; margin: 0 auto 6px; display: block; }
.about-hero .lead { color: var(--body); max-width: 66ch; margin: 16px auto 0; line-height: 1.6; }

/* editorial rows: a narrow label column beside the content, so the width reads intentionally */
.about-row { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 34px; margin-top: 40px; align-items: start; }
.about-row > .eyebrow { margin: 0; padding-top: 3px; }
.about-row .about-body { max-width: 70ch; }
.about-row .about-body > p { color: var(--body); line-height: 1.65; margin: 0; }
.about-row .about-body .btns { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.about-row .about-fine { color: var(--muted); font-size: 13px; margin-top: 14px; }
.av-showcase { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.av-showcase .avatar { border: 1px solid var(--line); box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
@media (max-width: 760px) { .about-row { grid-template-columns: 1fr; gap: 12px; margin-top: 30px; } }

/* How it works — roomier cards with a little icon strip at the bottom */
.about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 16px; margin-top: 8px; }
.about-grid .card { display: flex; flex-direction: column; padding: 24px 24px 20px; }
.about-grid .hiw-title { color: var(--fg); font-family: var(--display); font-size: 17px; text-transform: uppercase; letter-spacing: .03em; }
.about-grid .hiw-body { color: var(--body); font-size: 14px; margin: 10px 0 0; line-height: 1.55; flex: 1; }
.hiw-foot { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.hiw-foot .hiw-ics { display: inline-flex; gap: 11px; color: var(--accent-bright); }
.hiw-foot .hiw-ics svg { width: 20px; height: 20px; display: block; opacity: .92; fill-rule: evenodd; }
.hiw-foot .hiw-cap { font-family: var(--display); text-transform: uppercase; letter-spacing: .07em; font-size: 10px; color: var(--faint); line-height: 1.3; }

/* 404 */
.nf-wrap { text-align: center; padding: 60px 0; }
.nf-code { font-family: var(--display); font-size: clamp(70px, 20vw, 150px); line-height: 1;
  background: linear-gradient(174deg, #fff 30%, var(--accent-bright) 80%, var(--accent) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* ============================================================
   PWA install prompt
   ============================================================ */
.pwa-install {
  position: fixed; left: 50%; bottom: 18px; z-index: 80;
  transform: translate(-50%, 140%);
  display: flex; align-items: center; gap: 12px;
  width: min(440px, calc(100vw - 24px));
  padding: 12px 14px; border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line-strong); box-shadow: var(--shadow);
  transition: transform .35s cubic-bezier(.2,.7,.3,1);
}
.pwa-install.in { transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .pwa-install { transition: none; } }
.pwa-ic { font-size: 24px; flex: none; }
.pwa-txt { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.pwa-txt strong { color: var(--fg); font-size: 14px; }
.pwa-txt span { color: var(--muted); font-size: 12.5px; }
.pwa-txt b { color: var(--body); }
.pwa-x {
  appearance: none; background: transparent; border: 0; cursor: pointer; flex: none;
  color: var(--muted); font-size: 15px; width: 28px; height: 28px; border-radius: 7px;
}
.pwa-x:hover { color: var(--fg); background: var(--panel-3); }

/* ============================================================
   Cookie consent + feedback + FAQ
   ============================================================ */
.cookie-bar {
  position: fixed; left: 50%; bottom: 18px; z-index: 85;
  transform: translate(-50%, 170%);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  width: min(560px, calc(100vw - 24px));
  padding: 12px 16px; border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line-strong); box-shadow: var(--shadow);
  transition: transform .35s cubic-bezier(.2,.7,.3,1);
}
.cookie-bar.in { transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .cookie-bar { transition: none; } }
.cookie-ic { font-size: 20px; flex: none; }
.cookie-txt { flex: 1; min-width: 200px; color: var(--body); font-size: 12.5px; line-height: 1.5; margin: 0; }
.cookie-txt b { color: var(--fg); } .cookie-txt a { color: var(--accent-bright); }
.cookie-btns { display: flex; gap: 8px; flex: none; margin-left: auto; }

/* floating feedback button */
.fb-fab {
  position: fixed; right: 16px; bottom: 16px; z-index: 70;
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  padding: 10px 15px; border-radius: 999px;
  background: linear-gradient(180deg, var(--deep-2), var(--deep));
  color: #fff; border: 1px solid var(--line-strong);
  box-shadow: 0 10px 30px -12px rgba(120,60,200,.75);
  font-family: var(--display); font-size: 12px; letter-spacing: .05em; text-transform: uppercase;
  transition: transform .18s, box-shadow .18s, bottom .3s;
}
.fb-fab:hover { transform: translateY(-2px); box-shadow: 0 14px 36px -12px rgba(150,90,240,.85); }
.fb-fab > span[aria-hidden] { font-size: 15px; }
body.bottom-banner .fb-fab { bottom: 92px; }
@media (max-width: 520px) { .fb-fab-txt { display: none; } .fb-fab { padding: 12px; } }

/* feedback modal */
.fb-types { display: flex; gap: 8px; flex-wrap: wrap; }
.fb-type { flex: 1; position: relative; min-width: 90px; }
.fb-type input { position: absolute; opacity: 0; pointer-events: none; }
.fb-type span { display: block; text-align: center; padding: 9px 8px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--panel); color: var(--body); font-size: 13px; cursor: pointer; transition: border-color .12s, background .12s; }
.fb-type input:checked + span { border-color: var(--accent); background: rgba(166,120,255,.14); color: var(--fg); }
.fb-thanks { text-align: center; padding: 18px 0 6px; }
.fb-check { width: 58px; height: 58px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; font-size: 28px; color: var(--good); background: rgba(99,230,184,.12); border: 1px solid rgba(99,230,184,.45); }
.fb-thanks h2 { font-size: 26px; text-transform: uppercase; letter-spacing: .03em; }

/* Control Room feedback cards */
.fb-filters { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.fb-filter { cursor: pointer; text-transform: capitalize; }
.fb-filter.on { background: var(--accent); color: #0a0710; border-color: var(--accent); }
.fb-card { margin-bottom: 10px; }
.fb-card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; flex-wrap: wrap; }
.fb-status { font-family: var(--display); text-transform: uppercase; letter-spacing: .05em; font-size: 10px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.fb-status.new { color: var(--warn); border-color: rgba(255,207,107,.4); }
.fb-status.seen, .fb-status.invited { color: var(--accent-bright); border-color: var(--line-strong); }
.fb-status.resolved, .fb-status.added { color: var(--good); border-color: rgba(99,230,184,.4); }
.fb-msg-body { color: var(--fg); line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.fb-card-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.fb-page { color: var(--faint); font-size: 11px; font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; max-width: 60%; white-space: nowrap; }

/* FAQ (help page) */
.faq { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); margin: 8px 0; }
.faq > summary { list-style: none; cursor: pointer; padding: 13px 16px; color: var(--fg); font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 10px; }
.faq > summary::-webkit-details-marker { display: none; }
.faq > summary::before { content: "＋"; color: var(--accent); font-family: var(--display); flex: none; }
.faq[open] > summary::before { content: "－"; }
.faq > summary:hover { color: var(--accent-bright); }
.faq > p { margin: 0; padding: 0 16px 14px; color: var(--body); font-size: 14.5px; line-height: 1.6; }
.faq > p a { color: var(--accent-bright); }

/* Daily Double consent gate */
.video-consent { text-align: center; color: var(--body); max-width: 400px; }
.video-consent p { margin: 0 0 16px; font-size: 15px; }
.video-consent b { color: var(--fg); }
.video-consent-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ============================================================
   Slipstream — board race + live feed
   ============================================================ */
.ss-live { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
/* ---- the star map ----------------------------------------------------------
   Deep-space backdrop for the race board: a dark base, two faint nebula washes
   in the brand purple, and a hand-placed starfield. All of it is pure CSS
   gradients — no image asset, so it costs one paint, adds no request, and does
   not touch the CSP.

   IT LIVES ON THE WRAPPER, NOT ON .ss-board, and that is deliberate: every
   space and token inside .ss-board is absolutely positioned at a pixel
   coordinate the renderer computes, so adding padding or a border to .ss-board
   would move the containing block's origin and shift the entire board out from
   under its own connector lines. The wrapper can be styled freely. */
.ss-board-wrap {
  flex: 1; min-width: 0; overflow-x: auto;
  padding: 18px 16px 20px;
  border: 1px solid rgba(166, 120, 255, 0.22);
  border-radius: var(--radius-sm);
  background-color: #05030c;
  background-image:
    /* nebulae — brand purple, kept low-alpha so the purple track still reads */
    radial-gradient(60% 80% at 18% 12%, rgba(166, 120, 255, 0.20), transparent 70%),
    radial-gradient(50% 70% at 82% 88%, rgba(120, 80, 220, 0.16), transparent 72%),
    radial-gradient(40% 55% at 60% 25%, rgba(255, 138, 61, 0.07), transparent 70%),
    /* starfield: three sizes, three tile scales, so the pattern never lines up */
    radial-gradient(1.6px 1.6px at 12% 22%, rgba(255,255,255,.85), transparent 60%),
    radial-gradient(1.4px 1.4px at 74% 14%, rgba(255,255,255,.70), transparent 60%),
    radial-gradient(1.7px 1.7px at 38% 78%, rgba(255,255,255,.80), transparent 60%),
    radial-gradient(1.2px 1.2px at 91% 63%, rgba(214,224,255,.70), transparent 60%),
    radial-gradient(1.1px 1.1px at 26% 54%, rgba(255,255,255,.55), transparent 60%),
    radial-gradient(1.3px 1.3px at 57% 91%, rgba(255,236,214,.60), transparent 60%),
    radial-gradient(1px 1px at 6% 82%, rgba(255,255,255,.45), transparent 60%),
    radial-gradient(1px 1px at 66% 44%, rgba(255,255,255,.40), transparent 60%);
  background-size:
    100% 100%, 100% 100%, 100% 100%,
    260px 200px, 260px 200px, 260px 200px, 260px 200px,
    170px 230px, 170px 230px, 410px 310px, 410px 310px;
  background-repeat: no-repeat, no-repeat, no-repeat, repeat, repeat, repeat, repeat, repeat, repeat, repeat, repeat;
  box-shadow: inset 0 0 60px -18px rgba(166, 120, 255, 0.35);
}
/* transparent so the star map shows through; position and size untouched */
.ss-board { position: relative; margin: 0 auto; background: transparent; }
/* the connector track reads brighter against the dark field */
.ss-board-wrap .ss-lines line { stroke: rgba(190, 155, 255, 0.42); }
.ss-lines { position: absolute; inset: 0; pointer-events: none; }
.ss-lines line { stroke: rgba(166, 120, 255, 0.26); stroke-width: 3; stroke-linecap: round; }
.ss-space {
  position: absolute; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; z-index: 2;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--muted);
}
.ss-space.ss-start { background: var(--panel-3); border-color: var(--line-strong); color: var(--accent-bright); }
.ss-space.ss-chance { background: radial-gradient(circle, rgba(255,138,61,.32), var(--panel-2)); border-color: rgba(255,138,61,.6); color: #ff8a3d; box-shadow: 0 0 10px -2px rgba(255,138,61,.55); }
.ss-space.ss-checkpoint { border-color: var(--accent); color: var(--accent-bright); }
.ss-space.ss-finish { background: linear-gradient(180deg, rgba(255,207,107,.28), var(--panel-2)); border-color: var(--warn); color: var(--warn); }
.ss-token {
  position: absolute; width: 22px; height: 22px; border-radius: 50%; z-index: 3;
  display: grid; place-items: center; color: #0a0710; font-family: var(--display);
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  border: 2px solid rgba(255,255,255,.55); box-shadow: 0 2px 6px rgba(0,0,0,.5);
}
.ss-token.first { box-shadow: 0 0 0 2px #ff8a3d, 0 0 12px #ff8a3d; }

.ss-feed { width: 210px; flex: none; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); padding: 11px; display: flex; flex-direction: column; }
.ss-feed-h { font-family: var(--display); text-transform: uppercase; letter-spacing: .1em; font-size: 10.5px; color: var(--accent-bright); }
.ss-feed-list { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; max-height: 210px; margin-top: 9px; scroll-behavior: smooth; }
.ss-feed-empty { color: var(--muted); font-size: 12px; }
.ss-feed-item { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 6px 8px; border-radius: 7px; background: var(--panel-2); border-left: 2px solid var(--line-strong); }
.ss-feed-item.good { border-left-color: var(--good); }
.ss-feed-item.bad { border-left-color: var(--bad); }
.ss-fi-ic { flex: none; }
.ss-fi-txt { flex: 1; color: var(--body); min-width: 0; }
.ss-fi-txt b { color: var(--fg); }
.ss-fi-d { flex: none; font-family: var(--display); font-variant-numeric: tabular-nums; color: var(--muted); }
.ss-feed-item.good .ss-fi-d { color: var(--good); }
.ss-feed-item.bad .ss-fi-d { color: var(--bad); }
@media (max-width: 620px) { .ss-feed { width: 100%; } .ss-feed-list { max-height: 150px; } }

/* instant anomaly notification (player's own hit) */
.ss-toast {
  position: fixed; left: 50%; top: 78px; z-index: 75;
  transform: translate(-50%, -16px); opacity: 0;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 22px; border-radius: 999px;
  background: var(--panel-3); border: 1px solid var(--line-strong); box-shadow: var(--shadow);
  transition: opacity .3s, transform .3s;
}
.ss-toast.in { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .ss-toast { transition: none; } }
.ss-toast .ss-t-ic { font-size: 24px; }
.ss-toast .ss-t-lbl { font-family: var(--display); text-transform: uppercase; letter-spacing: .04em; color: var(--fg); }
.ss-toast .ss-t-d { font-family: var(--display); font-size: 19px; font-variant-numeric: tabular-nums; }
.ss-toast.good .ss-t-d { color: var(--good); }
.ss-toast.bad .ss-t-d { color: var(--bad); }

/* ============================================================
   Account chip (header) + username claim modal
   ============================================================ */
.account-slot { display: flex; align-items: center; }
.account { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--line-strong); object-fit: cover; background: var(--panel-2);
  display: grid; place-items: center; font-size: 15px;
}
.avatar-fallback { color: var(--accent-bright); }
.account-name {
  font-family: var(--display); font-size: 13px; letter-spacing: .03em;
  color: var(--fg); max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(5, 3, 10, 0.72); backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: 20px;
  animation: fadein 0.18s ease;
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .modal-overlay { animation: none; } }
.modal {
  width: 100%; max-width: 440px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-lg);
  background: radial-gradient(500px 240px at 50% 0%, rgba(59,15,110,.4), transparent 70%), linear-gradient(180deg, var(--panel), var(--ground-2));
  box-shadow: var(--shadow); padding: 26px;
}
.text-input {
  width: 100%; min-width: 0; box-sizing: border-box;   /* min-width:0 lets datetime-local/select shrink to the card instead of overflowing */
  font-family: var(--sans); font-size: 17px; color: var(--fg);
  background: var(--ground); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 13px 15px; outline: none;
}
.text-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(166,120,255,.18); }
.text-input::placeholder { color: var(--faint); }
.claim-msg { min-height: 20px; margin: 9px 2px 4px; font-size: 13.5px; color: var(--muted); }
.claim-msg.ok { color: var(--good); }
.claim-msg.bad { color: var(--bad); }

.modal { position: relative; }
.modal-close {
  position: absolute; top: 10px; right: 12px;
  background: none; border: none; color: var(--muted);
  font-size: 26px; line-height: 1; cursor: pointer; padding: 2px 8px; border-radius: 8px;
}
.modal-close:hover { color: var(--fg); background: rgba(255, 255, 255, 0.06); }

/* ============================================================
   Profile page
   ============================================================ */
.avatar { overflow: hidden; }
.avatar-svg { padding: 0; }
.avatar-initial { color: #fff; font-weight: 800; font-family: var(--display); }
a.account { text-decoration: none; }
a.account:hover { text-decoration: none; }

.profile-head { display: flex; align-items: center; gap: 20px; }
.profile-avatar .avatar { border-width: 2px; box-shadow: var(--shadow); }
.profile-id h1 { font-size: clamp(28px, 6vw, 44px); text-transform: uppercase; letter-spacing: .03em; margin: 0; line-height: 1; }
.profile-meta { color: var(--muted); font-size: 14px; margin-top: 8px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel), var(--ground-2)); padding: 16px 12px; text-align: center;
}
.stat-value { font-family: var(--display); font-size: 27px; color: var(--accent-bright); line-height: 1; }
.stat-label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .07em; margin-top: 6px; }
@media (max-width: 560px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }

.game-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-top: 1px solid var(--line); }
.game-row:first-child { border-top: none; }
.game-row-stats { color: var(--muted); font-size: 13px; }

.setting-label { display: block; font-family: var(--display); text-transform: uppercase; letter-spacing: .1em; font-size: 11px; color: var(--muted); margin-bottom: 10px; }
.setting-row { display: flex; gap: 10px; align-items: center; }
.setting-row .text-input { flex: 1; min-width: 0; }
select.text-input { appearance: none; -webkit-appearance: none; cursor: pointer; }
.save-msg { min-height: 18px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.save-msg.ok { color: var(--good); }
.save-msg.bad { color: var(--bad); }

.avatar-picker { display: flex; flex-wrap: wrap; gap: 10px; }
.avatar-choice { padding: 3px; border: 2px solid transparent; border-radius: 50%; background: none; cursor: pointer; line-height: 0; }
.avatar-choice:hover { border-color: var(--line-strong); }
.avatar-choice.active { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(166, 120, 255, 0.2); }

/* ---- onboarding setup modal (auth.js) ---- */
.setup-modal { max-width: 480px; width: min(480px, 94vw); max-height: 90vh; display: flex; flex-direction: column; }
.nux-body { overflow-y: auto; display: flex; flex-direction: column; gap: 15px; margin: 2px -6px 6px; padding: 2px 6px; }
.setup-field { display: flex; flex-direction: column; }
.setup-label { font-family: var(--display); text-transform: uppercase; letter-spacing: .06em; font-size: 11px; color: var(--fg); margin: 0 0 7px; display: flex; align-items: center; gap: 8px; }
.setup-req { text-transform: none; letter-spacing: 0; font-size: 10.5px; color: var(--faint); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; font-family: var(--sans); }
.setup-hint { color: var(--muted); font-size: 12px; line-height: 1.45; margin: 7px 0 0; }
.setup-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.setup-toggle { display: flex; align-items: center; gap: 14px; }
.setup-toggle > div:first-child { flex: 1; }
@media (max-width: 440px) { .setup-row2 { grid-template-columns: 1fr; } }

/* toggle switch */
.switch { position: relative; display: inline-block; width: 44px; height: 26px; flex: 0 0 auto; cursor: pointer; }
.switch input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch-track { position: absolute; inset: 0; border-radius: 999px; background: var(--line-strong); transition: background .15s; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 3px rgba(166,120,255,.35); }

/* segmented control (public / private) */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 3px; background: rgba(255,255,255,.02); }
.seg-btn { appearance: none; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-family: var(--display); text-transform: uppercase; letter-spacing: .05em; font-size: 12px; padding: 7px 20px; border-radius: 7px; transition: background .15s, color .15s; }
.seg-btn:hover { color: var(--body); }
.seg-btn.on { background: var(--accent); color: #fff; }

/* privacy share list (profile) */
.share-list { margin-top: 14px; display: flex; flex-direction: column; transition: opacity .15s; }
.share-list.off { opacity: .45; }
.share-head { font-family: var(--display); text-transform: uppercase; letter-spacing: .06em; font-size: 10.5px; color: var(--faint); margin-bottom: 4px; }
.share-item { display: flex; gap: 11px; align-items: flex-start; padding: 8px 0; cursor: pointer; }
.share-item input { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--accent); flex: 0 0 auto; }
.share-text { display: flex; flex-direction: column; }
.share-name { color: var(--fg); font-size: 14px; }
.share-hint { color: var(--muted); font-size: 12px; margin-top: 1px; }

/* profile 2-column (record | settings); danger zone + inbox stay full-width */
.profile-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); gap: 22px; align-items: start; }
.profile-cols > .profile-col { margin-top: 22px !important; }
@media (max-width: 760px) { .profile-cols { grid-template-columns: 1fr; gap: 0; } }

/* leaderboard winner -> public profile link */
a.lb-link { text-decoration: none; }
a.lb-link:hover { text-decoration: underline; text-underline-offset: 2px; color: var(--accent-bright); }

.danger-zone {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  border: 1px solid rgba(255, 107, 139, 0.35); border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 107, 139, 0.06), transparent); padding: 18px;
}
.btn.danger { border-color: rgba(255, 107, 139, 0.5); color: var(--bad); background: transparent; }
.btn.danger:hover { background: rgba(255, 107, 139, 0.12); border-color: var(--bad); }

/* ============================================================
   Games pages
   ============================================================ */
.game-emoji { font-size: 32px; line-height: 1; width: 42px; text-align: center; flex: none; filter: drop-shadow(0 3px 10px rgba(166, 120, 255, 0.4)); }
.game-emoji.big { font-size: clamp(48px, 12vw, 68px); width: auto; }

/* animated game icon: looping clip over the emoji (which shows until it paints) */
.game-icon {
  position: relative; display: inline-grid; place-items: center; flex: none;
  border-radius: 11px; overflow: hidden; line-height: 1;
  background: color-mix(in srgb, var(--game-accent, var(--accent)) 16%, var(--panel-2));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--game-accent, var(--accent)) 34%, transparent);
}
.game-icon-fallback { grid-area: 1 / 1; }
.game-anim { grid-area: 1 / 1; width: 100%; height: 100%; object-fit: cover; display: block; }
.game-card { display: flex; flex-direction: column; gap: 10px; text-decoration: none; transition: border-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease; }
.game-card:hover, .game-card:focus-visible { border-color: var(--game-accent); text-decoration: none; }
.game-card:hover .game-name { color: var(--game-accent); }
.gc-top { display: flex; align-items: center; gap: 12px; }
.gc-top .pill { margin-left: auto; flex: none; white-space: nowrap; }
.game-name { font-family: var(--display); font-size: 21px; text-transform: uppercase; letter-spacing: .02em; line-height: 1.1; color: var(--fg); min-height: 2.2em; }
.gc-format { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.gc-tagline { color: var(--body); font-size: 14.5px; line-height: 1.45; margin: 0; }
.gc-howto { margin-top: auto; padding-top: 2px; color: var(--game-accent); font-family: var(--display); font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; }
/* two-button card footer (How to play + Play demo) */
.gc-actions { margin-top: auto; padding-top: 6px; display: flex; gap: 8px; }
.gc-actions .gc-btn { flex: 1; justify-content: center; text-align: center; }

.game-hero { display: flex; align-items: center; gap: 20px; }

ol.how-steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; gap: 12px; }
ol.how-steps li {
  position: relative; padding: 13px 16px 13px 54px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel), var(--ground-2)); color: var(--body);
}
ol.how-steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%;
  background: linear-gradient(160deg, var(--accent-bright), var(--deep));
  color: #fff; font-family: var(--display); font-weight: 800; font-size: 13px;
}

.card.special { display: flex; flex-direction: column; gap: 4px; }
.special-name { font-family: var(--display); text-transform: uppercase; letter-spacing: .06em; color: var(--game-accent, var(--accent-bright)); font-size: 13px; }
.special-desc { color: var(--body); font-size: 14px; }

/* board preview on rules pages */
.board-preview { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px; background: var(--ground-2); overflow-x: auto; }
.board-preview.embed { padding: 0; overflow: hidden; }
.board-embed { width: 100%; height: 560px; border: 0; display: block; background: var(--ground); }
@media (max-width: 560px) { .board-embed { height: 640px; } }

/* ============================================================
   Live engine (host console + play)
   ============================================================ */
.tb-host-grid { display: grid; grid-template-columns: 1fr 240px; gap: 18px; align-items: start; }
@media (max-width: 760px) { .tb-host-grid { grid-template-columns: 1fr; } .tb-host-grid aside { order: -1; } }

.tb-ladder { display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; background: linear-gradient(180deg, var(--panel), var(--ground-2)); position: sticky; top: 76px; }
.tb-rung { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; color: var(--muted); font-size: 13px; }
.tb-rung .tb-num { font-family: var(--display); width: 1.7em; text-align: center; color: var(--faint); }
.tb-rung .tb-val { font-family: var(--display); font-variant-numeric: tabular-nums; }
.tb-rung .tb-safe { color: var(--accent); margin-left: auto; }
.tb-rung.safe { color: var(--body); }
.tb-rung.active { background: linear-gradient(90deg, var(--deep), transparent); color: #fff; box-shadow: inset 0 0 0 1px var(--line-strong); }
.tb-rung.active .tb-num, .tb-rung.active .tb-val { color: #fff; }
.tb-rung.secured { color: var(--good); }
.tb-rung.secured .tb-val, .tb-rung.secured .tb-num { color: var(--good); }

button.opt { cursor: pointer; text-align: left; font-family: inherit; }
button.opt:hover { border-color: var(--accent); }
button.opt[disabled] { cursor: not-allowed; }
/* Tractor Beam — selected answer / crowd vote glows */
.opt.tb-answer { transition: box-shadow .15s, border-color .15s, transform .1s; }
.opt.tb-answer:not([disabled]):hover { border-color: var(--accent); }
.opt.tb-answer.picked {
  border-color: var(--accent-bright);
  background: linear-gradient(180deg, rgba(166,120,255,0.28), rgba(166,120,255,0.10));
  box-shadow: 0 0 0 2px var(--accent-bright), 0 0 22px -2px var(--accent), 0 0 40px -8px var(--accent);
  animation: tb-glow 1.6s ease-in-out infinite;
}
.opt.tb-answer.picked .letter { color: #fff; }
@keyframes tb-glow {
  0%, 100% { box-shadow: 0 0 0 2px var(--accent-bright), 0 0 18px -4px var(--accent), 0 0 32px -10px var(--accent); }
  50% { box-shadow: 0 0 0 2px var(--accent-bright), 0 0 28px 0 var(--accent), 0 0 52px -6px var(--accent); }
}
@media (prefers-reduced-motion: reduce) { .opt.tb-answer.picked { animation: none; } }

/* Signal Grid board */
.sg-board { display: grid; grid-auto-flow: column; grid-template-columns: repeat(6, minmax(68px, 1fr)); gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.sg-col { display: flex; flex-direction: column; gap: 6px; }
.sg-cat { font-family: var(--display); text-transform: uppercase; font-size: 10.5px; letter-spacing: .03em; text-align: center; color: var(--accent-bright); padding: 7px 4px; background: var(--deep); border-radius: 8px; min-height: 46px; display: grid; place-items: center; line-height: 1.15; }
.sg-cell { border: 1px solid var(--line-strong); background: linear-gradient(180deg, var(--panel-2), var(--panel)); color: var(--accent-bright); font-family: var(--display); font-variant-numeric: tabular-nums; font-size: 15px; padding: 8px 4px; border-radius: 8px; text-align: center; min-height: 52px; display: grid; place-items: center; }
button.sg-cell { cursor: pointer; }
button.sg-cell:hover { border-color: var(--accent); }
.sg-cell.used { opacity: 0.22; color: var(--faint); background: var(--ground-2); cursor: default; border-color: var(--line); }
.sg-board-play .sg-cell { cursor: default; }

.sg-buzz { display: block; width: 100%; margin-top: 18px; padding: 26px; font-family: var(--display); font-size: clamp(26px, 8vw, 36px); letter-spacing: .12em; text-transform: uppercase; color: #fff; background: radial-gradient(circle at 50% 30%, var(--live), #8a0f2a); border: none; border-radius: var(--radius-lg); cursor: pointer; box-shadow: 0 12px 30px -10px rgba(255, 77, 109, .7); animation: buzzpulse 1.1s ease-in-out infinite; }
.sg-buzz:active { transform: scale(0.98); }
@keyframes buzzpulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.02); } }
@media (prefers-reduced-motion: reduce) { .sg-buzz { animation: none; } }

/* Hive Mind */
.hm-scores { display: flex; gap: 12px; }
.hm-team { flex: 1; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); font-family: var(--display); text-transform: uppercase; letter-spacing: .03em; color: var(--body); }
.hm-team.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.hm-team span:last-child { color: var(--accent-bright); font-size: 22px; }
.hm-strikes { margin: 14px 0; font-size: 17px; letter-spacing: .18em; color: var(--body); }
.hm-board { display: grid; gap: 8px; }
.hm-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: linear-gradient(180deg, var(--panel-2), var(--panel)); color: var(--muted); text-align: left; font-family: inherit; width: 100%; }
button.hm-row { cursor: pointer; }
button.hm-row:hover { border-color: var(--accent); }
.hm-row.revealed { color: var(--fg); border-color: var(--good); }
.hm-rank { font-family: var(--display); color: var(--accent-bright); width: 1.5em; text-align: center; }
.hm-ans { flex: 1; font-size: 16px; letter-spacing: .04em; }
.hm-pts { font-family: var(--display); color: var(--good); font-variant-numeric: tabular-nums; }

/* Capstone pyramid */
.cs-pyramid { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.cs-level { display: grid; place-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--faint); font-family: var(--display); font-size: 13px; }
.cs-level.lit { background: linear-gradient(160deg, var(--accent-bright), var(--deep)); color: #fff; border-color: var(--accent); }

/* Orbit board */
/* Orbit — Wheel-style tile board: whole words wrap, letters never split */
.or-board {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 12px 22px; /* row-gap, word-gap */
  background: var(--ground); border: 1px solid var(--line-strong);
  border-radius: var(--radius); padding: 22px 16px; min-height: 60px;
}
.or-word { display: inline-flex; gap: 5px; } /* small gap between letters; word never wraps */
.or-tile {
  width: clamp(23px, 6vw, 34px); height: clamp(32px, 8vw, 46px);
  display: grid; place-items: center;
  background: #fff; border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(20, 9, 31, 0.2), 0 1px 2px rgba(0, 0, 0, 0.4);
  color: #14091f; font-family: var(--display); font-size: clamp(17px, 4.5vw, 26px);
  text-transform: uppercase; line-height: 1;
}
.or-tile.on { animation: or-flip 0.28s ease; }
/* Orbit — octagon spin wheel (host) */
.or-wheelwrap { max-width: 260px; margin: 16px auto 6px; }
.or-wheel { width: 100%; height: auto; display: block; filter: drop-shadow(0 6px 16px rgba(0, 0, 0, .4)); }
.or-wheel .or-wlabel { font-family: var(--display); font-weight: 800; fill: #fff; paint-order: stroke; stroke: rgba(0, 0, 0, .3); stroke-width: .5px; }
.or-wheel .or-wlabel.bad { fill: #ff6b8b; }
.or-wheel .or-wlabel.worm { fill: var(--accent-bright); }
.or-wheel .or-ptr { fill: var(--accent-bright); }
@keyframes or-flip { 0% { transform: rotateX(90deg); } 100% { transform: rotateX(0); } }
@media (prefers-reduced-motion: reduce) { .or-tile.on { animation: none; } }
.or-punct {
  display: grid; place-items: center; min-width: 12px; align-self: center;
  color: var(--fg); font-family: var(--display); font-size: clamp(17px, 4.5vw, 26px);
}
.or-cat { color: var(--accent-bright); font-family: var(--display); text-transform: uppercase; letter-spacing: .1em; font-size: 12px; margin-top: 10px; }

.score-chip.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

/* ============================================================
   Concept demos
   ============================================================ */
/* Redact or No Redact */
.rd-wrap { display: grid; grid-template-columns: 1fr 168px; gap: 20px; align-items: start; }
@media (max-width: 640px) { .rd-wrap { grid-template-columns: 1fr; } .rd-wrap aside { order: -1; } }
.rd-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.rd-file { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; aspect-ratio: 3 / 4; border: 1px solid var(--line-strong); border-radius: 10px; background: repeating-linear-gradient(135deg, #1a1020, #1a1020 6px, #150b26 6px, #150b26 12px); color: var(--muted); font-family: var(--display); }
button.rd-file { cursor: default; }
button.rd-file.live { cursor: pointer; }
button.rd-file.live:hover { border-color: var(--accent); color: var(--fg); }
.rd-file .rd-num { font-size: 20px; color: var(--accent-bright); }
.rd-file .rd-tag { font-size: 8px; letter-spacing: .14em; color: var(--faint); }
.rd-file.held { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: linear-gradient(180deg, var(--deep), var(--ground-2)); color: #fff; }
.rd-file.held .rd-tag { color: var(--accent-bright); }
.rd-file.opened { opacity: .4; background: var(--ground-2); border-style: dashed; }
.rd-file .rd-val { font-size: 13px; color: var(--good); }
.rd-ladder { display: flex; gap: 8px; }
.rd-ladder-col { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.rd-rung { padding: 6px 8px; border-radius: 6px; background: var(--panel-2); color: var(--accent-bright); font-family: var(--display); font-variant-numeric: tabular-nums; font-size: 12px; text-align: center; }
.rd-rung.out { opacity: .25; text-decoration: line-through; color: var(--faint); }
.rd-offer, .rd-result { text-align: center; border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 20px; background: radial-gradient(400px 160px at 50% 0%, rgba(255, 107, 139, .15), transparent 70%), var(--panel); }
.rd-offer-label { font-family: var(--display); text-transform: uppercase; letter-spacing: .14em; font-size: 11px; color: var(--bad); }
.rd-offer-amt { font-family: var(--display); font-size: 40px; color: #fff; margin-top: 6px; }

/* ============================================================
   Loading shimmer
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, var(--panel) 25%, var(--panel-2) 37%, var(--panel) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

/* ============================================================
   Control Room — tabs + content workbench
   ============================================================ */
.field { display: block; }
.field + .field { margin-top: 12px; }

.tabbar {
  display: flex; gap: 6px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  margin: 4px 0 22px; padding-bottom: 0;
}
/* On desktop the wider container fits every tab, so keep them on one row. */
@media (min-width: 900px) { .tabbar { flex-wrap: nowrap; } .tabbar .tab { flex: 0 0 auto; } }
.tab {
  appearance: none; background: transparent; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 16px; margin-bottom: -1px;
  font-family: var(--display); text-transform: uppercase; letter-spacing: .05em;
  font-size: 13px; color: var(--muted);
  border-bottom: 2px solid transparent; border-radius: 8px 8px 0 0;
  transition: color .15s, background .15s, border-color .15s;
}
.tab:hover { color: var(--body); background: rgba(166,120,255,.06); }
.tab.on { color: var(--fg); border-bottom-color: var(--accent); }
.tab .tab-ic { font-size: 14px; }
.tab-label { display: inline; }
.tab-active-label { display: none; }
.tab-panel { min-height: 200px; }
.tab-intro { margin-bottom: 4px; }
/* Mobile: collapse the Control Room tabs to a single row of icons; show the
   selected tab's title beneath the row. Only the Control Room uses .tabbar. */
@media (max-width: 640px) {
  .tabbar { flex-wrap: nowrap; gap: 2px; justify-content: space-between; margin-bottom: 8px; }
  .tab { flex: 1 1 0; min-width: 0; justify-content: center; gap: 0; padding: 10px 4px; }
  .tab .tab-ic { font-size: 22px; }
  .tab .tab-label { display: none; }
  .tab-active-label {
    display: block; text-align: center;
    font-family: var(--display); text-transform: uppercase; letter-spacing: .09em;
    font-size: 13px; color: var(--fg); margin: 0 0 18px;
  }
}

/* People roster table (Control Room) */
.ppl-toolbar { display: flex; align-items: center; gap: 14px; margin: 16px 0 10px; flex-wrap: wrap; }
.ppl-toolbar .text-input { max-width: 340px; }
.ppl-count { font-family: var(--display); text-transform: uppercase; letter-spacing: .08em; font-size: 11px; color: var(--faint); }
.ppl-grid { display: flex; flex-direction: column; }
.ppl-row { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1.5fr) 0.8fr minmax(0, 1.35fr); gap: 12px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.ppl-head { font-family: var(--display); text-transform: uppercase; letter-spacing: .08em; font-size: 10.5px; color: var(--faint); border-bottom: 1px solid var(--line-strong); }
.ppl-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ppl-namewrap { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
/* the view group wraps; only the NAME itself ellipsises, so the Edit button
   beside it can never be clipped out of reach on a narrow screen */
.ppl-nameview { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.ppl-nameview[hidden] { display: none; }
.ppl-name { color: var(--fg); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ppl-noname { color: var(--faint); font-style: italic; font-weight: 500; }
.ppl-you { font-size: 9.5px; color: var(--faint); border: 1px solid var(--line); border-radius: 999px; padding: 1px 6px; text-transform: uppercase; letter-spacing: .06em; }
.ppl-joined { color: var(--muted); font-size: 13px; }
.ppl-role { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ppl-role .save-msg { min-height: 0; margin: 0; font-size: 12px; }

/* managers see no email column at all — fall back to the original 3 tracks */
.ppl-grid.no-email .ppl-row { grid-template-columns: minmax(0, 1.7fr) 0.9fr minmax(0, 1.4fr); }

/* email column — the only handle a no-username account has */
.ppl-email { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ppl-noemail { color: var(--faint); }

/* inline username editor (admins+) */
.ppl-editname {
  background: none; border: 1px solid var(--line); color: var(--faint);
  border-radius: 999px; padding: 1px 8px; font-size: 10px; cursor: pointer;
  text-transform: uppercase; letter-spacing: .06em; line-height: 1.7;
}
.ppl-editname:hover { color: var(--fg); border-color: var(--line-strong); }
.ppl-nameedit { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.ppl-nameedit[hidden] { display: none; }
.ppl-nameinput { width: auto; max-width: 170px; padding: 6px 9px; font-size: 13.5px; }
.ppl-namewrap .save-msg { min-height: 0; margin: 0; font-size: 12px; }
.btn-mini {
  border: 1px solid var(--line-strong); background: var(--accent);
  color: #0a0710; border-radius: 6px; padding: 5px 10px;
  font-size: 12px; font-weight: 600; cursor: pointer;
}
.btn-mini.ghost { background: none; color: var(--muted); border-color: var(--line); }
.btn-mini:disabled { opacity: .55; cursor: default; }
.ppl-rolesel { width: auto; min-width: 118px; padding: 8px 10px; font-size: 14px; }
.ppl-rolepill.r-superadmin { border-color: var(--accent); color: var(--accent-bright); }
.ppl-rolepill.r-admin { border-color: #63e6b8; color: #63e6b8; }
.ppl-rolepill.r-manager { border-color: #ffcf6b; color: #ffcf6b; }
@media (max-width: 600px) {
  .ppl-row { grid-template-columns: 1fr auto; row-gap: 2px; padding: 12px 4px; }
  .ppl-head { display: none; }
  /* stack: name (1,1) / email (2,1) / joined (3,1), role spans the right edge */
  .ppl-email { grid-column: 1; grid-row: 2; font-size: 11.5px; }
  .ppl-joined { grid-column: 1; grid-row: 3; font-size: 11.5px; color: var(--faint); }
  .ppl-role { grid-column: 2; grid-row: 1 / span 3; }
  /* no email cell for managers — joined moves up, role spans two rows */
  .ppl-grid.no-email .ppl-joined { grid-row: 2; }
  .ppl-grid.no-email .ppl-role { grid-row: 1 / span 2; }
  .ppl-nameinput { max-width: 100%; }
}

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--line);
  font-size: 11.5px; font-family: var(--display); letter-spacing: .04em;
  text-transform: uppercase; color: var(--accent-bright);
}
.chip.warn { color: var(--warn); border-color: rgba(255,207,107,.4); }
.chip.val { color: var(--good); font-variant-numeric: tabular-nums; }
.count-pill {
  font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums;
  background: var(--panel-2); border: 1px solid var(--line);
  padding: 2px 10px; border-radius: 999px;
}
.mono-up { font-family: var(--mono); letter-spacing: .12em; text-transform: uppercase; }

/* compose card gets a subtle accent edge */
.compose { border-left: 3px solid var(--game-accent, var(--accent)); }
.compose-kind { font-family: var(--display); text-transform: uppercase; letter-spacing: .04em; color: var(--fg); font-size: 15px; }

/* MCQ option inputs */
.opt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .opt-grid { grid-template-columns: 1fr; } }
.opt-input {
  display: flex; align-items: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 6px 8px;
}
.opt-input:focus-within { border-color: var(--line-strong); }
.opt-input input[type="radio"] { width: 17px; height: 17px; accent-color: var(--good); flex: none; cursor: pointer; }
.opt-input .opt-letter {
  font-family: var(--display); color: var(--accent-bright); font-size: 14px;
  width: 20px; text-align: center; flex: none;
}
.opt-input .text-input { border: 0; background: transparent; padding: 6px 4px; }
.opt-input .text-input:focus { outline: none; }

/* question bank cards */
.q-card { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 10px; }
.q-head { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.q-prompt { color: var(--fg); font-weight: 600; line-height: 1.35; }
.q-ans { margin-top: 8px; color: var(--muted); font-size: 13px; }
.q-ans strong { color: var(--good); }
.q-opts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.q-opt {
  font-size: 12.5px; padding: 3px 9px; border-radius: 7px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--body);
}
.q-opt.correct { border-color: rgba(99,230,184,.5); color: var(--good); background: rgba(99,230,184,.08); }
.q-words { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.wchip { font-size: 12.5px; padding: 3px 9px; border-radius: 7px; background: var(--panel-2); border: 1px solid var(--line); color: var(--accent-bright); }
.q-actions { display: flex; gap: 6px; flex: none; }

/* survey management cards */
.sv-card { margin-bottom: 12px; }
.sv-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sv-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.sv-board { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.sv-row { display: flex; align-items: center; gap: 10px; }
.sv-rank {
  font-family: var(--display); color: var(--accent); width: 22px; flex: none;
  text-align: center; font-variant-numeric: tabular-nums;
}
.sv-ans { color: var(--fg); min-width: 90px; flex: 1; font-size: 14px; }
.sv-bar { flex: 2; height: 8px; background: var(--panel-2); border-radius: 999px; overflow: hidden; min-width: 60px; }
.sv-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-dim), var(--accent)); border-radius: 999px; }
.sv-pts { color: var(--accent-bright); font-variant-numeric: tabular-nums; width: 34px; text-align: right; flex: none; }
.sv-preview { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }

/* session rows + setup readiness */
.session-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.session-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ready { color: var(--good); }
.unset { color: var(--warn); }

/* setup overlay sheet */
.setup-overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(6,3,12,.72); backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px; overflow-y: auto;
}
.setup-sheet {
  width: 100%; max-width: 620px; background: var(--panel); border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  display: flex; flex-direction: column; max-height: calc(100vh - 80px);
}
.setup-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 22px 14px; border-bottom: 1px solid var(--line); }
.setup-head > div:first-child { flex: 1; }
.setup-body { padding: 18px 22px; overflow-y: auto; }
.setup-foot { display: flex; align-items: center; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.icon-btn {
  appearance: none; background: var(--panel-2); border: 1px solid var(--line);
  color: var(--muted); width: 34px; height: 34px; border-radius: 9px; cursor: pointer; flex: none;
  font-size: 15px; line-height: 1;
}
.icon-btn:hover { color: var(--fg); border-color: var(--line-strong); }

.pick-list { display: flex; flex-direction: column; gap: 8px; }
.pick {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 11px 13px; cursor: pointer; transition: border-color .12s, background .12s;
}
.pick:hover { border-color: var(--line-strong); }
.pick:has(input:checked) { border-color: var(--accent); background: rgba(166,120,255,.07); }
.pick input { margin-top: 2px; width: 17px; height: 17px; accent-color: var(--accent); flex: none; cursor: pointer; }
.pick span { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pick strong { color: var(--fg); font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.pick small { color: var(--muted); font-size: 12px; }
.pick.none strong, .pick.none span { color: var(--muted); }

/* ============================================================
   Audience survey page (survey.html)
   ============================================================ */
.survey-hero { text-align: center; padding: 10px 0; }
.survey-hero h1 { font-size: clamp(30px,7vw,50px); text-transform: uppercase; letter-spacing: .03em; margin: 12px 0 0; line-height: 1; }
.survey-tile { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.survey-q { flex: 1; color: var(--fg); font-weight: 600; font-size: 16px; }
.survey-go { color: var(--accent-bright); font-family: var(--display); text-transform: uppercase; letter-spacing: .04em; font-size: 12px; flex: none; }
.survey-card { padding: 26px; }
.survey-question { font-size: clamp(24px,5vw,34px); text-transform: none; letter-spacing: 0; margin: 8px 0 0; line-height: 1.1; }
.survey-thanks { text-align: center; padding: 20px 0 8px; }
.survey-check {
  width: 62px; height: 62px; margin: 0 auto 14px; border-radius: 50%;
  display: grid; place-items: center; font-size: 30px; color: var(--good);
  background: rgba(99,230,184,.12); border: 1px solid rgba(99,230,184,.45);
}
.survey-thanks h2 { font-size: 28px; text-transform: uppercase; letter-spacing: .03em; margin: 0; }

/* host: load a pre-set question from the show's bank */
.host-bank { border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 14px; background: rgba(166,120,255,.04); }
.host-bank-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.host-bank-head > span:last-child { color: var(--muted); font-size: 12px; }
.host-bank-list { display: flex; flex-direction: column; gap: 6px; max-height: 210px; overflow-y: auto; }
.host-bank-item {
  appearance: none; text-align: left; cursor: pointer;
  display: flex; flex-direction: column; gap: 2px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 11px;
  transition: border-color .12s, background .12s;
}
.host-bank-item:hover { border-color: var(--line-strong); }
.host-bank-item.on { border-color: var(--accent); background: rgba(166,120,255,.09); }
.hb-q { color: var(--fg); font-size: 13.5px; font-weight: 600; }
.hb-a { color: var(--good); font-size: 12px; }
.host-bank-hint { color: var(--muted); font-size: 12px; margin: 0 0 12px; }

/* ============================================================
   Signal Grid — Daily Double clip + Final Signal (wager + drawing)
   ============================================================ */
.video-overlay {
  position: fixed; inset: 0; z-index: 120; /* above modals (100) — the synced clip is the focus */
  background: radial-gradient(1200px 600px at 50% 40%, rgba(59,15,110,.5), #05030a 75%);
  display: grid; place-items: center; padding: 20px;
}
.video-frame { width: min(94vw, 1100px); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.video-16x9 { width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow), 0 0 0 1px var(--line-strong); }
.video-16x9 iframe { width: 100%; height: 100%; border: 0; display: block; }
.video-badge { font-family: var(--display); text-transform: uppercase; letter-spacing: .14em; color: var(--accent-bright); font-size: 13px; }
.video-note { color: var(--muted); font-size: 13px; }
.video-stop { }

.sg-video-ctl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; padding: 10px 12px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); background: rgba(166,120,255,.04); }

/* host: final review grid */
.fin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.fin-card { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); padding: 10px; }
.fin-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.fin-top strong { color: var(--fg); }
.fin-draw { width: 100%; aspect-ratio: 60 / 28; object-fit: contain; background: #fff; border-radius: 6px; display: block; }
.fin-draw.empty { display: grid; place-items: center; color: var(--muted); font-size: 12px; background: var(--panel-2); }
.fin-judge { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

/* player: wager + drawing pad */
.fin-wager { display: flex; align-items: center; gap: 6px; max-width: 220px; margin: 0 auto; }
.fin-wager span { font-family: var(--display); font-size: 22px; color: var(--accent-bright); }
.fin-wager .text-input { text-align: center; font-size: 20px; font-variant-numeric: tabular-nums; }
.fin-pad-wrap { margin-top: 12px; }
.fin-pad { width: 100%; height: auto; aspect-ratio: 600 / 280; background: #fff; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); touch-action: none; cursor: crosshair; display: block; }
.fin-locked { text-align: center; color: var(--good); font-size: 18px; font-family: var(--display); letter-spacing: .02em; padding: 18px 0; }

/* ============================================================
   Leaderboard
   ============================================================ */
.lb-hero { text-align: center; padding: 8px 0 30px; }
.lb-title { font-size: clamp(34px, 8vw, 62px); text-transform: uppercase; letter-spacing: .04em; margin: 12px 0 0; line-height: .95;
  background: linear-gradient(174deg, #fff 34%, var(--accent-bright) 82%, var(--accent) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.lb-games { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr)); gap: 18px; }
.lb-game { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 16px; border-top: 3px solid var(--game-accent, var(--accent)); }
.lb-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.lb-head .game-emoji { font-size: 28px; }
.lb-game-name { font-size: 20px; text-transform: uppercase; letter-spacing: .03em; color: var(--fg); }
.lb-game-fmt { color: var(--muted); font-size: 12px; }
.lb-list { display: flex; flex-direction: column; gap: 6px; }
.lb-loading, .lb-empty { color: var(--muted); font-size: 13px; padding: 14px 6px; }
.lb-empty { border: 1px dashed var(--line); border-radius: var(--radius-sm); text-align: center; }
.lb-row { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--radius-sm); background: var(--ground-2); }
.lb-row.top { background: linear-gradient(100deg, color-mix(in srgb, var(--game-accent) 12%, var(--ground-2)), var(--ground-2)); }
.lb-rank { width: 30px; text-align: center; font-size: 20px; flex: none; }
.lb-rank .lb-num { font-family: var(--display); color: var(--muted); font-size: 15px; }
.lb-main { flex: 1; min-width: 0; }
.lb-winner { color: var(--fg); font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-outcome { color: var(--body); font-size: 12.5px; margin-top: 2px; }
.lb-meta { text-align: right; flex: none; }
.lb-score { display: block; font-family: var(--display); color: var(--game-accent, var(--accent-bright)); font-size: 16px; font-variant-numeric: tabular-nums; }
.lb-date { color: var(--faint); font-size: 11px; }
@media (max-width: 480px) { .lb-outcome { white-space: normal; } }

/* ============================================================
   Home: open-survey notice + survey cards
   ============================================================ */
.survey-banner {
  display: flex; align-items: center; gap: 12px; text-decoration: none;
  margin: 0 0 26px; padding: 13px 18px; border-radius: var(--radius);
  background: linear-gradient(100deg, rgba(255,122,217,.14), rgba(166,120,255,.10));
  border: 1px solid rgba(255,122,217,.34);
  transition: border-color .15s, transform .12s;
}
.survey-banner:hover { border-color: rgba(255,122,217,.6); transform: translateY(-1px); }
.survey-banner .sb-dot {
  width: 10px; height: 10px; border-radius: 50%; background: #ff7ad9; flex: none;
  box-shadow: 0 0 0 0 rgba(255,122,217,.6); animation: sb-pulse 1.8s ease-out infinite;
}
@keyframes sb-pulse { 0% { box-shadow: 0 0 0 0 rgba(255,122,217,.55); } 70% { box-shadow: 0 0 0 9px rgba(255,122,217,0); } 100% { box-shadow: 0 0 0 0 rgba(255,122,217,0); } }
@media (prefers-reduced-motion: reduce) { .survey-banner .sb-dot { animation: none; } }
.survey-banner .sb-text { flex: 1; color: var(--body); font-size: 14px; }
.survey-banner .sb-text strong { color: var(--fg); }
.survey-banner .sb-go { color: var(--accent-bright); font-family: var(--display); text-transform: uppercase; letter-spacing: .05em; font-size: 12px; flex: none; }

.pill.new { color: #ff7ad9; border-color: rgba(255,122,217,.4); }
.survey-home-card { display: flex; flex-direction: column; gap: 12px; text-decoration: none; --game-accent: #ff7ad9; }
.survey-home-q { color: var(--fg); font-size: 18px; letter-spacing: 0; text-transform: none; line-height: 1.2; }

/* Surveys tab: release-a-player panel */
.sv-release { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.sv-release .setting-label { display: block; margin-bottom: 8px; }

/* ============================================================
   Mobile refinements (appended last so they win at these widths)
   Small-screen tightening for game boards and dense controls that
   otherwise force horizontal scroll or shrink below comfortable
   tap/read sizes on phones. Purely additive @media rules.
   ============================================================ */
@media (max-width: 560px) {
  /* Signal Grid: keep all 6 category columns but shrink them to fit a
     phone instead of side-scrolling the board. */
  .sg-board { grid-template-columns: repeat(6, minmax(42px, 1fr)); gap: 4px; }
  /* People roster (Control Room) search + role select stop forcing width. */
  .ppl-toolbar .text-input { max-width: 100%; }
  .ppl-rolesel { min-width: 0; }
}
@media (max-width: 520px) {
  /* Cookie bar: let the copy shrink and the buttons take a full row. */
  .cookie-txt { min-width: 0; }
  .cookie-btns { margin-left: 0; width: 100%; }
}
@media (max-width: 440px) {
  /* Redact demo: 4 cramped tiles -> 2 comfortable ones. */
  .rd-grid { grid-template-columns: repeat(2, 1fr); }
  /* Feedback modal: keep the three type chips on one row in a narrow modal. */
  .fb-type { min-width: 70px; }
}
@media (max-width: 390px) {
  /* Orbit: lift the letter tiles off their tiny floor on small phones. */
  .or-tile { width: clamp(26px, 7vw, 34px); height: clamp(36px, 9.5vw, 46px); font-size: clamp(18px, 5vw, 26px); }
}
