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

body {
  background: #000;
  color: #fff;
  font-family: monospace;
  overflow: hidden;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

#output {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

#remoteVideo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: auto;
}

#controls {
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  max-height: 100vh;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.75);
  padding: 12px;
  font-size: 12px;
  z-index: 10;
  display: none;
}

#controls.visible {
  display: block;
}

#hud {
  position: fixed;
  bottom: 8px;
  left: 12px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  pointer-events: none;
}

.control-group {
  margin-bottom: 10px;
}

.control-group label {
  display: block;
  margin-bottom: 3px;
  color: #aaa;
}

.control-group select,
.control-group input[type="range"],
.control-group input[type="text"] {
  width: 100%;
  background: #222;
  color: #fff;
  border: 1px solid #444;
  padding: 4px;
}

.control-group input[type="range"] {
  padding: 0;
}

.range-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.range-val {
  width: 36px;
  text-align: right;
  color: #ccc;
  flex-shrink: 0;
}

h3 {
  color: #888;
  font-size: 11px;
  text-transform: uppercase;
  margin: 10px 0 6px;
  border-bottom: 1px solid #333;
  padding-bottom: 3px;
}

#connectBtn {
  width: 100%;
  padding: 8px;
  background: #1a6;
  color: #fff;
  border: none;
  cursor: pointer;
  font-family: monospace;
  font-size: 13px;
  margin-bottom: 10px;
}

#connectBtn:disabled {
  background: #555;
  cursor: default;
}

#status {
  color: #fa0;
  margin-bottom: 8px;
  word-break: break-all;
}

/* ── Audio debug widget ──────────────────────────────────────────────────── */
#audioDebug {
  position: fixed;
  bottom: 30px;
  right: 12px;
  display: flex;
  gap: 8px;
  align-items: flex-end;
  pointer-events: none;
}

#audViz {
  display: flex;
  gap: 4px;
  align-items: flex-end;
  height: 60px;
}

.audCol {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 60px;
  gap: 2px;
}

.audBar {
  width: 14px;
  background: #0f8;
  transition: height 0.05s;
  height: 0%;
}

.audLabel {
  font-size: 8px;
  color: #555;
  font-family: monospace;
}

#audMeta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding-bottom: 14px;
}

#audBeat {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #333;
  transition: background 0.05s;
}

#audBpm {
  font-size: 11px;
  font-family: monospace;
  color: #888;
}
