/* BEATBOX 24 — deep black, neon, hardware feel. */
@font-face { font-family: 'Assistant'; src: url('fonts/Assistant.ttf') format('truetype'); font-weight: 200 800; font-display: swap; }

:root {
  --bg: #050508;
  --bg2: #0a0a10;
  --panel: rgba(18, 18, 28, .78);
  --panel-solid: #12121b;
  --line: rgba(255, 255, 255, .08);
  --line2: rgba(255, 255, 255, .14);
  --text: #f4f6ff;
  --muted: #9aa0b8;
  --dim: #636884;
  --cyan: #00f5d4;
  --orange: #ff8a1f;
  --pink: #ff3fa4;
  --blue: #2f8bff;
  --green: #3dff7a;
  --purple: #9d4dff;
  --red: #ff3b5c;
  --accent: #22e3d6;
  --accent-rgb: 34, 227, 214;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --gap: 7px;
  --display: 'Assistant', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--display); overflow: hidden;
  overscroll-behavior: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-user-select: none; user-select: none; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

#app { position: fixed; inset: 0; overflow: hidden;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(var(--accent-rgb), .16), transparent 60%),
    radial-gradient(60% 40% at 0% 100%, rgba(255, 63, 164, .10), transparent 70%),
    radial-gradient(60% 40% at 100% 90%, rgba(47, 139, 255, .10), transparent 70%),
    var(--bg);
  transition: background .6s; }
#app::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .35;
  background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 28px 28px; mask-image: linear-gradient(to bottom, #000, transparent 75%); -webkit-mask-image: linear-gradient(to bottom, #000, transparent 75%); }

/* ============================== splash ============================== */
.splash { position: absolute; inset: 0; z-index: 50; display: grid; place-items: center; background: #030305; overflow: hidden; transition: opacity .5s, visibility .5s; }
.splash.gone { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-glow { position: absolute; inset: -20%; background:
  radial-gradient(35% 30% at 30% 35%, rgba(0, 245, 212, .22), transparent 70%),
  radial-gradient(35% 30% at 70% 40%, rgba(255, 63, 164, .2), transparent 70%),
  radial-gradient(40% 30% at 50% 75%, rgba(157, 77, 255, .18), transparent 70%);
  animation: drift 9s ease-in-out infinite alternate; filter: blur(10px); }
@keyframes drift { to { transform: translate3d(3%, -2%, 0) scale(1.08); } }
.splash-grid { position: absolute; left: -50%; right: -50%; bottom: -10%; height: 55%; transform: perspective(500px) rotateX(62deg); transform-origin: bottom;
  background-image: linear-gradient(rgba(0,245,212,.35) 1px, transparent 1px), linear-gradient(90deg, rgba(255,63,164,.3) 1px, transparent 1px);
  background-size: 48px 48px; animation: grid 2.4s linear infinite; mask-image: linear-gradient(to top, #000 10%, transparent 90%); -webkit-mask-image: linear-gradient(to top, #000 10%, transparent 90%); opacity: .55; }
@keyframes grid { to { background-position: 0 48px, 0 0; } }
.splash-inner { position: relative; text-align: center; padding: 24px; display: flex; flex-direction: column; align-items: center; }
.logo-pads { display: grid; grid-template-columns: repeat(3, 26px); gap: 7px; margin-bottom: 22px; }
.logo-pads i { width: 26px; height: 26px; border-radius: 7px; background: var(--c); box-shadow: 0 0 18px var(--c), inset 0 -3px 0 rgba(0,0,0,.35);
  animation: padpulse 1.6s ease-in-out infinite; opacity: .35; }
.logo-pads i:nth-child(1) { --c: #00f5d4; animation-delay: 0s; } .logo-pads i:nth-child(2) { --c: #2f8bff; animation-delay: .2s; } .logo-pads i:nth-child(3) { --c: #9d4dff; animation-delay: .4s; }
.logo-pads i:nth-child(4) { --c: #ff3fa4; animation-delay: .6s; } .logo-pads i:nth-child(5) { --c: #ffd23f; animation-delay: .1s; } .logo-pads i:nth-child(6) { --c: #ff7a1a; animation-delay: .8s; }
.logo-pads i:nth-child(7) { --c: #3dff7a; animation-delay: .3s; } .logo-pads i:nth-child(8) { --c: #18d6ff; animation-delay: .5s; } .logo-pads i:nth-child(9) { --c: #ff4d3a; animation-delay: .7s; }
@keyframes padpulse { 0%, 100% { opacity: .3; transform: scale(.92); } 40% { opacity: 1; transform: scale(1); } }
.logo-word { margin: 0; font-size: clamp(46px, 13vw, 84px); line-height: .9; font-weight: 800; letter-spacing: -.02em; display: flex; align-items: baseline; gap: .1em; }
.logo-word span { background: linear-gradient(180deg, #fff 30%, #a9b3d6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo-word b { background: linear-gradient(135deg, #00f5d4, #ff3fa4 60%, #ffd23f); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 18px rgba(255,63,164,.5)); }
.splash-tag { margin: 12px 0 18px; color: var(--muted); font-size: 17px; font-weight: 600; letter-spacing: .02em; }
.eq { display: flex; gap: 5px; height: 38px; align-items: flex-end; margin-bottom: 38px; }
.eq i { width: 6px; border-radius: 3px; background: linear-gradient(to top, #00f5d4, #ff3fa4); animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(odd) { animation-duration: .8s; } .eq i:nth-child(3n) { animation-duration: 1.25s; } .eq i:nth-child(4n) { animation-duration: .65s; }
.eq i:nth-child(2) { animation-delay: -.2s; } .eq i:nth-child(5) { animation-delay: -.5s; } .eq i:nth-child(7) { animation-delay: -.35s; } .eq i:nth-child(9) { animation-delay: -.7s; } .eq i:nth-child(11) { animation-delay: -.1s; }
@keyframes eq { 0%, 100% { height: 18%; } 50% { height: 100%; } }
.start-btn { position: relative; width: 190px; height: 190px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 35%, #1d1d2b, #09090f 70%); box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 20px 60px rgba(0,0,0,.6), inset 0 2px 0 rgba(255,255,255,.08);
  transition: transform .15s; }
.start-btn:active { transform: scale(.95); }
.start-ring { position: absolute; inset: -6px; border-radius: 50%; padding: 3px;
  background: conic-gradient(from 0deg, #00f5d4, #2f8bff, #9d4dff, #ff3fa4, #ff7a1a, #ffd23f, #3dff7a, #00f5d4);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spin 3s linear infinite; filter: drop-shadow(0 0 12px rgba(255,63,164,.6)); }
@keyframes spin { to { transform: rotate(360deg); } }
.start-label { font-weight: 800; font-size: 19px; letter-spacing: .14em; animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .45; } }
.splash-load { width: min(280px, 80vw); margin-top: 28px; display: flex; flex-direction: column; gap: 10px; color: var(--muted); font-size: 14px; }
.splash-load .bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; }
.splash-load .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #00f5d4, #ff3fa4); transition: width .15s; }
.splash-err { color: #ff8a9c; max-width: 320px; line-height: 1.5; }

/* ============================== studio layout ============================== */
.studio { position: absolute; inset: 0; display: flex; flex-direction: column; padding: calc(var(--safe-t) + 8px) 10px calc(var(--safe-b) + 8px); gap: 8px; }
.top { display: flex; align-items: center; gap: 8px; height: 50px; flex: none; }
.icon-btn { width: 44px; height: 44px; flex: none; border-radius: 13px; display: grid; place-items: center; font-size: 22px; color: var(--text);
  background: rgba(255,255,255,.04); box-shadow: inset 0 0 0 1px var(--line); transition: transform .1s, background .2s; }
.icon-btn:active { transform: scale(.92); background: rgba(255,255,255,.1); }
.brand { position: relative; flex: 1; height: 44px; border-radius: 13px; overflow: hidden; display: grid; place-items: center; min-width: 0;
  background: rgba(255,255,255,.02); box-shadow: inset 0 0 0 1px var(--line); }
.viz { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .8; }
.brand-word { position: relative; font-weight: 800; font-size: 19px; letter-spacing: .06em; white-space: nowrap; text-shadow: 0 0 14px rgba(0,0,0,.9); }
.brand-word b { margin-inline-start: 3px; background: linear-gradient(135deg, #00f5d4, #ff3fa4); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mode-btn { height: 44px; flex: none; min-width: 118px; padding: 0 14px; border-radius: 13px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; line-height: 1.05;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), .3), rgba(var(--accent-rgb), .08)); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .6), 0 0 18px rgba(var(--accent-rgb), .25);
  transition: transform .1s, box-shadow .3s; }
.mode-btn:active { transform: scale(.95); }
.mode-k { font-size: 10px; font-weight: 800; letter-spacing: .2em; color: rgba(var(--accent-rgb), 1); }
.mode-v { font-size: 15px; font-weight: 800; letter-spacing: .03em; white-space: nowrap; }

.strip { height: 34px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 4px; }
.bpm-chip { display: flex; align-items: baseline; gap: 4px; min-width: 76px; }
.bpm-chip b { font-size: 21px; font-weight: 800; font-variant-numeric: tabular-nums; }
.bpm-chip span { font-size: 10px; font-weight: 800; letter-spacing: .15em; color: var(--muted); }
.bpm-chip em { font-style: normal; font-size: 11px; font-weight: 800; color: #000; background: var(--orange); border-radius: 5px; padding: 1px 5px; }
.steps { flex: 1; display: grid; grid-template-columns: repeat(16, 1fr); gap: 3px; min-width: 0; }
.steps i { height: 8px; border-radius: 3px; background: rgba(255,255,255,.09); transition: background .05s; }
.steps i:nth-child(4n+1) { background: rgba(255,255,255,.17); }
.steps i.now { background: rgba(var(--accent-rgb), 1); box-shadow: 0 0 10px rgba(var(--accent-rgb), .9); }
.flags { display: flex; gap: 4px; }
.flag { font-size: 10px; font-weight: 800; letter-spacing: .1em; padding: 3px 6px; border-radius: 6px; white-space: nowrap; }
.flag.rec { background: var(--red); color: #fff; animation: blink 1s steps(2) infinite; }
.flag.dub { background: var(--orange); color: #000; }
.flag.auto { background: rgba(157, 77, 255, .25); color: #d7c2ff; box-shadow: inset 0 0 0 1px rgba(157,77,255,.6); }
.flag.mute { background: #fff; color: #000; }

/* ============================== the 24 pads ============================== */
.pad-area { position: relative; flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; }
.pads { width: 100%; height: 100%; max-height: min(100%, calc((100vw - 20px) / 6 * 4 * 1.8)); display: grid; grid-template-columns: repeat(6, 1fr); grid-template-rows: repeat(4, 1fr); gap: var(--gap); }
.pad { position: relative; border-radius: 14px; min-height: 0; overflow: hidden; touch-action: none; isolation: isolate;
  background: linear-gradient(165deg, var(--c-top) 0%, var(--c-low) 62%, #07070b 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), inset 0 -5px 0 rgba(0,0,0,.5), inset 0 0 0 1px var(--c-edge), 0 6px 14px rgba(0,0,0,.55);
  transform: translateZ(0); transition: transform .07s ease-out, filter .2s, opacity .25s; }
.pad::before { content: ''; position: absolute; inset: 3px 3px 40% 3px; border-radius: 11px 11px 40% 40%; background: linear-gradient(180deg, rgba(255,255,255,.16), transparent); pointer-events: none; }
.pad::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at 50% 45%, #fff 0%, var(--c) 38%, var(--c-low) 100%);
  box-shadow: inset 0 0 26px rgba(255,255,255,.55); transition: opacity .22s ease-out; z-index: -0; }
.pad.hit { transform: scale(.94) translateY(1px); }
.pad.hit::after { opacity: 1; transition: none; }
.pad .glow { position: absolute; inset: -40%; border-radius: 50%; background: radial-gradient(circle, var(--c-glow), transparent 60%); opacity: 0; pointer-events: none; transition: opacity .3s; }
.pad.hit .glow { opacity: 1; transition: none; }
.pad .lbl { position: absolute; left: 0; right: 0; bottom: 6px; text-align: center; font-size: clamp(8px, 2.3vw, 11px); font-weight: 800; letter-spacing: .06em; color: rgba(255,255,255,.78);
  text-shadow: 0 1px 2px rgba(0,0,0,.8); pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 3px; z-index: 2; }
.pad .kb { position: absolute; top: 5px; left: 7px; font-size: 9px; font-weight: 700; color: rgba(255,255,255,.4); pointer-events: none; font-family: var(--mono); z-index: 2; }
.pad .led { position: absolute; top: 7px; right: 7px; width: 6px; height: 6px; border-radius: 50%; background: rgba(0,0,0,.45); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); z-index: 2; transition: background .2s, box-shadow .2s; }
.pad.hit .led, .pad.lit .led { background: #fff; box-shadow: 0 0 8px var(--c), 0 0 2px #fff; transition: none; }
.pad .ripple { position: absolute; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; pointer-events: none; z-index: 1;
  background: radial-gradient(circle, rgba(255,255,255,.85), rgba(255,255,255,0) 70%); animation: ripple .45s ease-out forwards; }
@keyframes ripple { from { transform: scale(.4); opacity: .9; } to { transform: scale(7); opacity: 0; } }
.no-labels .pad .lbl, .no-labels .pad .kb { display: none; }
.no-kb .pad .kb { display: none; }
.pad.lit::after { opacity: .75; transition: none; }

/* pads in a challenge */
.pads.game .pad.off { opacity: .14; filter: saturate(.3); pointer-events: none; }
.pads.game .pad.target::after { opacity: .95; transition: opacity .1s; }
.pads.game .pad.target { animation: targetPulse .5s ease-in-out infinite alternate; }
@keyframes targetPulse { to { filter: brightness(1.25); } }
.pads.game .pad.good::after { opacity: 1; background: radial-gradient(circle, #fff, #3dff7a 60%); transition: none; }
.pads.game .pad.bad { animation: shake .3s; }
.pads.game .pad.bad::after { opacity: 1; background: radial-gradient(circle, #fff, #ff3b5c 60%); transition: none; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.pad .ring { position: absolute; inset: -55%; border-radius: 22px; border: 3px solid #fff; pointer-events: none; z-index: 3; opacity: 0; box-shadow: 0 0 12px var(--c); }
.pad .ring.go { animation: approach var(--lead, 1000ms) linear forwards; }
@keyframes approach { 0% { inset: -55%; opacity: 0; } 15% { opacity: .9; } 100% { inset: 2px; opacity: 1; border-color: var(--c); } }
.judge { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); font-weight: 800; font-size: 13px; letter-spacing: .08em; z-index: 4; pointer-events: none;
  animation: judge .6s ease-out forwards; text-shadow: 0 0 10px currentColor; white-space: nowrap; }
@keyframes judge { from { opacity: 1; transform: translate(-50%, -30%) scale(.8); } to { opacity: 0; transform: translate(-50%, -140%) scale(1.15); } }

.game-banner { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 5; }
.game-banner b { font-size: clamp(34px, 11vw, 64px); font-weight: 800; letter-spacing: .04em; text-align: center; line-height: 1;
  background: linear-gradient(135deg, #fff, rgba(var(--accent-rgb), 1)); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 22px rgba(var(--accent-rgb), .7)) drop-shadow(0 4px 20px rgba(0,0,0,.9)); animation: pop .5s cubic-bezier(.2,1.4,.4,1); }
.game-banner small { display: block; font-size: 15px; font-weight: 700; margin-top: 8px; color: #fff; -webkit-text-fill-color: #fff; letter-spacing: .02em; }
@keyframes pop { from { transform: scale(.5); opacity: 0; } }

.hud { height: 46px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 2px; }
.hud-quit { width: 38px; height: 38px; border-radius: 11px; background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 1px var(--line2); font-size: 16px; }
.hud-cell { display: flex; flex-direction: column; align-items: center; min-width: 64px; line-height: 1; }
.hud-cell span { font-size: 9px; font-weight: 800; letter-spacing: .18em; color: var(--muted); }
.hud-cell b { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; margin-top: 3px; }
.hud-msg { flex: 1; text-align: center; display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.hud-msg b { font-size: 16px; font-weight: 800; letter-spacing: .08em; color: rgba(var(--accent-rgb), 1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-msg span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.in-game .strip, .in-game .tabs, .in-game .panels { display: none; }
.in-game .pad-area { flex: 1; }

/* ============================== tabs and panels ============================== */
.tabs { flex: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 4px; border-radius: 15px; background: rgba(255,255,255,.035); box-shadow: inset 0 0 0 1px var(--line); }
.tab { height: 36px; border-radius: 11px; font-weight: 800; font-size: 13px; letter-spacing: .14em; color: var(--muted); transition: background .2s, color .2s; }
.tab.on { color: #000; background: linear-gradient(135deg, rgba(var(--accent-rgb), 1), rgba(var(--accent-rgb), .75)); box-shadow: 0 0 16px rgba(var(--accent-rgb), .45); }
.panels { flex: none; position: relative; min-height: 172px; }
.panel { display: none; flex-direction: column; gap: 9px; padding: 11px; border-radius: 18px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line), 0 10px 30px rgba(0,0,0,.4);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); min-height: 172px; }
.panel.on { display: flex; animation: panelIn .22s ease-out; }
@keyframes panelIn { from { opacity: 0; transform: translateY(6px); } }
.row { display: flex; gap: 8px; align-items: stretch; }

.key { flex: 1; min-height: 46px; border-radius: 13px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-weight: 800; font-size: 11px; letter-spacing: .1em; color: #dfe3f5;
  background: linear-gradient(180deg, #23232f, #15151d); box-shadow: inset 0 1px 0 rgba(255,255,255,.1), inset 0 -3px 0 rgba(0,0,0,.45), 0 0 0 1px rgba(0,0,0,.6), 0 4px 10px rgba(0,0,0,.35);
  transition: transform .08s, box-shadow .2s, color .2s, background .2s; }
.key svg { font-size: 18px; }
.key:active { transform: translateY(1px) scale(.97); box-shadow: inset 0 1px 0 rgba(255,255,255,.06), inset 0 -1px 0 rgba(0,0,0,.45), 0 0 0 1px rgba(0,0,0,.6); }
.key.sq { flex: 0 0 52px; font-size: 26px; font-weight: 600; }
.key.tap { flex: 0 0 78px; font-size: 14px; line-height: 1.05; }
.key.tap small { font-size: 9px; letter-spacing: .2em; color: var(--muted); }
.key.tap.flash { color: #000; background: linear-gradient(180deg, #ffd23f, #ff9a1f); box-shadow: 0 0 18px rgba(255,210,63,.7); }
.key.small { flex: 0 0 auto; padding: 0 14px; flex-direction: row; gap: 6px; min-height: 40px; }
.key.on, .key.toggle.on { color: #000; background: linear-gradient(180deg, rgba(var(--accent-rgb), 1), rgba(var(--accent-rgb), .7)); box-shadow: 0 0 18px rgba(var(--accent-rgb), .55), inset 0 -3px 0 rgba(0,0,0,.25); }
.key.go.on { background: linear-gradient(180deg, #3dff7a, #14c957); box-shadow: 0 0 18px rgba(61,255,122,.55), inset 0 -3px 0 rgba(0,0,0,.25); color: #000; }
.key.paused { color: #000; background: linear-gradient(180deg, #ffd23f, #ffa41f); box-shadow: 0 0 16px rgba(255,210,63,.5); }
.key.rec .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--red); box-shadow: 0 0 10px var(--red); }
.key.rec.on { background: linear-gradient(180deg, #ff5c76, #d81b3d); color: #fff; box-shadow: 0 0 22px rgba(255,59,92,.7); animation: recpulse 1s ease-in-out infinite; }
.key.rec.on .dot { background: #fff; box-shadow: 0 0 8px #fff; border-radius: 3px; }
@keyframes recpulse { 50% { box-shadow: 0 0 6px rgba(255,59,92,.4); } }
.key.armed { color: #000; background: linear-gradient(180deg, #ff9a6b, #ff5c3a); }
.key.big { flex-direction: row; gap: 10px; font-size: 14px; }
.key.big svg { font-size: 22px; }

.bpm-row .bpm-big { flex: 1; display: flex; align-items: baseline; justify-content: center; gap: 6px; border-radius: 13px; background: rgba(0,0,0,.35); box-shadow: inset 0 0 0 1px var(--line); }
.bpm-big b { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 46px; text-shadow: 0 0 14px rgba(var(--accent-rgb), .6); }
.bpm-big span { font-size: 11px; font-weight: 800; letter-spacing: .2em; color: var(--muted); }

.slider { direction: ltr; -webkit-appearance: none; appearance: none; width: 100%; height: 30px; background: transparent; margin: 0; touch-action: pan-y; }
.slider::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, rgba(var(--accent-rgb), 1) 0, rgba(var(--accent-rgb), 1) var(--p, 50%), rgba(255,255,255,.1) var(--p, 50%)); }
.slider::-moz-range-track { height: 6px; border-radius: 3px; background: rgba(255,255,255,.1); }
.slider::-moz-range-progress { height: 6px; border-radius: 3px; background: rgba(var(--accent-rgb), 1); }
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -10px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #fff, #c9cde0); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .3), 0 3px 8px rgba(0,0,0,.6); }
.slider::-moz-range-thumb { width: 24px; height: 24px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .3); }

.seg { display: flex; align-items: center; gap: 3px; padding: 3px; border-radius: 12px; background: rgba(0,0,0,.35); box-shadow: inset 0 0 0 1px var(--line); flex: 1; min-width: 0; }
.seg-k { font-size: 9px; font-weight: 800; letter-spacing: .16em; color: var(--muted); padding: 0 6px; }
.seg button { flex: 1; height: 34px; border-radius: 9px; font-size: 12px; font-weight: 800; color: var(--muted); min-width: 0; }
.seg button.on { color: #000; background: rgba(var(--accent-rgb), 1); }

.layers { display: flex; gap: 7px; overflow-x: auto; overflow-y: hidden; padding: 2px 1px 4px; min-height: 52px; scrollbar-width: none; }
.layers::-webkit-scrollbar { display: none; }
.layers-empty { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.45; direction: rtl; text-align: right; align-self: center; }
.layer { flex: none; display: flex; align-items: center; gap: 2px; height: 46px; border-radius: 12px; padding: 0 4px 0 2px; background: rgba(255,255,255,.04);
  box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .2s, opacity .2s; }
.layer.sel { box-shadow: inset 0 0 0 2px var(--lc); }
.layer.sel { box-shadow: inset 0 0 0 2px var(--lc), 0 0 14px color-mix(in srgb, var(--lc) 40%, transparent); }
.layer.off { opacity: .45; }
.layer .lon { width: 34px; height: 40px; display: grid; place-items: center; }
.layer .lon i { width: 14px; height: 14px; border-radius: 4px; background: var(--lc); box-shadow: 0 0 10px var(--lc); }
.layer.off .lon i { background: transparent; box-shadow: inset 0 0 0 2px var(--lc); }
.layer .lname { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; padding: 0 4px; height: 40px; justify-content: center; }
.layer .lname b { font-size: 11px; font-weight: 800; letter-spacing: .06em; }
.layer .lname span { font-size: 10px; color: var(--muted); }
.layer .ldel { width: 30px; height: 40px; color: var(--dim); font-size: 14px; }
.layer .lprog { width: 34px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.1); overflow: hidden; margin-top: 3px; }
.layer .lprog i { display: block; height: 100%; width: 0; background: var(--lc); }

.fx-grid { display: grid; grid-template-columns: repeat(5, 1fr); grid-template-rows: repeat(2, 1fr); gap: 7px; flex: 1; }
.fx { border-radius: 13px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 66px;
  font-size: 10px; font-weight: 800; letter-spacing: .06em; line-height: 1.1; text-align: center; color: #cfd3e6;
  background: linear-gradient(180deg, #21212c, #14141b); box-shadow: inset 0 1px 0 rgba(255,255,255,.1), inset 0 -3px 0 rgba(0,0,0,.45), 0 0 0 1px rgba(0,0,0,.6); transition: transform .08s, box-shadow .2s, background .2s, color .2s; }
.fx i { font-style: normal; font-size: 17px; line-height: 1; }
.fx:active { transform: scale(.95); }
.fx.on { color: #000; background: var(--fxc, #00f5d4); background: linear-gradient(180deg, var(--fxc, #00f5d4), color-mix(in srgb, var(--fxc, #00f5d4) 70%, #000)); box-shadow: 0 0 20px var(--fxc, #00f5d4), inset 0 -3px 0 rgba(0,0,0,.25); }
.fx[data-fx="bass"] { --fxc: #ff7a1a; } .fx[data-fx="reverb"] { --fxc: #2f8bff; } .fx[data-fx="echo"] { --fxc: #18d6ff; } .fx[data-fx="dist"] { --fxc: #ff3b5c; }
.fx[data-fx="filter"] { --fxc: #9d4dff; } .fx[data-fx="slow"] { --fxc: #3dff7a; } .fx[data-fx="fast"] { --fxc: #ffd23f; } .fx[data-fx="mute"] { --fxc: #ffffff; }
.fx.act { color: #fff; }
.fx.act.flash { background: linear-gradient(180deg, #ff6be0, #c9238c); box-shadow: 0 0 22px #ff3fa4; }
.fx.drop { background: linear-gradient(180deg, #2a1622, #170c13); box-shadow: inset 0 0 0 1px rgba(255,63,164,.45), inset 0 -3px 0 rgba(0,0,0,.45); }
.fx.drop.building { animation: dropbuild .25s ease-in-out infinite alternate; color: #fff; }
@keyframes dropbuild { from { background: #3a1430; } to { background: #ff3fa4; box-shadow: 0 0 26px #ff3fa4; } }

.auto-top { align-items: center; }
.vol-mini { flex: 0 0 38%; display: flex; flex-direction: column; gap: 0; }
.vol-mini span { font-size: 9px; font-weight: 800; letter-spacing: .18em; color: var(--muted); padding-left: 2px; }
.styles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; flex: 1; }
.style { border-radius: 13px; padding: 8px 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 48px;
  background: rgba(255,255,255,.04); box-shadow: inset 0 0 0 1px var(--line); transition: background .2s, box-shadow .2s, transform .08s; }
.style:active { transform: scale(.96); }
.style b { font-size: 12px; font-weight: 800; letter-spacing: .1em; }
.style span { font-size: 12px; color: var(--muted); font-weight: 600; }
.style.on { background: linear-gradient(135deg, rgba(157,77,255,.55), rgba(255,63,164,.35)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.3), 0 0 18px rgba(157,77,255,.45); }
.style.on span { color: #fff; }
.style.loading b::after { content: ' …'; }

/* ============================== drawer / sheets / modals ============================== */
.scrim { position: absolute; inset: 0; z-index: 20; background: rgba(0,0,0,.6); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.drawer { position: absolute; top: 0; bottom: 0; right: 0; width: min(330px, 86vw); z-index: 21; display: flex; flex-direction: column; gap: 14px;
  padding: calc(var(--safe-t) + 14px) 16px calc(var(--safe-b) + 16px); background: linear-gradient(180deg, #11111a, #08080d); box-shadow: -20px 0 60px rgba(0,0,0,.6), inset 1px 0 0 var(--line);
  animation: drawerIn .25s cubic-bezier(.2,.8,.2,1); overflow-y: auto; }
@keyframes drawerIn { from { transform: translateX(100%); } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; direction: ltr; }
.drawer-head .brand-word { font-size: 22px; }
.rank-card { border-radius: 16px; padding: 14px; background: linear-gradient(135deg, rgba(var(--accent-rgb), .18), rgba(255,63,164,.12)); box-shadow: inset 0 0 0 1px var(--line2); }
.rank-card .rk { display: flex; align-items: center; gap: 12px; }
.rank-badge { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; background: rgba(0,0,0,.4); box-shadow: inset 0 0 0 1px var(--line2), 0 0 16px rgba(var(--accent-rgb), .3); flex: none; }
.rank-card b { display: block; font-size: 17px; font-weight: 800; letter-spacing: .04em; }
.rank-card small { color: var(--muted); font-size: 13px; }
.xpbar { height: 6px; border-radius: 3px; background: rgba(0,0,0,.4); margin-top: 12px; overflow: hidden; }
.xpbar i { display: block; height: 100%; background: linear-gradient(90deg, #00f5d4, #ff3fa4); border-radius: 3px; }
.menu-list { display: flex; flex-direction: column; gap: 6px; }
.menu-list button { display: flex; align-items: center; gap: 12px; height: 54px; padding: 0 14px; border-radius: 14px; text-align: right; background: rgba(255,255,255,.035); box-shadow: inset 0 0 0 1px var(--line); transition: background .15s, transform .1s; }
.menu-list button:active { transform: scale(.98); background: rgba(255,255,255,.08); }
.menu-list i { font-style: normal; font-size: 19px; width: 24px; text-align: center; }
.menu-list span { flex: 1; font-size: 16px; font-weight: 700; }
.menu-list em { font-style: normal; font-size: 10px; font-weight: 800; letter-spacing: .14em; color: var(--dim); }
.drawer-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.link-btn { color: var(--muted); font-size: 14px; padding: 8px 2px; text-decoration: none; }
.ver { font-size: 11px; color: var(--dim); padding: 4px 2px; }

.sheet { position: absolute; inset: 0; z-index: 30; display: flex; flex-direction: column; background: radial-gradient(120% 50% at 50% 0%, rgba(var(--accent-rgb), .12), transparent 60%), #07070b;
  padding: calc(var(--safe-t) + 10px) 14px calc(var(--safe-b) + 14px); overflow-y: auto; animation: sheetIn .26s cubic-bezier(.2,.8,.2,1); }
@keyframes sheetIn { from { opacity: 0; transform: translateY(18px); } }
.sheet-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; position: sticky; top: calc(var(--safe-t) * -1 - 10px); }
.sheet-head h2 { margin: 0; flex: 1; font-size: 24px; font-weight: 800; }
.kicker { font-size: 10px; font-weight: 800; letter-spacing: .22em; color: rgba(var(--accent-rgb), 1); }

.mode-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.mode-card { position: relative; border-radius: 18px; padding: 16px 14px 14px; text-align: right; min-height: 128px; display: flex; flex-direction: column; gap: 4px; overflow: hidden;
  background: #13131c; box-shadow: inset 0 0 0 1px var(--line2);
  background: linear-gradient(160deg, color-mix(in srgb, var(--mc) 24%, #13131c), #0c0c12 70%); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mc) 35%, transparent), 0 8px 24px rgba(0,0,0,.4); transition: transform .1s, box-shadow .2s; }
.mode-card:active { transform: scale(.97); }
.mode-card.on { box-shadow: inset 0 0 0 2px var(--mc), 0 0 26px color-mix(in srgb, var(--mc) 45%, transparent); }
.mode-card .mi { font-size: 26px; color: var(--mc); text-shadow: 0 0 16px var(--mc); line-height: 1; margin-bottom: 6px; }
.mode-card b { font-size: 15px; font-weight: 800; letter-spacing: .06em; direction: ltr; text-align: right; }
.mode-card span { font-size: 15px; font-weight: 700; }
.mode-card small { font-size: 12px; color: var(--muted); line-height: 1.35; }
.mode-card .mdots { position: absolute; left: 12px; top: 14px; display: grid; grid-template-columns: repeat(6, 5px); gap: 3px; direction: ltr; opacity: .8; }
.mode-card .mdots i { width: 5px; height: 5px; border-radius: 1.5px; background: var(--mc); opacity: .5; }
.mode-card .mdots i:nth-child(3n+1) { opacity: 1; }
.mode-card .mcheck { position: absolute; left: 12px; bottom: 12px; font-size: 11px; font-weight: 800; color: #000; background: var(--mc); border-radius: 6px; padding: 2px 7px; direction: ltr; }

.game-list { display: flex; flex-direction: column; gap: 10px; }
.game-card { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 18px; text-align: right;
  background: #12121a; box-shadow: inset 0 0 0 1px var(--line2);
  background: linear-gradient(135deg, color-mix(in srgb, var(--gc) 20%, #12121a), #0c0c12); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gc) 35%, transparent); transition: transform .1s; }
.game-card:active { transform: scale(.98); }
.game-ico { width: 56px; height: 56px; flex: none; border-radius: 16px; display: grid; place-items: center; font-size: 26px; background: rgba(0,0,0,.45); color: var(--gc); text-shadow: 0 0 16px var(--gc); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gc) 45%, transparent); }
.game-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.game-txt b { font-size: 15px; font-weight: 800; letter-spacing: .05em; direction: ltr; text-align: right; }
.game-txt span { font-size: 14px; font-weight: 700; }
.game-txt small { font-size: 12px; color: var(--muted); line-height: 1.35; }
.game-best { text-align: center; min-width: 58px; }
.game-best small { display: block; font-size: 9px; font-weight: 800; letter-spacing: .16em; color: var(--muted); }
.game-best b { font-size: 19px; font-weight: 800; color: var(--gc); }

.rank-big { border-radius: 20px; padding: 18px; text-align: center; background: linear-gradient(135deg, rgba(var(--accent-rgb), .2), rgba(255,63,164,.14)); box-shadow: inset 0 0 0 1px var(--line2); margin-bottom: 12px; }
.rank-big .rank-badge { width: 64px; height: 64px; font-size: 32px; margin: 0 auto 10px; border-radius: 18px; }
.rank-big b { font-size: 22px; font-weight: 800; letter-spacing: .08em; display: block; direction: ltr; }
.rank-big small { color: var(--muted); }
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.stat { border-radius: 14px; padding: 10px 6px; text-align: center; background: rgba(255,255,255,.035); box-shadow: inset 0 0 0 1px var(--line); }
.stat b { display: block; font-size: 19px; font-weight: 800; direction: ltr; }
.stat span { font-size: 11px; color: var(--muted); }
.ach-list { display: grid; grid-template-columns: 1fr; gap: 8px; }
.ach { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 14px; background: rgba(255,255,255,.03); box-shadow: inset 0 0 0 1px var(--line); }
.ach i { width: 42px; height: 42px; flex: none; border-radius: 12px; display: grid; place-items: center; font-style: normal; font-size: 20px; background: rgba(0,0,0,.45); filter: grayscale(1); opacity: .45; }
.ach.got i { filter: none; opacity: 1; box-shadow: 0 0 14px rgba(255,210,63,.35), inset 0 0 0 1px rgba(255,210,63,.5); }
.ach div { flex: 1; min-width: 0; }
.ach b { display: block; font-size: 14px; font-weight: 800; }
.ach small { color: var(--muted); font-size: 12px; }
.ach.got b { color: #ffe27a; }
.ach em { font-style: normal; font-size: 11px; font-weight: 800; color: var(--dim); direction: ltr; }

.saved-list { display: flex; flex-direction: column; gap: 9px; }
.saved { border-radius: 16px; padding: 12px; background: rgba(255,255,255,.035); box-shadow: inset 0 0 0 1px var(--line); display: flex; flex-direction: column; gap: 10px; }
.saved-top { display: flex; align-items: center; gap: 12px; }
.saved-play { width: 48px; height: 48px; flex: none; border-radius: 14px; display: grid; place-items: center; font-size: 20px; color: #000; background: linear-gradient(135deg, #00f5d4, #18d6ff); box-shadow: 0 0 14px rgba(0,245,212,.4); }
.saved-txt { flex: 1; min-width: 0; }
.saved-txt b { display: block; font-size: 16px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.saved-txt small { color: var(--muted); font-size: 12px; }
.saved-acts { display: flex; gap: 6px; }
.saved-acts button { flex: 1; height: 36px; border-radius: 10px; font-size: 13px; font-weight: 700; background: rgba(255,255,255,.05); box-shadow: inset 0 0 0 1px var(--line); }
.saved-acts button.danger { color: #ff8a9c; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); line-height: 1.6; }
.empty b { display: block; font-size: 40px; margin-bottom: 8px; }

.settings { display: flex; flex-direction: column; gap: 8px; max-width: 640px; width: 100%; margin: 0 auto; }
.settings h3 { margin: 12px 2px 2px; font-size: 13px; font-weight: 800; color: rgba(var(--accent-rgb), 1); letter-spacing: .04em; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; min-height: 54px; border-radius: 14px; background: rgba(255,255,255,.035); box-shadow: inset 0 0 0 1px var(--line); }
.set-row > span { flex: 1; font-size: 15px; font-weight: 600; }
.set-row small { color: var(--muted); font-weight: 500; font-size: 12px; }
.set-row .slider { flex: 0 0 46%; }
.set-row output { min-width: 34px; text-align: center; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.set-row.col { flex-direction: column; align-items: stretch; gap: 8px; }
.set-row.col .slider { flex: none; }
.set-row .seg { flex: none; }
.switch { width: 50px; height: 30px; border-radius: 15px; background: rgba(255,255,255,.14); position: relative; flex: none; transition: background .2s; }
.switch::after { content: ''; position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.switch.on { background: rgba(var(--accent-rgb), 1); }
.switch.on::after { transform: translateX(-20px); }
.pill-btn { height: 40px; padding: 0 18px; border-radius: 12px; font-size: 14px; font-weight: 800; background: rgba(255,255,255,.08); box-shadow: inset 0 0 0 1px var(--line2); white-space: nowrap; transition: transform .1s; }
.pill-btn:active { transform: scale(.96); }
.pill-btn.primary { color: #000; background: linear-gradient(135deg, rgba(var(--accent-rgb), 1), rgba(var(--accent-rgb), .75)); box-shadow: 0 0 18px rgba(var(--accent-rgb), .4); }
.pill-btn.danger { color: #ff8a9c; box-shadow: inset 0 0 0 1px rgba(255,59,92,.4); }
.pill-btn.ghost { background: transparent; box-shadow: none; color: var(--muted); }
.settings-note { color: var(--dim); font-size: 13px; line-height: 1.6; padding: 6px 4px; }

.modal { position: absolute; inset: 0; z-index: 40; display: grid; place-items: center; padding: 20px; background: rgba(0,0,0,.65); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade .2s; }
.modal-card { width: min(380px, 100%); border-radius: 22px; padding: 22px 18px 16px; background: linear-gradient(180deg, #16161f, #0d0d13); box-shadow: inset 0 0 0 1px var(--line2), 0 30px 80px rgba(0,0,0,.7); text-align: center; animation: pop .3s cubic-bezier(.2,1.3,.4,1); }
.modal-card h3 { margin: 0 0 8px; font-size: 20px; font-weight: 800; }
.modal-card p { margin: 0 0 14px; color: var(--muted); line-height: 1.5; font-size: 15px; }
.text-in { width: 100%; height: 48px; border-radius: 12px; border: 0; padding: 0 14px; font: inherit; font-size: 17px; font-weight: 700; color: var(--text); background: rgba(0,0,0,.45); box-shadow: inset 0 0 0 1px var(--line2); margin-bottom: 14px; outline: none; -webkit-user-select: text; user-select: text; }
.text-in:focus { box-shadow: inset 0 0 0 2px rgba(var(--accent-rgb), 1); }
.modal-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.modal-actions .pill-btn { flex: 1; min-width: 90px; }
.results .res-stars { font-size: 34px; letter-spacing: 6px; margin: 8px 0 2px; color: #ffd23f; text-shadow: 0 0 16px rgba(255,210,63,.6); direction: ltr; }
.results .res-stars i { font-style: normal; color: rgba(255,255,255,.15); text-shadow: none; }
.res-score { display: block; font-size: 58px; font-weight: 800; line-height: 1.1; background: linear-gradient(135deg, #fff, rgba(var(--accent-rgb), 1)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.res-line { color: var(--text) !important; font-weight: 600; }
.res-best { color: #ffd23f !important; font-weight: 800; }

.loading { position: absolute; inset: 0; z-index: 45; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: rgba(5,5,8,.75); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); color: var(--muted); font-weight: 700; }
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 4px solid rgba(255,255,255,.1); border-top-color: rgba(var(--accent-rgb), 1); animation: spin .8s linear infinite; }

.toasts { position: absolute; top: calc(var(--safe-t) + 10px); left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(420px, 92vw); }
.toast { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 14px; background: rgba(20,20,30,.95); box-shadow: inset 0 0 0 1px var(--line2), 0 12px 30px rgba(0,0,0,.6);
  font-size: 14px; font-weight: 700; animation: toastIn .3s cubic-bezier(.2,1.3,.4,1); max-width: 100%; }
.toast.out { animation: toastOut .3s forwards; }
.toast.ach { background: linear-gradient(135deg, rgba(60,45,0,.96), rgba(30,22,0,.96)); box-shadow: inset 0 0 0 1px rgba(255,210,63,.55), 0 0 30px rgba(255,210,63,.25); }
.toast.ach i { font-style: normal; font-size: 22px; }
.toast.ach b { display: block; color: #ffe27a; font-size: 14px; }
.toast.ach small { color: #d8c88a; font-weight: 600; font-size: 12px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px) scale(.95); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-10px); } }

/* ============================== bigger screens ============================== */
@media (min-width: 720px) and (min-height: 560px) {
  .studio { padding-left: 18px; padding-right: 18px; }
  .pads { max-width: calc((100vh - 360px) * 1.6); max-height: none; }
  .pad { border-radius: 18px; }
  .pad .lbl { font-size: 12px; }
}
@media (orientation: landscape) and (min-width: 820px) {
  .studio { display: grid; grid-template-columns: 1fr minmax(320px, 380px); grid-template-rows: 50px 34px 1fr auto; gap: 10px 16px; }
  .top { grid-column: 1 / 3; }
  .strip, .hud { grid-column: 1; }
  .pad-area { grid-column: 1; grid-row: 3 / 5; }
  .tabs { grid-column: 2; grid-row: 2 / 3; align-self: stretch; padding: 3px; }
  .tab { height: 28px; }
  .panels { grid-column: 2; grid-row: 3 / 5; align-self: start; }
  .pads { max-width: calc((100vh - 120px) * 1.55); max-height: 100%; }
  .in-game .pad-area { grid-row: 3 / 5; }
}
@media (orientation: landscape) and (max-height: 500px) {
  /* a phone on its side: pads on the left, the panel on the right */
  .studio { display: grid; grid-template-columns: 1.35fr 1fr; grid-template-rows: 40px 1fr auto; gap: 6px 10px; padding: 6px calc(env(safe-area-inset-right, 0px) + 10px) 6px calc(env(safe-area-inset-left, 0px) + 10px); }
  .top { grid-column: 1 / 3; height: 40px; }
  .icon-btn, .brand, .mode-btn { height: 38px; }
  .strip { display: none; }
  .hud { grid-column: 1 / 3; grid-row: 1; height: 40px; }
  .in-game .top { display: none; }
  .pad-area { grid-column: 1; grid-row: 2 / 4; }
  .pads { max-height: 100%; --gap: 5px; }
  .tabs { grid-column: 2; grid-row: 2 / 3; align-self: start; }
  .tab { height: 28px; font-size: 11px; }
  .panels { grid-column: 2; grid-row: 2 / 4; margin-top: 44px; min-height: 0; }
  .panel { min-height: 0; padding: 8px; gap: 6px; }
  .key { min-height: 38px; }
  .fx { min-height: 48px; }
  .in-game .pad-area { grid-column: 1 / 3; }
  .pad .lbl { bottom: 3px; }
}
@media (max-height: 640px) and (orientation: portrait) {
  .top { height: 44px; } .icon-btn, .brand, .mode-btn { height: 40px; }
  .strip { height: 26px; }
  .panels, .panel { min-height: 150px; }
  .panel { padding: 8px; gap: 7px; }
  .key { min-height: 40px; }
  .fx { min-height: 54px; }
  .tab { height: 32px; }
  .bpm-big b { font-size: 28px; line-height: 40px; }
  .layers { min-height: 46px; }
}
@media (prefers-reduced-motion: reduce) {
  .splash-grid, .splash-glow, .start-ring { animation: none; }
}
