body {
  font-family: Arial, sans-serif;
  text-align: center;
  margin: 0;
  padding: 0;
}

#controls {
  margin: 20px;
}

/* Volume Controls Styles */
#volumeControls {
  margin: 20px auto;
  width: 800px;
  text-align: left;
  border: 1px solid #ccc;
  padding: 10px;
}
.volume-control {
  margin-bottom: 10px;
}
.volume-control label {
  margin-right: 10px;
}

/* Real-Time Waveform Preview Styles */
#waveformPreviews {
  margin: 20px auto;
  width: 800px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  border: 1px solid #ccc;
  padding: 10px;
}
.waveform-item {
  text-align: center;
  margin: 10px;
}
.waveform-item canvas {
  width: 150px;
  height: 50px;
  background: #000;
  display: block;
  margin: 0 auto 5px;
}

/* Editor and Pitch Scale */
#editor {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
#pitchScaleContainer {
  width: 70px;
  height: 500px;
  overflow: hidden;
  border-right: 2px solid #333;
  background: #fafafa;
  position: relative;
}
#pitchScale {
  position: absolute;
  left: 0;
  top: 0;
  width: 70px;
}
.pitch-label {
  height: 20px;
  line-height: 20px;
  border-bottom: 1px solid #ccc;
  cursor: pointer;
  font-size: 12px;
  box-sizing: border-box;
}

/* Piano Roll Container */
#pianoRollContainer {
  width: 800px;
  height: 500px;
  overflow: auto;
  position: relative;
  border: 1px solid #ccc;
}
#pianoRoll {
  position: relative;
  width: 1200px;
  /* Height based on semitone count */
}
#grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* Vertical grid:
     Fine lines every quarter beat (10px) and bold lines every full beat (40px);
     Horizontal grid: pitch lines every semitone (20px) */
  background-image: 
    linear-gradient(to right, rgba(200,200,200,0.3) 1px, transparent 1px),
    linear-gradient(to right, rgba(150,150,150,0.8) 1px, transparent 1px),
    linear-gradient(to bottom, #ddd 1px, transparent 1px);
  background-size: 
    10px 100%,  /* Quarter-beat fine vertical lines */
    40px 100%,  /* Full-beat bold vertical lines */
    40px 20px;  /* Horizontal pitch lines */
}

/* Note Styles */
.note {
  position: absolute;
  border: 1px solid #005fbb;
  cursor: move;
  user-select: none;
  opacity: 0.9;
}
.note.square { background-color: rgba(0, 128, 255, 0.7); }
.note.triangle { background-color: rgba(0, 200, 0, 0.7); }
.note.sawtooth { background-color: rgba(128, 0, 128, 0.7); }
.note.noise { background-color: rgba(200, 0, 0, 0.7); }
.note.pulse { background-color: rgba(255, 165, 0, 0.7); }
.note.chiptune { background-color: rgba(0, 255, 0, 0.7); }
.note.bitcrushed { background-color: rgba(128, 128, 128, 0.7); }

/* Resize handle for adjusting note length */
.resize-handle {
  position: absolute;
  right: 0;
  top: 0;
  width: 5px;
  height: 100%;
  cursor: ew-resize;
  background: rgba(0, 0, 0, 0.3);
}

/* Playback Marker */
#playbackMarker {
  position: absolute;
  top: 0;
  width: 2px;
  height: 100%;
  background: red;
  cursor: ew-resize;
}