/* Tap tempo */
.tap-stage { gap: var(--space-2); }

.tap-pad {
  position: relative;
  width: min(300px, 70vw);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid var(--color-hairline);
  background: radial-gradient(circle at 50% 38%, #34332d, var(--color-surface-2) 72%);
  color: var(--color-ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .35), 0 14px 34px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .05);
  transition: border-color .2s ease, transform .06s ease, box-shadow .2s ease;
  --stab: var(--color-accent);
}
.tap-pad:hover { border-color: var(--color-accent); }
.tap-pad.is-hit { transform: scale(.965); border-color: var(--color-accent); transition: none; box-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 0 0 6px var(--color-accent-dim), inset 0 2px 8px rgba(0, 0, 0, .35); }
.tap-pad__ring, .tap-pad__ghost {
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 3px solid var(--color-accent);
  opacity: 0;
  pointer-events: none;
}
.tap-pad__ring.is-on { animation: tap-ring .5s ease-out; }
.tap-pad__ghost { border-width: 2px; border-color: var(--stab); }
.tap-pad__ghost.is-on { animation: tap-ghost .6s ease-out; }
@keyframes tap-ring { from { opacity: .9; transform: scale(1); } to { opacity: 0; transform: scale(1.2); } }
@keyframes tap-ghost { from { opacity: .45; transform: scale(.94); } to { opacity: 0; transform: scale(1.08); } }
.tap-pad__bpm { font-size: clamp(3.8rem, 16vw, 6.2rem); transition: color .2s ease; }
.tap-pad__bpm.is-pop { animation: tap-pop .18s ease-out; }
@keyframes tap-pop { from { transform: scale(1.06); } to { transform: none; } }
.tap-pad__unit { margin-top: 2px; }
.tap-pad__help {
  margin-top: 10px;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.tap-style { margin: 0; min-height: 1.3em; font-size: .9rem; color: var(--color-ink-soft); text-align: center; }
.tap-style strong { color: var(--color-ink); }

.tap-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  max-width: 520px;
}
.tap-stat {
  background: var(--color-surface-2);
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-media);
  padding: 8px 6px 6px;
  text-align: center;
  min-width: 0;
  box-shadow: var(--shadow-sm);
}
.tap-stat__label { display: flex; align-items: center; justify-content: center; gap: 2px; font-size: .64rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--color-gray); white-space: nowrap; min-height: 22px; }
.tap-stat__label .info { width: 18px; height: 18px; font-size: .7rem; margin: 0 0 0 2px; }
.tap-stat__val { display: block; font-family: var(--font-heading); font-weight: 700; font-size: 1.45rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
.tap-stat__val.is-good { color: var(--color-accent); }
.tap-stat__val.is-mid { color: var(--color-warn); }
.tap-stat__val.is-bad { color: var(--color-danger); }

.tap-actions { display: grid; grid-template-columns: 56px 56px 44px minmax(0, 1fr); gap: 8px; width: 100%; max-width: 520px; align-items: center; }
.tap-actions .btn--ghost { padding: 0; font-size: 1.05rem; }
.tap-actions__go { padding: 0 14px; white-space: nowrap; overflow: hidden; }
.tap-actions__go span { overflow: hidden; text-overflow: ellipsis; }
a.btn[aria-disabled="true"] { opacity: .4; pointer-events: none; box-shadow: none; }

.tap-chart { margin: 0; width: 100%; max-width: 520px; }
.tap-chart svg { width: 100%; height: 64px; background: var(--color-surface-2); border: 1px solid var(--color-hairline); border-radius: var(--radius-media); overflow: hidden; }
.tap-chart figcaption { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: .78rem; color: var(--color-gray); margin-top: 8px; }

.controls .switch + .switch { margin-top: 4px; }
.tap-tips ul { margin: 0; padding-left: 1.1em; font-size: .88rem; color: var(--color-ink-soft); }
.tap-tips li + li { margin-top: 4px; }
.tap-tips strong { color: var(--color-ink); }

@media (max-width: 600px) {
  .tap-pad { width: min(236px, 62vw); }
  .tap-pad__bpm { font-size: 3.6rem; }
  .tap-stat { padding: 6px 4px 5px; }
  .tap-stat__val { font-size: 1.2rem; }
  .tap-stat__label { font-size: .58rem; letter-spacing: .05em; }
  .tap-chart svg { height: 52px; }
  .tap-actions { grid-template-columns: 52px 52px 44px minmax(0, 1fr); }
}
