/* ==========================================================================
   urPiano — mobile piano: stacked keyboards with finger-sized keys
   ========================================================================== */

.mstack {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.mrow { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; }

/* octave arrows + visible range above each keyboard */
.mrow-bar {
  direction: ltr;
  flex: none;
  height: 46px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 max(8px, env(safe-area-inset-right)) 0 max(8px, env(safe-area-inset-left));
  background: linear-gradient(180deg, var(--lacquer), var(--lacquer-2));
  box-shadow: inset 0 1px 0 var(--lacquer-edge);
}
.app.is-rotated .mrow-bar { padding: 0 8px; }
.app.is-short .mrow-bar { height: 40px; }
.mrow-btn {
  flex: none;
  width: 60px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: var(--fill);
  color: var(--ink);
  display: grid;
  place-items: center;
  touch-action: manipulation;
  transition: transform 0.08s, opacity 0.15s;
}
.mrow-btn .i { width: 20px; height: 20px; }
.mrow-btn:active { transform: scale(0.94); background: var(--fill-2); }
.mrow-btn[disabled] { opacity: 0.3; pointer-events: none; }
@media (hover: hover) { .mrow-btn:hover { background: var(--fill-2); } }
.mrow-range {
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* the keyboards share the remaining height instead of a fixed one */
.app--mobile .kb { flex: 1 1 auto; height: auto; min-height: 0; }
.app--mobile.is-two-rows .mrow--upper .kb { padding-bottom: 0; }
.app--mobile .key-note { font-size: clamp(11px, calc(var(--kw) * 0.27), 16px); }

/* chord / note name, covering the first range label (between the arrow buttons) while playing */
.mreadout {
  position: absolute;
  z-index: 6;
  top: 5px;
  left: 76px;
  right: 76px;
  transform: translateY(-4px);
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--pop-bg);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.14);
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s, transform 0.18s;
}
.mreadout.is-on { opacity: 1; transform: none; transition-duration: 0.06s; }
.mrow-range { transition: opacity 0.12s; }
.app--mobile.is-two-rows .mstack.is-reading .mrow--upper .mrow-range,
.app--mobile:not(.is-two-rows) .mstack.is-reading .mrow--lower .mrow-range { opacity: 0; }
.app--mobile .loading { top: 52px; }

@media (prefers-reduced-motion: reduce) {
  .mreadout, .mrow-btn, .mrow-range { transition: none; }
}
