:root {
  --fondo: #ffffff;
  --pillola: #121214;
  --pillola-alta: #2b2b30;
  --testo: #f6f5f1;
  --testo-spento: rgba(246, 245, 241, 0.46);
  --segno: rgba(246, 245, 241, 0.34);
  --accento: #c9f25d;
  --accento-scuro: #8fbf1f;
  --inchiostro: #17171a;
  --inchiostro-spento: rgba(23, 23, 26, 0.56);
}

* { 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;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}

.unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: calc(100vw - 32px);
}

/* the pill: graphite ink, a hairline that takes the light on top, a soft layered shadow on the white */
.btn {
  position: relative;
  display: block;
  width: min(232px, calc(100vw - 32px));
  height: 60px;
  border-radius: 30px;
  color: var(--testo);
  background: linear-gradient(180deg, var(--pillola-alta) 0%, var(--pillola) 58%, #0a0a0b 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    inset 0 -1px 0 rgba(0, 0, 0, 0.7),
    0 1px 1px rgba(16, 16, 20, 0.14),
    0 4px 10px -4px rgba(16, 16, 20, 0.3),
    0 calc(14px + var(--alto, 0) * 6px) calc(30px + var(--alto, 0) * 10px) -14px rgba(16, 16, 20, calc(0.42 + var(--alto, 0) * 0.1)),
    0 12px 34px -16px rgba(150, 200, 40, calc(var(--alone, 0) * 0.7));
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  outline: none;
  isolation: isolate;
  overflow: hidden;
}
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  transition: box-shadow 0.25s ease;
}
.btn:focus-visible::after { box-shadow: inset 0 0 0 2px var(--accento); }

/* a warm light under the pointer */
.btn__light {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: -1;
}
.btn__light::before {
  content: "";
  position: absolute;
  left: var(--mx, 40%);
  top: var(--my, 0%);
  width: 220px;
  height: 140px;
  margin: -70px 0 0 -110px;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0));
  opacity: var(--luce, 0);
}
/* a thin sheen that crosses once when the pill opens */
.btn__sheen {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -40%;
  width: 34%;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.09) 50%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
  opacity: 0;
}

/* rest: the label and a drawn arrow */
.rest {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 22px;
  white-space: nowrap;
}
.rest__label {
  font-size: 16px;
  font-weight: 580;
  font-stretch: 100%;
  letter-spacing: -0.005em;
  line-height: 22px;
}
.rest__arrow {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.8;
}

/* your place: the line of marks ahead of you on the right */
.place {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}
.line {
  position: absolute;
  right: 22px;
  top: 50%;
  width: 118px;
  height: 26px;
  margin-top: -13px;
}
.mark {
  position: absolute;
  left: 0;
  bottom: 4px;
  width: 2px;
  height: 14px;
  margin-left: -1px;
  border-radius: 1px;
  background: var(--segno);
  transform-origin: 50% 100%;
}
.mark--you {
  width: 3px;
  height: 20px;
  margin-left: -1.5px;
  border-radius: 1.5px;
  background: linear-gradient(180deg, #e6ff9e, var(--accento));
  box-shadow: 0 0 10px rgba(201, 242, 93, 0.35);
}
.mark--after { background: rgba(246, 245, 241, 0.16); }
.line__floor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 3px;
  height: 1px;
  background: linear-gradient(90deg, rgba(246, 245, 241, 0), rgba(246, 245, 241, 0.14) 30%, rgba(246, 245, 241, 0.14));
  transform-origin: 100% 50%;
}

/* the number: a window per digit, the strip inside rolls */
.num {
  position: absolute;
  left: 22px;
  top: 50%;
  height: 24px;
  margin-top: -12px;
  display: flex;
  align-items: center;
  font-size: 19px;
  font-weight: 640;
  font-stretch: 104%;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  line-height: 24px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}
.num__hash { color: var(--testo-spento); margin-right: 1px; font-weight: 560; }
.num__comma { color: var(--testo); width: 0.3em; text-align: center; }
.num__win {
  position: relative;
  display: inline-block;
  width: 0.62em;
  height: 24px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 22%, #000 78%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 22%, #000 78%, transparent 100%);
}
.num__strip {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  text-align: center;
}
.num__strip span { display: block; height: 24px; }

/* done: You're in · #2,412 and the check */
.done {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 0 22px;
  white-space: nowrap;
  pointer-events: none;
}
.done__words {
  font-size: 16px;
  font-weight: 580;
  font-stretch: 100%;
  line-height: 22px;
  opacity: 0;
}
.done__dot { color: var(--testo-spento); margin: 0 0.32em 0 0.28em; }
.done__slot { display: inline-block; height: 24px; }
.check {
  position: absolute;
  right: 17px;
  top: 50%;
  width: 26px;
  height: 26px;
  margin-top: -13px;
  overflow: visible;
}
.check__disc { fill: var(--accento); opacity: 0; transform-origin: 12px 12px; }
.check__tick {
  fill: none;
  stroke: #10140a;
  stroke-width: 2.1;
  stroke-dasharray: 16;
  stroke-dashoffset: 16;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* the second action, small, under the pill */
.share {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px 0 10px;
  border-radius: 15px;
  color: var(--inchiostro-spento);
  font-size: 13px;
  font-weight: 560;
  opacity: 0;
  visibility: hidden;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  transition: background-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}
.share:focus-visible { box-shadow: 0 0 0 2px var(--inchiostro); }
@media (hover: hover) {
  .share:hover { color: var(--inchiostro); background-color: rgba(23, 23, 26, 0.05); }
}
.share__icon {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}
.share__ok { stroke: var(--accento-scuro); stroke-width: 1.8; stroke-dasharray: 14; stroke-dashoffset: 14; }
.share__words { position: relative; display: inline-block; height: 18px; overflow: hidden; }
.share__label { display: block; line-height: 18px; white-space: nowrap; font-stretch: 100%; }
.share__label + .share__label { position: absolute; left: 0; top: 0; opacity: 0; color: var(--inchiostro); }

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.ghost {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  margin: -3px 0 0 -4px;
  fill: #ffffff;
  stroke: #111114;
  stroke-width: 1.4;
  stroke-linejoin: round;
  pointer-events: none;
  opacity: 0;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}
