:root {
  --bg: #ffffff;
  --ink: #ffffff;
  --surface: #121317;
  --surface-hi: #24262d;
  --accent: #19b36b;
  --accent-deep: #0c8f52;
  --run: #7df0b4;
}

*, *::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 ---- */
.hook {
  position: relative;
  width: min(286px, calc(100vw - 32px));
  height: 60px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 10px 0 9px;
  border: 0;
  border-radius: 99px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  isolation: isolate;
  box-shadow:
    0 1px 1px rgba(18, 19, 23, 0.3),
    0 12px 26px -12px rgba(18, 19, 23, 0.55),
    0 30px 50px -30px rgba(18, 19, 23, 0.4);
  transition: box-shadow 0.6s ease;
}
.hook.is-ok {
  box-shadow:
    0 1px 1px rgba(18, 19, 23, 0.2),
    0 14px 30px -12px color-mix(in srgb, var(--accent) 70%, transparent),
    0 30px 54px -28px color-mix(in srgb, var(--accent) 60%, transparent);
}
.hook:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.hook__body {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  background: linear-gradient(180deg, var(--surface-hi), var(--surface));
  z-index: -2;
}
/* the green that floods the pill from the sign when the answer lands */
.hook__flood {
  position: absolute;
  left: 30px;
  top: 50%;
  width: 600px;
  height: 600px;
  margin: -300px 0 0 -300px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--accent) 80%, #ffffff) 0%, var(--accent) 36%, var(--accent-deep) 100%);
  transform: scale(0);
}
/* a soft light that follows the pointer */
.hook__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;
}
.hook.is-hot .hook__light { opacity: 1; }
/* the 1px edge that catches the light from above */
.hook__edge {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.3), 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 light that runs round the edge: out along the top, back along the bottom */
.hook__run {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.hook__run rect {
  fill: none;
  stroke: var(--run);
  stroke-width: 1.6;
  stroke-linecap: round;
  opacity: 0;
}
.hook__run .hook__run-glow {
  stroke-width: 5;
  filter: blur(4px);
}

/* ---- the hook sign in its round seat ---- */
.sign {
  position: relative;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.09);
  display: grid;
  place-items: center;
  transition: background-color 0.5s ease;
}
.hook.is-ok .sign { background: rgba(255, 255, 255, 0.2); }
.sign svg { width: 23px; height: 23px; overflow: visible; }
.sign path { fill: none; stroke: #e6e8ee; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sign__tick { stroke: #ffffff !important; stroke-width: 2.3 !important; stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; }

/* ---- the words ---- */
.label {
  flex: 1;
  min-width: 0;
  height: 22px;
  overflow: hidden;
  font-size: 15.5px;
  line-height: 22px;
  font-weight: 580;
  font-stretch: 104%;
  letter-spacing: -0.005em;
}
.label__word { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hook.is-busy .label__word { font-stretch: 92%; font-weight: 520; color: #d5d8e0; }

/* ---- the chip that counts the milliseconds ---- */
.time {
  flex: none;
  height: 40px;
  line-height: 40px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  text-align: center;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  width: 0;
  transition: background-color 0.4s ease;
}
.hook.is-ok .time { background: rgba(4, 40, 22, 0.3); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18); }

.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: #14151a;
  stroke: #ffffff;
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 4px rgba(20, 21, 26, 0.3));
  opacity: 0;
  visibility: hidden;
  z-index: 5;
}
