/* one centred column: the pendulum on top, the bpm in big display type, the controls below */
.metro {
  max-width: 500px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  -webkit-tap-highlight-color: transparent;
}
.metro .tool-head {
  padding-bottom: 0;
}
.metro .segmented button {
  font: 500 14px / 1 var(--mono);
}

/* ---- pendulum ---- */
.stage {
  position: relative;
  height: 190px;
  display: flex;
  justify-content: center;
}
.arc {
  position: absolute;
  bottom: 0;
  width: 280px;
  max-width: 100%;
  height: 140px;
  border: 1px dashed var(--rule);
  border-bottom: 0;
  border-radius: 140px 140px 0 0;
}
.arm {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 2px;
  height: 175px;
  margin-left: -1px;
  background: var(--muted);
  transform-origin: bottom center;
}
.arm::after {
  content: "";
  position: absolute;
  top: 18px;
  left: 50%;
  width: 22px;
  height: 22px;
  margin-left: -11px;
  border-radius: 50%;
  border: 3px solid var(--ink);
  background: var(--paper);
}
.arm.flash {
  background: var(--accent);
}
.arm.flash::after {
  border-color: var(--accent);
  background: var(--accent);
}

/* ---- beats ---- */
.beats {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  min-height: 22px;
}
.dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface-2);
  transition:
    background 0.06s,
    transform 0.06s;
}
.dot.first {
  outline: 2px solid var(--surface-2);
  outline-offset: 3px;
}
.dot.on {
  background: var(--accent);
  transform: scale(1.25);
}
.dot.first.on {
  outline-color: var(--accent);
}

/* ---- tempo ---- */
.tempo {
  text-align: center;
}
.bpm-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}
.step {
  flex: none;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  background: var(--surface);
  font: 500 28px / 1 var(--display);
}
.step:active {
  background: var(--surface-2);
}
.bpm {
  min-width: 3.2ch;
  font: 800 96px / 1 var(--display);
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.marking {
  margin-top: 6px;
  color: var(--muted);
  font-size: 17px;
}
.marking b {
  color: var(--ink);
  font-weight: 500;
  font-style: italic;
  text-decoration: underline 0.5em var(--mark);
  text-underline-offset: -0.3em;
  text-decoration-skip-ink: none;
}
.marking small {
  margin-left: 6px;
  font: 12px var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---- slider ---- */
.metro input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 6px;
  margin: 0;
  border-radius: 3px;
  background: linear-gradient(to right, var(--accent) var(--p, 30%), var(--surface-2) var(--p, 30%));
}
.metro input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  cursor: pointer;
}
.metro input[type="range"]::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
}
.scale {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font: 12px var(--mono);
  color: var(--muted);
}

/* ---- options and controls ---- */
.options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.opt {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--code-bg);
  text-align: left;
}
@media (hover: hover) {
  .opt:hover {
    border-color: var(--rule);
  }
}
.opt span {
  display: block;
  margin-bottom: 2px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.opt b {
  font-weight: 500;
}
.controls {
  display: flex;
  gap: 12px;
}
.controls .btn {
  height: 64px;
  font: 600 19px / 1 var(--display);
}
.tap {
  flex: 1;
  letter-spacing: 0.08em;
}
.tap:active {
  color: var(--accent);
  box-shadow: inset 0 0 0 2px var(--accent);
}
.play {
  flex: 1.6;
}
.play svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}
.keys {
  margin: -6px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
@media (hover: none) {
  .keys {
    display: none;
  }
}
