:root {
  --fondo: #ffffff;
  --inchiostro: #0b0b0c;
  --grigio: #71717a;
  --grigio-chiaro: #a1a1aa;
  --strada: rgba(255, 255, 255, 0.3);
  --segno: #3d7bff;
  --fari: #fff4d6;
  --stop: #ff4b3e;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--fondo);
  color: var(--inchiostro);
  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;
}

.park {
  display: grid;
  justify-items: center;
  gap: 18px;
  min-width: min(300px, calc(100vw - 32px));
}

/* the line with the street and the rate above the button */
.where {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--grigio);
  white-space: nowrap;
}
.where__brand { color: var(--inchiostro); font-weight: 650; }
.where__dot { width: 3px; height: 3px; border-radius: 2px; background: var(--grigio-chiaro); opacity: 0.7; }

.pill {
  position: relative;
  width: 168px;
  height: 64px;
  border-radius: 32px;
  overflow: hidden;
  isolation: isolate;
  color: #fff;
  box-shadow: 0 1px 2px rgba(11, 11, 12, 0.2), 0 12px 24px -12px rgba(11, 11, 12, 0.6);
  -webkit-tap-highlight-color: transparent;
}
.pill:focus-visible { outline: 2px solid var(--segno); outline-offset: 3px; }
.pill__ink {
  position: absolute; inset: 0;
  background: radial-gradient(120% 140% at 50% 0%, #1c1c20 0%, var(--inchiostro) 60%);
  z-index: 0;
}

/* the little street inside the pill: the road line, the parking bay and the P sign */
.pill__street { position: absolute; inset: 0; z-index: 1; }
.road {
  position: absolute;
  left: 20px; right: 20px; bottom: 10px;
  height: 1.5px;
  background: repeating-linear-gradient(90deg, var(--strada) 0 8px, transparent 8px 14px);
  opacity: 0;
}
.bay {
  position: absolute;
  right: 30px; bottom: 9px;
  width: 86px; height: 5px;
  opacity: 0;
}
.bay i {
  position: absolute; bottom: 0;
  width: 1.5px; height: 5px;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.55);
}
.bay i:first-child { left: 0; }
.bay i:last-child { right: 0; }
.sign {
  position: absolute;
  right: 17px; bottom: 10px;
  width: 13px; height: 40px;
  opacity: 0;
  transform-origin: 50% 100%;
}
.sign__post {
  position: absolute; left: 5.7px; bottom: 0;
  width: 1.6px; height: 28px;
  border-radius: 1px;
  background: linear-gradient(90deg, #8b8d94, #d4d5da 50%, #7d7f86);
}
.sign__plate { position: absolute; left: 0; top: 0; width: 13px; height: 13px; overflow: visible; }
.sign__plate rect, .face__p rect { fill: var(--segno); stroke: rgba(255, 255, 255, 0.85); stroke-width: 1; }
.sign__plate path, .face__p path { fill: none; stroke: #fff; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.face {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  gap: 10px;
  white-space: nowrap;
  z-index: 3;
}
.face__label { font-size: 15.5px; font-weight: 600; font-variation-settings: "wdth" 100; letter-spacing: -0.005em; }
.face__p { width: 18px; height: 18px; overflow: visible; }
.face--done { opacity: 0; justify-content: flex-start; padding-left: 22px; gap: 9px; }
.done__label { font-size: 15px; font-weight: 650; }
.done__sep { width: 3px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.55); }

/* the timer: every character sits in its own small window, so a changed digit can roll */
.timer { display: inline-flex; font-size: 15px; font-weight: 500; font-variation-settings: "wdth" 96; color: rgba(255, 255, 255, 0.86); }
.timer__c { position: relative; display: inline-block; height: 1.25em; line-height: 1.25em; overflow: hidden; text-align: center; }
.timer__c span { display: block; }
.timer__c--d { width: 0.62em; }
.timer__c--s { width: 0.3em; }

/* the car: inside the pill, so it is clipped by the edges as it drives in and out */
.car {
  position: absolute;
  left: 0; top: 0;
  width: 72px; height: 34px;
  z-index: 4;
  pointer-events: none;
}
.car__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.car__shadow {
  position: absolute;
  left: 4px; right: 3px; bottom: -1px;
  height: 4px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.75);
  filter: blur(1.6px);
}
.car__beam {
  position: absolute;
  left: 67px; top: 15px;
  width: 56px; height: 19px;
  background: linear-gradient(90deg, rgba(255, 244, 214, 0.42), rgba(255, 244, 214, 0));
  clip-path: polygon(0 28%, 100% 0, 100% 100%, 0 52%);
  filter: blur(1.2px);
  opacity: 0;
  transform-origin: 0 40%;
}
.car__glow--tail {
  position: absolute;
  left: -5px; top: 13px;
  width: 14px; height: 11px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 75, 62, 0.9), rgba(255, 75, 62, 0));
  opacity: 0;
}
.puff {
  position: absolute;
  left: -2px; top: 23px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(220, 220, 228, 0.55), rgba(220, 220, 228, 0));
  opacity: 0;
}

.body__arches { fill: none; stroke: #121318; stroke-width: 1.6; }
.body__shell { stroke: rgba(0, 0, 0, 0.18); stroke-width: 0.4; }
.body__shine { stroke: rgba(255, 255, 255, 0.45); stroke-width: 1.1; stroke-linecap: round; fill: none; }
.body__pillar { stroke: #c9cbd1; stroke-width: 1.4; }
.body__line { fill: none; stroke: rgba(20, 22, 28, 0.22); stroke-width: 0.5; }
.body__handle { stroke: rgba(20, 22, 28, 0.45); stroke-width: 0.9; stroke-linecap: round; }
.body__mirror { fill: #c7c9cf; }
.body__head { fill: var(--fari); }
.body__tail { fill: #c4372e; }
.body__sill { stroke: rgba(20, 22, 28, 0.3); stroke-width: 0.7; }
.wheel__tyre { fill: #101114; stroke: #2a2c33; stroke-width: 0.5; }
.wheel__spokes path { stroke: #6f727b; stroke-width: 0.9; stroke-linecap: round; }
.wheel__hub { fill: #e9eaee; stroke: #6f727b; stroke-width: 0.4; }

.note {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px;
  color: var(--grigio);
  opacity: 0;
  white-space: nowrap;
}
.note svg { width: 14px; height: 14px; fill: none; stroke: var(--segno); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; display: none; }
.note--ok svg { display: block; }

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

@media (max-width: 360px) {
  .where { font-size: 11px; gap: 5px; }
}
