:root {
  --fondo: #ffffff;
  --testo: #15161a;
  --testo-2: #7a7d86;
  --linea: #eceef1;          /* the dial track and the empty tacks */
  --tacca: #d9dce1;          /* the minute ticks outside the arc */
  --focus: #e5532d;          /* Focus: a warm tomato red */
  --pausa: #1f9a74;          /* Short break: a calm green */
  --acc: #e5532d;            /* the accent of the mode on screen, moved by the script */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--fondo);
  color: var(--testo);
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.stage {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 12px;
}

.timer {
  --dial: min(270px, 46vh, 72vw);
  width: min(372px, 92vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: min(14px, 2.6vh);
  padding: min(20px, 3.6vh) 20px;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(20, 22, 30, 0.06), 0 1px 2px rgba(20, 22, 30, 0.04), 0 18px 40px -18px rgba(20, 22, 30, 0.18);
}

/* ---- header: the mode and the round ---- */
.top { width: 100%; display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.mode {
  display: inline-flex; align-items: center; gap: 7px;
  height: 26px; padding: 0 11px; border-radius: 99px;
  background: color-mix(in srgb, var(--acc) 10%, #fff);
  color: color-mix(in srgb, var(--acc) 78%, #000);
  font-weight: 560; font-variation-settings: "wdth" 100;
}
.mode__win { display: inline-block; height: 16px; overflow: hidden; position: relative; line-height: 16px; }
.mode__txt { display: inline-block; white-space: nowrap; }
.round { color: var(--testo-2); font-variant-numeric: tabular-nums; font-weight: 450; }

/* ---- the dial ---- */
.dial {
  position: relative;
  width: var(--dial); height: var(--dial);
  touch-action: none;
  cursor: grab;
  border-radius: 50%;
  outline: none;
}
.dial.is-run { cursor: default; }
.dial.is-drag { cursor: grabbing; }
.dial:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 30%, transparent); }
.dial__svg { width: 100%; height: 100%; display: block; overflow: visible; }
.ticks line { stroke: var(--tacca); stroke-width: 1.2; stroke-linecap: round; transition: stroke .35s; }
.ticks line.is-big { stroke-width: 1.8; }
.ticks line.is-on { stroke: var(--acc); }
.track { fill: none; stroke: var(--linea); stroke-width: 3; }
.arc { fill: none; stroke: var(--acc); stroke-width: 3.4; stroke-linecap: round; stroke-dasharray: 1 1; stroke-dashoffset: 1; }
.knob__halo { fill: var(--acc); opacity: 0; }
.knob__body { fill: #fff; stroke: var(--acc); stroke-width: 2.4; filter: drop-shadow(0 2px 3px rgba(20, 22, 30, .18)); }
.knob__dot { fill: var(--acc); }

.read {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  pointer-events: none;
}
.time {
  display: flex; align-items: center;
  font-size: calc(var(--dial) * 0.215);
  line-height: 1;
  font-weight: 520;
  font-variation-settings: "wdth" 94;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  transition: opacity .4s;
}
.time.is-paused { opacity: .45; }
.dg { position: relative; display: inline-block; height: 1.04em; width: 0.6em; overflow: hidden; }
.dg > span { position: absolute; left: 0; right: 0; top: 0; text-align: center; line-height: 1.04em; }
.colon { width: 0.28em; text-align: center; transform: translateY(-0.06em); color: var(--testo-2); }
.sub { margin-top: 8px; font-size: 12px; color: var(--testo-2); }
.sub__win { display: inline-block; height: 15px; line-height: 15px; overflow: hidden; }
.sub__win > span { display: inline-block; white-space: nowrap; }

/* ---- the four rounds ---- */
.tacks { display: flex; gap: 7px; }
.tack { position: relative; width: 26px; height: 5px; border-radius: 99px; background: var(--linea); overflow: hidden; }
.tack__fill { position: absolute; inset: 0; border-radius: inherit; background: var(--acc); transform-origin: 0 50%; transform: scaleX(0); }

/* ---- the controls ---- */
.controls { display: flex; align-items: center; gap: 12px; }
.round-btn {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: #f4f5f7;
  color: #4a4d56;
  transition: background .25s, color .25s;
}
.round-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.round-btn [data-skip] path:first-child, .round-btn svg path:first-child { }
[data-skip] svg path:first-child { fill: currentColor; stroke-linejoin: round; }

.go { position: relative; height: 48px; padding: 0; border-radius: 99px; color: #fff; }
.go__bg { position: absolute; inset: 0; border-radius: inherit; background: var(--testo); box-shadow: 0 8px 18px -10px rgba(20, 22, 30, .55), inset 0 1px 0 rgba(255,255,255,.12); }
.go__in { position: relative; display: flex; align-items: center; gap: 8px; height: 100%; padding: 0 22px 0 18px; }
.go__icon { width: 15px; height: 15px; fill: #fff; flex: none; }
.go__win { display: inline-block; height: 18px; overflow: hidden; line-height: 18px; font-weight: 560; font-size: 15px; }
.go__txt { display: inline-block; white-space: nowrap; }
.measure { position: absolute; visibility: hidden; white-space: nowrap; font-weight: 560; font-size: 15px; pointer-events: none; }

@media (hover: hover) {
  .round-btn:hover { background: #eceef1; color: var(--testo); }
  .go:hover .go__bg { background: #000; }
}
