/* Mini keyboard: the controls, the keys (a box that scrolls sideways inside itself), the staff and the readout.
   Builds on the shared .explorer, .btn and .cx styles in styles.css and on the staff drawing in staff-reader.css. */
.mini-keyboard { min-width: 0; }

.mk-controls { display: flex; flex-wrap: wrap; gap: 0.6rem 1rem; align-items: center; margin-bottom: 0.8rem; }
.mk-controls .btn { min-height: 44px; }
.mk-mute[aria-pressed="true"], .mk-naming[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.mk-namings { display: flex; gap: 0.4rem; }
.mk-audio-note { margin: 0 0 0.6rem; font-size: 0.9rem; }

/* The keys are physical objects, so they keep the same colours in the light and the dark theme. Each white key is at least
   44 px wide: on a phone the row is wider than the screen and scrolls inside this box, never the page. */
.mk-scroll { overflow-x: auto; max-width: 100%; padding-bottom: 4px; border-radius: 10px; -webkit-overflow-scrolling: touch; }
.mk-keys { position: relative; height: 9.5rem; min-width: calc(var(--whites, 15) * 44px); max-width: calc(var(--whites, 15) * 72px); }
.mk-key { position: absolute; top: 0; box-sizing: border-box; margin: 0; padding: 0 0 0.4rem; display: flex; align-items: flex-end; justify-content: center; font: inherit; font-weight: 700; cursor: pointer; touch-action: manipulation; }
.mk-key--white { height: 100%; z-index: 1; background: #fbfbfd; color: #1c2033; border: 1px solid #8a91a8; border-radius: 0 0 8px 8px; font-size: 0.85rem; }
.mk-key--black { height: 60%; z-index: 2; background: #1c2033; color: #f6f7fb; border: 1px solid #f6f7fb; border-radius: 0 0 6px 6px; font-size: 0.7rem; }
.mk-label { pointer-events: none; }
.mk-key:focus-visible { outline: 3px solid #d9480f; outline-offset: -4px; z-index: 3; }

/* A highlighted key (a scale, a chord) is tinted and carries a dot; the key last played is gold with a heavy outline. */
.mk-key--lit::before { content: ''; position: absolute; top: 0.55rem; left: 50%; width: 0.6rem; height: 0.6rem; margin-left: -0.3rem; border-radius: 50%; background: #3b5bdb; box-shadow: 0 0 0 2px #fbfbfd; }
.mk-key--white.mk-key--lit { background: #dbe4ff; }
.mk-key--black.mk-key--lit { background: #3b5bdb; }
.mk-key--black.mk-key--lit::before { background: #ffc53d; box-shadow: 0 0 0 2px #1c2033; top: 0.45rem; }
.mk-key--current { background: #ffc53d !important; color: #1c2033; box-shadow: inset 0 0 0 3px #1c2033; }

.mk-staff { margin-top: 0.8rem; }
.mk-readout { margin: 0.8rem 0 0; min-height: 3em; padding: 0.55rem 0.75rem; border-radius: 10px; background: var(--accent-soft); font-weight: 600; overflow-wrap: anywhere; }
.mk-hint { margin: 0.6rem 0 0; font-size: 0.85rem; }
