/* Squipy Beats: retro CRT DJ deck (no external fonts/assets). Nothing animates a filter. */

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

:root {
  --bg: #140810;
  --panel: #1e1020;
  --panel-edge: #3d2048;
  --neon-pink: #ff4ecd;
  --neon-cyan: #3df0ff;
  --neon-lime: #b8ff3d;
  --neon-amber: #ffc14d;
  --neon-purple: #a78bfa;
  --text: #f3e8ff;
  --muted: #9b8aab;
  --cell: #2a1832;
  --cell-on: #ff4ecd;
  --cell-play: #3df0ff;
  --pixel: "Courier New", Courier, ui-monospace, monospace;
}

html,
body {
  min-height: 100%;
  background: #0a0508;
  color: var(--text);
  font-family: var(--pixel);
}

body {
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(255, 78, 205, 0.18), transparent 50%),
    radial-gradient(ellipse 60% 40% at 100% 80%, rgba(61, 240, 255, 0.08), transparent 45%),
    #0a0508;
}

.crt {
  position: relative;
  width: min(56rem, 100%);
  margin: 0 auto;
  padding: max(0.75rem, env(safe-area-inset-top)) 0.85rem max(1.25rem, env(safe-area-inset-bottom));
  min-height: calc(100vh - var(--rg-bar));
  min-height: calc(100dvh - var(--rg-bar));
}

.scanlines {
  pointer-events: none;
  position: fixed;
  inset: var(--rg-bar) 0 0 0;
  z-index: 50;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.12) 2px,
    rgba(0, 0, 0, 0.12) 4px
  );
  opacity: 0.35;
}

/* Top bar */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.home-link {
  color: var(--neon-cyan);
  text-decoration: none;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.home-link:hover {
  text-decoration: underline;
}

.logo {
  font-family: var(--pixel);
  font-weight: 700;
  font-size: clamp(0.7rem, 2.8vw, 1rem);
  letter-spacing: 0.06em;
  color: var(--neon-amber);
  text-shadow: 0 0 12px rgba(255, 193, 77, 0.55);
}

.logo span {
  color: var(--neon-pink);
  text-shadow: 0 0 12px rgba(255, 78, 205, 0.55);
}

.version {
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.1em;
}

/* DJ stage */
.dj-stage {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 1.15rem;
  margin-bottom: 1rem;
  min-height: 7.25rem;
}

.stage-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  min-width: 5.5rem;
}

.dj {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  transition: transform 0.08s ease;
}

.dj.bounce {
  transform: translateY(-6px) scale(1.05);
}

/* ── Squipy on the stand ──────────────────────────── */
.squipy-dj {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  position: relative;
  z-index: 2;
}

.squipy-body {
  width: 3.15rem;
  height: 3.15rem;
  border-radius: 0.5rem;
  background: linear-gradient(160deg, #c4b5fd, #7c3aed 55%, #5b21b6);
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow:
    0 0 16px rgba(167, 139, 250, 0.55),
    0 0 28px rgba(255, 78, 205, 0.2);
  display: grid;
  place-items: center;
  will-change: transform;
  transition: box-shadow 0.12s ease;
}

.squipy-dj .sq-face {
  position: relative;
  width: 1.65rem;
  height: 1.15rem;
}

.squipy-dj .brow {
  position: absolute;
  top: -0.05rem;
  width: 0.44rem;
  height: 0.1rem;
  background: #0a0508;
  border-radius: 2px;
  transition: transform 0.12s ease, top 0.12s ease;
}

.squipy-dj .brow.left {
  left: 0.12rem;
}
.squipy-dj .brow.right {
  right: 0.12rem;
}

.squipy-dj .eye {
  position: absolute;
  top: 0.14rem;
  width: 0.32rem;
  height: 0.32rem;
  background: #0a0508;
  border-radius: 50%;
  transition:
    width 0.12s ease,
    height 0.12s ease,
    top 0.12s ease,
    border-radius 0.12s ease,
    background 0.12s ease,
    box-shadow 0.12s ease;
}

.squipy-dj .eye.left {
  left: 0.14rem;
}
.squipy-dj .eye.right {
  right: 0.14rem;
}

.squipy-dj .eye::after {
  content: "";
  position: absolute;
  top: 0.04rem;
  right: 0.04rem;
  width: 0.09rem;
  height: 0.09rem;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
}

.squipy-dj .mouth {
  position: absolute;
  left: 50%;
  bottom: 0.02rem;
  width: 0.68rem;
  height: 0.26rem;
  border-bottom: 2.5px solid #0a0508;
  border-radius: 0 0 50% 50%;
  transform: translateX(-50%);
  transition: width 0.12s ease, height 0.12s ease, border 0.12s ease, bottom 0.12s ease, background 0.12s ease;
}

.squipy-dj .cheek {
  position: absolute;
  bottom: 0.24rem;
  width: 0.24rem;
  height: 0.15rem;
  border-radius: 50%;
  background: rgba(244, 114, 182, 0.55);
  opacity: 0;
  transition: opacity 0.12s ease;
}

.squipy-dj .cheek.left {
  left: -0.04rem;
}
.squipy-dj .cheek.right {
  right: -0.04rem;
}

.squipy-label {
  color: #c4b5fd !important;
  text-shadow: 0 0 8px rgba(167, 139, 250, 0.55);
  letter-spacing: 0.14em !important;
}

/* Moods */
.squipy-dj[data-mood="idle"] .cheek {
  opacity: 0.5;
}

.squipy-dj[data-mood="groove"] .brow.left,
.squipy-dj[data-mood="groove"] .brow.right {
  top: -0.08rem;
}
.squipy-dj[data-mood="groove"] .mouth {
  width: 0.9rem;
  height: 0.34rem;
  border-bottom-width: 3px;
}
.squipy-dj[data-mood="groove"] .cheek {
  opacity: 0.85;
}

.squipy-dj[data-mood="kick"] .brow.left {
  transform: rotate(12deg);
}
.squipy-dj[data-mood="kick"] .brow.right {
  transform: rotate(-12deg);
}
.squipy-dj[data-mood="kick"] .eye {
  width: 0.4rem;
  height: 0.4rem;
  top: 0.08rem;
}
.squipy-dj[data-mood="kick"] .mouth {
  width: 0.5rem;
  height: 0.48rem;
  border: 2.5px solid #0a0508;
  border-radius: 50%;
  bottom: -0.08rem;
  background: rgba(10, 5, 8, 0.12);
}

.squipy-dj[data-mood="snare"] .eye.left {
  height: 0.12rem;
  border-radius: 2px;
  top: 0.26rem;
}
.squipy-dj[data-mood="snare"] .eye.left::after {
  display: none;
}
.squipy-dj[data-mood="snare"] .mouth {
  width: 0.85rem;
  transform: translateX(-40%);
}
.squipy-dj[data-mood="snare"] .cheek {
  opacity: 0.9;
}

.squipy-dj[data-mood="hat"] .eye {
  height: 0.14rem;
  border-radius: 2px;
  top: 0.26rem;
}
.squipy-dj[data-mood="hat"] .eye::after {
  display: none;
}
.squipy-dj[data-mood="hat"] .mouth {
  width: 0.55rem;
  height: 0;
  border-radius: 0;
  bottom: 0.16rem;
}

.squipy-dj[data-mood="hype"] .brow.left,
.squipy-dj[data-mood="hype"] .brow.right {
  top: -0.16rem;
}
.squipy-dj[data-mood="hype"] .eye {
  width: 0.44rem;
  height: 0.44rem;
  top: 0.04rem;
  background: #fff;
  box-shadow: inset 0 0 0 0.1rem #0a0508;
}
.squipy-dj[data-mood="hype"] .eye::after {
  top: 0.12rem;
  right: 0.1rem;
  width: 0.12rem;
  height: 0.12rem;
  background: #0a0508;
}
.squipy-dj[data-mood="hype"] .mouth {
  width: 0.58rem;
  height: 0.55rem;
  border: 2.5px solid #0a0508;
  border-radius: 50%;
  bottom: -0.12rem;
  background: rgba(10, 5, 8, 0.1);
}
.squipy-dj[data-mood="hype"] .cheek {
  opacity: 0.75;
}

.squipy-dj[data-mood="chill"] .eye {
  height: 0.12rem;
  border-radius: 2px;
  top: 0.28rem;
}
.squipy-dj[data-mood="chill"] .eye::after {
  display: none;
}
.squipy-dj[data-mood="chill"] .mouth {
  width: 0.7rem;
  height: 0.28rem;
}

/* Continuous dance while pattern/loop is playing */
.squipy-dj.dancing .squipy-body {
  animation: squipy-dance 0.42s ease-in-out infinite;
  box-shadow:
    0 0 18px rgba(167, 139, 250, 0.7),
    0 0 32px rgba(255, 78, 205, 0.35);
}

.squipy-dj.beat-pop .squipy-body {
  animation: squipy-beat 0.16s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes squipy-dance {
  0%,
  100% {
    transform: translateY(0) rotate(-4deg) scale(1);
  }
  25% {
    transform: translateY(-8px) rotate(5deg) scale(1.06);
  }
  50% {
    transform: translateY(-2px) rotate(-3deg) scale(1.02);
  }
  75% {
    transform: translateY(-9px) rotate(6deg) scale(1.08);
  }
}

@keyframes squipy-beat {
  0% {
    transform: scale(1) translateY(0);
  }
  40% {
    transform: scale(1.16) translateY(-10px) rotate(-6deg);
  }
  100% {
    transform: scale(1) translateY(0);
  }
}

.squipy-dj.dancing.beat-pop .squipy-body {
  animation: squipy-beat 0.16s cubic-bezier(0.22, 1, 0.36, 1);
}

.dj-body.tri {
  width: 0;
  height: 0;
  border-left: 1.35rem solid transparent;
  border-right: 1.35rem solid transparent;
  border-bottom: 2.2rem solid var(--neon-cyan);
  filter: drop-shadow(0 0 10px rgba(61, 240, 255, 0.55));
  position: relative;
}

.dj-body.cir {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #e9d5ff, var(--neon-purple) 55%, #5b21b6);
  box-shadow: 0 0 14px rgba(167, 139, 250, 0.65);
}

.dj-face {
  position: relative;
  height: 0;
  width: 0;
  pointer-events: none;
}

.triangle-dj .dj-face {
  margin-top: -1.55rem;
  margin-left: 0.05rem;
}

.circle-dj .dj-face {
  margin-top: -1.65rem;
}

.dj-face .eye {
  position: absolute;
  width: 0.28rem;
  height: 0.28rem;
  background: #0a0508;
  border-radius: 50%;
}

.triangle-dj .eye:first-child {
  left: -0.55rem;
  top: 0;
}

.triangle-dj .eye:nth-child(2) {
  left: 0.28rem;
  top: 0;
}

.circle-dj .eye:first-child {
  left: -0.55rem;
  top: 0;
}

.circle-dj .eye:nth-child(2) {
  left: 0.28rem;
  top: 0;
}

.dj-face .mouth {
  position: absolute;
  left: -0.28rem;
  top: 0.45rem;
  width: 0.55rem;
  height: 0.2rem;
  border-bottom: 2px solid #0a0508;
  border-radius: 0 0 50% 50%;
}

.dj-face .mouth.smile {
  border-bottom-width: 2.5px;
  width: 0.65rem;
  left: -0.32rem;
}

.dj-name {
  font-family: var(--pixel);
  font-weight: 700;
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.12em;
}

.deck-lights {
  display: flex;
  gap: 0.35rem;
  padding-bottom: 0.15rem;
}

.deck-lights span {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #3a2038;
  box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.5);
}

.deck-lights span.on {
  background: var(--neon-lime);
  box-shadow: 0 0 10px var(--neon-lime);
}

.deck-lights span:nth-child(even).on {
  background: var(--neon-pink);
  box-shadow: 0 0 10px var(--neon-pink);
}

/* Panels */
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; }
.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; }
.deck { display: flex; flex-direction: column; gap: 0.75rem; }
.panel {
  background: linear-gradient(165deg, #261428, var(--panel)); border: 2px solid var(--panel-edge); border-radius: 0.75rem; padding: 0.8rem 0.9rem 0.95rem;
  box-shadow: 0 0 0 1px rgba(255, 78, 205, 0.08), 0 12px 32px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.panel-label { font-family: var(--pixel); font-weight: 700; font-size: 0.78rem; color: var(--neon-cyan); letter-spacing: 0.06em; margin: 0 0 0.65rem; }
button, select, input { font: inherit; }
:focus-visible { outline: 3px solid var(--neon-lime); outline-offset: 2px; }

/* Style chips */
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; border: 0; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span { display: inline-flex; align-items: center; min-height: 2.5rem; padding: 0.35rem 0.85rem; border: 2px solid #4a3058; border-radius: 999px; background: #2a1834; color: var(--text); font-weight: 700; font-size: 0.9rem; letter-spacing: 0.02em; }
.chip input:checked + span { border-color: var(--neon-pink); background: rgba(255, 78, 205, 0.18); color: #ffd6f3; box-shadow: 0 0 12px rgba(255, 78, 205, 0.35); }
.chip input:focus-visible + span { outline: 3px solid var(--neon-lime); outline-offset: 2px; }
.chip:hover span { border-color: var(--neon-cyan); }
.now { margin-top: 0.6rem; color: var(--neon-amber); font-size: 0.9rem; min-height: 1.3em; }

/* Transport */
.transport-row, .gen-row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.big-btn {
  font-family: var(--pixel); font-weight: 700; font-size: 0.9rem; min-height: 2.75rem; padding: 0.55rem 0.95rem; border: 2px solid #4a3058; border-radius: 0.5rem;
  background: #2a1834; color: var(--text); cursor: pointer; min-width: 6rem; letter-spacing: 0.04em; transition: transform 0.08s ease, box-shadow 0.08s ease, background-color 0.1s ease;
}
.big-btn:hover { background-color: #351e42; }
.big-btn:active { transform: scale(0.97); }
.big-btn.play { border-color: var(--neon-lime); color: var(--neon-lime); box-shadow: 0 0 12px rgba(184, 255, 61, 0.2); }
.big-btn.play.playing { background: rgba(184, 255, 61, 0.15); box-shadow: 0 0 18px rgba(184, 255, 61, 0.35); }
.big-btn.stop { border-color: var(--neon-amber); color: var(--neon-amber); }
.big-btn.loop { border-color: var(--neon-pink); color: var(--muted); }
.big-btn.loop.active { color: var(--neon-pink); background: rgba(255, 78, 205, 0.12); box-shadow: 0 0 14px rgba(255, 78, 205, 0.3); }
.big-btn.random { border-color: var(--neon-purple); color: #ede9fe; background: linear-gradient(160deg, #4c1d95, #2e1065); box-shadow: 0 0 16px rgba(167, 139, 250, 0.35); }
.knobs { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0.6rem 1rem; margin-top: 0.8rem; }
.knob-wrap, .sel-wrap { display: flex; align-items: center; gap: 0.5rem; color: var(--muted); }
.knob-wrap span, .sel-wrap span { min-width: 3.4rem; font-family: var(--pixel); font-weight: 700; font-size: 0.78rem; color: var(--neon-amber); }
.knob-wrap input[type="range"] { flex: 1; min-width: 0; height: 2rem; accent-color: var(--neon-pink); }
.knob-wrap output { min-width: 2.6rem; color: var(--neon-cyan); font-weight: 700; text-align: right; }
.sel-wrap select { flex: 1; min-height: 2.5rem; background: #2a1834; color: var(--text); border: 2px solid #4a3058; border-radius: 0.4rem; padding: 0 0.5rem; font-size: 1rem; }
.step-readout { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; }
.step-readout .label { font-family: var(--pixel); font-weight: 700; font-size: 0.7rem; color: var(--muted); }
#step-display { font-family: var(--pixel); font-weight: 700; font-size: 1.1rem; color: var(--neon-lime); text-shadow: 0 0 10px rgba(184, 255, 61, 0.4); font-variant-numeric: tabular-nums; }

/* Generate */
.mini-btn { font-family: var(--pixel); font-weight: 700; font-size: 0.8rem; min-height: 2.5rem; padding: 0.4rem 0.75rem; border: 2px solid #4a3058; border-radius: 0.4rem; background: #2a1834; color: #d8cce6; cursor: pointer; }
.mini-btn:hover { color: var(--neon-cyan); border-color: var(--neon-cyan); }
.seed-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.75rem; }
.seed-row label, .share-out label { font-family: var(--pixel); font-weight: 700; font-size: 0.78rem; color: var(--neon-amber); }
.seed-row input, .share-out input { min-height: 2.5rem; flex: 1 1 10rem; min-width: 0; background: #12081a; color: var(--neon-cyan); border: 2px solid #4a3058; border-radius: 0.4rem; padding: 0 0.6rem; font-family: var(--pixel); font-size: 1rem; }
.help { margin-top: 0.45rem; font-size: 0.82rem; color: var(--muted); }
.share-out { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.6rem; }
.share-out[hidden], .classic-presets[hidden] { display: none; }

/* Sequencer */
.bar-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.7rem; }
.bars { display: flex; gap: 0.3rem; }
.bar-btn { min-height: 2.5rem; min-width: 3.6rem; border: 2px solid #4a3058; border-radius: 0.4rem; background: #2a1834; color: #d8cce6; font-family: var(--pixel); font-weight: 700; font-size: 0.78rem; cursor: pointer; }
.bar-btn[aria-pressed="true"] { border-color: var(--neon-cyan); color: var(--neon-cyan); background: rgba(61, 240, 255, 0.1); }
.bar-btn.live { box-shadow: inset 0 -3px 0 var(--neon-lime); }
.follow { display: flex; align-items: center; gap: 0.4rem; color: #d8cce6; font-size: 0.9rem; min-height: 2.5rem; }
.follow input { width: 1.25rem; height: 1.25rem; accent-color: var(--neon-pink); }
.tracks { display: flex; flex-direction: column; gap: 0.45rem; }
.track { display: grid; grid-template-columns: 13.5rem 1fr; gap: 0.5rem; align-items: center; }
.track-head { display: flex; align-items: center; gap: 0.3rem; min-width: 0; }
.track-name { flex: 1; min-width: 0; font-weight: 700; font-size: 0.9rem; color: var(--tc, var(--text)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbtn { min-width: 2.4rem; min-height: 2.4rem; border: 2px solid #4a3058; border-radius: 0.35rem; background: #2a1834; color: #d8cce6; font-family: var(--pixel); font-weight: 700; font-size: 0.8rem; cursor: pointer; padding: 0 0.3rem; }
.tbtn[aria-pressed="true"] { border-color: var(--neon-amber); background: rgba(255, 193, 77, 0.18); color: var(--neon-amber); }
.tbtn:hover { border-color: var(--neon-cyan); }
.track-vol { width: 4.2rem; height: 2.4rem; accent-color: var(--tc, var(--neon-pink)); }
.track.muted .cells { opacity: 0.4; }
.cells { display: grid; grid-template-columns: repeat(16, minmax(0, 1fr)); gap: 0.2rem; }
.cell {
  position: relative; min-height: 2.4rem; border: 1px solid #3a2548; border-radius: 0.25rem; background: var(--cell); cursor: pointer; padding: 0; touch-action: manipulation;
}
.cell:nth-child(4n + 1) { border-color: #5a3a70; background: #301c3a; }
.cell.on { background: color-mix(in srgb, var(--tc, var(--cell-on)) calc(35% + var(--v, 1) * 65%), #1a0f20); border-color: var(--tc, #ff8ae0); box-shadow: 0 0 8px color-mix(in srgb, var(--tc, var(--cell-on)) 55%, transparent); }
.cell.roll::after { content: ""; position: absolute; left: 20%; right: 20%; bottom: 3px; height: 3px; border-radius: 2px; background: repeating-linear-gradient(90deg, #12081a 0 3px, transparent 3px 5px); }
.cell.glide::before { content: ""; position: absolute; left: -0.25rem; top: 50%; width: 0.5rem; height: 2px; background: #fff; opacity: 0.85; }
.cell.playhead { outline: 2px solid var(--cell-play); outline-offset: -2px; }
.cell.on.playhead { box-shadow: 0 0 12px rgba(61, 240, 255, 0.65); }

/* Pads */
.pad-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.35rem; }
.pad {
  min-height: 3rem; border: 2px solid #4a3058; border-bottom: 4px solid var(--pc, #4a3058); border-radius: 0.45rem; background: linear-gradient(160deg, #3a2244, #221028); color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif; font-weight: 800; font-size: 0.9rem; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 0.4rem; padding: 0.2rem 0.35rem;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; transition: transform 0.06s ease, box-shadow 0.06s ease;
}
.pad .key { opacity: 0.6; font-size: 0.78em; font-family: var(--pixel); }
.pad:hover { border-color: var(--neon-cyan); border-bottom-color: var(--pc, var(--neon-cyan)); }
.pad.hit, .pad:active { transform: scale(0.95); background: linear-gradient(160deg, #5a3068, #3a1848); box-shadow: 0 0 16px rgba(255, 78, 205, 0.45); color: #ffd6f3; }

/* Master */
.master .vu { display: flex; gap: 0.4rem; height: 0.6rem; margin-bottom: 0.6rem; }
.vu-bar { flex: 1; border-radius: 2px; background: #1a1020; box-shadow: inset 0 0 0 1px #3a2548; overflow: hidden; position: relative; }
.vu-bar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--lvl, 4%); background: linear-gradient(90deg, var(--neon-lime), var(--neon-amber), var(--neon-pink)); }
.hint { font-size: 0.85rem; color: var(--muted); line-height: 1.5; }

@media (max-width: 760px) {
  .track { grid-template-columns: 1fr; gap: 0.3rem; }
  .pad-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .cells { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .cell:nth-child(8n + 1) { margin-left: 0; }
  .big-btn { flex: 1 1 auto; min-width: 0; }
  .step-readout { margin-left: 0; }
  .knobs { grid-template-columns: 1fr; }
  .bar-btn { min-width: 0; flex: 1; }
  .bars { flex: 1 1 100%; }
  .crt { padding-left: 0.5rem; padding-right: 0.5rem; }
  .panel { padding: 0.7rem 0.6rem 0.8rem; }
  .pad-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .dj, .big-btn, .pad { transition: none; }
  .squipy-dj.dancing .squipy-body, .squipy-dj.beat-pop .squipy-body, .squipy-dj.dancing.beat-pop .squipy-body { animation: none; }
  .dj.bounce { transform: none; }
  .scanlines { display: none; }
}

/* v2.1: creative-freedom controls (no animated filters; static colours only) */
.track-name { display: flex; flex-direction: column; line-height: 1.15; }
.track-name small { font-weight: 600; font-size: 0.72rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.track { grid-template-columns: 15.5rem 1fr; }
.track.locked .track-head .lock { border-color: var(--neon-lime); background: rgba(184, 255, 61, 0.14); color: var(--neon-lime); }
.track.resting .cells { opacity: 0.45; }
.cell { color: #12081a; font-family: var(--pixel); font-weight: 700; font-size: 0.68rem; }
.cell.anchor { box-shadow: inset 0 3px 0 var(--neon-amber); }
.cell.on.anchor { box-shadow: inset 0 3px 0 var(--neon-amber), 0 0 8px color-mix(in srgb, var(--tc, var(--cell-on)) 55%, transparent); }
.cell.out { opacity: 0.55; background-image: repeating-linear-gradient(135deg, transparent 0 4px, rgba(18, 8, 26, 0.55) 4px 6px); }
.cell.sel { outline: 3px solid #fff; outline-offset: -3px; z-index: 1; }
.cell:focus-visible { outline: 3px solid var(--neon-lime); outline-offset: -1px; z-index: 2; }
.big-btn.arrange { border-color: var(--neon-cyan); color: var(--muted); }
.big-btn.arrange.active { color: var(--neon-cyan); background: rgba(61, 240, 255, 0.1); }
.section-readout { margin-left: 0; min-width: 7.5rem; }
#section { font-family: var(--pixel); font-weight: 700; font-size: 0.95rem; color: var(--neon-cyan); }
.modes { margin-bottom: 0.6rem; }
.mini-btn.guide[aria-pressed="true"] { border-color: var(--neon-lime); color: var(--neon-lime); }
.mini-btn.guide[aria-pressed="false"] { border-color: var(--neon-amber); color: var(--neon-amber); background: rgba(255, 193, 77, 0.12); }
.mini-btn:disabled { opacity: 0.4; cursor: default; }
.mixkits .knobs, .macros .knobs { margin-top: 0; }
.bar-label { color: var(--muted); font-size: 0.85rem; }
.note-ed { margin-top: 0.7rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.8rem; padding: 0.55rem 0.65rem; border: 2px dashed #4a3058; border-radius: 0.5rem; }
.note-ed:not(.empty) { border-style: solid; border-color: var(--neon-cyan); }
.ne-label { flex: 1 1 14rem; font-size: 0.88rem; color: #d8cce6; }
.ne-ctrls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.ne-ctrls .mini-btn { min-width: 2.75rem; min-height: 2.75rem; }
.ne-vel { display: flex; align-items: center; gap: 0.35rem; font-family: var(--pixel); font-weight: 700; font-size: 0.75rem; color: var(--neon-amber); }
.ne-vel input { width: 6.5rem; height: 2rem; accent-color: var(--neon-pink); }
.legend { margin-top: 0.55rem; font-size: 0.8rem; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.6rem; }
.lg { display: inline-block; width: 1.1rem; height: 1.1rem; border-radius: 0.2rem; background: var(--cell-on); vertical-align: middle; }
.lg.anchor { background: var(--cell); box-shadow: inset 0 3px 0 var(--neon-amber); border: 1px solid #5a3a70; }
.lg.out { opacity: 0.55; background-image: repeating-linear-gradient(135deg, transparent 0 3px, rgba(18, 8, 26, 0.6) 3px 5px); }
.lg.glide { background: var(--cell-on); position: relative; }
.lg.glide::before { content: ""; position: absolute; left: -0.3rem; top: 50%; width: 0.55rem; height: 2px; background: #fff; }
.lg.roll { width: auto; padding: 0 0.2rem; color: #12081a; font-family: var(--pixel); font-weight: 700; font-size: 0.7rem; line-height: 1.1rem; }
body.free .cell.anchor { box-shadow: none; }
@media (max-width: 760px) { .track { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .section-readout { min-width: 0; } .ne-label { flex-basis: 100%; } }

/* v2.2 arcade trim: Squipy is the star */
.dj-stage { min-height: 12rem; padding: 0.8rem 0 0.4rem; border-radius: 1rem; gap: 2rem;
  background: radial-gradient(ellipse 55% 85% at 50% 100%, rgba(167, 139, 250, 0.32), rgba(255, 78, 205, 0.08) 60%, transparent 75%); }
.stage-center .squipy-dj { zoom: 2.3; }
.dj { zoom: 1.35; }
.deck-lights { zoom: 1.3; }
.big-row { margin-top: 0.8rem; }
.big-btn.huge { font-size: 1.15rem; min-height: 3.6rem; padding: 0.7rem 1.4rem; flex: 1 1 12rem; }
.track { grid-template-columns: 8.5rem 1fr; }
.extra-row { margin-top: 0.8rem; }
.seed-box { margin-top: 0.6rem; color: var(--muted); }
.seed-box summary { cursor: pointer; min-height: 2.5rem; display: flex; align-items: center; font-family: var(--pixel); font-weight: 700; font-size: 0.78rem; color: var(--neon-amber); }
.pads .vu { display: flex; gap: 0.4rem; height: 0.6rem; margin: 0.7rem 0 0.5rem; }
@media (max-width: 560px) {
  .stage-center .squipy-dj { zoom: 1.9; }
  .dj { zoom: 1.1; }
  .dj-stage { gap: 1rem; min-height: 10rem; }
  .track { grid-template-columns: 1fr; }
}
.chip input { width: 100%; height: 100%; }
.follow input { width: 1.5rem; height: 1.5rem; }
