/* ============================================================
   Sargam Tuner — circular display + meter
   ============================================================ */

.tuner-page {
  max-width: 68rem;
  margin: 0 auto;
  padding-top: clamp(1.5rem, 4vh, 3rem);
  position: relative;
}

.tuner-page::before {
  content: "";
  position: absolute;
  inset: -2rem -4rem 0;
  background: radial-gradient(ellipse at 50% 30%, rgba(255, 176, 0, 0.1) 0%, transparent 65%);
  pointer-events: none;
  z-index: -1;
  filter: blur(40px);
}

.tuner-hero {
  text-align: center;
  padding: 1rem 0 2rem;
}

.tuner-hero h1 {
  color: var(--primary-container);
  font-size: clamp(2.5rem, 6vw, 4rem);
  margin: 0.5rem 0 1rem;
  text-shadow: 0 0 20px rgba(255, 176, 0, 0.2);
}

.tuner-hero .hero-copy {
  max-width: 44rem;
  margin: 0 auto;
  color: var(--on-surface-variant);
  line-height: 1.7;
}

.tuner-shell {
  padding: 2.5rem 2rem 2rem;
  background: rgba(28, 27, 27, 0.5);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(82, 69, 51, 0.25);
  border-radius: var(--radius-lg);
  box-shadow:
    inset 0 0 40px rgba(0, 0, 0, 0.55),
    0 30px 80px rgba(0, 0, 0, 0.7);
  display: grid;
  gap: 2rem;
  justify-items: center;
}

.tuner-status {
  margin: 0;
  padding: 0.5rem 1rem;
  background: var(--surface-container-lowest);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-full);
  color: var(--on-surface-variant);
  font-size: 0.85rem;
  text-align: center;
}

/* ---------- Circular note display ---------- */
.tuner-display {
  width: clamp(14rem, 40vw, 22rem);
  aspect-ratio: 1;
  background: var(--surface-container-low);
  border: 1px solid rgba(82, 69, 51, 0.2);
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 1rem rgba(14, 14, 14, 0.5),
    inset 0 0 40px rgba(0, 0, 0, 0.7),
    0 0 80px rgba(255, 176, 0, 0.05);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

.tuner-display::before {
  content: "";
  position: absolute;
  inset: 1rem;
  border-radius: 50%;
  border: 1px solid rgba(53, 53, 52, 0.5);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.tuner-note-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.tuner-sargam {
  font-family: var(--font-headline);
  font-size: clamp(5rem, 16vw, 9rem);
  font-weight: 900;
  line-height: 1;
  color: var(--primary);
  text-shadow: 0 0 25px rgba(255, 176, 0, 0.45);
  letter-spacing: -0.02em;
}

.tuner-note {
  font-family: var(--font-body);
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--on-surface-variant);
  margin-top: 0.75rem;
}

.tuner-freq {
  font-family: ui-monospace, 'SF Mono', monospace;
  font-size: 0.8rem;
  color: var(--outline);
  margin-top: 0.5rem;
  letter-spacing: 0.08em;
}

/* ---------- Cents meter ---------- */
.tuner-meter {
  width: 100%;
  max-width: 34rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}

.tuner-meter__scale {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-family: var(--font-headline);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--outline);
}

.tuner-meter__scale span:nth-child(2) {
  color: var(--primary);
  opacity: 0.7;
}

.tuner-meter__track {
  position: relative;
  width: 100%;
  height: 12px;
  background: var(--surface-container-lowest);
  border: 1px solid rgba(82, 69, 51, 0.25);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.9);
  overflow: hidden;
}

.tuner-meter__centre {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(255, 176, 0, 0.35);
  transform: translateX(-50%);
  z-index: 1;
}

.tuner-needle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  margin-left: -8px;
  background: linear-gradient(145deg, #ffba43, #ffb000);
  border-radius: 50%;
  box-shadow:
    0 0 15px rgba(255, 176, 0, 0.8),
    0 0 30px rgba(255, 176, 0, 0.4);
  transition: left 0.08s ease-out;
  z-index: 2;
}

.tuner-cents {
  font-family: ui-monospace, 'SF Mono', monospace;
  color: var(--primary-fixed-dim);
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  min-height: 1.2rem;
}

/* ---------- Controls ---------- */
.tuner-controls {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.tuner-controls .primary-button[hidden] { display: none; }

.tuner-note-ref {
  max-width: 42rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--on-surface-variant);
  font-style: italic;
  padding: 0 0.5rem;
}

@media (max-width: 520px) {
  .tuner-page::before {
    inset-inline: 0;
  }

  .tuner-shell { padding: 1.5rem 1rem; }
}
