/* Метроном */
.mt-core { max-width: 1240px; margin-inline: auto; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center; gap: 40px clamp(40px, 6vw, 96px); }
.mt-l, .mt-r { display: grid; justify-items: center; min-width: 0; }
@media (max-width: 1000px) { .mt-core { grid-template-columns: 1fr; max-width: 760px; } }
.mt-top { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: clamp(16px, 4vw, 48px); width: 100%; }
.mt-bpm { text-align: center; }
.mt-num { width: 100%; max-width: 4.2ch; margin: 0 auto; display: block; background: none; border: 0; outline: 0; color: var(--ivory); text-align: center; font: 200 clamp(108px, 14vw, 196px)/.9 var(--f-display); letter-spacing: -.06em; padding: 0; caret-color: var(--red); }
.mt-num:focus { color: #fff; }
.mt-num.is-bump { animation: mt-bump .32s var(--slow); }
@keyframes mt-bump { 0% { transform: scale(1); } 40% { transform: scale(1.035); } 100% { transform: none; } }
.mt-sub { margin: 10px 0 0; display: flex; justify-content: center; align-items: baseline; gap: 14px; }
.mt-name { font-size: clamp(22px, 2vw, 28px); color: var(--ivory-2); transition: opacity .3s; }
.mt-range { margin-top: clamp(28px, 3.6vw, 44px); max-width: 640px; }

.mt-beats { position: relative; display: flex; justify-content: center; gap: clamp(12px, 2.4vw, 30px); margin-top: 0; padding-top: 34px; min-height: 92px; flex-wrap: wrap; max-width: 100%; }
.mt-beat { position: relative; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%; -webkit-tap-highlight-color: transparent; }
.mt-beat::before { content: ""; border-radius: 50%; transition: width .35s var(--spring), height .35s var(--spring), background .2s, box-shadow .2s, border-color .2s; }
.mt-beat[data-l="3"]::before { width: 40px; height: 40px; border: 1.5px solid var(--ivory); }
.mt-beat[data-l="2"]::before { width: 26px; height: 26px; border: 1.5px solid var(--ivory-2); }
.mt-beat[data-l="1"]::before { width: 14px; height: 14px; border: 1.5px solid var(--mute); }
.mt-beat[data-l="0"]::before { width: 26px; height: 26px; border: 1.5px dashed rgba(239,232,220,.22); }
.mt-beat:hover::before { border-color: var(--ivory); }
.mt-beat.is-hit[data-l="3"]::before { background: var(--ivory); box-shadow: 0 0 0 10px rgba(239,232,220,.08); }
.mt-beat.is-hit[data-l="2"]::before { background: var(--ivory-2); }
.mt-beat.is-hit[data-l="1"]::before { background: var(--mute); }
.mt-beat.is-hit::before { transition-duration: 0s; }
.mt-beat.is-first.is-hit[data-l="3"]::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; border: 1px solid var(--red); animation: mt-ring .5s var(--ease) both; }
@keyframes mt-ring { from { transform: scale(.7); opacity: 1; } to { transform: scale(1.45); opacity: 0; } }
.mt-beat i { position: absolute; top: calc(100% + 4px); font: 400 11px/1 var(--f-mono); color: var(--mute); font-style: normal; }
.mt-ball { position: absolute; top: 0; left: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--ivory); opacity: 0; will-change: transform; transition: opacity .3s; pointer-events: none; }
.mt.is-on .mt-ball { opacity: 1; }
.mt-hint { margin: 28px 0 0; font: 300 13.5px/1.4 var(--f-text); color: var(--mute); text-align: center; }

.mt-go { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: clamp(28px, 3.4vw, 40px); }
.mt-play { min-width: 210px; }
.mt-play .st-kbd { border-color: rgba(11,10,9,.25); color: rgba(11,10,9,.6); }
.mt-ico-stop { display: none; }
.mt.is-on .mt-ico-play { display: none; } .mt.is-on .mt-ico-stop { display: inline; }
.mt-tap.is-tap { background: rgba(239,232,220,.12); }

.mt-opts { display: flex; flex-wrap: wrap; justify-content: center; gap: 28px 40px; margin-top: clamp(48px, 5vw, 72px); padding-top: clamp(32px, 4vw, 48px); border-top: 1px solid var(--hair); }
.mt-opt { display: grid; gap: 10px; justify-items: start; }
.mt-opt--vol { min-width: 180px; }
.mt-opt--vol .st-range { width: 180px; margin-top: 8px; }

.mt-train { display: grid; grid-template-columns: 1fr 1fr auto; gap: 28px 48px; align-items: start; }
.mt-tr { display: grid; gap: 12px; }
.mt-tr b { font-weight: 500; color: var(--ivory); }
.mt-tr__line { margin: 0; padding-left: 52px; font: 300 15px/2.2 var(--f-text); color: var(--ivory-2); transition: opacity .3s; }
.mt-tr:has([aria-checked="false"]) .mt-tr__line { opacity: .5; }
.mt-step { display: inline-flex; align-items: center; gap: 2px; margin: 0 4px; padding: 2px; border-radius: 999px; border: 1px solid var(--hair); vertical-align: middle; }
.mt-step button { width: 28px; height: 28px; 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: 34px; text-align: center; font: 500 14px/1 var(--f-mono); color: var(--ivory); }
.mt-stat { display: flex; gap: 32px; }
.mt-stat div { display: grid; gap: 6px; }
.mt-stat b { font: 200 34px/1 var(--f-display); letter-spacing: -.04em; color: var(--ivory); }

.mt-flash { position: fixed; inset: 0; pointer-events: none; background: rgba(239,232,220,.05); opacity: 0; z-index: 1; }

@media (max-width: 900px) { .mt-train { grid-template-columns: 1fr; } .mt-tr__line { padding-left: 0; } }
@media (max-width: 640px) {
  .st-round { width: 48px; height: 48px; }
  .mt-beat { width: 44px; height: 44px; }
  .mt-beats { gap: 10px; }
  .mt-kbd { display: none; }
  .mt-opts { justify-content: flex-start; }
  .mt-opt--vol, .mt-opt--vol .st-range { width: 100%; }
  .mt-opt--vol { min-width: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .mt-ball { display: none; } .mt-num.is-bump { animation: none; } }
