:root {
  /* Dark theme (default) */
  --bg-base: #140f22;
  --bg-elevated: #1d1730;
  --bg-elevated-2: #241c3b;
  --glass-bg: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.12);

  --text-primary: #f5f1ff;
  --text-muted: #b3a8cf;
  --text-faint: #8377a3;

  --accent-coral: #ff6b5b;
  --accent-coral-strong: #ff5040;
  --accent-gold: #ffc857;
  --accent-violet: #9a7bff;
  --accent-teal: #4ce0c3;

  --focus-ring: #ffd166;

  --shadow-soft: 0 8px 30px rgba(0, 0, 0, 0.35);
  --shadow-glow-coral: 0 0 40px rgba(255, 107, 91, 0.35);
  --shadow-glow-gold: 0 0 30px rgba(255, 200, 87, 0.3);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  --font-display: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.375rem;
  --fs-xl: 1.75rem;
  --fs-2xl: 2.25rem;
  --fs-3xl: 3rem;

  --duration-fast: 150ms;
  --duration-base: 280ms;
  --duration-slow: 520ms;
  --ease-standard: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spin: cubic-bezier(0.15, 0.85, 0.25, 1);

  --z-base: 1;
  --z-board: 10;
  --z-header: 100;
  --z-overlay: 500;
  --z-modal: 600;
  --z-toast: 700;

  --tap-min: 44px;
  --vh: 1dvh;
}

/* ---------- Modern Themes ---------- */

/* Theme 1: Midnight Glass (Default Dark) */
[data-theme="midnight-glass"], [data-theme="dark"] {
  --bg-base: #140f22;
  --bg-elevated: #1d1730;
  --bg-elevated-2: #241c3b;
  --glass-bg: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.12);

  --text-primary: #f5f1ff;
  --text-muted: #b3a8cf;
  --text-faint: #8377a3;

  --accent-coral: #ff6b5b;
  --accent-coral-strong: #ff5040;
  --accent-gold: #ffc857;
  --accent-violet: #9a7bff;
  --accent-teal: #4ce0c3;

  --focus-ring: #ffd166;

  --shadow-soft: 0 8px 30px rgba(0, 0, 0, 0.35);
  --shadow-glow-coral: 0 0 40px rgba(255, 107, 91, 0.35);
  --shadow-glow-gold: 0 0 30px rgba(255, 200, 87, 0.3);

  --wheel-truth: #4ce0c3;
  --wheel-dare: #ff6b5b;
}

/* Theme 2: Neon Party */
[data-theme="neon-party"] {
  --bg-base: #05050a;
  --bg-elevated: #0d0d1a;
  --bg-elevated-2: #16162e;
  --glass-bg: rgba(255, 0, 127, 0.06);
  --glass-border: rgba(0, 240, 255, 0.22);

  --text-primary: #ffffff;
  --text-muted: #8ae4ff;
  --text-faint: #597d9a;

  --accent-coral: #ff007f;        /* Neon Pink */
  --accent-coral-strong: #e60073;
  --accent-gold: #39ff14;         /* Neon Green */
  --accent-violet: #bc13fe;       /* Neon Violet */
  --accent-teal: #00f0ff;         /* Neon Cyan */

  --focus-ring: #00f0ff;

  --shadow-soft: 0 8px 30px rgba(0, 240, 255, 0.15);
  --shadow-glow-coral: 0 0 40px rgba(255, 0, 127, 0.6);
  --shadow-glow-gold: 0 0 30px rgba(57, 255, 20, 0.5);

  --wheel-truth: #00f0ff;
  --wheel-dare: #ff007f;
}
[data-theme="neon-party"] .board {
  background: radial-gradient(circle, #100f24 0%, #05050a 100%);
  border-color: var(--accent-teal);
  box-shadow: inset 0 0 40px rgba(0, 240, 255, 0.3), var(--shadow-soft);
}
[data-theme="neon-party"] .bottle-svg-wrap svg path {
  fill: var(--accent-coral);
  stroke: var(--accent-teal);
  stroke-width: 2px;
}
[data-theme="neon-party"] .bottle-svg-wrap svg rect {
  fill: var(--accent-gold);
}

/* Theme 3: Sunset Pop */
[data-theme="sunset-pop"] {
  --bg-base: #2a0f1d;
  --bg-elevated: #3d142b;
  --bg-elevated-2: #4f1d39;
  --glass-bg: rgba(255, 120, 0, 0.08);
  --glass-border: rgba(255, 94, 58, 0.2);

  --text-primary: #fff1f5;
  --text-muted: #fca8cf;
  --text-faint: #b07090;

  --accent-coral: #ff5e3a;        /* Sunset Orange */
  --accent-coral-strong: #e04b2b;
  --accent-gold: #ffc72c;         /* Golden Sun */
  --accent-violet: #ff2e93;       /* Deep Pink */
  --accent-teal: #ffd085;

  --focus-ring: #ffc72c;

  --shadow-soft: 0 8px 30px rgba(0, 0, 0, 0.4);
  --shadow-glow-coral: 0 0 40px rgba(255, 94, 58, 0.45);
  --shadow-glow-gold: 0 0 30px rgba(255, 199, 44, 0.35);

  --wheel-truth: #ffc72c;
  --wheel-dare: #ff5e3a;
}
[data-theme="sunset-pop"] .board {
  background: radial-gradient(circle, #4f1d39 0%, #2a0f1d 100%);
  border-color: var(--accent-coral);
  box-shadow: inset 0 0 40px rgba(255, 94, 58, 0.3), var(--shadow-soft);
}
[data-theme="sunset-pop"] .bottle-svg-wrap svg path {
  fill: var(--accent-coral-strong);
  stroke: var(--accent-gold);
  stroke-width: 1.5px;
}

/* Theme 4: Ocean Chill */
[data-theme="ocean-chill"] {
  --bg-base: #071524;
  --bg-elevated: #0c233c;
  --bg-elevated-2: #123356;
  --glass-bg: rgba(0, 210, 252, 0.05);
  --glass-border: rgba(0, 210, 252, 0.15);

  --text-primary: #e6f7ff;
  --text-muted: #8cd6ff;
  --text-faint: #5a94b5;

  --accent-coral: #00d2fc;        /* Ice Blue */
  --accent-coral-strong: #00b6dc;
  --accent-gold: #52de97;         /* Mint Green */
  --accent-violet: #00a8cc;       /* Deep Cyan */
  --accent-teal: #a3f7bf;

  --focus-ring: #00d2fc;

  --shadow-soft: 0 8px 30px rgba(0, 0, 0, 0.4);
  --shadow-glow-coral: 0 0 40px rgba(0, 210, 252, 0.35);
  --shadow-glow-gold: 0 0 30px rgba(82, 222, 151, 0.3);

  --wheel-truth: #52de97;
  --wheel-dare: #00d2fc;
}
[data-theme="ocean-chill"] .board {
  background: radial-gradient(circle, #123356 0%, #071524 100%);
  border-color: var(--accent-coral);
  box-shadow: inset 0 0 40px rgba(0, 210, 252, 0.3), var(--shadow-soft);
}
[data-theme="ocean-chill"] .bottle-svg-wrap svg path {
  fill: var(--accent-violet);
  stroke: var(--accent-coral);
  stroke-width: 1.5px;
}

/* Theme 5: Candy Fun */
[data-theme="candy-fun"] {
  --bg-base: #33152c;
  --bg-elevated: #451b3a;
  --bg-elevated-2: #59254c;
  --glass-bg: rgba(255, 123, 178, 0.08);
  --glass-border: rgba(255, 123, 178, 0.22);

  --text-primary: #fff2f8;
  --text-muted: #ffa3c9;
  --text-faint: #b56c8f;

  --accent-coral: #ff7bb2;        /* Bubblegum Pink */
  --accent-coral-strong: #e65f97;
  --accent-gold: #ffe066;         /* Lemon drop yellow */
  --accent-violet: #c87cff;       /* Purple candy */
  --accent-teal: #7cffc4;

  --focus-ring: #ffe066;

  --shadow-soft: 0 8px 30px rgba(0, 0, 0, 0.4);
  --shadow-glow-coral: 0 0 40px rgba(255, 123, 178, 0.45);
  --shadow-glow-gold: 0 0 30px rgba(255, 224, 102, 0.35);

  --wheel-truth: #ffe066;
  --wheel-dare: #ff7bb2;
}
[data-theme="candy-fun"] .board {
  background: radial-gradient(circle, #59254c 0%, #33152c 100%);
  border-color: var(--accent-coral);
  box-shadow: inset 0 0 40px rgba(255, 123, 178, 0.3), var(--shadow-soft);
}
[data-theme="candy-fun"] .bottle-svg-wrap svg path {
  fill: var(--accent-violet);
  stroke: var(--accent-coral);
  stroke-width: 1.5px;
}

/* Theme 6: Classic Table */
[data-theme="classic-table"] {
  --bg-base: #0a1f11;
  --bg-elevated: #11331e;
  --bg-elevated-2: #174528;
  --glass-bg: rgba(212, 175, 55, 0.06);
  --glass-border: rgba(212, 175, 55, 0.18);

  --text-primary: #e6f5ec;
  --text-muted: #a3cbb3;
  --text-faint: #6e947e;

  --accent-coral: #cc2929;        /* Casino Red */
  --accent-coral-strong: #b21e1e;
  --accent-gold: #d4af37;         /* Gold felt */
  --accent-violet: #8c6239;       /* Mahogany wood */
  --accent-teal: #4ce0c3;

  --focus-ring: #d4af37;

  --shadow-soft: 0 8px 30px rgba(0, 0, 0, 0.5);
  --shadow-glow-coral: 0 0 40px rgba(204, 41, 41, 0.35);
  --shadow-glow-gold: 0 0 30px rgba(212, 175, 55, 0.3);

  --wheel-truth: #ffffff;
  --wheel-dare: #cc2929;
}
[data-theme="classic-table"] .board {
  background: radial-gradient(circle, #174528 0%, #0a1f11 100%);
  border: 8px solid #4a2c11;
  box-shadow: inset 0 0 50px rgba(0,0,0,0.6), var(--shadow-soft);
}
[data-theme="classic-table"] .bottle-svg-wrap svg path {
  fill: #0d381e;
  stroke: var(--accent-gold);
  stroke-width: 1.5px;
}

/* Theme 7: Minimal Light (Default Light) */
[data-theme="minimal-light"], [data-theme="light"] {
  --bg-base: #f8f9fa;
  --bg-elevated: #ffffff;
  --bg-elevated-2: #f1f3f5;
  --glass-bg: rgba(30, 41, 59, 0.04);
  --glass-border: rgba(30, 41, 59, 0.1);

  --text-primary: #1e293b;
  --text-muted: #475569;
  --text-faint: #64748b;

  --accent-coral: #ea580c;        /* Solid Dark Orange */
  --accent-coral-strong: #c2410c;
  --accent-gold: #0f172a;         /* Charcoal black for selected text */
  --accent-violet: #6366f1;       /* Indigo blue */
  --accent-teal: #0d9488;

  --focus-ring: #2563eb;

  --shadow-soft: 0 8px 30px rgba(30, 41, 59, 0.08);
  --shadow-glow-coral: 0 0 30px rgba(234, 88, 12, 0.18);
  --shadow-glow-gold: 0 0 24px rgba(15, 23, 42, 0.12);

  --wheel-truth: #0d9488;
  --wheel-dare: #ea580c;
}
[data-theme="minimal-light"] .board, [data-theme="light"] .board {
  background: radial-gradient(circle, #f1f3f5 0%, #ffffff 100%);
  border-color: var(--glass-border);
  box-shadow: inset 0 0 30px rgba(0,0,0,0.05), var(--shadow-soft);
}
[data-theme="minimal-light"] .bottle-svg-wrap svg path, [data-theme="light"] .bottle-svg-wrap svg path {
  fill: #64748b;
  stroke: #1e293b;
  stroke-width: 1.5px;
}

/* Theme 8: Retro Arcade */
[data-theme="retro-arcade"] {
  --bg-base: #0c0c10;
  --bg-elevated: #15151e;
  --bg-elevated-2: #1e1e2c;
  --glass-bg: rgba(135, 255, 0, 0.05);
  --glass-border: rgba(135, 255, 0, 0.2);

  --text-primary: #ffffff;
  --text-muted: #87ff00;          /* Retro Lime Green */
  --text-faint: #6d6d8a;

  --accent-coral: #a200ff;        /* Neon Purple */
  --accent-coral-strong: #8b00db;
  --accent-gold: #00ffff;         /* Cyber Cyan */
  --accent-violet: #ff0055;       /* Retro Hot Pink */
  --accent-teal: #87ff00;

  --focus-ring: #00ffff;

  --shadow-soft: 0 8px 30px rgba(135, 255, 0, 0.15);
  --shadow-glow-coral: 0 0 40px rgba(162, 0, 255, 0.5);
  --shadow-glow-gold: 0 0 30px rgba(0, 255, 255, 0.5);

  --font-display: "Courier New", Courier, monospace;

  --wheel-truth: #87ff00;
  --wheel-dare: #a200ff;
}
[data-theme="retro-arcade"] .board {
  background: radial-gradient(circle, #1e1e2c 0%, #0c0c10 100%);
  border: 4px double var(--accent-coral);
  box-shadow: inset 0 0 30px rgba(135, 255, 0, 0.2), var(--shadow-soft);
}
[data-theme="retro-arcade"] .bottle-svg-wrap svg path {
  fill: #000;
  stroke: var(--accent-teal);
  stroke-width: 3px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100svh;
  min-height: 100dvh;
}
img { max-width: 100%; display: block; }
button { font: inherit; }
a { color: var(--accent-gold); }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 var(--space-3); }
p { margin: 0 0 var(--space-3); color: var(--text-muted); }

@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;
  }
}

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

:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ---------- Layout shell ---------- */
.site-header {
  position: sticky; top: 0; z-index: var(--z-header);
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  padding-top: max(var(--space-3), env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg-base) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--glass-border);
}
.brand { display: flex; align-items: center; gap: var(--space-2); font-family: var(--font-display); font-size: var(--fs-md); font-weight: 700; color: var(--text-primary); text-decoration: none; }
.brand-mark { width: 28px; height: 28px; flex-shrink: 0; }

.header-actions { display: flex; align-items: center; gap: var(--space-2); }
.icon-btn {
  width: var(--tap-min); height: var(--tap-min);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill); color: var(--text-primary);
  cursor: pointer; transition: transform var(--duration-fast) var(--ease-standard), background var(--duration-fast);
}
.icon-btn:hover { background: var(--bg-elevated-2); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn svg { width: 20px; height: 20px; }

main { display: block; }

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

/* ---------- Hero / intro ---------- */
.hero {
  padding: var(--space-6) 0 var(--space-4);
  text-align: center;
}
.hero h1 {
  font-size: clamp(1.9rem, 6vw, var(--fs-3xl));
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-coral));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .lede { max-width: 60ch; margin: 0 auto var(--space-4); font-size: var(--fs-md); }
.hero-tags { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: center; margin-bottom: var(--space-5); }
.tag {
  font-size: var(--fs-xs); padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill); background: var(--glass-bg);
  border: 1px solid var(--glass-border); color: var(--text-muted);
}

/* ---------- Game section ---------- */
.game-section {
  padding: var(--space-4) 0 var(--space-7);
}

.game-stage {
  display: contents;
}

.game-card {
  background: linear-gradient(180deg, var(--bg-elevated), var(--bg-elevated-2));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: var(--space-5);
  position: relative;
  overflow: hidden;
  transition: background var(--duration-base);
}

.game-card-top {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.game-card-top .mode-bar { flex: 1; margin-bottom: 0; }

.fullscreen-btn {
  flex-shrink: 0;
  margin-bottom: var(--space-3);
}
.fullscreen-btn[aria-pressed="true"] {
  background: var(--mode-accent, var(--accent-coral));
  color: #fff;
  border-color: transparent;
}

/* Fullscreen play mode: native Fullscreen API target */
#game-stage:fullscreen,
#game-stage:-webkit-full-screen {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  background: var(--bg-base);
  padding: var(--space-5);
  overflow-y: auto;
  align-items: center;
  justify-content: flex-start;
}
#game-stage:fullscreen .game-card,
#game-stage:-webkit-full-screen .game-card { width: min(560px, 92vw); }
#game-stage:fullscreen .players-panel,
#game-stage:-webkit-full-screen .players-panel { width: min(560px, 92vw); }

/* Fallback for browsers without the Fullscreen API */
.game-stage.is-app-mode {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  position: fixed;
  inset: 0;
  z-index: 900;
  background: var(--bg-base);
  padding: var(--space-4);
  padding-top: max(var(--space-4), env(safe-area-inset-top));
  padding-bottom: max(var(--space-4), env(safe-area-inset-bottom));
  overflow-y: auto;
  align-items: center;
}
.game-stage.is-app-mode .game-card,
.game-stage.is-app-mode .players-panel { width: min(560px, 92vw); }

.mode-bar {
  display: flex; gap: var(--space-2); overflow-x: auto; padding-bottom: var(--space-3);
  margin-bottom: var(--space-4); -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.mode-chip {
  flex: 0 0 auto;
  min-height: var(--tap-min);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-pill);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 600;
  font-size: var(--fs-sm);
  transition: background var(--duration-fast), color var(--duration-fast), border-color var(--duration-fast);
  white-space: nowrap;
}
.mode-chip[aria-pressed="true"] {
  background: linear-gradient(135deg, var(--mode-accent, var(--accent-coral)), var(--mode-accent-strong, var(--accent-gold)));
  color: #1a1025;
  border-color: transparent;
}

/* ---------- Wedge wheel (Classic mode: alternating Truth/Dare wheel) ---------- */
.wedge-wheel {
  position: absolute;
  inset: 0;
  z-index: var(--z-base);
  opacity: 0;
  transform: scale(0.94);
  pointer-events: none;
  transition: opacity var(--duration-base) var(--ease-standard), transform var(--duration-base) var(--ease-standard);
}
.wedge-wheel.is-active { opacity: 1; transform: scale(1); }
.wedge-wheel svg { width: 100%; height: 100%; border-radius: 50%; }
.wedge-label {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 6px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  fill: rgba(255, 255, 255, 0.92);
  paint-order: stroke;
  stroke: rgba(0, 0, 0, 0.25);
  stroke-width: 0.6px;
}
[data-theme="light"] .wedge-label,
[data-theme="minimal-light"] .wedge-label { fill: rgba(20, 15, 34, 0.88); stroke: rgba(255, 255, 255, 0.4); }

.board-wrap {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-4);
}

.board {
  position: relative;
  width: min(92vw, 420px);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, var(--bg-elevated-2) 0%, var(--bg-elevated) 62%, var(--bg-base) 100%);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 0 60px rgba(0,0,0,0.35), var(--shadow-soft);
  display: grid;
  place-items: center;
  isolation: isolate;
}

.board-ring {
  position: absolute; inset: 6%;
  border-radius: 50%;
  border: 1px dashed var(--glass-border);
  transition: opacity var(--duration-base);
}
.board.classic-mode .board-ring { opacity: 0; }

.player-chip {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: var(--space-1);
  width: 76px;
  transition: filter var(--duration-base) var(--ease-standard);
}
.player-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: var(--fs-sm);
  background: var(--bg-elevated-2);
  border: 2px solid var(--glass-border);
  color: var(--text-primary);
  transition: box-shadow var(--duration-base), border-color var(--duration-base), transform var(--duration-base);
}
.player-name {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  max-width: 76px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}
.player-chip.is-selected .player-avatar {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 6px rgba(255, 200, 87, 0.18), var(--shadow-glow-gold);
  transform: scale(1.12);
}
.player-chip.is-selected .player-name { color: var(--accent-gold); font-weight: 700; }

.bottle-pivot {
  position: relative;
  width: 40%;
  aspect-ratio: 1 / 1;
  z-index: var(--z-board);
}
.bottle-btn {
  width: 100%; height: 100%;
  background: transparent; border: none; cursor: pointer;
  display: block; padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.bottle-btn:disabled { cursor: not-allowed; }
.bottle-svg-wrap {
  width: 100%; height: 100%;
  transform-origin: 50% 50%;
  filter: drop-shadow(var(--mode-glow, var(--shadow-glow-coral)));
  will-change: transform;
  transition: filter var(--duration-base);
}
.bottle-svg-wrap.idle { animation: idleSway 3.2s ease-in-out infinite; }
@keyframes idleSway {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
}

.spin-cta {
  min-height: 52px;
  padding: 0 var(--space-6);
  border-radius: var(--radius-pill);
  border: none;
  background: linear-gradient(135deg, var(--mode-accent, var(--accent-coral)), var(--mode-accent-strong, var(--accent-coral-strong)));
  color: #fff;
  font-weight: 800;
  font-size: var(--fs-md);
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: var(--mode-glow, var(--shadow-glow-coral));
  transition: transform var(--duration-fast) var(--ease-standard), opacity var(--duration-fast), box-shadow var(--duration-base);
}
.spin-cta:hover { transform: translateY(-2px); }
.spin-cta:active { transform: translateY(0) scale(0.98); }
.spin-cta:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }

.result-panel {
  width: 100%;
  max-width: 420px;
  text-align: center;
  min-height: 32px;
}
.result-name { font-family: var(--font-display); font-size: var(--fs-xl); color: var(--accent-gold); }

.tud-choice { display: flex; gap: var(--space-3); justify-content: center; margin-top: var(--space-3); flex-wrap: wrap; }
.choice-btn {
  min-height: var(--tap-min); padding: 0 var(--space-5);
  border-radius: var(--radius-pill); border: 1px solid var(--glass-border);
  background: var(--glass-bg); color: var(--text-primary); font-weight: 700;
  cursor: pointer;
}
.choice-btn.truth { border-color: var(--accent-teal); }
.choice-btn.dare { border-color: var(--accent-coral); }
.choice-btn:hover { background: var(--bg-elevated-2); }

.prompt-card {
  margin-top: var(--space-4);
  padding: var(--space-5);
  border-radius: var(--radius-md);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  text-align: left;
}
.prompt-meta { display: flex; gap: var(--space-2); align-items: center; margin-bottom: var(--space-2); }
.prompt-badge {
  font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 2px var(--space-2); border-radius: var(--radius-sm);
}
.prompt-badge.truth { background: rgba(76, 224, 195, 0.18); color: var(--accent-teal); }
.prompt-badge.dare { background: rgba(255, 107, 91, 0.18); color: var(--accent-coral); }
.prompt-level { font-size: var(--fs-xs); color: var(--text-faint); }
.prompt-text { font-size: var(--fs-lg); color: var(--text-primary); margin: 0; }
.prompt-actions { display: flex; gap: var(--space-2); margin-top: var(--space-4); flex-wrap: wrap; }
.ghost-btn {
  min-height: var(--tap-min); padding: 0 var(--space-4);
  border-radius: var(--radius-pill); border: 1px solid var(--glass-border);
  background: transparent; color: var(--text-primary); cursor: pointer; font-weight: 600;
}
.ghost-btn:hover { background: var(--glass-bg); }

/* ---------- Players panel ---------- */
.players-panel { margin-top: var(--space-5); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-3); }
.panel-heading h2 { font-size: var(--fs-md); margin: 0; }

.player-list { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-3); }
.player-row {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
}
.player-row .row-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-xs); font-weight: 700; background: var(--bg-elevated-2);
}
.player-row input[type="text"] {
  flex: 1; min-width: 0; background: transparent; border: none; color: var(--text-primary);
  font-size: var(--fs-base); padding: var(--space-2) 0;
}
.player-row .remove-btn {
  width: var(--tap-min); height: var(--tap-min); border-radius: 50%;
  border: none; background: transparent; color: var(--text-faint); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.player-row .remove-btn:hover { color: var(--accent-coral); }
.player-row.has-error { border-color: var(--accent-coral); }
.field-error { color: var(--accent-coral); font-size: var(--fs-xs); margin: -var(--space-1) 0 var(--space-2) var(--space-3); }

.player-controls { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.primary-btn {
  min-height: var(--tap-min); padding: 0 var(--space-4);
  border-radius: var(--radius-pill); border: none;
  background: linear-gradient(135deg, var(--accent-violet), #7159e0);
  color: #fff; font-weight: 700; cursor: pointer;
}
.text-btn {
  min-height: var(--tap-min); padding: 0 var(--space-3);
  border: none; background: transparent; color: var(--text-muted); cursor: pointer; font-weight: 600;
}
.text-btn:hover { color: var(--text-primary); }

/* ---------- Content sections ---------- */
.content-section { padding: var(--space-7) 0; border-top: 1px solid var(--glass-border); }
.content-section h2 { font-size: var(--fs-2xl); }
.content-section .section-lede { max-width: 65ch; }

.steps-list { display: grid; gap: var(--space-3); margin-top: var(--space-4); }
.step-item { display: flex; gap: var(--space-3); align-items: flex-start; }
.step-num {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%;
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--accent-gold);
  font-family: var(--font-display);
}

.mode-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-3); margin-top: var(--space-4); }
@media (min-width: 640px) { .mode-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .mode-grid { grid-template-columns: repeat(3, 1fr); } }
.mode-card {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
}
.mode-card h3 { font-size: var(--fs-md); margin-bottom: var(--space-1); }
.audience-badge {
  display: inline-block; font-size: var(--fs-xs); color: var(--text-faint);
  border: 1px solid var(--glass-border); padding: 1px var(--space-2); border-radius: var(--radius-pill);
  margin-bottom: var(--space-2);
}

.tips-list { display: grid; gap: var(--space-2); margin-top: var(--space-3); }
.tips-list li { display: flex; gap: var(--space-2); color: var(--text-muted); }
.tips-list li::before { content: "✦"; color: var(--accent-gold); flex-shrink: 0; }

.faq-item { border-bottom: 1px solid var(--glass-border); }
.faq-item summary {
  padding: var(--space-3) 0; cursor: pointer; font-weight: 700; color: var(--text-primary);
  display: flex; justify-content: space-between; align-items: center; gap: var(--space-3);
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--accent-gold); font-size: var(--fs-lg); flex-shrink: 0; }
.faq-item[open] summary::after { content: "–"; }
.faq-item p { padding-bottom: var(--space-3); }

.related-links { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
.related-links a {
  display: inline-block; padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-pill); border: 1px solid var(--glass-border);
  color: var(--text-primary); text-decoration: none; font-size: var(--fs-sm);
}
.related-links a:hover { background: var(--glass-bg); }

/* ---------- Ad slots ---------- */
.ad-slot {
  border: 1px dashed var(--glass-border);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-faint); font-size: var(--fs-xs);
  margin: var(--space-6) 0;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--glass-border);
  padding: var(--space-6) 0;
  padding-bottom: max(var(--space-6), env(safe-area-inset-bottom));
}
.footer-grid { display: grid; gap: var(--space-5); grid-template-columns: 1fr; }
@media (min-width: 640px) { .footer-grid { grid-template-columns: repeat(3, 1fr); } }
.footer-col h3 { font-size: var(--fs-sm); color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: var(--space-2); }
.footer-col a { display: block; color: var(--text-muted); text-decoration: none; padding: var(--space-1) 0; font-size: var(--fs-sm); }
.footer-col a:hover { color: var(--text-primary); }
.footer-bottom { margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--glass-border); display: flex; flex-wrap: wrap; gap: var(--space-3); justify-content: space-between; color: var(--text-faint); font-size: var(--fs-xs); }

/* ---------- Modal / bottom sheet ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(10, 6, 20, 0.6);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: var(--z-overlay); opacity: 0; pointer-events: none;
  transition: opacity var(--duration-base) var(--ease-standard);
}
.overlay.is-open { opacity: 1; pointer-events: auto; }
@media (min-width: 640px) { .overlay { align-items: center; } }

.sheet {
  width: 100%; max-width: 520px;
  max-height: min(86vh, 86dvh);
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: var(--space-5);
  padding-bottom: max(var(--space-5), env(safe-area-inset-bottom));
  transform: translateY(24px);
  transition: transform var(--duration-base) var(--ease-standard);
  z-index: var(--z-modal);
}
@media (min-width: 640px) { .sheet { border-radius: var(--radius-lg); transform: translateY(0) scale(0.97); } }
.overlay.is-open .sheet { transform: translateY(0) scale(1); }

.sheet-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-4); }
.sheet-header h2 { margin: 0; font-size: var(--fs-lg); }
.sheet-close {
  width: var(--tap-min); height: var(--tap-min); border-radius: 50%;
  border: none; background: var(--glass-bg); color: var(--text-primary); cursor: pointer;
}

.form-row { margin-bottom: var(--space-4); }
.form-row label { display: block; font-size: var(--fs-sm); color: var(--text-muted); margin-bottom: var(--space-1); }
.form-row select, .form-row input[type="text"], .form-row textarea {
  width: 100%; padding: var(--space-3); border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border); background: var(--bg-elevated-2); color: var(--text-primary);
  font-size: var(--fs-base);
}
.form-row textarea { min-height: 80px; resize: vertical; }
.form-actions { display: flex; gap: var(--space-2); justify-content: flex-end; flex-wrap: wrap; }

.custom-list { display: flex; flex-direction: column; gap: var(--space-2); margin: var(--space-3) 0; max-height: 220px; overflow-y: auto; }
.custom-item { display: flex; gap: var(--space-2); align-items: center; padding: var(--space-2); border-radius: var(--radius-sm); background: var(--glass-bg); }
.custom-item span { flex: 1; font-size: var(--fs-sm); }
.empty-state { text-align: center; color: var(--text-faint); padding: var(--space-4); font-size: var(--fs-sm); }

/* ---------- Toast ---------- */
.toast-region {
  position: fixed; left: 50%; bottom: max(var(--space-5), env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: var(--z-toast);
  display: flex; flex-direction: column; gap: var(--space-2);
  width: min(92vw, 420px);
}
.toast {
  background: var(--bg-elevated-2); border: 1px solid var(--glass-border);
  color: var(--text-primary); padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-soft);
  font-size: var(--fs-sm);
  animation: toastIn var(--duration-base) var(--ease-standard);
}
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Confetti ---------- */
.confetti-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: var(--z-board); }
.confetti-piece {
  position: absolute; top: -10px; width: 8px; height: 14px; opacity: 0.9;
  animation: confettiFall 1100ms ease-in forwards;
}
@keyframes confettiFall {
  to { transform: translateY(240px) rotate(340deg); opacity: 0; }
}

/* ---------- Utility ---------- */
.hidden { display: none !important; }

/* ---------- New Theme & Settings Components ---------- */
.theme-selector-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2);
  margin-top: var(--space-2);
  margin-bottom: var(--space-4);
}
.theme-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background var(--duration-fast), border-color var(--duration-fast);
}
.theme-btn:hover {
  background: var(--bg-elevated-2);
}
.theme-btn.is-active {
  border-color: var(--accent-coral);
  background: var(--bg-elevated-2);
}
.theme-color-preview {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}
.theme-color-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--glass-border);
}
.settings-row:last-of-type {
  border-bottom: none;
}
.settings-row label {
  font-weight: 600;
  color: var(--text-primary);
  font-size: var(--fs-base);
  margin-bottom: 0;
  cursor: pointer;
}
.settings-row p {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin: 0;
}
.settings-control {
  display: flex;
  align-items: center;
  margin-left: var(--space-3);
}

.recent-winners-panel {
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--glass-border);
}
.recent-winners-title {
  font-size: var(--fs-xs);
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-2);
  font-weight: 700;
}
.recent-winners-list {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.recent-winner-badge {
  font-size: var(--fs-xs);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--bg-elevated-2);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  animation: badgeIn var(--duration-fast) var(--ease-standard);
}
@keyframes badgeIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

/* ---------- Point Scorekeeper & Suspense Timer Styles ---------- */
.score-controls {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-right: var(--space-2);
}
.score-display {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--accent-gold);
  font-weight: 700;
  min-width: 42px;
  text-align: center;
}
.score-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-primary);
  font-size: var(--fs-md);
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background var(--duration-fast), transform var(--duration-fast);
}
.score-btn:hover {
  background: var(--bg-elevated-2);
}
.score-btn:active {
  transform: scale(0.9);
}

.prompt-timer-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px dashed var(--glass-border);
}
.prompt-timer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.timer-title {
  font-size: var(--fs-xs);
  color: var(--text-faint);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.timer-number {
  font-family: var(--font-mono);
  font-size: var(--fs-lg);
  color: var(--accent-coral);
  font-weight: 800;
}
.timer-number.expired {
  color: var(--accent-coral-strong);
  animation: pulseExpire 0.5s ease infinite alternate;
}
@keyframes pulseExpire {
  from { transform: scale(1); }
  to { transform: scale(1.15); opacity: 0.8; }
}
.timer-progress-bg {
  width: 100%;
  height: 6px;
  background: var(--glass-bg);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.timer-progress-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--accent-teal), var(--accent-coral));
  border-radius: var(--radius-pill);
  transition: width 1s linear;
}
.timer-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-1);
}
.timer-control-btn {
  min-height: 32px;
  padding: 0 var(--space-3);
  font-size: var(--fs-xs);
  font-weight: 600;
  border-radius: var(--radius-pill);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-primary);
  cursor: pointer;
}
.timer-control-btn:hover {
  background: var(--bg-elevated-2);
}
