:root {
  --fondo: #ffffff;
  --carta: #ffffff;
  --bordo: rgba(24, 22, 20, 0.09);
  --tessera: #f4f3f1;
  --tessera-sopra: #ecebe8;
  --testo: #1a1917;
  --testo-2: #6f6b66;
  --testo-3: #a6a19b;
  --accento: #2f8f5e;     /* the colour of 10; 0 is a warm grey, the score slides between them */
  --inchiostro: #1a1917;  /* Send and the chosen chips */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--fondo);
  color: var(--testo);
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.stage {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(10px, 3vh, 28px) 12px;
}

/* ---- the card: GSAP animates its height, the body inside keeps its natural size ---- */
.card {
  position: relative;
  width: min(440px, 100%);
  background: var(--carta);
  border-radius: 22px;
  box-shadow:
    0 0 0 1px var(--bordo),
    0 1px 2px rgba(24, 22, 20, 0.04),
    0 12px 28px -10px rgba(24, 22, 20, 0.16),
    0 34px 60px -30px rgba(24, 22, 20, 0.18);
  overflow: hidden;
  transform-origin: 85% 100%;
}
.card__body { position: relative; }
.face { padding: clamp(14px, 3.4vh, 22px) clamp(14px, 4.4vw, 22px) clamp(14px, 3.4vh, 20px); }
.face--thanks {
  position: absolute; inset: 0 0 auto 0;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding-top: clamp(18px, 4.6vh, 30px); padding-bottom: clamp(16px, 4vh, 26px);
  visibility: hidden;
}

.top { display: flex; align-items: center; justify-content: space-between; margin-bottom: clamp(8px, 1.8vh, 12px); }
.brand {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 600; letter-spacing: -0.005em;
}
.brand svg { width: 18px; height: 18px; fill: none; stroke: var(--testo); stroke-width: 1.5; stroke-linecap: round; }
.later {
  font-size: 12.5px; color: var(--testo-2); padding: 6px 8px; margin: -6px -8px; border-radius: 8px;
  transition: color .2s;
}
.later:focus-visible, .again:focus-visible { outline: 2px solid var(--testo); outline-offset: 2px; }

.q {
  font-size: clamp(15.5px, 4.4vw, 19px);
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.015em;
  font-stretch: 96%;
  margin-bottom: clamp(10px, 2.4vh, 16px);
  max-width: 24em;
}

/* ---- the scale: eleven tiles; the score fill rises inside a tile ---- */
.scale { display: grid; grid-template-columns: repeat(11, 1fr); gap: clamp(3px, 1vw, 5px); }
.tile {
  position: relative;
  height: clamp(32px, 8.4vh, 40px);
  border-radius: 9px;
  background: var(--tessera);
  font-size: clamp(12.5px, 3.4vw, 14px);
  font-weight: 560;
  color: var(--testo);
  isolation: isolate;
  transition: background-color .2s;
}
.tile__lift { position: absolute; inset: 0; border-radius: inherit; }
.tile__fill {
  position: absolute; inset: 0; border-radius: inherit;
  background: var(--tinta, var(--accento));
  transform: scaleY(0); transform-origin: 50% 100%;
  z-index: -1;
}
.tile__shine {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.28), rgba(255,255,255,0) 55%);
  opacity: 0;
}
.tile__n { position: relative; display: grid; place-items: center; height: 100%; }
.tile:focus-visible { outline: 2px solid var(--testo); outline-offset: 2px; }
@media (hover: hover) {
  .tile:hover { background: var(--tessera-sopra); }
  .later:hover { color: var(--testo); }
  .again:hover { color: var(--testo); }
}

.ends {
  display: flex; justify-content: space-between;
  margin-top: 7px; font-size: 11.5px; color: var(--testo-3); letter-spacing: .01em;
}

/* ---- the follow-up: height animated from 0 ---- */
.more { height: 0; overflow: hidden; }
.more__in { padding-top: clamp(12px, 2.8vh, 18px); }
.follow {
  position: relative; height: 1.35em; overflow: hidden;
  font-size: clamp(14px, 3.9vw, 15.5px); font-weight: 600; letter-spacing: -0.01em;
  margin-bottom: 8px;
}
.follow__line { position: absolute; left: 0; top: 0; white-space: nowrap; }
.field { display: block; }
.field__input {
  width: 100%;
  height: clamp(36px, 9vh, 42px);
  border: 1px solid var(--bordo);
  border-radius: 11px;
  background: #fbfbfa;
  padding: 0 12px;
  font-size: 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.field__input::placeholder { color: var(--testo-3); }
.field__input:focus { border-color: rgba(24,22,20,.28); background: #fff; box-shadow: 0 0 0 4px rgba(24,22,20,.05); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.chip {
  position: relative;
  height: 28px; padding: 0 11px;
  border-radius: 999px;
  font-size: 12.5px; color: var(--testo-2);
  box-shadow: inset 0 0 0 1px var(--bordo);
  overflow: hidden; isolation: isolate;
  transition: color .25s;
}
.chip__bg { position: absolute; inset: 0; border-radius: inherit; background: var(--inchiostro); transform: scale(0.2); opacity: 0; z-index: -1; }
.chip[aria-pressed="true"] { color: #fff; }
.chip:focus-visible { outline: 2px solid var(--testo); outline-offset: 2px; }
@media (hover: hover) { .chip:hover { color: var(--testo); } .chip[aria-pressed="true"]:hover { color: #fff; } }

.actions { display: flex; align-items: center; justify-content: space-between; margin-top: clamp(10px, 2.4vh, 14px); }
.count { font-size: 11.5px; color: var(--testo-3); }

/* ---- Send: the elastic pill (label widens on the wdth axis, the ground swells) ---- */
.send {
  position: relative;
  height: 40px; padding: 0 16px 0 18px;
  display: inline-flex; align-items: center; gap: 8px;
  color: #fff; font-size: 14px; font-weight: 560;
  isolation: isolate;
}
.send__bg { position: absolute; inset: 0; border-radius: 999px; background: var(--inchiostro); z-index: -1; box-shadow: 0 6px 14px -6px rgba(24,22,20,.45); }
.send__label { font-stretch: 100%; transition: font-stretch .45s cubic-bezier(.34,1.56,.64,1); }
.send__arrow { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.send:focus-visible { outline: 2px solid var(--testo); outline-offset: 3px; border-radius: 999px; }
@media (hover: hover) { .send:hover .send__label { font-stretch: 112%; } }

/* ---- thanks ---- */
.tick { width: 44px; height: 44px; margin-bottom: 10px; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.tick circle { stroke: var(--tinta, var(--accento)); stroke-width: 1.6; stroke-dasharray: 1; stroke-dashoffset: 1; }
.tick path { stroke: var(--tinta, var(--accento)); stroke-width: 2.2; stroke-dasharray: 1; stroke-dashoffset: 1; }
.thanks__t { font-size: 17px; font-weight: 600; letter-spacing: -0.015em; }
.thanks__s { margin-top: 4px; font-size: 13px; color: var(--testo-2); }
.again { margin-top: 12px; font-size: 12.5px; color: var(--testo-2); padding: 4px 6px; border-radius: 7px; text-decoration: none; transition: color .2s; }

/* ---- the folded state ---- */
.pill-wrap { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.pill {
  pointer-events: auto;
  height: 40px; padding: 0 16px;
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: 999px; background: var(--carta);
  box-shadow: 0 0 0 1px var(--bordo), 0 10px 22px -10px rgba(24,22,20,.25);
  font-size: 13.5px; font-weight: 560;
  visibility: hidden;
}
.pill svg { width: 15px; height: 15px; fill: none; stroke: var(--testo); stroke-width: 1.5; stroke-linejoin: round; }
.pill:focus-visible { outline: 2px solid var(--testo); outline-offset: 3px; }
