:root {
  --fondo: #ffffff;
  --inchiostro: #0b0c0e;
  --grigio: #71717a;
  --grigio-chiaro: #a1a1aa;
  --linea: rgba(11, 12, 14, 0.08);
  --accento: #2f7cf6;
  --tacca: #e7e9ee;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--fondo);
  color: var(--inchiostro);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

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

.card {
  width: min(300px, calc(100vw - 32px));
  display: grid;
  gap: clamp(6px, 2vh, 14px);
  justify-items: center;
}

.card__top {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}
.card__app {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.card__drop { width: 14px; height: 14px; fill: var(--accento); }
.card__heads { position: relative; display: grid; justify-items: end; color: var(--grigio); }
.card__head { grid-area: 1 / 1; white-space: nowrap; }
.card__head--goal { color: var(--accento); font-weight: 600; opacity: 0; }

.total {
  display: flex;
  align-items: baseline;
  gap: 6px;
  line-height: 1;
}
.total__num {
  display: inline-flex;
  font-size: clamp(34px, 9vh, 46px);
  font-weight: 640;
  font-stretch: 92%;
  letter-spacing: -0.03em;
}
.total__goal { font-size: 15px; color: var(--grigio); font-weight: 500; }

/* each digit is a window one line tall with a column 0-9 inside that slides */
.rullo {
  position: relative;
  display: inline-block;
  height: 1.3em;
  width: 0.6em;
  margin: -0.15em 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(transparent 0, #000 13%, #000 87%, transparent 100%);
  mask-image: linear-gradient(transparent 0, #000 13%, #000 87%, transparent 100%);
}
.rullo__col { position: absolute; left: 0; right: 0; top: 0; display: grid; text-align: center; }
.rullo__col span { height: 1.3em; line-height: 1.3em; display: block; }
.punto { display: inline-block; width: 0.26em; text-align: center; }

.glass {
  position: relative;
  width: clamp(120px, 34vh, 190px);
  height: clamp(130px, 37vh, 210px);
}
.glass canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.ticks {
  display: flex;
  gap: 6px;
  height: 14px;
  align-items: flex-end;
}
.tacca {
  width: 16px;
  height: 6px;
  border-radius: 3px;
  background: var(--tacca);
  position: relative;
  overflow: hidden;
}
.tacca i {
  position: absolute; inset: 0;
  background: var(--accento);
  border-radius: inherit;
  transform: scaleX(0);
  transform-origin: left center;
}

.actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.add {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 42px;
  padding: 0 20px 0 16px;
  border-radius: 999px;
  background: var(--inchiostro);
  color: #fff;
  font-size: 14px;
  font-weight: 560;
  overflow: hidden;
  isolation: isolate;
}
.add__fill {
  position: absolute; inset: 0;
  background: var(--accento);
  border-radius: inherit;
  transform: scaleX(0);
  transform-origin: left center;
  z-index: -1;
}
.add__plus { width: 14px; height: 14px; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; fill: none; }
.reset { font-size: 13px; color: var(--grigio); padding: 8px 4px; }
@media (hover: hover) {
  .reset:hover { color: var(--inchiostro); }
}

.ghost {
  position: absolute; left: 0; top: 0;
  width: 22px; height: 22px;
  fill: var(--inchiostro);
  stroke: #fff; stroke-width: 1.2; stroke-linejoin: round;
  pointer-events: none;
  opacity: 0;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.2));
  z-index: 5;
}

@media (prefers-reduced-motion: reduce) {
  .ghost { display: none; }
}
