/* style.css — design tokens + components for Spark or Dare */

:root {
  /* Type scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 5rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  --radius-sm: 0.5rem;
  --radius-md: 0.875rem;
  --radius-lg: 1.25rem;
  --radius-xl: 1.75rem;
  --radius-full: 9999px;

  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  --content-narrow: 640px;
  --content-default: 880px;
  --content-wide: 1180px;

  --font-display: 'Clash Display', 'Segoe UI', sans-serif;
  --font-body: 'Satoshi', 'Inter', sans-serif;
}

/* DARK (default) — neon party night */
:root,
[data-theme='dark'] {
  --color-bg: #120a20;
  --color-surface: #1c1030;
  --color-surface-2: #251640;
  --color-surface-offset: #170c29;
  --color-border: #3c2a5c;
  --color-divider: #2c1c47;

  --color-text: #f5eefe;
  --color-text-muted: #b6a4d9;
  --color-text-faint: #8873af;
  --color-text-inverse: #1c1030;

  --color-primary: #ff3d81;
  --color-primary-hover: #ff5f97;
  --color-primary-active: #e02268;
  --color-primary-highlight: #3d1f38;

  --color-secondary: #ffb020;
  --color-secondary-hover: #ffc253;
  --color-secondary-active: #e6960a;

  --color-success: #35d499;
  --color-warning: #ffb020;
  --color-error: #ff5470;

  --shadow-sm: 0 2px 8px rgba(10, 4, 24, 0.35);
  --shadow-md: 0 10px 30px rgba(10, 4, 24, 0.45);
  --shadow-lg: 0 24px 60px rgba(10, 4, 24, 0.55);

  --gradient-hero: radial-gradient(circle at 20% 15%, #3a1a5c 0%, transparent 55%),
    radial-gradient(circle at 85% 10%, #4a1240 0%, transparent 50%),
    radial-gradient(circle at 50% 100%, #1c0e35 0%, #120a20 60%);
}

/* LIGHT */
[data-theme='light'] {
  --color-bg: #fbf5ff;
  --color-surface: #ffffff;
  --color-surface-2: #f6ecff;
  --color-surface-offset: #f1e4fb;
  --color-border: #e3d2f3;
  --color-divider: #ecdffa;

  --color-text: #241238;
  --color-text-muted: #6b5686;
  --color-text-faint: #9a8bb3;
  --color-text-inverse: #fdf8ff;

  --color-primary: #d61e70;
  --color-primary-hover: #b8135c;
  --color-primary-active: #920e49;
  --color-primary-highlight: #fbdcea;

  --color-secondary: #c6720a;
  --color-secondary-hover: #a75e04;
  --color-secondary-active: #834900;

  --color-success: #1f9d6c;
  --color-warning: #b8730a;
  --color-error: #d6285a;

  --shadow-sm: 0 2px 8px rgba(90, 50, 120, 0.08);
  --shadow-md: 0 10px 30px rgba(90, 50, 120, 0.12);
  --shadow-lg: 0 24px 60px rgba(90, 50, 120, 0.16);

  --gradient-hero: radial-gradient(circle at 20% 15%, #fbe4f3 0%, transparent 55%),
    radial-gradient(circle at 85% 10%, #fdeccb 0%, transparent 50%),
    radial-gradient(circle at 50% 100%, #fef8ff 0%, #fbf5ff 60%);
}

/* ---------- Layout shells ---------- */
.wrap {
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-4);
  background: color-mix(in oklab, var(--color-bg) 78%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-divider);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-lg);
  letter-spacing: -0.01em;
  color: var(--color-text);
  text-decoration: none;
}
.brand-mark {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
}
.theme-toggle:hover {
  color: var(--color-text);
  border-color: var(--color-primary);
}

main {
  min-height: 100dvh;
  background-image: var(--gradient-hero);
}

/* ---------- Hero / screen sections ---------- */
.screen {
  padding-block: clamp(var(--space-10), 6vw, var(--space-24));
  display: none;
}
.screen.is-active {
  display: block;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
  background: var(--color-primary-highlight);
  border: 1px solid color-mix(in oklab, var(--color-primary) 35%, transparent);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-6);
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-3xl);
  letter-spacing: -0.02em;
  max-width: 16ch;
  margin-bottom: var(--space-5);
}
.hero-title .accent {
  background: linear-gradient(100deg, var(--color-primary), var(--color-secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 52ch;
  margin-bottom: var(--space-8);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-16);
  align-items: center;
}
@media (max-width: 860px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: var(--space-10);
  }
}

.stat-row {
  display: flex;
  gap: var(--space-8);
  margin-top: var(--space-10);
  flex-wrap: wrap;
}
.stat-num {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-text);
}
.stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Bottle illustration card */
.bottle-card {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-xl);
  background: linear-gradient(155deg, var(--color-surface), var(--color-surface-2));
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.bottle-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 40%, color-mix(in oklab, var(--color-primary) 22%, transparent), transparent 65%);
}
.bottle-svg {
  width: 46%;
  transition: transform 900ms cubic-bezier(0.2, 0.9, 0.15, 1);
  filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.35));
}
.bottle-svg.spinning {
  transition: transform 2600ms cubic-bezier(0.15, 0.9, 0.1, 1);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-sm);
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(100deg, var(--color-primary), var(--color-secondary));
  color: #1a0c14;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.btn-ghost {
  background: color-mix(in oklab, var(--color-surface) 60%, transparent);
  border-color: var(--color-border);
  color: var(--color-text);
}
.btn-ghost:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.btn-lg {
  padding: var(--space-5) var(--space-10);
  font-size: var(--text-base);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}
.hero-ctas {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

/* ---------- Setup screen ---------- */
.setup-card {
  max-width: var(--content-narrow);
  margin-inline: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: clamp(var(--space-6), 4vw, var(--space-10));
  box-shadow: var(--shadow-md);
}
.setup-card h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  margin-bottom: var(--space-2);
}
.setup-card .lede {
  color: var(--color-text-muted);
  margin-bottom: var(--space-8);
}
.field-label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-faint);
  margin-bottom: var(--space-3);
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-8);
}
@media (max-width: 560px) {
  .option-grid {
    grid-template-columns: 1fr;
  }
}
.option-card {
  border: 1px solid var(--color-border);
  background: var(--color-surface-2);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  text-align: left;
}
.option-card strong {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-base);
  margin-bottom: var(--space-1);
}
.option-card span {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.option-card.is-selected {
  border-color: var(--color-primary);
  background: var(--color-primary-highlight);
  box-shadow: 0 0 0 1px var(--color-primary);
}

.heat-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-8);
}
.heat-pill {
  flex: 1 1 auto;
  min-width: 84px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-2);
  border-radius: var(--radius-full);
  padding: var(--space-3) var(--space-2);
  text-align: center;
  font-size: var(--text-xs);
  font-weight: 600;
}
.heat-pill.is-selected {
  border-color: var(--color-secondary);
  background: color-mix(in oklab, var(--color-secondary) 22%, var(--color-surface-2));
  color: var(--color-text);
}

/* AI backend status badge — tells the room whether prompts are live or built-in */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.ai-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.32rem 0.7rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-surface-2);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
.ai-status::before {
  content: '';
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: currentColor;
}
.ai-status.is-checking {
  color: var(--color-text);
  opacity: 0.65;
}
.ai-status.is-live {
  color: #2fd07a;
  border-color: color-mix(in oklab, #2fd07a 45%, var(--color-border));
}
.ai-status.is-offline {
  color: #e8a33d;
  border-color: color-mix(in oklab, #e8a33d 45%, var(--color-border));
}
/* on narrow screens the badge collapses to a dot — hover/title still explains it */
@media (max-width: 640px) {
  .ai-status {
    gap: 0;
    padding: 0.5rem;
    font-size: 0;
  }
  .ai-status::before {
    width: 0.55rem;
    height: 0.55rem;
  }
}

.player-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.player-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
}
.player-row .dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  flex-shrink: 0;
}
.player-row .name {
  flex: 1 1 6rem;
  min-width: 0;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.player-row button {
  color: var(--color-text-faint);
  font-size: var(--text-sm);
}
.player-row button:hover {
  color: var(--color-error);
}

.add-player-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.add-player-row input {
  flex: 1 1 10rem;
  min-width: 0;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  color: var(--color-text);
}
.add-player-row input:focus-visible {
  border-color: var(--color-primary);
}

/* per-player gender / orientation pickers */
.player-select {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 1 auto;
  background-color: var(--color-surface-2);
  background-image: linear-gradient(45deg, transparent 50%, var(--color-text-faint) 50%),
    linear-gradient(135deg, var(--color-text-faint) 50%, transparent 50%);
  background-position: calc(100% - 1.05rem) 50%, calc(100% - 0.7rem) 50%;
  background-size: 0.35rem 0.35rem, 0.35rem 0.35rem;
  background-repeat: no-repeat;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) 1.7rem var(--space-3) var(--space-3);
  color: var(--color-text);
  font: inherit;
  font-size: var(--text-sm);
  cursor: pointer;
}
.player-select:focus-visible {
  border-color: var(--color-primary);
}
.player-select.is-unset {
  color: var(--color-text-faint);
}
.helper-text {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-top: var(--space-2);
}

.field-label-optional {
  text-transform: none;
  font-weight: 400;
  letter-spacing: normal;
  color: var(--color-text-faint);
}
.theme-textarea {
  width: 100%;
  resize: vertical;
  min-height: 4.5rem;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  color: var(--color-text);
  font-family: inherit;
  font-size: var(--text-sm);
  line-height: 1.5;
}
.theme-textarea::placeholder {
  color: var(--color-text-faint);
}
.theme-textarea:focus-visible {
  border-color: var(--color-primary);
  outline: none;
}

/* ---------- Game screen ---------- */
.game-shell {
  max-width: var(--content-narrow);
  margin-inline: auto;
  text-align: center;
}
.turn-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}
.turn-name {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  margin-bottom: var(--space-8);
}
.turn-name .who {
  background: linear-gradient(100deg, var(--color-primary), var(--color-secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.choice-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-10);
}
@media (max-width: 520px) {
  .choice-row {
    grid-template-columns: 1fr;
  }
}
.choice-btn {
  padding: var(--space-8);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  text-align: left;
}
.choice-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.choice-btn .icon {
  width: 40px;
  height: 40px;
  margin-bottom: var(--space-4);
}
.choice-btn.truth .icon {
  color: var(--color-primary);
}
.choice-btn.dare .icon {
  color: var(--color-secondary);
}
.choice-btn strong {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  margin-bottom: var(--space-1);
}
.choice-btn span {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.prompt-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: clamp(var(--space-8), 6vw, var(--space-12));
  box-shadow: var(--shadow-lg);
  margin-bottom: var(--space-8);
}
.prompt-kind {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-6);
}
.prompt-kind.truth {
  color: var(--color-primary);
  background: var(--color-primary-highlight);
}
.prompt-kind.dare {
  color: var(--color-secondary);
  background: color-mix(in oklab, var(--color-secondary) 18%, var(--color-surface-2));
}
.prompt-text {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 500;
  line-height: 1.3;
  max-width: 34ch;
  margin-inline: auto;
}

.game-actions {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  flex-wrap: wrap;
}

.exit-link {
  display: inline-block;
  margin-top: var(--space-10);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}
.exit-link:hover {
  color: var(--color-primary);
}

/* ---------- Modes / how-it-works sections on landing ---------- */
.section {
  padding-block: clamp(var(--space-10), 6vw, var(--space-20));
}
.section-head {
  max-width: 48ch;
  margin-bottom: var(--space-10);
}
.section-head .eyebrow {
  margin-bottom: var(--space-4);
}
.section-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  letter-spacing: -0.01em;
}
.section-lede {
  color: var(--color-text-muted);
  margin-top: var(--space-3);
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}
@media (max-width: 860px) {
  .mode-grid {
    grid-template-columns: 1fr;
  }
}
.mode-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}
.mode-card .num {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--color-text-faint);
  margin-bottom: var(--space-4);
}
.mode-card h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  margin-bottom: var(--space-2);
}
.mode-card p {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.steps-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-5);
}
@media (max-width: 900px) {
  .steps-list {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 560px) {
  .steps-list {
    grid-template-columns: 1fr;
  }
}
.step-card {
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  background: var(--color-surface-2);
  border: 1px solid var(--color-divider);
}
.step-card .num {
  font-family: var(--font-display);
  color: var(--color-primary);
  font-size: var(--text-lg);
  margin-bottom: var(--space-3);
}
.step-card h4 {
  font-size: var(--text-sm);
  margin-bottom: var(--space-2);
}
.step-card p {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.site-footer {
  border-top: 1px solid var(--color-divider);
  padding-block: var(--space-8);
  text-align: center;
  color: var(--color-text-faint);
  font-size: var(--text-xs);
}

/* live region toast for "copied" style micro feedback */
.toast {
  position: fixed;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-md);
  font-size: var(--text-sm);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease;
  z-index: 60;
}
.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------------- Age gate ---------------- */
.age-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  background: radial-gradient(circle at 30% 20%, #2a1240 0%, transparent 55%),
    radial-gradient(circle at 80% 80%, #3a0f2e 0%, transparent 50%),
    #0a0614;
  transition: opacity 260ms ease, visibility 260ms ease;
}
.age-gate.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.age-gate-card {
  max-width: 30rem;
  width: 100%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl, 1.25rem);
  padding: var(--space-8);
  text-align: center;
  box-shadow: var(--shadow-lg, 0 20px 60px rgba(0,0,0,0.45));
}
.age-gate-logo {
  margin-inline: auto;
  display: block;
  margin-bottom: var(--space-4);
}
.age-gate-badge {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #FF3D81;
  background: color-mix(in oklab, #FF3D81 14%, transparent);
  border: 1px solid color-mix(in oklab, #FF3D81 35%, transparent);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-4);
}
.age-gate-card h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  line-height: 1.25;
  margin-bottom: var(--space-3);
  color: var(--color-text);
}
.age-gate-copy {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: 1.6;
  margin-bottom: var(--space-6);
}
.age-gate-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
}
