/*
 * A percentage as a ring (ChanceRing.js). The stroke draws from the top on
 * the slow duration once `play()` is called, and the figure counts up with
 * it — the app's number entrance in two parts that land together.
 */

.chance-ring {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: var(--size, 60px);
  height: var(--size, 60px);
}

.chance-ring__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.chance-ring__track,
.chance-ring__fill {
  fill: none;
  stroke-width: 5;
}

.chance-ring__track {
  stroke: var(--surface-sunken);
}

.chance-ring__fill {
  stroke: var(--accent);
  stroke-linecap: round;
  transition: stroke-dashoffset var(--duration-slow) var(--easing);
}

.chance-ring__text {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.chance-ring__figure {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.chance-ring__caption {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: var(--weight-medium);
}

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