:root {
  --bg: #000000;
  --ink: #f4f4f7;
  --soft: #9a9cab;
  --pill-hi: #2a2b34;
  --pill-lo: #17181e;
  --accent: #ffc94d;
}

*, *::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 ---- */
.clap {
  position: relative;
  width: min(232px, calc(100vw - 32px));
  height: 60px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 20px 0 9px;
  border: 0;
  border-radius: 99px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  isolation: isolate;
  box-shadow: 0 18px 40px -18px color-mix(in srgb, var(--accent) calc(var(--heat, 0) * 70%), transparent);
}
.clap:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.clap__body {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  background: linear-gradient(180deg, var(--pill-hi), var(--pill-lo));
  z-index: -2;
}
/* the pill warms up from the hands as the applause grows */
.clap__warm {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 34%, transparent), transparent 70%);
  opacity: 0;
}
.clap__light {
  position: absolute;
  inset: 0;
  background: radial-gradient(120px 70px at var(--px, 50%) var(--py, 0%), rgba(255, 255, 255, 0.12), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.clap.is-hot .clap__light { opacity: 1; }
.clap__edge {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.05) 45%, rgba(255, 255, 255, 0.1));
  -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: the two hands, the ring, the burst ---- */
.seat { position: relative; flex: none; width: 42px; height: 42px; }
.seat__disc {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  display: grid;
  place-items: center;
}
.seat__disc svg { width: 25px; height: 25px; overflow: visible; }
.seat__disc rect, .seat__disc path { fill: #23242c; stroke: #f4f4f7; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; transition: stroke 0.3s ease; }
.clap.is-mine .seat__disc rect, .clap.is-mine .seat__disc path { stroke: var(--accent); }
.seat__ring, .seat__burst { position: absolute; left: -6px; top: -6px; width: 54px; height: 54px; overflow: visible; pointer-events: none; }
.seat__ring { transform: rotate(-90deg); }
.seat__ring circle { fill: none; stroke-width: 2; stroke-linecap: round; }
.seat__track { stroke: rgba(255, 255, 255, 0.07); }
.seat__arc { stroke: var(--accent); stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; }
.seat__burst { opacity: 0; }
.seat__burst path { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; }

/* ---- the words and the count ---- */
.label { flex: 1; min-width: 0; height: 22px; overflow: hidden; font-size: 15.5px; line-height: 22px; font-weight: 600; font-stretch: 104%; letter-spacing: -0.005em; }
.label__word { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.total { flex: none; font-size: 15px; font-weight: 640; color: var(--soft); transition: color 0.3s ease; }
.total span { display: inline-block; }
.clap.is-mine .total { color: var(--accent); }

/* ---- the bubble with your own claps ---- */
.mine {
  position: absolute;
  left: 30px;
  top: -40px;
  min-width: 44px;
  height: 30px;
  margin-left: -22px;
  padding: 0 10px;
  border-radius: 99px;
  background: var(--accent);
  color: #1c1503;
  font-size: 13.5px;
  line-height: 30px;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--accent) 80%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.mine span { display: inline-block; }

.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: #101116;
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.6));
  opacity: 0;
  visibility: hidden;
  z-index: 5;
}
