/* ============================================================
   strummer — tuner page
   Uses the tokens from styles.css (--bg, --accent, --panel…).
   The tuner page scrolls, unlike the player shell.
   ============================================================ */

html, body { overflow: auto; height: auto; }

.tune-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 20px 80px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ---------- header ---------- */
.tune-head { text-align: center; }
.back {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 22px;
  transition: color .15s;
}
.back:hover { color: var(--fg); }
.back .period { color: var(--accent); }

.tune-head h1 {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.tune-head h1 em { font-style: italic; }
.tune-head h1 .amp { color: var(--muted); }
.sub { color: var(--muted); font-size: 0.9rem; margin-top: 8px; }

/* ---------- panels ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 22px;
}
.label {
  display: block;
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}
.mono { font-family: var(--font-mono); }
.dim { color: var(--muted); }
.small { font-size: 0.78rem; }

.error {
  background: rgba(220, 38, 38, 0.12);
  border: 1px solid rgba(220, 38, 38, 0.4);
  color: #fca5a5;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.86rem;
}

/* ---------- tuner ---------- */
.tuner { display: flex; flex-direction: column; align-items: center; gap: 16px; }

.readout {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  gap: 12px;
}
.note-wrap {
  font-family: var(--font-display);
  font-size: 4rem;
  line-height: 1;
  text-align: right;
}
.note-wrap sub { font-size: 1.1rem; color: var(--muted); vertical-align: baseline; }
.readout .meta { text-align: center; font-size: 0.78rem; }
.cents { font-size: 1.1rem; text-align: left; color: var(--muted-2); }

/* dial */
.dial {
  position: relative;
  width: 100%;
  height: 68px;
  background: var(--panel-2);
  border: 1px solid var(--rule);
  border-radius: 10px;
  overflow: hidden;
}
.tick { position: absolute; top: 12px; bottom: 12px; width: 1px; background: var(--rule-2); }
.tick.center { left: 50%; background: var(--muted); width: 2px; }
.tick.t-25 { left: 25%; }
.tick.t25 { left: 75%; }

.needle {
  position: absolute;
  top: 6px; bottom: 6px;
  left: 50%;
  width: 3px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: var(--accent);
  transition: transform .08s linear, background .2s;
}
.dial.in-tune .needle { background: var(--good); box-shadow: 0 0 18px rgba(74, 222, 128, .55); }

.verdict { font-size: 0.95rem; color: var(--muted-2); min-height: 1.4em; }
.verdict.good { color: var(--good); }
.verdict.off { color: var(--accent); }

.level-wrap {
  width: 100%; height: 3px;
  background: var(--panel-2);
  border-radius: 2px; overflow: hidden;
}
.level { height: 100%; width: 0; background: var(--muted); transition: width .1s; }

.btn-primary {
  background: var(--fg);
  color: var(--bg);
  border-radius: 999px;
  padding: 11px 26px;
  font-weight: 600;
  font-size: 0.92rem;
  transition: transform .12s ease-out, opacity .15s;
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* reference tones */
.ref { width: 100%; text-align: center; margin-top: 4px; }
.strings { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.stringbtn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 52px; min-height: 46px;
  padding: 8px 10px;
  background: var(--panel-2);
  border: 1px solid var(--rule);
  border-radius: 9px;
  font-weight: 600;
  transition: border-color .15s, background .15s;
}
.stringbtn small { font-family: var(--font-mono); font-size: 0.6rem; color: var(--muted); font-weight: 400; }
.stringbtn:hover { background: var(--elevated); border-color: var(--rule-2); }
.stringbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- chord ear ---------- */
.chord { text-align: center; }
.chord-name {
  font-family: var(--font-display);
  font-size: 3.4rem;
  line-height: 1.1;
  color: var(--muted);
  transition: color .18s, transform .18s;
}
.chord-name.active { color: var(--fg); transform: scale(1.04); }

/* ---------- songs ---------- */
.songs { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.song {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "title chords" "artist chords";
  gap: 2px 14px;
  text-align: left;
  padding: 14px 16px;
  background: var(--panel-2);
  border: 1px solid var(--rule);
  border-radius: 10px;
  transition: background .15s, border-color .15s;
}
.song:hover { background: var(--elevated); border-color: var(--rule-2); }
.song:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.s-title { grid-area: title; font-weight: 600; font-size: 0.95rem; }
.s-artist { grid-area: artist; color: var(--muted); font-size: 0.8rem; }
.s-chords {
  grid-area: chords; align-self: center;
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted-2);
}

/* ---------- practice ---------- */
.practice { position: relative; text-align: center; }
.p-close {
  position: absolute; top: 10px; right: 12px;
  width: 40px; height: 40px;
  font-size: 1.5rem; line-height: 1; color: var(--muted);
  border-radius: 8px;
}
.p-close:hover { color: var(--fg); background: var(--panel-2); }
.p-title { font-family: var(--font-display); font-size: 1.7rem; }

.p-diagram { margin: 18px 0 14px; display: flex; justify-content: center; }
.p-diagram.hit .diagram { animation: pop .45s ease-out; }
@keyframes pop {
  0% { transform: scale(1); border-color: var(--good); }
  40% { transform: scale(1.07); border-color: var(--good); box-shadow: 0 0 26px rgba(74,222,128,.35); }
  100% { transform: scale(1); }
}

.diagram {
  background: var(--panel-2);
  border: 1px solid var(--rule-2);
  border-radius: 12px;
  padding: 14px 18px;
  min-width: 210px;
}
.dg-name { font-family: var(--font-display); font-size: 2rem; margin-bottom: 8px; }
.dg-strings { display: flex; gap: 10px; justify-content: center; }
.fing {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-family: var(--font-mono); font-size: 0.78rem;
  background: var(--elevated); color: var(--fg);
}
.fing.muted { color: var(--muted); background: transparent; }
.fing.open { color: var(--muted-2); background: transparent; border: 1px solid var(--rule-2); }
.fing.fretted { background: var(--accent); color: #fff; font-weight: 600; }
.dg-legend {
  margin-top: 8px;
  font-family: var(--font-mono); font-size: 0.64rem;
  letter-spacing: 0.42em; color: var(--muted);
}
.no-shape { font-family: var(--font-display); font-size: 2rem; color: var(--muted); }

.p-loop { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chip {
  font-family: var(--font-mono); font-size: 0.82rem;
  padding: 5px 11px; border-radius: 7px;
  background: var(--panel-2); color: var(--muted-2);
  border: 1px solid transparent;
}
.chip.next { background: var(--elevated); color: var(--fg); border-color: var(--accent); }
.arrow { color: var(--muted); font-size: 0.72rem; }

.p-score { display: flex; align-items: baseline; justify-content: center; gap: 10px; margin-bottom: 8px; }
.p-count { font-size: 1.7rem; color: var(--good); }

.tune-foot {
  text-align: center;
  font-family: var(--font-mono); font-size: 0.66rem;
  letter-spacing: 0.1em; color: var(--muted);
  margin-top: 10px;
}
.tune-foot .period { color: var(--accent); }

@media (max-width: 560px) {
  .note-wrap { font-size: 3rem; }
  .chord-name { font-size: 2.6rem; }
  .readout { grid-template-columns: 1fr auto; }
  .cents { grid-column: 2; text-align: right; }
}

@media (prefers-reduced-motion: reduce) {
  .needle { transition: none; }
  .p-diagram.hit .diagram { animation: none; }
  .btn-primary:hover { transform: none; }
}

/* ============================================================
   Analyzer — bring your own audio
   ============================================================ */
.drop {
  border: 1px dashed var(--rule-2);
  border-radius: 12px;
  padding: 28px 18px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--panel-2); }
.drop:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.drop-inner { display: flex; flex-direction: column; gap: 5px; }
.drop-inner strong { font-size: 1.02rem; }
.tiny { font-size: 0.68rem; }

.progress-wrap { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.progress-bar { height: 4px; background: var(--panel-2); border-radius: 3px; overflow: hidden; }
.progress { height: 100%; width: 0; background: var(--accent); transition: width .25s ease-out; }

.analysis { margin-top: 18px; display: flex; flex-direction: column; gap: 16px; }
.a-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.a-stat {
  display: flex; flex-direction: column; gap: 3px; align-items: center;
  background: var(--panel-2); border: 1px solid var(--rule);
  border-radius: 10px; padding: 12px 8px;
}
.a-stat strong { font-family: var(--font-display); font-size: 1.5rem; line-height: 1; }

.a-shapes { display: flex; flex-direction: column; gap: 8px; }
.shape-row { display: flex; gap: 7px; flex-wrap: wrap; }
.shape-chip {
  font-family: var(--font-mono); font-size: 0.8rem;
  padding: 6px 12px; border-radius: 8px;
  background: var(--elevated); border: 1px solid var(--rule-2);
}

.player { width: 100%; height: 36px; }

.a-now { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.a-current {
  font-family: var(--font-display); font-size: 2.6rem; line-height: 1;
  color: var(--fg);
}

.timeline {
  display: flex; width: 100%; height: 46px;
  border: 1px solid var(--rule); border-radius: 9px; overflow: hidden;
}
.seg {
  min-width: 3px; height: 100%;
  font-family: var(--font-mono); font-size: 0.66rem;
  color: var(--muted-2); background: var(--panel-2);
  border-right: 1px solid var(--rule);
  overflow: hidden; white-space: nowrap;
  transition: background .12s, color .12s;
}
.seg:hover { background: var(--elevated); color: var(--fg); }
.seg.active { background: var(--accent); color: #fff; font-weight: 600; }
.seg:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

@media (max-width: 560px) {
  .a-current { font-size: 2rem; }
  .a-stat strong { font-size: 1.2rem; }
}

/* ---------- /vibe handoff banner ---------- */
.learning {
  border: 1px solid #322e29;
  border-radius: 10px;
  padding: 0.9rem 1rem;
  margin-bottom: 1.25rem;
  background: #14120f;
}
.learning-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}
.learning-eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8a8178;
}
.learning-back { font-size: 0.75rem; color: #8a8178; }
.learning-back:hover { color: #dc2626; }
.learning-title {
  font-size: 1.15rem;
  margin-top: 0.35rem;
  color: #f5f5f4;
}
.learning-meta { font-size: 0.8rem; color: #8a8178; margin-top: 0.2rem; }
.learning-chords {
  font-size: 0.95rem;
  color: #dc2626;
  margin-top: 0.5rem;
  word-break: break-word;
}
.learning .shape-row { margin-top: 0.6rem; }
.shape-chip {
  display: inline-block;
  border: 1px solid #322e29;
  border-radius: 6px;
  padding: 0.2rem 0.5rem;
  margin: 0 0.3rem 0.3rem 0;
  font-size: 0.8rem;
  color: #f5f5f4;
}
