/*
 * Accordatore diagnostico — stili specifici del solo strumento.
 *
 * Tutto ciò che il forum ha già (tipografia, bottoni, pannelli, colori) viene
 * dal sistema esistente: qui ci sono soltanto i pezzi che non esistono altrove,
 * e sono scritti sui token del tema — mai su colori fissi — così la pagina
 * segue chiaro, scuro e alto contrasto senza doverli conoscere.
 */

.tuner { margin: 0 0 1.5rem; }

/* --- schema della tastiera --- */
.tuner__keys { display: block; width: 100%; height: auto; margin: .35rem 0 .25rem; }
/*
 * I tasti hanno colori PROPRI, non del tema: un pianoforte ha i tasti bianchi
 * e neri sia di giorno sia di notte. Legandoli a --text si invertivano in tema
 * chiaro, e la tastiera compariva in negativo. Restano quindi letterali, con
 * il solo sfondo agganciato al tema perché è pannello, non strumento.
 */
.tuner__keys-bg   { fill: var(--surface-muted); }
.tuner__key       { fill: #eceff4; stroke: rgb(0 0 0 / 22%); stroke-width: .5; }
.tuner__key--black{ fill: #1a1d23; }
.tuner__zone      { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.5; opacity: .85; }
.tuner__zone-label{ fill: var(--accent); font-size: 10.5px; letter-spacing: .06em; font-weight: 650; }

/* --- rilevatore dal vivo --- */
.tuner__live { text-align: center; padding: 1.75rem 1.25rem; }

.tuner__note {
    font-size: clamp(3rem, 13vw, 3.75rem);
    font-weight: 700;
    letter-spacing: -.03em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    transition: color .2s ease;
}
.tuner__note small { font-size: .38em; color: var(--text-secondary); font-weight: 500; }
.tuner__note--idle   { color: var(--text-secondary); }
.tuner__note--loud   { color: var(--danger); }

.tuner__cents {
    font-size: 1.0625rem;
    color: var(--text-secondary);
    margin-top: .5rem;
    min-height: 1.6rem;
    font-variant-numeric: tabular-nums;
}

/* Ago dello strumento: posizione = scostamento in centesimi. */
.tuner__gauge {
    position: relative;
    height: .5rem;
    background: var(--surface-muted);
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    margin: 1.25rem 0 .4rem;
}
.tuner__gauge::after {          /* tacca dello zero */
    content: "";
    position: absolute;
    left: 50%; top: -.25rem; bottom: -.25rem;
    width: 1px;
    background: var(--border);
}
.tuner__needle {
    position: absolute;
    top: 0; bottom: 0; left: 50%;
    width: 3px;
    background: var(--accent);
    border-radius: 2px;
    transform: translateX(-50%);
    transition: left .09s linear;
}
.tuner__scale {
    display: flex;
    justify-content: space-between;
    font-size: .6875rem;
    color: var(--text-secondary);
    letter-spacing: .04em;
}

/* --- note raccolte --- */
.tuner__samples {
    display: flex; flex-wrap: wrap; gap: .45rem;
    justify-content: center;
    margin-top: 1.1rem;
    min-height: 1.9rem;
}
.tuner__sample {
    background: var(--surface-muted);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-small);
    padding: .3rem .6rem;
    font-size: .8125rem;
    font-variant-numeric: tabular-nums;
}
.tuner__sample b { color: var(--text); font-weight: 650; }
.tuner__sample span { color: var(--text-secondary); margin-left: .3rem; }

/* --- esito --- */
.tuner__verdict {
    font-size: clamp(1.75rem, 7vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.1;
    margin: 0 0 .35rem;
}
.tuner__verdict--ok   { color: var(--success); }
.tuner__verdict--warn { color: var(--warning); }
.tuner__verdict--bad  { color: var(--danger); }

.tuner__facts { margin: 1.25rem 0 0; }
.tuner__fact {
    display: flex; justify-content: space-between; gap: .9rem;
    padding: .8rem 0;
    border-top: 1px solid var(--border-subtle);
}
.tuner__fact:first-child { border-top: 0; }
.tuner__fact dt { color: var(--text-secondary); font-size: .875rem; }
.tuner__fact dd { margin: 0; font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; }

/* --- avvisi --- */
.tuner__alert {
    background: var(--danger-soft);
    border: 1px solid var(--danger);
    color: var(--text);
    border-radius: var(--radius-medium);
    padding: .9rem 1.1rem;
    margin: 0 0 1.25rem;
}

.tuner__actions { display: flex; flex-direction: column; gap: .6rem; }
.tuner__actions .button { width: 100%; }

.tuner__hint {
    font-size: .84375rem;
    color: var(--text-secondary);
    border-left: 2px solid var(--border-subtle);
    padding-left: .8rem;
    margin: 1.1rem 0 0;
}

[hidden] { display: none !important; }
