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

body {
  background: #1a1a2e;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  font-family: 'Segoe UI', sans-serif;
  color: #eee;
  user-select: none;
  padding: 2rem 1rem;
}

h1 {
  font-size: 1.6rem;
  letter-spacing: 0.2em;
  margin-bottom: 1.6rem;
  color: #a0c4ff;
  text-transform: uppercase;
}

/* ---- Controls panel ---- */
#controls {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-end;
  margin-bottom: 1.6rem;
  background: #111;
  border-radius: 12px;
  padding: 16px 24px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.ctrl-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ctrl-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #556677;
  font-weight: 600;
}

/* Instrument selector — dropdown */
#inst-sel {
  background: #1e1e30;
  border: 1px solid #334;
  color: #a0c4ff;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 13px;
  font-family: 'Segoe UI', sans-serif;
  cursor: pointer;
  outline: none;
  min-width: 160px;
}

#inst-sel:hover { border-color: #556; }
#inst-sel:focus { border-color: #a0c4ff; }

/* Range sliders */
.range-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

input[type=range] {
  -webkit-appearance: none;
  width: 110px;
  height: 4px;
  border-radius: 2px;
  background: #334;
  outline: none;
  cursor: pointer;
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #a0c4ff;
  cursor: pointer;
}

input[type=range]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #a0c4ff;
  border: none;
  cursor: pointer;
}

.range-val {
  font-size: 12px;
  color: #a0c4ff;
  font-weight: 600;
  min-width: 36px;
}

.key-count {
  font-size: 11px;
  color: #556677;
}

/* Divider */
.ctrl-divider {
  width: 1px;
  height: 40px;
  background: #223;
  align-self: center;
}

/* ---- Piano container ---- */
#piano-scroll {
  overflow-x: auto;
  max-width: 100vw;
  padding-bottom: 4px;
}

#piano-container {
  position: relative;
  display: flex;
  background: #111;
  padding: 20px 24px 28px;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.7);
}

/* ---- White keys ---- */
.key-white {
  position: relative;
  width: 44px;
  height: 200px;
  background: linear-gradient(to bottom, #f8f8f4, #e8e8e0);
  border: 1px solid #aaa;
  border-radius: 0 0 6px 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 10px;
  transition: background 0.04s;
  z-index: 1;
}

.key-white:hover { background: linear-gradient(to bottom, #fffde0, #f0f0d0); }

.key-white.active {
  background: linear-gradient(to bottom, #a0c4ff, #7eb4ef);
  box-shadow: inset 0 -4px 8px rgba(0,0,0,0.3);
}

/* ---- Black keys ---- */
.key-black {
  position: absolute;
  width: 28px;
  height: 120px;
  background: linear-gradient(to bottom, #333, #111);
  border-radius: 0 0 5px 5px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 8px;
  z-index: 2;
  transition: background 0.04s;
  box-shadow: 2px 4px 8px rgba(0,0,0,0.6);
}

.key-black:hover { background: linear-gradient(to bottom, #555, #222); }

.key-black.active {
  background: linear-gradient(to bottom, #4a90d9, #2a70b9);
  box-shadow: inset 0 -3px 6px rgba(0,0,0,0.4);
}

/* ---- Labels ---- */
.note-label {
  font-size: 9px;
  font-weight: 600;
  color: #666;
  letter-spacing: 0.05em;
}

.key-black .note-label { color: #aaa; font-size: 8px; }

.key-label {
  font-size: 11px;
  font-weight: 700;
  margin-top: 3px;
  color: #999;
  background: rgba(0,0,0,0.08);
  border-radius: 3px;
  padding: 1px 4px;
}

.key-black .key-label {
  color: #ccc;
  font-size: 10px;
  background: rgba(255,255,255,0.12);
}

/* ---- Info bar ---- */
#info {
  margin-top: 1.6rem;
  font-size: 0.9rem;
  color: #8899aa;
  text-align: center;
  line-height: 1.7;
}

#last-note {
  font-size: 1.1rem;
  color: #a0c4ff;
  font-weight: 600;
  min-height: 1.4em;
  margin-top: 0.4rem;
}



