:root {
  --bg-color: #121212;
  --surface-color: #1e1e1e;
  --text-color: #e0e0e0;
  --accent-color: #bb86fc;
  --success-color: #03dac6;
  --error-color: #cf6679;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  overflow: hidden;
}

/* Header */
header {
  height: 40px;
  background-color: var(--surface-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid #333;
  -webkit-app-region: drag;
}

h1 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  opacity: 0.8;
}

#connection-status {
  font-size: 11px;
  font-weight: bold;
  padding: 4px 8px;
  border-radius: 4px;
  background-color: #333;
  color: #aaa;
  text-transform: uppercase;
}

#connection-status.connected {
  background-color: rgba(3, 218, 198, 0.2);
  color: var(--success-color);
}

#connection-status.disconnected {
  background-color: rgba(207, 102, 121, 0.2);
  color: var(--error-color);
}

/* Setup Screen */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px;
  gap: 20px;
  align-items: center;
  justify-content: center;
}

#setup-screen {
  text-align: center;
  background: var(--surface-color);
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.control-panel {
  width: 300px;
}

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

.control-group label {
  display: block;
  font-size: 11px;
  color: #aaa;
  margin-bottom: 5px;
  text-transform: uppercase;
}

input[type="text"],
select {
  width: 100%;
  padding: 8px;
  background: #000;
  color: white;
  border: 1px solid #444;
  border-radius: 4px;
}

button {
  width: 100%;
  padding: 12px;
  background: #0066cc;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  margin-top: 10px;
}

button:hover {
  background: #0055aa;
}

/* BROADCAST SCREEN - FIXED HEIGHT LAYOUT */
#broadcast-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: none;
  flex-direction: column;
  background: #111;
}

/* Top bar - fixed 50px */
.top-bar {
  height: 50px;
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  background: #222;
  border-bottom: 1px solid #333;
}

.status-group {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 15px;
}

.status-indicator {
  font-weight: bold;
  color: #666;
  font-size: 11px;
  /* Slightly smaller for horizontal fit */
  padding: 4px 8px;
  background-color: #333;
  border-radius: 4px;
  text-transform: uppercase;
}

.status-indicator.connected {
  color: #00ff00;
}

.stats-display {
  font-size: 10px;
  color: #888;
  font-family: monospace;
}

#settings-toggle-btn {
  padding: 8px 15px;
  background: #444;
  font-size: 12px;
}

/* Meters area - takes remaining space */
.meters-wrapper {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

.meter-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #333;
  background: #000;
  padding: 10px;
  position: relative;
}

.meter-panel:last-child {
  border-right: none;
}

.meter-panel h3 {
  margin: 0 0 10px 0;
  font-size: 12px;
  color: #888;
  text-transform: uppercase;
  text-align: center;
  height: 20px;
  flex-shrink: 0;
}

.vu-readout {
  position: absolute;
  top: 10px;
  right: 10px;
  font-family: monospace;
  color: lime;
  font-size: 11px;
  z-index: 10;
}

/* Canvas container with explicit height calculation */
.meter-panel canvas {
  width: 100%;
  height: calc(100% - 30px);
  /* Subtract h3 height */
  display: block;
  background: #050505;
  border-radius: 4px;
}

/* Controls panel - auto height */
.audio-controls {
  height: auto;
  min-height: 250px;
  flex-shrink: 0;
  background: #1a1a1a;
  border-top: 1px solid #333;
  padding: 15px;
  /* overflow: hidden; REMOVED to allow visibility */
}

.control-row {
  display: flex;
  gap: 20px;
  margin-bottom: 12px;
}

.control-row:last-child {
  margin-bottom: 0;
}

.toggles {
  display: flex;
  gap: 15px;
  background: #000;
  padding: 8px;
  border: 1px solid #444;
  border-radius: 4px;
  align-items: center;
  height: 36px;
}

.toggles label {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  color: #ddd;
  font-size: 12px;
}

.slider-markers {
  display: flex;
  justify-content: space-between;
  font-size: 8px;
  color: #888;
  margin-top: 4px;
  padding-right: 48px;
  /* Offset for the dB label on the right */
  padding-left: 2px;
  font-weight: bold;
  letter-spacing: 0.5px;
}