/* Тюнер */
.tn-bar { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px 14px; }
.tn-a4 { display: inline-flex; align-items: center; gap: 8px; margin-left: 8px; }
.mt-step { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border-radius: 999px; border: 1px solid var(--hair); vertical-align: middle; }
.mt-step button { width: 32px; height: 32px; border-radius: 50%; color: var(--mute); font: 400 16px/1 var(--f-text); }
.mt-step button:hover { color: var(--ivory); background: var(--surface-hover); }
.mt-step button:active { transform: scale(.9); }
.mt-step output { min-width: 40px; text-align: center; font: 500 14px/1 var(--f-mono); color: var(--ivory); }

.tn-core { max-width: 920px; margin: clamp(28px, 3vw, 44px) auto 0; display: grid; justify-items: center; }
.tn-big { display: flex; align-items: flex-end; justify-content: center; }
.tn-note { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-height: clamp(130px, 12vw, 170px); transition: opacity .4s var(--ease); }
.tn:not(.is-live) .tn-name, .tn:not(.is-live) .tn-oct { opacity: .16; }
.tn-core > * { order: 3; }
.tn-core > .tn-note { order: 1; }
.tn[data-state="off"] .tn-mic, .tn[data-state="denied"] .tn-mic { order: 2; margin: 22px 0 8px; }
.tn[data-state="off"] .tn-trail, .tn[data-state="denied"] .tn-trail, .tn[data-state="off"] .tn-read, .tn[data-state="denied"] .tn-read { display: none; }
.tn-name { font: 200 clamp(112px, 11vw, 160px)/.86 var(--f-display); letter-spacing: -.06em; color: var(--ivory); transition: color .35s var(--ease); }
.tn-oct { font: 300 clamp(28px, 3vw, 40px)/1 var(--f-display); color: var(--mute); margin-left: 6px; margin-bottom: 8px; }
.tn-ru { margin-top: 10px; text-align: center; font-size: clamp(22px, 2vw, 28px); color: var(--ivory-2); }
.tn.is-ok .tn-name { color: var(--ok); }
.tn-note.is-swap .tn-name { animation: tn-swap .35s var(--slow); }
@keyframes tn-swap { from { opacity: .3; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.tn-meter { position: relative; width: 100%; height: 64px; margin-top: clamp(26px, 3vw, 40px); }
.tn-scale { position: absolute; inset: 0; }
.tn-scale i { position: absolute; bottom: 18px; width: 1px; height: 10px; background: rgba(239,232,220,.22); transform: translateX(-.5px); }
.tn-scale i.is-big { height: 18px; background: rgba(239,232,220,.4); }
.tn-scale i.is-mid { height: 30px; width: 2px; background: var(--ivory-2); }
.tn-scale b { position: absolute; bottom: 0; transform: translateX(-50%); font: 400 11px/1 var(--f-mono); color: var(--mute); font-weight: 400; }
.tn-zone { position: absolute; left: calc(50% - 3%); width: 6%; bottom: 18px; height: 30px; border-radius: 4px; background: rgba(127,214,155,0); transition: background .3s; }
.tn.is-ok .tn-zone { background: rgba(127,214,155,.16); }
.tn.is-ok .tn-scale i.is-mid { background: var(--ok); }
.tn-needle { position: absolute; left: 50%; bottom: 18px; width: 0; height: 46px; will-change: transform; }
.tn-needle i { position: absolute; left: -1px; bottom: 0; width: 2px; height: 46px; border-radius: 2px; background: var(--ivory); opacity: .25; transition: opacity .3s, background .3s; }
.tn-needle i::after { content: ""; position: absolute; left: -4px; top: -10px; width: 10px; height: 10px; border-radius: 50%; background: inherit; }
.tn.is-live .tn-needle i { opacity: 1; }
.tn.is-ok .tn-needle i { background: var(--ok); }

.tn-read { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 20px; margin: 18px 0 0; font: 400 13px/1.4 var(--f-mono); color: var(--mute); min-height: 20px; }
.tn-read b { font-weight: 500; color: var(--ivory); }
.tn-read .sep { opacity: .4; }
.tn-hint { color: var(--ivory-2); font-family: var(--f-text); font-size: 14px; opacity: 0; transition: opacity .3s; }
.tn.has-hint .tn-hint { opacity: 1; }
.tn-trail { width: 100%; height: 70px; margin-top: 18px; display: block; opacity: .9; }

.tn-mic { display: grid; justify-items: center; gap: 12px; margin-top: 26px; text-align: center; }
.tn-mic__note { margin: 0; font: 300 13.5px/1.4 var(--f-text); color: var(--mute); }
.tn-live, .tn-denied { display: none; }
.tn-live { margin: 0; font: 400 14px/1.4 var(--f-text); color: var(--ivory-2); align-items: center; gap: 10px; }
.tn-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--red); animation: st-pulse 1.6s var(--ease) infinite; }
.tn-off { color: var(--ivory-2); border-bottom: 1px solid var(--hair-2); }
.tn-off:hover { color: var(--ivory); }
.tn-denied { max-width: 560px; font: 300 14.5px/1.55 var(--f-text); color: var(--ivory-2); }
.tn-denied p { margin: 0 0 6px; } .tn-denied b { color: var(--ivory); font-weight: 500; }
.tn[data-state="on"] .tn-on, .tn[data-state="on"] .tn-mic__note, .tn[data-state="denied"] .tn-on, .tn[data-state="denied"] .tn-mic__note { display: none; }
.tn[data-state="on"] .tn-live { display: inline-flex; }
.tn[data-state="denied"] .tn-denied { display: block; }

.tn-strings-wrap { margin-top: clamp(40px, 5vw, 64px); padding-top: clamp(28px, 3vw, 40px); border-top: 1px solid var(--hair); display: grid; justify-items: center; gap: 18px; }
.tn-strings { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.tn-str { position: relative; display: grid; justify-items: center; gap: 4px; min-width: 76px; padding: 14px 14px 12px; border-radius: 16px; border: 1px solid var(--hair); transition: border-color .2s, background .2s, transform .2s var(--ease); }
.tn-str:hover { border-color: var(--hair-2); background: var(--surface-subtle); }
.tn-str:active { transform: scale(.96); }
.tn-str b { font: 300 26px/1 var(--f-display); letter-spacing: -.03em; color: var(--ivory); font-weight: 300; }
.tn-str b sub { font-size: 12px; color: var(--mute); margin-left: 2px; }
.tn-str small { font: 400 11px/1 var(--f-mono); color: var(--mute); }
.tn-str .n { position: absolute; top: 8px; left: 10px; font: 400 10px/1 var(--f-mono); color: var(--mute); }
.tn-str.is-near { border-color: var(--ivory); }
.tn-str.is-play { background: rgba(239,232,220,.08); border-color: var(--ivory-2); }
.tn-str.is-play::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 6px; height: 2px; border-radius: 2px; background: var(--ivory); transform-origin: 0 50%; animation: tn-ring var(--dur, 2.5s) linear both; }
@keyframes tn-ring { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.tn-str.is-done .n::after { content: ""; display: inline-block; width: 8px; height: 4px; margin-left: 6px; border-left: 1.5px solid var(--ok); border-bottom: 1.5px solid var(--ok); transform: rotate(-45deg) translateY(-2px); animation: st-pop-in .45s var(--spring) both; }
@keyframes st-pop-in { from { transform: rotate(-45deg) scale(0); } to { transform: rotate(-45deg) scale(1) translateY(-2px); } }

@media (max-width: 640px) {
  .tn-a4 { margin-left: 0; }
  .tn-scale b.q { display: none; }
  .tn-str { min-width: 0; flex: 1 1 calc(33% - 10px); padding: 12px 8px 10px; }
  .tn-meter { height: 56px; }
}
