/* ==========================================================================
   playgta.es — "Sunset Strip" design system (v2, night palette)
   An original, fan-made look: a city at night with pastel sunset accents.
   Patterns (pill buttons, condensed headings, pastel accents, soft glows)
   follow docs/design-research.md. No third-party logos, lettering, fonts
   or artwork are used; the brand mark is our own striped sun.

   Layers:
     1. Tokens        (:root custom properties — the only place raw values live)
     2. Base          (reset, typography defaults, focus)
     3. Components    (.btn, .input, .card, .badge, .eyebrow, .tabs, kbd, .link…)
     4. Page layout   (header, hero + live stage, sections, footer)
     5. Accessibility (reduced motion)
   ========================================================================== */

/* ---------- 1. Tokens ---------- */

:root {
  color-scheme: dark;

  /* Color · palette primitives (do not use directly in components) */
  --night-950: #0c0d1b;
  --night-900: #11122a;
  --night-850: #15172f;
  --night-800: #1c1e3d;
  --night-700: #282a52;
  --plum-700: #31223e;
  --plum-500: #583660;
  --cream-100: #fff9cb;
  --lavender-50: #f4f1ff;
  --lavender-100: #f1eaff;
  --lavender-300: #ccc2f5;
  --lavender-400: #aaa3cf;
  --pink-100: #fecedd;
  --pink-300: #ffb2c6;
  --pink-400: #fc97b1;
  --pink-500: #ff8aa9;
  --pink-ink: #5d3955;
  --hotpink-400: #f976b0;
  --peach-300: #ffd4a8;
  --peach-400: #ffbf80;
  --lime-300: #e6ffa3;
  --lime-400: #d4f57a;
  --mint-300: #b8f0ea;
  --red-300: #ff9aa6;
  --red-500: #ff6b7d;
  --ink-900: #070810;
  --white: #fff;
  --black: #000;

  /* Color · semantic (what components use) */
  --color-bg: var(--night-950);
  --color-bg-raised: var(--night-850);
  --color-surface: rgba(21, 23, 47, 0.72);
  --color-surface-solid: var(--night-850);
  --color-surface-raised: var(--night-800);
  --color-surface-subtle: rgba(255, 255, 255, 0.06);
  --color-surface-hover: rgba(255, 255, 255, 0.12);
  --color-well: rgba(0, 0, 0, 0.32);
  --color-scrim: rgba(12, 13, 27, 0.72);
  --color-border: rgba(255, 255, 255, 0.08);
  --color-border-strong: rgba(255, 255, 255, 0.5);
  --color-border-soft: rgba(255, 255, 255, 0.16);
  --color-heading: var(--cream-100);
  --color-text: var(--lavender-50);
  --color-text-soft: var(--lavender-300);
  --color-text-muted: var(--lavender-400);
  --color-eyebrow: var(--lavender-100);
  --color-text-on-bright: var(--ink-900);
  --color-brand: var(--pink-300);
  --color-brand-hover: var(--pink-500);
  --color-hero-cta: var(--pink-100);
  --color-hero-cta-text: var(--pink-ink);
  --color-highlight: var(--peach-300);
  --color-accent: var(--lime-300);
  --color-focus: var(--pink-300);
  --color-success: var(--mint-300);
  --color-warning: var(--peach-300);
  --color-warning-text: var(--peach-300);
  --color-danger: var(--red-500);
  --color-danger-text: var(--red-300);
  --color-live: var(--pink-300);

  /* Gradients & scrims */
  --grad-text: linear-gradient(90deg, var(--peach-300), var(--pink-300) 55%, var(--hotpink-400));
  --grad-sun: linear-gradient(180deg, var(--peach-300) 0%, var(--pink-300) 55%, var(--hotpink-400) 100%);
  --grad-hero:
    radial-gradient(55% 60% at 85% 0%, rgba(88, 54, 96, 0.75), transparent 70%),
    radial-gradient(45% 55% at 0% 100%, rgba(207, 119, 188, 0.22), transparent 70%),
    radial-gradient(40% 40% at 55% 105%, rgba(255, 197, 150, 0.14), transparent 70%),
    linear-gradient(rgba(48, 25, 88, 0.2) 0%, transparent 30%);
  --scrim-media: radial-gradient(100% 120% at 50% 50%, rgba(12, 13, 27, 0.55) 0%, rgba(12, 13, 27, 0.85) 60%, var(--color-bg) 100%);
  --fade-bottom: linear-gradient(#000 60%, rgba(0, 0, 0, 0.3) 80%, transparent);

  /* Typography · families (free, open-licensed) */
  --font-display: "Big Shoulders Display", "Oswald", "Arial Narrow", Impact, sans-serif;
  --font-body: "Jost", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Typography · scale */
  --text-display: clamp(40px, 3.6vw, 56px);
  --text-h1: clamp(44px, 6vw, 84px);
  --text-h2: 28px;
  --text-h3: 20px;
  --text-numeral: clamp(56px, 5vw, 72px);
  --text-lg: 18px;
  --text-body: 16px;
  --text-sm: 14px;
  --text-xs: 12px;
  --text-eyebrow: 17px;

  /* Typography · weights */
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-black: 800;

  /* Typography · letter-spacing */
  --tracking-body: -0.015em;
  --tracking-ui: -0.005em;
  --tracking-display: 0;
  --tracking-caps: 0.02em;
  --tracking-eyebrow: 0.08em;
  --tracking-wide: 0.15em;

  /* Typography · line-height */
  --leading-none: 1;
  --leading-display: 0.9;
  --leading-snug: 1.25;
  --leading-body: 1.5;

  /* Spacing (4px base) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --gutter: clamp(16px, 3vw, 40px);
  --section-gap: clamp(64px, 9vw, 128px);

  /* Radii */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-card: 25px;
  --radius-pill: 1000px;

  /* Control heights (pill buttons) */
  --control-sm: 32px;
  --control-md: 40px;
  --control-lg: 48px;
  --control-xl: 56px;

  /* Shadows & glows */
  --glow-cta: 0 2px 56px rgba(255, 179, 199, 0.22);
  --glow-cta-hover: 0 0 28px rgba(255, 178, 198, 0.32), 0 0 110px rgba(255, 178, 198, 0.4);
  --shadow-stage: 0 40px 120px -40px rgba(249, 118, 176, 0.35), 0 0 0 1px var(--color-border);
  --glow-accent: 0 0 0 2px var(--lime-300), 0 30px 100px -30px rgba(230, 255, 163, 0.45);
  --glow-sun: 0 0 18px rgba(255, 178, 198, 0.45);
  --focus-width: 4px;
  --focus-offset: 4px;

  /* Motion */
  --dur-ui: 0.25s;
  --dur-glow: 0.5s;
  --dur-fade: 1s;
  --dur-pulse: 1.6s;
  --ease-ui: ease-in-out;
  --ease-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-sheet: cubic-bezier(0.32, 0.72, 0, 1);

  /* Z-index */
  --z-behind: -1;
  --z-base: 0;
  --z-overlay: 2;
  --z-header: 20;

  /* Layout */
  --width-page: 1560px;
  --width-content: 1200px;
  --width-prose: 820px;
  --width-panel: clamp(320px, 26vw, 380px);
  --header-height: 72px;
}

/* ---------- 2. Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-width: 0;
  overflow-x: hidden;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: var(--weight-regular);
  line-height: var(--leading-body);
  letter-spacing: var(--tracking-body);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
button, input { font: inherit; letter-spacing: inherit; }
code { font-size: 0.9em; }

:focus-visible { outline: var(--focus-width) solid var(--color-focus); outline-offset: var(--focus-offset); }

.muted { color: var(--color-text-muted); font-weight: var(--weight-regular); }
.small { font-size: var(--text-sm); margin-bottom: 0; }

@keyframes blink { 50% { opacity: 0.35; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- 3. Components ---------- */

/* Buttons: pill, sentence case, hover = color change only.
   .btn + --primary | --peach | --secondary | --light | --ghost | --danger | --hero
   sizes --sm 32 | --md 40 (default) | --lg 48 | --xl 56, plus --block */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-width: 96px;
  height: var(--control-md);
  padding: 0 var(--space-5);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-ui);
  line-height: var(--leading-none);
  text-transform: none;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  color: var(--color-text);
  background: var(--color-surface-subtle);
  outline: 2px solid transparent;
  outline-offset: var(--focus-offset);
  transition: color var(--dur-ui) var(--ease-ui), background-color var(--dur-ui) var(--ease-ui),
    border-color var(--dur-ui) var(--ease-ui), outline-color var(--dur-ui) var(--ease-ui);
}
.btn:focus-visible { outline: var(--focus-width) solid var(--color-focus); }
.btn:disabled, .btn[aria-disabled="true"] { cursor: not-allowed; color: #8a8aa0; background: #34354a; border-color: transparent; box-shadow: none; }

.btn--primary { color: var(--color-text-on-bright); background: var(--pink-300); }
.btn--primary:hover:not(:disabled) { background: var(--pink-500); }

.btn--peach { color: var(--color-text-on-bright); background: var(--peach-300); }
.btn--peach:hover:not(:disabled) { background: var(--peach-400); }

.btn--secondary { background: transparent; border-color: var(--color-border-strong); color: var(--white); }
.btn--secondary:hover:not(:disabled) { background: rgba(255, 255, 255, 0.15); }
.btn--secondary:focus-visible { outline-color: var(--white); }

.btn--light { background: rgba(255, 255, 255, 0.9); color: #1a1a1a; }
.btn--light:hover:not(:disabled) { background: var(--white); }

.btn--ghost { background: transparent; color: var(--color-text-soft); }
.btn--ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.1); color: var(--color-text); }

.btn--danger { background: var(--red-500); color: var(--color-text-on-bright); }
.btn--danger:hover:not(:disabled) { background: var(--red-300); }
.btn--danger:focus-visible { outline-color: var(--red-300); }

/* Hero CTA: the one big action, with a soft two-layer pink glow. */
.btn--hero {
  color: var(--color-hero-cta-text);
  background: var(--color-hero-cta);
  font-weight: var(--weight-semibold);
  box-shadow: var(--glow-cta);
  transition: color var(--dur-glow) linear, background-color var(--dur-glow) linear,
    border-color var(--dur-glow) linear, box-shadow var(--dur-glow) linear, outline-color var(--dur-glow) linear;
}
.btn--hero:hover:not(:disabled) { background: var(--pink-300); color: var(--ink-900); box-shadow: var(--glow-cta-hover); }
.btn--hero:focus-visible { box-shadow: var(--glow-cta-hover); outline: var(--focus-width) solid var(--pink-300); }

.btn--sm { height: var(--control-sm); min-width: 0; padding: 0 14px; font-size: var(--text-sm); }
.btn--md { height: var(--control-md); padding: 0 var(--space-5); }
.btn--lg { height: var(--control-lg); padding: 0 var(--space-6); font-size: 17px; }
.btn--xl { height: var(--control-xl); padding: 0 28px; font-size: var(--text-lg); }
.btn--block { display: flex; width: 100%; }

/* Inputs */
.input {
  flex: 1;
  min-width: 0;
  height: var(--control-md);
  padding: 0 var(--space-4);
  font-size: var(--text-body);
  color: var(--color-text);
  background: var(--color-well);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-pill);
  transition: border-color var(--dur-ui) var(--ease-ui), outline-color var(--dur-ui) var(--ease-ui);
  outline: 2px solid transparent;
  outline-offset: 2px;
}
.input--lg { height: var(--control-lg); padding: 0 var(--space-5); }
.input::placeholder { color: var(--color-text-muted); opacity: 1; }
.input:hover { border-color: rgba(255, 255, 255, 0.32); }
.input:focus, .input:focus-visible { border-color: var(--color-brand); outline: 2px solid var(--color-brand); }
.input:disabled { opacity: 0.55; cursor: not-allowed; }
.input[aria-invalid="true"] { border-color: var(--color-danger-text); }

.field { display: grid; gap: var(--space-2); }
.field__label { font-size: var(--text-xs); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--color-eyebrow); }
.field__help { font-size: var(--text-sm); color: var(--color-text-muted); }
.field__help--error { color: var(--color-danger-text); }

.input-group { display: flex; gap: var(--space-2); }

/* Cards: 25px radius. .card + --glass | --solid | --feature | --accent */
.card {
  position: relative;
  min-width: 0;
  padding: var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
}
.card--glass { background: var(--color-surface); backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px); }
.card--solid { background: var(--color-surface-solid); }
.card--feature { padding: var(--space-8); background: var(--color-surface-solid); }
.card--accent { background: linear-gradient(160deg, rgba(255, 178, 198, 0.14), transparent 60%), var(--color-surface-solid); border-color: rgba(255, 178, 198, 0.3); }

.card__eyebrow {
  margin: 0 0 var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-eyebrow);
}
.card__eyebrow .muted { letter-spacing: var(--tracking-caps); text-transform: none; font-size: var(--text-sm); }
.card__title {
  margin: 0 0 var(--space-4);
  font-family: var(--font-display);
  font-weight: var(--weight-black);
  font-size: var(--text-h2);
  line-height: var(--leading-display);
  letter-spacing: var(--tracking-display);
  text-transform: uppercase;
  color: var(--color-heading);
}
.card__title .muted { font-family: var(--font-body); font-size: var(--text-sm); text-transform: none; letter-spacing: var(--tracking-body); }
.card__heading { margin: 0 0 var(--space-2); font-size: var(--text-h3); font-weight: var(--weight-semibold); line-height: var(--leading-snug); color: var(--color-heading); }
.card__body { margin: 0; color: var(--color-text-soft); }

/* Badges: .badge + --live | --status | --ok | --warn | --danger | --outline */
.badge {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  height: 28px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-caps);
  color: var(--color-text-soft);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--color-border);
  white-space: nowrap;
}
.badge--live {
  color: var(--color-text-on-bright);
  background: var(--color-live);
  border-color: transparent;
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}
.badge--outline { background: transparent; border-color: var(--color-border-strong); color: var(--color-text); }
.badge__dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: blink var(--dur-pulse) var(--ease-ui) infinite; }

/* Status: pending (pulsing peach) by default; app.js adds .ok when connected. */
.badge--status::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--color-warning);
  animation: blink var(--dur-pulse) var(--ease-ui) infinite;
}
.badge--status.ok, .badge--ok { color: var(--color-success); }
.badge--status.ok::before { background: var(--color-success); animation: none; }
.badge--warn { color: var(--color-warning-text); }
.badge--danger { color: var(--color-danger-text); }

/* Callouts */
.callout {
  margin: 0 0 var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
}
.callout--warning, .warning {
  background: rgba(255, 212, 168, 0.1);
  border: 1px solid rgba(255, 212, 168, 0.35);
  color: var(--color-warning-text);
}

/* Key caps */
kbd, .keycap {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  padding: 0 var(--space-2);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: var(--weight-semibold);
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--color-border-soft);
  border-bottom-width: 2px;
  border-radius: var(--radius-sm);
}
.keycap--active, .pressed span {
  color: var(--color-text-on-bright);
  background: var(--color-brand);
  border-color: var(--pink-500);
}

/* Eyebrows & headings */
.eyebrow, .section-eyebrow {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-3);
  font-family: var(--font-display);
  font-size: var(--text-eyebrow);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--color-eyebrow);
}
.eyebrow__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-live); box-shadow: 0 0 12px var(--pink-300); animation: blink var(--dur-pulse) var(--ease-ui) infinite; }


.display, .section-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--weight-black);
  line-height: var(--leading-display);
  letter-spacing: var(--tracking-display);
  text-transform: uppercase;
  color: var(--color-heading);
}
.display { font-size: var(--text-display); }
.section-title { margin-bottom: var(--space-8); font-size: var(--text-h1); }
.display__accent, .section-title__accent, .grad {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.display__accent { display: block; }
.section-lede { max-width: 640px; margin: calc(-1 * var(--space-4)) 0 var(--space-8); font-size: var(--text-lg); color: var(--color-text-soft); }

/* Links */
.link {
  color: var(--pink-100);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.2s var(--ease-ui);
}
.link:hover { color: var(--cream-100); }

.nav__link {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-pill);
  text-decoration: none;
  font-size: 13px;
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
  transition: background-color 0.3s var(--ease-ui), color 0.3s var(--ease-ui);
}
.nav__link:hover { background: rgba(255, 255, 255, 0.1); color: var(--white); }

/* Language switch: data-set-lang buttons, aria-pressed marks the current one. */
.lang-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border-soft);
  background: rgba(12, 13, 27, 0.4);
}
.lang-switch__btn {
  height: 28px;
  min-width: 40px;
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-caps);
  color: rgba(255, 255, 255, 0.8);
  background: transparent;
  cursor: pointer;
  outline-offset: 2px;
  transition: background-color var(--dur-ui) var(--ease-ui), color var(--dur-ui) var(--ease-ui);
}
.lang-switch__btn:hover { background: rgba(255, 255, 255, 0.1); color: var(--white); }
.lang-switch__btn[aria-pressed="true"] { background: var(--cream-100); color: var(--color-text-on-bright); }

/* Tabs (controls cheat sheet): segmented pill, works with public/controls-tabs.js */
.tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  padding: var(--space-1);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.06);
}
.tab {
  height: var(--control-md);
  padding: 0 var(--space-5);
  border: 0;
  border-radius: var(--radius-pill);
  font-size: var(--text-body);
  font-weight: var(--weight-semibold);
  color: var(--color-text-soft);
  background: transparent;
  cursor: pointer;
  transition: background-color var(--dur-ui) var(--ease-ui), color var(--dur-ui) var(--ease-ui);
}
.tab:hover { color: var(--white); background: rgba(255, 255, 255, 0.08); }
.tab[aria-selected="true"] { color: var(--color-text-on-bright); background: var(--cream-100); }
.tabpanel { animation: fade-in var(--dur-glow) var(--ease-out); border-radius: var(--radius-md); }

/* Disclosure (FAQ) */
.disclosure {
  border-radius: var(--radius-lg);
  background: var(--color-surface-solid);
  border: 1px solid var(--color-border);
  transition: background-color var(--dur-ui) var(--ease-ui);
}
.disclosure:hover { background: var(--color-surface-raised); }
.disclosure summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  cursor: pointer;
  font-size: var(--text-lg);
  font-weight: var(--weight-medium);
  color: var(--color-heading);
  list-style: none;
  border-radius: var(--radius-lg);
}
.disclosure summary::-webkit-details-marker { display: none; }
.disclosure summary::after {
  content: "+";
  flex: none;
  display: grid; place-items: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--color-border-soft);
  color: var(--color-brand);
  font-size: 20px;
  line-height: 1;
  transition: transform var(--dur-ui) var(--ease-ui), background-color var(--dur-ui) var(--ease-ui);
}
.disclosure[open] summary::after { transform: rotate(45deg); background: rgba(255, 178, 198, 0.12); }
.disclosure p { margin: 0; padding: 0 var(--space-6) var(--space-5); color: var(--color-text-soft); max-width: 680px; }

/* ---------- 4. Page layout ---------- */

/* Header: transparent, sits over the hero and scrolls away with it. */
.topbar {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: var(--z-header);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  height: var(--header-height);
  padding: 0 var(--gutter);
}
.topbar__end { display: flex; align-items: center; gap: var(--space-3); margin-left: auto; }

.brand { display: flex; align-items: center; gap: var(--space-3); text-decoration: none; border-radius: var(--radius-sm); }
.brand-sun {
  flex: none;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--grad-sun);
  -webkit-mask: linear-gradient(180deg, #000 0 54%, transparent 54% 60%, #000 60% 70%, transparent 70% 76%, #000 76% 84%, transparent 84% 90%, #000 90%);
  mask: linear-gradient(180deg, #000 0 54%, transparent 54% 60%, #000 60% 70%, transparent 70% 76%, #000 76% 84%, transparent 84% 90%, #000 90%);
}
.brand-text, .footer-brand {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: var(--weight-black);
  letter-spacing: 0.01em;
  text-transform: uppercase;
  line-height: var(--leading-none);
  color: var(--color-heading);
}
.brand-text em, .footer-brand em { font-style: normal; color: var(--color-brand); }

.nav { display: flex; gap: var(--space-1); margin-left: var(--space-6); }

@media (max-width: 1100px) { .nav { display: none; } }
@media (max-width: 480px) {
  .topbar { gap: var(--space-2); }
  .brand-text { font-size: 22px; }
  .brand-sun { width: 22px; height: 22px; }
  .topbar__end { gap: var(--space-2); }
  .lang-switch__btn { min-width: 34px; padding: 0 var(--space-2); }
  .topbar .badge { padding: 0 var(--space-2); }
}

/* Hero: the live stage first, with the action panel beside it. */
.hero {
  position: relative;
  isolation: isolate;
  padding: calc(var(--header-height) + var(--space-2)) var(--gutter) 0;
}
.hero__glow {
  position: absolute;
  inset: 0 0 -240px 0;
  z-index: var(--z-behind);
  pointer-events: none;
  background: radial-gradient(40% 50% at 35% 45%, rgba(249, 118, 176, 0.12), transparent 70%), var(--grad-hero);
  -webkit-mask: var(--fade-bottom);
  mask: var(--fade-bottom);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--width-panel);
  align-items: start;
  gap: clamp(20px, 2vw, 32px);
  max-width: var(--width-page);
  margin: 0 auto;
}
@media (max-width: 960px) { .layout { grid-template-columns: minmax(0, 1fr); } }

.stage { min-width: 0; animation: fade-in var(--dur-fade) var(--ease-out) both; }

.screen { position: relative; border-radius: var(--radius-card); box-shadow: var(--shadow-stage); }
.screen__live { position: absolute; top: var(--space-4); left: var(--space-4); z-index: var(--z-overlay); pointer-events: none; height: 26px; font-size: 11px; }

.video {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--black);
  border-radius: var(--radius-card);
  overflow: hidden;
  transition: box-shadow var(--dur-glow) var(--ease-ui);
}
.video.controlling { box-shadow: var(--glow-accent); }
.video canvas, .video iframe, .video video { width: 100%; height: 100%; display: block; border: 0; background: var(--black); }
.video-status {
  position: absolute; inset: 0; margin: 0; display: grid; place-items: center; padding: var(--space-8);
  text-align: center; color: var(--color-heading); font-size: var(--text-lg); font-weight: var(--weight-medium);
  background: var(--scrim-media);
  animation: fade-in var(--dur-glow) var(--ease-out);
}
/* Row under the video (mouse hint + sound button): keeps the frame clear for the game's own prompts. */
.stage__bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-top: var(--space-3); }
.stage__bar:not(:has(> :not([hidden]))) { display: none; }
.stage__bar .mouse-hint { margin: 0; }
.unmute { margin-left: auto; }
.fullscreen-toggle { margin-left: auto; }
.unmute:not([hidden]) ~ .fullscreen-toggle { margin-left: 0; }
.fullscreen-toggle__icon { flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fullscreen-toggle[data-active="true"] .fullscreen-toggle__enter,
.fullscreen-toggle[data-active="false"] .fullscreen-toggle__exit { display: none; }

/* Fullscreen stage: video + LIVE badge fill the screen; the video letterboxes on black.
   Kept as separate rules: an unknown prefixed selector would void a shared selector list. */
.screen:fullscreen { display: flex; width: 100%; height: 100%; border-radius: 0; box-shadow: none; background: var(--black); }
.screen:-webkit-full-screen { display: flex; width: 100%; height: 100%; border-radius: 0; box-shadow: none; background: var(--black); }
.screen:fullscreen .video { flex: 1; aspect-ratio: auto; width: 100%; height: 100%; border-radius: 0; }
.screen:-webkit-full-screen .video { flex: 1; aspect-ratio: auto; width: 100%; height: 100%; border-radius: 0; }
.screen::backdrop { background: #000; } /* ::backdrop may not inherit custom properties */
.video video { object-fit: contain; }

.hint { margin: var(--space-3) var(--space-2) 0; color: var(--color-text-muted); font-size: var(--text-sm); }

/* Runtime element (app.js): mouse-camera hint in the row under the video. */
.mouse-hint {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-3) 0 0;
  padding: 0 var(--space-4);
  min-height: var(--control-sm);
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-on-bright);
  background: var(--lime-300);
  animation: fade-in var(--dur-glow) var(--ease-out);
}
.mouse-hint::before {
  content: "";
  width: 10px; height: 14px;
  border: 2px solid currentColor;
  border-radius: 6px;
}
/* Turn start, keyboard player without the mouse captured: pulse so the hint is not missed. */
.mouse-hint--pulse { animation: hint-pulse 0.7s var(--ease-out) 3; }
@keyframes hint-pulse {
  0%, 100% { transform: none; box-shadow: 0 0 0 0 rgba(230, 255, 163, 0.6); }
  50% { transform: scale(1.06); box-shadow: 0 0 0 10px rgba(230, 255, 163, 0); }
}

/* Runtime toasts over the video (app.js): "your turn" (big, top) and "blocked button" (bottom).
   Always in the DOM so screen readers announce them; empty and invisible when idle. */
.screen-toast {
  position: absolute; left: 50%; z-index: var(--z-overlay);
  max-width: calc(100% - 2 * var(--space-4));
  margin: 0; padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-pill);
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -8px);
  transition: opacity var(--dur-ui) var(--ease-out), transform var(--dur-ui) var(--ease-out);
}
.screen-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.screen-toast--turn {
  top: var(--space-6);
  font-family: var(--font-display);
  font-weight: var(--weight-black);
  font-size: clamp(28px, 5vw, 56px);
  line-height: var(--leading-none);
  padding: var(--space-3) var(--space-8);
  color: var(--color-text-on-bright);
  background: var(--lime-300);
  box-shadow: var(--glow-accent);
}
.screen-toast--blocked {
  bottom: var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-heading);
  background: var(--color-scrim);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-lg); /* wraps on phones */
}
.screen-toast:empty { visibility: hidden; }

/* PS glyph → key legend under the video during your turn (app.js): the main help for keyboard players. */
.key-legend { margin-top: var(--space-3); padding: var(--space-4); border-radius: var(--radius-lg); background: var(--color-surface); border: 1px solid var(--color-border); }
.key-legend__title { margin: 0 0 var(--space-3); font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--color-text-soft); }
.key-legend__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.key-legend__item {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: var(--space-1) var(--space-3) var(--space-1) var(--space-1);
  border-radius: var(--radius-pill);
  background: var(--color-surface-subtle);
}
.key-legend__glyph {
  display: inline-grid; place-items: center;
  min-width: 34px; height: 34px; padding: 0 var(--space-2);
  border-radius: var(--radius-pill);
  font-size: var(--text-lg); font-weight: var(--weight-bold); line-height: 1;
  color: var(--color-heading);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--color-border-soft);
}
/* PlayStation face-button colours, like the prompts in the game. */
.key-legend__glyph[data-button="cross"] { color: #8fb8ff; }
.key-legend__glyph[data-button="circle"] { color: #ff8a8a; }
.key-legend__glyph[data-button="square"] { color: #f2a6e0; }
.key-legend__glyph[data-button="triangle"] { color: #7fe3c4; }
.key-legend__glyph[data-button="dpad"], .key-legend__glyph[data-button="options"], .key-legend__glyph[data-button="touchpad"] { font-size: var(--text-xs); }
.key-legend__item kbd { font-size: var(--text-body); }
.key-legend__extra { margin: var(--space-3) 0 0; font-size: var(--text-sm); color: var(--color-text-muted); }
.key-legend__title:last-child { margin: 0; }

/* Fullscreen: the legend moves into the stage (app.js) as a slim translucent strip centred on the bottom
   edge, clear of the minimap (bottom-left) and the game's context prompts (bottom-right). */
.key-legend--overlay {
  position: absolute; left: 50%; bottom: var(--space-2); z-index: var(--z-overlay);
  transform: translateX(-50%);
  width: max-content; max-width: min(78%, 1100px);
  margin: 0; padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-lg);
  background: rgba(0, 0, 0, 0.5);
  border-color: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
  pointer-events: none; /* clicks still reach the video (mouse capture) */
}
.key-legend--overlay .key-legend__title, .key-legend--overlay .key-legend__extra { display: none; }
.key-legend--overlay .key-legend__list { justify-content: center; gap: var(--space-1) var(--space-2); } /* wraps only on narrow screens */
.key-legend--overlay .key-legend__item { flex: none; gap: 3px; padding: 0 var(--space-1) 0 0; background: transparent; }
.key-legend--overlay .key-legend__glyph { min-width: 22px; height: 22px; padding: 0 var(--space-1); font-size: var(--text-xs); border: 0; }
.key-legend--overlay .key-legend__item kbd { min-width: 0; height: 22px; padding: 0 5px; font-size: 11px; }

/* Show/hide button for that strip: small, top-right of the fullscreen stage (LIVE badge sits top-left). */
.legend-toggle {
  position: absolute; top: var(--space-4); right: var(--space-4); z-index: var(--z-overlay);
  height: 26px; padding: 0 var(--space-3);
  border: 1px solid rgba(255, 255, 255, 0.2); border-radius: var(--radius-pill);
  font: inherit; font-size: var(--text-xs); font-weight: var(--weight-semibold);
  color: var(--color-heading); background: rgba(0, 0, 0, 0.5);
  cursor: pointer; opacity: 0.75;
}
.legend-toggle:hover, .legend-toggle:focus-visible { opacity: 1; }

/* "How to play" box under the video before your turn; collapsible, choice remembered (app.js). */
.howto { margin-top: var(--space-3); padding: var(--space-3) var(--space-4); border-radius: var(--radius-lg); background: var(--color-surface); border: 1px solid var(--color-border); }
.howto__summary { cursor: pointer; font-weight: var(--weight-semibold); color: var(--color-heading); }
.howto p { margin: var(--space-2) 0 0; font-size: var(--text-sm); color: var(--color-text-soft); }

.panel { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; animation: fade-up var(--dur-fade) var(--ease-out) 0.1s both; }

.intro { padding: var(--space-2) var(--space-1) var(--space-1); }
.intro .lede { margin: var(--space-4) 0 0; font-size: var(--text-body); color: var(--color-text-soft); }

.card--turn { padding: var(--space-6); }
.turn-status { margin: 0 0 var(--space-4); font-size: var(--text-lg); font-weight: var(--weight-medium); line-height: var(--leading-snug); color: var(--color-heading); }

.join { display: grid; gap: var(--space-3); }
.join__note { margin: 0; text-align: center; font-size: var(--text-xs); color: var(--color-text-muted); letter-spacing: var(--tracking-caps); }
.join__pad { margin: 0; text-align: center; font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--color-accent); }

.timer {
  margin: calc(-1 * var(--space-2)) 0 var(--space-3);
  font-family: var(--font-display);
  font-weight: var(--weight-black);
  font-size: var(--text-numeral);
  line-height: var(--leading-display);
  font-variant-numeric: tabular-nums;
  color: var(--color-accent);
}

/* Runtime element (app.js): ping, coloured by data-quality good | ok | bad. */
.latency {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-caps);
  color: var(--color-text-soft);
  font-variant-numeric: tabular-nums;
}
.latency::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--color-text-muted); }
.latency[data-quality="good"]::before { background: var(--color-success); }
.latency[data-quality="ok"]::before { background: var(--color-warning); }
.latency[data-quality="bad"] { color: var(--color-danger-text); }
.latency[data-quality="bad"]::before { background: var(--color-danger); }

.card--queue { padding: var(--space-5) var(--space-6); }
.now-playing { margin: 0 0 var(--space-2); font-weight: var(--weight-medium); color: var(--color-heading); }
#queue { margin: 0; padding: 0; list-style: none; max-height: 220px; overflow: auto; }
#queue li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-2);
  border-top: 1px solid var(--color-border);
  overflow-wrap: anywhere;
  color: var(--color-text-soft);
}
/* Explicit numbers (data-n): the list shows only the top of the line plus our own row. */
#queue li::before {
  content: attr(data-n);
  flex: none;
  min-width: 24px; height: 24px; padding: 0 4px; border-radius: var(--radius-pill); /* room for 3-digit places */
  display: grid; place-items: center;
  font-size: var(--text-xs); font-weight: var(--weight-bold);
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text-soft);
}
#queue li.me { color: var(--color-heading); font-weight: var(--weight-semibold); background: rgba(255, 178, 198, 0.1); border-radius: var(--radius-pill); border-top-color: transparent; }
#queue li.me::before { background: var(--color-brand); color: var(--color-text-on-bright); }
#queue li.more { justify-content: center; font-size: var(--text-xs); color: var(--color-text-soft); }
#queue li.more::before { content: none; }

@media (max-width: 960px) {
  .intro { padding-top: var(--space-2); }
  .display { font-size: clamp(36px, 10vw, 56px); }
  .display__accent { display: inline; }
}

/* Content sections */
.section {
  max-width: var(--width-content);
  margin: 0 auto;
  padding: var(--section-gap) var(--gutter) 0;
  scroll-margin-top: var(--space-4);
}

.steps, .rules {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}
@media (max-width: 860px) { .steps, .rules { grid-template-columns: minmax(0, 1fr); } }

.step-n {
  display: block;
  margin-bottom: var(--space-6);
  font-family: var(--font-display);
  font-weight: var(--weight-black);
  font-size: 72px;
  line-height: var(--leading-display);
  color: var(--pink-300);
}
.step:nth-child(2) .step-n { color: var(--peach-300); }
.step:nth-child(3) .step-n { color: var(--lime-300); }

/* Controls: cheat sheet + controller tester */
.controls { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: var(--space-4); align-items: start; }
@media (max-width: 960px) { .controls { grid-template-columns: minmax(0, 1fr); } }

.cheat { padding: var(--space-6); }
.cheat__head { display: flex; justify-content: space-between; margin: var(--space-5) 0 0; padding: 0 var(--space-2) var(--space-2); }
.cheat__list { list-style: none; margin: 0; padding: 0; }
.cheat__row {
  display: grid;
  grid-template-columns: 172px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-2);
  border-top: 1px solid var(--color-border);
}
.cheat__keys { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); }
.cheat__plus, .cheat__or { padding: 0 2px; color: var(--color-text-muted); font-size: var(--text-sm); }
.cheat__action { color: var(--color-text); }
.cheat__ps { font-size: var(--text-xs); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-caps); color: var(--color-text-muted); text-align: right; white-space: nowrap; }
.cheat__head .cheat__ps { text-transform: uppercase; letter-spacing: var(--tracking-wide); }
.cheat__note { margin: var(--space-4) var(--space-2) 0; font-size: var(--text-sm); color: var(--color-text-muted); }
/* Keyboard / controller switch (shown when a pad is connected) and the controller view. */
.view-switch { display: inline-flex; gap: var(--space-1); margin: 0 0 var(--space-3); padding: 3px; border-radius: var(--radius-pill); border: 1px solid var(--color-border-soft); }
.view-switch[hidden] { display: none; }
.view-switch__btn {
  height: 28px; padding: 0 var(--space-3); border: 0; border-radius: var(--radius-pill);
  font-size: var(--text-sm); font-weight: var(--weight-semibold);
  color: var(--color-text-soft); background: transparent; cursor: pointer;
}
.view-switch__btn:hover { background: rgba(255, 255, 255, 0.1); color: var(--white); }
.view-switch__btn[aria-pressed="true"] { background: var(--cream-100); color: var(--color-text-on-bright); }
.cheat[data-view="pad"] .cheat__keys { display: none; }
.cheat[data-view="pad"] .cheat__row { grid-template-columns: minmax(96px, auto) minmax(0, 1fr); }
.cheat[data-view="pad"] .cheat__list .cheat__ps { order: -1; text-align: left; font-size: var(--text-body); color: var(--color-heading); }
.cheat[data-view="pad"] .cheat__head { flex-direction: row-reverse; }
@media (max-width: 560px) {
  .cheat { padding: var(--space-4); }
  .cheat__row { grid-template-columns: minmax(0, 1fr) auto; row-gap: var(--space-2); }
  .cheat__action { grid-column: 1 / -1; grid-row: 2; }
  .tab { padding: 0 var(--space-4); font-size: var(--text-sm); }
  .cheat[data-view="pad"] .cheat__action { grid-column: auto; grid-row: auto; }
  .key-legend { padding: var(--space-3); }
  .key-legend__glyph { min-width: 30px; height: 30px; font-size: var(--text-body); }
}

.tester-card .card__title { font-size: var(--text-h2); }
.tester { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); margin: var(--space-4) 0; }
.stick {
  position: relative; flex: none;
  width: 84px; height: 84px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.35));
  border: 1px solid var(--color-border-soft);
}
.stick span {
  position: absolute; left: 50%; top: 50%; width: 24px; height: 24px; margin: -12px 0 0 -12px;
  border-radius: 50%; background: var(--color-text-muted);
  transition: background-color 0.1s linear;
}
.stick span.active { background: var(--color-brand); box-shadow: var(--glow-sun); }
.triggers { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.trigger { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-xs); font-weight: var(--weight-bold); color: var(--color-text-soft); }
.trigger i {
  flex: 1; height: 8px; border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--peach-300), var(--pink-300)) no-repeat var(--color-well);
  background-size: 0% 100%;
  border: 1px solid var(--color-border-soft);
}
.pressed { display: flex; flex-wrap: wrap; gap: var(--space-1); min-height: 30px; }
.pressed span { margin: 0; }
.tester-card .small { margin: var(--space-3) 0 0; }

/* Mouse camera settings (app.js applies them live to MouseLook). */
.mouse-settings { margin: var(--space-4) 0 0; padding: var(--space-3) var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-md); display: grid; gap: var(--space-2); min-width: 0; }
.mouse-settings__legend { padding: 0 var(--space-1); font-size: var(--text-xs); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--color-text-muted); }
.mouse-settings__row { display: grid; grid-template-columns: auto minmax(0, 1fr) 3.5em; align-items: center; gap: var(--space-3); font-size: var(--text-sm); }
.mouse-settings__range { width: 100%; min-width: 0; accent-color: var(--color-brand); }
.mouse-settings__value { font-variant-numeric: tabular-nums; text-align: right; font-weight: var(--weight-semibold); }
.mouse-settings__check { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); cursor: pointer; }
.mouse-settings__check input { accent-color: var(--color-brand); width: 18px; height: 18px; }

/* Rules */
.rule { display: flex; gap: var(--space-4); align-items: flex-start; padding: var(--space-6); }
.rule-badge {
  flex: none;
  display: grid; place-items: center;
  width: var(--space-12); height: var(--space-12); border-radius: 50%;
  font-family: var(--font-display);
  font-weight: var(--weight-black);
  font-size: 20px;
  color: var(--color-text-on-bright);
  background: var(--pink-300);
}
.rule-badge--peach { background: var(--peach-300); }
.rule-badge--lime { background: var(--lime-300); }

.faq { display: grid; gap: var(--space-3); max-width: var(--width-prose); }

/* Footer */
.footer {
  margin-top: var(--section-gap);
  padding: var(--space-12) var(--gutter) var(--space-12);
  text-align: center;
  border-top: 1px solid var(--color-border);
  background: radial-gradient(60% 120% at 50% 100%, rgba(88, 54, 96, 0.35), transparent 70%);
}
.footer-brand { display: inline-flex; align-items: center; gap: var(--space-3); }
.footer p { max-width: 640px; margin: var(--space-4) auto 0; font-size: var(--text-sm); color: var(--color-text-muted); }

/* ---------- 5. Accessibility ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* Inline text button (e.g. "Log out" next to the account name). */
.link-button { background: none; border: 0; padding: 0; color: var(--color-text-soft); font: inherit; text-decoration: underline; cursor: pointer; }
.link-button:hover { color: var(--color-text); }
.link-button:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

/* Cloudflare Turnstile: invisible unless Cloudflare needs a click. */
.join__turnstile:empty { display: none; }
.join__turnstile { display: flex; justify-content: center; margin-bottom: 8px; }

/* Stage timer: time left in the turn, on top of the video (also in fullscreen). */
.stage-timer {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 5; margin: 0;
  padding: 6px 16px; border-radius: 999px; pointer-events: none;
  background: rgba(12, 13, 27, 0.78); border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--color-text); font: 700 18px/1.2 var(--font-body); letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}
.stage-timer--low { background: rgba(255, 107, 125, 0.92); color: var(--color-text-on-bright); border-color: transparent; }
:fullscreen .stage-timer { top: 22px; font-size: 22px; padding: 8px 22px; }

/* Creator push-to-talk: under the LIVE badge while the creator talks over the stream. */
.creator-badge {
  position: absolute; top: calc(var(--space-4) + 26px + var(--space-2)); left: var(--space-4);
  z-index: var(--z-overlay); margin: 0; padding: 6px 14px; border-radius: 999px; pointer-events: none;
  background: var(--color-accent); color: var(--color-text-on-bright);
  font: 700 14px/1.2 var(--font-body); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  animation: creator-badge-pulse 1.6s ease-in-out infinite;
}
.creator-badge[hidden] { display: none; }
:fullscreen .creator-badge { font-size: 18px; padding: 8px 18px; }
@keyframes creator-badge-pulse { 50% { opacity: 0.75; } }
@media (prefers-reduced-motion: reduce) { .creator-badge { animation: none; } }

/* Idle warning: big countdown in the middle of the video before an idle player loses the turn. */
.idle-warning {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 6; margin: 0;
  width: max-content; max-width: calc(100% - 2 * var(--space-4));
  padding: var(--space-3) var(--space-6); border-radius: var(--radius-lg); pointer-events: none;
  background: rgba(255, 107, 125, 0.94); color: var(--color-text-on-bright); text-align: center;
  font-family: var(--font-display); font-weight: var(--weight-black);
  font-size: clamp(20px, 4.5vw, 48px); line-height: 1.15; font-variant-numeric: tabular-nums;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  animation: idle-warning-pulse 1s ease-in-out infinite;
}
.idle-warning[hidden] { display: none; }
:fullscreen .idle-warning { font-size: clamp(28px, 5vw, 64px); }
@keyframes idle-warning-pulse { 50% { transform: translate(-50%, -50%) scale(1.05); } }

/* "Log in with Kick": Kick's green, like other "sign in with" buttons. */
.btn--kick { background: #53fc18; color: #0b0e0f; }
.btn--kick:hover:not(:disabled) { background: #6dff3a; }
.btn--kick::before {
  content: "K"; display: inline-grid; place-items: center; width: 1.4em; height: 1.4em; margin-right: 0.5em;
  border-radius: 0.3em; background: #0b0e0f; color: #53fc18; font-weight: 800; font-size: 0.9em;
}

/* The "How to play" box is retired: the key legend under the video and the FAQ cover it. The element
   stays in the page because app.js anchors the legend next to it. */
.howto { display: none !important; }

/* Discord invite: always visible in the top bar (icon only on narrow screens). */
.discord-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.4em 0.85em;
  border-radius: 999px;
  background: #5865f2;
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease;
}
.discord-link:hover { background: #4752c4; }
.discord-link:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.discord-link__icon { width: 1.15em; height: 1.15em; flex: none; }
@media (max-width: 560px) {
  .discord-link { padding: 0.45em; }
  .discord-link span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}
.footer-discord { color: #aab1ff; font-weight: 600; }

/* X (Twitter) link to the launch post, next to Discord. */
.x-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.4em 0.85em;
  border-radius: 999px;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  white-space: nowrap;
}
.x-link:hover { background: #222; }
.x-link:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.x-link__icon { width: 1em; height: 1em; flex: none; }
@media (max-width: 560px) {
  .x-link { padding: 0.5em; }
  .x-link span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

/* Tip link (Streamlabs), next to X and Discord. */
.tip-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.4em 0.85em;
  border-radius: 999px;
  background: #0f9f8a;
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease;
}
.tip-link[hidden] { display: none; }
.tip-link:hover { background: #0b8473; }
.tip-link:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.tip-link__icon { width: 1em; height: 1em; flex: none; }
@media (max-width: 560px) {
  .tip-link { padding: 0.5em; }
  .tip-link span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

/* Skip ahead with a tip: shown to a waiting player with real players ahead. */
.skip {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.75rem;
  padding: 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(15, 159, 138, 0.55);
  background: rgba(15, 159, 138, 0.12);
}
.skip[hidden] { display: none; }
.skip__text { margin: 0; font-size: 0.9rem; }
.skip__code { margin: 0; display: flex; align-items: center; justify-content: center; gap: 0.6rem; }
.skip__value { font-size: 1.35rem; font-weight: 800; letter-spacing: 0.08em; user-select: all; }

/* Donation goal card (app.js renderGoal): data-state active | reached | expired. */
.goal { display: grid; gap: var(--space-2); padding: var(--space-4) var(--space-5); }
.goal[hidden] { display: none; }
.goal .card__eyebrow { margin: 0; }
.goal__line { margin: 0; font-size: var(--text-sm); color: var(--color-text-soft); }
.goal__bar { height: 10px; border-radius: var(--radius-pill); background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.goal__fill { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--color-accent); transition: width 0.4s ease; }
.goal[data-state="expired"] .goal__fill { background: var(--color-brand); }
.goal__meta { display: flex; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; margin: 0; font-weight: var(--weight-semibold); color: var(--color-heading); font-variant-numeric: tabular-nums; }
.goal__status { color: var(--color-accent); }
.goal[data-state="expired"] .goal__status { color: var(--color-brand); }
.goal__supporters { margin: 0; font-size: var(--text-xs); color: var(--color-text-soft); overflow-wrap: anywhere; }
