:root {
  --bg: #000000;
  --pill: #f3f2ee;
  --ink: #131417;
  --soft: rgba(19, 20, 23, 0.52);
  --go: #3ddc84;
}

*, *::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: 16px;
}
.live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.tn {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 12px;
  width: min(292px, 100%);
  height: 64px;
  padding: 0 18px 0 8px;
  border: 0;
  border-radius: 32px;
  /* --t goes from 0 to 1 when it is your turn: the pill passes from paper to green */
  background: color-mix(in srgb, var(--go) calc(var(--t, 0) * 100%), var(--pill));
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), inset 0 -2px 0 rgba(19, 20, 23, 0.08), 0 18px 40px -18px color-mix(in srgb, var(--go) calc(var(--t, 0) * 70%), rgba(255, 255, 255, 0.25));
}
.tn:focus-visible { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--pill); }
.tn[aria-busy="true"] { cursor: default; }

/* the slot: a dark tile with a slit, the ticket feeds upwards out of it */
.tn__slot { position: relative; width: 48px; height: 48px; border-radius: 24px; background: var(--ink); overflow: hidden; }
.tn__slit { position: absolute; left: 11px; right: 11px; bottom: 11px; height: 3px; border-radius: 2px; background: #000000; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.16); }
.tn__paper { position: absolute; left: 13px; right: 13px; bottom: 13px; height: 27px; overflow: hidden; }
.tn__paper b {
  display: grid;
  place-items: center;
  width: 100%;
  height: 27px;
  padding-top: 2px;
  border-radius: 2px 2px 0 0;
  background: #ffffff;
  font-size: 8.5px;
  font-weight: 760;
  letter-spacing: 0.02em;
  color: var(--ink);
  /* a pinked top edge, like a ticket torn off a roll */
  clip-path: polygon(0 3px, 8% 0, 17% 3px, 25% 0, 33% 3px, 42% 0, 50% 3px, 58% 0, 67% 3px, 75% 0, 83% 3px, 92% 0, 100% 3px, 100% 100%, 0 100%);
}

.tn__text { min-width: 0; display: grid; gap: 1px; }
.tn__line { display: block; overflow: hidden; white-space: nowrap; }
.tn__line span { display: block; overflow: hidden; text-overflow: ellipsis; }
.tn__line--a { height: 22px; font-size: 16.5px; line-height: 22px; font-weight: 680; font-stretch: 104%; letter-spacing: -0.012em; }
.tn__line--b { height: 16px; font-size: 11.5px; line-height: 16px; font-weight: 560; color: var(--soft); }

/* the people ahead: short upright bars, the front one leaves when a number is called */
.tn__queue { display: flex; align-items: flex-end; gap: 4px; height: 22px; }
.tn__queue i { display: block; width: 5px; height: 16px; border-radius: 2.5px; background: var(--ink); opacity: 0.8; transform-origin: 50% 100%; }
.tn__queue i:nth-child(2n) { height: 19px; }
.tn__queue i:nth-child(3n) { height: 13px; }
/* one wave that leaves the pill when it is your turn */
.tn__wave { position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 0 0 2px var(--go); opacity: 0; pointer-events: none; }

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

@media (hover: hover) {
  .tn:not([aria-busy="true"]):hover .tn__slit { box-shadow: 0 1px 0 rgba(255, 255, 255, 0.34); }
}
