/* ==========================================================================
   AWOOGA — TuGPT
   --------------------------------------------------------------------------
   The boat's onboard AI, brought out of the web portal and onto the main site.
   Two pieces live here:

     1. .tugpt-invite — the on-page invitation (currently on build.php), a card
        that sits in the flow of the page and opens the console.
     2. .tugpt        — the console itself: a full-screen overlay that
        assets/js/tugpt.js injects into <body> once, on any page that loads it.

   Everything is namespaced under .tugpt* and scoped to the overlay, so this can
   be dropped onto any page without touching that page's own styles. Colours all
   come from tokens.css, so the console re-skins with the rest of the site.

   The console is deliberately a *place*, not a chat bubble in a corner: brass
   header, chart-paper thread, and a waterline that never stops moving along the
   bottom. It should feel like you stepped into her wheelhouse and asked.
   ========================================================================== */

/* ==========================================================================
   1. THE INVITATION (in-page)
   ========================================================================== */
.tugpt-section { overflow: hidden; }

.tugpt-invite {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 200px) minmax(0, 1fr);
  gap: clamp(1.2rem, 3vw, 2.6rem);
  align-items: center;
  max-width: 1000px;
  margin-inline: auto;
  padding: clamp(1.6rem, 3.4vw, 2.6rem);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(201, 162, 39, 0.3);
  background:
    radial-gradient(120% 140% at 12% 0%, rgba(201, 162, 39, 0.14), transparent 55%),
    linear-gradient(165deg, var(--navy-800), var(--navy-900) 70%);
  box-shadow: var(--shadow-lg);
  isolation: isolate;
  overflow: hidden;
}
/* Faint sonar rings behind the mascot — the same visual language as the Sonar
   heatmap on the About page, purely decorative here. */
.tugpt-invite::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: -60px;
  top: 50%;
  width: 420px;
  height: 420px;
  transform: translateY(-50%);
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 32%, rgba(227, 195, 90, 0.09) 33%, transparent 34%),
    radial-gradient(circle, transparent 52%, rgba(227, 195, 90, 0.07) 53%, transparent 54%),
    radial-gradient(circle, transparent 72%, rgba(227, 195, 90, 0.05) 73%, transparent 74%);
  pointer-events: none;
}

.tugpt-invite__art {
  position: relative;
  justify-self: center;
  width: min(200px, 46vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}
.tugpt-invite__art img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.45));
  animation: tugpt-bob 5.5s ease-in-out infinite;
}
/* Three bubbles drifting up out of her stack, endlessly. */
.tugpt-invite__bubbles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.tugpt-invite__bubbles i {
  position: absolute;
  left: 50%;
  bottom: 58%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid rgba(227, 195, 90, 0.55);
  background: rgba(227, 195, 90, 0.12);
  opacity: 0;
  animation: tugpt-rise 4.2s linear infinite;
}
.tugpt-invite__bubbles i:nth-child(2) { width: 8px;  height: 8px;  animation-delay: 1.4s; }
.tugpt-invite__bubbles i:nth-child(3) { width: 16px; height: 16px; animation-delay: 2.8s; }

.tugpt-invite__body .eyebrow { color: var(--brass-lt); }
.tugpt-invite__body .eyebrow::before { background: var(--brass-lt); }
.tugpt-invite__body h2 { color: var(--cream); margin-bottom: 0.5rem; }
.tugpt-invite__body .lead { color: rgba(247, 241, 227, 0.76); max-width: 56ch; }

.tugpt-invite__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
  margin-top: 1.4rem;
}
/* Small print beside the button: what it costs you, in one breath. */
.tugpt-invite__note {
  font-size: 0.8rem;
  color: rgba(247, 241, 227, 0.5);
  margin: 0;
}

/* Seed questions — tap one and the console opens with it already asked. */
.tugpt-seeds {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.3rem 0 0;
  padding: 0;
  list-style: none;
}
.tugpt-seed {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  border: 1px dashed rgba(227, 195, 90, 0.4);
  background: rgba(227, 195, 90, 0.07);
  color: rgba(247, 241, 227, 0.86);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.25;
  text-align: left;
  transition: background-color 0.22s var(--ease), border-color 0.22s var(--ease),
    color 0.22s var(--ease), transform 0.22s var(--ease);
}
/* A straight quote glyph reads as an inch mark at this size — a brass dot says
   "this is a thing you tap" without pretending to be punctuation. */
.tugpt-seed::before {
  content: "";
  flex: 0 0 auto;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brass-lt);
}
.tugpt-seed:hover,
.tugpt-seed:focus-visible {
  background: rgba(227, 195, 90, 0.17);
  border-color: var(--brass-lt);
  border-style: solid;
  color: #fff;
  transform: translateY(-2px);
  outline: none;
}

@media (max-width: 720px) {
  .tugpt-invite { grid-template-columns: 1fr; text-align: center; }
  .tugpt-invite__body .eyebrow { justify-content: center; }
  .tugpt-invite__body .lead { margin-inline: auto; }
  .tugpt-invite__cta, .tugpt-seeds { justify-content: center; }
  .tugpt-invite::before { display: none; }
}

/* ==========================================================================
   2. THE CONSOLE (overlay)
   ========================================================================== */
.tugpt {
  position: fixed;
  inset: 0;
  z-index: 99996;
  display: grid;
  place-items: center;
  padding: clamp(0px, 3vw, 28px);
  /* Hidden without display:none, so the open/close transitions can run. */
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s var(--ease), visibility 0s linear 0.3s;
}
.tugpt.is-open {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.3s var(--ease), visibility 0s;
}
/* display:grid above outranks the UA's [hidden] rule, so say it explicitly.
   The attribute is only set once the close transition has finished. */
.tugpt[hidden] { display: none; }
/* Off-screen live region: finished answers are announced here once, because
   the thread itself streams character by character. */
.tugpt__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.tugpt__scrim {
  position: absolute;
  inset: 0;
  background: rgba(6, 16, 27, 0.62);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.tugpt__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(760px, 100%);
  height: min(720px, 100%);
  max-height: 100%;
  border-radius: clamp(0px, 2vw, 26px);
  overflow: hidden;
  background: var(--paper);
  border: 1px solid rgba(201, 162, 39, 0.45);
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.75);
  transform: translateY(26px) scale(0.975);
  opacity: 0;
  transition: transform 0.42s var(--ease), opacity 0.3s var(--ease);
}
.tugpt.is-open .tugpt__panel { transform: none; opacity: 1; }

/* ---------- Header ------------------------------------------------------- */
.tugpt__head {
  position: relative;
  z-index: 3;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 0.9rem 0.85rem 1.05rem;
  background:
    radial-gradient(90% 200% at 0% 0%, rgba(201, 162, 39, 0.22), transparent 60%),
    linear-gradient(160deg, var(--navy-800), var(--navy-900));
  border-bottom: 1px solid rgba(201, 162, 39, 0.45);
  box-shadow: 0 10px 30px -22px rgba(0, 0, 0, 0.9);
}
.tugpt__avatar {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px solid rgba(227, 195, 90, 0.5);
  background: rgba(227, 195, 90, 0.12);
  overflow: hidden;
}
.tugpt__avatar img { width: 34px; height: 34px; object-fit: contain; }
.tugpt.is-thinking .tugpt__avatar img { animation: tugpt-bob 1.7s ease-in-out infinite; }

.tugpt__id { min-width: 0; flex: 1 1 auto; }
.tugpt__id h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--cream);
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.tugpt__sub {
  margin: 0.12rem 0 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.74rem;
  font-weight: 500;
  color: rgba(247, 241, 227, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tugpt__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6);
  animation: tugpt-pulse 2.4s ease-out infinite;
  flex: 0 0 auto;
}
.tugpt__mode { color: var(--brass-lt); font-weight: 600; }

.tugpt__tools { display: flex; align-items: center; gap: 0.3rem; flex: 0 0 auto; }
.tugpt__tool {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(247, 241, 227, 0.16);
  border-radius: 10px;
  background: rgba(247, 241, 227, 0.06);
  color: rgba(247, 241, 227, 0.8);
  font-size: 0.95rem;
  line-height: 1;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease),
    color 0.2s var(--ease), transform 0.2s var(--ease);
}
.tugpt__tool:hover,
.tugpt__tool:focus-visible {
  background: rgba(227, 195, 90, 0.18);
  border-color: rgba(227, 195, 90, 0.55);
  color: #fff;
  transform: translateY(-1px);
  outline: none;
}
.tugpt__tool[aria-expanded="true"] {
  background: rgba(227, 195, 90, 0.24);
  border-color: var(--brass-lt);
  color: #fff;
}
.tugpt__tool svg { width: 17px; height: 17px; }
.tugpt__tool--close { font-size: 1.3rem; }

/* ---------- Mood tray ---------------------------------------------------- */
.tugpt__moods {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.45rem;
  padding: 0.75rem 0.9rem;
  background: var(--navy-900);
  border-bottom: 1px solid rgba(201, 162, 39, 0.28);
}
.tugpt__moods[hidden] { display: none; }
.tugpt__mood-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid rgba(247, 241, 227, 0.14);
  border-radius: 12px;
  background: rgba(247, 241, 227, 0.05);
  color: rgba(247, 241, 227, 0.82);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: left;
  line-height: 1.2;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease),
    color 0.2s var(--ease), transform 0.2s var(--ease);
}
.tugpt__mood-btn em { font-style: normal; font-size: 1.05rem; flex: 0 0 auto; }
.tugpt__mood-btn:hover,
.tugpt__mood-btn:focus-visible {
  background: rgba(227, 195, 90, 0.14);
  border-color: rgba(227, 195, 90, 0.5);
  color: #fff;
  transform: translateY(-1px);
  outline: none;
}
.tugpt__mood-btn[aria-pressed="true"] {
  background: rgba(227, 195, 90, 0.22);
  border-color: var(--brass-lt);
  color: #fff;
}

/* ---------- Thread ------------------------------------------------------- */
.tugpt__thread {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1.15rem 1.05rem 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  /* The same faint chart grid the site body uses, so the console reads as a
     window onto the site rather than a foreign widget bolted on. */
  background-image: radial-gradient(circle at center, rgba(12, 32, 52, 0.055) 1px, transparent 1.4px);
  background-size: 24px 24px;
  scrollbar-width: thin;
  scrollbar-color: rgba(12, 32, 52, 0.22) transparent;
}
.tugpt__thread::-webkit-scrollbar { width: 9px; }
.tugpt__thread::-webkit-scrollbar-thumb {
  background: rgba(12, 32, 52, 0.2);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: content-box;
}

.tugpt__msg {
  max-width: min(84%, 560px);
  padding: 0.7rem 0.95rem;
  border-radius: 16px;
  font-size: 0.94rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
  animation: tugpt-in 0.4s var(--ease) both;
}
.tugpt__msg a { color: var(--navy-600); text-decoration: underline; text-underline-offset: 2px; }
.tugpt__text { white-space: pre-wrap; }

.tugpt__msg--boat {
  align-self: flex-start;
  background: var(--surface);
  color: var(--text);
  border: 1px solid rgba(12, 32, 52, 0.1);
  border-bottom-left-radius: 5px;
  box-shadow: var(--shadow-sm);
}
.tugpt__msg--you {
  align-self: flex-end;
  background: linear-gradient(160deg, var(--navy-700), var(--navy-900));
  color: var(--cream);
  border-bottom-right-radius: 5px;
  box-shadow: 0 10px 26px -18px rgba(12, 32, 52, 0.9);
}
.tugpt__msg--you a { color: var(--brass-lt); }
/* --wood-dk is near-invisible on navy; her side of the thread keeps it. */
.tugpt__msg--you .tugpt__who { color: rgba(227, 195, 90, 0.78); }

.tugpt__who {
  display: block;
  margin-bottom: 0.22rem;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--wood-dk);
}

/* The cursor trailing the answer while it is still being typed out. It waits
   for the first character to land — until then the bubbles say enough. */
.tugpt__msg.is-waiting .tugpt__text::after { content: none; }
.tugpt__msg.is-typing .tugpt__text::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 2px;
  vertical-align: -0.15em;
  background: var(--brass);
  animation: tugpt-caret 1s steps(2) infinite;
}

/* Bubbles rising out of her stack while she thinks. */
.tugpt__thinking {
  display: inline-flex;
  align-items: flex-end;
  gap: 5px;
  height: 1.5em;
}
.tugpt__thinking i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1.5px solid rgba(29, 77, 120, 0.55);
  background: rgba(29, 77, 120, 0.2);
  animation: tugpt-think 1.25s ease-in-out infinite;
}
.tugpt__thinking i:nth-child(2) { animation-delay: 0.18s; }
.tugpt__thinking i:nth-child(3) { animation-delay: 0.36s; }

/* Photos she decides are worth showing you. */
.tugpt__photo {
  align-self: flex-start;
  max-width: min(84%, 560px);
  margin: 0;
  padding: 6px;
  border-radius: 16px;
  border: 1px solid rgba(201, 162, 39, 0.35);
  background: rgba(201, 162, 39, 0.08);
  animation: tugpt-in 0.4s var(--ease) both;
}
.tugpt__photo img {
  width: 100%;
  border-radius: 11px;
  cursor: zoom-in;
  display: block;
}
.tugpt__photo figcaption {
  margin: 0.4rem 0.25rem 0.15rem;
  font-size: 0.74rem;
  font-style: italic;
  color: var(--text-soft);
}

/* Helpful? — the rating row under a finished answer. */
.tugpt__rate {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.55rem;
  padding-top: 0.5rem;
  border-top: 1px dashed rgba(12, 32, 52, 0.14);
}
.tugpt__rate-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-soft);
  margin-right: 0.1rem;
}
.tugpt__rate-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(12, 32, 52, 0.14);
  border-radius: 9px;
  background: var(--surface);
  font-size: 0.85rem;
  line-height: 1;
  transition: transform 0.18s var(--ease), border-color 0.18s var(--ease),
    background-color 0.18s var(--ease);
}
.tugpt__rate-btn:hover:not(:disabled) { transform: translateY(-2px) scale(1.06); border-color: var(--brass); }
.tugpt__rate-btn:disabled { cursor: default; opacity: 0.4; }
.tugpt__rate-btn.is-picked { opacity: 1; border-color: var(--brass); background: rgba(201, 162, 39, 0.18); }
.tugpt__rate-note { font-size: 0.72rem; font-weight: 600; color: var(--wood-dk); }

/* The "want the captain to text you a real answer?" card. */
.tugpt__followup {
  align-self: stretch;
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  border: 1px dashed rgba(184, 71, 63, 0.4);
  background: rgba(184, 71, 63, 0.06);
  animation: tugpt-in 0.4s var(--ease) both;
}
.tugpt__followup h3 {
  margin: 0 0 0.25rem;
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--navy-900);
}
.tugpt__followup p { margin: 0 0 0.6rem; font-size: 0.8rem; color: var(--text-soft); line-height: 1.5; }
.tugpt__followup-row { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.tugpt__followup input {
  flex: 1 1 170px;
  min-width: 0;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(12, 32, 52, 0.16);
  border-radius: 10px;
  background: var(--surface);
  font: inherit;
  font-size: 0.86rem;
  color: var(--text);
}
.tugpt__followup input:focus-visible { outline: 2px solid var(--brass); outline-offset: 1px; }
.tugpt__followup button {
  padding: 0.5rem 0.9rem;
  border: 0;
  border-radius: 10px;
  background: var(--red);
  color: #fff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
}
.tugpt__followup button:hover { background: var(--red-dk); }
/* Scoped past .tugpt__followup button above, which would otherwise make the
   opt-out look like the primary action. */
.tugpt__followup .tugpt__followup-skip,
.tugpt__followup .tugpt__followup-skip:hover {
  margin-top: 0.5rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-soft);
  font: inherit;
  font-size: 0.75rem;
  text-decoration: underline;
}
.tugpt__followup-status { margin: 0.45rem 0 0; font-size: 0.75rem; color: var(--text-soft); }

/* ---------- Follow-up seeds (below the thread) --------------------------- */
.tugpt__quick {
  flex: 0 0 auto;
  display: flex;
  gap: 0.4rem;
  padding: 0.55rem 1.05rem 0.15rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.tugpt__quick::-webkit-scrollbar { display: none; }
.tugpt__quick[hidden] { display: none; }
.tugpt__quick-btn {
  flex: 0 0 auto;
  padding: 0.38rem 0.8rem;
  border: 1px dashed rgba(12, 32, 52, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--navy-800);
  font: inherit;
  font-size: 0.79rem;
  font-weight: 500;
  white-space: nowrap;
  animation: tugpt-in 0.35s var(--ease) both;
  transition: background-color 0.18s var(--ease), border-color 0.18s var(--ease),
    transform 0.18s var(--ease);
}
.tugpt__quick-btn:hover,
.tugpt__quick-btn:focus-visible {
  background: rgba(201, 162, 39, 0.16);
  border-color: var(--brass);
  border-style: solid;
  transform: translateY(-1px);
  outline: none;
}

/* ---------- Composer ----------------------------------------------------- */
.tugpt__composer {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  /* The extra bottom padding keeps the footer line clear of the waterline,
     which is painted over the very bottom edge of the panel. */
  padding: 0.7rem 1.05rem 1.5rem;
  background: linear-gradient(180deg, transparent, var(--paper) 40%);
}
.tugpt__row {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  padding: 0.35rem 0.35rem 0.35rem 0.9rem;
  border: 1.5px solid rgba(12, 32, 52, 0.14);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.tugpt__row:focus-within {
  border-color: var(--brass);
  box-shadow: 0 0 0 4px rgba(201, 162, 39, 0.16);
}
.tugpt__input {
  flex: 1 1 auto;
  min-width: 0;
  max-height: 110px;
  padding: 0.5rem 0;
  border: 0;
  background: none;
  resize: none;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text);
}
.tugpt__input:focus { outline: none; }
.tugpt__input::placeholder { color: rgba(74, 93, 104, 0.6); }

.tugpt__send {
  position: relative;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(160deg, var(--navy-700), var(--navy-900));
  color: var(--cream);
  box-shadow: 0 8px 20px -12px rgba(12, 32, 52, 0.9);
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}
.tugpt__send svg { width: 19px; height: 19px; }
.tugpt__send:hover:not(:disabled) { transform: translateY(-2px) scale(1.04); }
.tugpt__send:disabled { opacity: 0.4; cursor: not-allowed; }
.tugpt__send:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

.tugpt__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin: 0.45rem 0.3rem 0;
  font-size: 0.7rem;
  color: var(--text-soft);
}
.tugpt__count { font-variant-numeric: tabular-nums; opacity: 0.75; }
.tugpt__foot a { color: var(--wood-dk); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Waterline ---------------------------------------------------- */
/* Two wave bands sliding at different speeds along the bottom edge. Purely
   decorative and pointer-transparent — she is always afloat. */
.tugpt__water {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 18px;
  overflow: hidden;
  pointer-events: none;
  /* Above the composer, which paints an opaque --paper background of its own. */
  z-index: 3;
}
.tugpt__water svg { position: absolute; bottom: -2px; left: 0; width: 200%; height: 100%; }
.tugpt__water svg:nth-child(1) { animation: tugpt-drift 14s linear infinite; opacity: 0.45; }
.tugpt__water svg:nth-child(2) { animation: tugpt-drift 9s linear infinite reverse; opacity: 0.28; }

/* ---------- Stumped-the-AI celebration ----------------------------------- */
.tugpt__stump {
  align-self: stretch;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(201, 162, 39, 0.55);
  background: linear-gradient(140deg, rgba(201, 162, 39, 0.2), rgba(201, 162, 39, 0.06));
  animation: tugpt-in 0.45s var(--ease) both;
}
.tugpt__stump-medal { font-size: 2rem; line-height: 1; animation: tugpt-bob 2.4s ease-in-out infinite; }
.tugpt__stump strong { display: block; font-family: var(--font-display); font-size: 1rem; color: var(--navy-900); }
.tugpt__stump span { font-size: 0.8rem; color: var(--text-soft); line-height: 1.5; }

.tugpt__confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 4;
}
.tugpt__confetti i {
  position: absolute;
  top: -14px;
  width: 8px;
  height: 12px;
  border-radius: 2px;
  animation: tugpt-fall linear forwards;
}

/* ---------- Keyframes ---------------------------------------------------- */
@keyframes tugpt-bob {
  0%, 100% { transform: translateY(0) rotate(-1.5deg); }
  50%      { transform: translateY(-7px) rotate(1.5deg); }
}
@keyframes tugpt-rise {
  0%   { opacity: 0; transform: translate(-50%, 0) scale(0.6); }
  12%  { opacity: 1; }
  80%  { opacity: 0.7; }
  100% { opacity: 0; transform: translate(calc(-50% + 22px), -190px) scale(1.15); }
}
@keyframes tugpt-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.55); }
  70%  { box-shadow: 0 0 0 7px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}
@keyframes tugpt-in {
  from { opacity: 0; transform: translateY(9px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}
@keyframes tugpt-think {
  0%, 100% { transform: translateY(0);    opacity: 0.35; }
  50%      { transform: translateY(-7px); opacity: 1; }
}
@keyframes tugpt-caret { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes tugpt-drift { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes tugpt-fall {
  from { transform: translateY(0) rotate(0deg); opacity: 1; }
  to   { transform: translateY(760px) rotate(720deg); opacity: 0; }
}

/* ---------- Small screens ------------------------------------------------ */
@media (max-width: 560px) {
  .tugpt { padding: 0; }
  .tugpt__panel { width: 100%; height: 100%; border-radius: 0; border: 0; }
  .tugpt__msg { max-width: 90%; }
  .tugpt__moods { grid-template-columns: 1fr 1fr; }
  /* The tagline is the first thing to go: on a phone the header has room for
     the name and the current mood, and nothing else. */
  .tugpt__tagline { display: none; }
  .tugpt__foot { font-size: 0.66rem; }
  .tugpt__count { white-space: nowrap; }
}

/* ---------- Reduced motion ----------------------------------------------- */
/* Everything that loops or travels stops. The console still opens, streams and
   answers — it just does it without the theatre. */
@media (prefers-reduced-motion: reduce) {
  .tugpt-invite__art img,
  .tugpt-invite__bubbles i,
  .tugpt__avatar img,
  .tugpt__dot,
  .tugpt__water svg,
  .tugpt__stump-medal,
  .tugpt__msg,
  .tugpt__photo,
  .tugpt__quick-btn,
  .tugpt__followup,
  .tugpt__stump { animation: none !important; }
  .tugpt__confetti { display: none; }
  .tugpt__panel { transition: opacity 0.2s linear; transform: none; }
  .tugpt__thinking i { animation-duration: 2s; }
}
