/* PULSE 4K — Pro Club Lighting & VJ Director Interface */
:root {
  --bg: #04050a;
  --glass: rgba(10, 13, 22, 0.72);
  --glass-strong: rgba(8, 11, 20, 0.88);
  --border: rgba(255, 255, 255, 0.11);
  --border-bright: rgba(255, 255, 255, 0.24);
  --text: #f2f5ff;
  --text-dim: #9aa4c2;
  --accent: #ff1b8d;
  --accent-2: #00f0ff;
  --danger: #ff3b5c;
  --radius: 14px;
  --font-ui: 'Segoe UI', 'Noto Sans Thai', system-ui, -apple-system, sans-serif;
  --font-mono: 'Cascadia Code', 'JetBrains Mono', 'Consolas', monospace;
}

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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

/* DUAL FULL-VIEWPORT 4K CANVAS STACK */
#stage-viewport {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: #000;
  z-index: 1;
}

#gl-canvas,
#three-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#gl-canvas {
  z-index: 1;
}

#three-canvas {
  z-index: 2;
}

#three-canvas.orbit-cursor {
  cursor: grab;
}

#three-canvas.orbit-cursor:active {
  cursor: grabbing;
}

/* TOP FLOATING TELEMETRY BAR */
.glass-bar {
  position: fixed;
  top: 12px;
  left: 14px;
  right: 14px;
  height: 48px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 14px;
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.48);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

body.hud-hidden .glass-bar,
body.hud-hidden .vj-deck {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-16px);
}

body.hud-hidden .vj-deck {
  transform: translateY(28px);
}

.hud-left,
.hud-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  letter-spacing: 0.08em;
}

.pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 12px var(--accent-2);
  transition: transform 0.08s ease;
}

.pulse-dot.hit {
  transform: scale(1.65);
  background: #ffffff;
  box-shadow: 0 0 18px var(--accent), 0 0 28px #ffffff;
}

.brand-name {
  font-weight: 800;
  font-size: 14px;
  color: #fff;
}

.brand-4k {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 5px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #05070e;
}

.telemetry-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  min-width: 0;
}

.source-indicator {
  color: var(--text-dim);
  max-width: 190px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.source-indicator.live {
  color: #6effb8;
  font-weight: 600;
}

.divider {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.14);
}

.bpm-box {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-family: var(--font-mono);
}

.bpm-val {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  min-width: 30px;
  text-align: right;
}

.bpm-unit {
  font-size: 10px;
  color: var(--text-dim);
}

.beat-leds {
  display: flex;
  align-items: center;
  gap: 4px;
}

.b-led {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  transition: background 0.06s, box-shadow 0.06s;
}

.b-led.on {
  background: var(--accent-2);
  box-shadow: 0 0 10px var(--accent-2);
}

.b-led.downbeat.on {
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.drop-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 0.08em;
  transition: all 0.12s ease;
}

.drop-badge.active {
  background: linear-gradient(90deg, var(--accent), #ff9500);
  color: #fff;
  box-shadow: 0 0 18px var(--accent);
  transform: scale(1.08);
}

.perf-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

.perf-pill .sep {
  margin: 0 4px;
  opacity: 0.45;
}

/* BUTTONS */
button {
  font-family: inherit;
  color: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  flex-shrink: 0;
  background: linear-gradient(135deg, #ff1b8d, #7b2cbf);
  box-shadow: 0 0 18px rgba(255, 27, 141, 0.38);
  transition: transform 0.14s ease, filter 0.14s ease, box-shadow 0.14s ease;
}

.btn-primary:hover {
  filter: brightness(1.12);
  box-shadow: 0 0 24px rgba(255, 27, 141, 0.6);
  transform: translateY(-1px);
}

.btn-glass {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: all 0.14s ease;
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.13);
  border-color: var(--border-bright);
}

.btn-glass.active {
  background: rgba(0, 240, 255, 0.16);
  border-color: var(--accent-2);
  color: #fff;
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.25);
}

.btn-xs {
  padding: 4px 9px;
  font-size: 11px;
}

.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-dim);
  transition: all 0.14s ease;
}

.btn-icon:hover,
.btn-icon.active {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border-color: var(--border-bright);
}

/* HIDDEN HUD RESTORE CONTROLS */
.hidden-hint {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%) translateY(-12px);
  z-index: 40;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(10, 12, 20, 0.85);
  border: 1px solid var(--border-bright);
  font-size: 12px;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.hidden-hint.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.restore-hud-btn {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 45;
  padding: 7px 12px;
  border-radius: 9px;
  font-size: 11.5px;
  font-weight: 600;
  background: rgba(10, 13, 24, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

body.hud-hidden .restore-hud-btn {
  opacity: 0.22;
  pointer-events: auto;
}

body.hud-hidden .restore-hud-btn:hover {
  opacity: 1;
  background: rgba(10, 13, 24, 0.9);
  color: #fff;
}

/* BOTTOM VJ & LIGHTING DIRECTOR CONSOLE */
.vj-deck {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: 14px;
  max-width: 1260px;
  margin: 0 auto;
  z-index: 30;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 16px;
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.62);
  overflow: hidden;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.vj-deck.collapsed {
  opacity: 0;
  pointer-events: none;
  transform: translateY(28px);
}

.deck-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
  flex-wrap: wrap;
}

.deck-tabs {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-wrap: nowrap;
}

.deck-tab {
  padding: 5px 8.5px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
  transition: all 0.15s ease;
}

.deck-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.deck-tab.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

/* LIVE FX PADS */
.fx-pad-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.fx-pad {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #e6ecff;
  transition: all 0.1s ease;
}

.fx-pad kbd {
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.45);
  color: var(--text-dim);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.fx-pad:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.3);
}

.fx-pad.active {
  background: linear-gradient(135deg, var(--accent-2), #3a86ff);
  color: #03060f;
  border-color: #fff;
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.65);
  transform: scale(0.97);
}

.fx-pad.active kbd {
  background: rgba(0, 0, 0, 0.28);
  color: #fff;
}

.fx-pad.fx-accent {
  border-color: rgba(255, 149, 0, 0.45);
}

.fx-pad.fx-accent.active {
  background: linear-gradient(135deg, #ff1b8d, #ff9500);
  color: #fff;
  box-shadow: 0 0 22px rgba(255, 27, 141, 0.75);
}

.fx-pad.fx-danger.active {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 0 18px rgba(255, 59, 92, 0.75);
}

.fx-pad.fx-fire {
  border-color: rgba(255, 115, 0, 0.55);
}

.fx-pad.fx-fire.active {
  background: linear-gradient(135deg, #ff3b00, #ffb700);
  color: #fff;
  box-shadow: 0 0 24px rgba(255, 100, 0, 0.85);
}

.fx-pad.fx-co2 {
  border-color: rgba(120, 235, 255, 0.55);
}

.fx-pad.fx-co2.active {
  background: linear-gradient(135deg, #00d2ff, #e6fbff);
  color: #04101c;
  box-shadow: 0 0 24px rgba(130, 238, 255, 0.85);
}

.deck-body {
  padding: 12px 14px 13px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* BACKGROUND SOURCE BAR & LOCAL 8-CLIP GRID */
.bg-source-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.clip-audio-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.clip-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  max-height: 118px;
  overflow-y: auto;
  padding-right: 2px;
}

.clip-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 3px;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
  transition: all 0.14s ease;
  min-height: 52px;
}

.clip-card:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
  transform: translateY(-1px);
}

.clip-card.active {
  background: linear-gradient(145deg, rgba(255, 27, 141, 0.28), rgba(0, 240, 255, 0.22));
  border-color: var(--accent-2);
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.28);
}

.clip-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 9.5px;
}

.clip-idx {
  color: var(--accent-2);
  font-weight: 800;
}

.clip-size {
  color: var(--text-dim);
  font-size: 9px;
}

.clip-title {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

/* TAB 1: SCENES GRID (16 4K BACKGROUNDS) */
.scene-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
}

.scene-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2px;
  padding: 6px 8px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.09);
  text-align: left;
  transition: all 0.14s ease;
  min-height: 52px;
}

.scene-card:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.24);
  transform: translateY(-1px);
}

.scene-card.active {
  background: linear-gradient(155deg, rgba(255, 27, 141, 0.24), rgba(0, 240, 255, 0.18));
  border-color: var(--accent-2);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.24);
}

.scene-top {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.scene-num {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 800;
  color: var(--accent-2);
}

.scene-tag {
  font-family: var(--font-mono);
  font-size: 8px;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
}

.scene-code {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.scene-thai {
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.panel-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.control-group {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.control-group > label,
.sub-label {
  font-size: 11.5px;
  color: var(--text-dim);
  font-weight: 600;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.36);
  border: 1px solid rgba(255, 255, 255, 0.09);
  gap: 2px;
}

.segmented button {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-dim);
  transition: all 0.14s ease;
}

.segmented button:hover {
  color: #fff;
}

.segmented button.active {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

/* TAB 2: LIGHTING */
.lighting-layout {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 16px;
  align-items: start;
}

.section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 7px;
}

.palette-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.palette-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.09);
  text-align: left;
  transition: all 0.14s ease;
}

.palette-card:hover {
  background: rgba(255, 255, 255, 0.1);
}

.palette-card.active {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.13);
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.18);
}

.palette-swatch {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.palette-info {
  min-width: 0;
}

.palette-name {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.palette-thai {
  font-size: 10px;
  color: var(--text-dim);
}

.lighting-sliders {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}

.slider-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.slider-head {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-dim);
}

.slider-head span:last-child {
  font-family: var(--font-mono);
  color: #fff;
  font-weight: 700;
}

input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.14);
  outline: none;
}

input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent-2);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.65);
  cursor: pointer;
}

.toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: var(--text);
  cursor: pointer;
}

.toggle-chip input[type='checkbox'] {
  accent-color: var(--accent-2);
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.glass-select {
  background: rgba(8, 12, 22, 0.9);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 11.5px;
  font-family: inherit;
  outline: none;
}

.glass-input {
  background: rgba(8, 12, 22, 0.9);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 11.5px;
  font-family: var(--font-mono);
  outline: none;
  width: 160px;
}

.glass-input:focus {
  border-color: var(--accent-2);
}

.venue-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.inline-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-dim);
}

.slider-full-note {
  grid-column: 1 / -1;
  font-size: 11px;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 6px 10px;
}

.slider-full-note strong {
  color: var(--accent-2);
}

#gl-canvas.orbit-cursor {
  cursor: grab;
}

#gl-canvas.orbit-cursor:active {
  cursor: grabbing;
}

/* TAB 3: MEDIA DECK */
.media-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
}

.drop-zone {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 11px;
  border: 1.5px dashed rgba(0, 240, 255, 0.42);
  background: rgba(0, 240, 255, 0.05);
  cursor: pointer;
  transition: all 0.15s ease;
}

.drop-zone:hover,
.drop-zone.dragover {
  background: rgba(0, 240, 255, 0.12);
  border-color: var(--accent-2);
}

.drop-zone-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  background: rgba(0, 240, 255, 0.18);
  color: var(--accent-2);
  flex-shrink: 0;
}

.drop-zone-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.drop-zone-text strong {
  font-size: 12.5px;
  color: #fff;
}

.drop-zone-text span {
  font-size: 11px;
  color: var(--text-dim);
}

.media-thumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  overflow-x: auto;
  min-height: 56px;
  padding-bottom: 3px;
}

.empty-hint {
  font-size: 11.5px;
  color: var(--text-dim);
  opacity: 0.78;
}

.thumb-item {
  position: relative;
  width: 82px;
  height: 50px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.14);
  flex-shrink: 0;
  cursor: pointer;
  background: #000;
}

.thumb-item.active {
  border-color: var(--accent-2);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.45);
}

.thumb-item img,
.thumb-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb-del {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.76);
  color: #fff;
  font-size: 11px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumb-type {
  position: absolute;
  bottom: 2px;
  left: 3px;
  font-family: var(--font-mono);
  font-size: 8px;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
}

.slider-row-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

/* TAB 4: AUDIO & 4K PERFORMANCE */
.audio-layout {
  display: grid;
  grid-template-columns: 1.12fr 1fr;
  gap: 16px;
}

.source-btn-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 6px;
}

.source-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 11px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
  cursor: pointer;
  transition: all 0.14s ease;
}

.source-card:hover {
  background: rgba(255, 255, 255, 0.11);
  border-color: var(--border-bright);
}

.source-card.active {
  background: rgba(0, 240, 255, 0.14);
  border-color: var(--accent-2);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.22);
}

.source-card strong {
  font-size: 12px;
  color: #fff;
}

.source-card span {
  font-size: 10.5px;
  color: var(--text-dim);
}

.inline-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.meter-header {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-dim);
  margin-bottom: 5px;
}

#mini-spectrum-canvas {
  width: 100%;
  height: 58px;
  display: block;
  border-radius: 9px;
  background: rgba(2, 4, 10, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.quality-box {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-dim);
}

.mt-xs {
  margin-top: 7px;
}

.mt-sm {
  margin-top: 10px;
}

/* WELCOME / AUDIO CONNECT MODAL */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(3, 4, 10, 0.56);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: opacity 0.28s ease;
}

.modal-backdrop.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-card {
  width: 100%;
  max-width: 560px;
  padding: 28px 28px 22px;
  border-radius: 20px;
  background: rgba(9, 12, 22, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.72), 0 0 60px rgba(255, 27, 141, 0.16);
  text-align: center;
}

.modal-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.35);
  color: var(--accent-2);
  margin-bottom: 10px;
}

.modal-card h1 {
  font-size: 38px;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.05;
  margin-bottom: 10px;
}

.modal-card h1 span {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.modal-sub {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-dim);
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.modal-cta {
  width: 100%;
  padding: 13px 15px;
  border-radius: 12px;
  text-align: left;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.13);
  transition: all 0.16s ease;
}

.modal-cta:hover {
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.modal-cta.primary {
  background: linear-gradient(135deg, rgba(255, 27, 141, 0.28), rgba(0, 240, 255, 0.22));
  border-color: rgba(0, 240, 255, 0.52);
  box-shadow: 0 0 28px rgba(255, 27, 141, 0.22);
}

.modal-cta.primary:hover {
  box-shadow: 0 0 36px rgba(0, 240, 255, 0.38);
}

.cta-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 3px;
}

.cta-desc {
  font-size: 11.5px;
  color: var(--text-dim);
  line-height: 1.45;
}

.cta-desc b {
  color: #fff;
}

.modal-shortcuts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
  font-size: 11px;
  color: var(--text-dim);
}

.modal-shortcuts kbd,
.hidden-hint kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
}

.modal-skip {
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-dim);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.modal-skip:hover {
  color: #fff;
}

/* WINDOWS PER-APP AUDIO PICKER MODAL */
.picker-card {
  max-width: 640px;
  text-align: left;
  padding: 22px 24px 18px;
}

.picker-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.picker-head h2 {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  margin-top: 2px;
}

.picker-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.picker-divider {
  font-size: 11.5px;
  color: var(--text-dim);
  margin: 12px 0 8px;
  font-weight: 600;
}

.app-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 290px;
  overflow-y: auto;
  padding-right: 4px;
}

.app-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 13px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.11);
  text-align: left;
  transition: all 0.14s ease;
}

.app-item:hover {
  background: rgba(0, 240, 255, 0.12);
  border-color: rgba(0, 240, 255, 0.55);
  transform: translateY(-1px);
}

.app-item.master-item {
  background: linear-gradient(135deg, rgba(255, 27, 141, 0.2), rgba(0, 240, 255, 0.16));
  border-color: rgba(0, 240, 255, 0.45);
}

.app-item.selected {
  border-color: #6effb8;
  background: rgba(110, 255, 184, 0.12);
}

.app-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.app-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.24);
  flex-shrink: 0;
}

.app-dot.live {
  background: #42ff9e;
  box-shadow: 0 0 12px #42ff9e;
}

.app-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.app-meta strong {
  font-size: 13px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-meta span {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-meter-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.app-meter-bar {
  width: 64px;
  height: 7px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.app-meter-fill {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, #00f0ff, #42ff9e, #ff9500);
  transition: width 0.18s ease;
}

.app-connect-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

.picker-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
}

.ssl-warning {
  padding: 10px 13px;
  border-radius: 10px;
  background: rgba(255, 165, 0, 0.14);
  border: 1px solid rgba(255, 165, 0, 0.45);
  color: #ffe0a3;
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 12px;
}

.guide-steps {
  margin-top: 12px;
  padding: 11px 14px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.6;
}

.guide-title {
  font-weight: 700;
  color: #d7ecff;
  margin-bottom: 5px;
}

.guide-steps ol {
  padding-left: 18px;
}

.guide-steps b {
  color: #fff;
}

.picker-row-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 9px;
  margin-top: 12px;
}

.modal-cta.compact {
  padding: 10px 12px;
}

.modal-cta.compact .cta-title {
  font-size: 12.5px;
}

.modal-cta.compact .cta-desc {
  font-size: 10.5px;
}

.btn-perf-tier {
  border-color: rgba(0, 240, 255, 0.34);
  color: #b8faff;
}

.btn-perf-tier:hover {
  border-color: rgba(0, 240, 255, 0.72);
  color: #fff;
}

.gpu-detected-hint {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 5px 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* PRO DJ BPM SYNC BAR */
.bpm-box {
  cursor: pointer;
}

.bpm-lock-icon {
  font-size: 10px;
  margin-right: 1px;
}

.bpm-sync-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.bpm-sync-bar kbd {
  font-size: 9px;
  opacity: 0.72;
  margin-left: 2px;
  font-family: var(--font-mono);
}

.bpm-tap-btn {
  border-color: rgba(0, 240, 255, 0.45);
  color: #b8faff;
  font-weight: 700;
}

.bpm-tap-btn:active {
  background: rgba(0, 240, 255, 0.28);
  transform: scale(0.96);
}

.bpm-stepper {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.bpm-num-input {
  width: 74px;
  text-align: center;
  background: rgba(8, 12, 22, 0.92);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 7px;
  padding: 4px 6px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-mono);
  outline: none;
  -moz-appearance: textfield;
}

.bpm-num-input::-webkit-outer-spin-button,
.bpm-num-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.bpm-num-input:focus {
  border-color: var(--accent-2);
}

.bpm-lock-btn.locked {
  border-color: rgba(255, 200, 50, 0.7);
  background: rgba(255, 180, 30, 0.16);
  color: #ffe28a;
  font-weight: 700;
}

/* EXTRA PERFORMANCE PADS & CUSTOM KEYBIND MODAL */
.fx-pad.fx-punch {
  border-color: rgba(168, 85, 247, 0.45);
  color: #e9d5ff;
}

.fx-pad.fx-punch.active {
  background: rgba(168, 85, 247, 0.34);
  border-color: #c084fc;
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.55);
}

.fx-pad.fx-glitch {
  border-color: rgba(236, 72, 153, 0.45);
  color: #fbcfe8;
}

.fx-pad.fx-glitch.active {
  background: rgba(236, 72, 153, 0.34);
  border-color: #f472b6;
  box-shadow: 0 0 14px rgba(236, 72, 153, 0.55);
}

.fx-pad.fx-action {
  border-color: rgba(0, 240, 255, 0.3);
  color: #cffafe;
}

.fx-pad.fx-keys {
  border-color: rgba(250, 204, 21, 0.45);
  color: #fef08a;
}

.keybind-card {
  max-width: 780px;
  width: min(780px, 95vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.global-hotkey-panel {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(0, 240, 255, 0.24);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.global-hotkey-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.global-status-pill {
  font-size: 12px;
  font-weight: 700;
  color: #e2e8f0;
}

.global-status-pill.connected {
  color: #4ade80;
}

.global-hotkey-toggles {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.global-hotkey-note {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.45;
}

.global-hotkey-note code {
  background: rgba(0, 0, 0, 0.45);
  padding: 1px 5px;
  border-radius: 4px;
  color: #7dd3fc;
  font-family: var(--font-mono);
}

.keybind-list-wrap {
  overflow-y: auto;
  max-height: 44vh;
  padding-right: 4px;
}

.keybind-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.keybind-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 9px;
}

.keybind-label {
  font-size: 11.5px;
  color: #f1f5f9;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.keybind-btn {
  min-width: 78px;
  padding: 4px 9px;
  border-radius: 7px;
  background: rgba(8, 12, 24, 0.92);
  border: 1px solid rgba(0, 240, 255, 0.35);
  color: #7dd3fc;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.14s ease;
}

.keybind-btn:hover {
  border-color: #fff;
  color: #fff;
}

.keybind-btn.listening {
  background: rgba(255, 27, 141, 0.28);
  border-color: #ff1b8d;
  color: #fff;
  animation: pulseListen 0.7s infinite alternate;
}

@keyframes pulseListen {
  from { box-shadow: 0 0 6px rgba(255, 27, 141, 0.4); }
  to { box-shadow: 0 0 16px rgba(255, 27, 141, 0.9); }
}

.keybind-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.keybind-tip {
  font-size: 11px;
  color: var(--text-dim);
}

@media (max-width: 720px) {
  .keybind-grid {
    grid-template-columns: 1fr;
  }
}

/* TOAST */
.toast {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  z-index: 80;
  padding: 9px 16px;
  border-radius: 10px;
  background: rgba(10, 14, 24, 0.92);
  border: 1px solid rgba(0, 240, 255, 0.38);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  max-width: 90vw;
  text-align: center;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.error {
  border-color: rgba(255, 59, 92, 0.72);
  color: #ffd5dc;
}

/* RESPONSIVE ADJUSTMENTS */
@media (max-width: 1040px) {
  .scene-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .lighting-layout,
  .media-layout,
  .audio-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1200px) {
  .perf-pill {
    display: none;
  }
  .glass-bar {
    padding: 0 10px;
    gap: 8px;
  }
  .hud-right {
    gap: 5px;
  }
  .btn-sm {
    padding: 0 9px;
    font-size: 11.5px;
  }
  .telemetry-pill {
    padding: 4px 8px;
    gap: 6px;
  }
  .telemetry-pill .source-indicator {
    max-width: 82px;
  }
}

@media (max-width: 680px) {
  .telemetry-pill .source-indicator,
  .telemetry-pill .divider {
    display: none;
  }
  .modal-row-2 {
    grid-template-columns: 1fr;
  }
}


/* ============================================================================
   MULTI-MODE DROPS & CUSTOM SHOW PRESET MANAGER
   ============================================================================ */
.presets-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.presets-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.btn-preset-primary {
  background: linear-gradient(135deg, rgba(255, 27, 141, 0.3), rgba(0, 240, 255, 0.24)) !important;
  border-color: rgba(0, 240, 255, 0.52) !important;
  color: #fff !important;
}

.btn-preset-primary:hover {
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.32);
}

#btn-quick-screen-blackout.active {
  background: rgba(0, 255, 153, 0.22);
  border-color: rgba(0, 255, 153, 0.65);
  color: #b7ffdf;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  max-height: 185px;
  overflow-y: auto;
  padding-right: 4px;
}

.preset-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 9px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-card:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.32);
  transform: translateY(-1px);
}

.preset-card.active {
  background: rgba(0, 240, 255, 0.12);
  border-color: var(--preset-accent, #00f0ff);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.22);
}

.preset-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.preset-card-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preset-card-icon {
  font-size: 15px;
  flex-shrink: 0;
}

.preset-card-tools {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.preset-kbd {
  font-family: var(--font-mono);
  font-size: 9.5px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #d8f4ff;
}

.preset-mini-btn {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  font-size: 10.5px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-dim);
  transition: all 0.12s ease;
}

.preset-mini-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.preset-mini-btn.del:hover {
  background: rgba(255, 59, 92, 0.35);
  border-color: rgba(255, 59, 92, 0.65);
  color: #fff;
}

.preset-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.preset-tag {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-dim);
}

.preset-tag.blackout {
  background: rgba(0, 255, 153, 0.16);
  color: #88ffd0;
}

.preset-tag.dim {
  background: rgba(168, 85, 247, 0.22);
  color: #e2c6ff;
}

.preset-tag.drop {
  background: rgba(255, 27, 141, 0.22);
  color: #ffb8dc;
}

.preset-hint-bar {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-dim);
}

.preset-hint-bar code {
  font-family: var(--font-mono);
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* Preset Builder Modal */
.preset-card-modal {
  max-width: 720px;
  width: 94vw;
  max-height: 90vh;
  overflow-y: auto;
  padding: 20px 22px;
}

.pm-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.pm-span-2 {
  grid-column: span 2;
}

.pm-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.pm-field > label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-dim);
}

.pm-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pm-name-row .glass-input {
  flex: 1;
}

.pm-icon-sel {
  width: 64px;
  text-align: center;
  font-size: 16px;
}

.pm-color-inp {
  width: 40px;
  height: 32px;
  padding: 2px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.pm-section {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.pm-sec-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

.pm-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: center;
}

.pm-row-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.pm-fx-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

@media (max-width: 1040px) {
  .preset-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pm-row-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ============================================================================
   TAB: PRO DMX MOVING HEAD CONSOLE (#panel-beams)
   ============================================================================ */
.mh-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-bottom: 7px;
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mh-power-group,
.mh-save-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.mh-power-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  transition: all 0.16s ease;
  border: 1px solid rgba(0, 255, 160, 0.55);
  background: linear-gradient(135deg, rgba(0, 235, 145, 0.22), rgba(0, 190, 255, 0.16));
  color: #dcffef;
  box-shadow: 0 0 14px rgba(0, 235, 145, 0.24);
}

.mh-power-btn:hover {
  filter: brightness(1.12);
}

.mh-power-btn.off {
  border-color: rgba(255, 68, 102, 0.65);
  background: linear-gradient(135deg, rgba(255, 45, 85, 0.24), rgba(140, 18, 44, 0.25));
  color: #ffd0d9;
  box-shadow: 0 0 14px rgba(255, 45, 85, 0.2);
}

.mh-power-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #00ff9d;
  box-shadow: 0 0 8px #00ff9d;
}

.mh-power-btn.off .mh-power-dot {
  background: #ff3b5c;
  box-shadow: 0 0 8px #ff3b5c;
}

.mh-power-btn kbd,
#btn-mh-next-preset kbd {
  font-family: var(--font-mono);
  font-size: 9.5px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
}

.mh-icon-sel {
  width: 48px;
  padding: 4px 3px;
  text-align: center;
  font-size: 13px;
}

.mh-name-inp {
  width: 145px;
  padding: 4px 8px;
  font-size: 11px;
}

.mh-layout {
  display: grid;
  grid-template-columns: 1.02fr 1.28fr;
  gap: 10px;
  align-items: start;
}

.mh-presets-col {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.mh-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
}

.mh-preset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  max-height: 158px;
  overflow-y: auto;
  padding-right: 3px;
}

.mh-preset-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 5px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
  cursor: pointer;
  transition: all 0.14s ease;
}

.mh-preset-card:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.28);
}

.mh-preset-card.active {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.18), rgba(168, 85, 247, 0.14));
  border-color: var(--accent-2);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.25);
}

.mh-preset-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.mh-preset-title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 11.5px;
  font-weight: 700;
  color: #fff;
}

.mh-preset-title span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mh-preset-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.mh-tag {
  font-size: 9.5px;
  padding: 1px 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
}

.mh-tag.static {
  background: rgba(0, 240, 255, 0.16);
  color: #aef7ff;
}

.mh-tag.fx {
  background: rgba(255, 196, 61, 0.18);
  color: #ffe399;
}

.mh-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.45);
  flex-shrink: 0;
}

.mh-controls-col {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.mh-select-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.mh-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.mh-field > label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mh-field .glass-select {
  width: 100%;
  padding: 5px 7px;
  font-size: 11px;
}

.mh-color-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.mh-color-pickers {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: border-color 0.15s ease;
}

.mh-color-pickers.active {
  border-color: var(--accent-2);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.22);
}

.mh-col-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
}

.mh-color-inp {
  width: 26px;
  height: 20px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
}

.mh-quick-btns {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.mh-slider-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 12px;
}

.mh-slider-wide {
  grid-column: span 2;
}

@media (max-width: 780px) {
  .mh-layout {
    grid-template-columns: 1fr;
  }
  .mh-select-grid,
  .mh-slider-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mh-slider-wide {
    grid-column: span 2;
  }
}

/* ============================================================================
   TAB: CROWD CHOREOGRAPHY DIRECTOR (#panel-crowd)
   ============================================================================ */
.cd-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-bottom: 7px;
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cd-status-group,
.cd-drop-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.cd-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 700;
  border: 1px solid rgba(0, 240, 255, 0.45);
  background: rgba(0, 240, 255, 0.14);
  color: #cffaff;
}

.cd-status-pill.unison {
  border-color: rgba(255, 27, 141, 0.7);
  background: linear-gradient(135deg, rgba(255, 27, 141, 0.28), rgba(168, 85, 247, 0.24));
  color: #ffe0f0;
  box-shadow: 0 0 12px rgba(255, 27, 141, 0.25);
}

#btn-cd-freestyle kbd,
#btn-cd-fire-drop kbd {
  font-family: var(--font-mono);
  font-size: 9.5px;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  margin-left: 3px;
}

.cd-sel-sm {
  padding: 4px 7px;
  font-size: 11px;
  max-width: 175px;
}

.cd-sel-xs {
  padding: 4px 7px;
  font-size: 11px;
  max-width: 155px;
}

.cd-layout {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 10px;
  align-items: start;
}

.cd-dances-col {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.cd-dance-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  max-height: 158px;
  overflow-y: auto;
  padding-right: 3px;
}

.cd-dance-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
  cursor: pointer;
  transition: all 0.14s ease;
}

.cd-dance-card:hover {
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 255, 255, 0.3);
}

.cd-dance-card.active {
  background: linear-gradient(135deg, rgba(255, 27, 141, 0.24), rgba(0, 240, 255, 0.16));
  border-color: var(--accent-1);
  box-shadow: 0 0 12px rgba(255, 27, 141, 0.3);
}

.cd-dance-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.cd-dance-name {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cd-dance-dur {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-dim);
  flex-shrink: 0;
}

.cd-dance-thai {
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cd-presets-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 7px 9px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-width: 0;
}

.cd-tune-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cd-speed-slider {
  flex: 1;
  min-width: 120px;
}

.cd-preset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  max-height: 98px;
  overflow-y: auto;
  padding-right: 3px;
}

.cd-save-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.cd-name-inp {
  flex: 1;
  min-width: 90px;
  padding: 4px 8px;
  font-size: 11px;
}

@media (max-width: 780px) {
  .cd-layout {
    grid-template-columns: 1fr;
  }
  .cd-dance-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ============================================================================
   SOLO PRESET SETUP MODE BANNER, LIVE DOCKABLE PRESET STUDIO & HOTKEY LIVE PILL
   ============================================================================ */
.solo-banner {
  position: fixed;
  top: 58px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 42;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(14, 18, 32, 0.88);
  border: 1px solid rgba(255, 196, 61, 0.72);
  box-shadow: 0 6px 26px rgba(0, 0, 0, 0.55), 0 0 18px rgba(255, 196, 61, 0.28);
  backdrop-filter: blur(12px);
  font-size: 11.5px;
  font-weight: 700;
  color: #ffe9aa;
  max-width: 94vw;
  white-space: nowrap;
}

.solo-banner.hidden {
  display: none;
}

.solo-banner-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ffc43d;
  box-shadow: 0 0 10px #ffc43d;
  flex-shrink: 0;
}

.btn-solo-exit {
  border-color: rgba(0, 255, 160, 0.65) !important;
  background: rgba(0, 235, 145, 0.2) !important;
  color: #dcffef !important;
  font-weight: 700;
}

.btn-solo-toggle {
  border-color: rgba(255, 196, 61, 0.45);
  color: #ffe6a3;
}

.btn-solo-toggle.active {
  background: linear-gradient(135deg, rgba(255, 180, 0, 0.34), rgba(255, 85, 0, 0.28));
  border-color: #ffc43d;
  color: #fff;
  box-shadow: 0 0 14px rgba(255, 196, 61, 0.42);
}

#btn-lz-next-preset kbd {
  font-family: var(--font-mono);
  font-size: 9.5px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
}

.global-live-key {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.35);
  color: #aef7ff;
  transition: all 0.15s ease;
}

.global-live-key.flash {
  background: rgba(0, 255, 160, 0.35);
  border-color: #00ff9d;
  color: #fff;
  box-shadow: 0 0 12px rgba(0, 255, 157, 0.55);
}

#btn-open-keybinds.global-linked {
  border-color: rgba(0, 255, 160, 0.65);
  box-shadow: 0 0 10px rgba(0, 255, 160, 0.22);
}

.pm-solo-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: 9px;
  background: rgba(255, 196, 61, 0.08);
  border: 1px solid rgba(255, 196, 61, 0.28);
}

/* Docked Side-Studio Mode for Show Preset Builder: lets DJ see the live 3D stage on the left while tweaking! */
#preset-modal.docked {
  background: transparent;
  backdrop-filter: none;
  justify-content: flex-end;
  align-items: center;
  padding: 12px 14px;
  pointer-events: none;
}

#preset-modal.docked:not(.hidden) .preset-card-modal {
  pointer-events: auto;
  max-width: 500px;
  width: 44vw;
  min-width: 390px;
  max-height: 92vh;
  background: rgba(10, 14, 24, 0.88);
  box-shadow: -8px 0 36px rgba(0, 0, 0, 0.65), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

#preset-modal.hidden,
#preset-modal.hidden .preset-card-modal {
  pointer-events: none !important;
  visibility: hidden;
}

#preset-modal.docked .pm-row-4 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* ============================================================================
   INTERACTIVE 3D FOH GRANDMA2 CONSOLE POV & RIGHT-SIDE CONTROL DOCK
   ============================================================================ */
.btn-foh-pill {
  border-color: rgba(0, 240, 255, 0.36) !important;
  color: #cffafe !important;
}

.btn-foh-pill.active,
.fx-pad.fx-foh-auto.active {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.28), rgba(168, 85, 247, 0.25)) !important;
  border-color: rgba(0, 240, 255, 0.78) !important;
  color: #ffffff !important;
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.28);
}

.foh-console-hint {
  position: fixed;
  bottom: 14px;
  left: 16px;
  z-index: 28;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(8, 13, 24, 0.86);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 240, 255, 0.42);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.5), 0 0 18px rgba(0, 240, 255, 0.14);
  font-size: 11.5px;
  font-weight: 600;
  color: #e6fbff;
  max-width: calc(100vw - 440px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.foh-console-hint.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
}

@media (max-width: 1380px) {
  .glass-bar {
    padding: 0 10px;
    gap: 6px;
  }
  .hud-right {
    gap: 4px;
  }
  .btn-sm {
    padding: 0 8px;
    font-size: 11px;
  }
  .telemetry-pill {
    padding: 4px 8px;
    gap: 6px;
  }
  .telemetry-pill .source-indicator {
    max-width: 86px;
  }
  .fps-readout {
    display: none;
  }
}

.foh-hint-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00f0ff;
  box-shadow: 0 0 8px #00f0ff;
  flex-shrink: 0;
}
