/* ============================================================
   ART VIBE STUDIO — 3D stage experience
   Design system: purple #9E33CA · gold #D1A13B · cream #FDFBF7
   ============================================================ */

:root {
  --purple: #9E33CA;
  --purple-dark: #5c1876;
  --purple-deep: #2a0f3a;
  --gold: #D1A13B;
  --gold-light: #e8c169;
  --cream: #FDFBF7;
  --lavender: #E5DFE8;
  --ink: #17121c;
  --red: #d21f3c;
  --green: #1f9d4d;
  --scene-bg: #0a0612;
  --shadow-pop: 10px 10px 0 rgba(158, 51, 202, .35);
  --r-panel: 22px;
}

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

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--scene-bg);
  color: var(--cream);
  font-family: 'Manrope', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.mono { font-family: 'JetBrains Mono', 'Courier New', monospace; }

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

[hidden] { display: none !important; }

::selection { background: var(--purple); color: var(--cream); }

#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

#slideshow-nav {
  position: fixed; top: 0; left: 0; z-index: 34;
  width: 0; height: 0;
  pointer-events: auto; touch-action: pan-y;
}

/* ============ INTRO ============ */
#intro {
  position: fixed; inset: 0; z-index: 60;
  display: flex; flex-direction: column; justify-content: space-between;
  background: var(--scene-bg);
  transition: opacity .9s ease, visibility .9s;
}
#intro.gone { opacity: 0; visibility: hidden; pointer-events: none; }

.intro-bg {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(60% 50% at 20% 15%, rgba(158, 51, 202, .28), transparent 60%),
    radial-gradient(50% 40% at 85% 75%, rgba(209, 161, 59, .16), transparent 60%),
    radial-gradient(40% 35% at 70% 20%, rgba(92, 24, 118, .35), transparent 65%);
  animation: bgDrift 14s ease-in-out infinite alternate;
}
@keyframes bgDrift {
  from { transform: scale(1) translate(0, 0); }
  to   { transform: scale(1.12) translate(-1.5%, 2%); }
}

.intro-top {
  position: relative; z-index: 2;
  display: flex; justify-content: space-between; padding: 22px 28px;
}
.tag {
  font-size: 11px; letter-spacing: .28em; text-transform: uppercase;
  color: var(--gold); border: 1px solid rgba(209, 161, 59, .45);
  padding: 7px 12px; border-radius: 999px;
}

.intro-center {
  position: relative; z-index: 2; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 0 20px;
}
.intro-kicker {
  font-size: 12px; letter-spacing: .5em; text-transform: uppercase;
  color: rgba(253, 251, 247, .6);
}
.intro-logo {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic; font-weight: 900;
  font-size: clamp(64px, 14vw, 168px);
  line-height: .95; letter-spacing: .01em;
  background: linear-gradient(175deg, var(--gold-light) 20%, var(--gold) 55%, #a97b22 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 26px rgba(158, 51, 202, .55)) drop-shadow(0 4px 0 rgba(42, 15, 58, .9));
}
.intro-studio {
  font-family: 'Unbounded', sans-serif; font-weight: 500;
  font-size: clamp(14px, 2.6vw, 26px);
  letter-spacing: 1.15em; text-indent: 1.15em; color: var(--purple);
  text-shadow: 0 0 18px rgba(158, 51, 202, .8);
}
.intro-slogan {
  margin-top: 10px;
  font-family: 'Unbounded', sans-serif; font-weight: 700;
  font-size: clamp(11px, 1.7vw, 16px); letter-spacing: .18em;
  color: var(--cream);
  display: flex; align-items: center; gap: 14px;
}
.tri, .step-tri {
  width: 0; height: 0; flex: none;
  border-top: .55em solid transparent;
  border-bottom: .55em solid transparent;
  border-left: .85em solid var(--purple);
}
.tri.flip { transform: scaleX(-1); }

#enter-btn { margin-top: 26px; }
#enter-btn:disabled { opacity: .45; cursor: wait; }
#enter-btn.ready { animation: pulse 2.2s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(209, 161, 59, .45); }
  50% { box-shadow: 0 0 0 14px rgba(209, 161, 59, 0); }
}
.intro-hint { font-size: 11px; letter-spacing: .12em; color: rgba(253, 251, 247, .4); }

.ticker {
  position: relative; z-index: 2; overflow: hidden;
  border-top: 1px solid rgba(209, 161, 59, .25);
  border-bottom: 1px solid rgba(209, 161, 59, .25);
  padding: 10px 0; margin-bottom: 18px;
}
.ticker-track {
  display: inline-flex; white-space: nowrap; gap: 0;
  font-size: 12px; letter-spacing: .35em; text-transform: uppercase;
  color: rgba(209, 161, 59, .8);
  animation: tick 28s linear infinite;
}
@keyframes tick { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ============ BUTTONS ============ */
.pill-btn {
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
  font-family: 'Unbounded', sans-serif; font-weight: 700;
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--cream); background: transparent;
  border: 2px solid var(--gold); border-radius: 999px;
  padding: 12px 22px; cursor: pointer;
  transition: background .25s, color .25s, transform .15s, border-color .25s;
}
.pill-btn:hover { background: var(--purple); border-color: var(--purple); color: var(--cream); transform: translateY(-2px); }
.pill-btn:active { transform: translateY(0); }
.pill-btn.big { font-size: 14px; padding: 16px 34px; }
.pill-btn.small { font-size: 11px; padding: 9px 16px; }
.pill-btn.gold { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.pill-btn.gold:hover { background: var(--purple); border-color: var(--purple); color: var(--cream); }
.pill-btn.outline { border-color: var(--ink); color: var(--ink); }
.pill-btn.outline:hover { background: var(--purple); border-color: var(--purple); color: var(--cream); }

.icon-btn {
  width: 42px; height: 42px; border-radius: 50%;
  border: 2px solid rgba(253, 251, 247, .35); background: rgba(23, 18, 28, .5);
  color: var(--cream); cursor: pointer; display: grid; place-items: center;
  transition: border-color .2s, background .2s, transform .15s;
  backdrop-filter: blur(6px);
}
.icon-btn:hover { border-color: var(--gold); color: var(--gold); transform: translateY(-2px); }
.icon-btn.off { color: rgba(253, 251, 247, .35); }
.icon-btn.off svg { opacity: .4; }

/* ============ HUD ============ */
#hud {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 14px 18px;
  transition: transform .8s cubic-bezier(.2, .9, .25, 1), opacity .8s;
}
#hud.hidden, #keys-hint.hidden, #drag-hint.hidden { transform: translateY(-140%); opacity: 0; pointer-events: none; }
#keys-hint, #drag-hint { transition: opacity .8s, transform .8s; }

.hud-left { display: flex; align-items: center; }
.logo-chip {
  display: flex; align-items: center; gap: 10px;
  background: rgba(23, 18, 28, .55); border: 1px solid rgba(209, 161, 59, .35);
  border-radius: 14px; padding: 7px 14px 7px 8px; backdrop-filter: blur(8px);
}
.logo-av {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--purple); color: var(--gold);
  font-family: 'Playfair Display', serif; font-weight: 900; font-style: italic;
  font-size: 20px; display: grid; place-items: center;
  box-shadow: 0 0 14px rgba(158, 51, 202, .6);
}
.logo-text { font-size: 10px; letter-spacing: .22em; line-height: 1.5; color: var(--cream); }
.logo-text em { font-style: normal; color: var(--gold); }

.hud-center { flex: 1; display: flex; justify-content: center; }
#vibe {
  display: flex; align-items: center; gap: 10px;
  background: rgba(23, 18, 28, .55); border: 1px solid rgba(158, 51, 202, .45);
  border-radius: 999px; padding: 8px 16px; backdrop-filter: blur(8px);
}
.vibe-label { font-size: 10px; letter-spacing: .3em; color: var(--gold); }
.vibe-track {
  width: clamp(90px, 16vw, 220px); height: 10px; border-radius: 999px;
  background: rgba(253, 251, 247, .12); overflow: hidden;
}
#vibe-fill {
  height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, var(--purple), var(--gold));
  box-shadow: 0 0 12px rgba(209, 161, 59, .8);
  transition: width .25s ease;
}
#vibe.max #vibe-fill { animation: vibeFlash .5s linear infinite; }
@keyframes vibeFlash { 50% { filter: brightness(1.7); } }

.hud-right { display: flex; align-items: center; gap: 8px; }
.nav-btn {
  padding: 10px 16px; font-size: 11px;
  background: rgba(23, 18, 28, .55); backdrop-filter: blur(8px);
  border-color: rgba(253, 251, 247, .35);
}
.nav-btn:hover { border-color: var(--purple); }
.nav-btn.gold { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.nav-btn.gold:hover { background: var(--purple); border-color: var(--purple); color: var(--cream); }

#keys-hint {
  position: fixed; bottom: 16px; left: 18px; z-index: 40;
  font-size: 11px; letter-spacing: .06em; color: rgba(253, 251, 247, .55);
  background: rgba(23, 18, 28, .45); padding: 8px 14px; border-radius: 10px;
  backdrop-filter: blur(6px);
}
#keys-hint b {
  color: var(--gold); border: 1px solid rgba(209, 161, 59, .5);
  border-radius: 5px; padding: 1px 6px; font-weight: 600;
}
#drag-hint {
  position: fixed; bottom: 16px; right: 18px; z-index: 40;
  font-size: 11px; letter-spacing: .08em; color: rgba(253, 251, 247, .4);
}

#zoom-controls {
  position: fixed; right: 18px; top: 50%; z-index: 44;
  transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 7px;
  padding: 6px; border: 1px solid rgba(209, 161, 59, .32); border-radius: 999px;
  background: rgba(23, 18, 28, .58); backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
}
#zoom-controls button {
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 1px solid rgba(253, 251, 247, .22); border-radius: 50%;
  background: rgba(253, 251, 247, .1); color: var(--cream);
  font: 500 25px/1 'Manrope', system-ui, sans-serif; cursor: pointer;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  transition: background .16s, border-color .16s, color .16s, transform .16s;
}
#zoom-controls button:hover, #zoom-controls button:focus-visible {
  background: var(--gold); border-color: var(--gold); color: var(--ink); outline: none;
}
#zoom-controls button:active { transform: scale(.91); }

/* ============ LOOP PEDAL ============ */
#loop-pedal {
  position: fixed; right: 18px; bottom: 52px; z-index: 44;
  display: flex; align-items: stretch; gap: 6px;
}
#loop-toggle {
  position: relative; width: 82px; height: 60px; overflow: hidden;
  display: grid; grid-template-columns: 11px 1fr; grid-template-rows: 1fr 1fr;
  align-items: center; column-gap: 5px; padding: 9px 10px 8px;
  border: 2px solid rgba(209, 161, 59, .66); border-radius: 16px;
  background: linear-gradient(155deg, rgba(35, 25, 43, .95), rgba(15, 10, 22, .95));
  color: var(--cream); cursor: pointer; touch-action: manipulation;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .13), 0 6px 0 rgba(59, 14, 77, .9), 0 13px 28px rgba(0, 0, 0, .4);
  -webkit-tap-highlight-color: transparent; user-select: none;
  transition: transform .14s, border-color .2s, background .2s, box-shadow .2s, opacity .2s;
}
#loop-toggle:hover, #loop-toggle:focus-visible { border-color: var(--gold-light); outline: 2px solid rgba(209, 161, 59, .42); outline-offset: 2px; }
#loop-toggle:active { transform: translateY(4px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 2px 0 rgba(59, 14, 77, .9), 0 8px 18px rgba(0, 0, 0, .38); }
#loop-toggle:disabled { cursor: default; opacity: .62; }
.loop-led {
  grid-row: 1 / 3; width: 9px; height: 9px; border-radius: 50%;
  background: rgba(253, 251, 247, .24); box-shadow: 0 0 0 3px rgba(253, 251, 247, .06);
}
#loop-label { align-self: end; font: 800 10px/1 'Unbounded', sans-serif; letter-spacing: .04em; text-align: left; }
#loop-meta { align-self: start; color: rgba(253, 251, 247, .52); font-size: 6px; line-height: 1.25; letter-spacing: .06em; text-align: left; white-space: nowrap; }
.loop-progress { position: absolute; left: 9px; right: 9px; bottom: 5px; height: 2px; overflow: hidden; border-radius: 9px; background: rgba(253, 251, 247, .12); }
#loop-progress-bar { display: block; width: 0%; height: 100%; border-radius: inherit; background: var(--gold-light); transition: width .08s linear; }
#loop-tools { display: flex; flex-direction: column; gap: 5px; }
#loop-tools button {
  width: 29px; height: 28px; display: grid; place-items: center;
  border: 1px solid rgba(253, 251, 247, .28); border-radius: 9px;
  background: rgba(23, 18, 28, .88); color: var(--cream); cursor: pointer;
  font: 700 11px/1 'Manrope', sans-serif; touch-action: manipulation;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .3); transition: background .15s, color .15s, transform .15s;
}
#loop-tools button:hover, #loop-tools button:focus-visible { background: var(--gold); color: var(--ink); outline: none; transform: scale(1.05); }
#loop-pedal[data-state="recording"] #loop-toggle { border-color: rgba(255, 91, 117, .9); }
#loop-pedal[data-state="recording"] .loop-led { background: #ff5b75; box-shadow: 0 0 13px rgba(255, 91, 117, .95); animation: loopPulse .62s ease-in-out infinite alternate; }
#loop-pedal[data-state="recording"] #loop-progress-bar { background: #ff7890; }
#loop-pedal[data-state="playing"] .loop-led { background: var(--gold-light); box-shadow: 0 0 12px rgba(209, 161, 59, .9); }
#loop-pedal[data-state="overdubbing"] #loop-toggle { border-color: var(--purple); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .13), 0 6px 0 rgba(59, 14, 77, .9), 0 0 22px rgba(158, 51, 202, .5); }
#loop-pedal[data-state="overdubbing"] .loop-led { background: #df7cff; box-shadow: 0 0 14px rgba(223, 124, 255, .95); animation: loopPulse .52s ease-in-out infinite alternate; }
#loop-pedal[data-state="paused"] #loop-toggle { opacity: .68; }
#loop-pedal[data-state="paused"] .loop-led { background: rgba(253, 251, 247, .34); }
#loop-pedal.unlocking { animation: loopUnlock .58s cubic-bezier(.2, .9, .25, 1); }
@keyframes loopUnlock {
  0% { opacity: 0; transform: translateY(20px) scale(.82); }
  62% { opacity: 1; transform: translateY(-4px) scale(1.05); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes loopPulse { to { transform: scale(1.35); filter: brightness(1.25); } }

/* ============ TOOLTIP / CHIP / TOAST ============ */
#tooltip {
  position: fixed; z-index: 45; pointer-events: none;
  background: var(--purple); color: var(--cream);
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  padding: 8px 13px; border-radius: 10px;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, .45);
  transform: translate(-50%, -160%);
  white-space: nowrap;
}
#tooltip::after {
  content: ''; position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%);
  border-left: 6px solid transparent; border-right: 6px solid transparent;
  border-top: 6px solid var(--purple);
}
#tooltip em { font-style: normal; color: var(--gold); }

#chip {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  z-index: 45; display: grid; grid-template-columns: 28px minmax(150px, 1fr) 28px auto;
  align-items: center; gap: 7px;
  background: rgba(253, 251, 247, .94); color: var(--ink); backdrop-filter: blur(14px);
  border: 1px solid rgba(253, 251, 247, .82); border-radius: 18px;
  width: min(calc(100vw - 24px), 500px); padding: 8px 10px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, .28), 0 2px 10px rgba(158, 51, 202, .15);
  animation: chipIn .25s ease-out;
  touch-action: pan-y;
}
@keyframes chipIn { from { transform: translate(-50%, 12px); opacity: 0; } }
#chip-title { font-family: 'Unbounded'; font-weight: 700; font-size: 11px; line-height: 1.28; letter-spacing: .015em; }
#chip-title .accent { display: inline; margin-left: 4px; color: var(--purple); white-space: nowrap; }
#chip-desc { display: none; }
.chip-arrow {
  width: 28px; height: 28px; display: grid; place-items: center;
  padding: 0 0 3px; border: 0; border-radius: 50%;
  background: rgba(23, 18, 28, .06); color: rgba(23, 18, 28, .72); font-size: 20px; line-height: 1; cursor: pointer;
  transition: background .18s, color .18s, transform .18s;
}
.chip-arrow:hover, .chip-arrow:focus-visible { background: var(--purple); color: var(--cream); transform: scale(1.06); outline: none; }
#chip-close {
  position: absolute; top: -9px; right: -7px;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(23, 18, 28, .82); color: var(--cream); border: 1px solid rgba(253, 251, 247, .45); cursor: pointer; font-size: 9px;
}
#chip .pill-btn { min-width: 72px; padding: 8px 12px; font-size: 9px; white-space: nowrap; }

#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  z-index: 55; background: var(--ink); color: var(--cream);
  border: 1px solid var(--gold); border-radius: 999px;
  font-size: 12px; letter-spacing: .1em; padding: 12px 22px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  animation: chipIn .3s ease;
  max-width: 90vw; text-align: center;
}
#toast .hl { color: var(--gold); }

/* ============ PLAYABLE VOCAL PAD ============ */
#vocal-pad {
  position: fixed; left: 50%; bottom: 122px; z-index: 46;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 7px;
  padding: 8px; border: 1px solid rgba(209, 161, 59, .72); border-radius: 999px;
  background: rgba(23, 18, 28, .82); backdrop-filter: blur(12px);
  box-shadow: 0 10px 34px rgba(0, 0, 0, .42), 0 0 22px rgba(158, 51, 202, .25);
  animation: vocalPadIn .24s cubic-bezier(.2, 1.3, .35, 1);
}
@keyframes vocalPadIn { from { opacity: 0; transform: translate(-50%, 18px) scale(.88); } }
#vocal-pad button {
  width: 48px; height: 48px; border: 1px solid rgba(253, 251, 247, .28); border-radius: 50%;
  background: linear-gradient(145deg, rgba(158, 51, 202, .95), rgba(92, 24, 118, .92));
  color: var(--cream); font: 700 9px/1 'Unbounded', sans-serif; letter-spacing: .02em;
  cursor: pointer; touch-action: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 4px 12px rgba(0, 0, 0, .3);
  transition: transform .12s, background .12s, box-shadow .12s;
}
#vocal-pad button:nth-child(even) { background: linear-gradient(145deg, var(--gold), #9d6f14); color: var(--ink); }
#vocal-pad button.playing {
  transform: translateY(-5px) scale(1.08);
  background: var(--cream); color: var(--purple-deep);
  box-shadow: 0 0 0 3px var(--gold), 0 0 24px rgba(209, 161, 59, .85);
}

/* ============ MOBILE GAME CONTROLS ============ */
#mobile-controls { display: none; }
#move-stick, #mobile-play { -webkit-tap-highlight-color: transparent; user-select: none; }
#move-stick {
  position: relative; width: 112px; height: 112px; border-radius: 50%;
  border: 2px solid rgba(209, 161, 59, .48);
  background: radial-gradient(circle, rgba(158, 51, 202, .2) 0 35%, rgba(23, 18, 28, .72) 37% 100%);
  box-shadow: inset 0 0 26px rgba(158, 51, 202, .28), 0 8px 28px rgba(0, 0, 0, .38);
  backdrop-filter: blur(7px); touch-action: none;
}
.stick-arrows {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: rgba(209, 161, 59, .23); font-size: 52px; transform: rotate(45deg); pointer-events: none;
}
#move-thumb {
  position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; border-radius: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(145deg, var(--gold-light), var(--gold));
  border: 2px solid rgba(253, 251, 247, .75);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .42), 0 0 18px rgba(209, 161, 59, .45);
  pointer-events: none; transition: transform .1s ease-out;
}
#move-stick.engaged #move-thumb { transition: none; }
#mobile-play {
  width: 92px; height: 92px; border-radius: 50%; border: 3px solid var(--gold);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  background: linear-gradient(145deg, var(--purple), var(--purple-dark)); color: var(--cream);
  font: 800 11px/1 'Unbounded', sans-serif; letter-spacing: .08em;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .2), 0 8px 0 #3b0e4d, 0 13px 28px rgba(0, 0, 0, .45);
  touch-action: manipulation;
}
#mobile-play:active, #mobile-play.pressed { transform: translateY(6px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .16), 0 2px 0 #3b0e4d; }
#mobile-play.performing { animation: playPulse .48s ease-in-out infinite alternate; }
@keyframes playPulse { to { filter: brightness(1.2); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .24), 0 8px 0 #3b0e4d, 0 0 28px rgba(209, 161, 59, .62); } }
.play-key { color: var(--gold-light); font-size: 15px; }

/* ============ OVERLAYS / PANELS ============ */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10, 6, 18, .72); backdrop-filter: blur(10px);
  padding: 4vh 4vw;
  animation: fadeIn .3s ease;
}
@keyframes fadeIn { from { opacity: 0; } }

.panel {
  position: relative;
  width: min(860px, 100%); max-height: 88vh; overflow-y: auto;
  background: var(--cream); color: var(--ink);
  border: 3px solid var(--ink); border-radius: var(--r-panel);
  box-shadow: var(--shadow-pop);
  padding: 38px clamp(22px, 5vw, 56px) 34px;
  animation: panelIn .45s cubic-bezier(.2, 1.3, .35, 1);
}
@keyframes panelIn { from { transform: translateY(46px) scale(.94); opacity: 0; } }

.panel::-webkit-scrollbar { width: 10px; }
.panel::-webkit-scrollbar-track { background: var(--lavender); border-radius: 8px; }
.panel::-webkit-scrollbar-thumb { background: var(--purple); border-radius: 8px; }

.close-btn {
  position: absolute; top: 16px; right: 16px; z-index: 2;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--ink); color: var(--cream);
  border: none; font-size: 15px; cursor: pointer;
  transition: background .2s, transform .2s;
}
.close-btn:hover { background: var(--purple); transform: rotate(90deg); }

.panel-meta {
  display: flex; justify-content: space-between;
  font-size: 10px; letter-spacing: .3em; text-transform: uppercase;
  color: rgba(23, 18, 28, .5); margin-bottom: 10px;
}
.panel-title {
  font-family: 'Unbounded', sans-serif; font-weight: 900;
  font-size: clamp(30px, 5.5vw, 54px); line-height: 1.04;
  color: var(--purple); text-transform: none; letter-spacing: -.01em;
  margin-bottom: 26px;
}
.panel-title .dot { color: var(--gold); }

.panel-actions {
  display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px;
}

/* ---- steps ---- */
.steps-list { list-style: none; display: flex; flex-direction: column; gap: 18px; }
.steps-list li { display: flex; gap: 18px; align-items: flex-start; }
.step-tri { margin-top: 6px; border-left-width: 1.1em; border-top-width: .7em; border-bottom-width: .7em; filter: drop-shadow(3px 3px 0 rgba(23, 18, 28, .85)); }
.steps-list div { font-size: clamp(15px, 2vw, 18px); line-height: 1.55; }
.steps-list b { font-family: 'Unbounded'; font-weight: 700; font-size: .85em; color: var(--purple); letter-spacing: .04em; }
.steps-list em { font-style: normal; color: var(--gold); font-weight: 700; background: rgba(209, 161, 59, .18); padding: 0 6px; border-radius: 6px; }

/* ---- rules ---- */
.rules-panel { background: var(--lavender); }
.rule-block {
  display: flex; gap: clamp(14px, 3vw, 30px);
  padding: 22px 0; border-top: 2px dashed rgba(23, 18, 28, .25);
}
.rule-block:first-of-type { border-top: none; }
.rule-num {
  font-family: 'Rubik Mono One', 'Unbounded', sans-serif;
  font-size: clamp(56px, 9vw, 96px); line-height: .9;
  color: var(--purple);
  text-shadow: 5px 5px 0 var(--ink);
  flex: none; width: 1.15em; text-align: center;
  transform: rotate(-4deg);
}
.rule-body h3 {
  font-family: 'Unbounded'; font-weight: 700; font-size: clamp(15px, 2.2vw, 19px);
  letter-spacing: .02em; margin-bottom: 12px; color: var(--ink);
}
.dots { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.dots li { position: relative; padding-left: 20px; font-size: 15px; line-height: 1.5; }
.dots li::before {
  content: ''; position: absolute; left: 0; top: .5em;
  width: 7px; height: 7px; border-radius: 50%; background: var(--purple);
}
.status { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.5; margin-bottom: 10px; }
.status .mark {
  flex: none; width: 26px; height: 26px; border-radius: 8px;
  display: grid; place-items: center; font-weight: 900; font-size: 14px;
  color: var(--cream); margin-top: 1px;
}
.status.no .mark { background: var(--red); }
.status.yes .mark { background: var(--green); }

/* ---- pricing ---- */
.price-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.price-card {
  border: 3px solid var(--ink); border-radius: 18px; overflow: hidden;
  transition: transform .25s, box-shadow .25s;
}
.price-card:hover { transform: translateY(-4px); box-shadow: 8px 8px 0 rgba(23, 18, 28, .25); }
.price-card.flash { animation: cardFlash 1.2s ease; }
@keyframes cardFlash { 0%, 60% { box-shadow: 0 0 0 6px var(--gold); } 100% { box-shadow: none; } }
.price-card header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px 12px;
}
.price-card h3 {
  font-family: 'Playfair Display', serif; font-weight: 900; font-style: italic;
  font-size: clamp(24px, 3.2vw, 36px); line-height: 1.05;
}
.price-kicker { display: block; margin-bottom: 5px; font-size: 9px; letter-spacing: .14em; opacity: .78; }
.price-card .sketch { width: 64px; height: 88px; }
.price-card.vocal { background: var(--purple); color: var(--cream); }
.price-card.vocal h3 { color: var(--gold-light); }
.price-card.vocal .sketch { color: rgba(253, 251, 247, .9); }
.price-card.guitar { background: var(--gold); color: var(--ink); }
.price-card.guitar h3 { color: var(--purple-deep); }
.price-card.guitar .sketch { color: rgba(23, 18, 28, .85); }

.dur-group { padding: 10px 22px 14px; border-top: 1px dashed rgba(253, 251, 247, .35); }
.price-card.guitar .dur-group { border-top-color: rgba(23, 18, 28, .3); }
.section-label { padding: 13px 22px 4px; font-size: 10px; font-weight: 800; letter-spacing: .2em; opacity: .72; }
.single-lessons { padding-bottom: 16px; }
.single-lessons .price-row > span { display: grid; gap: 2px; font-weight: 800; }
.single-lessons .price-row small { font-size: 9px; font-weight: 500; opacity: .72; }
.dur-head { display: flex; align-items: baseline; gap: 10px; margin: 4px 0 8px; }
.dur {
  font-family: 'Unbounded'; font-weight: 900; font-size: 17px; letter-spacing: .05em;
}
.price-card.vocal .dur { color: var(--gold-light); }
.price-card.guitar .dur { color: var(--purple-deep); }
.dur-note { font-size: 11px; opacity: .75; letter-spacing: .04em; }
.price-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 14px; padding: 5px 0;
}
.price-row b { font-family: 'Unbounded'; font-weight: 700; font-size: 15px; }
.price-foot { margin-top: 18px; font-size: 11px; letter-spacing: .08em; color: rgba(23, 18, 28, .55); }
.promotions { margin-top: 24px; padding-top: 22px; border-top: 2px dashed rgba(23, 18, 28, .22); }
.promotions > h3 { margin-bottom: 14px; color: var(--gold); font: 900 clamp(24px, 4vw, 36px)/1.05 'Playfair Display', serif; }
.promo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.promo-grid p { min-height: 112px; margin: 0; padding: 18px; border: 2px solid var(--ink); border-radius: 16px; background: var(--purple); color: var(--cream); font-size: 13px; font-weight: 700; line-height: 1.35; }
.promo-grid p:nth-child(2) { background: var(--gold); color: var(--ink); }
.promo-grid b { display: block; margin-bottom: 6px; font: 900 17px 'Unbounded', sans-serif; }

/* ---- help ---- */
.help-panel { width: min(560px, 100%); }
.help-list { list-style: none; display: flex; flex-direction: column; gap: 14px; font-size: 15px; }
.help-list li { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; line-height: 1.5; }
.kbd {
  font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 600;
  background: var(--ink); color: var(--gold);
  border-radius: 7px; padding: 3px 10px; letter-spacing: .08em;
  box-shadow: 2px 2px 0 rgba(158, 51, 202, .6);
}
.help-note { margin-top: 22px; font-size: 11px; letter-spacing: .12em; color: var(--purple); }

#webgl-fail { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: var(--scene-bg); padding: 20px; }
#webgl-fail .panel { width: min(480px, 100%); }
#webgl-fail p { font-size: 15px; line-height: 1.6; }

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  .price-cards { grid-template-columns: 1fr; }
  .promo-grid { grid-template-columns: 1fr; }
  .promo-grid p { min-height: 0; }
}
@media (max-width: 720px), (hover: none) and (pointer: coarse) and (max-height: 900px) {
  #hud {
    display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 7px 9px;
    padding: max(8px, env(safe-area-inset-top)) 10px 8px;
    background: linear-gradient(180deg, rgba(10, 6, 18, .78), rgba(10, 6, 18, 0));
  }
  .hud-left { grid-column: 1; grid-row: 1; }
  .logo-chip { width: 46px; height: 46px; padding: 4px; border-radius: 13px; justify-content: center; }
  .logo-av { width: 36px; height: 36px; font-size: 18px; }
  .logo-text { display: none; }
  .hud-center { grid-column: 2; grid-row: 1; min-width: 0; }
  #vibe { width: 100%; height: 46px; padding: 7px 12px; }
  .vibe-track { width: auto; min-width: 0; flex: 1; }
  .hud-right {
    grid-column: 1 / -1; grid-row: 2; width: 100%; min-width: 0;
    display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr) minmax(0, .78fr) 36px 36px;
    gap: 6px; margin: 0;
  }
  .nav-btn {
    width: 100%; min-width: 0; min-height: 36px; padding: 6px 5px;
    font-size: clamp(7px, 2.25vw, 10px); letter-spacing: .05em; line-height: 1.15;
  }
  .icon-btn { width: 36px; height: 36px; }
  #keys-hint, #drag-hint { display: none; }
  #zoom-controls {
    right: max(10px, env(safe-area-inset-right)); top: 48%; gap: 5px; padding: 5px;
    background: rgba(23, 18, 28, .46);
  }
  #zoom-controls button { width: 36px; height: 36px; font-size: 22px; }
  #loop-pedal {
    right: calc(max(18px, env(safe-area-inset-right)) + 106px);
    bottom: max(18px, env(safe-area-inset-bottom));
  }
  #loop-toggle {
    width: 66px; height: 66px; grid-template-columns: 1fr; grid-template-rows: 12px 18px 10px;
    justify-items: center; row-gap: 2px; padding: 9px 7px 10px; border-radius: 50%;
  }
  .loop-led { grid-row: 1; width: 8px; height: 8px; }
  #loop-label { align-self: center; font-size: 9px; text-align: center; }
  #loop-meta { align-self: start; max-width: 55px; overflow: hidden; font-size: 5px; line-height: 1.1; text-align: center; }
  .loop-progress { left: 13px; right: 13px; bottom: 8px; }
  #loop-tools { position: absolute; left: -3px; top: -38px; flex-direction: row; gap: 4px; }
  #loop-tools button { width: 34px; height: 34px; border-radius: 50%; }
  #mobile-controls.active {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 43;
    display: flex; align-items: flex-end; justify-content: space-between;
    padding: 0 max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
    pointer-events: none;
  }
  #move-stick, #mobile-play { pointer-events: auto; }
  #vocal-pad {
    bottom: calc(202px + env(safe-area-inset-bottom));
    max-width: calc(100vw - 22px); gap: 5px; padding: 7px;
  }
  #vocal-pad button { width: clamp(42px, 12vw, 50px); height: clamp(42px, 12vw, 50px); font-size: 8px; }
  .panel { padding: 28px 16px 24px; }
  .rule-num { text-shadow: 3px 3px 0 var(--ink); }
  .dur-group { padding: 8px 14px 12px; }
  .price-card header { padding: 14px 16px 8px; }
  #chip {
    top: auto; bottom: calc(132px + env(safe-area-inset-bottom));
    grid-template-columns: 28px minmax(0, 1fr) 28px auto;
    gap: 6px; width: calc(100vw - 24px); padding: 8px 9px;
  }
  #chip-title { font-size: 9px; }
  .chip-arrow { width: 28px; height: 28px; font-size: 21px; }
  #chip .pill-btn { min-width: 65px; padding: 8px 9px; font-size: 8px; }
  #toast { bottom: calc(142px + env(safe-area-inset-bottom)); }

  .intro-top { padding: 14px; }
  .tag { font-size: 9px; letter-spacing: .16em; padding: 5px 9px; }
  .intro-kicker { font-size: 9px; letter-spacing: .3em; }
  .intro-logo { font-size: clamp(40px, 14.5vw, 120px); }
  .intro-studio { letter-spacing: .8em; text-indent: .8em; }
  .intro-slogan { font-size: 10px; letter-spacing: .1em; gap: 8px; flex-wrap: wrap; justify-content: center; }
  .intro-hint { font-size: 9px; padding: 0 34px; }
  .ticker-track { font-size: 10px; }
  .pill-btn.big { font-size: 12px; padding: 14px 24px; }
}

@media (max-width: 390px) {
  #move-stick { width: 98px; height: 98px; }
  #move-thumb { width: 43px; height: 43px; }
  #mobile-play { width: 82px; height: 82px; }
  #loop-pedal { right: calc(max(18px, env(safe-area-inset-right)) + 92px); }
  #loop-toggle { width: 60px; height: 60px; grid-template-rows: 11px 16px 9px; padding-top: 8px; }
  #loop-label { font-size: 8px; }
  #loop-meta { max-width: 49px; font-size: 4.7px; }
  .hud-right { grid-template-columns: minmax(0, 1.35fr) minmax(0, .9fr) minmax(0, .72fr) 34px 34px; gap: 4px; }
  .icon-btn { width: 34px; height: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  .ticker-track, .intro-bg, #enter-btn.ready, .loop-led, #loop-pedal.unlocking { animation: none; }
}
