/* ============================================================
   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;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  /* Kill iOS Safari double-tap zoom without blocking taps */
  touch-action: manipulation;
  overscroll-behavior: none;
}

/* Keep readable panels copyable (rules, pricing). */
.panel, .panel * {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}
.panel { touch-action: pan-y; }
#intro, #hud, #onboard, #toast, #chip, #keys-hint, #drag-hint,
#zoom-controls, #loop-pedal, #vocal-pad, .overlay,
button, a, .pill-btn, .icon-btn, .nav-btn {
  touch-action: manipulation;
}

.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;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
}

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

.sound-wrap { position: relative; }
#sound-mixer {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 55;
  width: min(220px, 78vw);
  display: grid; gap: 10px;
  padding: 12px;
  border-radius: 14px; border: 1px solid rgba(209, 161, 59, .4);
  background: rgba(23, 18, 28, .94); backdrop-filter: blur(12px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, .45);
}
#sound-mixer[hidden] { display: none !important; }
.sound-mixer-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.sound-mixer-head .mono {
  font-size: 10px; letter-spacing: .18em; color: rgba(253, 251, 247, .72);
}
.sound-mute-btn {
  border: 1px solid rgba(253, 251, 247, .28); border-radius: 999px;
  background: rgba(158, 51, 202, .35); color: var(--cream);
  font: 700 10px/1 'Unbounded', sans-serif; letter-spacing: .08em;
  padding: 7px 10px; cursor: pointer;
}
.sound-mute-btn[aria-pressed="true"] {
  background: rgba(253, 251, 247, .12); color: rgba(253, 251, 247, .45);
}
.sound-fader {
  display: grid; gap: 5px;
  font: 600 11px/1 'Manrope', sans-serif; color: var(--cream);
}
.sound-fader input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px; border-radius: 999px;
  background: rgba(253, 251, 247, .16); outline: none;
  touch-action: none;
}
.sound-fader input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--gold); border: 2px solid var(--cream); cursor: pointer;
}
.sound-fader input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--gold); border: 2px solid var(--cream); cursor: pointer;
}

/* ============ 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; position: relative; }
.hud-nav-links { display: flex; align-items: center; gap: 8px; }
#menu-btn { display: none; }
.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);
}

/* Super-simple first-run tip */
#onboard {
  position: fixed; left: 50%; bottom: max(28px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 46;
  display: flex; align-items: center; gap: 14px;
  max-width: min(420px, calc(100vw - 28px));
  padding: 12px 14px 12px 18px;
  border: 1px solid rgba(209, 161, 59, .4);
  border-radius: 16px;
  background: rgba(23, 18, 28, .88);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .35);
  color: var(--cream);
  animation: onboardIn .45s cubic-bezier(.2, 1.2, .35, 1);
}
#onboard[hidden] { display: none !important; }
#onboard-text {
  margin: 0;
  font-size: 13px; letter-spacing: .04em; line-height: 1.35;
}
#onboard-ok { flex: none; }
@keyframes onboardIn {
  from { opacity: 0; transform: translate(-50%, 16px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
@media (prefers-reduced-motion: reduce) {
  #onboard { animation: none; }
}

#zoom-controls {
  position: fixed; right: 18px; top: 50%; z-index: 44;
  transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 6px;
  padding: 5px; border: 1px solid rgba(209, 161, 59, .22); border-radius: 999px;
  background: rgba(23, 18, 28, .38); backdrop-filter: blur(10px);
  opacity: .55; transition: opacity .25s ease, transform .3s ease;
}
#zoom-controls:hover, #zoom-controls:focus-within { opacity: 1; }
#zoom-controls button {
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 1px solid rgba(253, 251, 247, .18); border-radius: 50%;
  background: rgba(253, 251, 247, .08); color: var(--cream);
  font: 500 22px/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: 26px minmax(120px, 1fr) 26px auto;
  align-items: center; gap: 6px;
  background: rgba(23, 18, 28, .72); color: var(--cream); backdrop-filter: blur(12px);
  border: 1px solid rgba(209, 161, 59, .28); border-radius: 14px;
  width: min(calc(100vw - 28px), 420px); padding: 7px 9px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .32);
  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: 600; font-size: 10px; line-height: 1.3; letter-spacing: .02em; color: rgba(253, 251, 247, .88); }
#chip-title .accent { display: inline; margin-left: 4px; color: var(--gold-light); white-space: nowrap; font-weight: 500; }
#chip-desc { display: none; }
.chip-arrow {
  width: 26px; height: 26px; display: grid; place-items: center;
  padding: 0 0 2px; border: 0; border-radius: 50%;
  background: rgba(253, 251, 247, .06); color: rgba(253, 251, 247, .55); font-size: 18px; line-height: 1; cursor: pointer;
  transition: background .18s, color .18s, transform .18s;
}
.chip-arrow:hover, .chip-arrow:focus-visible { background: rgba(158, 51, 202, .55); color: var(--cream); transform: scale(1.05); outline: none; }
#chip-close {
  position: absolute; top: -8px; right: -6px;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(23, 18, 28, .75); color: rgba(253, 251, 247, .7); border: 1px solid rgba(253, 251, 247, .22); cursor: pointer; font-size: 8px;
}
#chip .pill-btn {
  min-width: 64px; padding: 7px 10px; font-size: 8px; white-space: nowrap;
  background: transparent; color: var(--gold-light); border: 1px solid rgba(209, 161, 59, .45);
}
#chip .pill-btn:hover, #chip .pill-btn:focus-visible {
  background: rgba(209, 161, 59, .18); color: var(--cream); border-color: var(--gold);
}

#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);
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
@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;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: 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);
}

/* ============ GUITAR CHORD PAD ============ */
#chord-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);
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  touch-action: none;
}
#chord-pad[hidden] { display: none !important; }
#chord-pad button {
  min-width: 48px; height: 48px; padding: 0 10px;
  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 11px/1 'Unbounded', sans-serif; letter-spacing: .04em;
  cursor: pointer; touch-action: none;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: 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;
}
#chord-pad button:nth-child(even) {
  background: linear-gradient(145deg, var(--gold), #9d6f14); color: var(--ink);
}
#chord-pad button.held {
  transform: translateY(-4px) scale(1.06);
  background: var(--cream); color: var(--purple-deep);
  box-shadow: 0 0 0 3px var(--gold), 0 0 22px rgba(209, 161, 59, .85);
}
/* Guitar focus / fretting: block browser page pinch-zoom (Safari scales the page). */
html.guitar-focused,
html.guitar-focused body,
html.guitar-focused #scene,
html.guitar-fretting,
html.guitar-fretting body,
html.guitar-fretting #scene {
  touch-action: none;
}
#mobile-controls { display: none; }
#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 22px 22px; pointer-events: none;
}
/* Small grab pad around the home stick — leave most of the screen free for orbit/zoom. */
#move-zone {
  position: relative;
  width: 132px;
  height: 132px;
  pointer-events: auto;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}
#move-stick, #mobile-play, #mobile-exit {
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  transition: opacity .28s ease, transform .28s ease;
}
#move-stick {
  position: absolute; left: 4px; bottom: 0;
  width: 108px; height: 108px; border-radius: 50%;
  border: 1px solid rgba(209, 161, 59, .32);
  background: rgba(23, 18, 28, .42);
  box-shadow: inset 0 0 18px rgba(158, 51, 202, .12), 0 4px 16px rgba(0, 0, 0, .28);
  backdrop-filter: blur(8px); touch-action: none;
  opacity: .58;
}
#move-stick.floating {
  position: fixed; left: auto; right: auto; bottom: auto; margin: 0;
  transform: translate(-50%, -50%);
  opacity: 1; z-index: 45;
}
#move-stick.engaged { opacity: 1; }
.stick-arrows {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: rgba(209, 161, 59, .18); font-size: 40px; transform: rotate(45deg); pointer-events: none;
}
#move-thumb {
  position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; border-radius: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(145deg, rgba(232, 193, 105, .95), rgba(209, 161, 59, .92));
  border: 1px solid rgba(253, 251, 247, .55);
  box-shadow: 0 3px 12px rgba(0, 0, 0, .35);
  pointer-events: none; transition: transform .1s ease-out;
}
#move-stick.engaged #move-thumb { transition: none; }
#mobile-actions {
  position: relative;
  display: flex; align-items: flex-end; justify-content: flex-end;
  pointer-events: none;
}
#mobile-play, #mobile-exit {
  width: 78px; height: 78px; border-radius: 50%; border: 2px solid rgba(209, 161, 59, .75);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: rgba(92, 24, 118, .82); color: var(--cream);
  font: 700 10px/1 'Unbounded', sans-serif; letter-spacing: .1em;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .35), 0 0 16px rgba(158, 51, 202, .28);
  backdrop-filter: blur(8px);
  touch-action: none;
}
#mobile-exit {
  width: 56px; height: 56px; border-color: rgba(253, 251, 247, .5);
  background: rgba(23, 18, 28, .88);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .4), 0 0 14px rgba(209, 161, 59, .3);
  font-size: 22px; line-height: 1; color: var(--gold); letter-spacing: 0;
}
#mobile-exit:active, #mobile-exit.pressed,
#mobile-play:active, #mobile-play.pressed { transform: scale(.94); }
#mobile-play.performing { animation: playPulse .48s ease-in-out infinite alternate; }
#mobile-play:disabled {
  opacity: .32; filter: saturate(.5); cursor: not-allowed;
  transform: none; box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
}
#mobile-play-hint {
  position: absolute; right: max(14px, env(safe-area-inset-right));
  bottom: calc(max(18px, env(safe-area-inset-bottom)) + 96px);
  width: min(200px, 58vw); padding: 7px 10px; border-radius: 12px;
  border: 1px solid rgba(209, 161, 59, .35); background: rgba(23, 18, 28, .72);
  color: rgba(253, 251, 247, .82); font: 600 8px/1.4 'Unbounded', sans-serif; text-align: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .28); backdrop-filter: blur(8px);
  pointer-events: none;
}
@keyframes playPulse {
  to { filter: brightness(1.15); box-shadow: 0 4px 18px rgba(0, 0, 0, .35), 0 0 22px rgba(209, 161, 59, .5); }
}

/* Stage-first: tuck walk chrome while seated; keep exit */
html[data-instrument-view="approaching"] #move-zone,
html[data-instrument-view="entering"] #move-zone,
html[data-instrument-view="focused"] #move-zone,
html[data-instrument-view="approaching"] #move-stick,
html[data-instrument-view="entering"] #move-stick,
html[data-instrument-view="focused"] #move-stick,
html[data-instrument-view="entering"] #mobile-play-hint,
html[data-instrument-view="focused"] #mobile-play-hint {
  opacity: 0 !important;
  pointer-events: none !important;
}
html[data-instrument-view="approaching"] #mobile-play,
html[data-instrument-view="entering"] #mobile-play,
html[data-instrument-view="focused"] #mobile-play {
  display: none !important;
}
html[data-instrument-view="focused"] #hud {
  opacity: .72;
}

@media (min-width: 721px) {
  #loop-pedal { right: 134px; bottom: 24px; }
  #keys-hint { bottom: 150px; }
  #drag-hint { right: 142px; bottom: 30px; }
}

/* On full desktop, keep the controls discoverable without covering the stage. */
@media (min-width: 1000px) {
  #keys-hint {
    left: 50%; bottom: 22px;
    transform: translateX(-50%);
    white-space: nowrap;
  }
  #keys-hint.hidden { transform: translate(-50%, -140%); }
  #drag-hint { right: 142px; bottom: 140px; }
}

/* ============ 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: 12px;
}
.panel-title .dot { color: var(--gold); }
.panel-lead {
  max-width: 38em; margin: 0 0 28px;
  font-size: clamp(14px, 2vw, 16px); line-height: 1.55;
  color: rgba(23, 18, 28, .72);
}

.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:
    radial-gradient(90% 60% at 100% 0%, rgba(158, 51, 202, .12), transparent 55%),
    var(--cream);
}
.rules-score {
  position: relative;
  display: flex; flex-direction: column; gap: 0;
  padding-left: 2px;
}
.rules-score::before {
  content: '';
  position: absolute; left: 19px; top: 18px; bottom: 18px;
  width: 2px;
  background: linear-gradient(180deg, var(--gold), rgba(158, 51, 202, .55), var(--gold));
  border-radius: 2px;
}
.rule-block {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: clamp(14px, 3vw, 22px);
  padding: 18px 0 22px;
}
.rule-num {
  position: relative; z-index: 1;
  display: grid; place-items: start center;
  padding-top: 2px;
}
.rule-num span {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--ink); color: var(--gold);
  border: 2px solid var(--gold);
  font-family: 'Unbounded', sans-serif; font-weight: 900;
  font-size: 15px; letter-spacing: .02em;
  box-shadow: 0 0 0 4px var(--cream);
}
.rule-body h3 {
  font-family: 'Unbounded'; font-weight: 700; font-size: clamp(15px, 2.2vw, 19px);
  letter-spacing: .02em; margin-bottom: 6px; color: var(--ink);
}
.rule-sub {
  margin: 0 0 12px;
  font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  color: rgba(23, 18, 28, .5);
}
.dots { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.dots li { position: relative; padding-left: 18px; font-size: 15px; line-height: 1.5; }
.dots li::before {
  content: ''; position: absolute; left: 0; top: .55em;
  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;
  padding: 12px 14px; border-radius: 14px; border: 2px solid transparent;
}
.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 {
  background: rgba(210, 31, 60, .08);
  border-color: rgba(210, 31, 60, .28);
}
.status.no .mark { background: var(--red); }
.status.yes {
  background: rgba(31, 157, 77, .08);
  border-color: rgba(31, 157, 77, .28);
}
.status.yes .mark { background: var(--green); }

/* ---- pricing mixer ---- */
.pricing-panel {
  width: min(560px, 100%);
  background:
    radial-gradient(80% 50% at 0% 0%, rgba(209, 161, 59, .14), transparent 50%),
    var(--cream);
}
.price-mixer { display: flex; flex-direction: column; gap: 18px; }
.mixer-section { display: flex; flex-direction: column; gap: 10px; }
.mixer-label {
  font-size: 10px; letter-spacing: .22em; color: rgba(23, 18, 28, .48);
}
.inst-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.inst-btn {
  display: grid; justify-items: center; gap: 6px;
  padding: 12px 6px 10px;
  border: 2px solid rgba(23, 18, 28, .18);
  border-radius: 14px; background: rgba(253, 251, 247, .7);
  color: var(--ink); cursor: pointer;
  font: 700 11px/1.1 'Unbounded', sans-serif;
  transition: border-color .2s, background .2s, color .2s, transform .2s;
}
.inst-btn svg { width: 28px; height: 28px; }
.inst-btn:hover { border-color: var(--purple); transform: translateY(-2px); }
.inst-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.inst-btn.is-on {
  background: var(--purple); border-color: var(--ink); color: var(--cream);
  box-shadow: 4px 4px 0 rgba(23, 18, 28, .2);
}
#price-mixer[data-theme="rhythm"] .inst-btn.is-on {
  background: var(--gold); color: var(--ink);
}

.format-toggle {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  border: 2px solid var(--ink); border-radius: 999px; overflow: hidden;
  background: rgba(23, 18, 28, .06);
}
.format-btn {
  border: 0; background: transparent; color: var(--ink);
  padding: 12px 10px; cursor: pointer;
  font: 800 12px/1 'Unbounded', sans-serif; letter-spacing: .04em;
  transition: background .2s, color .2s;
}
.format-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; }
.format-btn.is-on { background: var(--ink); color: var(--gold); }
#price-mixer[data-theme="vocal"] .format-btn.is-on { background: var(--purple); color: var(--cream); }
#price-mixer[data-theme="rhythm"] .format-btn.is-on { background: var(--ink); color: var(--gold); }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-chip {
  min-width: 72px; padding: 10px 14px;
  border: 2px solid rgba(23, 18, 28, .2); border-radius: 999px;
  background: transparent; color: var(--ink); cursor: pointer;
  font: 800 13px/1 'Unbounded', sans-serif;
  transition: background .2s, border-color .2s, color .2s, transform .2s;
}
.choice-chip:hover { border-color: var(--purple); transform: translateY(-1px); }
.choice-chip:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.choice-chip.is-on {
  background: var(--purple); border-color: var(--ink); color: var(--cream);
}
#price-mixer[data-theme="rhythm"] .choice-chip.is-on {
  background: var(--gold); color: var(--ink);
}

.price-board {
  position: relative;
  margin-top: 4px;
  padding: 22px 22px 20px;
  border: 3px solid var(--ink); border-radius: 18px;
  background: var(--purple); color: var(--cream);
  box-shadow: 8px 8px 0 rgba(23, 18, 28, .18);
  transition: background .25s, color .25s;
}
.price-board::before,
.price-board::after {
  content: '';
  position: absolute; top: 50%; z-index: 2;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--cream);
  border: 3px solid var(--ink);
  transform: translateY(-50%);
  pointer-events: none;
}
.price-board::before { left: -11px; }
.price-board::after { right: -11px; }
.price-board[data-theme="rhythm"] {
  background: var(--gold); color: var(--ink);
}
.price-board.flash { animation: boardFlash 1s ease; }
.price-board.is-tick .board-amount { animation: priceTick .35s cubic-bezier(.2, 1.4, .35, 1); }
@keyframes boardFlash {
  0%, 55% { box-shadow: 0 0 0 6px var(--gold), 8px 8px 0 rgba(23, 18, 28, .18); }
  100% { box-shadow: 8px 8px 0 rgba(23, 18, 28, .18); }
}
@keyframes priceTick {
  from { transform: translateY(10px); opacity: .35; }
  to { transform: none; opacity: 1; }
}
.board-kicker {
  font-size: 10px; letter-spacing: .18em; opacity: .78; margin-bottom: 8px;
}
.board-amount {
  display: flex; align-items: baseline; gap: 10px;
  font-family: 'Playfair Display', serif; font-weight: 900; font-style: italic;
  font-size: clamp(52px, 12vw, 72px); line-height: .9;
  color: var(--gold-light);
}
.price-board[data-theme="rhythm"] .board-amount { color: var(--purple-deep); }
.board-cur {
  font-family: 'Unbounded', sans-serif; font-style: normal; font-weight: 800;
  font-size: .34em; letter-spacing: .08em;
}
.board-meta {
  margin-top: 12px;
  font-family: 'Unbounded', sans-serif; font-weight: 700;
  font-size: 15px; letter-spacing: .02em;
}
.board-note { margin-top: 6px; font-size: 13px; line-height: 1.4; opacity: .78; }
.board-per {
  margin-top: 12px; padding-top: 12px;
  border-top: 1px dashed rgba(253, 251, 247, .35);
  font-size: 11px; letter-spacing: .12em; opacity: .8;
}
.price-board[data-theme="rhythm"] .board-per { border-top-color: rgba(23, 18, 28, .28); }

.price-foot { margin-top: 18px; font-size: 11px; letter-spacing: .08em; color: rgba(23, 18, 28, .55); }
.promotions { margin-top: 28px; padding-top: 22px; border-top: 2px dashed rgba(23, 18, 28, .22); }
.promotions > h3 {
  margin-bottom: 14px; color: var(--purple);
  font: 900 clamp(22px, 3.5vw, 32px)/1.05 'Playfair Display', serif; font-style: italic;
}
.promo-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.promo-grid p {
  margin: 0; padding: 12px 14px;
  border: 2px solid var(--ink); border-radius: 12px;
  background: rgba(158, 51, 202, .08); color: var(--ink);
  font-size: 13px; font-weight: 600; line-height: 1.35;
  display: flex; gap: 12px; align-items: baseline;
}
.promo-grid p:nth-child(2) { background: rgba(209, 161, 59, .16); }
.promo-grid p:nth-child(3) { background: rgba(23, 18, 28, .06); }
.promo-grid b {
  flex: none; min-width: 4.5em;
  font: 900 14px/1.1 'Unbounded', sans-serif; color: var(--purple);
}
.promo-grid p:nth-child(2) b { color: var(--purple-deep); }

#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) {
  .inst-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px), (hover: none) and (pointer: coarse) and (max-height: 900px) {
  #hud {
    display: flex; align-items: center; gap: 8px;
    padding: max(8px, env(safe-area-inset-top)) 10px 8px;
    background: linear-gradient(180deg, rgba(10, 6, 18, .55), rgba(10, 6, 18, 0));
  }
  .hud-left { flex: 0 0 auto; }
  .logo-chip { width: 38px; height: 38px; padding: 3px; border-radius: 11px; justify-content: center; }
  .logo-av { width: 30px; height: 30px; font-size: 15px; border-radius: 8px; }
  .logo-text { display: none; }
  .hud-center { flex: 1; min-width: 0; justify-content: stretch; }
  #vibe {
    width: 100%; height: 34px; padding: 5px 10px; gap: 8px;
    background: rgba(23, 18, 28, .42); border-color: rgba(158, 51, 202, .32);
  }
  .vibe-label { font-size: 8px; letter-spacing: .22em; }
  .vibe-track { width: auto; min-width: 0; flex: 1; height: 7px; }
  .hud-right {
    flex: 0 0 auto; gap: 5px; margin: 0;
  }
  #menu-btn { display: grid; }
  .hud-nav-links {
    display: none;
    position: absolute; top: calc(100% + 8px); right: 0;
    flex-direction: column; align-items: stretch; gap: 6px;
    min-width: min(220px, 72vw); padding: 10px;
    border-radius: 14px; border: 1px solid rgba(209, 161, 59, .35);
    background: rgba(23, 18, 28, .92); backdrop-filter: blur(12px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .4);
    z-index: 50;
  }
  #hud.nav-open .hud-nav-links { display: flex; }
  .nav-btn {
    width: 100%; min-height: 40px; padding: 10px 12px;
    font-size: 10px; letter-spacing: .06em; text-align: left;
  }
  .icon-btn { width: 36px; height: 36px; }
  #keys-hint, #drag-hint { display: none; }
  #zoom-controls {
    right: max(10px, env(safe-area-inset-right));
    top: auto; bottom: calc(max(18px, env(safe-area-inset-bottom)) + 108px);
    transform: none; gap: 4px; padding: 4px;
    opacity: .42; background: rgba(23, 18, 28, .32);
  }
  #zoom-controls:active, #zoom-controls:focus-within { opacity: .9; }
  #zoom-controls button { width: 32px; height: 32px; font-size: 18px; }
  #loop-pedal {
    right: calc(max(14px, env(safe-area-inset-right)) + 88px);
    bottom: max(18px, env(safe-area-inset-bottom));
  }
  #loop-toggle {
    width: 58px; height: 58px; grid-template-columns: 1fr; grid-template-rows: 10px 16px 9px;
    justify-items: center; row-gap: 1px; padding: 8px 6px 9px; border-radius: 50%;
  }
  .loop-led { grid-row: 1; width: 7px; height: 7px; }
  #loop-label { align-self: center; font-size: 8px; text-align: center; }
  #loop-meta { align-self: start; max-width: 48px; overflow: hidden; font-size: 5px; line-height: 1.1; text-align: center; }
  .loop-progress { left: 11px; right: 11px; bottom: 7px; }
  #loop-tools { position: absolute; left: -3px; top: -34px; flex-direction: row; gap: 4px; }
  #loop-tools button { width: 30px; height: 30px; 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(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    pointer-events: none;
  }
  #vocal-pad, #chord-pad {
    bottom: calc(168px + 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; }
  #chord-pad button { min-width: clamp(40px, 11vw, 48px); height: clamp(42px, 12vw, 50px); font-size: 10px; padding: 0 8px; }
  .overlay { padding: max(10px, env(safe-area-inset-top)) 10px max(12px, env(safe-area-inset-bottom)); align-items: flex-end; }
  .panel {
    width: 100%; max-height: min(92vh, 100%);
    padding: 24px 14px 22px; border-radius: 18px 18px 14px 14px;
  }
  .panel-title { margin-bottom: 8px; }
  .panel-lead { margin-bottom: 20px; font-size: 14px; }
  .rules-score::before { left: 17px; }
  .rule-block { grid-template-columns: 36px minmax(0, 1fr); gap: 12px; padding: 14px 0 18px; }
  .rule-num span { width: 34px; height: 34px; font-size: 13px; }
  .status { padding: 10px 12px; font-size: 14px; }
  .dots li { font-size: 14px; }
  .inst-btn { padding: 10px 4px 8px; font-size: 10px; }
  .inst-btn svg { width: 24px; height: 24px; }
  .format-btn { font-size: 11px; padding: 11px 8px; }
  .choice-chip { min-width: 64px; padding: 9px 12px; font-size: 12px; }
  .price-board { padding: 18px 16px 16px; }
  .board-amount { font-size: clamp(48px, 16vw, 64px); }
  .promo-grid p { padding: 11px 12px; font-size: 12px; }
  #chip {
    top: auto; bottom: calc(112px + env(safe-area-inset-bottom));
    grid-template-columns: 24px minmax(0, 1fr) 24px auto;
    gap: 5px; width: calc(100vw - 32px); max-width: 360px; padding: 6px 8px;
  }
  #chip-title { font-size: 9px; }
  .chip-arrow { width: 24px; height: 24px; font-size: 17px; }
  #chip .pill-btn { min-width: 58px; padding: 6px 8px; font-size: 7px; }
  #toast { bottom: calc(120px + env(safe-area-inset-bottom)); }
  #onboard {
    bottom: calc(118px + env(safe-area-inset-bottom));
    flex-direction: column; gap: 10px; text-align: center;
    padding: 14px 16px;
  }
  #onboard-text { font-size: 12px; }

  .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-zone { width: 118px; height: 118px; }
  #move-stick { width: 96px; height: 96px; }
  #move-thumb { width: 40px; height: 40px; }
  #mobile-play { width: 70px; height: 70px; font-size: 9px; }
  #mobile-exit { width: 52px; height: 52px; font-size: 20px; }
  #mobile-play-hint { bottom: calc(max(16px, env(safe-area-inset-bottom)) + 86px); width: min(180px, 62vw); font-size: 7px; }
  #zoom-controls { bottom: calc(max(16px, env(safe-area-inset-bottom)) + 96px); }
  #loop-pedal { right: calc(max(14px, env(safe-area-inset-right)) + 78px); }
  #loop-toggle { width: 52px; height: 52px; grid-template-rows: 9px 14px 8px; padding-top: 7px; }
  #loop-label { font-size: 7px; }
  #loop-meta { max-width: 42px; font-size: 4.5px; }
  .icon-btn { width: 34px; height: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  .ticker-track, .intro-bg, #enter-btn.ready, .loop-led, #loop-pedal.unlocking,
  .price-board.flash, .price-board.is-tick .board-amount { animation: none; }
  .inst-btn, .choice-chip { transition: none; }
}
