:root {
  /* the page is pure black, the night of the show; the flat code keeps its own white sheet with the quiet zone */
  --carta: #000000;
  --testo: #f3efe6;
  --sbiadito: #8e8a82;
  --filo: rgba(243, 239, 230, 0.17);
  --pieno: #f3efe6;
  --sul-pieno: #000000;
  --fuoco: #ffb43b;
  --e-elastico: cubic-bezier(0.34, 1.8, 0.64, 1);
  --e-uscita: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: var(--carta);
  color: var(--testo);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

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

.studio {
  width: min(680px, 100%);
  display: grid;
  gap: 18px;
}

/* ------------------------------------------------------------------ the stage */
.palco {
  display: grid;
  gap: 6px;
}
.tavola {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 0.84;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
  outline: none;
}
.tavola:focus-visible {
  box-shadow: 0 0 0 2px var(--carta), 0 0 0 4px var(--testo);
}
.tela {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.cenno {
  margin: 0;
  height: 20px;
  overflow: hidden;
  text-align: center;
  font-size: 0.86rem;
  font-weight: 520;
  font-stretch: 112%;
  letter-spacing: 0.005em;
  color: var(--sbiadito);
}
.cenno__testo {
  display: inline-block;
}

/* ------------------------------------------------------------------ controls */
.comandi {
  width: min(520px, 100%);
  justify-self: center;
  display: grid;
  gap: 12px;
}
.riga {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.riga--azioni {
  justify-content: center;
  gap: 10px;
}
.riga--azioni .pillola--piena {
  flex: 1 1 100%;
}
.riga--azioni .pillola--vuota {
  flex: 1 1 0;
  min-width: 0;
}

/* the first choice: radios on one track, the cursor slides under the chosen one */
.ore {
  position: relative;
  display: flex;
  padding: 4px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--filo);
}
.ore__cursore {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: 60px;
  border-radius: 999px;
  background: var(--pieno);
  pointer-events: none;
}
.ora {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 12px 0 10px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--testo);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  font-stretch: 100%;
  white-space: nowrap;
  cursor: pointer;
  transition: font-stretch 0.5s var(--e-elastico), color 0.25s ease;
}
.ora svg {
  width: 16px;
  height: 16px;
  flex: none;
}
.ora[aria-checked='true'] {
  color: var(--sul-pieno);
}
.ora:focus-visible,
.tinta:focus-visible,
.pillola:focus-visible {
  outline: 2px solid var(--testo);
  outline-offset: 3px;
}
@media (hover: hover) and (pointer: fine) {
  .ora:not([aria-checked='true']):hover {
    font-stretch: 116%;
  }
}

/* the second choice: small swatches */
.tinte {
  display: flex;
  gap: 8px;
}
.tinta {
  position: relative;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--a), var(--b) 55%, var(--c));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: transform 0.5s var(--e-elastico);
}
.tinta::before {
  /* a tiny burst on every swatch: thin rays from the middle */
  content: '';
  position: absolute;
  inset: 5px;
  background:
    linear-gradient(0deg, transparent 44%, rgba(255, 255, 255, 0.85) 44% 56%, transparent 56%),
    linear-gradient(90deg, transparent 44%, rgba(255, 255, 255, 0.85) 44% 56%, transparent 56%),
    linear-gradient(45deg, transparent 46%, rgba(255, 255, 255, 0.6) 46% 54%, transparent 54%),
    linear-gradient(-45deg, transparent 46%, rgba(255, 255, 255, 0.6) 46% 54%, transparent 56%);
  border-radius: 50%;
  -webkit-mask: radial-gradient(circle, transparent 0 18%, #000 19% 100%);
  mask: radial-gradient(circle, transparent 0 18%, #000 19% 100%);
}
.tinta::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 11px;
  box-shadow: inset 0 0 0 1.5px var(--testo);
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.2s ease, transform 0.5s var(--e-elastico);
}
.tinta[aria-checked='true']::after {
  opacity: 1;
  transform: none;
}
@media (hover: hover) and (pointer: fine) {
  .tinta:hover {
    transform: translateY(-2px) rotate(-6deg);
  }
}
.tinta:active {
  transform: scale(0.9);
}

/* the address */
.indirizzo {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 56px;
  padding: 4px 4px 4px 14px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--filo);
}
.indirizzo:focus-within {
  box-shadow: inset 0 0 0 1.5px var(--testo);
}
.indirizzo__segno {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--sbiadito);
}
.indirizzo__campo {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--testo);
  font: inherit;
  font-size: 1rem;
  font-weight: 500;
  font-stretch: 96%;
  outline: none;
}
.indirizzo__campo::selection {
  background: color-mix(in srgb, var(--fuoco) 30%, transparent);
}

/* the elastic pill: the fill swells with a bounce, the label widens on the wdth axis */
.pillola {
  --pb: var(--pieno);
  --pt: var(--sul-pieno);
  --pbordo: 0 0 0 transparent;
  --gonfia: 6px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--pt);
  font: inherit;
  font-size: 0.94rem;
  font-weight: 640;
  font-stretch: 100%;
  letter-spacing: -0.005em;
  white-space: nowrap;
  cursor: pointer;
  isolation: isolate;
  flex: none;
}
.pillola::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--pb);
  box-shadow: var(--pbordo);
  transition: inset 0.6s var(--e-elastico), transform 0.25s var(--e-uscita);
}
.pillola__testo {
  display: inline-grid;
  text-align: center;
  transition: font-stretch 0.6s var(--e-elastico);
}
.pillola__testo::before {
  content: attr(data-testo);
  grid-area: 1 / 1;
  height: 0;
  overflow: hidden;
  visibility: hidden;
  font-stretch: 122%;
}
.pillola__segno {
  width: 18px;
  height: 18px;
  flex: none;
  transition: transform 0.6s var(--e-elastico);
}
.pillola--vuota {
  --pb: transparent;
  --pt: var(--testo);
  --pbordo: inset 0 0 0 1px var(--filo);
}
.pillola[hidden] {
  display: none;
}
.pillola[aria-busy='true'] {
  cursor: progress;
}
.pillola[aria-busy='true'] .pillola__testo {
  opacity: 0.6;
}
.indirizzo .pillola {
  --gonfia: 1px;
}
@media (hover: hover) and (pointer: fine) {
  .pillola:hover::before {
    inset: -2px calc(var(--gonfia) * -1);
  }
  .pillola:hover .pillola__testo {
    font-stretch: 122%;
  }
  .pillola:hover .pillola__segno {
    transform: translateY(2px);
  }
  .pillola:hover .pillola__segno--anima {
    transform: translateX(1px) scale(1.08);
  }
  .pillola--vuota:hover {
    --pbordo: inset 0 0 0 1.5px var(--testo);
  }
}
.pillola:active::before {
  transform: scale(1.03, 0.88);
}

@media (max-width: 460px) {
  .studio { gap: 14px; }
  .riga--scelte { justify-content: center; }
  .ora { padding: 0 9px 0 7px; font-size: 0.8rem; font-stretch: 90%; }
  .pillola { padding: 0 18px; }
  .riga--azioni { gap: 8px; }
  .riga--azioni .pillola--vuota { padding: 0 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .ora,
  .tinta,
  .tinta::after,
  .pillola::before,
  .pillola__testo,
  .pillola__segno {
    transition: opacity 0.2s ease, color 0.2s ease;
  }
}

/* ------------------------------------------------------------------ the preview (?anteprima=1): only the stage, square */
.anteprima body {
  padding: 0;
  overflow: hidden;
}
.anteprima .studio {
  width: 100vw;
  height: 100vh;
  display: block;
}
.anteprima .palco {
  display: block;
  height: 100%;
}
.anteprima .tavola {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  border-radius: 0;
  cursor: default;
}
.anteprima .cenno,
.anteprima .comandi {
  display: none;
}

/* ------------------------------------------------------------------ the animation on its own (the downloaded zip:
   class solo-palco on <html>): only the stage and the hint, as big as the window allows, centred, never cut */
.solo-palco,
.solo-palco body {
  height: 100%;
  overflow: hidden;
}
.solo-palco body {
  min-height: 0;
  height: 100vh;
  height: 100svh;
  display: block;
  padding: clamp(10px, 3vmin, 32px);
}
.solo-palco .studio {
  width: 100%;
  height: 100%;
  display: block;
}
.solo-palco .palco {
  height: 100%;
  grid-template-rows: minmax(0, 1fr) auto;
}
.solo-palco .tavola {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
}
.solo-palco .comandi {
  display: none;
}
