/* === Metronome === */

main { max-width: 560px; }

/* --- BPM display --- */
.met-display { text-align: center; margin: 0.5rem 0 1.25rem; }
.met-bpm {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  font-family: "Fredoka", "Nunito", sans-serif;
  font-weight: 600;
  font-size: 4.5rem;
  line-height: 1;
  color: var(--ink);
}
.met-bpm-unit { font-size: 1.1rem; font-weight: 700; color: var(--muted); }
.met-tempo-name {
  margin-top: 0.3rem;
  font-style: italic;
  font-weight: 700;
  color: var(--primary-dark);
  font-size: 1.05rem;
}

/* --- Beat dots --- */
.met-dots {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  min-height: 26px;
  margin-bottom: 1.4rem;
}
.met-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--border);
  transition: background 0.08s ease, border-color 0.08s ease;
}
.met-dot.accent { border-color: var(--primary); }
.met-dot.on { background: var(--accent); border-color: var(--accent); }
.met-dot.accent.on { background: var(--primary); border-color: var(--primary); }
.met-dot.pop { animation: met-pop 0.18s ease; }
@keyframes met-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.55); }
  100% { transform: scale(1); }
}

/* --- Tempo slider row --- */
.met-tempo-row { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 1.1rem; }
.met-step {
  width: 44px; height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--btn);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
}
.met-step:hover { border-color: var(--primary); color: var(--primary-dark); }
.met-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  border-radius: 999px;
  background: var(--border);
  outline: none;
}
.met-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid #fff;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.met-slider::-moz-range-thumb {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid #fff;
  box-shadow: var(--shadow);
  cursor: pointer;
}

/* --- Buttons --- */
.met-buttons { display: flex; gap: 0.7rem; margin-bottom: 1.6rem; }
.met-play { flex: 1; margin-top: 0; }
.met-play.playing { background: var(--accent); border-color: var(--accent); }
.met-play.playing:hover { background: #5fb3c8; border-color: #5fb3c8; }
.met-tap {
  flex-shrink: 0;
  background: var(--btn);
  font-weight: 700;
  padding: 0.85rem 1.4rem;
}
.met-tap:hover { border-color: var(--primary); color: var(--primary-dark); }
.met-tap.flash { background: var(--pick-bg); border-color: var(--pick-border); }

/* --- Settings --- */
.met-settings {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 18px;
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow);
}
.met-set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0;
}
.met-set-row + .met-set-row { border-top: 1px solid var(--border); }
.met-set-label { font-weight: 700; color: var(--ink); }
.met-stepper { display: flex; align-items: center; gap: 0.8rem; }
.met-stepper button {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--btn);
  font-size: 1.2rem; font-weight: 700; line-height: 1;
  color: var(--ink);
}
.met-stepper button:hover { border-color: var(--primary); color: var(--primary-dark); }
.met-stepper span { min-width: 1.4rem; text-align: center; font-weight: 700; font-size: 1.1rem; }
.met-subs { display: flex; gap: 0.4rem; }
.met-sub {
  min-width: 44px;
  height: 40px;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: var(--btn);
  font-size: 1.2rem;
  color: var(--ink);
  padding: 0 0.4rem;
}
.met-sub:hover { border-color: var(--primary); }
.met-sub.picked { background: var(--pick-bg); border-color: var(--pick-border); color: var(--primary-dark); }
.met-trip { font-size: 0.7rem; letter-spacing: -1px; }
.met-vol { max-width: 180px; }

/* --- Reference pitch --- */
.pitch-card { margin-top: 1.1rem; }
.pitch-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 0.9rem; }
.pitch-title { margin: 0; font-family: "Fredoka", "Nunito", sans-serif; font-weight: 600; font-size: 1.2rem; color: var(--ink); }
.pitch-display { font-weight: 700; color: var(--muted); }
.pitch-display b { font-size: 1.3rem; color: var(--primary-dark); margin-right: 0.35rem; }
.pitch-notes {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.4rem;
  margin-bottom: 0.4rem;
}
.pitch-note-btn {
  height: 40px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: var(--btn);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
}
.pitch-note-btn.sharp { background: #f3eef6; color: var(--muted); font-size: 0.72rem; padding: 0 0.15rem; }
.pitch-note-btn:hover { border-color: var(--primary); }
.pitch-note-btn.picked { background: var(--pick-bg); border-color: var(--pick-border); color: var(--primary-dark); }
.pitch-tones { display: flex; gap: 0.35rem; flex-wrap: wrap; justify-content: flex-end; }
.pitch-tone-btn {
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: var(--btn);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--ink);
}
.pitch-tone-btn:hover { border-color: var(--primary); }
.pitch-tone-btn.picked { background: var(--pick-bg); border-color: var(--pick-border); color: var(--primary-dark); }
.pitch-play { margin-top: 0.9rem; }
.pitch-play.playing { background: var(--accent); border-color: var(--accent); }
.pitch-play.playing:hover { background: #5fb3c8; border-color: #5fb3c8; }
.met-hint { color: var(--muted); font-weight: 400; font-size: 0.8rem; }

kbd {
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--muted);
}

@media (max-width: 460px) {
  .met-bpm { font-size: 3.5rem; }
  .met-set-row { flex-wrap: wrap; }
}
