/* Countdown: one tile per unit, the number large, its unit beneath */
.countdown {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs);
}

.countdown__unit {
  align-items: center;
  background: color-mix(in oklch, var(--color-surface-1) 70%, transparent);
  border: var(--border-width) solid color-mix(in oklch, var(--color-subtle) 70%, transparent);
  border-radius: var(--radius-m);
  display: flex;
  flex-direction: column;
  gap: var(--space-3xs);
  min-inline-size: 4rem;
  padding: var(--space-xs) var(--space-2xs) var(--space-2xs);
}

.countdown__value {
  font-size: var(--step-2);
  font-variant-numeric: tabular-nums;
  font-weight: var(--weight-bold);
  line-height: var(--leading-flat);
}

.countdown__label {
  color: var(--color-muted);
  font-size: var(--step--2);
}

/* Holds the ticking still: pause while it runs, play while it is held */
.countdown__toggle {
  align-items: center;
  align-self: center;
  appearance: none;
  aspect-ratio: 1;
  background: transparent;
  block-size: 2.5rem;
  border: 0;
  border-radius: var(--radius-pill);
  color: var(--color-muted);
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  transition: background var(--duration-fast) var(--ease-out);

  &:hover {
    background: color-mix(in oklch, var(--color-surface-1) 70%, transparent);
    color: var(--color-text);
  }

  &[aria-pressed="false"] [data-when="paused"],
  &[aria-pressed="true"] [data-when="running"] {
    display: none;
  }
}

/* Contrast themes (forced colors) drop the fill; a border keeps the edge */
@media (forced-colors: active) {
  .countdown__toggle {
    border: var(--border-width) solid ButtonText;
  }
}
