/* Afinador */
.tuner-stage { gap: var(--space-2); }

/* Selector de instrumento: una fila que se desliza si no cabe */
.tuner-top { width: 100%; display: flex; justify-content: center; }
.tuner-inst { flex-wrap: nowrap; justify-content: center; overflow-x: auto; scrollbar-width: none; max-width: 100%; padding: 2px 2px 6px; }
.tuner-inst::-webkit-scrollbar { display: none; }
.tuner-inst button { flex: 0 0 auto; }

/* Zona que cubre la capa del micrófono */
.tuner-display { position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; gap: var(--space-2); padding: 4px 0; }

.tuner-note { position: relative; display: flex; align-items: flex-start; justify-content: center; gap: 10px; min-height: 108px; transition: color .2s ease; }
.tuner-note__name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(4.4rem, 13vw, 7rem);
  line-height: .95;
  letter-spacing: -0.03em;
  transition: color .2s ease, text-shadow .3s ease;
}
.tuner-note__meta { display: flex; align-items: baseline; margin-top: 14px; font-weight: 700; font-size: 1.5rem; color: var(--color-gray); }
.tuner-note__meta sub { font-size: .9rem; vertical-align: baseline; margin-left: 1px; }
.tuner-stage.is-idle .tuner-note { color: var(--color-surface-3); }
.tuner-stage.is-tuned .tuner-note__name { color: var(--color-accent); text-shadow: 0 0 28px rgba(0, 205, 156, .45); }

/* Celebración al afinar: un anillo que se expande detrás de la nota */
.tuner-burst {
  position: absolute;
  left: 50%; top: 50%;
  width: 120px; height: 120px;
  margin: -60px 0 0 -60px;
  border-radius: 50%;
  border: 2px solid var(--color-accent);
  opacity: 0;
  pointer-events: none;
}
.tuner-burst.is-go { animation: tuner-burst .7s ease-out; }
@keyframes tuner-burst { from { transform: scale(.6); opacity: .9; } to { transform: scale(2.2); opacity: 0; } }

.tuner-gauge { width: 100%; max-width: 420px; }
.tuner-gauge svg { width: 100%; height: auto; overflow: visible; }
.tuner-gauge__ends { display: flex; justify-content: space-between; margin-top: -6px; font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--color-gray); padding: 0 4px; }
.tuner-gauge .tick { stroke: var(--color-gray); stroke-width: 2; stroke-linecap: round; }
.tuner-gauge .tick--major { stroke: var(--color-ink-soft); stroke-width: 2.5; }
.tuner-gauge .tick--center { stroke: var(--color-accent); stroke-width: 3.5; }
.tuner-gauge .tick-label { fill: var(--color-gray); font: 700 11px var(--font-body); text-anchor: middle; }
.tuner-needle { transform-origin: 160px 160px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .5)); }
.tuner-needle line { stroke: var(--color-ink); transition: stroke .2s ease; }
.tuner-needle circle { fill: var(--color-ink); transition: fill .2s ease; }
.tuner-stage.is-idle .tuner-needle line { stroke: var(--color-surface-3); }
.tuner-stage.is-idle .tuner-needle circle { fill: var(--color-surface-3); }
.tuner-stage.is-tuned .tuner-needle line { stroke: var(--color-accent); }
.tuner-stage.is-tuned .tuner-needle circle { fill: var(--color-accent); }
.tuner-stage.is-tuned #zone { opacity: .4; transition: opacity .3s ease; }

.tuner-state {
  margin: 0;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 4px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: .9rem;
  letter-spacing: .04em;
  color: var(--color-gray);
  background: var(--color-surface-2);
  border: 1px solid var(--color-hairline);
  box-shadow: var(--shadow-sm);
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.tuner-state.is-low, .tuner-state.is-high { color: var(--color-warn); border-color: rgba(242, 181, 68, .4); }
.tuner-state.is-ok { color: var(--color-bg); background: var(--color-accent); border-color: var(--color-accent); box-shadow: var(--shadow-glow); }

.tuner-read { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); width: 100%; max-width: 460px; margin: 0; text-align: center; }
.tuner-read div { min-width: 0; }
.tuner-read dt { display: flex; align-items: center; justify-content: center; gap: 4px; font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--color-gray); margin-bottom: 4px; }
.tuner-read dt .info { width: 18px; height: 18px; font-size: .7rem; margin: -3px 0; }
.tuner-read dd { margin: 0; font-family: var(--font-heading); font-weight: 700; font-size: 1.45rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tuner-read small { font-family: var(--font-body); font-size: .72rem; color: var(--color-gray); }

.tuner-level { width: 100%; max-width: 460px; height: 4px; border-radius: 999px; background: var(--color-surface-3); overflow: hidden; }
.tuner-level span { display: block; height: 100%; width: 0; background: var(--color-accent); border-radius: inherit; transition: width .08s linear; }

/* Capa para activar el micrófono */
.tuner-mic {
  position: absolute;
  inset: -8px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: var(--space-2);
  text-align: center;
  border-radius: var(--radius-media);
  background: rgba(28, 27, 24, .8);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.tuner-mic__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 156px;
  height: 156px;
  border-radius: 50%;
  border: 0;
  background: var(--color-accent);
  color: var(--color-bg);
  font-weight: 700;
  font-size: .95rem;
  line-height: 1.2;
  padding: 0 24px;
  box-shadow: 0 0 0 12px var(--color-accent-dim), var(--shadow-md);
  transition: background .15s ease, transform .1s ease;
  animation: tuner-invite 2.4s ease-in-out infinite;
}
@keyframes tuner-invite { 0%, 100% { box-shadow: 0 0 0 10px var(--color-accent-dim), var(--shadow-md); } 50% { box-shadow: 0 0 0 18px rgba(0, 205, 156, .07), var(--shadow-md); } }
.tuner-mic__btn:hover { background: var(--color-accent-hover); }
.tuner-mic__btn:active { transform: scale(.97); }
.tuner-mic__btn svg { width: 38px; height: 38px; }
.tuner-mic__btn.is-busy { opacity: .7; pointer-events: none; }
.tuner-mic__text { margin: 4px 0 0; max-width: 300px; font-size: .84rem; color: var(--color-ink-soft); }
.tuner-mic__text svg { display: inline-block; width: 15px; height: 15px; margin-right: 5px; vertical-align: -2px; color: var(--color-accent); }
.tuner-mic .notice { max-width: 400px; text-align: left; }
.tuner-stop { position: absolute; top: 0; right: 0; z-index: 1; }

/* Cuerdas del instrumento */
.tuner-strings-wrap { width: 100%; display: grid; gap: 8px; }
.tuner-strings { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.tuner-strings__hint { margin: 0; text-align: center; font-size: .78rem; color: var(--color-gray); }
.tuner-strings__hint span { font-weight: 700; color: var(--color-accent); }
.tuner-string {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 60px;
  padding: 6px 4px;
  border-radius: var(--radius-media);
  border: 1px solid var(--color-hairline);
  background: var(--color-surface-2);
  color: var(--color-ink);
  box-shadow: var(--shadow-sm);
  transition: border-color .15s ease, background .15s ease, color .15s ease, transform .1s ease;
  touch-action: manipulation;
}
.tuner-string:active { transform: scale(.95); }
.tuner-string:hover { border-color: var(--color-accent); }
.tuner-string__name { font-family: var(--font-heading); font-weight: 700; font-size: 1.2rem; line-height: 1.1; }
.tuner-string__meta { font-size: .7rem; font-weight: 700; color: var(--color-gray); letter-spacing: .04em; }
.tuner-string.is-near { border-color: var(--color-accent); background: var(--color-accent-dim); }
.tuner-string.is-near .tuner-string__name { color: var(--color-accent); }
.tuner-string.is-playing { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-bg); }
.tuner-string.is-playing .tuner-string__meta, .tuner-string.is-playing .tuner-string__name { color: var(--color-bg); }
/* Cuerda ya afinada en esta sesión: un check pequeño */
.tuner-string.is-done::after {
  content: "";
  position: absolute;
  top: 5px; right: 5px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 6px var(--color-accent-glow);
}

.tuner-tips ul { margin: 0; padding-left: 1.1em; }
.tuner-tips li { font-size: .88rem; color: var(--color-ink-soft); }
.tuner-tips li + li { margin-top: 4px; }
.tuner-tips strong { color: var(--color-ink); }

@media (min-width: 960px) {
  .tuner-stage { padding-top: var(--space-3); padding-bottom: var(--space-3); }
  .tuner-inst { flex-wrap: wrap; overflow: visible; }
  .tuner-display { gap: 12px; }
  .tuner-note { min-height: 90px; }
  .tuner-note__name { font-size: 5.2rem; }
  .tuner-gauge { max-width: 340px; }
  .tuner-read dd { font-size: 1.25rem; }
}

@media (max-width: 600px) {
  .tuner-stage { gap: 10px; padding-top: 12px; padding-bottom: 14px; }
  .tuner-top { justify-content: flex-start; margin: 0 -12px; width: calc(100% + 24px); }
  .tuner-inst { justify-content: flex-start; padding: 2px 12px 4px; gap: 6px; }
  .tuner-inst button { min-height: 34px; padding: 0 12px; font-size: .8rem; }
  .tuner-display { gap: 10px; }
  .tuner-note { min-height: 78px; }
  .tuner-note__name { font-size: 4.2rem; }
  .tuner-note__meta { font-size: 1.2rem; margin-top: 8px; }
  .tuner-gauge { max-width: 300px; }
  .tuner-state { min-height: 30px; font-size: .82rem; padding: 3px 14px; }
  .tuner-read { gap: 6px; }
  .tuner-read dd { font-size: 1.1rem; }
  .tuner-read dt { font-size: .6rem; letter-spacing: .08em; }
  .tuner-mic__btn { width: 132px; height: 132px; font-size: .88rem; }
  .tuner-mic__btn svg { width: 32px; height: 32px; }
  .tuner-string { min-height: 52px; }
  .tuner-string__name { font-size: 1.05rem; }
}
@media (max-width: 420px) { .tuner-string__meta { font-size: .62rem; letter-spacing: 0; } }

/* Alteraciones (♯ ♭) más pequeñas y altas junto al nombre */
.acc { font-family: "Segoe UI Symbol", "Apple Symbols", "Noto Music", "Noto Sans Symbols 2", "DejaVu Sans", sans-serif; font-weight: 400; font-size: .72em; vertical-align: .3em; line-height: 0; margin-left: .04em; letter-spacing: 0; }
svg .acc { font-size: .9em; }
.tuner-note__name .acc { font-size: .5em; vertical-align: .75em; }
