/* 타이밍 테스트 (timing.js) */
.tm-pad {
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 14px;
  width: 100%;
  min-height: clamp(270px, 46vh, 380px);
  margin-top: 22px;
  padding: 20px 18px 24px;
  border-radius: 26px;
  border: 2px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.2s;
}
.tm-pad:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
}
.tm-pad[data-state='run'] {
  border-color: var(--brand);
}
.tm-pad[data-state='paused'] {
  border-color: var(--early);
}
.tm-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}
.tm-top b {
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0 2px;
}

/* 막대: 목표선 · 판정 구역 · 움직이는 표시는 모두 안쪽 레일(tm-rail) 기준 % 로 놓는다 */
.tm-track {
  position: relative;
  display: block;
  height: 84px;
  border-radius: 18px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  overflow: hidden;
}
.tm-rail {
  position: absolute;
  inset: 0 14px;
  display: block;
}
.tm-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  display: block;
}
/* ±5% 구역(좋아요) */
.tm-zone.good {
  left: 45%;
  width: 10%;
  background: color-mix(in srgb, var(--go) 16%, transparent);
}
/* ±1% 구역(퍼펙트) — timing.js 의 PERFECT_PCT 와 같게 */
.tm-zone.perfect {
  left: 49%;
  width: 2%;
  background: color-mix(in srgb, var(--go) 45%, transparent);
}
.tm-center {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  margin-left: -1px;
  display: block;
  background: var(--go);
}
.tm-center::before,
.tm-center::after {
  content: '';
  position: absolute;
  left: 50%;
  margin-left: -7px;
  border: 7px solid transparent;
}
.tm-center::before {
  top: 0;
  border-top-color: var(--go);
}
.tm-center::after {
  bottom: 0;
  border-bottom-color: var(--go);
}
.tm-marker {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 0;
  width: 8px;
  margin-left: -4px;
  display: block;
  border-radius: 4px;
  background: var(--ink);
  box-shadow: 0 0 0 2px var(--surface), 0 2px 8px rgba(0, 0, 0, 0.3);
  will-change: transform;
}
.tm-marker.perfect {
  background: var(--go);
}
.tm-marker.good {
  background: var(--brand);
}
.tm-marker.miss {
  background: var(--wait);
}
/* 지난 라운드에 멈춘 자리 */
.tm-ticks {
  position: absolute;
  inset: 0;
  display: block;
  pointer-events: none;
}
.tm-tick {
  position: absolute;
  bottom: 3px;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  border-radius: 50%;
  background: var(--muted);
  opacity: 0.7;
}
.tm-tick.perfect {
  background: var(--go);
  opacity: 1;
}
.tm-tick.miss {
  background: var(--wait);
}
.tm-title {
  font-size: clamp(1.6rem, 7vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.tm-pad[data-state='idle'] .tm-title {
  color: var(--brand);
}
.tm-sub {
  color: var(--muted);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}
.tm .dots .dot.perfect {
  background: var(--brand);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 30%, transparent);
}
.tm-trend {
  margin: 8px auto 0;
  max-width: 28em;
  font-weight: 700;
}
.tm .tries {
  margin-top: 18px;
}
