* {
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #010306;
  color: #dbe6f5;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, monospace;
}

#webgl-container {
  width: 100%;
  height: 100%;
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

/* ══════════════════════════════════════════════════════════════════════
   TOP MASTER TRANSPORT BAR
   ══════════════════════════════════════════════════════════════════════ */
#vj-transport-bar {
  position: absolute;
  top: 12px;
  left: 16px;
  right: 16px;
  height: 48px;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(8, 12, 18, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 0 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.7);
}

.transport-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.vj-brand-badge {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: #00f0ff;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
}

.vj-brand-badge span {
  color: #ff00aa;
}

.vj-brand-badge small {
  font-size: 8px;
  color: #7b92ab;
  padding: 2px 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
}

.bpm-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-family: monospace;
  font-size: 12px;
  font-weight: 700;
}

.bpm-box b {
  color: #00f0ff;
  font-size: 14px;
}

.tap-btn {
  background: rgba(0, 240, 255, 0.15);
  border: 1px solid #00f0ff;
  color: #00f0ff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: all 0.08s ease;
}

.tap-btn:active {
  background: #00f0ff;
  color: #010408;
}

/* TouchDesigner CHOP Audio Spectrum Meters */
.chop-spectrum-meter {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 10px;
  font-family: monospace;
  font-weight: 700;
}

.spectrum-band {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
}

.spectrum-band span {
  font-size: 8px;
  color: #7b94ad;
}

.spectrum-bar-track {
  width: 28px;
  height: 18px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.spectrum-bar-fill {
  width: 100%;
  height: 20%;
  background: #00f0ff;
  transition: height 0.06s ease;
}

.spectrum-bar-fill.mid { background: #00ff88; }
.spectrum-bar-fill.high { background: #ff00aa; }

.btn-punch {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all 0.12s ease;
}

.btn-punch:hover {
  background: rgba(255, 255, 255, 0.2);
}

.btn-punch.strobe.active {
  background: #ffffff;
  color: #000000;
  box-shadow: 0 0 20px #ffffff;
}

.btn-punch.bloom {
  border-color: #ff00aa;
  color: #ff88dd;
}

.btn-punch.bloom:active, .btn-punch.bloom.active {
  background: #ff00aa;
  color: #ffffff;
  box-shadow: 0 0 24px #ff00aa;
}

/* ══════════════════════════════════════════════════════════════════════
   LEFT SIDEBAR: RESOLUME LAYERS
   ══════════════════════════════════════════════════════════════════════ */
#vj-layer-deck {
  position: absolute;
  top: 70px;
  left: 16px;
  width: 270px;
  z-index: 100;
  background: rgba(8, 12, 18, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
}

.panel-title {
  font-size: 11px;
  font-weight: 800;
  color: #00f0ff;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
}

.layer-strip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
}

.layer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 6px;
}

.layer-header span.tag {
  font-size: 9px;
  font-family: monospace;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 240, 255, 0.15);
  color: #00f0ff;
}

.fader-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-family: monospace;
  color: #8da4be;
  margin-top: 4px;
}

input[type=range] {
  -webkit-appearance: none;
  flex: 1;
  background: rgba(255, 255, 255, 0.12);
  height: 4px;
  border-radius: 2px;
  outline: none;
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #00f0ff;
  cursor: pointer;
  box-shadow: 0 0 8px #00f0ff;
}

.clip-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: 6px;
}

.clip-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: #a0b8d0;
  padding: 6px 4px;
  font-size: 9px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: all 0.1s ease;
}

.clip-btn:hover {
  background: rgba(0, 240, 255, 0.2);
  color: #ffffff;
}

.clip-btn.active {
  background: #00f0ff;
  border-color: #00f0ff;
  color: #010408;
  font-weight: 900;
}

/* ══════════════════════════════════════════════════════════════════════
   RIGHT SIDEBAR: TOUCHDESIGNER MODULATION MATRIX
   ══════════════════════════════════════════════════════════════════════ */
#vj-mod-matrix {
  position: absolute;
  top: 70px;
  right: 16px;
  width: 270px;
  z-index: 100;
  background: rgba(8, 12, 18, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
}

.fx-pad-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 8px;
}

.fx-pad {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #b8cde4;
  padding: 8px 6px;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: all 0.12s ease;
}

.fx-pad:hover {
  background: rgba(255, 0, 170, 0.2);
  border-color: #ff00aa;
  color: #ffffff;
}

.fx-pad.active {
  background: #ff00aa;
  border-color: #ff00aa;
  color: #ffffff;
  box-shadow: 0 0 14px #ff00aa;
}

/* ══════════════════════════════════════════════════════════════════════
   BOTTOM STATUS & SHORTCUTS
   ══════════════════════════════════════════════════════════════════════ */
#vj-bottom-legend {
  position: absolute;
  bottom: 12px;
  left: 16px;
  right: 16px;
  height: 34px;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(8, 12, 18, 0.80);
  backdrop-filter: blur(12px);
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-family: monospace;
  font-size: 10px;
  color: #7b92ab;
  pointer-events: none;
}

#vj-bottom-legend b {
  color: #00f0ff;
}
