/* afinador.css — estilos da ferramenta em /afinador-online/.
   Namespace .afn-* / .afn__* para não colidir com .rr-* do estilos.css. */

/* ── Cabeçalho compacto (página sem hero: a ferramenta vem primeiro) ── */
.afn-head { margin: 4px 0 16px; }
.afn-head__meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px;
}
.afn-head__date { font-size: 12px; color: var(--text-muted); }
.afn-head .rr-pill--outline { border-color: var(--border); color: var(--text-muted); }
.afn-head__title {
  font-size: clamp(1.45rem, 3.4vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.18;
  color: var(--text);
  margin: 0;
  text-wrap: pretty;
}

.afn-byline {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0 0; padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.86rem; color: var(--text-muted);
}
.afn-byline img {
  /* o estilos.css tem uma regra global img{width:100%} — sem largura
     explicita o avatar estica e quebra a linha da byline */
  width: 40px; height: 40px; border-radius: 9px;
  flex-shrink: 0; display: block; object-fit: cover;
}
.afn-byline a { color: var(--text); }

/* ── Ferramenta ── */
.afn {
  background: #0f1210;
  border-radius: 12px;
  padding: 26px 22px;
  color: #fff;
}

.afn__seletor { margin-bottom: 20px; }
.afn__label {
  display: block;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: #6b7280; margin-bottom: 7px;
}
.afn__select {
  width: 100%; height: 42px;
  border-radius: 8px; border: 1px solid #2f322e;
  background: #1a1d19; color: #fff;
  font-size: 0.92rem; font-weight: 600; font-family: inherit;
  padding: 0 10px; cursor: pointer;
}

/* Display */
.afn__display { text-align: center; margin-bottom: 18px; }
.afn__note {
  font-size: clamp(3rem, 12vw, 4.2rem);
  font-weight: 800; line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: #3f443c;                 /* apagado enquanto não há nota detectada */
  transition: color 0.12s ease;
}
.afn.is-intune .afn__note { color: #30df47; }
.afn.is-flat .afn__note,
.afn.is-sharp .afn__note { color: #f97316; }

.afn__note-alt {
  font-size: 0.9rem; font-weight: 600; color: #9ca3af; margin-top: 4px; min-height: 20px;
}
.afn__hz { font-size: 0.78rem; color: #6b7280; margin-top: 4px; min-height: 17px; }

/* Escala de cents */
.afn__meter { max-width: 340px; margin: 18px auto 8px; }
.afn__scale {
  position: relative; height: 10px;
  background: #27292c; border-radius: 6px; overflow: hidden;
}
.afn__zone {
  position: absolute; top: 0; bottom: 0; left: 45%; width: 10%;
  background: rgba(48, 223, 71, 0.28);
}
.afn__needle {
  position: absolute; top: -5px; left: 50%;
  width: 3px; height: 20px; border-radius: 2px;
  background: #fff; transform: translateX(-50%);
  transition: left 0.06s linear;
}
.afn.is-intune .afn__needle { background: #30df47; }
.afn.is-flat .afn__needle, .afn.is-sharp .afn__needle { background: #f97316; }

@media (prefers-reduced-motion: reduce) {
  .afn__needle { transition: none; }
}

.afn__scale-labels {
  display: flex; justify-content: space-between;
  max-width: 340px; margin: 0 auto 10px;
  font-size: 0.7rem; color: #6b7280; letter-spacing: 0.05em;
}
.afn__cents {
  text-align: center; font-size: 0.8rem; color: #9ca3af;
  font-variant-numeric: tabular-nums; min-height: 19px;
}
.afn__status {
  text-align: center; font-weight: 700; font-size: 0.98rem;
  color: #9ca3af; margin-top: 6px; min-height: 24px;
}
.afn.is-intune .afn__status { color: #30df47; }
.afn.is-flat .afn__status, .afn.is-sharp .afn__status { color: #f97316; }

/* Cordas */
.afn__strings {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin: 20px 0;
}
.afn__string {
  border: 1px solid #2f322e; background: #1a1d19;
  border-radius: 8px; padding: 10px 4px; text-align: center;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.afn__string-num {
  display: block; font-size: 0.66rem; font-weight: 700;
  letter-spacing: 0.06em; color: #6b7280; margin-bottom: 3px;
}
.afn__string-note { display: block; font-size: 0.95rem; font-weight: 700; color: #fff; }
.afn__string.is-active { border-color: #30df47; background: #16251a; }
.afn__string.is-active .afn__string-num { color: #30df47; }
.afn__string.is-done { border-color: rgba(48, 223, 71, 0.45); }
.afn__string.is-done .afn__string-note::after { content: ' ✓'; color: #30df47; }
.afn__chromatic-note {
  grid-column: 1 / -1; margin: 0; text-align: center;
  font-size: 0.82rem; color: #6b7280; line-height: 1.6;
}

/* Botão */
.afn__start {
  width: 100%; height: 54px;
  border: none; border-radius: 10px;
  background: #30df47; color: #08240f;
  font-size: 1.02rem; font-weight: 800; font-family: inherit;
  cursor: pointer; transition: background 0.12s ease;
}
.afn__start:hover { background: #4ae85f; }
.afn__start.is-on { background: #f97316; color: #fff; }
.afn__start.is-on:hover { background: #fb8c3c; }

.afn__hint {
  margin: 16px 0 0; font-size: 0.78rem; line-height: 1.6;
  color: #6b7280; text-align: center;
}

.afn :focus-visible { outline: 2px solid #30df47; outline-offset: 2px; }

@media (max-width: 480px) {
  .afn { padding: 20px 14px; }
  .afn__strings { grid-template-columns: repeat(3, 1fr); }
}
