:root {
  --bg: #f5f5f7;
  --bg2: #e8e8ed;
  --fg: #1d1d1f;
  --fg2: #6e6e73;
  --bar: rgba(245, 245, 247, 0.72);
  --line: rgba(0, 0, 0, 0.08);
  --accent: #0a84ff;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0b0c;
    --bg2: #000;
    --fg: #f5f5f7;
    --fg2: #8e8e93;
    --bar: rgba(0, 0, 0, 0.6);
    --line: rgba(255, 255, 255, 0.08);
  }
}

:root[data-theme="dark"] {
  --bg: #0b0b0c;
  --bg2: #000;
  --fg: #f5f5f7;
  --fg2: #8e8e93;
  --bar: rgba(0, 0, 0, 0.6);
  --line: rgba(255, 255, 255, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
}

body {
  background: radial-gradient(1200px 700px at 50% 30%, var(--bg) 0%, var(--bg2) 100%);
  background-color: var(--bg);
  color: var(--fg);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.topbar {
  position: relative;
  z-index: 5;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 max(16px, env(safe-area-inset-left));
  background: var(--bar);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.orb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: conic-gradient(from 200deg, #ff3b30, #ffb020, #30d158, #0a84ff, #bf5af2, #ff3b30);
  -webkit-mask: radial-gradient(circle, transparent 5px, #000 5.5px);
  mask: radial-gradient(circle, transparent 5px, #000 5.5px);
}

.actions { display: flex; gap: 6px; }

.icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--fg2);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.icon:hover { background: var(--line); color: var(--fg); }
.icon.on { color: var(--accent); }
.icon:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.power { color: var(--fg); }
body:not(.on) .power { animation: pulse 2.2s ease-in-out infinite; color: var(--accent); }
body.on .power { color: #30d158; }
body.suspended .power { color: #ffb020; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(10, 132, 255, 0.35); }
  50% { box-shadow: 0 0 0 8px rgba(10, 132, 255, 0); }
}

.wrap {
  height: calc(100% - 52px);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.stage {
  position: relative;
  --s: 0.8;
}

.device {
  --red: #e8262d;
  position: absolute;
  left: 0;
  top: 0;
  width: 1480px;
  height: 940px;
  transform: scale(var(--s));
  transform-origin: 0 0;
  font-family: Inter, -apple-system, sans-serif;
  color: #f2f2f2;
  filter: drop-shadow(0 40px 50px rgba(0, 0, 0, 0.35)) drop-shadow(0 10px 14px rgba(0, 0, 0, 0.3));
}

.top {
  position: absolute;
  left: 0;
  top: 0;
  width: 1480px;
  height: 312px;
  border-radius: 22px 22px 10px 10px;
  background:
    radial-gradient(1200px 300px at 50% -100px, rgba(255, 255, 255, 0.05), transparent 70%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.012) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, #232326, #19191b);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), inset 0 -2px 0 rgba(0, 0, 0, 0.6), 0 2px 0 #0c0c0d;
}

.top > * { position: absolute; }

.stripe {
  left: 340px;
  top: 8px;
  width: 760px;
  height: 14px;
  border-bottom: 2px solid var(--red);
  transform: skewX(-30deg);
}

.stripe span {
  position: absolute;
  right: 40px;
  top: -3px;
  transform: skewX(30deg);
  font: italic 800 11px/1 Inter, sans-serif;
  letter-spacing: 0.18em;
  color: var(--red);
  white-space: pre;
}

.redline {
  position: absolute;
  left: 16px;
  right: 16px;
  top: 317px;
  height: 2px;
  background: var(--red);
  opacity: 0.85;
  border-radius: 1px;
}

.red-lbl {
  font: italic 800 13px/1 Inter, sans-serif;
  letter-spacing: 0.06em;
  color: var(--red);
}

.rhy-lbl {
  font: 800 11px/1 Inter, sans-serif;
  letter-spacing: 0.08em;
}

.write-lbl {
  font: 800 8px/1 Inter, sans-serif;
  letter-spacing: 0.08em;
  color: #bdbdc2;
}

.knob-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.knob {
  --d: 56px;
  --rot: 0deg;
  position: relative;
  width: var(--d);
  height: var(--d);
  border-radius: 50%;
  cursor: ns-resize;
  outline: none;
  touch-action: none;
}

.knob-wrap.big .knob { --d: 116px; }
.knob-wrap.out .knob { --d: 48px; }

.knob-skirt {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 60%, rgba(0, 0, 0, 0.45) 74%),
    repeating-conic-gradient(from 0deg, #3c3c40 0deg 2.5deg, #121213 2.5deg 5deg);
  box-shadow: 0 8px 14px rgba(0, 0, 0, 0.7), 0 2px 3px rgba(0, 0, 0, 0.8), inset 0 1px 1px rgba(255, 255, 255, 0.18);
  transform: rotate(var(--rot));
}

.knob-cap {
  position: absolute;
  inset: 14%;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 30%, #3e3e42 0%, #1e1e20 60%, #141415 100%);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2), inset 0 -3px 5px rgba(0, 0, 0, 0.7), 0 1px 2px rgba(0, 0, 0, 0.8);
  transform: rotate(var(--rot));
  transition: transform 0.06s linear;
}

.knob-wrap.big .knob-cap { inset: 12%; }

.knob-mark {
  position: absolute;
  top: 5%;
  left: 50%;
  width: 3px;
  height: 26%;
  border-radius: 2px;
  transform: translateX(-50%);
  background: #f5f5f7;
}

.knob-wrap.big .knob-mark { width: 4px; }
.knob.focus .knob-skirt { box-shadow: 0 8px 14px rgba(0, 0, 0, 0.7), 0 0 0 2px rgba(10, 132, 255, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.18); }
.knob.grab { cursor: grabbing; }

.knob-lbl {
  font: 800 9px/1.2 Inter, sans-serif;
  letter-spacing: 0.04em;
  text-align: center;
}

.ctl {
  position: relative;
  border: 0;
  margin: 0;
  padding: 0;
  cursor: pointer;
  font-family: Inter, sans-serif;
  color: #fff;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  --led: transparent;
  outline: none;
  transition: transform 0.05s, filter 0.12s;
}

.ctl:focus-visible { box-shadow: 0 0 0 2px var(--accent) !important; }
.ctl:active, .ctl.pressed { transform: translateY(1px) scale(0.97); filter: brightness(0.9); }
.cap { position: relative; z-index: 2; pointer-events: none; }
.ctl .led { display: none; }

.rb-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 50px;
}

.rb-lbl {
  font: 800 9px/1 Inter, sans-serif;
  letter-spacing: 0.04em;
  min-height: 10px;
  display: flex;
  align-items: center;
}

.rb-sub {
  font: 700 7px/1 Inter, sans-serif;
  white-space: nowrap;
  color: #c7c7cc;
}

.rb {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #7a7b80, #4a4b50 60%, #36373b);
  box-shadow: 0 0 0 3px #101011, 0 0 0 4px #3a3a3e, 0 4px 6px rgba(0, 0, 0, 0.7), inset 0 1px 1px rgba(255, 255, 255, 0.35);
}

.rb.lit { box-shadow: 0 0 0 3px var(--led), 0 0 12px 2px var(--led), 0 4px 6px rgba(0, 0, 0, 0.7), inset 0 1px 1px rgba(255, 255, 255, 0.35); }

.ar { display: block; width: 0; height: 0; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.ar.l { border-right: 7px solid #fff; }
.ar.r { border-left: 7px solid #fff; }

.oval {
  width: 92px;
  height: 42px;
  border-radius: 21px;
  font: 800 9px/1.15 Inter, sans-serif;
  letter-spacing: 0.02em;
  text-align: center;
  background: linear-gradient(180deg, #8c8e94 0%, #64666b 45%, #4a4b50 100%);
  box-shadow: 0 0 0 3px #0e0e0f, 0 0 0 4px #333336, 0 5px 8px rgba(0, 0, 0, 0.7), inset 0 1px 1px rgba(255, 255, 255, 0.45), inset 0 -2px 3px rgba(0, 0, 0, 0.35);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
}

.oval.lit {
  background: linear-gradient(180deg, color-mix(in srgb, var(--led) 55%, #fff 20%) 0%, color-mix(in srgb, var(--led) 80%, #000 10%) 100%);
  box-shadow: 0 0 0 3px var(--led), 0 0 16px 2px var(--led), 0 5px 8px rgba(0, 0, 0, 0.7), inset 0 1px 1px rgba(255, 255, 255, 0.5);
}

.fx-pads { display: flex; gap: 14px; }

.fxb {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font: 800 17px/1 Inter, sans-serif;
  background: radial-gradient(circle at 50% 35%, #4a4a4e, #262628 70%);
  box-shadow: 0 0 0 3px #0e0e0f, 0 0 0 4px #39393c, 0 5px 8px rgba(0, 0, 0, 0.7), inset 0 1px 1px rgba(255, 255, 255, 0.2);
  color: #d8d8dc;
}

.fxb.lit {
  color: #fff;
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--led) 70%, #fff 25%), var(--led) 55%, color-mix(in srgb, var(--led) 70%, #000) 100%);
  box-shadow: 0 0 0 3px #0e0e0f, 0 0 0 4px color-mix(in srgb, var(--led) 70%, #000), 0 0 18px 1px var(--led), 0 5px 8px rgba(0, 0, 0, 0.7), inset 0 1px 1px rgba(255, 255, 255, 0.4);
}

.tracks {
  position: absolute;
  left: 16px;
  right: 16px;
  top: 326px;
  height: 610px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.track {
  position: relative;
  border-radius: 16px 16px 22px 22px;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.012) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, #222225, #18181a 60%, #141416);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), inset 1px 0 0 rgba(255, 255, 255, 0.04), inset -1px 0 0 rgba(0, 0, 0, 0.5), 0 3px 0 #0a0a0b, 0 6px 10px rgba(0, 0, 0, 0.5);
}

.track > * { position: absolute; }

.tbtn {
  width: 92px;
  height: 38px;
  border-radius: 11px;
  font: 800 12px/1 Inter, sans-serif;
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, #2a2a2d, #19191b);
  box-shadow: 0 0 0 2px var(--ring), 0 0 0 4px #0d0d0e, 0 5px 8px rgba(0, 0, 0, 0.7), inset 0 1px 1px rgba(255, 255, 255, 0.15);
  color: var(--ring);
}

.fxbtn { --ring: #e8262d; }
.trkbtn { --ring: #1fd462; }

.tbtn.lit {
  color: #fff;
  background: linear-gradient(180deg, color-mix(in srgb, var(--led) 75%, #fff 15%), color-mix(in srgb, var(--led) 85%, #000 15%));
  box-shadow: 0 0 0 2px var(--led), 0 0 0 4px #0d0d0e, 0 0 18px 1px color-mix(in srgb, var(--led) 70%, transparent), 0 5px 8px rgba(0, 0, 0, 0.7), inset 0 1px 1px rgba(255, 255, 255, 0.35);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
}

.clear-lbl {
  font: 800 8px/1 Inter, sans-serif;
  letter-spacing: 0.04em;
  color: #e5e5ea;
}

.stopb {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 40%, #2b2b2e, #151516);
  box-shadow: 0 0 0 6px #c9cbd1, 0 0 0 7px #8d8f95, 0 0 0 9px #0c0c0d, 0 6px 10px rgba(0, 0, 0, 0.75), inset 0 2px 3px rgba(0, 0, 0, 0.8);
}

.stopb .sq { display: block; width: 14px; height: 14px; border-radius: 2px; background: #f2f2f2; }
.stopb.lit { box-shadow: 0 0 0 6px var(--led), 0 0 0 7px #8d8f95, 0 0 0 9px #0c0c0d, 0 0 16px 2px var(--led), inset 0 2px 3px rgba(0, 0, 0, 0.8); }

.slider {
  --v: 0.5;
  width: 84px;
  height: 270px;
  cursor: ns-resize;
  outline: none;
  touch-action: none;
}

.slot {
  position: absolute;
  left: 50%;
  top: 4%;
  bottom: 4%;
  width: 34px;
  margin-left: -17px;
  border-radius: 4px;
  background: linear-gradient(90deg, #0a0a0b, #19191b 50%, #0a0a0b);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.95), 0 1px 0 rgba(255, 255, 255, 0.06);
}

.slot::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 6px;
  bottom: 6px;
  width: 3px;
  margin-left: -1.5px;
  background: #000;
}

.thumb {
  position: absolute;
  left: 50%;
  width: 52px;
  height: 56px;
  margin-left: -26px;
  bottom: calc(7% + var(--v) * 86% - 28px);
  border-radius: 6px 6px 8px 8px;
  background: linear-gradient(180deg, #3a3a3d 0%, #1d1d1f 48%, #121213 52%, #2a2a2c 100%);
  box-shadow: 0 10px 14px rgba(0, 0, 0, 0.75), 0 2px 3px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  pointer-events: none;
}

.thumb i {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 3px;
  margin-top: -1.5px;
  background: #fff;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.5);
}

.slider:focus-visible .thumb { box-shadow: 0 0 0 2px var(--accent), 0 10px 14px rgba(0, 0, 0, 0.75); }

.pad {
  width: 264px;
  height: 264px;
  display: grid;
  place-items: center;
}

.pad-base {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, #1d1d20 0%, #131315 62%, #0c0c0d 100%);
  box-shadow: 0 0 0 2px #2a2a2d, 0 10px 18px rgba(0, 0, 0, 0.8), inset 0 2px 2px rgba(255, 255, 255, 0.08), inset 0 -8px 16px rgba(0, 0, 0, 0.6);
}

.ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.recbtn {
  width: 122px;
  height: 122px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 40%, #2b2b2e, #141415 75%);
  box-shadow: 0 0 0 9px #d4d6db, 0 0 0 10px #8e9096, 0 0 0 13px #0b0b0c, 0 8px 14px rgba(0, 0, 0, 0.8), inset 0 3px 5px rgba(0, 0, 0, 0.85);
  transition: box-shadow 0.08s, background 0.08s, transform 0.05s;
}

.recbtn.lit {
  background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--led) 55%, #fff 10%) 0%, color-mix(in srgb, var(--led) 35%, #111) 55%, #141415 100%);
  box-shadow: 0 0 0 9px #e9ebef, 0 0 0 10px #8e9096, 0 0 0 13px #0b0b0c, 0 0 30px 4px color-mix(in srgb, var(--led) 60%, transparent), inset 0 3px 5px rgba(0, 0, 0, 0.5);
}

.big-glyph {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  color: #fff;
  font: 300 28px/1 Inter, sans-serif;
}

.big-glyph i { font-style: normal; opacity: 0.9; }
.big-glyph .dot { width: 16px; height: 16px; border-radius: 50%; background: #fff; }
.big-glyph .tri { width: 0; height: 0; border-top: 10px solid transparent; border-bottom: 10px solid transparent; border-left: 17px solid #fff; }

.trk-num {
  font: italic 800 44px/1 Inter, sans-serif;
  color: #fff;
  letter-spacing: -0.04em;
  pointer-events: none;
}

.hint {
  position: absolute;
  z-index: 4;
  top: -9px;
  right: -9px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  display: none;
  place-items: center;
  border-radius: 5px;
  font: 600 10px/18px "JetBrains Mono", ui-monospace, monospace;
  color: #1d1d1f;
  background: rgba(245, 245, 247, 0.92);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  text-align: center;
  text-shadow: none;
}

.show-hints .hint { display: grid; }
.knob-wrap .hint { top: -6px; right: -10px; }
.recbtn .hint { top: -4px; right: -4px; }

.lcd-frame {
  width: 400px;
  height: 186px;
  padding: 9px;
  border-radius: 8px;
  background: linear-gradient(180deg, #050506, #0f0f11);
  box-shadow: 0 0 0 2px #2e2e31, 0 0 0 4px #0b0b0c, inset 0 2px 6px rgba(0, 0, 0, 0.9);
}

.glass {
  position: absolute;
  inset: 9px;
  border-radius: 3px;
  pointer-events: none;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.03) 35%, transparent 36%);
}

.lcd {
  --contrast: 0.82;
  --lcd-fg: #ffffff;
  --lcd-bg: #3653e4;
  --lcd-dim: rgba(255, 255, 255, 0.78);
  --lcd-line: rgba(255, 255, 255, 0.55);
  position: relative;
  height: 100%;
  padding: 5px 7px;
  border-radius: 3px;
  font-family: "DotGothic16", "JetBrains Mono", monospace;
  font-weight: 400;
  color: var(--lcd-fg);
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 40, 0.08) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(0, 0, 40, 0.08) 0 1px, transparent 1px 3px),
    radial-gradient(120% 140% at 50% 0%, #6f8bff 0%, #4563f1 45%, #2e48d2 100%);
  filter: brightness(calc(0.7 + var(--contrast) * 0.38));
  text-shadow: 0 0 1px rgba(255, 255, 255, 0.55);
  overflow: hidden;
}

.device.off .lcd { background: #121a3a; }
.device.off .lcd > * { display: none; }
.device.off { cursor: pointer; }

.boot {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  animation: bootin 0.9s ease both;
}

.boot b { font: 400 30px "DotGothic16", monospace; letter-spacing: 0.3em; margin-right: -0.3em; }
.boot span { font-size: 11px; letter-spacing: 0.2em; }

@keyframes bootin {
  from { opacity: 0; }
  to { opacity: 1; }
}

.scr {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.scr header {
  height: 20px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  line-height: 1;
  letter-spacing: 0.02em;
  border-bottom: 1px solid var(--lcd-line);
  white-space: nowrap;
  overflow: hidden;
}

.scr header .t { padding: 1px 4px; background: var(--lcd-fg); color: var(--lcd-bg); text-shadow: none; }
.scr.play header .t { padding: 0; background: none; color: inherit; }

.scr header .s {
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.pg { display: flex; gap: 3px; margin-left: auto; align-items: center; }
.pg i { width: 6px; height: 6px; border: 1px solid var(--lcd-fg); }
.pg i.on { background: var(--lcd-fg); }

.bd { flex: 1; min-height: 0; position: relative; }

.cells {
  height: 44px;
  flex: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--lcd-line);
}

.cells.tall { flex: 1; height: auto; border-top: 0; }

.cell {
  padding: 4px 4px 2px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  cursor: pointer;
}

.cell + .cell { border-left: 1px dotted var(--lcd-line); }
.cell.empty { cursor: default; }
.cl { font-size: 10px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--lcd-dim); }
.cv { font-size: 15px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cells.tall .cell { justify-content: center; gap: 8px; padding: 6px 5px; }
.cells.tall .cl { font-size: 11px; }
.cells.tall .cv { font-size: 18px; padding: 2px 3px; border: 1px solid var(--lcd-line); }
.cell.go .cv::after { content: " ▸"; }
.cell.hot .cl::before { content: "◆"; margin-right: 2px; }

.tiles {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  padding: 8px 0 2px;
}

.tile {
  border: 1px solid var(--lcd-fg);
  display: flex;
  align-items: flex-end;
  padding: 6px 5px;
  font-size: 13px;
  line-height: 1.15;
  cursor: pointer;
}

.tile:hover { background: var(--lcd-fg); color: var(--lcd-bg); text-shadow: none; }
.tile.empty { border-style: dotted; opacity: 0.4; cursor: default; }

.ph { gap: 6px !important; }
.mno { font-size: 13px; padding: 1px 3px; background: var(--lcd-fg); color: var(--lcd-bg); text-shadow: none; }
.mnm { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.fxst { display: flex; gap: 1px; align-items: center; font-size: 8px; }
.fxst em { font-style: normal; margin-right: 2px; }
.fxst i { font-style: normal; width: 10px; height: 10px; display: grid; place-items: center; border: 1px solid var(--lcd-fg); line-height: 1; }
.fxst i.on { background: var(--lcd-fg); color: var(--lcd-bg); text-shadow: none; }

.blink { animation: blink 0.6s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0.1; } }

.v-mem { height: 100%; display: flex; align-items: center; gap: 12px; padding: 0 4px; }
.v-mem .big { font: 400 72px/1 "DotGothic16", monospace; letter-spacing: -0.02em; }
.v-mem .nm { font-size: 22px; line-height: 1.2; word-break: break-all; }

.v-trk { height: 100%; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 5px 0; }
.tk { border: 1px solid var(--lcd-line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.tk.cur { border: 2px solid var(--lcd-fg); }
.tk b { font-weight: 400; font-size: 13px; }
.tk span { font-size: 11px; }
.tk small { font-size: 9px; min-height: 10px; }

.ico { display: inline-block; width: 14px; height: 14px; position: relative; }
.ico.emp { border: 1px dotted var(--lcd-fg); }
.ico.rec { border-radius: 50%; background: var(--lcd-fg); }
.ico.ply { width: 0; height: 0; border-top: 7px solid transparent; border-bottom: 7px solid transparent; border-left: 12px solid var(--lcd-fg); }
.ico.dub { background: var(--lcd-fg); transform: rotate(45deg) scale(0.8); }
.ico.stp { background: var(--lcd-fg); transform: scale(0.8); }

.v-bars { height: 100%; display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 4px 1px; }
.bar { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.bar b { font-weight: 400; }
.bar span { flex: 1; height: 11px; border: 1px solid var(--lcd-fg); padding: 1px; }
.bar span i { display: block; height: 100%; background: var(--lcd-fg); }
.bar.stp span i, .bar.emp span i { opacity: 0.35; }

.v-stat { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; }
.bb { font: 400 46px/1 "DotGothic16", monospace; }
.bb i { font-style: normal; }
.dots { display: flex; gap: 5px; }
.dots i { width: 8px; height: 8px; border: 1px solid var(--lcd-fg); }
.dots i.on { background: var(--lcd-fg); }
.icons { display: flex; gap: 14px; }

.v-lvl { height: 100%; display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; padding: 5px 16px; }
.lv { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.lv span { flex: 1; width: 14px; border: 1px solid var(--lcd-fg); padding: 1px; display: flex; align-items: flex-end; }
.lv span i { display: block; width: 100%; background: repeating-linear-gradient(0deg, var(--lcd-fg) 0 3px, transparent 3px 4px); }
.lv b { font-weight: 400; font-size: 11px; }

.mcols { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); }
.mcol { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 5px 3px 2px; cursor: pointer; min-width: 0; }
.mcol + .mcol { border-left: 1px dotted var(--lcd-line); }
.meter { position: relative; flex: 1; width: 14px; border: 1px solid var(--lcd-fg); padding: 1px; display: flex; align-items: flex-end; }
.meter i { display: block; width: 100%; background: repeating-linear-gradient(0deg, var(--lcd-fg) 0 3px, transparent 3px 4px); }
.meter b { position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--lcd-fg); }
.mcol .cl, .mcol .cv { max-width: 100%; }

.tempo-big { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; font: 400 60px/1 "DotGothic16", monospace; }
.tempo-big small { font-size: 13px; align-self: flex-end; margin-bottom: 12px; }

.msg { align-items: center; justify-content: center; gap: 8px; text-align: center; }
.msg .big { font-size: 22px; }
.msg .small { font-size: 13px; }
.msg .keys { display: flex; gap: 10px; margin-top: 10px; font-size: 11px; }
.msg .keys span { padding: 2px 6px; border: 1px solid var(--lcd-fg); }
.msg .keys .hl { background: var(--lcd-fg); color: var(--lcd-bg); text-shadow: none; }

.wr { flex: 1; display: flex; align-items: center; gap: 14px; padding: 0 6px; }
.wr .no { font: 400 64px/1 "DotGothic16", monospace; }
.wr .nm { font-size: 20px; }

.nm-edit { flex: 1; display: flex; align-items: center; justify-content: center; gap: 2px; }
.nm-edit i { font-style: normal; width: 26px; height: 38px; display: grid; place-items: center; font-size: 22px; border-bottom: 2px solid var(--lcd-line); }
.nm-edit i.cur { background: var(--lcd-fg); color: var(--lcd-bg); text-shadow: none; border-color: var(--lcd-fg); }

.pop {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  min-width: 70%;
  padding: 8px 12px;
  background: var(--lcd-bg);
  border: 2px solid var(--lcd-fg);
  outline: 3px solid var(--lcd-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.pop span { font-size: 12px; }
.pop b { font-weight: 400; font-size: 26px; }

@media (max-width: 720px) {
  .topbar { height: 48px; }
  .wrap { height: calc(100% - 48px); }
}

@media (prefers-reduced-motion: reduce) {
  .boot, .blink, body:not(.on) .power { animation: none; }
}

.top > .ctl, .track > .ctl { position: absolute; }

:root {
  --panel: #ffffff;
  --panel2: #f2f2f7;
  --sep: rgba(60, 60, 67, 0.14);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --panel: #1c1c1e; --panel2: #2c2c2e; --sep: rgba(84, 84, 88, 0.5); }
}

:root[data-theme="dark"] { --panel: #1c1c1e; --panel2: #2c2c2e; --sep: rgba(84, 84, 88, 0.5); }

#fs .fs-out { display: none; }
body.fs #fs .fs-in { display: none; }
body.fs #fs .fs-out { display: block; }

.ov-back {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.2s;
}

.ov-back.in { opacity: 1; }

.ov-sheet {
  width: min(480px, 100%);
  max-height: min(760px, calc(100vh - 32px));
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  background: var(--panel);
  color: var(--fg);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35), 0 0 0 0.5px var(--sep);
  transform: translateY(10px) scale(0.98);
  transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1);
  user-select: text;
}

.ov-back.in .ov-sheet { transform: none; }
.ov-sheet.wide { width: min(680px, 100%); }

.ov-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 10px;
}

.ov-head h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }

.ov-x {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--panel2);
  color: var(--fg2);
  cursor: pointer;
}

.ov-body { padding: 6px 20px 20px; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.ov-pane { display: flex; flex-direction: column; gap: 18px; }

.seg {
  display: flex;
  padding: 2px;
  border-radius: 9px;
  background: var(--panel2);
  align-self: flex-start;
}

.seg button {
  border: 0;
  background: transparent;
  color: var(--fg);
  font: 500 13px Inter, sans-serif;
  padding: 6px 18px;
  border-radius: 7px;
  cursor: pointer;
}

.seg button.on { background: var(--panel); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); }

.ov-body section h3 {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg2);
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--panel2);
  border-radius: 10px;
  margin-bottom: 6px;
  font-size: 14px;
  flex-wrap: wrap;
}

.row .lbl { width: 92px; font-weight: 600; }
.row .note { flex: 1; font-size: 12px; color: var(--fg2); min-width: 140px; }

.row select {
  flex: 1;
  min-width: 140px;
  height: 32px;
  padding: 0 8px;
  border-radius: 8px;
  border: 0.5px solid var(--sep);
  background: var(--panel);
  color: var(--fg);
  font: 13px Inter, sans-serif;
}

.row select.sm { flex: 0 0 96px; min-width: 0; }

.vu { width: 70px; height: 6px; border-radius: 3px; background: var(--sep); overflow: hidden; }
.vu i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #30d158 70%, #ffd60a 88%, #ff453a); transition: width 0.05s; }

.row.sw { cursor: pointer; position: relative; }
.row.sw input { position: absolute; opacity: 0; pointer-events: none; }
.row.sw > i { width: 46px; height: 28px; border-radius: 14px; background: var(--sep); position: relative; transition: background 0.2s; flex: none; }
.row.sw > i::after { content: ""; position: absolute; left: 2px; top: 2px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); transition: transform 0.2s; }
.row.sw input:checked + i { background: #30d158; }
.row.sw input:checked + i::after { transform: translateX(18px); }

.keys { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px; }
.krow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px 8px 12px; border-radius: 10px; background: var(--panel2); font-size: 13px; }

.kcap {
  min-width: 34px;
  height: 28px;
  padding: 0 10px;
  border-radius: 7px;
  border: 0.5px solid var(--sep);
  background: var(--panel);
  color: var(--fg);
  font: 600 12px "JetBrains Mono", monospace;
  display: grid;
  place-items: center;
  box-shadow: 0 1px 0 var(--sep);
  cursor: pointer;
  white-space: nowrap;
}

span.kcap { cursor: default; }
.kcap.wait { background: var(--accent); color: #fff; border-color: transparent; font-family: Inter, sans-serif; animation: pulse 1.4s infinite; }

.ov-foot { display: flex; justify-content: flex-end; }
.ov-empty { padding: 30px 10px; text-align: center; color: var(--fg2); }

.btn {
  height: 34px;
  padding: 0 16px;
  border: 0;
  border-radius: 9px;
  background: var(--panel2);
  color: var(--fg);
  font: 600 13px Inter, sans-serif;
  cursor: pointer;
}

.btn.primary { background: var(--accent); color: #fff; }
.btn.link { background: none; color: var(--accent); padding: 0 6px; }
.btn:hover { filter: brightness(1.05); }

.card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 0;
  border-radius: 14px;
  background: var(--panel2);
  color: var(--fg);
  text-align: left;
  cursor: pointer;
  font-family: Inter, sans-serif;
  transition: transform 0.15s;
}

.card:hover { transform: translateY(-1px); }
.card .ic { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 700; font-size: 17px; }
.card b { display: block; font-size: 15px; margin-bottom: 3px; }
.card small { font-size: 13px; color: var(--fg2); }
.cheat { margin-top: 6px; }
.cheat .keys { grid-template-columns: 1fr; }

.tour-spot {
  position: fixed;
  z-index: 60;
  border-radius: 14px;
  pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5), 0 0 0 2px rgba(255, 255, 255, 0.9);
  transition: all 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.tour-bubble {
  position: fixed;
  z-index: 61;
  padding: 14px 16px 12px;
  border-radius: 16px;
  background: var(--panel);
  color: var(--fg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  transition: left 0.3s cubic-bezier(0.2, 0.9, 0.3, 1), top 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
  font-size: 14px;
  line-height: 1.45;
  user-select: text;
}

.tour-bubble h4 { margin: 6px 0 4px; font-size: 16px; letter-spacing: -0.01em; }
.tour-bubble p { margin: 0 0 12px; color: var(--fg); opacity: 0.85; }
.tour-bubble kbd { font: 600 12px "JetBrains Mono", monospace; padding: 1px 6px; border-radius: 5px; background: var(--panel2); border: 0.5px solid var(--sep); }
.tb-top { display: flex; justify-content: space-between; align-items: center; }
.tb-n { font-size: 12px; color: var(--fg2); font-weight: 600; }
.tb-x { border: 0; background: none; color: var(--fg2); cursor: pointer; font-size: 14px; }
.tb-act { width: 100%; margin-bottom: 10px; }
.tb-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tb-wait { margin-left: auto; font-size: 12px; color: var(--fg2); animation: blink 1.4s infinite; }

body.modal .tour-spot, body.modal .tour-bubble { display: none; }
