.musi-timer {
  /* Tokens: cambia estos valores para adaptar el temporizador */
  --musi-fg: currentColor; /* marcas, pista y contador */
  --musi-accent: #ff4d1f; /* lo que se llena y la marca actual */
  --musi-ring: 2.5em; /* tamaño del anillo */
  --musi-thickness: 1.5; /* grosor de la línea (en unidades del anillo, de 40) */
  --musi-track: 0.22; /* cuánto se ve la pista vacía */
  --musi-size: 1rem; /* todo el componente escala con este tamaño */

  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  color: var(--musi-fg);
  font-size: var(--musi-size);
}

.musi-timer__ring {
  flex: none;
  width: var(--musi-ring);
  height: var(--musi-ring);
  overflow: visible;
  rotate: -90deg;
}

.musi-timer__ring circle {
  fill: none;
  stroke-width: var(--musi-thickness);
}

.musi-timer__track {
  stroke: color-mix(in srgb, currentColor calc(var(--musi-track) * 100%), transparent);
}

.musi-timer__fill {
  stroke: var(--musi-accent);
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  stroke-linecap: round;
}

/* Se llena mientras corre; con el cursor encima (si así se pide) se detiene */
.musi-timer[data-musi-playing] .musi-timer__fill {
  animation: musi-timer-fill var(--musi-time, 4s) linear forwards;
}

.musi-timer[data-musi-paused] .musi-timer__fill {
  animation-play-state: paused;
}

@keyframes musi-timer-fill {
  to {
    stroke-dashoffset: 0;
  }
}

.musi-timer__marks line {
  stroke: currentColor;
  stroke-width: 1;
  stroke-linecap: round;
  opacity: 0.4;
  transition:
    stroke 0.4s ease,
    opacity 0.4s ease;
}

.musi-timer__marks line[data-musi-current] {
  stroke: var(--musi-accent);
  stroke-width: 1.6;
  opacity: 1;
}

.musi-timer__label {
  font: 400 0.75em / 1 ui-monospace, "SF Mono", Menlo, monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.musi-timer[data-musi-label="off"] .musi-timer__label {
  display: none;
}

.musi-timer__now {
  display: inline-block;
}

.musi-timer__now[data-musi-roll] {
  animation: musi-timer-roll 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes musi-timer-roll {
  from {
    opacity: 0;
    translate: 0 0.7em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .musi-timer *,
  .musi-timer {
    animation: none !important;
    transition: none !important;
  }
}
