body {
  font-family: sans-serif;
  margin: 4px;
  display: flex;
  gap: 10px;
  max-width: 1000px;
  margin: 0 auto;
}

/* Make instruments column narrower */
#instrumentsColumn {
  width: 180px;
  border: 1px solid #ccc;
  padding: 5px;
  overflow-y: auto;
  height: calc(100vh - 20px);
}


.instrument-item {
      padding: 5px;
      margin: 4px 0;
      cursor: pointer;
      border-radius: 4px;
      background-color: #f9f9f9;
      text-align: center;
      transition: background-color 0.1s;
    }
    .instrument-item:hover {
      background-color: #e0e0e0;
    }
    .instrument-item.active {
      background-color: #90caf9;
      font-weight: bold;
    }
    /* ====== Main UI Area ====== */
    #mainUI {
      flex: 1;
      min-width: 0;
    }
    h1 {
  font-size: 1.5rem;
  margin: 4px 0;
}

h2 {
  font-size: 1.2rem;
  margin: 8px 0;
}

    .pads-container {
      display: flex;
      gap: 20px;
      margin-top: 10px;
      flex-wrap: wrap;
    }
    .pad-section {
      flex: 1;
      min-width: 300px;
    }
    .pad-section h2 { text-align: center; }
  .touchpad {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin-top: 10px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
  }
  .pad {
    border: 2px solid #333;
    border-radius: 8px;
    padding: 10px;
    aspect-ratio: 1;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: transform 0.1s, filter 0.1s;
    white-space: pre-line;
  }
  .pad:hover { filter: brightness(110%); }
  .pad.playing { transform: scale(0.95); }
  .pad-label {
    font-size: 14px;
    font-weight: bold;
    color: #333;
  }

.pads-container {
  display: flex;
  gap: 10px; /* Reduce from 40px to 20px to bring pads closer */
  margin-top: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Update the right pad's grid to 3 columns instead of 4 */
#programmablePad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 10px;
  max-width: 300px; /* Limit the width */
  margin-left: auto;
  margin-right: auto;
}

/* Make the pads more visually appealing */
.pad {
  border: 2px solid #333;
  border-radius: 8px;
  padding: 10px;
  aspect-ratio: 1;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: all 0.2s ease;
  white-space: pre-line;
  background: linear-gradient(to bottom, #f9f9f9, #e0e0e0);
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.pad:hover { 
  background: linear-gradient(to bottom, #ffffff, #f0f0f0);
  box-shadow: 0 3px 7px rgba(0,0,0,0.15);
}

.pad.playing { 
  transform: scale(0.95);
  background: linear-gradient(to bottom, #e0e0e0, #d0d0d0);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Add a special style for pads that have been assigned */
.pad.assigned {
  border-color: #2196F3;
  background: linear-gradient(to bottom, #e3f2fd, #bbdefb);
}

 #selectedSoundDisplay {
      margin: 4px;
      font-weight: bold;
      text-align: center;
      color: #d32f2f;
    }


/* Control area */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin-top: 5px;
}


#volumeValueDisplay {
  font-size: 12px;
  margin-left: 5px;
}
.record-controls {
  margin-top: 5px;
  padding: 5px;
  border: 1px solid #aaa;
  border-radius: 4px;
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: center;
}
#toggleRecording.recording {
  background-color: #d32f2f;
  color: white;
  font-weight: bold;
}

#toggleRecording {
  transition: all 0.3s ease;
}

/* Make buttons smaller and more compact */
button {
  padding: 4px 8px;
  font-size: 12px;
}
