/* DJ-X 2D Professional DJ Interface */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Multi-touch optimization - prevent browser gestures */
html, body {
  touch-action: none;
  overscroll-behavior: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Interactive elements need explicit touch handling */
.turntable,
.vinyl,
input[type="range"],
button,
.transport-btn,
.loop-btn,
.fx-btn,
.waveform-container {
  touch-action: none;
}

:root {
  --bg-dark: #0a0a0f;
  --bg-panel: #12121a;
  --bg-control: #1a1a25;
  --bg-deck: linear-gradient(145deg, #15151f 0%, #0d0d14 100%);
  --accent-cyan: #00ffff;
  --accent-magenta: #ff00ff;
  --accent-blue: #0066ff;
  --accent-orange: #ff6600;
  --accent-green: #00ff66;
  --accent-red: #ff3366;
  --text-primary: #ffffff;
  --text-secondary: #888899;
  --border-color: #2a2a3a;
  --vinyl-dark: #111;
  --vinyl-groove: #1a1a1a;
}

body {
  font-family: 'Orbitron', sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

/* Header */
.dj-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 20px;
  background: linear-gradient(180deg, #1a1a25 0%, #0f0f18 100%);
  border-bottom: 1px solid var(--border-color);
  height: 50px;
}

.logo {
  font-size: 1.8rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-magenta));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 20px;
}

.master-section {
  display: flex;
  align-items: center;
  gap: 10px;
}

.master-section label {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.master-slider {
  width: 100px;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-magenta));
  border-radius: 3px;
  cursor: pointer;
}

.master-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.header-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.header-btn:hover {
  background: rgba(0, 255, 255, 0.2);
  border-color: var(--accent-cyan);
}

/* Recording Section */
.recording-section {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.record-btn {
  font-size: 1.2rem;
  color: #ff4444;
  padding: 4px 8px;
}

.record-btn.recording {
  background: rgba(255, 0, 0, 0.3);
  border-color: #ff4444;
  animation: recording-pulse 1s infinite;
}

@keyframes recording-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.record-time {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 45px;
  font-family: 'Orbitron', monospace;
}

.record-format-select,
.record-resolution-select {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 4px 8px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.7rem;
  cursor: pointer;
}

.record-format-select:hover,
.record-resolution-select:hover {
  border-color: var(--accent-cyan);
}

/* Main DJ Console */
.dj-console {
  display: grid;
  grid-template-columns: 1fr minmax(240px, 280px) 1fr;
  gap: 10px;
  padding: 10px;
  height: calc(100vh - 50px);
  width: 100%;
  max-width: 100vw;
  overflow: hidden;
}

/* Deck Styling */
.deck {
  background: var(--bg-deck);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.deck-left {
  box-shadow: inset 0 0 30px rgba(0, 255, 255, 0.03), 0 0 20px rgba(0, 0, 0, 0.5);
}

.deck-right {
  box-shadow: inset 0 0 30px rgba(255, 0, 255, 0.03), 0 0 20px rgba(0, 0, 0, 0.5);
}

/* Waveform Section */
.waveform-section {
  background: #0a0a12;
  border-radius: 8px;
  padding: 8px;
  border: 1px solid var(--border-color);
}

.track-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.track-name {
  font-size: 0.75rem;
  color: var(--accent-cyan);
  max-width: 70%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deck-right .track-name {
  color: var(--accent-magenta);
}

.bpm-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.bpm-adj-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
  padding: 2px 6px;
  font-size: 0.7rem;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s;
  min-width: 22px;
}

.bpm-adj-btn.small {
  padding: 2px 4px;
  min-width: 18px;
  font-weight: bold;
}

.bpm-adj-btn:hover {
  background: rgba(255, 136, 0, 0.3);
  border-color: var(--accent-orange);
}

.bpm-adj-btn:active {
  background: rgba(255, 136, 0, 0.5);
  transform: scale(0.95);
}

.bpm-display {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-orange);
  min-width: 65px;
  text-align: center;
}

.waveform-container {
  height: 80px;
  background: linear-gradient(180deg, #0d0d15 0%, #080810 100%);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.waveform-container canvas {
  width: 100%;
  height: 100%;
}

.time-display {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Turntable */
.turntable-container {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1;
  min-height: 150px;
}

.turntable {
  width: min(280px, 45vw);
  height: min(280px, 45vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #333, #111);
  box-shadow: 
    0 0 0 4px #222,
    0 0 0 6px #0a0a0a,
    0 10px 30px rgba(0, 0, 0, 0.7),
    inset 0 0 40px rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: grab;
  position: relative;
}

.turntable:active,
.turntable.scratching {
  cursor: grabbing;
  box-shadow: 
    0 0 0 4px #222,
    0 0 0 6px #0a0a0a,
    0 10px 30px rgba(0, 0, 0, 0.7),
    inset 0 0 40px rgba(0, 0, 0, 0.5),
    0 0 30px rgba(0, 255, 255, 0.3);
}

.vinyl {
  width: 92%;
  height: 92%;
  border-radius: 50%;
  background: var(--vinyl-dark);
  position: relative;
  transition: transform 0.05s linear;
}

.vinyl.spinning {
  animation: spin 1.8s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.vinyl-grooves {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: repeating-radial-gradient(
    circle at center,
    var(--vinyl-dark) 0px,
    var(--vinyl-groove) 1px,
    var(--vinyl-dark) 2px
  );
}

.vinyl-label {
  position: absolute;
  width: 32%;
  height: 32%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: linear-gradient(135deg, #333 0%, #1a1a1a 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.deck-left .vinyl-label {
  background: linear-gradient(135deg, #004444 0%, #001a1a 100%);
  border: 2px solid var(--accent-cyan);
}

.deck-right .vinyl-label {
  background: linear-gradient(135deg, #440044 0%, #1a001a 100%);
  border: 2px solid var(--accent-magenta);
}

.label-text {
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.vinyl-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  background: #fff;
  border-radius: 50%;
  top: 25%;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Deck Controls */
.deck-controls {
  display: grid;
  grid-template-columns: 50px 1fr 1fr 1fr;
  gap: 6px;
  align-items: stretch;
  padding-top: 6px;
  position: relative;
  z-index: 5;
}

/* Pitch Section */
.pitch-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: -40px;
}

.pitch-section label {
  font-size: 0.6rem;
  color: var(--text-secondary);
}

.pitch-slider {
  writing-mode: vertical-lr;
  direction: rtl;
  width: 28px;
  height: 120px;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
}

.pitch-slider::-webkit-slider-runnable-track {
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #0a2a2a 0%, #1a1a2a 50%, #2a0a2a 100%);
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.deck-left .pitch-slider::-webkit-slider-runnable-track {
  background: linear-gradient(180deg, var(--accent-cyan) 0%, #0a1a1a 50%, #051010 100%);
}

.deck-right .pitch-slider::-webkit-slider-runnable-track {
  background: linear-gradient(180deg, var(--accent-magenta) 0%, #1a0a1a 50%, #100510 100%);
}

.pitch-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 36px;
  height: 12px;
  background: linear-gradient(180deg, #fff, #aaa);
  border-radius: 2px;
  cursor: pointer;
  border: 1px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

.pitch-value {
  font-size: 0.65rem;
  color: var(--accent-green);
}

/* Transport Controls */
.transport-controls {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
}

.transport-btn {
  padding: 8px 10px;
  border: none;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cue-btn {
  background: linear-gradient(180deg, #ff6600, #cc5500);
  color: #fff;
  box-shadow: 0 4px 15px rgba(255, 102, 0, 0.3);
}

.cue-btn:hover {
  background: linear-gradient(180deg, #ff7711, #dd6611);
  transform: translateY(-1px);
}

.cue-btn:active, .cue-btn.active {
  background: #ff8833;
  box-shadow: 0 0 20px rgba(255, 102, 0, 0.6);
}

.play-btn {
  background: linear-gradient(180deg, #00cc66, #009944);
  color: #fff;
  font-size: 1.2rem;
  box-shadow: 0 4px 15px rgba(0, 204, 102, 0.3);
}

.play-btn:hover {
  background: linear-gradient(180deg, #00dd77, #00aa55);
  transform: translateY(-1px);
}

.play-btn.playing {
  background: linear-gradient(180deg, #ff3366, #cc2244);
  box-shadow: 0 0 20px rgba(255, 51, 102, 0.6);
}

/* Transform Button - old school audio cut/stutter effect */
.transform-btn {
  background: linear-gradient(180deg, #6600cc, #4400aa);
  color: #fff;
  font-size: 0.65rem;
  box-shadow: 0 4px 15px rgba(102, 0, 204, 0.3);
}

.transform-btn:hover {
  background: linear-gradient(180deg, #7711dd, #5511bb);
  transform: translateY(-1px);
}

.transform-btn:active, .transform-btn.active {
  background: linear-gradient(180deg, #9933ff, #7722dd);
  box-shadow: 0 0 25px rgba(153, 51, 255, 0.8);
  transform: scale(0.95);
}

.deck-left .transform-btn:active, .deck-left .transform-btn.active {
  background: linear-gradient(180deg, var(--accent-cyan), #00cccc);
  box-shadow: 0 0 25px rgba(0, 255, 255, 0.8);
}

.deck-right .transform-btn:active, .deck-right .transform-btn.active {
  background: linear-gradient(180deg, var(--accent-magenta), #cc00cc);
  box-shadow: 0 0 25px rgba(255, 0, 255, 0.8);
}

/* Loop Section */
.loop-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
}

.loop-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  flex: 1;
}

.loop-btn {
  padding: 8px 10px;
  background: var(--bg-control);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.6rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loop-btn:hover {
  background: rgba(0, 255, 255, 0.1);
  border-color: var(--accent-cyan);
}

.loop-btn.active {
  background: var(--accent-cyan);
  color: #000;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

.loop-btn.waiting {
  background: rgba(255, 165, 0, 0.3);
  border-color: #ffa500;
  color: #ffa500;
  animation: pulse-waiting 1s ease-in-out infinite;
}

@keyframes pulse-waiting {
  0%, 100% { opacity: 1; box-shadow: 0 0 5px rgba(255, 165, 0, 0.3); }
  50% { opacity: 0.7; box-shadow: 0 0 15px rgba(255, 165, 0, 0.6); }
}

.loop-btn.small {
  padding: 6px 8px;
}

.loop-active-btn {
  /* In grid, takes full column */
}

/* Utility Controls */
.utility-controls {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
}

/* Transform button in utility section */
.utility-controls .transform-btn {
  padding: 8px 10px;
  font-size: 0.65rem;
  flex: 1;
}

.sync-btn {
  padding: 8px 10px;
  background: linear-gradient(180deg, #0066ff, #0044cc);
  border: none;
  border-radius: 4px;
  color: #fff;
  font-family: inherit;
  font-size: 0.65rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sync-btn:hover {
  background: linear-gradient(180deg, #0077ff, #0055dd);
}

.sync-btn.active {
  background: var(--accent-cyan);
  color: #000;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.6);
}

.quantize-btn {
  padding: 8px 10px;
  background: var(--bg-control);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.65rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quantize-btn.active {
  background: var(--accent-magenta);
  color: #000;
  border-color: var(--accent-magenta);
}

.keylock-btn {
  padding: 4px 6px;
  background: var(--bg-control);
  border: 1px solid var(--border-color);
  border-radius: 3px;
  color: var(--text-secondary);
  font-size: 0.6rem;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1;
}

.keylock-btn.active {
  background: var(--accent-green);
  color: #000;
  border-color: var(--accent-green);
}

.load-btn {
  padding: 8px 10px;
  background: linear-gradient(180deg, #00cccc, #009999);
  border: none;
  border-radius: 4px;
  color: #000;
  font-family: inherit;
  font-size: 0.65rem;
  font-weight: 700;
  cursor: pointer;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.load-btn:hover {
  background: linear-gradient(180deg, #00dddd, #00aaaa);
  transform: translateY(-1px);
}

/* Mixer */
.mixer {
  background: var(--bg-panel);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  overflow: hidden;
}

/* Mixer Header - Output selects */
.mixer-header {
  display: flex;
  gap: 8px;
}

.mixer-header .output-select {
  flex: 1;
  padding: 4px;
  background: var(--bg-control);
  border: 1px solid var(--border-color);
  border-radius: 3px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.5rem;
}

/* Phase Meter */
.phase-meter-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px;
  background: var(--bg-control);
  border-radius: 6px;
}

.phase-meter-section label {
  font-size: 0.55rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.phase-meter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
}

.phase-track {
  position: relative;
  width: 100%;
  height: 12px;
  background: linear-gradient(90deg, var(--accent-cyan) 0%, #1a1a25 50%, var(--accent-magenta) 100%);
  border-radius: 6px;
  overflow: hidden;
}

.phase-center-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #fff;
  transform: translateX(-50%);
  z-index: 1;
}

.phase-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  background: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
  z-index: 2;
  transition: left 0.05s linear;
}

.phase-indicator.in-sync {
  background: var(--accent-green);
  box-shadow: 0 0 12px var(--accent-green);
}

.phase-status {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.phase-status.in-sync {
  color: var(--accent-green);
}

/* Mixer Body - Two channel strips side by side */
.mixer-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

/* Channel Strip - Vertical layout like real mixer */
.channel-strip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: var(--bg-control);
  border-radius: 8px;
  padding: 8px 6px;
  height: 100%;
  min-height: 0;
}

.channel-label {
  font-size: 0.85rem;
  font-weight: 900;
  color: var(--text-secondary);
}

.channel-a .channel-label { color: var(--accent-cyan); }
.channel-b .channel-label { color: var(--accent-magenta); }

/* Strip Control - Each knob section (Gain, HI, MID, LOW) */
.strip-control {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 100%;
  flex: 0 0 auto;
}

.strip-control label {
  font-size: 0.55rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Vertical knob style */
.knob-vertical {
  width: 100%;
  height: 8px;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(90deg, var(--accent-blue) 0%, #333 50%, var(--accent-red) 100%);
  border-radius: 4px;
  cursor: pointer;
}

.knob-vertical::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: var(--accent-orange);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(255, 102, 0, 0.5);
}

/* Fader Block - VU meter + volume fader */
.fader-block {
  display: flex;
  gap: 6px;
  align-items: stretch;
  width: 100%;
  min-height: 80px;
  margin-top: auto;
  flex: 1 1 auto;
}

/* Channel B: VU meter on right side of fader */
.channel-b .fader-block {
  flex-direction: row-reverse;
}

.vu-meter {
  width: 12px;
  background: #0a0a0a;
  border-radius: 3px;
  overflow: hidden;
  display: flex;
  flex-direction: column-reverse;
}

.vu-bar {
  background: linear-gradient(180deg, var(--accent-red), var(--accent-orange), var(--accent-green));
  transition: height 0.05s;
  height: 0%;
}

.volume-fader {
  flex: 1;
  writing-mode: vertical-lr;
  direction: rtl;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
}

.volume-fader::-webkit-slider-runnable-track {
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #1a3a3a 0%, #0a1a1a 100%);
  border-radius: 4px;
}

.channel-strip.channel-a .volume-fader::-webkit-slider-runnable-track {
  background: linear-gradient(180deg, var(--accent-cyan) 0%, #0a2a2a 50%, #051515 100%);
}

.channel-strip.channel-b .volume-fader::-webkit-slider-runnable-track {
  background: linear-gradient(180deg, var(--accent-magenta) 0%, #2a0a2a 50%, #150515 100%);
}

.volume-fader::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 100%;
  height: 18px;
  background: linear-gradient(180deg, #fff, #aaa);
  border-radius: 3px;
  cursor: pointer;
  border: 1px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

/* Mixer Footer - Crossfader at bottom */
.mixer-footer {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
}

/* Crossfader Curve Buttons */
.curve-section {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

.curve-btn {
  width: 32px;
  height: 24px;
  background: var(--bg-control);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s;
}

.curve-btn:hover {
  border-color: var(--accent-cyan);
  color: var(--text-primary);
}

.curve-btn.active {
  background: var(--accent-cyan);
  color: #000;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 8px rgba(0, 255, 255, 0.4);
}

/* Crossfader */
.crossfader-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.crossfader {
  width: 100%;
  height: 20px;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(90deg, var(--accent-cyan), #333, var(--accent-magenta));
  border-radius: 10px;
  cursor: pointer;
}

.crossfader::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 30px;
  height: 30px;
  background: linear-gradient(180deg, #666, #333);
  border-radius: 5px;
  cursor: pointer;
  border: 2px solid #888;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.crossfader-labels {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-size: 0.6rem;
  color: var(--text-secondary);
}

/* Output Section */
.output-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.output-section label {
  font-size: 0.5rem;
  color: var(--text-secondary);
  text-align: center;
}

.output-select {
  width: 100%;
  padding: 4px;
  background: var(--bg-control);
  border: 1px solid var(--border-color);
  border-radius: 3px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.55rem;
  cursor: pointer;
}

/* Drop Zone */
.drop-zone {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.drop-zone.visible {
  display: flex;
}

.drop-content {
  text-align: center;
  padding: 60px;
  border: 3px dashed var(--accent-cyan);
  border-radius: 20px;
  background: rgba(0, 255, 255, 0.05);
}

.drop-icon {
  font-size: 4rem;
  margin-bottom: 20px;
}

.drop-content p {
  font-size: 1.2rem;
  color: var(--accent-cyan);
}

/* MIDI Container styling */
#midi-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

#midi-container select {
  background: var(--bg-control);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.65rem;
  padding: 4px 8px;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .dj-console {
    grid-template-columns: 1fr minmax(180px, 220px) 1fr;
  }
  
  .turntable {
    width: 160px;
    height: 160px;
  }
  
  .vinyl {
    width: 145px;
    height: 145px;
  }
}

@media (max-width: 900px) {
  .dj-console {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }
  
  .mixer {
    order: -1;
    flex-direction: row;
    justify-content: space-around;
  }
  
  .mixer-channel {
    flex-direction: row;
    gap: 15px;
  }
  
  .volume-section {
    height: 100px;
  }
}

/* Settings Button */
.settings-btn {
  font-size: 1.2rem;
  opacity: 0.8;
  transition: opacity 0.2s, transform 0.2s;
}

.settings-btn:hover {
  opacity: 1;
  transform: rotate(30deg);
}

/* Settings Modal */
.settings-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.settings-modal.open {
  display: flex;
}

.settings-content {
  background: linear-gradient(145deg, #1a1a25 0%, #12121a 100%);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  width: 90%;
  max-width: 450px;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(0, 255, 255, 0.1);
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.3);
}

.settings-header h2 {
  font-size: 1rem;
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-magenta));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.settings-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s;
}

.settings-close:hover {
  color: var(--text-primary);
}

.settings-body {
  padding: 20px;
  overflow-y: auto;
  max-height: calc(80vh - 60px);
}

.settings-section {
  margin-bottom: 24px;
}

.settings-section:last-child {
  margin-bottom: 0;
}

.settings-section h3 {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-cyan);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
}

.settings-row label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.settings-select {
  background: var(--bg-control);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.7rem;
  padding: 6px 10px;
  min-width: 180px;
  cursor: pointer;
}

.settings-select:hover {
  border-color: var(--accent-cyan);
}

.settings-select:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 8px rgba(0, 255, 255, 0.3);
}

/* MIDI settings within modal */
.midi-settings-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.midi-settings-container .settings-row {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.midi-settings-container select {
  width: 100%;
  background: var(--bg-control);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.7rem;
  padding: 6px 10px;
}

.midi-settings-container button {
  background: linear-gradient(145deg, #2a2a3a, #1a1a25);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.7rem;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.midi-settings-container button:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.2);
}

/* MIDI Connect Button */
.midi-connect-btn {
  width: 100%;
  background: linear-gradient(145deg, #2a2a3a, #1a1a25);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.75rem;
  padding: 10px 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.midi-connect-btn:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.2);
}

/* MIDI Controls Container */
.midi-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.midi-controls .settings-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
}

.midi-controls label {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.midi-controls select {
  width: 100%;
  background: var(--bg-control);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.7rem;
  padding: 8px 10px;
}

.midi-controls select:hover,
.midi-controls select:focus {
  border-color: var(--accent-cyan);
  outline: none;
}

.midi-learn-btn {
  width: 100%;
  background: linear-gradient(145deg, #2a2a3a, #1a1a25);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.75rem;
  padding: 10px 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.midi-learn-btn:hover {
  border-color: var(--accent-magenta);
  box-shadow: 0 0 10px rgba(255, 0, 255, 0.2);
}

.midi-learn-btn.active {
  background: linear-gradient(145deg, #4a2a4a, #3a1a3a);
  border-color: var(--accent-magenta);
  box-shadow: 0 0 15px rgba(255, 0, 255, 0.3);
}

/* Headphone Cue Button */
.cue-headphone-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(145deg, #2a2a3a, #1a1a25);
  border: 2px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px auto;
}

.cue-headphone-btn:hover {
  border-color: var(--accent-green);
  color: var(--accent-green);
}

.cue-headphone-btn.active {
  background: linear-gradient(145deg, #1a3a2a, #0a2a1a);
  border-color: var(--accent-green);
  color: var(--accent-green);
  box-shadow: 0 0 12px rgba(0, 255, 102, 0.4);
}

.channel-a .cue-headphone-btn.active {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(0, 255, 255, 0.4);
}

.channel-b .cue-headphone-btn.active {
  border-color: var(--accent-magenta);
  color: var(--accent-magenta);
  box-shadow: 0 0 12px rgba(255, 0, 255, 0.4);
}

/* Video Preview PIP - overlay in turntable corner */
.video-preview-pip {
  display: none;
  position: absolute;
  top: 8px;
  width: 120px;
  height: 68px;
  background: #000;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  z-index: 10;
  pointer-events: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.deck-left .video-preview-pip {
  left: 8px;
  border-color: rgba(0, 255, 255, 0.5);
}

.deck-right .video-preview-pip {
  right: 8px;
  border-color: rgba(255, 0, 255, 0.5);
}

.deck.has-video .video-preview-pip {
  display: block;
}

.deck-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

/* Turntable container needs relative positioning for PIP */
.turntable-container {
  position: relative;
  overflow: hidden;
  min-width: 0;
}

/* Video preview needs to be inside turntable for proper positioning */
.video-preview-pip video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Video Output Display - Embedded in mixer center */
.video-output-container {
  display: none;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  max-height: clamp(120px, 20vh, 180px);
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 8px;
  flex: 0 0 auto;
}

.video-output-container.visible {
  display: flex;
  flex-direction: column;
}

.video-output-container.fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  max-height: 100%;
  border-radius: 0;
  z-index: 10000;
  margin: 0;
}

.video-output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  background: linear-gradient(180deg, #2a2a3a, #1a1a25);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.65rem;
  color: var(--text-secondary);
}

.video-output-controls {
  display: flex;
  gap: 4px;
}

.video-output-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 2px 4px;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.video-output-btn:hover {
  color: var(--text-primary);
}

.video-output-canvas {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  background: #000;
  display: block;
  object-fit: contain;
  flex: 1;
}

.video-output-container.fullscreen .video-output-canvas {
  width: 100%;
  height: calc(100% - 28px);
  max-width: 100%;
  max-height: calc(100% - 28px);
  object-fit: contain;
}

