.dj-mode {
 margin-block: 1.5rem;
 padding: clamp(.55rem, 1.2vw, 1rem);
 border: 1px solid var(--edge, #396676);
 border-radius: .75rem;
}
.dj-mode summary { cursor: pointer; font-weight: bold; letter-spacing: .08em; }
.dj-body { display: grid; gap: .85rem; margin-top: .85rem; }
.dj-console {
 display: grid;
 grid-template-columns: minmax(0, 1fr) minmax(10rem, .58fr) minmax(0, 1fr);
 grid-template-areas: "deck-a mixer deck-b";
 gap: clamp(.4rem, 1.2vw, 1rem);
 align-items: start;
}
.dj-deck, .dj-mixer {
 min-width: 0;
 display: grid;
 gap: .65rem;
 padding: clamp(.4rem, 1vw, .85rem);
 border: 1px solid var(--edge, #396676);
 border-radius: .55rem;
 background: linear-gradient(150deg, #18242cdd, #0c111ce6);
}
.dj-deck { background: linear-gradient(150deg, #18242c26, #0c111c30); }
.dj-deck[data-deck=a] { grid-area: deck-a; --deck-light: #6ceeff; --deck-wash: #166e82; --shell-edge: #6b8abe; }
.dj-deck[data-deck=b] { grid-area: deck-b; --deck-light: #ffa4ed; --deck-wash: #762e75; --shell-edge: #a483bf; }
.dj-cassette {
 --shell-tint: var(--tape-color, var(--deck-light));
 --shell-edge: color-mix(in srgb,var(--shell-tint) 75%,#fff);
 --shell-light: color-mix(in srgb,var(--shell-tint) 74%,transparent);
 --shell-dark: color-mix(in srgb,var(--shell-tint) 39%,transparent);
 --shell-glow: color-mix(in srgb,var(--shell-tint) 53%,transparent);
 position: relative;
 padding: .35rem;
 border: 1px solid var(--shell-edge);
 border-radius: .65rem .65rem .4rem .4rem;
 background: linear-gradient(168deg,#fff4,transparent 24%),
  linear-gradient(155deg,var(--shell-light),var(--shell-dark) 54%,var(--shell-light));
 box-shadow: inset 0 1px 0 #fffd, inset 0 -3px 0 var(--shell-glow),
  0 0 16px var(--shell-glow), 0 5px 9px #0009;
}
.dj-screen {
 position: relative;
 isolation: isolate;
 min-height: 9rem;
 display: grid;
 grid-template-rows: auto 1fr auto auto;
 gap: .25rem;
 padding: .65rem .75rem .6rem;
 overflow: hidden;
 border: 1px solid color-mix(in srgb,var(--shell-edge) 60%,transparent);
 border-radius: .34rem;
 background:
  repeating-linear-gradient(0deg,#e4eeff13 0 1px,transparent 1px 5px);
 color: #f4f7ff;
 text-shadow: 0 1px 3px #000e, 0 0 5px #000a;
}
.dj-cassette-screw {
 position: absolute;
 width: .57rem;
 aspect-ratio: 1;
 border-radius: 50%;
 border: 1px solid #252b39;
 background: linear-gradient(45deg, transparent 42%, #727881 43% 51%, transparent 54%), radial-gradient(circle at 38% 35%, #424850, #151822 62%);
 box-shadow: 0 0 0 2px #eff5ff8a;
 pointer-events: none;
}
.dj-cassette-screw:nth-last-child(4) { top: .15rem; left: .15rem; }
.dj-cassette-screw:nth-last-child(3) { top: .15rem; right: .15rem; }
.dj-cassette-screw:nth-last-child(2) { bottom: .15rem; left: .15rem; }
.dj-cassette-screw:last-child { bottom: .15rem; right: .15rem; }
.dj-cassette-face {
 width: 66%;
 min-height: 1.25rem;
 margin: .1rem auto .04rem;
 display: flex;
 align-items: center;
 justify-content: center;
 gap: .7rem;
 background: repeating-linear-gradient(90deg, #556a8a29 0 1px, transparent 1px 9px), linear-gradient(var(--shell-light),var(--shell-dark) 70%,var(--shell-light));
 clip-path: polygon(5% 0, 95% 0, 100% 100%, 0 100%);
 color: #e6f0ff;
}
.dj-cassette-head { width: 1rem; height: .45rem; border-radius: .12rem; background: #050607; box-shadow: inset 0 1px 1px #9ca1a3; }
.dj-cassette-print { font-size: .55rem; font-weight: bold; letter-spacing: .13em; }
.dj-deck-label { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: .15rem .55rem; align-items: baseline; }
.dj-deck-label h3 { grid-column: 1 / 3; grid-row: 2; margin: 0; color: #f3f6ff !important; overflow-wrap: anywhere; line-height: 1.25; }
/* The original white logo's dark backing becomes transparent on the cassette. */
.dj-cassette-logo { grid-column: 3; grid-row: 1 / 3; align-self: center; width: clamp(2rem,4vw,3.25rem); height: auto; filter: grayscale(1) contrast(1.4); mix-blend-mode: screen; opacity: .85; }
.dj-deck-badge { font-weight: bold; letter-spacing: .14em; font-size: .72rem; }
.dj-deck-state { grid-column: 2; grid-row: 1; justify-self: end; font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; }
.dj-deck-state::before { content: '●'; margin-right: .35em; opacity: .35; }
.dj-deck:is([data-state=playing], [data-state=roll]) .dj-deck-state::before { opacity: 1; text-shadow: 0 0 10px currentColor; }
.dj-deck[data-state=queued] .dj-deck-state::before { animation: dj-queued .6s steps(2, jump-none) infinite alternate; }
@keyframes dj-queued { from { opacity: .3; } to { opacity: 1; } }
.dj-reels { position: relative; display: flex; align-items: center; justify-content: center; gap: 4%; padding: .36rem .1rem .55rem; }
.dj-reels::before {
 content: '';
 position: absolute;
 inset: 11% 11% 12%;
 border-radius: 40% 40% 23% 23% / 50% 50% 30% 30%;
 background: linear-gradient(165deg, #d9e1ef18, #eef2fa32 55%, #8495b312 74%);
 box-shadow: inset 0 0 0 1px #657aa15e;
}
.dj-reel {
 z-index: 1;
 position: relative;
 width: 45%;
 max-width: 10rem;
 aspect-ratio: 1;
 display: grid;
 place-items: center;
 border-radius: 50%;
 background: repeating-radial-gradient(circle, #50596770 0 1px, #333b477d 2px 4px);
 box-shadow: 0 0 0 1px #627391, 0 2px 5px #29355050;
 /* Cut through the reel backing and the rotating hub together. */
 mask-image: radial-gradient(circle closest-side, transparent 18%, #000 19%);
}
.dj-reel-spokes {
 position: absolute;
 inset: 2%;
 border-radius: 50%;
 border: 1px solid #eff5ffa8;
 background:
  radial-gradient(circle, #e3e9f295 0 32%, transparent 33% 72%, #b6c3d780 73%),
  repeating-conic-gradient(from 5deg, #e1e7f099 0 70deg, transparent 72deg 95deg, #cbd6e589 97deg 120deg);
 box-shadow: inset 0 0 0 2px #f2f6ff70;
 animation: dj-reel-spin var(--reel-speed, 1.35s) linear infinite paused;
}
.dj-reel-spokes::after {
 content: '';
 position: absolute;
 inset: 34%;
 border-radius: 50%;
 border: 2px solid #14191b;
 background: repeating-conic-gradient(#f8fbff 0 24deg, #738197 25deg 45deg);
 box-shadow: 0 0 0 2px #899ab27d, 0 1px 2px #495570;
}
.dj-reel:nth-child(2) { background: #dae1ed48; }
.dj-reel:nth-child(2) .dj-reel-spokes { animation-duration: calc(var(--reel-speed, 1.35s) * 1.18); }
.dj-deck:is([data-state=playing], [data-state=roll]) .dj-reel-spokes { animation-play-state: running; }
@keyframes dj-reel-spin { to { transform: rotate(360deg); } }
.dj-tape-path {
 position: absolute;
 inset: auto 18% 13%;
 height: 30%;
 border: solid #271a20;
 border-width: 0 2px 3px;
 border-radius: 0 0 30% 30%;
 box-shadow: 0 2px 0 #9c6f55a8;
}
.dj-wave {
 position: relative;
 z-index: 2;
 margin-top: -.65rem;
 overflow: hidden;
 border: 1px solid color-mix(in srgb, var(--deck-light) 38%, transparent);
 border-radius: .25rem;
 background: radial-gradient(ellipse at center, #203054cc, #080c1fe8);
}
.dj-wave canvas { display: block; width: 100%; height: clamp(4.25rem, 8vw, 7rem); cursor: crosshair; }
.dj-playhead { position: absolute; inset: 0 auto 0 0; width: 2px; background: #d7fff6; box-shadow: 0 0 7px var(--deck-light); pointer-events: none; }
.dj-loop-mark { position: absolute; inset: 0 auto 0 0; background: #e6ff6d4a; border-inline: 2px solid #e4ff77; box-shadow: inset 0 0 10px #ccff7580; pointer-events: none; }
.dj-loop-label { position: absolute; right: .2rem; bottom: .1rem; background: #101416da; color: #eaff9c; padding: 0 .2rem; font-size: .63rem; pointer-events: none; }
.dj-loop-label:empty { display: none; }
.dj-cue-mark { position: absolute; inset: 0 auto 0 0; border-left: 2px dashed #ffd980; pointer-events: none; }
.dj-time { min-height: 1em; font-size: .7rem; color: #eef4ff; font-variant-numeric: tabular-nums; }
.dj-track-progress { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: .5rem; }
.dj-track-progress progress {
 appearance: none;
 -webkit-appearance: none;
 display: block;
 width: 100%;
 height: .55rem;
 overflow: hidden;
 border: 1px solid var(--shell-edge);
 border-radius: 99px;
 background: #070c168f;
 accent-color: var(--deck-light);
}
.dj-track-progress progress::-webkit-progress-bar { background: transparent; }
.dj-track-progress progress::-webkit-progress-value { background: var(--deck-light); border-radius: 99px; }
.dj-track-progress progress::-moz-progress-bar { background: var(--deck-light); border-radius: 99px; }
.dj-track-remaining { color: var(--deck-light); font-size: .72rem; font-variant-numeric: tabular-nums; }
.dj-wave-tools { display: flex; flex-wrap: wrap; gap: .25rem; }
.dj-wave-tools button { padding: .27rem .4rem; font-size: .68rem; }
.dj-transport, .dj-banks, .dj-cue-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
.dj-pitch-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.dj-deck-upper { display: grid; grid-template-columns: minmax(0,1fr) clamp(2.65rem,5vw,3.6rem); gap: .45rem; }
.dj-deck-face-controls { display: grid; min-width: 0; align-content: start; gap: .65rem; }
.dj-pitch-rail {
 display: grid;
 grid-template-rows: auto minmax(var(--fader-popout-travel),1fr) auto auto;
 gap: .35rem;
 padding: .45rem .2rem .25rem;
 border: 1px solid #47535c;
 border-radius: .35rem;
 background: linear-gradient(90deg,#1a242d,#29343e 50%,#141e27);
 text-align: center;
}
.dj-pitch-caption, .dj-pitch-rail output, .dj-pitch-scale {
 font-size: .62rem;
 color: #dae9ee;
 font-variant-numeric: tabular-nums;
}
.dj-pitch-caption { letter-spacing: .1em; }
.dj-pitch-track { display: grid; grid-template-columns: auto minmax(0,1fr); min-height: 0; }
.dj-pitch-scale { display: flex; flex-direction: column; justify-content: space-between; padding-block: .48rem; }
.dj-pitch-scale span { white-space: nowrap; }
.dj-pitch-scale span::after { content: '–'; margin-inline-start: .12em; opacity: .65; }
.dj-pitch-scale span:nth-child(3) { color: var(--deck-light); }
:root body .dj-pitch-track input[type=range] {
 appearance: none;
 writing-mode: vertical-lr;
 direction: ltr;
 width: 100%;
 height: 100%;
 min-width: 0;
 min-height: 0;
 margin: 0;
 border: 0;
 border-radius: 0;
 background: linear-gradient(#080d13,#0d151b) center/4px calc(100% - 10px) no-repeat;
 cursor: ns-resize;
 touch-action: none;
}
:root body .dj-pitch-track input[type=range]::-webkit-slider-runnable-track { background: transparent; }
.dj-pitch-track input::-webkit-slider-thumb {
 appearance: none;
 width: 16px;
 height: 10px;
 border: 1px solid #d5e0e7;
 border-radius: 2px;
 background: linear-gradient(#dae2e8 38%,#53616e 40% 57%,#b0bac5 59%);
}
.dj-pitch-track input::-moz-range-thumb {
 width: 16px;
 height: 10px;
 border: 1px solid #d5e0e7;
 border-radius: 2px;
 background: linear-gradient(#dae2e8 38%,#53616e 40% 57%,#b0bac5 59%);
}
.dj-pitch-track input:disabled { opacity: .45; cursor: default; }
.dj-pitch-rail button { min-width: 0; padding: .2rem; font-size: .65rem; }
.dj-deck input[type=number] { width: 8ch; }
.dj-monitor { color: #ffe19b; font-size: .72rem; }
.dj-monitor:empty { display: none; }
.dj-analysis { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; font-size: .72rem; color: var(--deck-light); }
.dj-deck label { font-size: .72rem; color: #eaf5ff; }
.dj-mode button { touch-action: manipulation; }
.dj-mode button[aria-pressed=true] { background: #235364; border-color: #8df5e3; color: #fff; }
.dj-pads { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(.18rem, .65vw, .45rem); }
.dj-pads button {
 min-width: 0;
 min-height: clamp(2.65rem, 6vw, 5rem);
 padding: .23rem;
 border-color: color-mix(in srgb, var(--deck-light) 44%, #132d40);
 border-radius: .35rem;
 background: linear-gradient(145deg, #314650, #14222e);
 box-shadow: inset 0 1px 0 #fff2, 0 2px 0 #050915;
 color: #e9f5ff;
 font-size: clamp(.64rem, .9vw, .82rem);
 overflow-wrap: anywhere;
}
.dj-pads button[data-kind=cue] { background: linear-gradient(145deg, #24445e, #132633); }
.dj-pads button[data-kind=repeat] { background: linear-gradient(145deg, #22535b, #13252f); }
.dj-pads button[data-kind=loop] { background: linear-gradient(145deg, #3e563b, #192b21); }
.dj-pads button[data-kind=slice] { background: linear-gradient(145deg, #4a3665, #211d36); }
.dj-pads button[aria-pressed=true] { border-color: var(--deck-light); box-shadow: inset 0 0 12px var(--deck-wash), 0 0 6px var(--deck-wash); }
.dj-pads[data-layer=auto] { min-height: calc(4 * clamp(2.65rem, 6vw, 5rem) + 3 * clamp(.18rem, .65vw, .45rem)); align-content: end; }
.dj-pads button[data-kind=loop][aria-pressed=true] { border-color: #e4ff77; background: linear-gradient(145deg, #586738, #283a24); }
.dj-pads button:disabled { opacity: .42; }
.dj-pads button:is([data-kind=repeat], [data-kind=slice]), .dj-cue-tools button[data-cue-roll] { touch-action: none; }
.dj-mixer { grid-area: mixer; align-self: center; --accent: #91e8db; }
.dj-mixer h3 { margin: 0; font-size: .88rem; }
.dj-mixer label { min-width: 0; font-size: .74rem; color: #eef5ff; }
.dj-mixer input[type=range] { width: 100%; }
.dj-mixer .mix-pad-card { min-width: 0; padding: .25rem; }
.dj-mixer .mix-pad-heading { flex-wrap: wrap; gap: .3rem; }
.dj-mixer .mix-pad-card .mix-cube-surface { min-height: 7rem; height: auto; touch-action: none; }
.dj-mixer .mix-pad-axes { flex-direction: column; gap: .35rem; }
.dj-mixer .mix-pad-axes label { min-width: 0; }
.dj-mixer .mix-pad-card output { font-size: .68rem; }
.dj-mixer .mix-pad-top, .dj-mixer .mix-pad-bottom { display: none; }
.dj-mode [hidden] { display: none; }
@media (max-width: 760px) {
 .dj-console { grid-template-columns: minmax(0, 1fr) 8rem minmax(0, 1fr); }
 .dj-mixer button, .dj-banks button, .dj-transport button { font-size: .68rem; padding: .3rem; }
}
@media (max-width: 580px) {
 .dj-console { grid-template-columns: 1fr 1fr; grid-template-areas: "deck-a deck-b" "mixer mixer"; }
 .dj-mixer { grid-template-columns: 1fr 1fr; }
 .dj-mixer .mix-pad-card { grid-column: 1 / -1; }
 .dj-deck-label h3 { font-size: .78rem; }
}
@media (max-width: 400px) {
 .dj-console { grid-template-columns: 1fr; grid-template-areas: "deck-a" "mixer" "deck-b"; }
}
@media (prefers-reduced-motion: reduce) {
 .dj-deck .dj-reel-spokes, .dj-deck .dj-deck-state::before { animation: none; }
}
