/* Practice tools (metronome, tuner) — scoped styles, main analysis page untouched */

.practice-page {
  min-height: 100vh;
}

.practice-shell {
  max-width: 560px;
  margin: 0 auto;
  padding: 1.25rem 1rem 2.5rem;
}

.practice-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.practice-header-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.practice-logo {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.practice-header-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.practice-nav {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.practice-nav-link {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-muted);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.practice-nav-link:hover {
  color: var(--text);
  background: var(--glass-strong);
}

.practice-nav-link.is-active {
  color: var(--btn-primary-text);
  background: var(--btn-primary-bg);
  border-color: transparent;
}

.practice-card {
  padding: 1.35rem 1.25rem 1.5rem;
}

.practice-title {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  line-height: 1.35;
}

.practice-lead {
  margin: 0 0 1.25rem;
  line-height: 1.55;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.practice-control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.practice-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.practice-value-display {
  font-family: var(--mono);
  font-size: 2.4rem;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  margin: 0.5rem 0 0.75rem;
  color: var(--accent);
}

.practice-slider {
  width: 100%;
  accent-color: var(--accent);
  margin: 0.35rem 0 0.15rem;
}

.practice-slider-hints {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.practice-select {
  appearance: none;
  padding: 0.45rem 2rem 0.45rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: var(--glass-strong);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) calc(50% + 2px), calc(100% - 11px) calc(50% + 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.practice-actions {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-top: 1.15rem;
}

.practice-actions .btn {
  flex: 1 1 auto;
  min-width: 7rem;
}

/* Metronome beat lights */
.metronome-beats {
  display: flex;
  justify-content: center;
  gap: 0.65rem;
  margin: 1.25rem 0 0.5rem;
}

.metronome-beat {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  transition: transform 0.08s ease, background 0.08s ease, box-shadow 0.08s ease;
}

.metronome-beat.is-active {
  transform: scale(1.35);
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent-dim);
}

.metronome-beat.is-downbeat.is-active {
  background: var(--btn-primary-bg);
  box-shadow: 0 0 16px var(--accent-dim);
}

[data-theme="paper"] .metronome-beat.is-downbeat.is-active {
  background: var(--accent);
}

.metronome-status {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  min-height: 1.25rem;
}

/* Tuner */
.tuner-display {
  text-align: center;
  margin: 0.75rem 0 1rem;
}

.tuner-note {
  font-family: var(--mono);
  font-size: 3.2rem;
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.tuner-freq {
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.tuner-meter {
  position: relative;
  height: 0.55rem;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  overflow: hidden;
  margin: 0 auto 0.35rem;
  max-width: 280px;
}

.tuner-meter-center {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  transform: translateX(-50%);
  background: var(--text-muted);
  opacity: 0.5;
}

.tuner-meter-needle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 4px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--accent);
  transition: left 0.06s linear, background 0.12s ease;
}

.tuner-meter-needle.is-in-tune {
  background: var(--success);
}

.tuner-cents {
  font-family: var(--mono);
  font-size: 0.88rem;
  color: var(--text-muted);
  min-height: 1.2rem;
}

.tuner-strings {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
  margin-top: 1rem;
}

.tuner-string-btn {
  padding: 0.55rem 0.35rem;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.tuner-string-btn:hover {
  background: var(--glass-strong);
}

.tuner-string-btn.is-active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

.tuner-string-btn.is-in-tune {
  background: var(--accent-dim);
  border-color: var(--success);
}

.tuner-status {
  margin-top: 0.85rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
  min-height: 2.5rem;
}

.tuner-status.is-error {
  color: var(--error-text);
}

.tuner-mode-row {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.tuner-mode-btn {
  flex: 1 1 auto;
  min-width: 6.5rem;
}

.tuner-mode-btn.is-active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

.practice-footer-note {
  margin-top: 1.25rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
  text-align: center;
}

@media (max-width: 480px) {
  .practice-value-display {
    font-size: 2rem;
  }

  .tuner-note {
    font-size: 2.6rem;
  }

  .tuner-strings {
    grid-template-columns: repeat(2, 1fr);
  }
}
