:root {
  --fondo: #ffffff;
  --pillola: #17171a;
  --pillola-alta: #26262b;
  --scritta: #f5f3ee;
  --scritta-piano: rgba(245, 243, 238, 0.52);
  --nastro: #ecc25a;
  --nastro-scuro: #c99a2c;
  --segni: #2a2216;
  --metallo: #d9dbe0;
  --accento: #ecc25a;
  --didascalia: #8b8a86;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  background: var(--fondo);
  color: var(--pillola);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

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

.wrap { display: grid; justify-items: center; gap: 14px; }

/* ---------- the pill ---------- */
.q {
  position: relative;
  display: block;
  height: 60px;
  width: 196px;
  border: 0;
  border-radius: 999px;
  padding: 0;
  font: inherit;
  color: var(--scritta);
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(120% 140% at 30% -30%, rgba(255, 255, 255, 0.13), transparent 55%),
    linear-gradient(180deg, var(--pillola-alta), var(--pillola));
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.14) inset,
    0 -1px 0 rgba(0, 0, 0, 0.5) inset,
    0 1px 2px rgba(17, 17, 19, 0.12),
    0 10px 22px -10px rgba(17, 17, 19, 0.5),
    0 26px 44px -26px rgba(17, 17, 19, 0.45);
  transition: box-shadow 0.3s;
}
/* fine grain on the pill */
.q::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .5 0'/></filter><rect width='120' height='120' filter='url(%23n)'/></svg>");
  opacity: 0.07;
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: -1;
}
.q:focus-visible { outline: 2px solid var(--accento); outline-offset: 4px; }
.q.is-hover,
.q.is-hover:focus-visible {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.16) inset,
    0 -1px 0 rgba(0, 0, 0, 0.5) inset,
    0 1px 2px rgba(17, 17, 19, 0.12),
    0 14px 26px -10px rgba(17, 17, 19, 0.55),
    0 32px 50px -26px rgba(17, 17, 19, 0.5);
}
@media (hover: hover) {
  .q:hover {
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.16) inset,
      0 -1px 0 rgba(0, 0, 0, 0.5) inset,
      0 1px 2px rgba(17, 17, 19, 0.12),
      0 14px 26px -10px rgba(17, 17, 19, 0.55),
      0 32px 50px -26px rgba(17, 17, 19, 0.5);
  }
}

.q__sheen {
  position: absolute; top: 0; bottom: 0; left: 0;
  width: 70px;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.12) 45%, rgba(255, 255, 255, 0.02) 60%, transparent);
  transform: translateX(-90px) skewX(-14deg);
  pointer-events: none;
}

/* ---------- rest: icon and label ---------- */
.q__idle {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 0 24px 0 20px;
  white-space: nowrap;
}
.q__icon { width: 22px; height: 22px; flex: none; }
.q__icon svg { width: 100%; height: 100%; overflow: visible; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.q__icon .case { stroke: var(--scritta); stroke-width: 1.7; }
.q__icon .hub { stroke: var(--scritta); stroke-width: 1.5; }
.q__icon .tongue { stroke: var(--accento); stroke-width: 1.8; }
.q__label { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; font-stretch: 100%; display: inline-block; }

/* ---------- the tape ---------- */
.tape {
  position: absolute; inset: 0;
  display: flex; align-items: center;
  padding: 0 10px 0 14px;
  gap: 8px;
  pointer-events: none;
  visibility: hidden;
}
.tape__track { position: relative; flex: 1; height: 100%; }
.tape__strip {
  position: absolute; left: 0; right: 0; top: 50%;
  height: 26px; margin-top: -13px;
  border-radius: 3px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0) 38%, rgba(0, 0, 0, 0) 70%, rgba(80, 50, 0, 0.18)),
    linear-gradient(90deg, var(--nastro), #f1cd6e 50%, var(--nastro));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset, 0 3px 6px -2px rgba(0, 0, 0, 0.55);
  clip-path: inset(0 100% 0 0);
  overflow: hidden;
}
.tape__ticks { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.tape__ticks line { stroke: var(--segni); stroke-width: 0.9; }
.tape__ticks line.m { stroke-width: 1.2; }
.tape__ticks text { fill: var(--segni); font-size: 8px; font-weight: 650; font-family: inherit; font-variant-numeric: tabular-nums; }
.tape__print {
  position: absolute; right: 6px; bottom: 2px;
  font-size: 6px; font-weight: 700; letter-spacing: 0.24em; color: rgba(42, 34, 22, 0.42);
}

.tape__hook {
  position: absolute; left: -4px; top: 50%;
  width: 5px; height: 32px; margin-top: -16px;
  border-radius: 1.5px;
  background: linear-gradient(90deg, #f4f5f7, #a8abb3);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.tape__roll {
  position: absolute; left: 0; top: 50%;
  width: 40px; height: 40px; margin: -20px 0 0 -20px;
  border-radius: 50%;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.55));
}
.tape__roll svg { width: 100%; height: 100%; overflow: visible; }
.roll__body { fill: #3a3a40; stroke: rgba(255, 255, 255, 0.22); stroke-width: 1; }
.roll__ring { fill: none; stroke: rgba(255, 255, 255, 0.14); stroke-width: 1; }
.roll__spoke { stroke: var(--accento); stroke-width: 1.4; stroke-linecap: round; opacity: 0.85; }
.roll__hub { fill: var(--metallo); }

.tape__marker {
  position: absolute; left: 0; top: 4px; bottom: 4px;
  width: 0;
  opacity: 0;
}
.tape__marker i {
  position: absolute; left: -0.75px; top: 0; bottom: 0;
  width: 1.5px; border-radius: 1px;
  background: #ffffff;
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.25);
}
.tape__marker i::before {
  content: ""; position: absolute; left: -3.25px; top: -1px;
  border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid #ffffff;
}

/* the reading */
.read {
  flex: none;
  display: flex; align-items: baseline; gap: 3px;
  padding: 7px 10px 7px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}
.read__num { display: flex; font-size: 17px; font-weight: 640; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; height: 20px; overflow: hidden; line-height: 20px; }
.read__num .col { display: block; width: 0.62em; text-align: center; }
.read__num .col span { display: block; height: 20px; }
.read__num .dot { width: 0.3em; text-align: center; }
.read__unit { font-size: 12px; color: var(--scritta-piano); font-weight: 560; }

/* ---------- done ---------- */
.q__done {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  padding: 0 22px 0 18px;
  white-space: nowrap;
  visibility: hidden;
}
.q__check { width: 22px; height: 22px; flex: none; fill: none; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.q__check .ck__ring { stroke: var(--accento); stroke-width: 1.6; }
.q__check path { stroke: var(--scritta); stroke-width: 1.9; }
.q__dlabel { font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em; display: inline-block; }
.q__meta {
  font-size: 12px; font-weight: 600; color: var(--segni);
  padding: 3px 8px; border-radius: 999px;
  background: var(--nastro);
  font-variant-numeric: tabular-nums;
  display: inline-block;
}

.hint { font-size: 12.5px; color: var(--didascalia); font-weight: 500; letter-spacing: 0.005em; white-space: nowrap; }
.hint span { margin: 0 3px; }

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

@media (max-width: 380px) {
  .q__dlabel { font-size: 14.5px; }
}
