/* Piano IQ — diagram-only styles (staff + keyboard + ear Play). The shared shell
   (packages/practice-kit/css/shell.css) provides all the common layout; this only
   styles what Piano's renderDiagram draws into the shell's #pk-diagram slot. */

/* iOS/WKWebView pops a native magnifying-glass "loupe" on long-press of selectable
   content (the note/staff/keyboard images). Piano is tap-only, so that magnifier is
   just noise — Fretsy suppresses the same way (user-select:none). Kill selection +
   the callout across Piano's UI so no loupe appears. Scoped to Piano: only Piano
   loads this stylesheet, so other PracticeKit apps are unaffected. Range sliders and
   buttons keep working — they aren't selectable text. */
.pk-app { -webkit-user-select: none; -moz-user-select: none; user-select: none; -webkit-touch-callout: none; }

/* Interval-by-ear Play button */
.piano-play-row { text-align: center; margin: 2px 0 10px; }
.piano-play-btn { font: inherit; font-weight: 600; font-size: 15px; padding: 9px 22px; border-radius: 10px;
  border: 1px solid transparent; background: var(--accent); color: var(--on-accent); cursor: pointer; }

/* Grand-staff (hand-rolled SVG; inherits --ink via currentColor) */
.staff-mount { color: var(--ink); margin: 4px 0 8px; }
.staff-mount:empty { display: none; }
.staff-svg { width: 100%; max-width: 300px; height: auto; display: block; margin: 0 auto; }
/* Single note-value glyph ("What note value is this?") — the default intrinsic
   size reads as huge on its own, so cap it to ~half. Measures keep .rhythm-svg's
   wider default so a full bar still fits comfortably. */
.rhythm-note { width: 100%; max-width: 150px; height: auto; display: block; margin: 0 auto; }

/* Interactive piano keyboard. A piano is white/black in every theme, so key fills
   are fixed; only the correct/wrong/lit highlights use theme accents. */
.keyboard-visual { margin: 10px 0 2px; text-align: center; }
.kb-svg { width: 100%; max-width: 360px; height: auto; display: block; margin: 6px auto 0; }
.kb-key { cursor: pointer; }
.kb-key rect { transition: fill .1s; }
.kb-white rect { fill: #f6f8fc; stroke: #c3cddd; stroke-width: 2; }
.kb-black rect { fill: #1a2233; stroke: #0a1120; stroke-width: 2; }
.kb-key:not(.kb-disabled):hover rect { filter: brightness(0.95); }
.kb-white.lit rect { fill: var(--info); stroke: var(--info-strong); }
.kb-black.lit rect { fill: var(--info); stroke: var(--info-strong); }
/* Correct-answer highlight: the same clear green on white and black keys (the
   theme accent read near-black on white keys in the dark themes). */
.kb-white.correct rect { fill: #2e9e63; stroke: #1c6b41; }
.kb-black.correct rect { fill: #2e9e63; stroke: #1c6b41; }
.kb-white.wrong rect { fill: var(--miss-bg); stroke: var(--danger); }
.kb-black.wrong rect { fill: var(--danger); stroke: var(--danger); }
.kb-disabled { cursor: default; }
/* Middle-C landmark: a small, faint bar at the foot of the centre octave's C.
   Light slate so it reads as a quiet reference, not competing with the
   lit/correct/wrong states; non-interactive. */
.kb-mid-c { fill: #969fb0; pointer-events: none; }

/* ── Practice tab: Fretsy-style randomizer/player ────────────────────────────
   A scope drawer, a lock bar of pill chips + toggles, the keyboard display, and
   primary/secondary control rows — the piano port of Fretsy's Practice layout.
   Reuses the interactive keyboard (.kb-* above); the keys light in sequence via
   .pp-play as each note sounds. All colors are theme tokens. */
.pp { max-width: 440px; margin: 0 auto; }
.pp-note { color: var(--ink-soft); text-align: center; }

/* Scope drawer */
.pp-scope { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; margin: 4px 0 10px; }
.pp-scope-sum { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px;
  padding: 11px 14px; font-weight: 600; color: var(--ink); }
.pp-scope-sum::-webkit-details-marker { display: none; }
.pp-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none; }
.pp-scope-text { flex: 1; }
.pp-chev { color: var(--ink-soft); transition: transform .15s; }
.pp-scope[open] .pp-chev { transform: rotate(180deg); }
.pp-scope-body { padding: 2px 14px 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.pp-field { display: flex; flex-direction: column; gap: 6px; }
.pp-field-lbl { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); }
.pp-opts { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.pp-opt { display: inline-flex; align-items: center; gap: 5px; color: var(--ink); font-size: 14px; cursor: pointer; }

/* Lock bar — pill chips (with selects) + toggle pills */
.pp-lockbar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; margin: 0 0 12px; }
.pp-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px 5px 12px;
  border: 1.5px solid var(--accent); border-radius: 999px; background: var(--chip-bg, transparent); }
.pp-chip-name { font-size: 13px; font-weight: 600; color: var(--accent); }
.pp-sel { font: inherit; font-size: 13px; border: none; background: transparent; color: var(--ink); cursor: pointer; padding: 2px 2px;
  max-width: 128px; text-overflow: ellipsis; }  /* cap so a long option (e.g. "Harmonic minor") can't balloon the chip */
.pp-sel:focus { outline: none; }
.pp-toggle { font: inherit; font-size: 13px; font-weight: 600; padding: 6px 14px; border-radius: 999px;
  border: 1.5px solid var(--accent); background: transparent; color: var(--accent); cursor: pointer; }
.pp-toggle.is-on { background: var(--accent); color: var(--on-accent); }

/* Tempo (BPM) slider */
.pp-bpm { display: flex; align-items: center; gap: 10px; justify-content: center; margin: 0 0 12px; }
.pp-bpm-lbl { font-size: 13px; font-weight: 600; color: var(--accent); }
.pp-bpm-val { font-size: 13px; color: var(--ink-soft); min-width: 60px; font-variant-numeric: tabular-nums; }
.pp-range { -webkit-appearance: none; appearance: none; width: 180px; height: 4px; border-radius: 4px;
  background: var(--line); outline: none; }
.pp-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 18px; height: 18px;
  border-radius: 50%; background: var(--accent); cursor: pointer; border: none; }
.pp-range::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--accent); cursor: pointer; border: none; }

/* Display */
.pp-display { text-align: center; position: relative; }
.pp-caption { font-size: 24px; font-weight: 700; color: var(--accent); margin: 4px 0 2px; }
/* The "Scale" / "Mode" / "Arpeggio" type word — the theme's info hue, a clearly
   different color from the accent-colored key/name (accents are warm on several
   themes, so a warm type word read too close; --info is cool + distinct). */
.pp-cap-type { color: var(--info); }
.pp-kb { margin: 8px 0 2px; }
.pp-empty { color: var(--ink-soft); padding: 22px 0; }

/* Count-in: a big "get ready" number over the keys, ticking down before playback. */
.pp-countin { position: absolute; left: 0; right: 0; top: 54%; transform: translateY(-50%);
  font-size: 80px; font-weight: 800; line-height: 1; color: var(--accent);
  text-shadow: 0 3px 16px rgba(0, 0, 0, .55); pointer-events: none; }
.pp-pulse { animation: pp-pop .32s ease-out; }
@keyframes pp-pop { from { transform: translateY(-50%) scale(1.45); opacity: .35; } to { transform: translateY(-50%) scale(1); opacity: 1; } }

/* The sounding key: a bright pulse over the dim scale-tone fill. */
.kb-white.pp-scale rect { fill: #cfe0d4; stroke: #8fb79c; }
.kb-black.pp-scale rect { fill: #3f5c49; stroke: #26402f; }
.kb-white.pp-play rect { fill: var(--accent); stroke: var(--accent-strong); }
.kb-black.pp-play rect { fill: var(--accent); stroke: var(--accent-strong); }

/* Control rows */
.pp-controls { display: flex; align-items: center; gap: 10px; margin: 12px 0 0; }
.pp-primary { justify-content: center; }
.pp-cd, .pp-spacer { flex: 1; font-size: 13px; color: var(--ink-soft); }
.pp-cd { text-align: right; }
.pp-acts { display: flex; gap: 10px; }
.pp-btn { font: inherit; font-weight: 600; font-size: 15px; padding: 10px 20px; border-radius: 10px;
  border: 1.5px solid var(--accent); background: var(--accent); color: var(--on-accent); cursor: pointer; }
.pp-hands { background: transparent; color: var(--accent); }
.pp-hands.is-on { background: var(--accent); color: var(--on-accent); }
.pp-btn:hover { filter: brightness(0.96); }
.pp-secondary { justify-content: center; margin-top: 10px; }
.pp-audio { font: inherit; font-size: 14px; font-weight: 600; padding: 8px 16px; border-radius: 9px;
  border: 1.5px solid var(--accent); background: transparent; color: var(--accent); cursor: pointer; }
.pp-audio.is-on { background: var(--accent); color: var(--on-accent); }

/* Spelled-tone strip (note names / degrees) — highlights in time with playback */
.pp-strip { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 14px 0 2px; }
.pp-chipnote { min-width: 30px; text-align: center; padding: 5px 9px; border-radius: 8px; font-weight: 600;
  font-size: 14px; background: var(--btn-soft); color: var(--ink-mid); border: 1px solid var(--line); }
.pp-chipnote.is-on { background: var(--accent); color: var(--on-accent); border-color: var(--accent-strong); }
