/* ============================================================================
   Project 'Em — "a luxe twilight dreamscape of the subconscious"
   --------------------------------------------------------------------------
   A premium, dreamy, surreal "mind-reading" aesthetic for a 4–10 player
   image-projection party card game. Mobile-first, self-contained, no build.

   Sections:
     1.  Design tokens (:root custom properties)
     2.  Reset + base
     3.  Atmosphere (aurora, grain, vignette)
     4.  App shell + layout primitives
     5.  Typography (display title, projection, Dr. Quack)
     6.  Glass panels
     7.  Buttons / CTAs
     8.  Inputs / fields / controls
     9.  Player chips / avatars / tags
     10. Cards + grids (hand, reveal, voting, results)
     11. Reveal materialization
     12. Vote orbs + score deltas
     13. Timer (bar + ring)
     14. Scoreboard
     15. Final / podium / Dr. Quack dossier
     16. Banners / notices / spinner / spectator
     17. Toasts
     18. Mute toggle
     19. Demo bar + misc helpers
     20. Reduced motion
   ========================================================================== */

/* ============================================================================
   1. DESIGN TOKENS
   ========================================================================== */
:root {
  /* --- Deep cosmic base --- */
  --base-0: #08081a;          /* near-black indigo */
  --base-1: #140b33;          /* deep violet */
  --base-2: #1f1147;          /* royal twilight */
  --base-3: #2a1856;          /* lifted plum (panel-adjacent) */
  --ink:    #0c0820;          /* dark ink used on bright CTAs */

  /* --- Luminous accents (used as GLOWS, not flat fills) --- */
  --lavender: #b39cff;
  --rose:     #f3a8c8;        /* orchid / rose */
  --peri:     #8ea2ff;        /* periwinkle */
  --gold:     #ffd9a0;        /* dusty gold — reserve for winner/favorite/special */

  /* RGB channels for translucent glows */
  --lavender-rgb: 179, 156, 255;
  --rose-rgb:     243, 168, 200;
  --peri-rgb:     142, 162, 255;
  --gold-rgb:     255, 217, 160;

  /* --- Text --- */
  --text:  #f4f1ff;
  --text-2: rgba(244, 241, 255, 0.82);
  --muted: rgba(244, 241, 255, 0.64);
  --faint: rgba(244, 241, 255, 0.40);

  /* --- Semantic accents --- */
  --accent:   #b39cff;
  --accent-2: #f3a8c8;
  --good: #84e6b0;            /* +score */
  --good-rgb: 132, 230, 176;
  --bad:  #ff8fb0;            /* -score */
  --bad-rgb: 255, 143, 176;

  /* --- Glass surfaces --- */
  --surface:    rgba(255, 255, 255, 0.045);
  --surface-2:  rgba(255, 255, 255, 0.075);
  --surface-3:  rgba(255, 255, 255, 0.11);
  --hairline:   rgba(255, 255, 255, 0.14);
  --hairline-strong: rgba(255, 255, 255, 0.24);

  /* --- Radii --- */
  --radius:      24px;
  --radius-lg:   28px;
  --radius-sm:   16px;
  --radius-card: 18px;
  --radius-pill: 999px;

  /* --- Shadows / glows --- */
  --shadow:      0 24px 60px rgba(0, 0, 0, 0.55);
  --shadow-soft: 0 14px 38px rgba(0, 0, 0, 0.40);
  --shadow-card: 0 16px 34px rgba(6, 4, 22, 0.55);
  --glow-accent: 0 0 50px rgba(var(--lavender-rgb), 0.18);
  --glow-rose:   0 0 50px rgba(var(--rose-rgb), 0.16);

  /* --- Layout --- */
  --maxw: 760px;
  --gap:  16px;

  /* --- Fonts (loaded in index.html with system fallbacks) --- */
  --font-display: "Fraunces", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ============================================================================
   2. RESET + BASE
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(1300px 900px at 12% -12%, rgba(var(--peri-rgb), 0.20), transparent 58%),
    radial-gradient(1100px 800px at 112% 6%,  rgba(var(--rose-rgb), 0.16), transparent 54%),
    radial-gradient(1000px 1000px at 50% 120%, rgba(var(--lavender-rgb), 0.14), transparent 60%),
    linear-gradient(168deg, var(--base-0) 0%, var(--base-1) 46%, var(--base-2) 78%, var(--base-3) 100%);
  background-attachment: fixed;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  font-feature-settings: "ss01", "cv01";
}

button { font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; }
img { display: block; max-width: 100%; }

/* Global focus-visible: a luminous ring, never invisible */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 8px;
}
a { color: var(--lavender); }
::selection { background: rgba(var(--lavender-rgb), 0.35); color: #fff; }

/* Faint scrollbar that matches the dreamscape */
* { scrollbar-width: thin; scrollbar-color: rgba(var(--lavender-rgb), 0.4) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb {
  background: rgba(var(--lavender-rgb), 0.32);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(var(--lavender-rgb), 0.5); background-clip: padding-box; }

/* ============================================================================
   3. ATMOSPHERE — aurora blobs, fx canvas, grain + vignette
   ========================================================================== */

/* Aurora: bigger, softer, slower, color-screen blended */
.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  filter: blur(72px) saturate(135%);
}
.blob {
  position: absolute;
  width: 58vmax;
  height: 58vmax;
  border-radius: 50%;
  opacity: 0.50;
  mix-blend-mode: screen;
  will-change: transform;
}
.blob-lavender { background: radial-gradient(circle, var(--lavender), transparent 62%); top: -18%; left: -14%; animation: drift1 46s ease-in-out infinite; }
.blob-rose     { background: radial-gradient(circle, var(--rose),     transparent 62%); bottom: -22%; right: -16%; animation: drift2 55s ease-in-out infinite; }
.blob-peri     { background: radial-gradient(circle, var(--peri),     transparent 64%); top: 26%; right: -4%;       animation: drift3 61s ease-in-out infinite; }
.blob-gold     { background: radial-gradient(circle, var(--gold),     transparent 68%); bottom: 4%; left: 4%; opacity: 0.30; animation: drift4 71s ease-in-out infinite; }

@keyframes drift1 { 0%,100% { transform: translate3d(0,0,0) scale(1); } 50% { transform: translate3d(9vw, 7vh, 0) scale(1.14); } }
@keyframes drift2 { 0%,100% { transform: translate3d(0,0,0) scale(1.06); } 50% { transform: translate3d(-8vw, -6vh, 0) scale(0.94); } }
@keyframes drift3 { 0%,100% { transform: translate3d(0,0,0) scale(1); } 50% { transform: translate3d(-7vw, 8vh, 0) scale(1.12); } }
@keyframes drift4 { 0%,100% { transform: translate3d(0,0,0) scale(1); } 50% { transform: translate3d(6vw, -7vh, 0) scale(1.1); } }

/* fx.js stardust canvas — sits above aurora, below #app */
#fx-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  display: block;
}

/* Burst canvas for the winner moment — above content but non-interactive */
#fx-burst {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  display: block;
}

/* Film grain — extremely subtle, tiled SVG noise (no external file) */
.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 160px 160px;
}

/* Soft vignette for depth */
.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(140% 120% at 50% 38%, transparent 52%, rgba(4, 3, 16, 0.45) 100%);
}

/* ============================================================================
   4. APP SHELL + LAYOUT PRIMITIVES
   ========================================================================== */
.app {
  position: relative;
  z-index: 2;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px 16px calc(34px + env(safe-area-inset-bottom));
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  padding-top: max(20px, calc(env(safe-area-inset-top) + 8px));
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.screen {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  animation: screenIn 0.55s cubic-bezier(0.22, 0.9, 0.3, 1) both;
}
@keyframes screenIn {
  from { opacity: 0; transform: translateY(14px); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}

.stack  { display: flex; flex-direction: column; gap: var(--gap); }
.row    { display: flex; align-items: center; gap: 10px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.center { text-align: center; }
.grow   { flex: 1; min-width: 0; }
.hr     { height: 1px; background: linear-gradient(90deg, transparent, var(--hairline), transparent); border: 0; margin: 4px 0; }

/* ============================================================================
   6. GLASS PANELS (declared before typography use)  — "Glass 2.0"
   --------------------------------------------------------------------------
   Layered translucency + backdrop-blur + 1px gradient hairline + top inner
   highlight + soft outer accent glow.
   ========================================================================== */
.panel {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow:
    var(--shadow-soft),
    var(--glow-accent),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  isolation: isolate;
}
/* Gradient hairline border via mask */
.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(150deg,
    rgba(var(--lavender-rgb), 0.55),
    rgba(255, 255, 255, 0.10) 35%,
    rgba(var(--rose-rgb), 0.30) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
  z-index: -1;
}

/* ============================================================================
   5. TYPOGRAPHY
   ========================================================================== */
h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  line-height: 1.02;
  font-weight: 600;
  font-optical-sizing: auto;
}

/* The showpiece title "Project 'Em" — gradient text + glow + shimmer */
.title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.6rem, 12vw, 4.4rem);
  letter-spacing: -0.03em;
  line-height: 0.98;
  font-variation-settings: "SOFT" 40, "WONK" 1, "opsz" 144;
  background: linear-gradient(102deg, var(--lavender) 0%, var(--rose) 42%, var(--peri) 78%, var(--lavender) 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 30px rgba(var(--lavender-rgb), 0.40));
  animation: titleShimmer 9s ease-in-out infinite;
}
@keyframes titleShimmer {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

.subtitle {
  color: var(--text-2);
  font-size: clamp(0.98rem, 3.5vw, 1.12rem);
  font-weight: 400;
  letter-spacing: 0.005em;
  line-height: 1.45;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 0.72rem;
  color: rgba(244, 241, 255, 0.62);
  font-weight: 700;
}
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.tag.bot, .tag { font-family: var(--font-body); }

/* The projection text — a luminous, whispered thought */
.projection {
  position: relative;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-optical-sizing: auto;
  font-variation-settings: "SOFT" 60, "opsz" 60;
  font-size: clamp(1.5rem, 6.5vw, 2.5rem);
  letter-spacing: -0.015em;
  text-align: center;
  line-height: 1.18;
  text-wrap: balance;
  padding: 10px 20px;
  color: #fff;
  background: linear-gradient(180deg, #ffffff 0%, var(--lavender) 130%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 22px rgba(var(--lavender-rgb), 0.45));
  animation: thoughtGlow 5.5s ease-in-out infinite;
}
@keyframes thoughtGlow {
  0%, 100% { filter: drop-shadow(0 2px 18px rgba(var(--lavender-rgb), 0.38)); }
  50%      { filter: drop-shadow(0 2px 30px rgba(var(--rose-rgb), 0.50)); }
}
.projection::before, .projection::after {
  content: "\201C";
  -webkit-text-fill-color: rgba(var(--lavender-rgb), 0.55);
  color: rgba(var(--lavender-rgb), 0.55);
  font-style: normal;
}
.projection::after { content: "\201D"; }

/* ============================================================================
   7. BUTTONS / CTAs
   ========================================================================== */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 26px;
  border: none;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.005em;
  color: var(--ink);
  background: linear-gradient(135deg, var(--lavender) 0%, var(--rose) 100%);
  box-shadow:
    0 10px 26px rgba(var(--lavender-rgb), 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -2px 8px rgba(var(--rose-rgb), 0.30);
  transition: transform 0.14s cubic-bezier(0.3, 0.9, 0.3, 1.2),
              box-shadow 0.2s ease, filter 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
  isolation: isolate;
}
/* Hover bloom */
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 140% at 50% -20%, rgba(255, 255, 255, 0.55), transparent 60%);
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: -1;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(var(--lavender-rgb), 0.5), inset 0 1px 0 rgba(255,255,255,0.6); filter: brightness(1.04) saturate(1.06); }
.btn:hover::after { opacity: 1; }
.btn:active { transform: translateY(1px) scale(0.985); box-shadow: 0 6px 16px rgba(var(--lavender-rgb), 0.4), inset 0 2px 6px rgba(0,0,0,0.2); }
.btn:disabled {
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.08);
  color: var(--faint);
  box-shadow: inset 0 0 0 1px var(--hairline);
  filter: none;
  transform: none;
}
.btn:disabled::after { opacity: 0; }
.btn-block { width: 100%; }

/* Ghost variant — translucent w/ accent hairline */
.btn-ghost {
  background: var(--surface-2);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(var(--lavender-rgb), 0.45), inset 0 1px 0 rgba(255,255,255,0.10);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.btn-ghost:hover { background: var(--surface-3); box-shadow: inset 0 0 0 1px rgba(var(--lavender-rgb), 0.7), 0 8px 22px rgba(var(--lavender-rgb), 0.18); filter: none; }
.btn-ghost::after { display: none; }

.btn-sm { min-height: 44px; padding: 0 18px; font-size: 0.92rem; }

/* ============================================================================
   8. INPUTS / FIELDS / CONTROLS
   ========================================================================== */
.field { display: flex; flex-direction: column; gap: 8px; }

.input {
  width: 100%;
  min-height: 52px;
  padding: 0 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--hairline-strong);
  color: var(--text);
  outline: none;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.input::placeholder { color: var(--faint); }
.input:focus {
  border-color: rgba(var(--lavender-rgb), 0.9);
  background: rgba(255, 255, 255, 0.10);
  box-shadow: 0 0 0 4px rgba(var(--lavender-rgb), 0.18), 0 0 24px rgba(var(--lavender-rgb), 0.18);
}
.input-code {
  text-transform: uppercase;
  letter-spacing: 0.38em;
  text-align: center;
  font-weight: 800;
  font-size: 1.5rem;
  text-indent: 0.38em; /* visually center despite letter-spacing */
}

.counter { font-variant-numeric: tabular-nums; font-size: 0.85rem; color: var(--muted); transition: color 0.2s ease; }
.counter.over { color: var(--bad); font-weight: 700; }

label.checkbox { display: flex; align-items: center; gap: 12px; cursor: pointer; min-height: 44px; }
/* Custom glassy checkbox — gradient fill + drawn check when on (no native look) */
label.checkbox input {
  -webkit-appearance: none;
  appearance: none;
  width: 26px; height: 26px; flex: 0 0 26px;
  margin: 0;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.03));
  border: 1px solid var(--hairline-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), inset 0 -2px 6px rgba(0, 0, 0, 0.25);
  display: inline-grid;
  place-content: center;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.2s ease;
}
/* The checkmark, masked from a tiny inline SVG; scales in when checked */
label.checkbox input::before {
  content: "";
  width: 13px; height: 13px;
  transform: scale(0);
  transform-origin: center;
  transition: transform 0.16s cubic-bezier(0.3, 0.9, 0.3, 1.4);
  background: var(--ink);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='none' stroke='black' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round' d='M4 12.5l5 5L20 6'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='none' stroke='black' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round' d='M4 12.5l5 5L20 6'/></svg>") center / contain no-repeat;
}
label.checkbox input:checked {
  background: linear-gradient(135deg, var(--lavender), var(--rose));
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 14px rgba(var(--lavender-rgb), 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
label.checkbox input:checked::before { transform: scale(1); }
label.checkbox input:focus-visible {
  outline: none;
  border-color: rgba(var(--lavender-rgb), 0.9);
  box-shadow: 0 0 0 4px rgba(var(--lavender-rgb), 0.28);
}
label.checkbox:hover input:not(:checked) { border-color: rgba(var(--lavender-rgb), 0.6); }

/* Range slider — target score */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: var(--radius-pill);
  /* Luminous accent track laid over a faint recessed groove for depth */
  background:
    linear-gradient(90deg, rgba(var(--lavender-rgb), 0.95), rgba(var(--rose-rgb), 0.95)),
    rgba(255, 255, 255, 0.10);
  outline: none;
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.45),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 18px rgba(var(--lavender-rgb), 0.20);
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #ffffff 0%, #efe9ff 55%, #d9ccff 100%);
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    0 3px 10px rgba(0, 0, 0, 0.5),
    0 0 0 5px rgba(var(--lavender-rgb), 0.0),
    0 0 14px rgba(var(--lavender-rgb), 0.45);
  transition: box-shadow 0.18s ease, transform 0.12s ease;
}
input[type="range"]:hover::-webkit-slider-thumb { box-shadow: 0 3px 10px rgba(0,0,0,0.5), 0 0 0 5px rgba(var(--lavender-rgb), 0.16), 0 0 18px rgba(var(--lavender-rgb), 0.55); }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 3px 10px rgba(0,0,0,0.5), 0 0 0 6px rgba(var(--lavender-rgb), 0.30); }
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.08); }
input[type="range"]::-moz-range-thumb {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #ffffff 0%, #efe9ff 55%, #d9ccff 100%);
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5), 0 0 14px rgba(var(--lavender-rgb), 0.45);
  cursor: pointer;
}
input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: 0 3px 10px rgba(0,0,0,0.5), 0 0 0 6px rgba(var(--lavender-rgb), 0.30); }

/* Stepper (bot count) */
.stepper {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-pill);
  overflow: hidden;
  background: var(--surface);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.stepper button {
  width: 46px; height: 46px;
  background: transparent;
  border: none;
  font-size: 1.4rem; font-weight: 800; line-height: 1;
  color: var(--lavender);
  transition: background 0.15s ease, color 0.15s ease;
}
.stepper button:hover { background: rgba(var(--lavender-rgb), 0.16); color: #fff; }
.stepper button:active { background: rgba(var(--lavender-rgb), 0.28); }
.stepper .val { min-width: 46px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }

/* copyable invite */
.invite { display: flex; gap: 10px; align-items: stretch; }
.invite .input { font-size: 0.86rem; letter-spacing: 0; min-height: 48px; }
.host { /* hook present in spec; host control container styling already on .panel */ }

/* ============================================================================
   9. PLAYER CHIPS / AVATARS / TAGS
   ========================================================================== */
.players { display: flex; flex-direction: column; gap: 9px; }
.player {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: background 0.2s ease, transform 0.2s ease;
}
.player:hover { background: var(--surface-2); }
.player.dim { opacity: 0.5; }
.player .pname { font-weight: 600; }
.player .tags { margin-left: auto; display: flex; align-items: center; gap: 7px; }

.avatar {
  width: 40px; height: 40px; flex: 0 0 40px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 800; font-size: 0.92rem;
  color: var(--ink);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.32),
    inset 0 -4px 8px rgba(0, 0, 0, 0.18),
    0 3px 10px rgba(0, 0, 0, 0.30);
}

.pname { font-weight: 600; }

.tag {
  font-size: 0.66rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em;
  padding: 4px 9px; border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.10); color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.10);
}
.tag.host { background: rgba(var(--gold-rgb), 0.18); color: var(--gold); border-color: rgba(var(--gold-rgb), 0.35); }
.tag.bot  { background: rgba(var(--peri-rgb), 0.18); color: var(--peri); border-color: rgba(var(--peri-rgb), 0.35); }
.tag.you  { background: rgba(var(--lavender-rgb), 0.22); color: var(--lavender); border-color: rgba(var(--lavender-rgb), 0.4); }

.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--good); box-shadow: 0 0 10px var(--good); }
.dot.off { background: var(--faint); box-shadow: none; }

.score-pill {
  font-variant-numeric: tabular-nums; font-weight: 800;
  min-width: 38px; text-align: center;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--hairline);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

/* Static pill (projector chip in header, joining state) */
.pill-static {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 15px 7px 8px; border-radius: var(--radius-pill);
  background: var(--surface-2); border: 1px solid var(--hairline);
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}
.pill-static .avatar { width: 30px; height: 30px; flex-basis: 30px; font-size: 0.78rem; }

/* Big room code — gradient showpiece */
.code-big {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.4rem, 13vw, 3.6rem);
  letter-spacing: 0.24em;
  text-indent: 0.24em;
  text-align: center;
  background: linear-gradient(120deg, var(--lavender), var(--rose) 60%, var(--peri));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 22px rgba(var(--lavender-rgb), 0.40));
}

/* ============================================================================
   10. CARDS + GRIDS
   --------------------------------------------------------------------------
   Reveal/voting/results grid: scrollable, 2 cols mobile → 3 → 4, cards large
   enough to judge with NO tap-to-enlarge.
   ========================================================================== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (min-width: 560px) { .card-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
@media (min-width: 860px) { .card-grid { grid-template-columns: repeat(4, 1fr); gap: 18px; } }

/* The hand — 2 cols mobile → 3 → 5 across so 5 cards line up on desktop */
.hand-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (min-width: 480px) { .hand-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 740px) { .hand-grid { grid-template-columns: repeat(5, 1fr); gap: 16px; } }

/* The premium card */
.card {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  box-shadow:
    var(--shadow-card),
    0 0 0 1px rgba(255, 255, 255, 0.07);
  transition:
    transform 0.22s cubic-bezier(0.25, 0.9, 0.3, 1.1),
    box-shadow 0.25s ease,
    filter 0.25s ease;
  -webkit-tap-highlight-color: transparent;
  transform-style: preserve-3d;
  will-change: transform;
}
.card img {
  width: 100%; height: 100%;
  object-fit: cover;
  -webkit-user-drag: none;
  user-select: none;
}

/* Subtle diagonal sheen overlay on every card */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(125deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0) 34%, rgba(255, 255, 255, 0) 62%, rgba(255, 255, 255, 0.07) 100%);
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 2;
  opacity: 0.7;
  transition: opacity 0.25s ease;
}
/* Inner vignette + hairline so the image edges feel crisp & framed */
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.10), inset 0 -24px 40px rgba(6, 4, 22, 0.30);
  pointer-events: none;
  z-index: 3;
}

.card.tappable { cursor: pointer; }
.card.tappable:hover {
  transform: translateY(-6px) rotateX(5deg) rotateY(-3deg) scale(1.02);
  box-shadow:
    0 26px 50px rgba(6, 4, 22, 0.6),
    0 0 36px rgba(var(--lavender-rgb), 0.30),
    0 0 0 1px rgba(var(--lavender-rgb), 0.35);
}
.card.tappable:hover::before { opacity: 1; }
.card.tappable:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(var(--lavender-rgb), 0.9),
    0 0 32px rgba(var(--lavender-rgb), 0.4),
    var(--shadow-card);
}

/* Selected — luminous ring + lift */
.card.selected {
  transform: translateY(-8px) scale(1.03);
  box-shadow:
    0 0 0 3px rgba(var(--lavender-rgb), 0.95),
    0 0 44px rgba(var(--lavender-rgb), 0.55),
    0 26px 52px rgba(6, 4, 22, 0.6);
  animation: selectedGlow 2.6s ease-in-out infinite;
}
@keyframes selectedGlow {
  0%, 100% { box-shadow: 0 0 0 3px rgba(var(--lavender-rgb), 0.9),  0 0 36px rgba(var(--lavender-rgb), 0.45), 0 24px 50px rgba(6,4,22,0.6); }
  50%      { box-shadow: 0 0 0 3px rgba(var(--rose-rgb), 0.95),     0 0 52px rgba(var(--rose-rgb), 0.55),     0 24px 50px rgba(6,4,22,0.6); }
}

.card.disabled { cursor: not-allowed; }
.card.disabled img { filter: brightness(0.46) saturate(0.55); }
.card.disabled::before { opacity: 0.3; }

/* --- Card badges (yours / crown / star / vote tick) --- */
.card .badge {
  position: absolute;
  z-index: 4;
  font-size: 0.66rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em;
  padding: 4px 9px; border-radius: var(--radius-pill);
  background: rgba(12, 8, 32, 0.82); color: var(--text);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}
.card .badge.tl { top: 9px; left: 9px; }
.card .badge.tr { top: 9px; right: 9px; }

/* Crown badge — gold, shimmers */
.card .badge.crown {
  background: linear-gradient(135deg, #fff0d4, var(--gold));
  color: #5a3a08;
  box-shadow: 0 4px 16px rgba(var(--gold-rgb), 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  animation: crownShimmer 2.4s ease-in-out infinite;
}
@keyframes crownShimmer {
  0%, 100% { filter: brightness(1); box-shadow: 0 4px 14px rgba(var(--gold-rgb), 0.5), inset 0 0 0 1px rgba(255,255,255,0.5); }
  50%      { filter: brightness(1.18); box-shadow: 0 4px 22px rgba(var(--gold-rgb), 0.85), inset 0 0 0 1px rgba(255,255,255,0.8); }
}

/* Star (favorite) badge — rose-gold, twinkles */
.card .badge.star {
  background: linear-gradient(135deg, #ffe1ee, var(--rose));
  color: #6b2748;
  box-shadow: 0 4px 16px rgba(var(--rose-rgb), 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  animation: starTwinkle 2s ease-in-out infinite;
}
@keyframes starTwinkle {
  0%, 100% { transform: scale(1) rotate(0deg); filter: brightness(1); }
  50%      { transform: scale(1.12) rotate(8deg); filter: brightness(1.25); }
}

/* Owner name + vote chips under a results card */
.card-wrap { display: flex; flex-direction: column; gap: 8px; }
.owner-name {
  font-size: 0.86rem; font-weight: 700; text-align: center; color: var(--text);
  letter-spacing: 0.01em;
}
.owner-name.empty { color: var(--faint); font-weight: 500; font-style: italic; }

/* ============================================================================
   11. REVEAL MATERIALIZATION (1 card/second; JS toggles -pending → -show)
   --------------------------------------------------------------------------
   Fade + scale + blur-in with a brief glow bloom. Keep the cadence intact.
   ========================================================================== */
.card.reveal-pending {
  opacity: 0;
  transform: scale(0.82) rotateX(16deg) translateY(10px);
  filter: blur(14px) brightness(1.4);
}
.card.reveal-show {
  animation: revealMaterialize 0.95s cubic-bezier(0.18, 0.85, 0.25, 1) both;
}
@keyframes revealMaterialize {
  0%   { opacity: 0;   transform: scale(0.82) rotateX(16deg) translateY(10px); filter: blur(14px) brightness(1.5); }
  45%  { opacity: 1;   transform: scale(1.045) rotateX(0deg) translateY(0);    filter: blur(0) brightness(1.35); }
  70%  { box-shadow: 0 0 60px rgba(var(--lavender-rgb), 0.6), var(--shadow-card); }
  100% { opacity: 1;   transform: scale(1);                                     filter: blur(0) brightness(1); box-shadow: var(--shadow-card), 0 0 0 1px rgba(255,255,255,0.07); }
}
/* A one-shot bloom flash overlay as the card lands */
.card.reveal-show::after {
  animation: revealBloom 0.95s ease-out both;
}
@keyframes revealBloom {
  0%   { box-shadow: inset 0 0 0 1px rgba(255,255,255,0.10), inset 0 0 80px rgba(var(--lavender-rgb), 0.7); }
  60%  { box-shadow: inset 0 0 0 1px rgba(255,255,255,0.10), inset 0 0 40px rgba(var(--rose-rgb), 0.35); }
  100% { box-shadow: inset 0 0 0 1px rgba(255,255,255,0.10), inset 0 -24px 40px rgba(6,4,22,0.30); }
}

/* ============================================================================
   12. VOTE ORBS + SCORE DELTAS
   ========================================================================== */
/* colored ring overlay area on a card showing who voted (positioned by app.js) */
.vote-rings { position: absolute; inset: 6px; pointer-events: none; z-index: 4; }

.vote-chips {
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; min-height: 18px;
}
/* Glowing orbs */
.vote-chip {
  width: 18px; height: 18px; border-radius: 50%;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.45),
    inset 0 -3px 5px rgba(0, 0, 0, 0.25),
    0 0 12px currentColor;
  /* currentColor unused for glow (bg is inline) — add explicit soft glow */
  position: relative;
  animation: orbFloat 3.2s ease-in-out infinite;
}
.vote-chip::after {
  content: "";
  position: absolute; inset: -3px;
  border-radius: 50%;
  background: inherit;
  filter: blur(6px);
  opacity: 0.55;
  z-index: -1;
}
@keyframes orbFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-2px); }
}

/* When orbs are overlaid on a card (results) keep them readable */
.vote-rings .vote-chips { gap: 5px; }

/* Score delta floaters */
.delta {
  font-weight: 800; font-variant-numeric: tabular-nums; font-size: 1rem;
  padding: 2px 8px; border-radius: var(--radius-pill);
}
.delta.pos {
  color: var(--good);
  background: rgba(var(--good-rgb), 0.14);
  text-shadow: 0 0 14px rgba(var(--good-rgb), 0.6);
  animation: deltaPosFloat 0.85s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
.delta.neg {
  color: var(--bad);
  background: rgba(var(--bad-rgb), 0.14);
  text-shadow: 0 0 14px rgba(var(--bad-rgb), 0.5);
  animation: deltaNegFloat 0.85s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
@keyframes deltaPosFloat {
  0%   { opacity: 0; transform: translateY(12px) scale(0.8); }
  55%  { opacity: 1; transform: translateY(-3px) scale(1.08); }
  100% { opacity: 1; transform: none; }
}
@keyframes deltaNegFloat {
  0%   { opacity: 0; transform: translateY(-10px) scale(0.85); }
  100% { opacity: 1; transform: none; }
}

/* ============================================================================
   13. TIMER (top progress bar + circular ring)
   ========================================================================== */
.timer-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--hairline);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.07);
}
.timer {
  position: relative;
  height: 10px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.10);
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}
.timer .fill {
  position: absolute; inset: 0;
  transform-origin: left center;
  background: linear-gradient(90deg, var(--peri), var(--lavender) 50%, var(--rose));
  border-radius: var(--radius-pill);
  box-shadow: 0 0 16px rgba(var(--lavender-rgb), 0.6);
  transition: transform 0.25s linear;
}
.timer .fill::after {
  /* moving sheen along the bar */
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
  background-size: 50% 100%;
  background-repeat: no-repeat;
  animation: barSheen 2.4s linear infinite;
}
@keyframes barSheen { from { background-position: -60% 0; } to { background-position: 160% 0; } }

/* Warn state — red-shift + pulse as time runs low */
.timer-row.warn .fill { background: linear-gradient(90deg, var(--rose), #ff6b6b); box-shadow: 0 0 22px rgba(255, 107, 107, 0.75); }
.timer-row.warn { animation: timerPulse 0.9s ease-in-out infinite; }
.timer-row.warn .timer-secs { color: #ff7a8a; }
@keyframes timerPulse {
  0%, 100% { box-shadow: inset 0 1px 0 rgba(255,255,255,0.07), 0 0 0 rgba(255, 107, 107, 0); }
  50%      { box-shadow: inset 0 1px 0 rgba(255,255,255,0.07), 0 0 0 4px rgba(255, 107, 107, 0.18); }
}

.timer-secs {
  font-variant-numeric: tabular-nums; font-weight: 800;
  font-size: 1.05rem; min-width: 2.6ch; text-align: right;
  color: var(--text);
}

/* Circular ring timer (Projector screen) */
.ring { --p: 1; width: 60px; height: 60px; flex: 0 0 60px; position: relative; }
.ring svg { transform: rotate(-90deg); width: 100%; height: 100%; filter: drop-shadow(0 0 10px rgba(var(--lavender-rgb), 0.5)); }
.ring .track { stroke: rgba(255, 255, 255, 0.12); }
.ring .prog  { stroke: url(#ringgrad); stroke-linecap: round; transition: stroke-dashoffset 0.25s linear; }
.ring .secs  {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-weight: 800; font-variant-numeric: tabular-nums; font-size: 1.15rem;
}

/* ============================================================================
   14. SCOREBOARD
   ========================================================================== */
.scoreboard { display: flex; flex-direction: column; gap: 6px; }
.score-row {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px; border-radius: 14px;
  transition: background 0.2s ease;
}
.score-row:hover { background: var(--surface); }
.score-row .avatar { width: 32px; height: 32px; flex-basis: 32px; font-size: 0.82rem; }

/* ============================================================================
   15. FINAL / PODIUM / DR. QUACK DOSSIER
   ========================================================================== */
.podium { display: flex; flex-direction: column; gap: 14px; }

.standing {
  position: relative;
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255,255,255,0.08);
  animation: standingIn 0.55s cubic-bezier(0.22, 0.9, 0.3, 1) both;
}
@keyframes standingIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* Winner — radiant gold-violet bloom */
.standing.winner {
  border-color: rgba(var(--gold-rgb), 0.55);
  background:
    linear-gradient(135deg, rgba(var(--gold-rgb), 0.16), rgba(var(--rose-rgb), 0.10) 60%, rgba(var(--lavender-rgb), 0.10));
  box-shadow:
    0 0 0 1px rgba(var(--gold-rgb), 0.45),
    0 0 60px rgba(var(--gold-rgb), 0.30),
    0 24px 60px rgba(6, 4, 22, 0.5);
  animation: standingIn 0.55s cubic-bezier(0.22,0.9,0.3,1) both, winnerBloom 4s ease-in-out 0.6s infinite;
}
@keyframes winnerBloom {
  0%, 100% { box-shadow: 0 0 0 1px rgba(var(--gold-rgb), 0.45), 0 0 50px rgba(var(--gold-rgb), 0.26), 0 24px 60px rgba(6,4,22,0.5); }
  50%      { box-shadow: 0 0 0 1px rgba(var(--gold-rgb), 0.6),  0 0 72px rgba(var(--rose-rgb), 0.34),  0 24px 60px rgba(6,4,22,0.5); }
}
/* a soft radial halo behind the winner */
.standing.winner::before {
  content: "";
  position: absolute; inset: -1px;
  border-radius: inherit;
  background: radial-gradient(120% 90% at 14% 0%, rgba(var(--gold-rgb), 0.22), transparent 55%);
  pointer-events: none;
  z-index: 0;
}
.standing > * { position: relative; z-index: 1; }

.standing .rank {
  font-family: var(--font-display);
  font-size: 1.7rem; font-weight: 700; min-width: 1.8ch; color: var(--muted);
  line-height: 1.1;
}
.standing.winner .rank { color: var(--gold); filter: drop-shadow(0 0 12px rgba(var(--gold-rgb), 0.6)); }
.standing .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.standing .pname { font-size: 1.05rem; font-weight: 700; }
.standing.winner .pname { color: #fff; }

.crown-emoji { font-size: 1.3rem; filter: drop-shadow(0 0 10px rgba(var(--gold-rgb), 0.7)); animation: crownShimmer 2.4s ease-in-out infinite; }

/* Dr. Quack — elegant serif-italic "dossier", readable under EVERY player */
.drquack {
  position: relative;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-optical-sizing: auto;
  font-variation-settings: "SOFT" 50, "opsz" 24;
  font-size: 1.0rem;
  line-height: 1.55;
  color: var(--text-2);
  background: rgba(var(--gold-rgb), 0.06);
  border: 1px solid rgba(var(--gold-rgb), 0.22);
  border-left: 3px solid var(--gold);
  border-radius: 12px;
  padding: 12px 14px 12px 46px;
}
/* Spectacled-duck emblem (inline SVG, gold) */
.drquack::before {
  content: "";
  position: absolute;
  left: 12px; top: 11px;
  width: 24px; height: 24px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.92;
  /* a whimsical spectacled duck: head + bill + two specs */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffd9a0' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><path d='M7 14.5c-2.2-.4-3.5-2-3.5-4C3.5 7.4 6 5.2 9 5.2c2.6 0 4.7 1.7 5.2 4'/><path d='M14.2 9.2c1.3.2 2.3 1 2.6 2.2.5 2-1 3.9-3.4 4.4-1.1.2-3.4.3-5.1.1'/><path d='M16.8 11.4 21 10.6l-3.5 2.2'/><circle cx='8.4' cy='9' r='1.7'/><circle cx='12.4' cy='9' r='1.7'/><path d='M10.1 9h.6'/><path d='M6.7 9H5.4'/><path d='M8 16c-.5 1.4-1.7 2.3-3.2 2.4'/></svg>");
  filter: drop-shadow(0 0 6px rgba(var(--gold-rgb), 0.5));
}
/* Winner's dossier gets radiant treatment */
.standing.winner .drquack {
  background: rgba(var(--gold-rgb), 0.12);
  border-color: rgba(var(--gold-rgb), 0.4);
  color: #fff;
  box-shadow: 0 0 28px rgba(var(--gold-rgb), 0.22), inset 0 1px 0 rgba(255,255,255,0.08);
}
/* The inline "Dr. Quack:" label (app.js sets it bold, non-italic) */
.drquack > span { color: var(--gold); letter-spacing: 0.01em; }

/* ============================================================================
   16. BANNERS / NOTICES / SPINNER / SPECTATOR
   ========================================================================== */
.banner {
  position: relative;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-optical-sizing: auto;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  font-size: clamp(1.1rem, 4.5vw, 1.45rem);
  letter-spacing: -0.01em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
  animation: bannerIn 0.6s cubic-bezier(0.22, 0.9, 0.3, 1.1) both;
}
@keyframes bannerIn { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: none; } }
.banner.all  { background: rgba(var(--good-rgb), 0.16); border-color: rgba(var(--good-rgb), 0.45); color: #c9ffe2; box-shadow: 0 0 36px rgba(var(--good-rgb), 0.2), inset 0 1px 0 rgba(255,255,255,0.08); }
.banner.some { background: rgba(var(--lavender-rgb), 0.16); border-color: rgba(var(--lavender-rgb), 0.45); color: #ece4ff; box-shadow: 0 0 36px rgba(var(--lavender-rgb), 0.2), inset 0 1px 0 rgba(255,255,255,0.08); }
.banner.none { background: rgba(var(--gold-rgb), 0.16); border-color: rgba(var(--gold-rgb), 0.45); color: #fff0d6; box-shadow: 0 0 36px rgba(var(--gold-rgb), 0.22), inset 0 1px 0 rgba(255,255,255,0.08); }

.notice {
  text-align: center; color: var(--muted);
  padding: 18px; border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px dashed var(--hairline-strong);
}
.waiting { display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); font-weight: 500; }

.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-top-color: var(--lavender);
  border-right-color: var(--rose);
  animation: spin 0.85s linear infinite;
  flex: 0 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.spectator-strip {
  text-align: center; font-weight: 700; font-size: 0.86rem;
  padding: 10px; border-radius: 14px; margin-bottom: 2px;
  background: rgba(var(--peri-rgb), 0.14);
  border: 1px solid rgba(var(--peri-rgb), 0.32);
  color: var(--peri);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}

/* ============================================================================
   17. TOASTS
   ========================================================================== */
.toasts {
  position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 70; display: flex; flex-direction: column; gap: 10px; align-items: center;
  width: min(92vw, 540px); pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-radius: 16px;
  background: rgba(12, 8, 32, 0.90);
  -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--hairline-strong);
  box-shadow: var(--shadow);
  font-size: 0.92rem; font-weight: 600;
  animation: toastIn 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.1) both;
  transition: opacity 0.3s ease;
}
.toast.err  { border-color: rgba(var(--bad-rgb), 0.55);  box-shadow: var(--shadow), 0 0 26px rgba(var(--bad-rgb), 0.22); }
.toast.warn { border-color: rgba(var(--gold-rgb), 0.55); box-shadow: var(--shadow), 0 0 26px rgba(var(--gold-rgb), 0.22); }
.toast .row { gap: 10px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ============================================================================
   18. MUTE TOGGLE  (stays visible top-right, ≥44px)
   ========================================================================== */
.mute-toggle {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  z-index: 65;
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--hairline-strong);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  font-size: 1.05rem; color: var(--lavender);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255,255,255,0.10);
  transition: transform 0.15s ease, box-shadow 0.2s ease, color 0.2s ease;
}
.mute-toggle:hover { transform: scale(1.06); box-shadow: 0 8px 24px rgba(var(--lavender-rgb), 0.25), inset 0 1px 0 rgba(255,255,255,0.12); }
.mute-toggle:active { transform: scale(0.95); }
.mute-toggle .mute-off { display: none; color: var(--bad); }
.mute-toggle.muted { color: var(--bad); }
.mute-toggle.muted .mute-on { display: none; }
.mute-toggle.muted .mute-off { display: inline; }

/* ============================================================================
   19. DEMO BAR + MISC HELPERS
   ========================================================================== */
.demo-bar {
  position: fixed; left: 50%; top: calc(10px + env(safe-area-inset-top)); transform: translateX(-50%);
  z-index: 66; display: flex; gap: 6px; flex-wrap: wrap; justify-content: center;
  padding: 7px 9px; border-radius: var(--radius-pill);
  background: rgba(12, 8, 32, 0.85);
  -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--hairline-strong);
  box-shadow: var(--shadow-soft);
  max-width: 94vw;
}
.demo-bar button {
  font-size: 0.72rem; font-weight: 700; padding: 6px 11px; border-radius: var(--radius-pill);
  background: transparent; border: 1px solid transparent; color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease;
}
.demo-bar button:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.demo-bar button.active {
  background: linear-gradient(135deg, var(--lavender), var(--rose));
  color: var(--ink);
  box-shadow: 0 4px 14px rgba(var(--lavender-rgb), 0.4);
}

/* ============================================================================
   20. REDUCED MOTION  — calm everything; keep content fully legible
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .blob { animation: none; }
  .title { animation: none; }
  .projection { animation: none; }
  .timer .fill::after { animation: none; }
  .card.tappable:hover { transform: translateY(-3px); }
  /* Reveal cards must still appear even with motion off */
  .card.reveal-pending { opacity: 1; transform: none; filter: none; }
  .card.reveal-show { animation: none; }
  .vote-chip { animation: none; }
}
