.stage-timer {
  position: absolute;
  z-index: 45;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .08em;
  box-sizing: border-box;
  min-width: var(--timer-min-width, 0px);
  padding: var(--timer-padding-y, 10px) var(--timer-padding-x, 36px);
  color: var(--timer-color, #fff);
  background: transparent;
  border: var(--timer-border-width, 0px) solid var(--timer-border-color, #fff);
  border-radius: var(--timer-radius, 16px);
  box-shadow: var(--timer-box-shadow, none);
  font-family: var(--timer-font, system-ui, sans-serif);
  font-size: var(--timer-size, 96px);
  font-weight: var(--timer-weight, 900);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  text-shadow: var(--timer-text-shadow, 0 2px 10px rgba(0,0,0,.35));
}
.stage-timer[hidden], .stage-timer [hidden] { display: none !important; }
.stage-timer-label { font-size: var(--timer-label-size, .28em); color: var(--timer-label-color, currentColor); white-space: nowrap; }
.stage-timer-main { display: flex; flex-direction: column; align-items: stretch; gap: .08em; min-width: 0; }
.stage-timer-value { display: block; white-space: nowrap; text-align: center; font-variant-numeric: tabular-nums; }
/* 数字は同じ幅（数字の中で一番広い「0」の幅）の枠に入れて中央に置く。文字の横ブレを防ぐ。 */
.stage-timer-digit { display: inline-block; width: 1ch; text-align: center; }
.stage-timer[data-label-pos="bottom"] > .stage-timer-label { order: 1; }
.stage-timer[data-label-pos="left"] { flex-direction: row; gap: .25em; }
.stage-timer[data-position="top-right"] { top: calc(var(--header-height) + 16px); right: 20px; }
.stage-timer[data-position="top-left"] { top: calc(var(--header-height) + 16px); left: 20px; }
.stage-timer[data-position="top-center"] { top: calc(var(--header-height) + 16px); left: 50%; transform: translateX(-50%); }
.stage-timer[data-position="bottom-right"] { bottom: 20px; right: 20px; }
.stage-timer[data-position="bottom-left"] { bottom: 20px; left: 20px; }
.stage-timer[data-position="bottom-center"] { bottom: 20px; left: 50%; transform: translateX(-50%); }
.stage-timer[data-position="center"] { top: 50%; left: 50%; transform: translate(-50%, -50%); }
.stage-timer[data-position="custom"] { top: var(--timer-y); left: var(--timer-x); transform: translate(-50%, -50%); }
.stage-timer[data-position="header"] { top: 0; right: 0; height: var(--header-height); font-size: min(var(--timer-size, 96px), calc(var(--header-height) * .5)); }
/* 警告中だけ色を変える。0になった（終了）時は色を変えない（点滅も「0になったら点滅」をオンにした時だけ）。 */
.stage-timer.is-warn { color: var(--timer-warn-color, #ff5252); }
.stage-timer-progress { display: block; height: var(--timer-progress-height, 8px); background: rgba(127,127,127,.25); overflow: hidden; border-radius: 999px; }
.stage-timer-progress-fill { display: block; width: 100%; height: 100%; background: var(--timer-progress-color, #4fc3f7); transform-origin: left; }
.stage-timer[data-progress="top"] .stage-timer-progress { order: -1; }
@keyframes taqu-timer-blink { 50% { opacity: .25; } }
@keyframes taqu-timer-pulse { 50% { transform: scale(1.06); } }
.stage-timer.is-warn[data-warn-blink="true"] { --timer-blink: taqu-timer-blink 1s ease-in-out infinite; }
.stage-timer.is-warn[data-warn-pulse="true"] { --timer-pulse: taqu-timer-pulse 1s ease-in-out infinite; }
.stage-timer.is-done[data-done-blink="true"] { --timer-blink: taqu-timer-blink .8s ease-in-out 4; }
.stage-timer-value { animation: var(--timer-blink, none), var(--timer-pulse, none); }
@media (prefers-reduced-motion: reduce) { .stage-timer-value { animation: none; } }

.stage-timer[data-position="header-custom"] { top: calc(var(--header-height) * var(--timer-yFraction, .5)); left: var(--timer-x); transform: translate(-50%, -50%); font-size: min(var(--timer-size, 96px), calc(var(--header-height) * .5)); }
