.stage[data-visual="warning"] .num,
.stage[data-visual="final"] .num { color: var(--amber); }

.stage[data-visual="warning"]::before,
.stage[data-visual="final"]::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 90px rgba(198, 161, 90, 0.07);
  z-index: 1;
}

.stage[data-critical="true"]::before {
  box-shadow: inset 0 0 160px rgba(0, 0, 0, 0.65);
}

.stage[data-visual="final"] .unit.seconds .num {
  font-size: clamp(160px, 16vw, 260px);
}

.stage[data-visual="final"] .unit.hours,
.stage[data-visual="final"] .unit.minutes,
.stage[data-visual="final"] .colon { opacity: 0.4; }

.unit.seconds.pulse .num { animation: pulse 280ms ease-out; }

.stage[data-ending="play"] .core { animation: core 1.05s ease-out both; }
.stage[data-ending="play"] .ring { animation: ring 0.85s ease-out 0.04s both; }
.stage[data-ending="play"] .ending-title { animation: rise 0.7s ease 0.75s both; }
.stage[data-ending="play"] .ending-message { animation: rise 0.6s ease 1.7s both; }
.stage[data-ending="play"] .clock { animation: hold-out 1.3s ease 0.15s both; }

.stage[data-ending="done"] .ending-title,
.stage[data-ending="done"] .ending-message { opacity: 1; }

.stage.is-shaking .fx { animation: shake 0.45s linear 1; }

@keyframes pulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.045); }
  100% { transform: scale(1); }
}

@keyframes core {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.12); }
  32% { opacity: var(--flash); transform: translate(-50%, -50%) scale(0.42); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.5); }
}

@keyframes ring {
  0% { opacity: 0.75; transform: translate(-50%, -50%) scale(0.15); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(7); }
}

@keyframes rise {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes hold-out {
  0%, 45% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes shake {
  20% { transform: translate3d(calc(var(--shake) * -1), 0, 0); }
  40% { transform: translate3d(var(--shake), 0, 0); }
  60% { transform: translate3d(calc(var(--shake) * -0.4), 0, 0); }
  80% { transform: translate3d(calc(var(--shake) * 0.3), 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .stage[data-ending="play"] .core,
  .stage[data-ending="play"] .ring,
  .stage.is-shaking .fx,
  .unit.seconds.pulse .num { animation: none !important; }

  .stage[data-ending="play"] .ending-title,
  .stage[data-ending="play"] .ending-message,
  .stage[data-ending="play"] .clock { animation: fade 0.4s ease both; }
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
