:root {
  --fondo: #060608;
  --superficie: #111114;
  --superficie-2: #18181c;
  --bordo: rgba(255, 255, 255, 0.07);
  --bordo-forte: rgba(255, 255, 255, 0.14);
  --testo: #f4f4f6;
  --testo-2: #9a9aa3;
  --testo-3: #5d5d66;
  --accento: #8fa2ff;
  --accento-2: #c99bff;
  --chiaro: #f4f4f6;
  --verde: #7be0b0;
}

* { box-sizing: border-box; margin: 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;
}

.stage {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(10px, 3vmin, 36px);
  background: radial-gradient(60% 50% at 50% 42%, rgba(143, 162, 255, 0.06), transparent 70%), var(--fondo);
}

.card {
  position: relative;
  width: min(360px, 100%);
  padding: clamp(12px, 3vh, 20px) clamp(14px, 3vh, 20px) clamp(10px, 2.4vh, 16px);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01)), var(--superficie);
  border: 1px solid var(--bordo);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(8px, 2vh, 14px);
}

.card__head {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand svg { width: 16px; height: 16px; fill: none; stroke: var(--testo); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.state {
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--bordo-forte);
  font-size: 11px;
  font-weight: 500;
  color: var(--testo-2);
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  transition: color 0.3s, border-color 0.3s;
}
.state.is-live { color: var(--accento); border-color: rgba(143, 162, 255, 0.35); }
.state.is-paused { color: #e8c88a; border-color: rgba(232, 200, 138, 0.3); }
.state.is-saved { color: var(--verde); border-color: rgba(123, 224, 176, 0.3); }
.state__in { display: block; white-space: nowrap; }

.dial {
  position: relative;
  width: min(212px, 40vh, 70vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.s1 { stop-color: var(--accento); }
.s2 { stop-color: var(--accento-2); }
.ticks line { stroke: rgba(255, 255, 255, 0.1); stroke-width: 1; stroke-linecap: round; }
.ticks line.is-long { stroke: rgba(255, 255, 255, 0.2); }
.ring__track { fill: none; stroke: rgba(255, 255, 255, 0.06); stroke-width: 6; }
.ring__wait { fill: none; stroke: rgba(255, 255, 255, 0.22); stroke-width: 2; stroke-dasharray: 0.6 2.4; stroke-linecap: round; }
.ring__arc, .ring__glow, .ring__head {
  fill: none;
  stroke-linecap: round;
  stroke-dasharray: 0 1;
}
.ring__arc { stroke: url(#luce); stroke-width: 6; }
.ring__glow { stroke: url(#luce); stroke-width: 16; opacity: 0; filter: blur(9px); }
.ring__head { stroke: rgba(255, 255, 255, 0.75); stroke-width: 6; opacity: 0; }

.dial__face {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.time {
  display: flex;
  align-items: center;
  font-size: clamp(30px, 8.6vh, 44px);
  font-weight: 560;
  font-variation-settings: "wdth" 88;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--testo);
}
.dig {
  position: relative;
  display: block;
  width: 0.6em;
  height: 1em;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 18%, #000 82%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 18%, #000 82%, transparent);
}
.dig__strip { position: absolute; left: 0; top: 0; width: 100%; will-change: transform; }
.dig__strip span { display: block; height: 1em; text-align: center; }
.colon { width: 0.28em; text-align: center; transform: translateY(-0.06em); color: var(--testo-2); }

.task {
  font-size: 11.5px;
  color: var(--testo-2);
  max-width: 140px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 46px;
}

.pill {
  position: relative;
  height: 44px;
  padding: 0 20px 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--chiaro);
  color: #0b0b0e;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 8px 26px -10px rgba(143, 162, 255, 0.55), inset 0 -1px 0 rgba(0, 0, 0, 0.12);
  transition: background-color 0.35s, color 0.35s, box-shadow 0.35s;
}
.pill.is-dark {
  background: var(--superficie-2);
  color: var(--testo);
  box-shadow: inset 0 0 0 1px var(--bordo-forte), 0 8px 24px -14px rgba(0, 0, 0, 0.9);
}
.pill:focus-visible, .end:focus-visible { outline: 2px solid var(--accento); outline-offset: 3px; }
.pill__sheen {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.55) 48%, transparent 66%);
  transform: translateX(-120%);
  pointer-events: none;
}
.pill.is-dark .pill__sheen { background: linear-gradient(105deg, transparent 30%, rgba(143, 162, 255, 0.22) 48%, transparent 66%); }
.pill__icon { position: relative; width: 18px; height: 18px; display: grid; place-items: center; }
.ic { position: absolute; width: 18px; height: 18px; fill: currentColor; }
.ic--pause { opacity: 0; }
.pill__label { position: relative; display: block; height: 1.2em; line-height: 1.2em; overflow: hidden; white-space: nowrap; }
.pill__roll { display: block; }

.end {
  position: relative;
  width: 0;
  height: 44px;
  margin-left: 0;
  border: 0;
  border-radius: 999px;
  background: var(--superficie-2);
  box-shadow: inset 0 0 0 1px var(--bordo-forte);
  color: var(--testo-2);
  display: grid;
  place-items: center;
  cursor: pointer;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: color 0.25s;
}
.end.is-on { pointer-events: auto; }
.end svg { width: 16px; height: 16px; fill: currentColor; flex: none; }

@media (hover: hover) {
  .end:hover { color: #ff8f8f; }
}

.today {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: clamp(8px, 1.8vh, 12px);
  border-top: 1px solid var(--bordo);
  font-size: 11.5px;
  color: var(--testo-3);
  position: relative;
}
.today__label { color: var(--testo-2); }
.bars { display: inline-flex; gap: 4px; }
.bars i {
  position: relative;
  display: block;
  width: 16px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.09);
  overflow: hidden;
}
.bars i::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accento), var(--accento-2));
  transform: scaleX(var(--pieno, 0));
  transform-origin: left center;
}
.bars i.is-done { --pieno: 1; }
.today__total { margin-left: auto; color: var(--testo-2); }
.today__saved {
  position: absolute;
  right: 0;
  bottom: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--verde);
  opacity: 0;
  white-space: nowrap;
}
.today__saved svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.today__saved path { stroke-dasharray: 1; stroke-dashoffset: 1; }

.ghost {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  fill: #f4f4f6;
  stroke: #060608;
  stroke-width: 1.4;
  stroke-linejoin: round;
  pointer-events: none;
  z-index: 5;
  opacity: 0;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}
