body {
  font-family: Arial, sans-serif;
  background-color: #f4f4f4;
  padding: 20px;
}

h1 {
  text-align: center;
  margin-bottom: 8px;
}

.subtitle {
  text-align: center;
  color: #555;
  margin: 0 0 28px;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  margin-bottom: 40px;
}

button {
  margin: 5px;
  padding: 10px 20px;
  font-size: 14px;
}

button:disabled {
  opacity: 0.45;
}

.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
}

.card {
  background: #fff;
  padding: 24px 20px 20px 20px;
  border-radius: 10px;
  box-shadow: 0 0 16px rgba(0,0,0,0.08);
  margin: 0 auto;
  width: 100%;
  min-width: 320px;
  box-sizing: border-box;
}

.spectrum-card {
  grid-column: 1 / span 2;
  min-height: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.spectrum-card canvas {
  max-width: 100%;
  height: auto !important;
}

.spectrum-col {
  max-width: 600px;
  min-width: 0;
}

.spectrum-labels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  text-align: center;
  font-size: 12px;
  margin-top: 8px;
}

.filter-section {
  min-width: 320px;
}

label {
  display: block;
  margin-top: 15px;
  font-weight: bold;
}

input[type="range"] {
  width: 100%;
}

select {
  padding: 4px 8px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.spectrum-flex-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 40px;
}

.master-volume-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  min-height: 240px;
  margin-left: 24px;
}

.master-volume-card h3 {
  margin-bottom: 10px;
}

/* vertical slider: works in current Chrome, Edge, Firefox and Safari */
#masterVolumeSlider {
  width: 40px;
  height: 180px;
  margin-top: 24px;
  writing-mode: vertical-lr;
  direction: rtl;
  -webkit-appearance: slider-vertical;
  appearance: slider-vertical;
}

.audio-source-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-right: 32px;
}

.audio-source-group label {
  margin-top: 0;
  margin-bottom: 4px;
  font-size: 15px;
  letter-spacing: 0.5px;
}

#audioSourceSelector {
  padding: 6px 18px;
  border-radius: 6px;
  border: 1px solid #bbb;
  font-size: 15px;
  background: #f8f8f8;
  transition: border 0.2s;
  margin: 0;
}

#audioSourceSelector:focus {
  border: 1.5px solid #007bff;
  outline: none;
}

.chain-card .chain {
  margin: 8px 0 0;
  padding-left: 22px;
  line-height: 1.7;
}

.chain-card .note {
  font-size: 13px;
  color: #555;
  margin-top: 14px;
}

@media (max-width: 900px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
  .spectrum-card {
    grid-column: 1;
  }
  .spectrum-flex-row {
    flex-direction: column;
    gap: 16px;
  }
  .master-volume-card {
    margin-left: 0;
    min-height: 0;
  }
  #masterVolumeSlider {
    writing-mode: horizontal-tb;
    direction: ltr;
    -webkit-appearance: auto;
    appearance: auto;
    width: 220px;
    height: auto;
    margin-top: 8px;
  }
}
