:root {
  --bg: #ffffff;
  --ink: #17171a;
  --soft: rgba(23, 23, 26, 0.55);
  --line: rgba(23, 23, 26, 0.1);
  --accent: #4d5dfb;
}

*, *::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; }

.pt { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); width: min(280px, 100%); }

/* the count: one column per digit, each rolls by itself */
.pt__count { display: flex; align-items: baseline; gap: 8px; }
.pt__digits { display: flex; font-size: clamp(34px, 11vh, 44px); line-height: 1; font-weight: 740; font-stretch: 84%; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.pt__digits span { display: block; height: 1em; overflow: hidden; contain: paint; }
.pt__digits b { display: block; font-weight: inherit; }
.pt__of { font-size: 13px; color: var(--soft); white-space: nowrap; }
.pt__of b { font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }

.pt__track { position: relative; display: block; height: 8px; margin-top: 12px; border-radius: 4px; background: rgba(23, 23, 26, 0.08); overflow: hidden; }
.pt__track i:first-child { display: block; height: 100%; border-radius: 4px; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }
.pt__spark { position: absolute; top: 0; bottom: 0; left: 0; width: 34px; margin-left: -34px; background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.75)); opacity: 0; }

.pt__people { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; height: 30px; margin-top: 14px; }
.pt__faces { display: flex; align-items: center; }
.pt__faces i { position: relative; display: grid; place-items: center; flex: none; width: 28px; height: 28px; margin-left: -8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px var(--bg); font-style: normal; font-size: 10px; font-weight: 720; letter-spacing: 0.01em; color: rgba(23, 23, 26, 0.8); }
.pt__faces .pt__you { --c: var(--accent); z-index: 1; width: 0; margin-left: 0; color: #ffffff; opacity: 0; overflow: hidden; box-shadow: none; }
.pt__faces .pt__you + i { margin-left: 0; }
.pt[data-state="done"] .pt__faces .pt__you { box-shadow: 0 0 0 2px var(--bg); }
.pt[data-state="done"] .pt__faces .pt__you + i { margin-left: -8px; }
.pt__names { display: block; height: 16px; overflow: hidden; font-size: 12px; line-height: 16px; color: var(--soft); white-space: nowrap; text-overflow: ellipsis; }
.pt__names span { display: block; overflow: hidden; text-overflow: ellipsis; }

/* the pill */
.pt__btn { position: relative; width: 100%; height: 52px; margin-top: 18px; border-radius: 26px; background: var(--ink); color: #ffffff; overflow: hidden; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 18px 28px -18px rgba(23, 23, 26, 0.7); }
.pt__btn:focus-visible { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.pt__face { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 9px; font-size: 15.5px; font-weight: 700; white-space: nowrap; }
.pt__face svg { display: block; flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.600; stroke-linecap: round; stroke-linejoin: round; }
.pt__face--done { opacity: 0; }
.pt__face--done path { stroke-dasharray: 1; stroke-dashoffset: 1; stroke-width: 2.200; }
.pt__ink { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: #ffffff; stroke-width: 1.800; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.pt__ink path { stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; }

/* an empty box as big as the whole piece: the preview frames this */
.frame { position: absolute; left: 50%; top: 50%; width: 300px; height: 214px; margin: -107px 0 0 -150px; pointer-events: none; }
.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; }
