:root {
  --fondo: #fafafa;
  --card: #ffffff;
  --inchiostro: #111113;
  --grigio: #6f6f77;
  --grigio-chiaro: #a1a1aa;
  --bordo: rgba(17, 17, 19, 0.09);
  --campo: #f4f4f5;
  --accento: #2563eb;
  --accento-velo: rgba(37, 99, 235, 0.18);
  --mappa: #eef0f2;
  --isolato: #e2e5e9;
  --strada: #ffffff;
  --parco: #dcebdd;
  --acqua: #d9e6f5;
  --auto-altre: #b9bcc4;
}

* { 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;
}

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

/* ---------- the ride card ---------- */
.rd {
  position: relative;
  width: min(360px, 100%);
  background: var(--card);
  border: 1px solid var(--bordo);
  border-radius: 22px;
  padding: clamp(12px, 3.4vmin, 16px);
  box-shadow: 0 1px 2px rgba(17, 17, 19, 0.04), 0 18px 48px -18px rgba(17, 17, 19, 0.16);
}

.rd__head { display: flex; align-items: center; gap: 10px; }
.rd__mark {
  flex: none; width: 28px; height: 28px; padding: 4px; border-radius: 8px;
  background: var(--inchiostro);
  fill: none; stroke: #fff; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}
.rd__brand { font-size: 14.5px; font-weight: 640; letter-spacing: -0.01em; flex: 1; }
.rd__brand span { color: var(--grigio-chiaro); font-weight: 500; }
.rd__state {
  font-size: 11.5px; font-weight: 600; color: var(--grigio);
  padding: 3px 9px; border-radius: 99px; background: var(--campo); border: 1px solid var(--bordo);
  white-space: nowrap; overflow: hidden;
}
.rd__state.is-on { color: var(--accento); background: rgba(37, 99, 235, 0.08); border-color: rgba(37, 99, 235, 0.22); }

/* ---------- the map ---------- */
.map {
  position: relative;
  margin-top: clamp(10px, 2.8vmin, 14px);
  height: clamp(92px, 25vh, 158px);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--bordo);
  background: var(--mappa);
}
.map__svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.m-ground { fill: var(--mappa); }
.m-water { fill: var(--acqua); }
.m-park { fill: var(--parco); }
.m-blocks rect { fill: var(--isolato); }
.m-roads path { fill: none; stroke: var(--strada); stroke-width: 9; }
.m-lines path { fill: none; stroke: rgba(17, 17, 19, 0.06); stroke-width: 0.6; stroke-dasharray: 3 4; }
.m-cross path { fill: none; stroke: #fff; stroke-width: 1.4; }
.m-roads + .m-cross path { stroke: rgba(17, 17, 19, 0.08); }
.m-trees circle { fill: #c9e0cb; }
.m-name { font-size: 5.6px; font-weight: 600; fill: #9a9ea8; letter-spacing: 0.02em; }
.m-name--park { fill: #7fa184; font-style: italic; font-weight: 500; }

.route, .route__glow { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.route { stroke: var(--accento); stroke-width: 3; }
.route__glow { stroke: var(--accento-velo); stroke-width: 8; }

.pin__body { fill: var(--inchiostro); }
.pin__hole { fill: #fff; }
.pin__shadow { fill: rgba(17, 17, 19, 0.18); }
.tag rect { fill: #fff; stroke: rgba(17, 17, 19, 0.1); stroke-width: 0.6; }
.tag text { font-size: 6px; font-weight: 640; fill: var(--inchiostro); text-anchor: middle; }

.car__shadow { fill: rgba(17, 17, 19, 0.14); }
.car__body { fill: var(--inchiostro); }
.car__glass { fill: rgba(255, 255, 255, 0.62); }
.car__glass--back { fill: rgba(255, 255, 255, 0.4); }
.car__roof { fill: rgba(255, 255, 255, 0.08); }
.car__light { fill: #ffe9a8; }
.car--other .car__body { fill: var(--auto-altre); }
.car--other .car__light { fill: #fff; }

/* ---------- from and to ---------- */
.trip { margin-top: clamp(8px, 2.4vmin, 12px); display: grid; gap: 4px; }
.trip p { display: flex; align-items: baseline; gap: 10px; font-size: 13px; }
.trip__k { width: 34px; flex: none; font-size: 11.5px; color: var(--grigio-chiaro); font-weight: 560; }
.trip__v { font-weight: 560; }

/* ---------- the option, the button and the driver card share one zone ---------- */
.zone { position: relative; margin-top: clamp(10px, 2.8vmin, 14px); }

.opt { display: flex; align-items: center; gap: 10px; padding: 0 2px; }
.opt__ico {
  flex: none; width: 34px; height: 34px; padding: 6px; border-radius: 10px;
  background: var(--campo); border: 1px solid var(--bordo);
  fill: none; stroke: var(--inchiostro); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.opt__name { flex: 1; display: grid; font-size: 14px; font-weight: 640; line-height: 1.2; }
.opt__name span { font-size: 11.5px; font-weight: 500; color: var(--grigio); }
.opt__price { font-size: 15px; font-weight: 660; letter-spacing: -0.01em; }

.shape {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 44px; border-radius: 22px;
  background: var(--inchiostro);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset, 0 8px 18px -8px rgba(17, 17, 19, 0.55);
  transition: box-shadow 0.25s;
}
.shape.is-hover { box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset, 0 12px 22px -8px rgba(17, 17, 19, 0.6); }

.req {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 16px;
  border: 0; border-radius: 22px; background: transparent; color: #fff;
  font: inherit; font-size: 14px; font-weight: 600;
  white-space: nowrap; overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.req:focus-visible { outline: 2px solid var(--accento); outline-offset: 3px; }
.req__icon { position: relative; width: 20px; height: 20px; flex: none; }
.req__icon svg { position: absolute; inset: 0; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.req__ring { opacity: 0; }
.ring__bg { stroke: rgba(255, 255, 255, 0.22); }
.ring__fg { stroke: #fff; stroke-dasharray: 14 34; transform-origin: 12px 12px; }
.req__label { position: relative; display: inline-block; }

.drv {
  position: absolute; inset: 0;
  display: grid; align-content: space-between;
  padding: 12px 12px 12px 14px;
  color: #fff;
  visibility: hidden;
}
.drv__top { display: flex; align-items: center; gap: 10px; }
.drv__face {
  flex: none; display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(140deg, #4f7cf0, #9b6be0);
  font-size: 12.5px; font-weight: 680; letter-spacing: 0.02em;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.14);
}
.drv__who { flex: 1; display: grid; font-size: 14px; font-weight: 640; line-height: 1.25; }
.drv__who span { display: flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 520; color: rgba(255, 255, 255, 0.62); }
.drv__who svg { width: 11px; height: 11px; fill: #f5c451; }

.eta { position: relative; min-width: 66px; height: 30px; text-align: right; }
.eta__num { display: inline-flex; align-items: baseline; justify-content: flex-end; gap: 4px; height: 30px; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; line-height: 30px; }
.eta__roll { position: relative; display: inline-block; height: 30px; overflow: hidden; min-width: 0.62em; text-align: right; }
.eta__roll span { display: block; }
.eta__unit { font-size: 12px; font-weight: 560; color: rgba(255, 255, 255, 0.62); letter-spacing: 0; }
.eta__check { position: absolute; right: 0; top: 2px; width: 26px; height: 26px; fill: none; stroke: #6ee7a8; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }

.drv__bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.drv__car { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 12px; color: rgba(255, 255, 255, 0.7); white-space: nowrap; }
.drv__car > span:first-child { overflow: hidden; text-overflow: ellipsis; }
.plate {
  flex: none;
  padding: 2px 6px; border-radius: 5px;
  background: #fff; color: var(--inchiostro);
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  font-stretch: 92%;
  box-shadow: 0 0 0 1px rgba(17, 17, 19, 0.6) inset;
}
.drv__btn {
  flex: none;
  height: 30px; padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 99px;
  background: rgba(255, 255, 255, 0.06); color: #fff;
  font: inherit; font-size: 12.5px; font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s, border-color 0.2s;
}
.drv__btn.is-hover { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.4); }
@media (hover: hover) { .drv__btn:hover { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.4); } }
.drv__btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

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

@media (max-height: 470px) {
  .trip { display: none; }
}
