/* ============================================================
   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 {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  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, #chord-pad, .overlay,
button, a, .pill-btn, .icon-btn, .nav-btn {
  touch-action: manipulation;
}
/* Keep chrome tappable under a second finger (pedal + instrument). Canvas stays none. */
html.stage-live #intro,
html.stage-live #hud,
html.stage-live #onboard,
html.stage-live #toast,
html.stage-live #chip,
html.stage-live #keys-hint,
html.stage-live #drag-hint,
html.stage-live #zoom-controls,
html.stage-live #loop-pedal,
html.stage-live #vocal-pad,
html.stage-live #chord-pad,
html.stage-live .overlay,
html.stage-live button,
html.stage-live a,
html.stage-live .pill-btn,
html.stage-live .icon-btn,
html.stage-live .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 {
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-grid; grid-template-columns: minmax(0, 1fr) 46px;
  align-items: center; gap: 14px;
  width: min(430px, calc(100vw - 40px)); min-height: 76px;
  margin-top: clamp(26px, 4vh, 42px); padding: 10px 14px 10px 64px;
  border: 1px solid rgba(255, 231, 166, .92);
  background: linear-gradient(135deg, #f0d17d 0%, var(--gold) 52%, #b77a20 100%);
  color: var(--ink);
  box-shadow:
    0 18px 50px rgba(209, 161, 59, .2),
    0 4px 0 rgba(92, 24, 118, .7),
    inset 0 1px 0 rgba(255, 255, 255, .45);
  transition: transform .2s ease, box-shadow .3s ease, border-color .3s ease,
    background .3s ease, color .3s ease;
}
#enter-label { position: relative; z-index: 1; white-space: nowrap; }
#enter-btn::before {
  content: ''; position: absolute; z-index: -1; inset: 0;
  background: linear-gradient(105deg, transparent 25%, rgba(255, 255, 255, .42) 48%, transparent 70%);
  transform: translateX(-120%); transition: transform .7s ease;
}
#enter-btn::after {
  content: '→'; position: relative; z-index: 1;
  display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--ink); color: var(--gold-light);
  font: 500 24px/1 'Manrope', system-ui, sans-serif;
  transition: transform .25s ease, background .25s ease, color .25s ease;
}
#enter-btn:hover {
  background: linear-gradient(135deg, #f4db95 0%, #d9aa46 52%, #c48829 100%);
  border-color: var(--cream); color: var(--ink);
  transform: translateY(-4px) scale(1.012);
  box-shadow:
    0 25px 65px rgba(209, 161, 59, .28),
    0 5px 0 rgba(92, 24, 118, .8),
    inset 0 1px 0 rgba(255, 255, 255, .55);
}
#enter-btn:hover::before { transform: translateX(120%); }
#enter-btn:hover::after { transform: translateX(3px); background: var(--purple-deep); color: var(--cream); }
#enter-btn:active { transform: translateY(-1px) scale(.995); }
#enter-btn:focus-visible {
  outline: 3px solid var(--cream); outline-offset: 6px;
  box-shadow: 0 0 0 10px rgba(158, 51, 202, .36), 0 20px 55px rgba(209, 161, 59, .26);
}
#enter-btn:disabled {
  cursor: wait; color: rgba(253, 251, 247, .58);
  border-color: rgba(209, 161, 59, .32);
  background: rgba(23, 18, 28, .5);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .03);
}
#enter-btn:disabled::after {
  content: ''; width: 20px; height: 20px; justify-self: center;
  border: 2px solid rgba(209, 161, 59, .25); border-top-color: var(--gold-light);
  background: transparent; animation: enterSpin .8s linear infinite;
}
#enter-btn:disabled:hover { transform: none; border-color: rgba(209, 161, 59, .32); }
#enter-btn:disabled:hover::before { transform: translateX(-120%); }
#enter-btn.ready { animation: enterAura 2.8s ease-in-out infinite; }
@keyframes enterAura {
  0%, 100% {
    box-shadow: 0 18px 50px rgba(209, 161, 59, .18), 0 4px 0 rgba(92, 24, 118, .7), inset 0 1px 0 rgba(255, 255, 255, .45);
  }
  50% {
    box-shadow: 0 22px 65px rgba(209, 161, 59, .32), 0 4px 0 rgba(92, 24, 118, .7), 0 0 0 9px rgba(209, 161, 59, .08), inset 0 1px 0 rgba(255, 255, 255, .45);
  }
}
@keyframes enterSpin { to { transform: rotate(360deg); } }
.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); }

.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);
}
.mixer-section-label {
  margin-top: 2px; font-size: 9px; letter-spacing: .16em; color: rgba(253, 251, 247, .52);
}
#sound-recover-btn {
  min-height: 30px; padding: 6px 9px; border-radius: 999px;
  border: 1px solid rgba(209, 161, 59, .68);
  background: rgba(209, 161, 59, .12); color: var(--cream);
  font: 700 9px/1 'JetBrains Mono', monospace; letter-spacing: .08em;
  cursor: pointer; touch-action: manipulation;
}
#sound-recover-btn:hover,
#sound-recover-btn:focus-visible {
  border-color: var(--gold); background: var(--gold); color: var(--ink); outline: none;
}
#sound-recover-btn:disabled { opacity: .58; cursor: wait; }
.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;
}
.sound-fader.light-fader {
  padding-bottom: 8px; margin-bottom: 2px;
  border-bottom: 1px solid rgba(253, 251, 247, .12);
}
.sound-fader.light-fader output {
  color: var(--gold); font-weight: 700; letter-spacing: .04em;
}
.light-fader-range {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px; border-radius: 999px; margin: 0;
  background: rgba(253, 251, 247, .16); outline: none;
  touch-action: none; cursor: pointer;
}
.light-fader-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;
}
.light-fader-range::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--gold); border: 2px solid var(--cream); cursor: pointer;
}
.light-fader-range:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

/* ============ 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);
  font: inherit; color: inherit; cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
}
.logo-chip:hover { border-color: var(--gold); }
.logo-chip.dancing { border-color: var(--purple); box-shadow: 0 0 16px rgba(158, 51, 202, .45); }
.logo-chip.dancing .logo-av { animation: logoDanceSway .48s ease-in-out infinite alternate; }
@keyframes logoDanceSway {
  from { transform: translateY(1px) rotate(-6deg); }
  to { transform: translateY(-2px) rotate(6deg); }
}
.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: none; -webkit-tap-highlight-color: transparent;
  transition: background .16s, border-color .16s, color .16s, transform .16s;
}
#zoom-controls { touch-action: none; }
#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: min(420px, 90vw); text-align: center;
  touch-action: none; user-select: none; -webkit-user-select: none;
  -webkit-touch-callout: none;
}
#toast .hl { color: var(--gold); }
/* Keep vibe-max / pad-safe toasts under the HUD — never over vocal/chord pads. */
html.pads-open #toast,
#toast[data-kind="vibe-max"] {
  top: max(96px, calc(env(safe-area-inset-top) + 78px));
  bottom: auto !important;
  animation: toastInTop .3s ease;
}
@keyframes toastInTop { from { transform: translate(-50%, -14px); opacity: 0; } }

/* ============ 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;
  padding: 9px; border: 1px solid rgba(209, 161, 59, .72); border-radius: 20px;
  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; }
.guitar-chord-buttons {
  display: flex; align-items: center; gap: 7px;
}
#chord-pad [data-chord] {
  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 [data-chord]:nth-child(even) {
  background: linear-gradient(145deg, var(--gold), #9d6f14); color: var(--ink);
}
#chord-pad [data-chord].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 play claims the canvas, while panels and controls keep normal zoom. */
html.guitar-focused #scene,
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: 172px;
  height: 172px;
  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: 126px; height: 126px; border-radius: 50%;
  border: 2px solid rgba(209, 161, 59, .72);
  background: rgba(23, 18, 28, .72);
  box-shadow: inset 0 0 22px rgba(158, 51, 202, .28), 0 6px 20px rgba(0, 0, 0, .4), 0 0 18px rgba(209, 161, 59, .22);
  backdrop-filter: blur(8px); touch-action: none;
  opacity: .92;
}
#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, .55); font-size: 42px; transform: rotate(45deg); pointer-events: none;
}
#move-thumb {
  position: absolute; left: 50%; top: 50%; width: 50px; height: 50px; border-radius: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(145deg, #f0d78a, var(--gold));
  border: 2px solid var(--cream);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .45), 0 0 12px rgba(209, 161, 59, .45);
  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: 82px; height: 82px; 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: 34px; 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, #mobile-play.is-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;
}

/* Backdrop capture makes the browser composite every glass control over the
   canvas. On the low mobile tier the existing translucent fills remain, while
   the expensive capture/blur pass is removed. */
html.low-mobile body * {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
@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;
}
/* Piano focus gives the measured keybed the full canvas; the global shortcut
   legend otherwise crosses the keys in short landscape browser windows. */
html[data-instrument="piano"][data-instrument-view="entering"] #keys-hint,
html[data-instrument="piano"][data-instrument-view="focused"] #keys-hint,
html[data-instrument="piano"][data-instrument-view="entering"] #drag-hint,
html[data-instrument="piano"][data-instrument-view="focused"] #drag-hint {
  opacity: 0;
  pointer-events: none;
}

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

.quality-control {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-bottom: 8px; border-bottom: 1px solid rgba(253, 251, 247, .12);
}
.quality-control > .mono { font-size: 10px; letter-spacing: .18em; color: rgba(253, 251, 247, .72); }
.quality-options { display: flex; gap: 3px; }
.quality-option {
  min-height: 26px; padding: 0 6px; border: 1px solid transparent; border-radius: 5px;
  color: rgba(253, 251, 247, .55); background: transparent; cursor: pointer;
  font: 700 8px/1 'JetBrains Mono', monospace; letter-spacing: .04em;
}
.quality-option:hover:not(:disabled), .quality-option:focus-visible { color: var(--cream); border-color: rgba(253, 251, 247, .38); outline: none; }
.quality-option.is-on { color: var(--ink); border-color: var(--gold); background: var(--gold); }
.quality-options.is-loading .quality-option:not(.is-loading) { opacity: .38; }
.quality-option:disabled { cursor: wait; }
.quality-option.is-loading { color: transparent; border-color: var(--gold); }
.quality-option.is-loading::after { content: "· · ·"; color: var(--gold); }
.quality-confirm-panel { max-width: 380px; padding: 28px; text-align: center; }
.quality-confirm-panel h2 { margin: 0 0 10px; color: var(--purple); font: 800 23px/1.15 'Unbounded', sans-serif; }
.quality-confirm-panel p { margin: 0; color: rgba(23, 18, 28, .68); font-size: 14px; line-height: 1.45; }
.quality-confirm-actions { display: flex; justify-content: center; gap: 8px; margin-top: 22px; }
.quality-confirm-loader { align-items: center; justify-content: center; gap: 8px; margin-top: 20px; color: var(--purple); font: 700 10px/1 'JetBrains Mono', monospace; letter-spacing: .08em; }
.quality-confirm-loader:not([hidden]) { display: flex; }
.quality-confirm-loader span { width: 14px; height: 14px; border: 2px solid rgba(158, 51, 202, .22); border-top-color: var(--purple); border-radius: 50%; animation: qualityConfirmLoader .65s linear infinite; }
.quality-confirm-panel.is-loading .quality-confirm-actions { opacity: .38; pointer-events: none; }
@keyframes qualityConfirmLoader { to { transform: rotate(360deg); } }

/* ---- 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; place-items: center;
  min-height: 52px; padding: 12px 8px;
  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.2 'Unbounded', sans-serif;
  text-align: center;
  transition: border-color .2s, background .2s, color .2s, transform .2s;
}
.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); }

/* ---- mascot customization ---- */
#modal-mascot {
  justify-content: flex-end; align-items: stretch;
  padding: 16px;
  background: rgba(10, 6, 18, .42);
  backdrop-filter: none;
  overscroll-behavior: contain;
  touch-action: none;
}
#modal-mascot .mascot-panel {
  width: min(440px, 100%); max-height: none; height: 100%;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  padding: 0; overflow: hidden; isolation: isolate;
  background:
    radial-gradient(80% 50% at 100% 0%, rgba(158, 51, 202, .14), transparent 55%),
    var(--cream);
  touch-action: pan-y;
}
.mascot-panel .close-btn { position: absolute; z-index: 6; top: 18px; right: 18px; width: 48px; height: 48px; }
.mascot-editor-head {
  position: relative; z-index: 2;
  padding: 28px 30px 0;
  background: linear-gradient(180deg, var(--cream) 78%, rgba(253, 251, 247, .94));
}
.mascot-editor-head .panel-meta { padding-right: 48px; }
.mascot-panel .panel-title { margin-bottom: 16px; font-size: clamp(27px, 4vw, 40px); }
.mascot-tabs {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px; padding-bottom: 12px;
}
.mascot-tabs button {
  min-width: 0; min-height: 48px; padding: 8px 6px;
  border: 2px solid rgba(23, 18, 28, .16); border-radius: 12px;
  background: rgba(23, 18, 28, .04); color: rgba(23, 18, 28, .68);
  font: 800 9px/1.2 'Unbounded', sans-serif; letter-spacing: .06em;
  cursor: pointer;
}
.mascot-tabs button[aria-selected="true"] {
  border-color: var(--ink); background: var(--purple); color: var(--cream);
  box-shadow: 0 4px 0 rgba(23, 18, 28, .9);
}
.mascot-tabs button:focus-visible,
.outfit-choice:focus-visible,
.mascot-text-btn:focus-visible {
  outline: 3px solid var(--gold); outline-offset: 2px;
}
.mascot-editor-scroll {
  min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 16px 30px 22px; scrollbar-gutter: stable;
}
.mascot-editor-scroll::-webkit-scrollbar { width: 8px; }
.mascot-editor-scroll::-webkit-scrollbar-track { background: var(--lavender); border-radius: 8px; }
.mascot-editor-scroll::-webkit-scrollbar-thumb { background: var(--purple); border-radius: 8px; }
.mascot-category { display: flex; flex-direction: column; gap: 18px; }
.mascot-category[hidden] { display: none; }
.mascot-category .mixer-section { margin: 0; }
.mascot-panel .mixer-label {
  display: block; margin-bottom: 8px; color: rgba(23, 18, 28, .62);
}
.mascot-panel .mixer-label b { color: var(--purple); font-weight: 800; }
.mascot-panel .chip-row { gap: 8px; }
.mascot-panel .choice-chip {
  min-height: 48px; min-width: 72px; padding: 9px 13px;
}
.mascot-panel .choice-chip.is-on {
  background: var(--purple); border-color: var(--ink); color: var(--cream);
  box-shadow: 0 3px 0 rgba(23, 18, 28, .86);
}

.mascot-panel .swatch-row { gap: 10px; }
.swatch {
  position: relative; width: 48px; height: 48px; flex: none; border-radius: 50%;
  border: 2px solid rgba(23, 18, 28, .25);
  background: var(--sw, #000); cursor: pointer;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.swatch::after {
  content: ""; position: absolute; left: 16px; top: 13px; width: 12px; height: 7px;
  border-left: 3px solid #fff; border-bottom: 3px solid #fff;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .75));
  opacity: 0; transform: rotate(-45deg) scale(.65); transition: opacity .16s, transform .16s;
}
.swatch:hover { transform: translateY(-2px) scale(1.06); border-color: var(--purple); }
.swatch:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.swatch.is-on {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px var(--cream), 0 0 0 5px var(--purple);
}
.swatch.is-on::after { opacity: 1; transform: rotate(-45deg) scale(1); }
.palette-default {
  background:
    conic-gradient(from 45deg, var(--cream) 0 25%, var(--purple) 25% 50%, var(--gold) 50% 75%, var(--ink) 75%);
}
.outfit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.outfit-choice {
  min-height: 64px; display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border: 2px solid rgba(23, 18, 28, .16); border-radius: 13px;
  background: rgba(253, 251, 247, .75); color: var(--ink); text-align: left; cursor: pointer;
}
.outfit-choice.is-on {
  border-color: var(--ink); background: rgba(158, 51, 202, .1);
  box-shadow: 0 4px 0 rgba(23, 18, 28, .88);
}
.outfit-choice b { font: 800 11px/1.2 'Unbounded', sans-serif; }
.outfit-colors {
  width: 38px; height: 38px; flex: none; border: 2px solid var(--ink); border-radius: 10px;
  background: linear-gradient(135deg, var(--c1) 0 33%, var(--c2) 33% 66%, var(--c3) 66%);
}
.mascot-range {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 12px; border-radius: 999px;
  background: rgba(23, 18, 28, .14); outline: none;
  touch-action: none; cursor: pointer;
}
.mascot-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--purple); border: 3px solid var(--ink); cursor: pointer;
  box-shadow: 2px 2px 0 rgba(23, 18, 28, .25);
}
.mascot-range::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--purple); border: 3px solid var(--ink); cursor: pointer;
  box-shadow: 2px 2px 0 rgba(23, 18, 28, .25);
}
.mascot-range:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }
.mascot-panel output { color: var(--purple); letter-spacing: .1em; }
.shape-control { padding: 12px 0 18px; }
.range-labels {
  display: flex; justify-content: space-between; gap: 8px;
  margin-top: 12px; color: rgba(23, 18, 28, .48); font-size: 7px; letter-spacing: .08em;
}
.mascot-editor-footer {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 13px 30px calc(16px + env(safe-area-inset-bottom));
  border-top: 2px solid rgba(23, 18, 28, .1); background: var(--cream);
  box-shadow: 0 -12px 24px rgba(23, 18, 28, .08);
}
.mascot-utility-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 10px; }
.mascot-text-btn {
  min-height: 44px; padding: 6px 0; border: 0; background: none;
  color: rgba(23, 18, 28, .62); font: 800 8px/1.2 'Unbounded', sans-serif;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.mascot-text-btn.random { color: var(--purple); }
.mascot-editor-footer .pill-btn { min-width: 132px; min-height: 48px; padding: 12px 18px; }

#mascot-preview-zone {
  position: fixed; z-index: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end; gap: 8px;
  min-width: 120px; min-height: 120px; padding: 8px;
  color: var(--cream); pointer-events: auto; cursor: ew-resize;
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.mascot-preview-hint {
  padding: 5px 8px; border-radius: 999px; background: rgba(10, 6, 18, .5);
  color: rgba(253, 251, 247, .72); font-size: 7px; letter-spacing: .12em;
  pointer-events: none;
}
html.mascot-editor-open #keys-hint,
html.mascot-editor-open #drag-hint,
html.mascot-editor-open #zoom-controls,
html.mascot-editor-open #mobile-controls,
html.mascot-editor-open #loop-pedal,
html.mascot-editor-open #vocal-pad,
html.mascot-editor-open #chord-pad,
html.mascot-editor-open #chip,
html.mascot-editor-open #toast {
  opacity: 0 !important; pointer-events: none !important;
}

#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 ============ */
/* Keyboard / drag legends are desktop-only — hide on phones and tablets. */
@media (max-width: 720px), (hover: none) and (pointer: coarse) {
  #keys-hint, #drag-hint { display: none !important; }
}
@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; }
  #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); padding: 7px;
  }
  #vocal-pad button { width: clamp(42px, 12vw, 50px); height: clamp(42px, 12vw, 50px); font-size: 8px; }
  .guitar-chord-buttons { gap: 5px; }
  #chord-pad [data-chord] { 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 { min-height: 46px; padding: 10px 6px; font-size: 10px; }
  .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)); }
  html.pads-open #toast,
  #toast[data-kind="vibe-max"] {
    top: calc(72px + env(safe-area-inset-top));
    bottom: auto !important;
    max-width: calc(100vw - 32px);
  }
  #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; }
  #enter-btn {
    grid-template-columns: minmax(0, 1fr) 42px; gap: 10px;
    width: min(350px, calc(100vw - 32px)); min-height: 68px;
    padding: 8px 10px 8px 52px;
  }
  #enter-btn::after { width: 42px; height: 42px; font-size: 21px; }
}

@media (max-width: 390px) {
  #move-zone { width: 156px; height: 156px; }
  #move-stick { width: 114px; height: 114px; }
  #move-thumb { width: 46px; height: 46px; }
  #mobile-play { width: 70px; height: 70px; font-size: 9px; }
  #mobile-exit { width: 74px; height: 74px; font-size: 31px; }
  #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; }
}

/* Mascot editor uses the measured open canvas as its preview, then the camera
   fits the selected head/body bounds into that rectangle. */
@media (max-width: 900px) {
  #modal-mascot {
    align-items: flex-end; justify-content: center;
    padding: 0 max(8px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(8px, env(safe-area-inset-left));
  }
  #modal-mascot .mascot-panel {
    width: 100%; height: clamp(318px, 56dvh, 540px); max-height: 62dvh;
    border-radius: 20px 20px 0 0;
  }
  .mascot-editor-head { padding: 18px 16px 0; }
  .mascot-editor-head .panel-meta { margin-bottom: 5px; font-size: 7px; }
  .mascot-panel .panel-title { margin-bottom: 10px; font-size: 25px; }
  .mascot-panel .close-btn { top: 13px; right: 13px; }
  .mascot-tabs { padding-right: 50px; padding-bottom: 9px; }
  .mascot-tabs button { min-height: 44px; font-size: 8px; }
  .mascot-editor-scroll { padding: 13px 16px 18px; }
  .mascot-category { gap: 15px; }
  .mascot-panel .choice-chip { min-width: 68px; }
  .mascot-editor-footer {
    grid-template-columns: minmax(0, 1fr) auto; padding: 9px 16px calc(10px + env(safe-area-inset-bottom));
  }
  .mascot-utility-actions { gap: 0 8px; }
  .mascot-text-btn { min-height: 38px; font-size: 7px; }
  .mascot-editor-footer .pill-btn { min-width: 116px; min-height: 46px; padding: 10px 14px; }
  .mascot-preview-hint { display: none; }
}

@media (max-width: 900px) and (orientation: landscape), (max-height: 560px) and (min-aspect-ratio: 1/1) {
  .intro-top { padding: 10px 16px; }
  .tag { font-size: 8px; padding: 4px 8px; }
  .intro-center { gap: 6px; }
  .intro-kicker { font-size: 8px; letter-spacing: .34em; }
  .intro-logo { font-size: clamp(58px, 11vw, 94px); line-height: .9; }
  .intro-studio { font-size: 12px; letter-spacing: .8em; text-indent: .8em; }
  .intro-slogan { margin-top: 4px; font-size: 9px; }
  #enter-btn {
    grid-template-columns: minmax(0, 1fr) 38px; gap: 10px;
    width: min(360px, calc(100vw - 32px)); min-height: 58px;
    margin-top: 10px; padding: 7px 9px 7px 48px; font-size: 11px;
  }
  #enter-btn::after { width: 38px; height: 38px; font-size: 19px; }
  .ticker { padding: 6px 0; margin-bottom: 6px; }

  #modal-mascot {
    align-items: center; justify-content: flex-end;
    padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) 8px;
  }
  #modal-mascot .mascot-panel {
    width: min(440px, 52vw); height: 100%; max-height: none;
    border-radius: 18px;
  }
  .mascot-editor-head { padding-top: 14px; }
  .mascot-panel .panel-title { font-size: 22px; }
  .mascot-tabs button { min-height: 40px; }
  .mascot-editor-footer { padding-bottom: 9px; }
}

@media (max-width: 390px) {
  .mascot-editor-head { padding-left: 13px; padding-right: 13px; }
  .mascot-editor-scroll { padding-left: 13px; padding-right: 13px; }
  .mascot-tabs { gap: 4px; }
  .mascot-tabs button { padding: 7px 3px; font-size: 7px; }
  .mascot-panel .choice-chip { min-width: 64px; padding-left: 10px; padding-right: 10px; }
  .mascot-panel .swatch-row { gap: 8px; }
  .swatch { width: 44px; height: 44px; }
  .mascot-editor-footer { padding-left: 13px; padding-right: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .ticker-track, .intro-bg, #enter-btn.ready, #enter-btn:disabled::after, .loop-led, #loop-pedal.unlocking,
  .price-board.flash, .price-board.is-tick .board-amount,
  .logo-chip.dancing .logo-av, .quality-confirm-loader span { animation: none; }
  .inst-btn, .choice-chip, .swatch { transition: none; }
}
