:root {
  --fondo: #000000;
  --pillola: #0f0f12;
  --pillola-alta: #1e1f25;
  --testo: #f3f2ee;
  --testo-spento: rgba(243, 242, 238, 0.5);
  --ambra: #ffb36b;
  --viola: #a596ff;
  --carta: #f4f1ea;
  --inchiostro: #17161c;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--fondo);
  color: var(--testo);
  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;
}
.fit { transform-origin: 50% 50%; }
.wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* ---- the deck: the slides sit behind the pill and are dealt out of its top edge ---- */
.deck {
  position: relative;
  width: 300px;
  height: 104px;
  z-index: 0;
}
.slide {
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: 104px;
  height: 59px;
  margin-left: -52px;
  border-radius: 7px;
  opacity: 0;
  will-change: transform;
}
.slide__face {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  padding: 8px 9px;
  background: linear-gradient(180deg, #fbf9f4 0%, var(--carta) 100%);
  color: var(--inchiostro);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.7),
    inset 0 -1px 0 rgba(23, 22, 28, 0.08),
    0 1px 1px rgba(0, 0, 0, 0.5),
    0 10px 22px -8px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.slide__sheen {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
}
.slide__sheen::before {
  content: "";
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: var(--sx, -60%);
  width: 46%;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0) 0%, rgba(255, 228, 196, 0.75) 45%, rgba(255, 255, 255, 0.95) 52%, rgba(196, 186, 255, 0.55) 60%, rgba(255, 255, 255, 0) 100%);
  mix-blend-mode: soft-light;
  opacity: var(--so, 0);
}

.s-h {
  font-size: 7px;
  font-weight: 650;
  font-stretch: 112%;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
}
.s-line {
  display: block;
  height: 2.5px;
  width: var(--w, 80%);
  border-radius: 2px;
  background: rgba(23, 22, 28, 0.2);
}

/* title slide: ink and violet, the only dark one */
.slide__face--title {
  background: radial-gradient(120% 140% at 88% 110%, rgba(165, 150, 255, 0.55) 0%, rgba(165, 150, 255, 0) 55%), linear-gradient(160deg, #24222c 0%, #121117 100%);
  color: #f6f3ff;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 1px 1px rgba(0, 0, 0, 0.5),
    0 10px 22px -8px rgba(0, 0, 0, 0.9);
  justify-content: flex-end;
  gap: 3px;
}
.s-brand {
  position: absolute;
  top: 7px;
  left: 9px;
  font-size: 5.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.6;
}
.s-h1 {
  font-size: 11px;
  font-weight: 700;
  font-stretch: 118%;
  line-height: 1;
  letter-spacing: -0.01em;
}
.s-sub { display: block; width: 46%; height: 2px; border-radius: 2px; background: rgba(246, 243, 255, 0.35); }
.s-orb {
  position: absolute;
  right: 9px;
  top: 8px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1px solid rgba(255, 179, 107, 0.8);
  box-shadow: inset 0 0 6px rgba(255, 179, 107, 0.5);
}

/* the chart slide: amber bars on a hairline */
.s-bars {
  flex: 1;
  display: flex;
  align-items: flex-end;
  gap: 5px;
  padding: 0 2px 0;
  border-bottom: 1px solid rgba(23, 22, 28, 0.18);
}
.s-bar {
  flex: 1;
  height: var(--h);
  border-radius: 2px 2px 0 0;
  background: linear-gradient(180deg, rgba(255, 179, 107, 0.55), rgba(255, 179, 107, 0.35));
  transform-origin: 50% 100%;
}
.s-bar--hi { background: linear-gradient(180deg, #ff9f45, var(--ambra)); }

/* the split slide: a picture block of light and a column of lines */
.slide__face--split { flex-direction: row; gap: 7px; }
.s-pic {
  flex: 0 0 40%;
  border-radius: 4px;
  background: radial-gradient(90% 90% at 30% 25%, #ffd9b1 0%, rgba(255, 217, 177, 0) 60%), linear-gradient(140deg, var(--ambra) 0%, #c77dff 60%, var(--viola) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}
.s-col { flex: 1; display: flex; flex-direction: column; gap: 4px; padding-top: 1px; }

/* the stat slide */
.slide__face--stat { justify-content: center; gap: 3px; }
.s-big {
  font-size: 19px;
  font-weight: 720;
  font-stretch: 112%;
  line-height: 1;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #e9862b, #b06bff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.s-cap { font-size: 5.5px; font-weight: 500; opacity: 0.55; white-space: nowrap; }

/* the count on the squared deck: a small graphite tag, a number not a dot */
.deck__count {
  position: absolute;
  left: 50%;
  bottom: 57px;
  margin-left: 46px;
  min-width: 26px;
  height: 18px;
  padding: 0 6px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 640;
  color: var(--inchiostro);
  background: linear-gradient(180deg, #ffd1a3, var(--ambra));
  box-shadow: 0 0 0 2px #000000, 0 4px 10px -2px rgba(255, 179, 107, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  opacity: 0;
  z-index: 20;
}

/* ---- the pill ---- */
.btn {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  height: 60px;
  padding: 0 14px 0 18px;
  border-radius: 30px;
  color: var(--testo);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  outline: none;
  isolation: isolate;
  white-space: nowrap;
}
.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: 0 0 0 3px #000000, 0 0 0 5px var(--ambra); }

.btn__face {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: -1;
  overflow: hidden;
  background: linear-gradient(180deg, var(--pillola-alta) 0%, var(--pillola) 62%, #09090b 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.11),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    inset 0 -1px 0 rgba(0, 0, 0, 0.7),
    0 2px 6px -2px rgba(0, 0, 0, 0.9);
}
.btn__shine {
  position: absolute;
  left: var(--hx, 50%);
  top: var(--hy, 0%);
  width: 170px;
  height: 120px;
  margin: -60px 0 0 -85px;
  background: radial-gradient(closest-side, rgba(255, 214, 170, 0.15), rgba(255, 214, 170, 0));
  opacity: var(--riflesso, 0);
}

/* the light that runs round the edge while the slides are made: a conic gradient shown only on a 1.5px ring */
.btn__ring,
.btn__glow {
  position: absolute;
  inset: -1px;
  border-radius: 31px;
  pointer-events: none;
  background: conic-gradient(from var(--ang, 0deg), rgba(165, 150, 255, 0) 0deg, rgba(165, 150, 255, 0) 150deg, var(--viola) 220deg, #ffffff 262deg, var(--ambra) 290deg, rgba(255, 179, 107, 0) 345deg);
  opacity: var(--on, 0);
}
.btn__ring {
  padding: 1.5px;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  z-index: 1;
}
.btn__glow {
  inset: 2px;
  filter: blur(12px);
  z-index: -2;
  opacity: calc(var(--on, 0) * 0.55);
}

.btn__icon {
  position: relative;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  margin-right: 10px;
}
.ico {
  position: absolute;
  inset: 0;
  width: 24px;
  height: 24px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ico__ln { stroke: var(--ambra); }
.ico--deck { opacity: 0; }
.ico__back { stroke: var(--testo-spento); }
.ico__front { fill: #15151a; }
.ico__play { fill: var(--ambra); stroke: var(--ambra); stroke-width: 1; }

.btn__label {
  position: relative;
  display: block;
  height: 22px;
  overflow: hidden;
  font-size: 16px;
  font-weight: 560;
  font-stretch: 100%;
  letter-spacing: 0.005em;
  line-height: 22px;
}
.btn__txt {
  position: absolute;
  left: 0;
  top: 0;
  white-space: nowrap;
}
.btn__txt span { display: inline; }
.btn__txt .dim { color: var(--testo-spento); font-weight: 480; }

.btn__key {
  margin-left: 12px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  color: var(--testo-spento);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.09), inset 0 -1px 0 rgba(0, 0, 0, 0.5);
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (hover: hover) {
  .btn:hover .btn__key { color: var(--testo); }
}

.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;
  z-index: 30;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}
