/* Harmonica course (decision 0308): the exercise screens drawn by courses/harmonica/kind.js inside the lesson mount.
   Rules ported from css/style.css of branch `music`, scoped under .hp so they do not touch the course page around them.
   Colours: --blow, --draw, --heard, --scale, --metal, --wood of css/style.css. */
.hp { display: flex; flex-direction: column; gap: 12px; }
.hp [hidden] { display: none !important; }
.hp .hp-top { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.hp .hp-mic.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.hp .hp-cfg summary { cursor: pointer; color: var(--muted); }
.hp .hp-cfg .range { display: block; margin: 10px 0; }
.hp .hp-cfg .range input { width: 100%; }
.hp .hp-text { margin: 0; }

/* what to play */
.hp .hp-instr { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.hp .hp-instr.flash { animation: hp-flash .35s ease; }
@keyframes hp-flash { 0% { box-shadow: 0 0 0 0 var(--ok); } 100% { box-shadow: 0 0 0 10px transparent; } }
.hp .instr-main { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; font-size: 1.4rem; }
.hp .instr-hole b { font-size: 2.2rem; }
.hp .instr-note { color: var(--muted); font-size: 1.05rem; }
.hp .dir-badge { font-weight: 700; padding: 6px 14px; border-radius: 999px; background: var(--line); color: var(--text); font-size: 1.1rem; }
.hp .dir-badge.blow { background: var(--blow); color: #fff; }
.hp .dir-badge.draw { background: var(--draw); color: #fff; }
.hp .dir-badge.done { background: var(--ok); color: #fff; }
.hp .dir-badge.countin { font-size: 2.2rem; font-weight: 800; }
.hp .hold { height: 8px; background: var(--bg); border-radius: 4px; margin: 10px 0 6px; overflow: hidden; }
.hp .hold-fill { height: 100%; width: 0; background: var(--ok); transition: width .05s linear; }
.hp .hint { min-height: 1.4em; color: var(--muted); }
.hp .hint.bad { color: var(--bad); }
.hp .hint.good { color: var(--ok); }

/* the harmonica: always fits the width, no horizontal scroll */
.hp .harp { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; min-width: 0; }
.hp .hole { display: grid; grid-template-rows: 30px auto auto auto 30px; row-gap: 2px; text-align: center; }
.hp .arrow { font-weight: 700; font-size: .75rem; display: flex; align-items: center; justify-content: center; border-radius: 8px; visibility: hidden; }
.hp .arrow.up { align-self: end; }
.hp .arrow.blow { background: var(--blow); color: #fff; }
.hp .arrow.draw { background: var(--draw); color: #fff; }
.hp .lbl { font-size: .78rem; color: var(--muted); padding: 3px 0; border-radius: 6px; }
.hp .lbl.in-scale { background: var(--scale); color: var(--text); font-weight: 700; }
.hp .hbody { background: var(--metal); padding: 8px 0; border-radius: 6px; }
.hp .slot { width: 60%; height: 26px; margin: 0 auto; background: var(--wood); border-radius: 4px; color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; transition: background .1s, box-shadow .1s; }
.hp .hole.next .slot { box-shadow: 0 0 0 2px var(--muted); }
.hp .hole.t-blow .arrow.blow, .hp .hole.t-draw .arrow.draw { visibility: visible; }
.hp .hole.t-blow .slot { background: var(--blow); box-shadow: 0 0 0 3px var(--blow-soft); }
.hp .hole.t-draw .slot { background: var(--draw); box-shadow: 0 0 0 3px var(--draw-soft); }
.hp .hole.t-blow .lbl.blow { background: var(--blow-soft); color: var(--text); font-weight: 700; }
.hp .hole.t-draw .lbl.draw { background: var(--draw-soft); color: var(--text); font-weight: 700; }
.hp .hole.h-blow .lbl.blow, .hp .hole.h-draw .lbl.draw { outline: 2px solid var(--heard); color: var(--heard); font-weight: 700; }
.hp .hole.h-blow .slot, .hp .hole.h-draw .slot { outline: 3px solid var(--heard); outline-offset: 2px; }
.hp .legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; font-size: .82rem; color: var(--muted); }
.hp .sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 4px; }
.hp .sw.blow { background: var(--blow); }
.hp .sw.draw { background: var(--draw); }
.hp .sw.heardsw { background: transparent; outline: 2px solid var(--heard); }

/* what the microphone hears */
.hp .meter { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.hp .heard { min-width: 140px; }
.hp .heard-note { font-size: 2rem; font-weight: 700; color: var(--heard); line-height: 1.1; }
.hp .heard-sub { color: var(--muted); font-size: .9rem; }
.hp .meter-right { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 10px; }
.hp .cents-scale { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); }
.hp .cents-bar { position: relative; height: 18px; background: var(--bg); border-radius: 9px; }
.hp .cents-zone { position: absolute; top: 0; bottom: 0; background: var(--draw-soft); border-radius: 9px; }
.hp .cents-needle { position: absolute; top: -3px; bottom: -3px; width: 4px; margin-left: -2px; left: 50%; background: var(--heard); border-radius: 2px; transition: left .08s; visibility: hidden; }
.hp .level-row { display: flex; align-items: center; gap: 10px; font-size: .8rem; color: var(--muted); }
.hp .level { position: relative; flex: 1; height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.hp .level-fill { height: 100%; width: 0; background: var(--muted); }
.hp .level-gate { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--bad); }

/* player: tempo, metronome, lane */
.hp .player-bar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.hp .tempo { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 200px; }
.hp .tempo input { flex: 1; }
.hp .check { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.hp .tab-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.hp .progress-text { font-weight: 600; }
.hp .lane { position: relative; height: 74px; background: var(--bg); border-radius: 10px; overflow: hidden; }
.hp .lane-inner { position: absolute; top: 0; bottom: 0; left: 0; will-change: transform; }
.hp .playhead { position: absolute; top: 0; bottom: 0; left: 25%; width: 3px; margin-left: -1px; background: var(--text); opacity: .8; }
.hp .lane-beat { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); opacity: .6; }
.hp .lane-bar { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--muted); opacity: .6; }
.hp .lane-note { position: absolute; top: 14px; height: 46px; border-radius: 8px; display: flex; align-items: center; padding-left: 8px; font: 700 .95rem ui-monospace, Consolas, monospace; color: #fff; border: 3px solid transparent; overflow: hidden; white-space: nowrap; box-sizing: border-box; }
.hp .lane-note.blow { background: var(--blow); }
.hp .lane-note.draw { background: var(--draw); }
.hp .lane-note.g-perfect { border-color: var(--ok); box-shadow: 0 0 0 2px var(--ok); }
.hp .lane-note.g-early, .hp .lane-note.g-late { border-color: #e0b400; }
.hp .lane-note.g-wrong, .hp .lane-note.g-miss { opacity: .35; border-color: var(--bad); }
.hp .lane-note.g-done { opacity: .5; }
.hp .lane-note .g { font: 600 .7rem system-ui, sans-serif; margin-left: 6px; opacity: .95; }
.hp .lane-note.current { outline: 3px solid var(--text); outline-offset: 1px; }
.hp .lane-count { position: absolute; top: 14px; height: 46px; display: flex; align-items: center; justify-content: center; border: 2px dashed var(--line); border-radius: 8px; color: var(--muted); font: 700 1.2rem system-ui, sans-serif; box-sizing: border-box; }
.hp .lane-chord { position: absolute; top: 0; padding-left: 4px; font: 700 .7rem system-ui, sans-serif; color: var(--muted); }
.hp .rhythm-stats { font-size: .95rem; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.hp .rhythm-stats b.ok { color: var(--ok); }
.hp .rhythm-stats b.warn { color: #c99a00; }
.hp .rhythm-stats b.bad { color: var(--bad); }

/* bends */
.hp .bend-main { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.hp .bend-meter { position: relative; width: 170px; flex: none; background: var(--bg); border-radius: 10px; overflow: hidden; }
.hp .bend-tick { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--muted); display: flex; justify-content: space-between; padding: 2px 8px 0; font-size: .8rem; }
.hp .bend-tick span { font: 700 .9rem ui-monospace, Consolas, monospace; }
.hp .bend-tick em { font-style: normal; color: var(--muted); }
.hp .bend-tick.target { border-top: 2px solid var(--ok); }
.hp .bend-zone { position: absolute; left: 0; right: 0; background: var(--ok); opacity: .18; }
.hp .bend-marker { position: absolute; left: 8px; right: 8px; height: 6px; margin-top: -3px; border-radius: 3px; background: var(--heard); visibility: hidden; transition: top .06s linear; }
.hp .bend-marker.hit { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.hp .bend-info { flex: 1; min-width: 220px; }
.hp .bend-title { font-size: 1.15rem; font-weight: 700; margin-bottom: 6px; }
.hp .bend-phase { font-size: 1.05rem; }
.hp .bend-phase.good { color: var(--ok); font-weight: 600; }
.hp .bend-now { min-height: 1.4em; color: var(--muted); }
.hp .bend-reps { font-weight: 600; margin-top: 4px; }
.hp .bend-tip { color: var(--muted); font-size: .9rem; margin-bottom: 0; }

/* blues jam */
.hp .jam-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.hp .jam-cell { background: var(--bg); border: 2px solid transparent; border-radius: 8px; padding: 8px 6px; text-align: center; font-weight: 700; }
.hp .jam-cell small { display: block; font-weight: 400; color: var(--muted); font-size: .75rem; }
.hp .jam-cell.current { border-color: var(--text); background: var(--card); }

/* techniques */
.hp .tech-status { min-height: 1.4em; font-weight: 600; }
.hp .tech-status.good { color: var(--ok); }
.hp .tech-status.bad { color: var(--bad); }
.hp .tv-big { font: 700 1.5rem ui-monospace, Consolas, monospace; margin: 6px 0 10px; }
.hp .tv-level { position: relative; height: 14px; background: var(--bg); border-radius: 7px; overflow: hidden; margin: 8px 0; }
.hp .tv-fill { height: 100%; width: 0; background: var(--heard); }
.hp .tv-mark { position: absolute; top: 0; bottom: 0; width: 3px; background: var(--ok); left: -10px; }
.hp .tv-mark.loud { background: var(--bad); }
.hp .tv-dots { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.hp .tv-dots span { width: 18px; height: 18px; border-radius: 50%; background: var(--bg); border: 2px solid var(--line); }
.hp .tv-dots span.on { background: var(--ok); border-color: var(--ok); }
.hp .tv-notes { display: flex; flex-wrap: wrap; gap: 8px; }
.hp .tv-notes span { padding: 6px 10px; border-radius: 8px; background: var(--bg); font-family: ui-monospace, Consolas, monospace; }
.hp .tv-notes span:last-child { border: 2px solid var(--ok); }
.hp .tv-notes span.on { background: var(--heard); color: #fff; }

@media (max-width: 600px) {
  .hp .mic-label { display: none; }
  .hp .instr-main { font-size: 1.1rem; gap: 8px; }
  .hp .instr-hole b { font-size: 1.8rem; }
  .hp .dir-badge { font-size: 1rem; padding: 5px 10px; }
  .hp .harp { gap: 2px; }
  .hp .hole { grid-template-rows: 26px auto auto auto 26px; }
  .hp .arrow { font-size: 0; border-radius: 6px; }
  .hp .arrow::before { font-size: .95rem; }
  .hp .arrow.blow::before { content: '⬇'; }
  .hp .arrow.draw::before { content: '⬆'; }
  .hp .lbl { font-size: .62rem; padding: 2px 0; }
  .hp .slot { width: 80%; height: 24px; font-size: .85rem; }
  .hp .hbody { padding: 6px 0; }
  .hp .legend { gap: 10px; font-size: .75rem; }
  .hp .meter { gap: 10px; }
  .hp .heard { min-width: 0; display: flex; align-items: baseline; gap: 10px; }
  .hp .heard-note { font-size: 1.5rem; }
  .hp .meter-right { min-width: 100%; }
  .hp .bend-meter { width: 120px; }
  .hp .bend-info { min-width: 0; }
  .hp .tempo { min-width: 100%; }
  .hp .jam-grid { gap: 4px; }
  .hp .jam-cell { padding: 6px 2px; font-size: .9rem; }
}
