:root {
  --onyx: #080b0a;
  --deep-onyx: #050706;
  --raised: #101412;
  --raised-2: #151a18;
  --snow: #f7f7f9;
  --soft-snow: #efefea;
  --amethyst: #8f5cff;
  --amethyst-2: #b79aff;
  --saffron: #f8c630;
  --avocado: #98d000;
  --terracotta: #f4442e;
  --purple: #211033;
  --muted: #a9ada7;
  --muted-2: #72786f;
  --line: rgba(247, 247, 249, 0.06);
  --line-strong: rgba(247, 247, 249, 0.12);
  --surface: rgba(16, 20, 18, 0.92);
  --shadow: 0 24px 48px rgba(0, 0, 0, 0.32);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.2);
  --radius: 10px;
  --radius-sm: 7px;
  --radius-lg: 14px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Geologica', 'Barlow', system-ui, sans-serif;
  background: var(--deep-onyx);
  color: var(--snow);
  min-height: 100vh;
  line-height: 1.5;
  font-size: 14px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ═══ Ambient Canvas ═══ */
#ambientCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.85;
}

.app {
  position: relative;
  z-index: 1;
  max-width: 620px;
  margin: 0 auto;
  padding: 0 24px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ═══ Stats Bar ═══ */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 28px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--deep-onyx) 88%, transparent);
  backdrop-filter: blur(16px) saturate(1.2);
  z-index: 100;
}

.stat {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.stat-value {
  font-family: 'Barlow', sans-serif;
  font-weight: 800;
  font-size: 20px;
  color: var(--amethyst-2);
  font-variant-numeric: tabular-nums;
  transition: transform 200ms var(--ease-spring), color 300ms ease;
}

.stat-value.bump {
  transform: scale(1.15);
}

.referral-value { color: var(--avocado); }

.stat-label {
  font-size: 10px;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

.pulse-stat .stat-value {
  animation: counter-pulse 3s ease-in-out infinite;
}

@keyframes counter-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ═══ Hero ═══ */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 56px 0 72px;
  gap: 32px;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  animation: mark-glow 4.5s ease-in-out infinite;
}

@keyframes mark-glow {
  0%, 100% { opacity: 0.55; filter: drop-shadow(0 0 6px rgba(143,92,255,0.15)); }
  50% { opacity: 1; filter: drop-shadow(0 0 18px rgba(143,92,255,0.5)); }
}

.wordmark-img {
  height: 26px;
  width: auto;
  opacity: 0.92;
}

.headline {
  font-family: 'Barlow', sans-serif;
  font-weight: 800;
  font-size: clamp(24px, 5.5vw, 38px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 20px rgba(143, 92, 255, 0.12);
}

.subhead {
  font-size: 16px;
  color: var(--soft-snow);
  max-width: 460px;
  line-height: 1.65;
  font-weight: 400;
}

.subhead strong { color: var(--saffron); font-weight: 600; }
.subhead em { color: var(--avocado); font-style: normal; font-weight: 600; }

/* ═══ Social Proof Strip ═══ */
.proof-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm);
}

.proof-dot {
  width: 7px;
  height: 7px;
  background: var(--avocado);
  border-radius: 50%;
  animation: dot-blink 1.8s ease-in-out infinite;
  box-shadow: 0 0 6px rgba(152, 208, 0, 0.5);
}

@keyframes dot-blink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.8); }
}

/* ═══ Pain/Solution Cards ═══ */
.value-stack {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pain-card, .solution-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  text-align: left;
  font-size: 13px;
  transition: transform 200ms var(--ease-out), box-shadow 200ms ease;
}

.pain-card:hover, .solution-card:hover {
  transform: translateX(3px);
}

.pain-card {
  background: color-mix(in srgb, var(--terracotta) 4%, var(--raised));
  border: 1px solid color-mix(in srgb, var(--terracotta) 10%, transparent);
  color: var(--muted);
}

.pain-icon {
  color: var(--terracotta);
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--terracotta) 12%, transparent);
  border-radius: 50%;
}

.solution-card {
  background: color-mix(in srgb, var(--avocado) 5%, var(--raised));
  border: 1px solid color-mix(in srgb, var(--avocado) 16%, transparent);
  color: var(--soft-snow);
  box-shadow: 0 4px 16px rgba(152, 208, 0, 0.06);
}

.solution-icon {
  color: var(--avocado);
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--avocado) 14%, transparent);
  border-radius: 50%;
}

/* ═══ How It Works ═══ */
.how-it-works {
  width: 100%;
  max-width: 480px;
  text-align: left;
}

.how-it-works h2 {
  font-family: 'Barlow', sans-serif;
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 14px;
  text-align: center;
  color: var(--soft-snow);
}

.steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.steps li {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  color: var(--soft-snow);
  padding: 8px 0;
}

.step-num {
  width: 30px;
  height: 30px;
  background: color-mix(in srgb, var(--amethyst) 14%, var(--raised));
  border: 1px solid color-mix(in srgb, var(--amethyst) 40%, transparent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Barlow', sans-serif;
  font-weight: 800;
  font-size: 12px;
  color: var(--amethyst-2);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(143, 92, 255, 0.12);
}

.how-note {
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted-2);
  text-align: center;
}

/* ═══ Urgency Box ═══ */
.urgency-box {
  padding: 14px 22px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--saffron) 8%, var(--raised)), color-mix(in srgb, var(--amethyst) 6%, var(--raised)));
  border: 1px solid color-mix(in srgb, var(--saffron) 22%, transparent);
  border-radius: var(--radius);
  width: 100%;
  max-width: 480px;
  box-shadow: 0 4px 20px rgba(248, 198, 48, 0.06);
}

.urgency-text {
  font-size: 13px;
  color: var(--soft-snow);
  text-align: center;
}

.urgency-text strong { color: var(--saffron); }

/* ═══ Progress Gate ═══ */
.progress-gate {
  width: 100%;
  max-width: 480px;
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm);
}

.progress-track {
  position: relative;
  margin-bottom: 14px;
}

.progress-fill {
  position: absolute;
  top: 50%;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--amethyst), var(--saffron));
  border-radius: 2px;
  transform: translateY(-50%);
  width: 55%;
  transition: width 600ms var(--ease-out);
  z-index: 0;
  box-shadow: 0 0 8px rgba(143, 92, 255, 0.3);
}

.progress-steps {
  display: flex;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

.p-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.p-step-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--raised-2);
  border: 2px solid var(--muted-2);
  transition: all 300ms var(--ease-spring);
}

.p-step.done .p-step-dot {
  background: var(--amethyst);
  border-color: var(--amethyst);
  box-shadow: 0 0 8px rgba(143, 92, 255, 0.4);
}

.p-step.active .p-step-dot {
  background: var(--saffron);
  border-color: var(--saffron);
  box-shadow: 0 0 10px rgba(248, 198, 48, 0.5);
  animation: step-pulse 1.5s ease-in-out infinite;
}

@keyframes step-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

.p-step-label {
  font-size: 10px;
  color: var(--muted-2);
  text-align: center;
  font-weight: 500;
  white-space: nowrap;
}

.p-step.done .p-step-label { color: var(--amethyst-2); }
.p-step.active .p-step-label { color: var(--saffron); font-weight: 600; }

.progress-copy {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
  font-style: italic;
}

/* ═══ Rewards Explainer ═══ */
.rewards-explainer {
  width: 100%;
  max-width: 480px;
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(8px);
  text-align: left;
}

.rewards-explainer h3 {
  font-family: 'Barlow', sans-serif;
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 8px;
  text-align: center;
}

.rewards-detail {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 16px;
}

.rewards-detail strong { color: var(--avocado); }
.stat-inline { color: var(--avocado); font-weight: 700; font-family: 'Barlow', sans-serif; }

.rewards-math {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.math-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 12px;
  background: var(--raised-2);
  border-radius: var(--radius-sm);
}

.math-highlight {
  background: color-mix(in srgb, var(--avocado) 10%, var(--raised-2));
  border: 1px solid color-mix(in srgb, var(--avocado) 24%, transparent);
}

.math-val {
  font-family: 'Barlow', sans-serif;
  font-weight: 800;
  font-size: 16px;
  color: var(--snow);
}

.math-highlight .math-val { color: var(--avocado); }

.math-label {
  font-size: 9px;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

.math-plus, .math-equals {
  font-family: 'Barlow', sans-serif;
  font-weight: 800;
  font-size: 16px;
  color: var(--muted-2);
}

.rewards-disclaimer {
  font-size: 10px;
  color: var(--muted-2);
  line-height: 1.5;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  text-align: center;
}

/* ═══ Waitlist Form ═══ */
.waitlist-box, .unlocked-box {
  width: 100%;
  max-width: 480px;
}

.waitlist-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.waitlist-form input, .referral-input {
  height: 48px;
  padding: 0 16px;
  background: color-mix(in srgb, var(--raised) 80%, black);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--snow);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 200ms ease, box-shadow 200ms ease, transform 200ms var(--ease-out);
  width: 100%;
}

.waitlist-form input:focus {
  border-color: var(--amethyst);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--amethyst) 16%, transparent), 0 4px 12px rgba(143, 92, 255, 0.1);
  transform: translateY(-1px);
}

.primary-button {
  height: 48px;
  padding: 0 24px;
  background: linear-gradient(135deg, var(--amethyst), color-mix(in srgb, var(--amethyst) 65%, var(--saffron)));
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-family: 'Barlow', sans-serif;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: transform 200ms var(--ease-spring), box-shadow 200ms ease;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(143, 92, 255, 0.2);
}

.primary-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(143, 92, 255, 0.3);
}

.primary-button:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 2px 8px rgba(143, 92, 255, 0.2);
}

.cta-button {
  height: 54px;
  font-size: 16px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--avocado), color-mix(in srgb, var(--avocado) 55%, var(--saffron)));
  color: var(--deep-onyx);
  letter-spacing: 0.02em;
  box-shadow: 0 4px 20px rgba(152, 208, 0, 0.25);
}

.cta-button:hover {
  box-shadow: 0 8px 32px rgba(152, 208, 0, 0.35);
}

.waitlist-note {
  margin-top: 10px;
  font-size: 11px;
  color: var(--muted-2);
  text-align: center;
}

.waitlist-error {
  margin-top: 8px;
  font-size: 12px;
  color: var(--terracotta);
  text-align: center;
  animation: shake 300ms ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* ═══ Unlocked State ═══ */
.welcome-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: color-mix(in srgb, var(--amethyst) 6%, var(--raised));
  border: 1px solid color-mix(in srgb, var(--amethyst) 30%, transparent);
  border-radius: var(--radius);
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(143, 92, 255, 0.08);
}

.badge-icon { font-size: 22px; }
.alias-display { color: var(--saffron); }

.referred-bonus {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: color-mix(in srgb, var(--avocado) 6%, var(--raised));
  border: 1px solid color-mix(in srgb, var(--avocado) 24%, transparent);
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--soft-snow);
  line-height: 1.5;
}

.referred-bonus strong { color: var(--avocado); }
.bonus-icon { font-size: 20px; flex-shrink: 0; }

/* ═══ Referral Panel ═══ */
.referral-panel {
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 16px;
  text-align: left;
  box-shadow: var(--shadow-sm);
}

.referral-panel h3 {
  font-family: 'Barlow', sans-serif;
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 8px;
}

.referral-explain {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
  line-height: 1.6;
}

.referral-explain strong { color: var(--avocado); }

.referral-link-box {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.referral-input {
  flex: 1;
  font-size: 12px;
  color: var(--muted);
  cursor: text;
}

.copy-button {
  padding: 0 16px;
  height: 48px;
  background: var(--raised-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--snow);
  font-family: 'Barlow', sans-serif;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  transition: all 200ms var(--ease-out);
}

.copy-button:hover { background: var(--amethyst); border-color: var(--amethyst); }
.copy-button:active { transform: scale(0.95); }

.referral-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}

.ref-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  padding: 10px 0;
  background: var(--raised-2);
  border-radius: var(--radius-sm);
}

.ref-value {
  font-family: 'Barlow', sans-serif;
  font-weight: 800;
  font-size: 20px;
  color: var(--amethyst-2);
}

.ref-label {
  font-size: 9px;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

.referral-disclaimer {
  font-size: 10px;
  color: var(--muted-2);
  line-height: 1.5;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

/* ═══ Referral Leaderboard ═══ */
.referral-leaderboard {
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.referral-leaderboard h3 {
  font-family: 'Barlow', sans-serif;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 12px;
}

.ref-lb-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ref-lb-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--raised-2);
  font-size: 12px;
  transition: transform 150ms var(--ease-out);
}

.ref-lb-entry:hover { transform: translateX(2px); }
.ref-lb-entry:nth-child(1) { background: color-mix(in srgb, var(--saffron) 8%, var(--raised-2)); }
.ref-lb-entry:nth-child(2) { background: color-mix(in srgb, var(--amethyst) 6%, var(--raised-2)); }
.ref-lb-entry:nth-child(3) { background: color-mix(in srgb, var(--avocado) 5%, var(--raised-2)); }

.ref-lb-rank { font-weight: 800; width: 20px; color: var(--muted); font-size: 11px; }
.ref-lb-entry:nth-child(1) .ref-lb-rank { color: var(--saffron); }
.ref-lb-entry:nth-child(2) .ref-lb-rank { color: var(--amethyst-2); }
.ref-lb-entry:nth-child(3) .ref-lb-rank { color: var(--avocado); }
.ref-lb-name { flex: 1; color: var(--soft-snow); }
.ref-lb-refs { color: var(--amethyst-2); font-weight: 700; font-family: 'Barlow', sans-serif; }

.play-button {
  width: 100%;
  height: 54px;
  font-size: 16px;
  font-weight: 800;
}

/* ═══ Switch User ═══ */
.switch-box {
  margin-top: 14px;
}

.ghost-button {
  background: transparent;
  border: none;
  color: var(--muted-2);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 200ms ease;
}

.ghost-button:hover { color: var(--snow); }

/* ═══ Games Section ═══ */
.games-section {
  padding: 20px 0 48px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.games-nav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.games-nav::-webkit-scrollbar { display: none; }

.game-tab {
  padding: 9px 16px;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-family: 'Barlow', sans-serif;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 200ms var(--ease-out);
}

.game-tab:hover { border-color: var(--line-strong); color: var(--soft-snow); }

.game-tab.active {
  background: color-mix(in srgb, var(--amethyst) 12%, var(--raised));
  border-color: var(--amethyst);
  color: var(--snow);
  box-shadow: 0 2px 10px rgba(143, 92, 255, 0.15);
}

.game-container {
  position: relative;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

#gameCanvas, #mpCanvas {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 16 / 9;
  max-height: 320px;
  cursor: crosshair;
}

.game-hud {
  position: absolute;
  top: 12px;
  right: 14px;
  display: flex;
  gap: 16px;
}

.hud-score, .hud-high {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.hud-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-2);
  font-weight: 500;
}

.hud-value {
  font-family: 'Barlow', sans-serif;
  font-weight: 800;
  font-size: 18px;
  color: var(--snow);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.game-instructions {
  position: absolute;
  bottom: 10px;
  left: 14px;
  font-size: 10px;
  color: var(--muted-2);
  pointer-events: none;
  opacity: 0.8;
}

/* ═══ Leaderboard ═══ */
.leaderboard {
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.leaderboard-title {
  font-family: 'Barlow', sans-serif;
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 12px;
}

.leaderboard-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}

.leaderboard-tabs::-webkit-scrollbar { display: none; }

.lb-tab {
  padding: 6px 11px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted-2);
  font-size: 10px;
  font-family: 'Barlow', sans-serif;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 200ms var(--ease-out);
}

.lb-tab:hover { border-color: var(--line-strong); }

.lb-tab.active {
  background: var(--raised-2);
  border-color: var(--line-strong);
  color: var(--snow);
}

.leaderboard-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 260px;
  overflow-y: auto;
  scrollbar-width: none;
}

.leaderboard-list::-webkit-scrollbar { display: none; }

.lb-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--raised-2);
  font-size: 12px;
  transition: transform 150ms var(--ease-out), background 150ms ease;
}

.lb-entry:hover { transform: translateX(2px); }
.lb-entry:nth-child(1) { background: color-mix(in srgb, var(--saffron) 8%, var(--raised-2)); }
.lb-entry:nth-child(2) { background: color-mix(in srgb, var(--amethyst) 6%, var(--raised-2)); }
.lb-entry:nth-child(3) { background: color-mix(in srgb, var(--avocado) 5%, var(--raised-2)); }

.lb-rank {
  font-family: 'Barlow', sans-serif;
  font-weight: 800;
  font-size: 12px;
  color: var(--muted);
  width: 22px;
  text-align: center;
}

.lb-entry:nth-child(1) .lb-rank { color: var(--saffron); }
.lb-entry:nth-child(2) .lb-rank { color: var(--amethyst-2); }
.lb-entry:nth-child(3) .lb-rank { color: var(--avocado); }

.lb-name { flex: 1; font-weight: 500; color: var(--soft-snow); }
.lb-game { font-size: 10px; color: var(--muted-2); }
.lb-score {
  font-family: 'Barlow', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: var(--amethyst-2);
  font-variant-numeric: tabular-nums;
}

.lb-empty {
  list-style: none;
  text-align: center;
  padding: 24px;
  color: var(--muted-2);
  font-size: 12px;
}

.back-button {
  align-self: center;
  padding: 11px 28px;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-family: 'Barlow', sans-serif;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 200ms var(--ease-out);
}

.back-button:hover {
  border-color: var(--snow);
  color: var(--snow);
  transform: translateY(-1px);
}

/* ═══ Games Header ═══ */
.games-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.games-logo {
  filter: drop-shadow(0 0 6px rgba(143, 92, 255, 0.3));
}

.games-title {
  font-family: 'Barlow', sans-serif;
  font-weight: 800;
  font-size: 16px;
  color: var(--soft-snow);
  letter-spacing: -0.01em;
}

/* ═══ Mode Tabs (Solo / MP) ═══ */
.mode-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  padding: 3px;
  background: var(--raised);
  border-radius: 999px;
  border: 1px solid var(--line);
  width: fit-content;
}

.mode-tab {
  padding: 8px 20px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: 'Barlow', sans-serif;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 200ms var(--ease-out);
  display: flex;
  align-items: center;
  gap: 6px;
}

.mode-tab.active {
  background: var(--amethyst);
  color: white;
  box-shadow: 0 2px 8px rgba(143, 92, 255, 0.3);
}

.mp-live-dot {
  width: 6px;
  height: 6px;
  background: var(--avocado);
  border-radius: 50%;
  animation: dot-blink 1.8s infinite;
}

/* ═══ Multiplayer Panel ═══ */
.mp-status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
  width: fit-content;
  margin-bottom: 12px;
}

.mp-online-dot {
  width: 7px;
  height: 7px;
  background: var(--avocado);
  border-radius: 50%;
  animation: dot-blink 1.5s infinite;
  box-shadow: 0 0 5px rgba(152, 208, 0, 0.5);
}

.mp-online-count {
  font-family: 'Barlow', sans-serif;
  font-weight: 800;
  color: var(--avocado);
}

/* ═══ Room Selector & Invite ═══ */
.room-selector {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
  padding: 3px;
  background: var(--raised);
  border-radius: 999px;
  border: 1px solid var(--line);
  width: fit-content;
}

.room-btn {
  padding: 6px 14px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: 'Barlow', sans-serif;
  font-weight: 600;
  font-size: 11px;
  cursor: pointer;
  transition: all 180ms var(--ease-out);
}

.room-btn.active {
  background: var(--raised-2);
  color: var(--snow);
}

.invite-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 10px;
}

.invite-row {
  display: flex;
  gap: 6px;
}

.invite-input {
  flex: 1;
  height: 36px;
  padding: 0 12px;
  background: var(--raised-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--snow);
  font-family: inherit;
  font-size: 12px;
  outline: none;
}

.invite-input:focus { border-color: var(--amethyst); }

.search-wrap {
  position: relative;
  flex: 1;
}

.search-wrap .invite-input { width: 100%; }

.search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: var(--raised-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  list-style: none;
  z-index: 20;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.search-dropdown li {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--soft-snow);
  cursor: pointer;
  transition: background 120ms ease;
}

.search-dropdown li:hover {
  background: color-mix(in srgb, var(--amethyst) 12%, var(--raised));
}

.invite-note {
  font-size: 10px;
  color: var(--muted-2);
  line-height: 1.4;
}

.mp-ai-notice {
  padding: 8px 12px;
  background: color-mix(in srgb, var(--saffron) 5%, var(--raised));
  border: 1px solid color-mix(in srgb, var(--saffron) 12%, transparent);
  border-radius: var(--radius-sm);
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
}

.mp-ai-notice strong { color: var(--saffron); }

.mp-badge {
  font-size: 9px;
  padding: 1px 5px;
  background: color-mix(in srgb, var(--saffron) 20%, transparent);
  border-radius: 4px;
  color: var(--saffron);
  font-weight: 700;
  margin-left: 4px;
}

.mp-nav .game-tab.active .mp-badge {
  background: color-mix(in srgb, white 20%, transparent);
  color: white;
}

.mp-waiting {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: color-mix(in srgb, var(--onyx) 90%, transparent);
  backdrop-filter: blur(4px);
  z-index: 10;
}

.mp-waiting-text {
  font-family: 'Barlow', sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--soft-snow);
}

.mp-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--amethyst);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.mp-result {
  padding: 12px 16px;
  background: color-mix(in srgb, var(--amethyst) 8%, var(--raised));
  border: 1px solid color-mix(in srgb, var(--amethyst) 24%, transparent);
  border-radius: var(--radius-sm);
  text-align: center;
}

.mp-result-text {
  font-family: 'Barlow', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--amethyst-2);
}

/* ═══ MP Feed ═══ */
.mp-feed {
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-top: 12px;
}

.mp-feed-title {
  font-family: 'Barlow', sans-serif;
  font-weight: 700;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.mp-feed-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 140px;
  overflow-y: auto;
  scrollbar-width: none;
}

.mp-feed-list::-webkit-scrollbar { display: none; }

.mp-feed-item {
  font-size: 11px;
  color: var(--muted);
  padding: 4px 8px;
  background: var(--raised-2);
  border-radius: 4px;
}

.mp-feed-item:first-child {
  color: var(--soft-snow);
}

/* ═══ Restless Brand Mark (bottom-right) ═══ */
.restless-mark {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 50;
  opacity: 0.35;
  pointer-events: none;
  animation: restless-drift 12s ease-in-out infinite;
}

.restless-img {
  animation: restless-fidget 4.2s ease-in-out infinite;
  filter: drop-shadow(0 0 4px rgba(143, 92, 255, 0.2));
}

@keyframes restless-drift {
  0% { transform: translate(0, 0); }
  15% { transform: translate(-3px, -2px); }
  30% { transform: translate(1px, -4px); }
  45% { transform: translate(-2px, 1px); }
  60% { transform: translate(2px, -1px); }
  75% { transform: translate(-1px, 3px); }
  90% { transform: translate(3px, 0px); }
  100% { transform: translate(0, 0); }
}

@keyframes restless-fidget {
  0%, 100% { transform: rotate(0deg) scale(1); }
  8% { transform: rotate(2.5deg) scale(1.02); }
  16% { transform: rotate(-1.5deg) scale(0.98); }
  24% { transform: rotate(1deg) scale(1.01); }
  32% { transform: rotate(-0.5deg) scale(1); }
  50% { transform: rotate(0deg) scale(1); }
  58% { transform: rotate(-2deg) scale(1.03); }
  66% { transform: rotate(1.5deg) scale(0.99); }
  74% { transform: rotate(-1deg) scale(1.01); }
  82% { transform: rotate(0.5deg) scale(1); }
}

/* ═══ Utilities ═══ */
.hidden { display: none !important; }

/* ═══ Focus States (accessibility) ═══ */
:focus-visible {
  outline: 2px solid var(--amethyst);
  outline-offset: 3px;
}

button:focus-visible, input:focus-visible {
  outline: 2px solid var(--amethyst);
  outline-offset: 2px;
}

/* ═══ Responsive ═══ */
@media (max-width: 520px) {
  .app { padding: 0 16px; }
  .stats-bar { gap: 12px; padding: 10px 0; }
  .stat-value { font-size: 16px; }
  .stat-label { font-size: 8px; }
  .hero { padding: 40px 0 56px; gap: 24px; }
  .referral-stats { gap: 6px; }
  .ref-stat { padding: 8px 4px; }
  .ref-value { font-size: 16px; }
  .games-nav { gap: 4px; }
  .game-tab { padding: 7px 11px; font-size: 11px; }
  .headline { font-size: clamp(20px, 5vw, 30px); }
  .progress-steps { gap: 2px; }
  .p-step-label { font-size: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .brand-mark, .proof-dot, .pulse-stat .stat-value, .p-step.active .p-step-dot,
  .restless-mark, .restless-img { animation: none; }
  #ambientCanvas { display: none; }
  * { transition-duration: 10ms !important; }
}
