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

:root {
  --bg:           #07000f;
  --bg-deep:      #02000a;
  --magenta:      #ff2bd6;
  --magenta-soft: rgba(255, 43, 214, 0.55);
  --magenta-glow: rgba(255, 43, 214, 0.35);
  --purple:       #9d4dff;
  --purple-soft:  rgba(157, 77, 255, 0.45);
  --purple-glow:  rgba(157, 77, 255, 0.30);
  --cyan:         #00f0ff;
  --cyan-soft:    rgba(0, 240, 255, 0.55);
  --cyan-glow:    rgba(0, 240, 255, 0.30);
  --amber:        #ffb347;
  --amber-glow:   rgba(255, 179, 71, 0.35);

  --text:         #e8d8ff;
  --text-dim:     #a190c8;
  --text-faint:   #5f4d80;

  --glass-bg:     rgba(20, 6, 44, 0.42);
  --glass-bg-2:   rgba(35, 12, 70, 0.55);
  --glass-stroke: linear-gradient(135deg, rgba(255, 43, 214, 0.45), rgba(157, 77, 255, 0.20) 35%, rgba(0, 240, 255, 0.30));
  --glass-shadow: 0 24px 60px -20px rgba(157, 77, 255, 0.45),
                  0 8px 24px -8px rgba(255, 43, 214, 0.35),
                  inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

html, body { background: var(--bg-deep); color: var(--text); overflow-x: hidden; }
body {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 20px 24px;
  isolation: isolate;
}
/* Lock the page to viewport while only the hero (scan) is showing.
   Once a scan begins (eq-panel + controls reveal), restore scroll. */
body.scan-only { height: 100vh; max-height: 100vh; overflow: hidden; padding-bottom: 16px; }
body.scan-only header { margin-bottom: 18px; }
body.scan-only main  { flex: 1; justify-content: center; gap: 0; }

/* ─── synthwave background ───────────────────────────────── */
.bg-sky {
  position: fixed; inset: 0;
  background:
    radial-gradient(120% 80% at 50% 100%, rgba(255, 43, 214, 0.18) 0%, transparent 55%),
    radial-gradient(80% 70% at 50% 30%, rgba(157, 77, 255, 0.18) 0%, transparent 60%),
    linear-gradient(180deg, #02000a 0%, #0a0220 45%, #1a0540 75%, #2c0a55 92%, #10001f 100%);
  z-index: -3;
}
.bg-stars {
  position: fixed; inset: 0;
  background-image:
    radial-gradient(1px 1px at 12% 18%, #fff 99%, transparent 100%),
    radial-gradient(1px 1px at 88% 24%, #fff 99%, transparent 100%),
    radial-gradient(1px 1px at 35% 8%,  #fff 99%, transparent 100%),
    radial-gradient(1px 1px at 70% 14%, rgba(255,255,255,.6) 99%, transparent 100%),
    radial-gradient(1px 1px at 22% 32%, rgba(255,255,255,.4) 99%, transparent 100%),
    radial-gradient(1px 1px at 52% 6%,  rgba(255,255,255,.7) 99%, transparent 100%),
    radial-gradient(1px 1px at 5% 25%,  rgba(255,255,255,.5) 99%, transparent 100%),
    radial-gradient(1px 1px at 95% 12%, rgba(255,255,255,.45) 99%, transparent 100%);
  z-index: -2;
  opacity: 0.7;
  animation: twinkle 6s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: 0.55; } to { opacity: 0.85; } }

.bg-horizon {
  position: fixed;
  left: 0; right: 0;
  bottom: 38vh;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(0, 240, 255, 0.0) 8%,
    rgba(0, 240, 255, 0.85) 50%,
    rgba(0, 240, 255, 0.0) 92%,
    transparent 100%);
  box-shadow:
    0 0 12px rgba(0, 240, 255, 0.7),
    0 0 28px rgba(255, 43, 214, 0.45);
  z-index: -2;
  pointer-events: none;
}
.bg-grid {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 38vh;
  perspective: 600px;
  perspective-origin: 50% 0%;
  pointer-events: none;
  z-index: -2;
  mask:         linear-gradient(180deg, transparent 0%, #000 18%, #000 92%, transparent 100%);
  -webkit-mask: linear-gradient(180deg, transparent 0%, #000 18%, #000 92%, transparent 100%);
  opacity: 0.9;
}
.bg-grid::before {
  content: '';
  position: absolute;
  left: -50%; right: -50%; top: 0; bottom: 0;
  background-image:
    linear-gradient(rgba(0, 240, 255, 0.55) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 43, 214, 0.45) 1px, transparent 1px);
  background-size: 60px 60px, 60px 60px;
  transform: rotateX(62deg);
  transform-origin: 50% 0%;
  animation: gridFlow 8s linear infinite;
  will-change: background-position;
  filter: drop-shadow(0 0 4px rgba(255, 43, 214, 0.4));
}
@keyframes gridFlow {
  from { background-position: 0 0,    0 0; }
  to   { background-position: 0 60px, 0 0; }
}
.bg-vignette {
  position: fixed; inset: 0;
  background: radial-gradient(ellipse at 50% 50%, transparent 50%, rgba(0,0,0,0.65) 100%);
  pointer-events: none;
  z-index: -1;
}

/* ─── header ──────────────────────────────────────────────── */
header {
  width: 100%;
  max-width: 880px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 36px;
}
h1.logo {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: clamp(28px, 5vw, 44px);
  letter-spacing: 0.18em;
  background: linear-gradient(180deg, #fff 0%, #ff2bd6 55%, #9d4dff 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow:
    0 0 30px rgba(255, 43, 214, 0.55),
    0 0 60px rgba(157, 77, 255, 0.35);
  filter: drop-shadow(0 0 1px rgba(0, 240, 255, 0.6));
  user-select: none;
}
h1.logo span { color: var(--cyan); -webkit-text-fill-color: initial; margin-left: 0.15em;
  text-shadow: 0 0 20px var(--cyan-glow), 0 0 40px var(--cyan-glow); }
.header-actions { display: flex; gap: 10px; }

/* ─── glass primitive ─────────────────────────────────────── */
.glass {
  position: relative;
  background: var(--glass-bg);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  border-radius: 20px;
  box-shadow: var(--glass-shadow);
}
.glass::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--glass-stroke);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}

/* ─── icon buttons ────────────────────────────────────────── */
.icon-btn {
  width: 44px; height: 44px;
  border-radius: 12px;
  border: none;
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform 160ms, box-shadow 160ms, color 160ms;
  position: relative;
  border: 1px solid rgba(157, 77, 255, 0.25);
}
.icon-btn:hover { color: var(--magenta); box-shadow: 0 0 20px var(--magenta-glow); transform: translateY(-1px); }
.icon-btn:active { transform: translateY(0); }
.icon-btn svg { width: 18px; height: 18px; }

/* ─── main ────────────────────────────────────────────────── */
main { width: 100%; max-width: 880px; display: flex; flex-direction: column; gap: 28px; align-items: center; }

/* ─── hero / scan ─────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 8px 16px 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* HUD status pill */
.hero-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.32em;
  color: var(--cyan);
  text-transform: uppercase;
  padding: 6px 12px;
  border: 1px solid rgba(0, 240, 255, 0.18);
  border-radius: 999px;
  background: rgba(20, 6, 44, 0.40);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.hero-meta .status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan), 0 0 14px var(--cyan-glow);
  animation: dotPulse 1.6s ease-in-out infinite;
}
@keyframes dotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(0.8); }
}

/* display tagline */
.tagline {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: clamp(22px, 4.4vw, 38px);
  letter-spacing: 0.02em;
  color: var(--text);
  line-height: 1.15;
  margin: 0 auto 36px;
  max-width: 720px;
  text-shadow:
    0 0 18px rgba(255, 43, 214, 0.25),
    0 0 36px rgba(157, 77, 255, 0.15);
}
.tagline .tag-em {
  font-style: italic;
  font-weight: 500;
  background: linear-gradient(90deg, var(--magenta) 0%, var(--purple) 50%, var(--cyan) 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 12px rgba(255, 43, 214, 0.30));
}

/* radar-pulse stage around the scan button */
.scan-stage {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  margin-bottom: 36px;
}
.scan-ring {
  position: absolute;
  top: 50%; left: 50%;
  width: 200px; height: 200px;
  margin: -100px 0 0 -100px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 43, 214, 0.55);
  pointer-events: none;
  opacity: 0;
  animation: scanPulse 3.6s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}
.scan-ring.r2 { animation-delay: 1.2s; }
.scan-ring.r3 { animation-delay: 2.4s; }
@keyframes scanPulse {
  0%   { transform: scale(0.8); opacity: 0; border-color: rgba(255, 43, 214, 0.85); }
  20%  { opacity: 0.85; }
  100% { transform: scale(1.9); opacity: 0; border-color: rgba(0, 240, 255, 0.30); }
}

.btn-scan {
  position: relative;
  border: none;
  cursor: pointer;
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 20px;
  letter-spacing: 0.30em;
  color: #fff;
  padding: 26px 60px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff2bd6 0%, #9d4dff 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.20) inset,
    0 0 36px var(--magenta-glow),
    0 0 90px var(--purple-glow),
    0 18px 44px -12px rgba(255, 43, 214, 0.7);
  transition: transform 200ms cubic-bezier(.22,1,.36,1), box-shadow 200ms;
  overflow: hidden;
  z-index: 1;
}
.btn-scan::before {
  content: '';
  position: absolute; inset: -3px;
  border-radius: inherit;
  background: conic-gradient(from 0deg, transparent 0%, var(--magenta) 25%, var(--cyan) 50%, var(--purple) 75%, transparent 100%);
  opacity: 0.45;
  z-index: -1;
  filter: blur(16px);
  animation: scanRing 3s linear infinite;
  transition: opacity 240ms;
}
.btn-scan:hover { transform: translateY(-2px) scale(1.02); }
.btn-scan:hover::before { opacity: 1; }
.btn-scan:active { transform: translateY(0) scale(0.99); }
.btn-scan.scanning { pointer-events: none; opacity: 0.7; }
.btn-scan.scanning::before { opacity: 1; }
@keyframes scanRing { to { transform: rotate(360deg); } }

/* minimal step indicator */
.hero-steps {
  display: inline-flex;
  gap: 28px;
  padding: 0;
  margin: 0;
  list-style: none;
  font-family: 'JetBrains Mono', monospace;
}
.hero-steps li {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.hero-steps .step-num {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 11px;
  letter-spacing: 0.18em;
}
.hero-steps li:nth-child(1) .step-num { color: var(--magenta); text-shadow: 0 0 8px var(--magenta-glow); }
.hero-steps li:nth-child(2) .step-num { color: var(--purple);  text-shadow: 0 0 8px var(--purple-glow);  }
.hero-steps li:nth-child(3) .step-num { color: var(--cyan);    text-shadow: 0 0 8px var(--cyan-glow);    }

@media (max-width: 560px) {
  .hero { padding: 4px 12px 0; }
  .scan-stage { padding: 32px; margin-bottom: 28px; }
  .scan-ring { width: 160px; height: 160px; margin: -80px 0 0 -80px; }
  .btn-scan { padding: 22px 46px; font-size: 17px; letter-spacing: 0.26em; }
  .tagline { margin-bottom: 24px; }
  .hero-steps { gap: 18px; }
  .hero-steps li { font-size: 10px; }
}

.progress-wrap {
  width: 100%;
  max-width: 480px;
  margin: 12px auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.progress-track {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  position: relative;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--magenta), var(--purple), var(--cyan));
  box-shadow: 0 0 14px var(--magenta-glow);
  transition: width 80ms linear;
}
.progress-label {
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* ─── EQ panel ─────────────────────────────────────────────── */
.eq-panel { width: 100%; padding: 18px 18px 14px; }
.eq-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.eq-title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.32em;
  color: var(--magenta);
  text-shadow: 0 0 10px var(--magenta-glow);
}
.eq-legend { display: flex; gap: 14px; font-size: 10px; letter-spacing: 0.18em; color: var(--text-dim); }
.eq-legend .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dot-room { background: var(--magenta); box-shadow: 0 0 8px var(--magenta-glow); }
.dot-mask { background: var(--cyan);    box-shadow: 0 0 8px var(--cyan-glow);    }
body.brown-mode .eq-title { color: var(--amber); text-shadow: 0 0 10px var(--amber-glow); }
body.brown-mode .dot-mask { background: var(--amber); box-shadow: 0 0 8px var(--amber-glow); }

#eq-canvas {
  display: block;
  width: 100%;
  height: 220px;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.35), rgba(20, 6, 44, 0.25));
}
.band-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 10px;
  min-height: 24px;
}
.band-chips:empty { display: none; }
.band-chip {
  padding: 4px 10px;
  font-size: 10px;
  letter-spacing: 0.18em;
  font-family: 'JetBrains Mono', monospace;
  color: var(--magenta);
  border: 1px solid var(--magenta-soft);
  border-radius: 999px;
  background: rgba(255, 43, 214, 0.08);
  text-shadow: 0 0 6px var(--magenta-glow);
}
body.brown-mode .band-chip {
  color: var(--amber);
  border-color: rgba(255, 179, 71, 0.55);
  background: rgba(255, 179, 71, 0.08);
  text-shadow: 0 0 6px var(--amber-glow);
}

/* ─── controls ─────────────────────────────────────────────── */
.controls {
  width: 100%;
  padding: 26px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

.mode-toggle {
  position: relative;
  display: inline-flex;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 999px;
  padding: 4px;
  gap: 0;
  border: 1px solid rgba(157, 77, 255, 0.30);
}
.mode-btn {
  position: relative;
  z-index: 1;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px 28px;
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.28em;
  color: var(--text-dim);
  transition: color 220ms;
}
.mode-btn.active { color: #fff; }
.mode-slider {
  position: absolute;
  top: 4px; bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  border-radius: 999px;
  background: linear-gradient(135deg, var(--magenta), var(--purple));
  box-shadow: 0 0 18px var(--magenta-glow), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 280ms cubic-bezier(.22,1,.36,1), background 280ms;
}
.mode-toggle[data-active="brown"] .mode-slider {
  transform: translateX(100%);
  background: linear-gradient(135deg, var(--amber), var(--magenta));
}

/* ─── play disc ───────────────────────────────────────────── */
.play-disc {
  position: relative;
  width: 140px; height: 140px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.16), transparent 55%),
    linear-gradient(135deg, rgba(255, 43, 214, 0.45), rgba(157, 77, 255, 0.30));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.20),
    inset 0 0 30px rgba(255, 43, 214, 0.18),
    0 0 0 1px rgba(255, 43, 214, 0.45),
    0 12px 40px -8px rgba(255, 43, 214, 0.55),
    0 0 60px var(--magenta-glow);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  transition: transform 200ms, box-shadow 240ms;
}
.play-disc::before {
  content: '';
  position: absolute; inset: -8px;
  border-radius: 50%;
  border: 1px solid var(--magenta-soft);
  filter: blur(2px);
  opacity: 0.6;
  animation: discRing 4s ease-in-out infinite;
}
.play-disc::after {
  content: '';
  position: absolute; inset: -16px;
  border-radius: 50%;
  border: 1px solid rgba(255, 43, 214, 0.20);
  opacity: 0;
  transition: opacity 240ms;
}
.play-disc.playing::after { opacity: 1; animation: discPulse 1.6s ease-out infinite; }
.play-disc:hover { transform: scale(1.04); }
.play-disc:active { transform: scale(0.97); }
.play-disc svg { width: 48px; height: 48px; filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.55)); }
.play-disc .icon-pause { display: none; }
.play-disc.playing .icon-play  { display: none; }
.play-disc.playing .icon-pause { display: block; }
body.brown-mode .play-disc {
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.16), transparent 55%),
    linear-gradient(135deg, rgba(255, 179, 71, 0.45), rgba(255, 43, 214, 0.30));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.20),
    inset 0 0 30px rgba(255, 179, 71, 0.18),
    0 0 0 1px rgba(255, 179, 71, 0.45),
    0 12px 40px -8px rgba(255, 179, 71, 0.55),
    0 0 60px var(--amber-glow);
}
body.brown-mode .play-disc::before { border-color: rgba(255, 179, 71, 0.55); }
@keyframes discRing { 0%, 100% { transform: scale(1); opacity: 0.5; } 50% { transform: scale(1.05); opacity: 0.85; } }
@keyframes discPulse { 0% { transform: scale(1); opacity: 0.7; } 100% { transform: scale(1.35); opacity: 0; } }

/* ─── volume ───────────────────────────────────────────────── */
.volume {
  width: 100%;
  max-width: 420px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--text-dim);
}
.volume label { text-transform: uppercase; }
.volume #vol-readout {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  color: var(--cyan);
  text-shadow: 0 0 8px var(--cyan-glow);
  min-width: 42px; text-align: right;
}
input[type=range] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  outline: none;
  position: relative;
}
button:focus-visible,
[role="switch"]:focus-visible,
input[type=range]:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 4px;
}
input[type=range]:focus-visible { outline-offset: 8px; }
input[type=range]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 999px;
  background: linear-gradient(90deg, var(--magenta) 0%, var(--purple) 50%, var(--cyan) 100%);
  background-size: var(--vol-pct, 40%) 100%;
  background-repeat: no-repeat;
  background-color: rgba(255, 255, 255, 0.07);
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  margin-top: -7px;
  background: #fff;
  box-shadow: 0 0 14px var(--magenta-glow), 0 0 0 2px var(--magenta);
  cursor: pointer;
  transition: transform 160ms;
}
input[type=range]::-webkit-slider-thumb:hover { transform: scale(1.15); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); }
input[type=range]::-moz-range-progress { height: 4px; border-radius: 999px; background: linear-gradient(90deg, var(--magenta), var(--purple), var(--cyan)); }
input[type=range]::-moz-range-thumb {
  width: 18px; height: 18px;
  border: none; border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 14px var(--magenta-glow), 0 0 0 2px var(--magenta);
  cursor: pointer;
}

/* ─── player actions row ──────────────────────────────────── */
.player-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.pill-btn {
  border: 1px solid rgba(157, 77, 255, 0.28);
  background: rgba(20, 6, 44, 0.4);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--text);
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 180ms, border-color 180ms, box-shadow 180ms, transform 160ms;
  text-transform: uppercase;
}
.pill-btn:hover { color: var(--magenta); border-color: var(--magenta-soft); box-shadow: 0 0 18px var(--magenta-glow); transform: translateY(-1px); }
.pill-btn.active { color: var(--cyan); border-color: var(--cyan-soft); box-shadow: 0 0 18px var(--cyan-glow); }

/* ─── status / toast ──────────────────────────────────────── */
.status {
  position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%);
  font-size: 10px; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--text-faint); pointer-events: none; z-index: 5;
  white-space: nowrap; max-width: 90vw; overflow: hidden; text-overflow: ellipsis;
}
#toast {
  position: fixed; top: 24px; left: 50%; transform: translate(-50%, -20px);
  padding: 12px 22px;
  background: var(--glass-bg-2);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--magenta-soft);
  border-radius: 999px;
  box-shadow: 0 0 30px var(--magenta-glow);
  color: var(--text);
  font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  opacity: 0; pointer-events: none;
  transition: opacity 240ms, transform 240ms;
  z-index: 100;
}
#toast.visible { opacity: 1; transform: translate(-50%, 0); }

/* ─── timer popover ───────────────────────────────────────── */
.timer-pop {
  position: fixed;
  background: var(--glass-bg-2);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--purple-soft);
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 16px 50px -12px rgba(0, 0, 0, 0.7), 0 0 30px var(--purple-glow);
  display: none;
  flex-direction: column;
  min-width: 160px;
  z-index: 50;
}
.timer-pop.visible { display: flex; }
.timer-pop button {
  background: none; border: none; cursor: pointer;
  padding: 10px 14px; text-align: left;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; letter-spacing: 0.12em;
  color: var(--text);
  border-radius: 8px;
  transition: background 160ms, color 160ms;
}
.timer-pop button:hover { background: rgba(157, 77, 255, 0.18); color: var(--magenta); }
.timer-pop button.active { color: var(--cyan); }

/* ─── settings drawer ─────────────────────────────────────── */
.scrim {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0; pointer-events: none;
  transition: opacity 240ms;
  z-index: 90;
}
.scrim.visible { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(360px, 88vw);
  background: var(--glass-bg-2);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border-left: 1px solid var(--purple-soft);
  transform: translateX(100%);
  transition: transform 320ms cubic-bezier(.22,1,.36,1);
  padding: 28px 24px;
  z-index: 91;
  display: flex;
  flex-direction: column;
  gap: 22px;
  overflow-y: auto;
}
.drawer.open { transform: translateX(0); }
.drawer h2 {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.3em;
  color: var(--magenta);
  text-shadow: 0 0 10px var(--magenta-glow);
  margin-bottom: 4px;
}
.drawer .row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(157, 77, 255, 0.12);
}
.drawer .row:last-of-type { border-bottom: none; }
.drawer label { font-size: 12px; color: var(--text); letter-spacing: 0.06em; }
.drawer .desc { display: block; font-size: 10px; color: var(--text-faint); margin-top: 4px; letter-spacing: 0.06em; }
.toggle {
  position: relative;
  width: 42px; height: 22px;
  padding: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(157, 77, 255, 0.30);
  cursor: pointer;
  transition: background 200ms;
  flex-shrink: 0;
}
.toggle::after {
  content: '';
  position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: transform 220ms, background 220ms;
}
.toggle.on { background: linear-gradient(90deg, var(--magenta), var(--purple)); border-color: transparent; }
.toggle.on::after { transform: translateX(22px); background: #fff; box-shadow: 0 0 10px var(--magenta-glow); }
.drawer-close {
  margin-top: auto;
  align-self: flex-start;
  font-family: 'Orbitron', sans-serif;
  font-size: 10px; letter-spacing: 0.3em;
  color: var(--text-dim);
  background: none; border: none; cursor: pointer;
  padding: 6px 0;
}
.drawer-close:hover { color: var(--magenta); }

/* ─── hidden helper ───────────────────────────────────────── */
.hidden { display: none !important; }

/* ─── motion preferences ──────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 120ms !important;
  }
  .bg-grid { animation: none; }
}

/* ─── MIC RAIN+ : ambience layer & unlock UI ──────────────── */
.ambience {
  width: 100%;
  margin-top: 8px;
  padding-top: 18px;
  border-top: 1px solid rgba(157, 77, 255, 0.18);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.amb-header {
  display: flex; align-items: center; justify-content: space-between;
}
.amb-title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.32em;
  color: var(--cyan);
  text-shadow: 0 0 8px var(--cyan-glow);
}
.amb-plus {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 14px;
  color: var(--magenta);
  text-shadow: 0 0 10px var(--magenta-glow);
  background: rgba(255, 43, 214, 0.12);
  border: 1px solid var(--magenta-soft);
  border-radius: 6px;
  padding: 1px 8px;
  line-height: 1;
}
.amb-tagline {
  font-size: 10px;
  color: var(--text-faint);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-top: 2px;
}
/* Reassurance pill — explicitly tells users that pink/brown noise + EQ
   are not subject to the 30-min trial countdown. Without this, the big
   "TRIAL · 29:28" badge above implies the whole app stops in 30 min,
   which is the wrong mental model — only the 4 vibe FX racks below are
   on trial. Cyan-coded so it reads as positive/safe, not as a warning. */
.amb-scope-note {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  line-height: 1.45;
  color: var(--cyan);
  background: rgba(0, 240, 255, 0.07);
  border: 1px solid rgba(0, 240, 255, 0.28);
  border-radius: 10px;
  padding: 8px 12px;
  text-transform: none;
  margin-top: -4px;
}
.amb-scope-note strong {
  color: #fff;
  font-weight: 700;
  text-shadow: 0 0 8px var(--cyan-glow);
}
.amb-scope-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border-radius: 999px;
  background: rgba(0, 240, 255, 0.18);
  border: 1px solid var(--cyan-soft);
  color: var(--cyan);
  box-shadow: 0 0 8px var(--cyan-glow);
}
.amb-scope-arrow {
  margin: -8px 0 -6px;
  text-align: center;
  font-size: 16px;
  line-height: 1;
  opacity: 0.7;
  user-select: none;
}
/* Hide reassurance pill once the user has paid — they no longer need
   the "free forever" framing. Stays visible during pre-trial / trial /
   expired states (where the timer or unlock CTA might still cause the
   "wait, is the noise stopping?" worry). */
.ambience.is-active .amb-scope-note,
.ambience.is-active .amb-scope-arrow { display: none; }
.vibe-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.vibe-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding: 14px 6px 12px;
  border-radius: 14px;
  border: 1px solid rgba(157, 77, 255, 0.25);
  background: linear-gradient(180deg, rgba(20, 6, 44, 0.52), rgba(35, 12, 70, 0.42));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--text);
  font-family: 'Orbitron', sans-serif;
  cursor: pointer;
  transition: color 180ms, border-color 180ms, box-shadow 220ms, transform 160ms, background 220ms;
  text-align: center;
  min-width: 0;
  min-height: 92px;
}
.vibe-glyph {
  width: 26px; height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  transition: color 180ms, filter 220ms;
}
.vibe-glyph svg { width: 100%; height: 100%; }
.vibe-name {
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--text);
}
.vibe-sub {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-weight: 400;
  font-size: 9px;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  text-transform: lowercase;
}
.vibe-btn:hover {
  color: var(--cyan);
  border-color: var(--cyan-soft);
  box-shadow: 0 0 18px var(--cyan-glow);
  transform: translateY(-1px);
}
.vibe-btn:hover .vibe-glyph { color: var(--cyan); filter: drop-shadow(0 0 6px var(--cyan-glow)); }
.vibe-btn.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(255, 43, 214, 0.22), rgba(0, 240, 255, 0.18));
  border-color: var(--magenta);
  box-shadow: 0 0 22px var(--magenta-glow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.vibe-btn.active .vibe-glyph { color: var(--magenta); filter: drop-shadow(0 0 8px var(--magenta-glow)); }
.vibe-btn.active .vibe-name { background: linear-gradient(180deg, #fff 0%, var(--magenta) 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.vibe-btn.active .vibe-sub { color: var(--text-dim); }
.vibe-btn.locked { opacity: 0.55; }
.vibe-btn.locked:hover { color: var(--text); border-color: rgba(157, 77, 255, 0.25); box-shadow: none; transform: none; }
.vibe-btn.locked:hover .vibe-glyph { color: var(--text-dim); filter: none; }

/* ─── CHIME variant badge + Marinelli lore tooltip ─────────────
   Re-tapping the active CHIME chip cycles 1→2→3→4→5→off; the small
   badge in the top-right corner shows the current variant. The lore
   panel hovers above the .vibe-row whenever the CHIME chip is hovered
   or keyboard-focused, telling the story of the sample (Pontificia
   Fonderia Marinelli — a near-millennium-old workshop, months of
   hand-craft per bell, healing bell-tone tradition) and the 5-variant
   menu so the generator feels grounded in the bell itself. */
.vibe-chime { position: relative; }
.vibe-badge {
  position: absolute;
  top: 6px; right: 6px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 43, 214, 0.18);
  color: var(--magenta);
  border: 1px solid rgba(255, 43, 214, 0.45);
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 180ms, transform 180ms;
  pointer-events: none;
}
.vibe-badge.visible { opacity: 1; transform: scale(1); }
.vibe-btn.active .vibe-badge {
  background: linear-gradient(135deg, rgba(255, 43, 214, 0.45), rgba(0, 240, 255, 0.35));
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}

.ambience { position: relative; }
/* CHIME button is in the rightmost column (4/4 desktop, 2/2 mobile bottom),
   so the lore is right-anchored to .ambience and the caret is shifted onto
   the chime column's horizontal center via the --chime-carat-x variable
   (overridden in the mobile media query). */
.chime-lore {
  --chime-carat-x: 12.5%;
  position: absolute;
  right: 0;
  bottom: 100%;
  margin-bottom: 14px;
  transform: translateY(6px);
  width: min(420px, calc(100vw - 32px));
  max-width: 420px;
  padding: 16px 18px 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(20, 6, 44, 0.94), rgba(35, 12, 70, 0.92));
  border: 1px solid rgba(157, 77, 255, 0.42);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55), 0 0 28px rgba(255, 43, 214, 0.18);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease, transform 220ms ease;
  z-index: 60;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.chime-lore::after {
  content: '';
  position: absolute;
  right: var(--chime-carat-x); bottom: -7px;
  transform: translateX(50%) rotate(45deg);
  width: 12px; height: 12px;
  background: rgba(35, 12, 70, 0.92);
  border-right: 1px solid rgba(157, 77, 255, 0.42);
  border-bottom: 1px solid rgba(157, 77, 255, 0.42);
}
.chime-lore.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.chime-lore-eyebrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.chime-lore-tag {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 10px;
  letter-spacing: 0.22em;
  background: linear-gradient(180deg, #fff 0%, var(--magenta) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.chime-lore-state {
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--cyan);
}
.chime-lore-state .chime-lore-name { color: #fff; font-weight: 600; }
.chime-lore-body {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  line-height: 1.55;
  color: var(--text-dim);
  margin: 0 0 10px;
}
.chime-lore-body strong {
  color: var(--text);
  font-weight: 600;
}
.chime-lore-tech {
  font-size: 10px;
  line-height: 1.5;
  color: var(--text-faint);
  margin: 0 0 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(157, 77, 255, 0.25);
}
.chime-lore-list {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.chime-lore-row {
  display: grid;
  grid-template-columns: 32px 86px 1fr;
  gap: 8px;
  align-items: baseline;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  border: 1px solid transparent;
  transition: background 160ms, border-color 160ms, color 160ms;
}
.chime-lore-row .chime-lore-n {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  color: var(--magenta);
  font-weight: 600;
}
.chime-lore-row .chime-lore-vn {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--text);
}
.chime-lore-row .chime-lore-vb {
  color: var(--text-faint);
  text-transform: lowercase;
}
.chime-lore-row.active {
  background: linear-gradient(135deg, rgba(255, 43, 214, 0.18), rgba(0, 240, 255, 0.10));
  border-color: rgba(255, 43, 214, 0.45);
  color: #fff;
}
.chime-lore-row.active .chime-lore-n { color: #fff; }
.chime-lore-row.active .chime-lore-vb { color: var(--text-dim); }
/* Healing/protection paragraph — slightly warmer tone than the tech text;
   sits between the workshop story and the parameter rundown. */
.chime-lore-heal {
  margin: 0 0 10px;
  padding-top: 8px;
  border-top: 1px dashed rgba(157, 77, 255, 0.25);
  font-size: 11px;
  line-height: 1.55;
  color: var(--text-dim);
}
/* Closer — final beat under the variant list. Smaller + softer so it
   doesn't compete with the active-row highlight above it. */
.chime-lore-closer {
  margin: 4px 0 0;
  padding-top: 8px;
  border-top: 1px dashed rgba(157, 77, 255, 0.25);
  font-size: 10px;
  line-height: 1.5;
  color: var(--text-faint);
  font-style: italic;
}

/* settings drawer: PLUS row */
.plus-row {
  background: linear-gradient(135deg, rgba(255, 43, 214, 0.06), rgba(0, 240, 255, 0.04));
  border: 1px solid rgba(255, 43, 214, 0.22);
  border-radius: 14px;
  padding: 14px !important;
  margin-top: 4px;
}
.plus-label {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 0.18em;
  background: linear-gradient(180deg, #fff 0%, var(--magenta) 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
}
.plus-plus { color: var(--cyan); -webkit-text-fill-color: initial; margin-left: 4px; text-shadow: 0 0 6px var(--cyan-glow); }
.plus-btn {
  padding: 10px 18px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--magenta), var(--purple));
  color: #fff;
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.22em;
  cursor: pointer;
  box-shadow: 0 0 18px var(--magenta-glow), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 160ms, box-shadow 200ms;
  flex-shrink: 0;
}
.plus-btn:hover { transform: translateY(-1px); box-shadow: 0 0 26px var(--magenta-glow); }
.plus-btn:active { transform: translateY(0); }
.plus-btn.unlocked {
  background: rgba(0, 240, 255, 0.12);
  color: var(--cyan);
  box-shadow: 0 0 12px var(--cyan-glow);
  cursor: default;
}

/* ─── hero teaser line ─────────────────────────────────────── */
.hero-teaser {
  margin-top: 18px;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--text-dim);
  text-align: center;
  text-transform: uppercase;
  max-width: 460px;
  line-height: 1.6;
}
.hero-teaser strong, .hero-teaser b { color: var(--magenta); text-shadow: 0 0 8px var(--magenta-glow); }

/* ─── promoted ambience header (trial / locked / active) ──── */
/* Override base .amb-header to support a 3-column trial layout. */
.ambience .amb-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
}
.ambience .amb-title {
  /* Re-skin from "AMBIENCE" to a Mic Rain+ wordmark. */
  background: linear-gradient(180deg, #fff 0%, var(--magenta) 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
}
.ambience .amb-plus {
  /* Inline + glyph inside the title; not the standalone bordered pill. */
  margin-left: 4px;
  background: none;
  border: none;
  padding: 0;
  color: var(--cyan);
  -webkit-text-fill-color: var(--cyan);
  text-shadow: 0 0 8px var(--cyan-glow);
}
.amb-trial {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.28em;
}
.amb-status {
  color: var(--cyan);
  text-shadow: 0 0 8px var(--cyan-glow);
}
.amb-clock {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 13px;
  letter-spacing: 0.12em;
  color: #fff;
  background: rgba(0, 240, 255, 0.10);
  border: 1px solid var(--cyan-soft);
  padding: 3px 8px;
  border-radius: 6px;
  min-width: 52px;
  text-align: center;
  box-shadow: 0 0 12px var(--cyan-glow);
}
.ambience.is-trial .amb-clock { animation: trialPulse 1.6s ease-in-out infinite alternate; }
@keyframes trialPulse {
  from { box-shadow: 0 0 8px var(--cyan-glow);  }
  to   { box-shadow: 0 0 22px var(--cyan-glow); }
}
.amb-cta {
  padding: 8px 14px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--magenta), var(--purple));
  color: #fff;
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.22em;
  cursor: pointer;
  box-shadow: 0 0 18px var(--magenta-glow), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 160ms, box-shadow 200ms;
  white-space: nowrap;
}
.amb-cta:hover { transform: translateY(-1px); box-shadow: 0 0 26px var(--magenta-glow); }
.amb-cta:active { transform: translateY(0); }

/* State variants for the promoted ambience block. */
.ambience.is-prestart .amb-status { color: var(--text-dim); text-shadow: none; }
.ambience.is-active  .amb-status  { color: var(--cyan); }
.ambience.is-active  .amb-clock   { display: none; }
.ambience.is-locked .amb-status   { color: var(--magenta); text-shadow: 0 0 10px var(--magenta-glow); }

/* When trial is expired (no entitlement at all), tint the vibe row and
   let an overlay invite the upgrade. The controls remain in the DOM
   (no layout shift); pointer events are blocked beneath the overlay. */
.amb-locked-overlay { display: none; }
.ambience.is-locked { position: relative; }
.ambience.is-locked .vibe-row,
.ambience.is-locked .amb-tagline,
.ambience.is-locked .amb-scope-note,
.ambience.is-locked .amb-scope-arrow {
  filter: grayscale(0.55) brightness(0.7);
  pointer-events: none;
  user-select: none;
}
.ambience.is-locked .amb-locked-overlay {
  display: flex;
  position: absolute;
  inset: 56px 0 0 0;          /* sit below the header */
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  background: linear-gradient(180deg, rgba(20, 6, 44, 0.55), rgba(20, 6, 44, 0.85));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 12px;
  text-align: center;
  padding: 16px;
}
.amb-locked-line {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--magenta);
  text-shadow: 0 0 10px var(--magenta-glow);
}
.amb-locked-eyebrow {
  display: block;
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 9px;
  letter-spacing: 0.28em;
  color: var(--text-dim);
  text-shadow: none;
  margin-bottom: 2px;
}

/* ─── Bell FOMO teaser — gated-out strip for non-pro users ─
   Shown pre-trial, during trial, and after expiry. Hidden when
   paid/god via .ambience.is-active parent. The diagonal-hatch
   grate over the bell icon reinforces the "locked behind glass"
   metaphor. PREVIEW CTA opens the lore panel on mobile (no
   :hover) so everyone can read the Marinelli story. ────────── */
.bell-teaser {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 43, 214, 0.22);
  background: linear-gradient(135deg, rgba(255, 43, 214, 0.06), rgba(157, 77, 255, 0.04));
  margin-top: 4px;
  overflow: hidden;
}
/* Diagonal-hatch "grate" over the bell icon — uses a fine repeating
   gradient so the surface reads as physically caged/gated. */
.bell-teaser-grate {
  position: absolute;
  top: 0; left: 0;
  width: 52px;         /* covers only the icon column */
  height: 100%;
  background: repeating-linear-gradient(
    -45deg,
    rgba(157, 77, 255, 0.12),
    rgba(157, 77, 255, 0.12) 2px,
    transparent 2px,
    transparent 7px
  );
  pointer-events: none;
  z-index: 1;
  border-radius: 14px 0 0 14px;
}
.bell-teaser-icon {
  position: relative;
  z-index: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  flex-shrink: 0;
  color: var(--magenta);
  opacity: 0.55;
  filter: drop-shadow(0 0 6px var(--magenta-glow));
}
.bell-teaser-icon svg { width: 100%; height: 100%; }
.bell-teaser-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}
.bell-teaser-tag {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 9px;
  letter-spacing: 0.22em;
  background: linear-gradient(180deg, #fff 0%, var(--magenta) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bell-teaser-body {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  line-height: 1.5;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}
.bell-teaser-body strong {
  color: var(--text);
  font-weight: 600;
}
.bell-teaser-cta {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--magenta), var(--purple));
  color: #fff;
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 9px;
  letter-spacing: 0.22em;
  cursor: pointer;
  box-shadow: 0 0 14px var(--magenta-glow), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 160ms, box-shadow 200ms;
  white-space: nowrap;
}
.bell-teaser-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 22px var(--magenta-glow);
}
.bell-teaser-cta:active { transform: translateY(0); }
/* When the lore panel is open via the PREVIEW button, swap CTA label
   and tint the strip border to cyan so it feels "active". */
.bell-teaser.lore-open {
  border-color: rgba(0, 240, 255, 0.35);
}
.bell-teaser.lore-open .bell-teaser-cta {
  background: rgba(0, 240, 255, 0.12);
  color: var(--cyan);
  box-shadow: 0 0 12px var(--cyan-glow);
}
/* Hide the bell teaser when user has paid / god mode active. */
.ambience.is-active .bell-teaser { display: none; }
/* During active trial, soften the "LOCKED" tag to "TRIAL" via JS;
   also slightly reduce the urgency styling. */
.bell-teaser.is-trial {
  border-color: rgba(0, 240, 255, 0.22);
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.04), rgba(157, 77, 255, 0.03));
}
.bell-teaser.is-trial .bell-teaser-icon {
  color: var(--cyan);
  opacity: 1;
  filter: drop-shadow(0 0 6px var(--cyan-glow));
}
@media (max-width: 600px) {
  .bell-teaser { gap: 10px; padding: 10px 12px; }
  .bell-teaser-body { font-size: 9px; }
  .bell-teaser-grate { width: 46px; }
}

/* ─── Mic Rain+ TRIAL EXPIRY MODAL ──────────────────────── */
.expiry-modal {
  position: fixed; inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 24px;
}
.expiry-modal.visible { display: flex; }
.expiry-card {
  width: min(440px, 100%);
  padding: 28px 26px 24px;
  border-radius: 18px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: expiryRise 320ms cubic-bezier(.22,1,.36,1);
}
@keyframes expiryRise {
  from { transform: translateY(14px) scale(0.96); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}
.expiry-eyebrow {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 11px;
  letter-spacing: 0.32em;
  background: linear-gradient(180deg, #fff 0%, var(--magenta) 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
}
.expiry-plus { color: var(--cyan); -webkit-text-fill-color: var(--cyan); margin-left: 4px; text-shadow: 0 0 8px var(--cyan-glow); }
.expiry-title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.05em;
  color: #fff;
  text-shadow: 0 0 14px var(--magenta-glow);
}
.expiry-sub {
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  line-height: 1.55;
}
.expiry-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}
.expiry-primary {
  padding: 14px 20px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--magenta), var(--purple));
  color: #fff;
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.22em;
  cursor: pointer;
  box-shadow: 0 0 22px var(--magenta-glow), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 160ms, box-shadow 200ms;
}
.expiry-primary:hover { transform: translateY(-1px); box-shadow: 0 0 32px var(--magenta-glow); }
.expiry-secondary {
  background: none;
  border: 1px solid rgba(157, 77, 255, 0.28);
  color: var(--text-dim);
  border-radius: 999px;
  padding: 10px 18px;
  font-family: 'Orbitron', sans-serif;
  font-size: 10px;
  letter-spacing: 0.22em;
  cursor: pointer;
}
.expiry-secondary:hover { color: var(--magenta); border-color: var(--magenta-soft); }

/* ─── GOD MODE dev panel ──────────────────────────────────── */
.god-panel {
  position: fixed;
  top: 12px;
  left: 12px;
  width: 240px;
  display: none;
  flex-direction: column;
  gap: 10px;
  padding: 12px 12px 10px;
  background: rgba(8, 0, 20, 0.92);
  border: 1px solid rgba(0, 240, 255, 0.45);
  border-radius: 10px;
  box-shadow: 0 0 22px rgba(0, 240, 255, 0.25);
  z-index: 300;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  color: var(--text);
  font-size: 11px;
}
.god-panel.open { display: flex; }
.god-head { display: flex; align-items: center; justify-content: space-between; }
.god-title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.28em;
  color: var(--cyan);
  text-shadow: 0 0 6px var(--cyan-glow);
}
.god-close {
  background: none; border: none; color: var(--text-dim);
  font-size: 18px; line-height: 1; cursor: pointer; padding: 0 4px;
}
.god-close:hover { color: var(--magenta); }
.god-state {
  font-size: 10px;
  line-height: 1.55;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(157, 77, 255, 0.18);
  border-radius: 6px;
  padding: 6px 8px;
}
.god-state b { color: var(--text); font-weight: 600; }
.god-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.god-btn {
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid rgba(157, 77, 255, 0.28);
  background: rgba(20, 6, 44, 0.6);
  color: var(--text);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 160ms, border-color 160ms, background 160ms;
}
.god-btn:hover { color: var(--cyan); border-color: var(--cyan-soft); background: rgba(0, 240, 255, 0.06); }
.god-btn.primary { color: var(--cyan); border-color: var(--cyan-soft); }
.god-btn.danger:hover { color: var(--magenta); border-color: var(--magenta-soft); background: rgba(255, 43, 214, 0.08); }
.god-foot {
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  text-align: center;
}
@media (max-width: 600px) {
  .god-panel { left: 8px; right: 8px; top: 8px; width: auto; }
  .ambience .amb-header { grid-template-columns: 1fr auto; row-gap: 8px; }
  .amb-trial { grid-column: 1 / -1; order: 3; }
  .amb-cta { grid-column: 2; }
  .hero-teaser { font-size: 10px; }
  /* 2×2 on mobile so each chip keeps a tap-sized footprint — 4 across at
     375 px feels cramped and squishes the sub-label past readable. */
  .vibe-row { grid-template-columns: repeat(2, 1fr); }
  .vibe-btn { min-height: 84px; padding: 12px 4px 10px; }
  .vibe-name { font-size: 10px; letter-spacing: 0.18em; }
  .vibe-sub  { font-size: 8px; }
  .vibe-glyph { width: 22px; height: 22px; }
  /* On the 2×2 mobile grid the CHIME chip occupies the bottom-right cell,
     which is the rightmost 50% of the row — caret centers at 25% from the
     right edge. The lore widens to almost-viewport for legibility. */
  .chime-lore { --chime-carat-x: 25%; width: calc(100vw - 32px); max-width: none; padding: 14px 14px 12px; }
  .chime-lore-row { grid-template-columns: 30px 76px 1fr; }
}

/* ─── responsive ───────────────────────────────────────────── */
@media (max-width: 600px) {
  body { padding: 20px 14px 70px; }
  header { margin-bottom: 24px; }
  .controls { padding: 22px 16px; gap: 18px; }
  .play-disc { width: 120px; height: 120px; }
  .play-disc svg { width: 40px; height: 40px; }
  .btn-scan { padding: 18px 36px; font-size: 16px; }
  .mode-btn { padding: 8px 22px; }
  #eq-canvas { height: 180px; }
}
