/* ============================================================
   Stage view: the full-screen, animated alternative to the classic
   dialler. Black and Macaw green, glass cards, things that arrive and
   dissolve. Everything is scoped under .stage so the classic view is
   untouched. Motion is decoration only: prefers-reduced-motion turns
   it off at the bottom of this file.
   ============================================================ */

.stage {
  --s-bg: #0a0909;
  --s-ink: #f4f4ec;
  --s-dim: rgba(244, 244, 236, 0.56);
  --s-faint: rgba(244, 244, 236, 0.32);
  --s-line: rgba(217, 238, 80, 0.16);
  --s-glass: rgba(255, 255, 255, 0.045);
  --s-glow: rgba(217, 238, 80, 0.35);
  --s-red: #e96c5b;
  --s-ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--s-bg);
  color: var(--s-ink);
  display: grid;
  grid-template-rows: 64px 1fr;
  /* clip, not hidden: hidden still lets focus scroll the stage sideways. */
  overflow: clip;
  font-family: 'Inter', Arial, sans-serif;
  animation: stage-in 0.6s var(--s-ease);
}

@keyframes stage-in { from { opacity: 0; } }

/* ---------------- background ---------------- */

.stage__bg { position: absolute; inset: 0; pointer-events: none; }

.stage__grid {
  position: absolute; inset: -40px;
  background-image: radial-gradient(rgba(217, 238, 80, 0.14) 1px, transparent 1.4px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse at 50% 45%, #000 20%, transparent 75%);
  animation: grid-drift 60s linear infinite;
}
@keyframes grid-drift { to { transform: translate(28px, 28px); } }

.stage__glow {
  position: absolute;
  width: 70vmax; height: 70vmax;
  left: 50%; top: 45%;
  translate: -50% -50%;
  background: radial-gradient(circle, rgba(217, 238, 80, 0.13), transparent 60%);
  animation: glow-breathe 9s ease-in-out infinite;
}
@keyframes glow-breathe {
  0%, 100% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.08); opacity: 1; }
}

.stage__scan {
  position: absolute; left: 0; right: 0; height: 160px; top: -160px;
  background: linear-gradient(to bottom, transparent, rgba(217, 238, 80, 0.035), transparent);
  animation: scan 7s linear infinite;
}
@keyframes scan { to { transform: translateY(calc(100vh + 160px)); } }

/* The call's phase tints the room: warmer while ringing, red-shifted never. */
.stage--incoming .stage__glow { background: radial-gradient(circle, rgba(217, 238, 80, 0.24), transparent 60%); animation-duration: 1.6s; }

/* ---------------- header ---------------- */

.stage__top {
  position: relative; z-index: 2;
  display: flex; align-items: center; gap: 14px;
  padding: 0 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.stage__logo { height: 22px; mix-blend-mode: screen; opacity: 0.9; }
.stage__appname { font-size: 12px; letter-spacing: 0.18em; color: var(--s-faint); }
.stage__spacer { flex: 1; }
.stage__who { font-size: 14px; letter-spacing: 0.08em; color: var(--s-dim); }
.stage__live {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; letter-spacing: 0.14em; color: var(--macaw);
  padding: 4px 10px; border: 1px solid var(--s-line); border-radius: 999px;
}
.stage__livedot { width: 7px; height: 7px; border-radius: 50%; background: var(--macaw); box-shadow: 0 0 10px var(--macaw); animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.25; } }

.stage__main { position: relative; z-index: 1; min-height: 0; display: grid; overflow-y: auto; }

/* ---------------- buttons ---------------- */

.sbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-width: 160px; padding: 16px 28px;
  border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06); color: var(--s-ink);
  font-size: 16px; font-weight: 600; letter-spacing: 0.01em;
  transition: transform 0.2s var(--s-ease), box-shadow 0.2s, background 0.2s;
}
.sbtn:hover { transform: translateY(-2px); }
.sbtn--accept {
  background: var(--macaw); color: #111; border-color: var(--macaw);
  box-shadow: 0 0 0 0 var(--s-glow);
  animation: accept-pulse 1.6s ease-out infinite;
}
@keyframes accept-pulse {
  0% { box-shadow: 0 0 0 0 rgba(217, 238, 80, 0.55); }
  100% { box-shadow: 0 0 0 22px rgba(217, 238, 80, 0); }
}
.sbtn--decline { border-color: rgba(233, 108, 91, 0.6); color: var(--s-red); }
.sbtn--decline:hover { background: rgba(233, 108, 91, 0.12); }

/* ---------------- lobby ---------------- */

.lobby {
  place-self: center;
  width: 100%;
  box-sizing: border-box;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 24px 32px 120px;
  max-width: 1100px;
}

.lobby__eyebrow { font-size: 12px; letter-spacing: 0.32em; text-transform: uppercase; color: var(--macaw); margin: 0 0 14px; }
.lobby__dots span { animation: blink 1.4s infinite; }
.lobby__dots span:nth-child(2) { animation-delay: 0.2s; }
.lobby__dots span:nth-child(3) { animation-delay: 0.4s; }

.lobby__hello {
  margin: 0; font-size: clamp(44px, 7vw, 92px); font-weight: 700; letter-spacing: -0.035em; line-height: 1;
  background: linear-gradient(100deg, var(--s-ink) 30%, var(--macaw) 50%, var(--s-ink) 70%);
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: rise 0.9s var(--s-ease) both, shimmer 6s ease-in-out 1s infinite;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 60%, 100% { background-position: -50% 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); filter: blur(8px); } }

.lobby__line {
  margin: 18px 0 0; min-height: 28px;
  font-size: 19px; color: var(--s-dim);
  animation: line-in 0.7s var(--s-ease);
}
@keyframes line-in { from { opacity: 0; transform: translateY(8px); filter: blur(6px); } }

.lobby__warn { margin-top: 24px; font-size: 12px; color: var(--s-red); }

/* ---------------- incoming ---------------- */

.ring, .solo, .ended {
  place-self: center; position: relative;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 0 32px 80px;
}
.ring__waves { position: absolute; top: 42%; left: 50%; width: 0; height: 0; pointer-events: none; }
.ring__waves span {
  position: absolute; left: -160px; top: -160px; width: 320px; height: 320px; border-radius: 50%;
  border: 2px solid var(--macaw);
  animation: wave 2.4s ease-out infinite;
}
.ring__waves span:nth-child(2) { animation-delay: 0.6s; }
.ring__waves span:nth-child(3) { animation-delay: 1.2s; }
.ring__waves span:nth-child(4) { animation-delay: 1.8s; }
@keyframes wave { from { transform: scale(0.3); opacity: 0.8; } to { transform: scale(2.2); opacity: 0; } }

.ring__label, .solo__label, .ended__label { font-size: 12px; letter-spacing: 0.32em; text-transform: uppercase; color: var(--macaw); margin: 0 0 16px; }
.ring__who, .solo__who {
  margin: 0; font-size: clamp(40px, 6vw, 78px); font-weight: 700; letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  animation: glitch-in 0.9s steps(1) both, rise 0.6s var(--s-ease);
}
@keyframes glitch-in {
  0% { opacity: 0; } 10% { opacity: 1; text-shadow: 3px 0 var(--macaw), -3px 0 #6fe1ee; transform: translateX(-4px); }
  20% { text-shadow: -2px 0 var(--macaw), 2px 0 #6fe1ee; transform: translateX(3px); }
  30%, 100% { text-shadow: none; transform: none; }
}
.ring__hint, .solo__hint { margin: 14px 0 44px; font-size: 12px; color: var(--s-dim); letter-spacing: 0.08em; }
.ring__actions { display: flex; gap: 18px; position: relative; }

/* ---------------- ended ---------------- */

.ended__title { margin: 0 0 28px; font-size: clamp(36px, 5vw, 64px); font-weight: 700; letter-spacing: -0.03em; animation: rise 0.8s var(--s-ease) both; }
.ended__duration { margin: -12px 0 20px; font-size: 14px; letter-spacing: 0.16em; color: var(--macaw); }
.ended__summary { max-width: 640px; color: var(--s-dim); font-size: 17px; margin: 0 0 12px; animation: rise 0.8s var(--s-ease) 0.4s both; }
.ended__next { list-style: none; padding: 0; margin: 0 0 32px; color: var(--s-dim); font-size: 14px; }
.ended__next li::before { content: '→ '; color: var(--macaw); }

/* ---------------- live ---------------- */

.live {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr) minmax(280px, 380px);
  gap: 32px;
  padding: 24px 32px 0;
  min-height: 0;
}

.live__label { display: flex; gap: 10px; align-items: center; margin: 0 0 14px; font-size: 10px; font-weight: 500; letter-spacing: 0.24em; text-transform: uppercase; color: var(--s-faint); }
.live__updating { color: var(--macaw); animation: blink 1s infinite; letter-spacing: 0.12em; }
.live__empty { color: var(--s-faint); font-size: 14px; }

.live__notes { padding-bottom: 110px; overflow-y: auto; min-height: 0; }
.note {
  display: flex; flex-direction: column; gap: 4px;
  padding: 12px 0; border-top: 1px solid rgba(255, 255, 255, 0.06);
  animation: rise 0.6s var(--s-ease) both; animation-delay: calc(var(--i, 0) * 0.06s);
}
.note__k { font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--s-faint); }
.note__v { font-size: 15px; font-weight: 600; }
.note__item { font-size: 14px; color: var(--s-dim); animation: line-in 0.6s var(--s-ease); }

.live__center { display: flex; flex-direction: column; gap: 22px; min-height: 0; overflow-y: auto; padding-bottom: 40px; }
/* Never squash a block to fit: the column scrolls instead. */
.live__center > * { flex-shrink: 0; }

.suggest-wrap { display: flex; flex-direction: column; gap: 12px; }
.suggest {
  position: relative;
  padding: 24px 28px;
  border-radius: 20px;
  border: 1px solid var(--s-line);
  background: linear-gradient(150deg, rgba(217, 238, 80, 0.09), rgba(255, 255, 255, 0.02) 60%);
  box-shadow: 0 30px 80px -40px rgba(217, 238, 80, 0.35);
  animation: materialise 0.8s var(--s-ease);
}
.suggest::before {
  content: ''; position: absolute; left: 0; top: 18px; bottom: 18px; width: 3px; border-radius: 3px;
  background: var(--macaw); box-shadow: 0 0 14px var(--macaw);
}
@keyframes materialise {
  from { opacity: 0; transform: translateY(14px) scale(0.98); filter: blur(12px); }
}
.suggest__label { display: flex; gap: 10px; font-size: 10px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--macaw); }
.suggest__ms { color: var(--s-faint); letter-spacing: 0.08em; }
.suggest__text { margin: 10px 0 0; font-size: clamp(20px, 2vw, 28px); line-height: 1.35; font-weight: 500; letter-spacing: -0.01em; }
.suggest--idle .suggest__text { color: var(--s-faint); }
.caret { display: none; width: 0.5em; height: 1em; margin-left: 3px; vertical-align: -0.12em; background: var(--macaw); animation: blink 0.8s steps(1) infinite; }
.suggest.is-streaming .caret { display: inline-block; }

.verdictpill {
  align-self: flex-start;
  display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 10px;
  padding: 8px 16px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 14px;
  animation: pop 0.5s var(--s-ease);
}
.verdictpill span { font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--s-faint); }
.verdictpill em { font-style: normal; color: var(--s-dim); font-size: 13px; }
.verdictpill--correct { border-color: var(--macaw); box-shadow: 0 0 24px rgba(217, 238, 80, 0.25); }
.verdictpill--correct strong { color: var(--macaw); }
.verdictpill--incorrect { border-color: var(--s-red); animation: pop 0.5s var(--s-ease), alarm 0.9s ease-out; }
.verdictpill--incorrect strong { color: var(--s-red); }
.verdictpill--partial strong { color: #6fe1ee; }
@keyframes alarm { 0% { box-shadow: 0 0 0 0 rgba(233, 108, 91, 0.6); } 100% { box-shadow: 0 0 0 18px rgba(233, 108, 91, 0); } }

/* The focus: one card, big. The old one dissolves over the new. */
.focus { position: relative; display: grid; min-height: 120px; }
.focus__slot { grid-area: 1 / 1; }
.focus__slot.is-entering { animation: focus-in 0.75s var(--s-ease); }
.focus__slot.is-leaving { animation: dissolve 0.65s ease-in forwards; pointer-events: none; z-index: 1; }
@keyframes focus-in { from { opacity: 0; transform: translateY(16px) scale(0.97); filter: blur(10px); } }
@keyframes dissolve { to { opacity: 0; transform: translateY(-10px) scale(1.03); filter: blur(14px); } }
.focus__slot--correction { animation: focus-in 0.75s var(--s-ease), shake 0.5s ease-in-out 0.2s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.focus__empty { align-self: center; text-align: center; color: var(--s-faint); font-size: 12px; letter-spacing: 0.12em; padding: 32px; border: 1px dashed rgba(255, 255, 255, 0.08); border-radius: 20px; }

.focus .kcard { padding: 22px 26px; border-radius: 20px; }
.focus .kcard__head h4 { font-size: 20px; }
.focus .kcard ul, .focus .notes__facts { font-size: 16px; }

.rail { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.rail__item { cursor: pointer; border-radius: 14px; }
.rail__item:focus-visible { outline: 2px solid var(--macaw); outline-offset: 2px; opacity: 1; }

/* A card reopened from the rail: flagged, with the way back to live. */
.pinbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: -10px; font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: #6fe1ee;
  animation: line-in 0.4s var(--s-ease);
}
.pinbar__back {
  font: 500 12px 'Inter', sans-serif; letter-spacing: 0; text-transform: none;
  padding: 5px 12px; border-radius: 999px; border: 1px solid rgba(111, 225, 238, 0.5);
  background: transparent; color: #6fe1ee;
}
.pinbar__back:hover { background: rgba(111, 225, 238, 0.12); }
.focus.is-pinned .kcard { border-color: rgba(111, 225, 238, 0.55); box-shadow: 0 0 40px -16px rgba(111, 225, 238, 0.6); }
.rail__item { opacity: 0.5; transform: scale(0.98); transition: opacity 0.3s, transform 0.3s; animation: rail-in 0.6s var(--s-ease) both; animation-delay: calc(var(--i, 0) * 0.07s); }
.rail__item:hover { opacity: 1; transform: none; }
.rail__item .kcard { padding: 12px 14px; margin: 0; font-size: 12px; }
.rail__item .kcard__head h4 { font-size: 13px; }
/* Earlier cards shrink to their heading and status: enough to recognise, not to read. */
.rail__item .kcard ul, .rail__item .notes__facts, .rail__item .ocard__detail, .rail__item .ocard__steps,
.rail__item .chips, .rail__item .kcard__meta, .rail__item .assist__empty { display: none; }
.rail__item .kcard__head { margin: 0; }
.rail__item .ostatus { margin: 6px 0 0; }
.rail__label { margin: 0 0 -10px; font-size: 10px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--s-faint); }
@keyframes rail-in { from { opacity: 0; transform: translateY(10px); } }

/* Cards, reskinned for the dark. Same markup as the classic panel. */
.stage .kcard {
  margin: 0;
  color: var(--s-ink);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  animation: none;
}
.stage .focus .kcard { border-color: var(--s-line); box-shadow: 0 0 0 1px rgba(217, 238, 80, 0.06), 0 30px 80px -50px var(--s-glow); }
.stage .kcard__meta, .stage .assist__empty, .stage .ocard__detail { color: var(--s-dim); }
.stage .notes__facts dt { color: var(--s-faint); }
.stage .notes__facts dd { color: var(--s-ink); }
.stage .ocard__steps { color: var(--s-faint); }
.stage .ocard__steps .is-next { color: var(--macaw); }
.stage .chip { background: rgba(255, 255, 255, 0.08); color: var(--s-dim); }
.stage .chip--action { background: transparent; border-color: rgba(255, 255, 255, 0.16); color: var(--s-dim); }
.stage .chip--cited { background: rgba(217, 238, 80, 0.14); color: var(--macaw); }
.stage .chip--button { background: var(--macaw); border-color: var(--macaw); color: #111; box-shadow: 0 0 18px var(--s-glow); }
.stage .chip--button:hover { background: #e9ff6e; }
.stage .ostatus--locked { background: rgba(255, 255, 255, 0.1); color: var(--s-ink); }
.stage .fact--wrong { color: var(--s-red); }
.stage .fixcard--incorrect { border-color: rgba(233, 108, 91, 0.7); box-shadow: 0 0 40px -10px rgba(233, 108, 91, 0.5); }
.stage .fixcard--partial { border-color: rgba(111, 225, 238, 0.6); }

/* Transcript: newest at the bottom, older lines fading up into the dark. */
.live__transcript { display: flex; flex-direction: column; min-height: 0; padding-bottom: 24px; }
.tx { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column-reverse; mask-image: linear-gradient(to bottom, transparent, #000 22%); scrollbar-width: none; }
.tx::-webkit-scrollbar { display: none; }
.tx__inner { display: flex; flex-direction: column; gap: 14px; padding-top: 40vh; }
.tx__turn { animation: tx-in 0.55s var(--s-ease); }
@keyframes tx-in { from { opacity: 0; transform: translateX(24px); filter: blur(6px); } }
.tx__turn p { margin: 4px 0 0; font-size: 15px; line-height: 1.45; }
.tx__who { display: flex; gap: 8px; font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--s-faint); }
.tx__turn--caller p { color: var(--s-ink); }
.tx__turn--you { padding-left: 14px; border-left: 2px solid var(--macaw); }
.tx__turn--you .tx__who { color: var(--macaw); }
.tx__turn--you p { color: var(--s-dim); }
.tx__turn.is-partial p { opacity: 0.55; }
.tx__mark--correct { color: var(--macaw); }
.tx__mark--incorrect { color: var(--s-red); }
.tx__mark--partial { color: #6fe1ee; }
.tx__sys { font-size: 11px; color: var(--macaw); opacity: 0.75; padding: 6px 10px; border: 1px dashed var(--s-line); border-radius: 8px; animation: tx-in 0.55s var(--s-ease); }

/* ---------------- dock ---------------- */

.dock {
  position: absolute; left: 24px; bottom: 24px; z-index: 5;
  display: flex; align-items: center; gap: 6px;
  padding: 6px; border-radius: 999px;
  background: rgba(20, 20, 18, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(14px);
  box-shadow: 0 20px 50px -20px #000;
  animation: dock-in 0.7s var(--s-ease) 0.2s both;
}
@keyframes dock-in { from { opacity: 0; transform: translateY(20px); } }

.dock__btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 14px; border-radius: 999px;
  border: 1px solid transparent; background: transparent; color: var(--s-dim);
  font-size: 13px; font-weight: 500;
  transition: background 0.2s, color 0.2s;
}
.dock__btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.08); color: var(--s-ink); }
.dock__btn:disabled { opacity: 0.35; cursor: default; }
.dock__btn .icon { width: 18px; height: 18px; }
.dock__btn.is-on { background: var(--purple); color: #111; }
.dock__btn--end { background: var(--s-red); color: #111; }
.dock__btn--end:hover:not(:disabled) { background: #ff8574; color: #111; }
.dock__btn--view { border-left: 1px solid rgba(255, 255, 255, 0.1); border-radius: 0 999px 999px 0; margin-left: 4px; }
.dock__sep { width: 1px; height: 24px; background: rgba(255, 255, 255, 0.1); margin: 0 4px; }

/* A setting: icon, label, and a switch whose knob is the state. Off dims the label. */
.dock__toggle { color: var(--s-ink); }
.dock__toggle.is-off { color: var(--s-faint); }
.stage .switch { background: var(--macaw); box-shadow: 0 0 10px rgba(217, 238, 80, 0.35); }
.stage .dock__toggle.is-off .switch { background: rgba(255, 255, 255, 0.16); box-shadow: none; }

.dock__timer { display: inline-flex; align-items: center; gap: 8px; padding: 0 12px 0 10px; font-size: 15px; color: var(--macaw); font-variant-numeric: tabular-nums; }
.dock__rec { width: 8px; height: 8px; border-radius: 50%; background: var(--s-red); box-shadow: 0 0 10px var(--s-red); animation: blink 1.2s infinite; }
.dock__device { display: inline-flex; align-items: center; gap: 8px; padding: 0 12px 0 10px; font-size: 12px; color: var(--s-dim); }
.dock__led { width: 8px; height: 8px; border-radius: 50%; background: var(--s-faint); }
.dock__device.is-ready .dock__led { background: var(--macaw); box-shadow: 0 0 10px var(--macaw); }
.dock__error { padding: 0 12px; font-size: 11px; color: var(--s-red); max-width: 320px; }

/* Dev preview's scenario buttons. */
.stage__dev { display: flex; gap: 6px; margin-left: 12px; }
.stage__dev button { font: 11px 'Roboto Mono', monospace; padding: 5px 10px; border-radius: 6px; border: 1px dashed rgba(217, 238, 80, 0.4); background: transparent; color: var(--macaw); }

/* ---------------- wren ----------------
   Studio's foraging wren (ForagingBird.tsx in PolyAI-LDN/platform_ui): one 6.5s
   timeline for bird, eye, worms and dirt, copied as-is so the choreography stays
   in sync. Idle and blink, two peeks, a strike, three tugs, the pop, the worm
   dangles, gulp, a hop, rest. The reduced-motion rule at the end of this file
   stops it in its first pose. */

.wren-forage * { transform-box: view-box; }
.wren-forage .wf-bird {
  transform-origin: 72px 106px;
  animation: wren-forage-body 6500ms linear infinite;
}
.wren-forage .wf-hop {
  transform-origin: 62px 106px;
  animation: wren-forage-hop 6500ms linear infinite;
}
.wren-forage .wf-eye {
  transform-origin: 82.5px 34px;
  animation: wren-forage-eye 6500ms linear infinite;
}
.wren-forage .wf-worm-g {
  transform-origin: 150px 130px;
  animation: wren-forage-worm-ground 6500ms linear infinite;
}
.wren-forage .wf-worm-d {
  transform-origin: 111px 38.5px;
  animation: wren-forage-worm-dangle 6500ms linear infinite;
  opacity: 0;
}
.wren-forage .wf-dirt path { opacity: 0; }
.wren-forage .wf-d1 { animation: wren-forage-d1 6500ms linear infinite; }
.wren-forage .wf-d2 { animation: wren-forage-d2 6500ms linear infinite; }
.wren-forage .wf-d3 { animation: wren-forage-d3 6500ms linear infinite; }

/* Bird master timeline. Positive deg tips toward the burrow. */
@keyframes wren-forage-body {
  0%, 9.2%  { transform: rotate(0deg);  animation-timing-function: cubic-bezier(.6,.05,.4,1); }
  10.5%     { transform: rotate(8deg);  animation-timing-function: linear; }
  12.3%     { transform: rotate(8deg);  animation-timing-function: cubic-bezier(.6,.05,.4,1); }
  13.5%     { transform: rotate(4deg);  animation-timing-function: linear; }
  15.4%     { transform: rotate(4deg);  animation-timing-function: cubic-bezier(.4,0,.6,1); }
  17.2%, 17.5% { transform: rotate(-6deg); animation-timing-function: cubic-bezier(.55,0,.85,.45); }
  19.9%     { transform: rotate(55deg); animation-timing-function: cubic-bezier(.3,1,.4,1); }
  21.2%     { transform: rotate(52deg); animation-timing-function: cubic-bezier(.25,.9,.35,1); }
  24.3%     { transform: rotate(46deg);   animation-timing-function: cubic-bezier(.6,.05,.4,1); }
  25.9%     { transform: rotate(46deg);   animation-timing-function: cubic-bezier(.55,0,.75,.5); }
  28.2%     { transform: rotate(52.5deg); animation-timing-function: cubic-bezier(.6,.05,.4,1); }
  29.7%     { transform: rotate(52.5deg); animation-timing-function: cubic-bezier(.25,.9,.35,1); }
  32.8%     { transform: rotate(44deg);   animation-timing-function: cubic-bezier(.6,.05,.4,1); }
  34.8%     { transform: rotate(44deg);   animation-timing-function: cubic-bezier(.55,0,.75,.5); }
  37.1%     { transform: rotate(53deg);   animation-timing-function: cubic-bezier(.6,.05,.4,1); }
  38.3%     { transform: rotate(53deg);   animation-timing-function: cubic-bezier(.3,.7,.4,1); }
  42.2%     { transform: rotate(42deg);   animation-timing-function: linear; }
  44.6%     { transform: rotate(42deg);   animation-timing-function: cubic-bezier(.2,1.2,.4,1); }
  47.4%     { transform: rotate(-8deg);   animation-timing-function: cubic-bezier(.4,0,.5,1); }
  49.5%     { transform: rotate(3deg);    animation-timing-function: cubic-bezier(.4,0,.5,1); }
  51.7%     { transform: rotate(-1deg);   animation-timing-function: cubic-bezier(.4,0,.5,1); }
  53.8%, 61.5% { transform: rotate(0deg); animation-timing-function: cubic-bezier(.5,.05,.5,1); }
  65.4%, 68.5% { transform: rotate(-12deg); animation-timing-function: cubic-bezier(.5,.05,.5,1); }
  72.3%, 100%  { transform: rotate(0deg); }
}

/* Celebratory hop after the gulp (translate layer above the rotation) */
@keyframes wren-forage-hop {
  0%, 74%   { transform: none; animation-timing-function: cubic-bezier(.2,.9,.4,1); }
  75.4%     { transform: translateY(-7px); animation-timing-function: cubic-bezier(.6,.05,.9,.6); }
  76.9%     { transform: translateY(0);   animation-timing-function: cubic-bezier(.4,0,.6,1); }
  77.7%     { transform: scale(1.05, .94); animation-timing-function: cubic-bezier(.3,.8,.4,1); }
  79.2%, 100% { transform: none; }
}

/* Blink + effort squint */
@keyframes wren-forage-eye {
  0%, 4.3%  { transform: scaleY(1); }
  4.8%      { transform: scaleY(.08); }
  5.5%, 38.3% { transform: scaleY(1); }
  39.5%, 44.6% { transform: scaleY(.45); }
  46.5%, 84.9% { transform: scaleY(1); }
  85.4%     { transform: scaleY(.08); }
  86.1%, 100% { transform: scaleY(1); }
}

/* Worm in the ground: oblivious bob → elastic stretches synced to the
   tugs → gone at the pop → the next worm surfaces during the rest. */
@keyframes wren-forage-worm-ground {
  0%        { transform: none; opacity: 1; animation-timing-function: cubic-bezier(.5,.05,.5,1); }
  2.5%      { transform: translateY(-1.5px); animation-timing-function: cubic-bezier(.5,.05,.5,1); }
  5%        { transform: none; animation-timing-function: cubic-bezier(.5,.05,.5,1); }
  7.5%      { transform: translateY(-1px); animation-timing-function: cubic-bezier(.5,.05,.5,1); }
  9.2%, 21.2% { transform: none; animation-timing-function: cubic-bezier(.25,.9,.35,1); }
  24.3%     { transform: rotate(-4deg) scaleY(1.30); animation-timing-function: cubic-bezier(.55,0,.75,.5); }
  25.9%     { transform: rotate(-4deg) scaleY(1.30); animation-timing-function: cubic-bezier(.55,0,.75,.5); }
  28.2%     { transform: rotate(0deg) scaleY(1); animation-timing-function: cubic-bezier(.4,.8,.5,1); }
  29%       { transform: rotate(0deg) scaleY(.94); animation-timing-function: cubic-bezier(.4,.8,.5,1); }
  29.7%     { transform: none; animation-timing-function: cubic-bezier(.25,.9,.35,1); }
  32.8%     { transform: rotate(-5deg) scaleY(1.39); animation-timing-function: cubic-bezier(.55,0,.75,.5); }
  34.8%     { transform: rotate(-5deg) scaleY(1.39); animation-timing-function: cubic-bezier(.55,0,.75,.5); }
  37.1%     { transform: rotate(0deg) scaleY(1); animation-timing-function: cubic-bezier(.4,.8,.5,1); }
  37.8%     { transform: rotate(0deg) scaleY(.95); animation-timing-function: cubic-bezier(.4,.8,.5,1); }
  38.3%     { transform: none; animation-timing-function: cubic-bezier(.3,.7,.4,1); }
  42.2%     { transform: rotate(-6deg) scaleY(1.47); animation-timing-function: linear; }
  44.6%     { transform: rotate(-6deg) scaleY(1.47); opacity: 1; }
  44.7%     { transform: translateY(16px); opacity: 0; }
  89%       { transform: translateY(16px); opacity: 0; }
  90%       { transform: translateY(16px); opacity: 1; animation-timing-function: cubic-bezier(.2,.8,.4,1); }
  96%, 100% { transform: none; opacity: 1; }
}

/* Worm dangling from the beak (inside the bird group, so it rides the
   spring-back), then slurped at the gulp. */
@keyframes wren-forage-worm-dangle {
  0%, 44.6% { opacity: 0; transform: rotate(-28deg) scale(1); }
  44.7%     { opacity: 1; transform: rotate(-28deg) scale(1); animation-timing-function: cubic-bezier(.3,.8,.4,1); }
  47.4%     { transform: rotate(22deg) scale(1);  animation-timing-function: cubic-bezier(.4,0,.5,1); }
  49.5%     { transform: rotate(-13deg) scale(1); animation-timing-function: cubic-bezier(.4,0,.5,1); }
  51.7%     { transform: rotate(7deg) scale(1);   animation-timing-function: cubic-bezier(.4,0,.5,1); }
  53.8%     { transform: rotate(0deg) scale(1);   animation-timing-function: cubic-bezier(.5,.05,.5,1); }
  56.5%     { transform: rotate(9deg) scale(1);   animation-timing-function: cubic-bezier(.5,.05,.5,1); }
  59%       { transform: rotate(-9deg) scale(1);  animation-timing-function: cubic-bezier(.5,.05,.5,1); }
  61.5%     { transform: rotate(0deg) scale(1); opacity: 1; animation-timing-function: cubic-bezier(.55,0,.8,.5); }
  65.4%     { transform: rotate(0deg) scale(.55); opacity: 1; }
  66.9%, 100% { transform: rotate(0deg) scale(.1); opacity: 0; }
}

/* Dirt flecks at the pop */
@keyframes wren-forage-d1 {
  0%, 44.6% { transform: none; opacity: 0; }
  44.7%     { opacity: .9; animation-timing-function: cubic-bezier(.2,.7,.4,1); }
  50.5%, 100% { transform: translate(-9px, -17px); opacity: 0; }
}
@keyframes wren-forage-d2 {
  0%, 44.6% { transform: none; opacity: 0; }
  44.7%     { opacity: .9; animation-timing-function: cubic-bezier(.2,.7,.4,1); }
  51.5%, 100% { transform: translate(1px, -22px); opacity: 0; }
}
@keyframes wren-forage-d3 {
  0%, 44.6% { transform: none; opacity: 0; }
  44.7%     { opacity: .9; animation-timing-function: cubic-bezier(.2,.7,.4,1); }
  50%, 100% { transform: translate(8px, -14px); opacity: 0; }
}

/* Ours: the wren in the stage's green, with a soft glow in the dark. */
.lobby__wren { position: relative; display: flex; flex-direction: column; align-items: center; margin-bottom: 28px; animation: rise 0.9s var(--s-ease) both; }
.lobby__ground {
  width: 260px; height: 26px; margin-top: -14px; border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(217, 238, 80, 0.22), transparent 70%);
  animation: glow-breathe 6.5s ease-in-out infinite;
}
.ended__wren { margin-bottom: 18px; }
.suggest__label { align-items: center; }
.stage .wren-forage, .stage .wren-mark { color: var(--macaw); }
.stage .wren-forage { filter: drop-shadow(0 0 14px rgba(217, 238, 80, 0.35)); overflow: visible; }

/* ---------------- narrower screens ---------------- */

@media (max-width: 1180px) {
  .live { grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); }
  .live__notes { display: none; }
}
@media (max-width: 760px) {
  .stage__top { padding: 0 16px; }
  .stage__appname, .stage__live, .stage__who { display: none; }
  .lobby { padding: 16px 16px 120px; }
  .lobby__line { font-size: 16px; margin-bottom: 24px; }
  .live { grid-template-columns: 1fr; overflow-y: auto; padding: 16px 16px 0; }
  .live__transcript { min-height: 300px; }
  .rail { grid-template-columns: 1fr; }
  .dock__text, .dock__device, .dock__sep { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .stage *, .stage *::before, .stage *::after, .stage { animation: none !important; transition: none !important; }
  .focus__slot.is-leaving { display: none; }
}
