:root {
  --paper: #f4f1ea;
  --ink: #1f1c18;
  --muted: #8b857a;
  --line: #dfd9cd;
  --film: #efebe3;
  --accent: #2f6b4f;
  --sheet-w: min(560px, 100%);
  --sheet-h: clamp(150px, min(44vh, 58vw), 330px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

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

.pack {
  width: min(560px, 100%);
  display: grid;
  justify-items: center;
  gap: clamp(10px, 2.6vh, 22px);
}

.head { text-align: center; display: grid; gap: 4px; }

.brand {
  font-family: "JetBrains Mono Variable", ui-monospace, monospace;
  font-size: clamp(10px, 1.5vh, 12px);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand__amp { color: var(--accent); }

.title {
  font-size: clamp(18px, 3.6vh, 28px);
  font-weight: 560;
  font-stretch: 92%;
  letter-spacing: -.01em;
  line-height: 1.1;
}

.sheet {
  position: relative;
  width: var(--sheet-w);
  height: var(--sheet-h);
  border-radius: 14px;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, .55) 0%, rgba(255, 255, 255, 0) 38%, rgba(255, 255, 255, .25) 62%, rgba(255, 255, 255, 0) 100%),
    var(--film);
  box-shadow:
    inset 0 0 0 1px rgba(31, 28, 24, .06),
    0 1px 0 rgba(255, 255, 255, .8),
    0 18px 40px -24px rgba(31, 28, 24, .35);
  touch-action: none;
  cursor: pointer;
  overflow: hidden;
}

/* la linea tratteggiata dello strappo, in alto e in basso */
.sheet::before,
.sheet::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  height: 0;
  border-top: 1px dashed rgba(31, 28, 24, .14);
  pointer-events: none;
}
.sheet::before { top: 7px; }
.sheet::after { bottom: 7px; }

.sheet__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.cursor {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  pointer-events: none;
  opacity: 0;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .18));
}

.foot {
  width: var(--sheet-w);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tally {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-size: clamp(13px, 2vh, 15px);
  color: var(--muted);
}

.tally__num {
  position: relative;
  display: inline-block;
  overflow: hidden;
  height: 1.25em;
  min-width: 2.4ch;
  font-family: "JetBrains Mono Variable", ui-monospace, monospace;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.tally__n {
  display: block;
  line-height: 1.25em;
  white-space: nowrap;
}

.tally__n + .tally__n { position: absolute; left: 0; top: 0; }

.pill {
  position: relative;
  border: 0;
  background: none;
  font: inherit;
  color: #fff;
  cursor: pointer;
  padding: 0;
  height: clamp(36px, 5.6vh, 42px);
  border-radius: 999px;
  display: grid;
  -webkit-tap-highlight-color: transparent;
}

.pill__bg {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--ink);
  box-shadow: 0 6px 16px -8px rgba(31, 28, 24, .5);
}

.pill__label {
  position: relative;
  display: grid;
  place-items: center;
  padding: 0 clamp(16px, 2.6vh, 20px);
  font-size: clamp(13px, 2vh, 14px);
  font-weight: 560;
  font-stretch: 100%;
  white-space: nowrap;
  transition: font-stretch .35s cubic-bezier(.3, 1.6, .5, 1);
}

@media (hover: hover) {
  .pill:hover .pill__label { font-stretch: 112%; }
}

.pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
