/* ── Piano app layout ── */
.piano-app {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 63px);
  overflow: hidden;
}

.piano-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1.25rem;
  background: var(--bg-card);
  border-bottom: 3px solid #000;
  flex-shrink: 0;
}

.piano-btn {
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
}

.octave-badge {
  font-family: 'Oswald', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  background: var(--bg);
  border: 3px solid #000;
  padding: 0.25rem 0.9rem;
  min-width: 96px;
  text-align: center;
  box-shadow: 3px 3px 0 #000;
}

.midi-badge {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-left: auto;
}

/* ── Keyboard wrapper ── */
.piano-keyboard-wrap {
  flex: 1;
  padding: 1.25rem 1.5rem 1.5rem;
  overflow: hidden;
  position: relative;
}

#keyboard {
  position: relative;
  display: flex;
  width: 100%;
  height: 100%;
  user-select: none;
  touch-action: none;
}

/* ── Keys ── */
.white-key {
  flex: 1;
  background: #F8FAFC;
  border: 2px solid #000;
  border-top: 3px solid #000;
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 0.6rem;
  transition: background 0.04s;
  -webkit-tap-highlight-color: transparent;
}

.white-key:first-child { border-left: 3px solid #000; }
.white-key:last-child  { border-right: 3px solid #000; }

.white-key.pressed { background: var(--yellow); }

.black-key {
  position: absolute;
  top: 0;
  background: #0F172A;
  border: 2px solid #000;
  border-top: 3px solid #000;
  z-index: 2;
  cursor: pointer;
  transition: background 0.04s;
  -webkit-tap-highlight-color: transparent;
}

.black-key.pressed { background: var(--red); }

.key-label {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(0.55rem, 1.2vw, 0.8rem);
  font-weight: 700;
  color: #1E293B;
  pointer-events: none;
  line-height: 1.1;
  text-align: center;
}

.key-label sub {
  font-size: 0.7em;
  color: var(--text-muted);
}

/* ── Overlays ── */
.piano-hint,
.piano-loading {
  position: absolute;
  bottom: 1.75rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Oswald', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  pointer-events: none;
  white-space: nowrap;
}

.piano-loading { display: none; color: var(--yellow); }
