:root {
  --bg: #f3f1ec;
  --card: #fffdf9;
  --ink: #1c1b19;
  --soft: rgba(28, 27, 25, 0.56);
  --line: rgba(28, 27, 25, 0.12);
  --accent: #128a5e;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 10px 12px;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; outline: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

.cp { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); width: min(356px, 100%); padding: 16px 16px 14px; border-radius: 26px; background: var(--card); box-shadow: 0 0 0 1px var(--line), inset 0 1px 0 #ffffff, 0 34px 50px -34px rgba(50, 40, 20, 0.45), 0 4px 10px -6px rgba(50, 40, 20, 0.2); }
.cp__head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.cp__title { display: grid; gap: 2px; }
.cp__title strong { font-size: 16px; font-weight: 720; letter-spacing: -0.012em; white-space: nowrap; }
.cp__title span { font-size: 12px; color: var(--soft); white-space: nowrap; }

/* the four seats of the car */
.cp__seats { display: flex; gap: 4px; }
.cp__seats i { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 9px 9px 11px 11px; box-shadow: inset 0 0 0 1.500px rgba(28, 27, 25, 0.18); font-style: normal; font-size: 9px; font-weight: 740; color: transparent; }
.cp__seats i.is-on { background: var(--ink); color: #ffffff; box-shadow: none; }
.cp__seats i.is-on.is-you { background: var(--accent); }

.cp__map { margin-top: 10px; border-radius: 16px; background: #f4f1ea; box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.cp__map svg { display: block; width: 100%; height: auto; max-height: 36vh; }
.cp__road { fill: none; stroke: rgba(28, 27, 25, 0.14); stroke-width: 5; stroke-linecap: round; }
.cp__done { fill: none; stroke: var(--accent); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.cp__ends circle, .cp__ends rect { fill: var(--ink); }
.cp__end { fill: var(--soft); font-size: 9.500px; font-weight: 600; }
.cp__stop circle { fill: var(--card); stroke: rgba(28, 27, 25, 0.35); stroke-width: 2; }
.cp__stop text { fill: var(--soft); font-size: 9.500px; font-weight: 640; text-anchor: middle; }
.cp__stop.is-on circle { stroke: var(--accent); }
.cp__stop.is-on text { fill: var(--ink); }
.cp__stop.is-maybe circle { stroke-dasharray: 2.600 2.400; }
.cp__stop.is-maybe text { opacity: 0.6; }
.cp__car circle:first-child { fill: var(--ink); stroke: var(--card); stroke-width: 2.500; }
.cp__dot { fill: #ffffff; }

.cp__foot { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; margin-top: 12px; }
.cp__stat { display: grid; gap: 1px; }
.cp__state { display: block; height: 18px; overflow: hidden; font-size: 13.500px; line-height: 18px; font-weight: 680; white-space: nowrap; }
.cp__state span { display: block; }
.cp__saved { font-size: 11.500px; color: var(--soft); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cp__saved b { font-weight: 700; color: var(--accent); }
.cp__btn { position: relative; width: 124px; height: 44px; border-radius: 22px; background: var(--ink); color: #ffffff; overflow: hidden; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 12px 18px -12px rgba(28, 27, 25, 0.7); }
.cp[data-joined="true"] .cp__btn { background: var(--accent); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 12px 18px -12px var(--accent); }
.cp__btn:focus-visible { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--ink); }
.cp__face { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 13.500px; font-weight: 700; white-space: nowrap; opacity: 0; }
.cp__face[data-face="ask"] { opacity: 1; }
.cp__face svg { display: block; flex: none; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.200; stroke-linecap: round; stroke-linejoin: round; }
.cp__face path { stroke-dasharray: 1; stroke-dashoffset: 1; }

.live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ghost { position: absolute; left: 0; top: 0; width: 24px; height: 24px; margin: -3px 0 0 -5px; transform-origin: 20% 15%; pointer-events: none; opacity: 0; fill: #17171a; stroke: #ffffff; stroke-width: 1.300; stroke-linejoin: round; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3)); z-index: 6; }
