/* 스페이스바 연타 테스트 전용 스타일. */
.sb-stage {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow);
  padding: 22px 18px 26px;
  text-align: center;
}
.sb-mode {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
}
.sb-mode[data-mode='touch'] {
  background: var(--brand-soft);
  color: var(--brand);
}
.sb-count {
  display: block;
  margin: 8px 0 0;
  font-size: clamp(3.4rem, 16vw, 5.4rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.sb-count small {
  font-size: 0.3em;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--muted);
  margin-left: 4px;
}
.sb-status {
  margin: 4px 0 18px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-height: 1.7em;
}

/* 키보드 스페이스바 모양 단추 */
.sb-key {
  --key-face: #ffffff;
  --key-side: #c9cfdc;
  --key-ink: #2a3142;
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: min(100%, 560px);
  min-height: 96px;
  margin: 0 auto;
  padding: 14px 16px 18px;
  border: 1px solid var(--key-side);
  border-radius: 16px;
  background: linear-gradient(180deg, var(--key-face) 0%, color-mix(in srgb, var(--key-face) 92%, var(--key-side)) 100%);
  color: var(--key-ink);
  font: inherit;
  box-shadow:
    0 7px 0 var(--key-side),
    0 10px 18px rgba(0, 0, 0, 0.16);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.04s ease-out, box-shadow 0.04s ease-out;
}
.sb-key.is-down {
  transform: translateY(6px);
  box-shadow:
    0 1px 0 var(--key-side),
    0 2px 6px rgba(0, 0, 0, 0.18);
}
.sb-key[data-state='go'] {
  border-color: var(--go);
}
.sb-key[data-state='early'] {
  border-color: var(--early);
}
.sb-key-label {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.sb-key-sub {
  font-size: 0.85rem;
  opacity: 0.75;
}
.sb-stage .timebar {
  max-width: 560px;
  margin: 26px auto 0;
}

@media (prefers-reduced-motion: reduce) {
  .sb-key {
    transition: none;
  }
}
