:root {
  --bg: #ffffff;
  --pill-hi: #2a2e31;
  --pill-lo: #111315;
  --ink: #f4f6f2;
  --soft: rgba(244, 246, 242, 0.56);
  --volt: #c8f53c;
  --volt-ink: #11140a;
  --saved: #7fe0ff;
}

*, *::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;
  place-items: center;
  padding: 16px;
}

/* the pill: GSAP owns its width, scale and y; the inner layers carry the CSS */
.run {
  position: relative;
  width: 264px;
  max-width: calc(100vw - 32px);
  height: 60px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px 0 8px;
  border: 0;
  border-radius: 99px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  isolation: isolate;
  box-shadow:
    0 1px 1px rgba(17, 19, 21, 0.22),
    0 8px 18px -8px rgba(17, 19, 21, 0.45),
    0 26px 50px -26px rgba(17, 19, 21, 0.55);
  transition: box-shadow 0.6s ease;
}
.run.is-live {
  box-shadow:
    0 1px 1px rgba(17, 19, 21, 0.22),
    0 8px 18px -8px rgba(17, 19, 21, 0.45),
    0 22px 46px -18px color-mix(in srgb, var(--volt) 85%, transparent),
    0 0 0 1px color-mix(in srgb, var(--volt) 26%, transparent);
}
.run.is-saved {
  box-shadow:
    0 1px 1px rgba(17, 19, 21, 0.22),
    0 8px 18px -8px rgba(17, 19, 21, 0.45),
    0 22px 46px -18px color-mix(in srgb, var(--saved) 80%, transparent);
}
.run:focus-visible { outline: 2px solid #111315; outline-offset: 4px; }

.run__body {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(255, 255, 255, 0.08), transparent 55%),
    linear-gradient(180deg, var(--pill-hi), var(--pill-lo));
  z-index: -2;
}
.run__light { position: absolute; inset: 0; background: radial-gradient(120px 70px at var(--px, 50%) var(--py, 0%), rgba(255, 255, 255, 0.13), transparent 70%); opacity: 0; transition: opacity 0.3s ease; }
.run.is-hot .run__light { opacity: 1; }
/* the light that crosses the pill when the run is saved */
.run__sweep { position: absolute; top: -20%; bottom: -20%; left: 0; width: 46%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.2) 45%, rgba(255, 255, 255, 0.34) 50%, rgba(255, 255, 255, 0.2) 55%, transparent); transform: translateX(-120%) skewX(-14deg); opacity: 0; }
.run__edge {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.06) 42%, rgba(255, 255, 255, 0.02) 70%, rgba(255, 255, 255, 0.12));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: -1;
}

/* the seat: a volt disc with the arrow, the stop, the pause or the tick, and the hold ring around it */
.seat { position: relative; flex: none; width: 44px; height: 44px; display: grid; place-items: center; }
.seat__disc {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(90% 90% at 30% 22%, #e6ff8a, var(--volt) 55%, color-mix(in srgb, var(--volt) 78%, #4d6b00));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), inset 0 -2px 4px rgba(40, 60, 0, 0.25), 0 2px 6px -2px rgba(0, 0, 0, 0.6);
  transition: background 0.45s ease;
}
.run.is-seeking .seat__disc { background: radial-gradient(90% 90% at 30% 22%, #4a5055, #2d3236 60%, #1d2023); }
.run.is-paused .seat__disc { background: radial-gradient(90% 90% at 30% 22%, #ffffff, #e9ece6 60%, #cfd3cb); }
.run.is-saved .seat__disc { background: radial-gradient(90% 90% at 30% 22%, #d9f6ff, var(--saved) 58%, color-mix(in srgb, var(--saved) 70%, #00506b)); }
.seat__hold { position: absolute; inset: -4px; width: 52px; height: 52px; overflow: visible; pointer-events: none; }
.seat__holdtrack { fill: none; stroke: rgba(255, 255, 255, 0.12); stroke-width: 2; opacity: 0; }
.seat__holdring { fill: none; stroke: #ffffff; stroke-width: 2.2; stroke-linecap: butt; stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; }
.seat__icon { position: relative; width: 24px; height: 24px; overflow: visible; }
.seat__arrow { fill: var(--volt-ink); stroke: var(--volt-ink); stroke-width: 1.4; stroke-linejoin: round; transition: fill 0.3s ease, stroke 0.3s ease; }
.run.is-seeking .seat__arrow { fill: var(--volt); stroke: var(--volt); }
.seat__stop { fill: var(--volt-ink); opacity: 0; }
.seat__pause { fill: var(--volt-ink); opacity: 0; }
.seat__tick { fill: none; stroke: #062330; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }

.label { flex: 1; min-width: 0; display: grid; gap: 1px; }
.label__main { height: 21px; overflow: hidden; font-size: 16px; line-height: 21px; font-weight: 640; font-stretch: 106%; letter-spacing: -0.01em; }
.label__sub { height: 15px; overflow: hidden; font-size: 11.5px; line-height: 15px; font-weight: 500; font-stretch: 100%; color: var(--soft); }
.label span span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.run.is-live .label__main, .run.is-paused .label__main { font-size: 19px; font-weight: 680; font-stretch: 112%; letter-spacing: -0.02em; }
.run.is-live .label__main span { color: var(--volt); }

/* the right slot: the chevron, the GPS bars or the route, one at a time */
.slot { position: relative; flex: none; width: 64px; height: 32px; }
.slot > * { position: absolute; }
.slot__go { right: 0; top: 4px; width: 24px; height: 24px; fill: none; stroke: var(--soft); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.slot__bars { right: 4px; bottom: 7px; display: flex; align-items: flex-end; gap: 3px; opacity: 0; }
.slot__bars i { display: block; width: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.16); transform-origin: 50% 100%; }
.slot__bars i:nth-child(1) { height: 6px; }
.slot__bars i:nth-child(2) { height: 10px; }
.slot__bars i:nth-child(3) { height: 14px; }
.slot__bars i:nth-child(4) { height: 18px; }
.slot__route { inset: 0; width: 64px; height: 32px; overflow: visible; opacity: 0; }
.slot__track, .slot__line { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.slot__track { stroke: rgba(255, 255, 255, 0.13); stroke-width: 2; stroke-dasharray: 0.1 3.4; }
.slot__line { stroke: var(--volt); stroke-width: 2.2; }
.slot__head { fill: #ffffff; }
.run.is-saved .slot__line { stroke: var(--saved); }

/* the countdown: a white number on the dark pill and a dark one on the volt wipe, clipped together */
.count { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; opacity: 0; }
.count__n { display: block; font-size: 25px; line-height: 1; font-weight: 720; font-stretch: 118%; letter-spacing: -0.02em; color: var(--ink); }
.wipe {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(120% 160% at 50% 0%, #e2ff7c, var(--volt) 60%, color-mix(in srgb, var(--volt) 84%, #4d6b00));
  clip-path: inset(0% 100% 0% 0% round 30px);
  pointer-events: none;
  opacity: 0;
}
.wipe .count { opacity: 1; }
.count--ink .count__n { color: var(--volt-ink); }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.ghost {
  position: fixed;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  pointer-events: none;
  fill: #ffffff;
  stroke: #14151a;
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.28));
  opacity: 0;
  visibility: hidden;
  z-index: 5;
}
