/* The Go live button with the countdown and the rising audience. Pure black, and in the middle one pill of
   obsidian with a 1px edge that catches the light from above. Inside, layered in one rounded box (.gl__body, moved
   only by GSAP): the obsidian fill, the red lacquer of the broadcast that floods out of the disc (clip-path), a wine
   tone for the question End stream?, the light under the pointer, the reflection that crosses, and the edge drawn in
   SVG (a static hairline and a light that runs round it during the countdown). Then the row: the disc (broadcast
   sign or countdown digit), the words, and on the right the arrow, the audience with its faces or the End chip. */
:root {
  --page: #000000;            /* the page: pure black */
  --obsidian: #111114;        /* the pill at rest */
  --red: #ff2e43;             /* the broadcast red */
  --red-deep: #b30f26;        /* the red in shadow */
  --wine: #4a0b16;            /* the darker red of End stream? */
  --edge: #ffffff;            /* the light on the 1px edge */
  --ink: #f6f6f8;             /* the words */
  --muted: rgba(246, 246, 248, 0.5); /* the small line under the words */
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

html,
body {
  margin: 0;
  overflow-x: clip;
}

body {
  min-height: 100svh;
  background: var(--page);
  color: var(--ink);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.stage {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow: hidden;
  background: var(--page);
}

.gl {
  position: relative;
  display: grid;
  place-items: center;
}

/* the light the button throws under itself: faint white at rest, red when live (GSAP fades it) */
.gl__spill {
  position: absolute;
  left: 50%;
  top: 100%;
  width: 92%;
  height: 36px;
  margin: -14px 0 0 -46%;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--red) 70%, transparent), color-mix(in srgb, var(--red-deep) 24%, transparent) 55%, transparent);
  filter: blur(16px);
  opacity: 0;
  pointer-events: none;
}

.gl__btn {
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  border-radius: 999px;
  -webkit-tap-highlight-color: transparent;
}

.gl__btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 5px;
}

.gl__body {
  --mx: 30%;
  --my: 50%;
  position: relative;
  display: block;
  width: min(86vw, 312px);
  height: 60px;
  border-radius: 999px;
  isolation: isolate;
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.9),
    0 10px 22px -12px rgba(0, 0, 0, 1),
    0 0 0 1px rgba(0, 0, 0, 0.9),
    0 18px 40px -22px rgba(255, 255, 255, 0.1);
}

.gl__fill,
.gl__red,
.gl__wine,
.gl__shine,
.gl__sweep {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
}

/* obsidian: deep, a cool lift at the top, a soft shadow at the bottom, a fine grain */
.gl__fill {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(120% 140% at 50% -40%, rgba(255, 255, 255, 0.1), transparent 60%),
    linear-gradient(180deg, #1b1b20, var(--obsidian) 55%, #0a0a0c);
}

/* the red lacquer of the broadcast: it floods out of the disc (GSAP grows the clip circle) */
.gl__red {
  background:
    radial-gradient(120% 160% at 50% -50%, rgba(255, 210, 214, 0.38), transparent 58%),
    linear-gradient(180deg, var(--red), var(--red-deep) 92%);
  clip-path: circle(0px at 30px 50%);
}

/* a warm light that breathes inside the red, anchored on the disc */
.gl__red-glow {
  position: absolute;
  left: -40px;
  top: -60%;
  width: 150px;
  height: 220%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 196, 150, 0.42), rgba(255, 120, 110, 0.12) 55%, transparent);
  opacity: 0.6;
}

.gl__wine {
  background: linear-gradient(180deg, color-mix(in srgb, var(--wine) 88%, #fff 4%), var(--wine));
  opacity: 0;
}

.gl__shine {
  background: radial-gradient(110px 70px at var(--mx) var(--my), rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.035) 50%, transparent 72%);
  opacity: 0;
}

.gl__sweep-band {
  position: absolute;
  top: -30%;
  left: 0;
  width: 30%;
  height: 160%;
  background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0.06) 30%, rgba(255, 255, 255, 0.34) 50%, rgba(255, 255, 255, 0.06) 70%, transparent 100%);
}

/* the edge: a 1px hairline brighter at the top (gradient stroke), and the light that runs round it */
.gl__edge {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 3;
}

.gl__edge rect {
  fill: none;
  stroke-width: 1;
}

.gl__edge-base {
  stroke: url(#gl-edge);
}

.gl__edge-run {
  stroke: var(--edge);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-dasharray: 0 1;
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.7));
  opacity: 0;
}

.gl__row {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 10px 0 8px;
  gap: 11px;
}

/* the disc: the broadcast sign at rest and live, the countdown digit in between */
.gl__disc {
  position: relative;
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
}

.gl__disc > * {
  grid-area: 1 / 1;
  position: relative;
}

.gl__plate {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 12%, rgba(255, 214, 218, 0.55), transparent 52%),
    linear-gradient(180deg, var(--red), var(--red-deep));
  box-shadow:
    inset 0 0 0 1px rgba(255, 196, 202, 0.24),
    inset 0 1px 0 rgba(255, 232, 234, 0.6),
    inset 0 -3px 6px rgba(80, 0, 14, 0.4),
    0 2px 5px rgba(0, 0, 0, 0.7),
    0 6px 16px -6px color-mix(in srgb, var(--red) 60%, transparent);
}

/* the broadcast sign: a small mast with a diamond on top and two pairs of waves (never a dot) */
.gl__sig {
  width: 24px;
  height: 24px;
  overflow: visible;
}

.gl__sig path {
  fill: none;
  stroke: #fff6f7;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gl__sig .gl__tip {
  fill: #fff6f7;
  stroke-width: 1;
}

.gl__sig {
  filter: drop-shadow(0 1px 1px rgba(90, 0, 16, 0.5));
}

/* the countdown digit, inside a window so it rolls */
.gl__num {
  display: inline-flex;
  font-size: 22px;
  font-weight: 640;
  font-variation-settings: 'wdth' 92;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  color: #fff;
  opacity: 0;
}

.gl__text {
  flex: 1;
  display: grid;
  min-width: 0;
  text-align: left;
}

.gl__state {
  grid-area: 1 / 1;
  display: grid;
  gap: 3px;
  min-width: 0;
}

.gl__state + .gl__state {
  opacity: 0;
}

.gl__title {
  --w: 100;
  font-size: 15.5px;
  font-weight: 600;
  font-variation-settings: 'wdth' var(--w);
  letter-spacing: 0.002em;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
}

.gl__title--live {
  font-weight: 680;
  letter-spacing: 0.01em;
}

.gl__sub {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.gl__sub-text {
  font-size: 11.5px;
  font-weight: 460;
  font-variation-settings: 'wdth' 96;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  line-height: 1.2;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.gl__sub-text--live {
  color: rgba(255, 238, 240, 0.78);
}

/* the right side: arrow at rest, the audience when live, the End chip for the question */
.gl__side {
  position: relative;
  flex: none;
  display: grid;
  justify-items: end;
  align-items: center;
}

.gl__side > * {
  grid-area: 1 / 1;
}

.gl__go {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 1px 2px rgba(0, 0, 0, 0.6);
}

.gl__go svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gl__aud {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 9px 0 5px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(60, 0, 10, 0.32), rgba(60, 0, 10, 0.18));
  box-shadow:
    inset 0 0 0 1px rgba(255, 220, 224, 0.2),
    inset 0 1px 0 rgba(255, 230, 232, 0.22);
  opacity: 0;
  visibility: hidden;
}

.gl__faces {
  display: flex;
  align-items: center;
}

.gl__face {
  width: 20px;
  height: 20px;
  border-radius: 7px;
  overflow: hidden;
  box-shadow: 0 0 0 1.5px #c51830, 0 1px 3px rgba(60, 0, 10, 0.5);
  opacity: 0;
}

.gl__face + .gl__face {
  margin-left: -6px;
}

.gl__face svg {
  display: block;
  width: 100%;
  height: 100%;
}

.gl__count {
  display: inline-flex;
  min-width: 2.1em;
  justify-content: flex-end;
  font-size: 12.5px;
  font-weight: 620;
  font-variation-settings: 'wdth' 94;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  color: #fff;
  white-space: nowrap;
}

/* a rolling window per character: the old one goes up, the new one comes from below */
.gl__slot {
  position: relative;
  display: inline-block;
  height: 1.25em;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 20%, #000 80%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 20%, #000 80%, transparent);
}

.gl__num .gl__slot {
  height: 1.2em;
}

.gl__ch {
  display: block;
  text-align: center;
}

.gl__ch--out {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
}

.gl__endchip {
  height: 30px;
  padding: 0 14px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 640;
  font-variation-settings: 'wdth' 104;
  letter-spacing: 0.01em;
  color: var(--red-deep);
  background: linear-gradient(180deg, #ffffff, #f1e6e8);
  box-shadow:
    inset 0 -1px 0 rgba(120, 0, 20, 0.18),
    0 1px 2px rgba(0, 0, 0, 0.45),
    0 4px 10px -4px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
}

@media (max-width: 360px) {
  .gl__row {
    gap: 9px;
    padding-right: 9px;
  }

  .gl__aud {
    gap: 5px;
    padding-right: 8px;
  }
}
