/* ===== Countdown digit animation (roll-down tick) =====
   We render each character in its own <span>.
   When a digit changes, we apply .tick briefly.
*/

/* ===== Full-width phase bar ===== */

.phase-high {
  background: rgba(99, 102, 241, 0.14); /* indigo */
  color: rgb(199, 210, 254);
  border-color: rgba(99, 102, 241, 0.35);
}

.phase-low {
  background: rgba(16, 185, 129, 0.14); /* emerald */
  color: rgb(167, 243, 208);
  border-color: rgba(16, 185, 129, 0.35);
}

/* ===== Smooth digit tick (keyframes) ===== */

.digit {
  display: inline-block;
  width: 0.62em;          /* keeps spacing stable per digit */
  text-align: center;
  will-change: transform, opacity;
}

.digit-colon {
  display: inline-block;
  width: 0.35em;
  text-align: center;
  opacity: 0.9;
}

@keyframes tickDown {
  0%   { transform: translateY(-12px); opacity: 0; }
  100% { transform: translateY(0);     opacity: 1; }
}

/* Apply this briefly when a digit changes */
.digit.animate {
  animation: tickDown 160ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .digit.animate { animation: none; }
}


/* ===== Haptic-ish button feedback (CSS only) ===== */
.haptic {
  transform: translateZ(0);
  transition:
    transform 120ms cubic-bezier(0.2, 0.9, 0.2, 1),
    box-shadow 120ms cubic-bezier(0.2, 0.9, 0.2, 1),
    filter 120ms cubic-bezier(0.2, 0.9, 0.2, 1);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.35),
    0 1px 0 rgba(255, 255, 255, 0.08) inset;
}

.haptic:active {
  transform: scale(0.985) translateY(1px);
  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.35),
    0 0 0 rgba(255, 255, 255, 0) inset;
  filter: brightness(1.04);
}

/* Tiny “impulse” ring on press (still CSS only) */
.haptic:active::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 14px;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
  pointer-events: none;
}

.haptic:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(99, 102, 241, 0.45),
    0 10px 24px rgba(0, 0, 0, 0.35),
    0 1px 0 rgba(255, 255, 255, 0.08) inset;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .digit {
    transition: none;
  }
  .haptic {
    transition: none;
  }
  .haptic:active::after {
    display: none;
  }
}
