/* ==========================================================
   Reachy Tell Me — standalone styles (no framework)
   ========================================================== */

:root {
  --radius: 1.25rem;

  --jungle-deep: oklch(0.22 0.06 170);
  --jungle-mid:  oklch(0.32 0.09 165);
  --jungle-leaf: oklch(0.55 0.16 155);
  --firefly:     oklch(0.92 0.18 105);

  --background: oklch(0.18 0.05 175);
  --foreground: oklch(0.97 0.02 90);

  --card: oklch(0.26 0.07 170 / 0.78);
  --primary: oklch(0.85 0.16 95);
  --primary-foreground: oklch(0.20 0.06 170);
  --muted: oklch(0.28 0.05 170);
  --muted-foreground: oklch(0.78 0.04 100);
  --border: oklch(0.45 0.06 150 / 0.4);
  --ring: oklch(0.78 0.18 100);

  /* Question card palette swatches drawn from the jungle background. */
  --c-emerald: linear-gradient(135deg, oklch(0.42 0.13 170), oklch(0.22 0.08 175));
  --c-leaf:    linear-gradient(135deg, oklch(0.55 0.16 155), oklch(0.28 0.10 165));
  --c-dawn:    linear-gradient(135deg, oklch(0.78 0.18 95),  oklch(0.32 0.10 165));
  --c-aqua:    linear-gradient(135deg, oklch(0.62 0.13 200), oklch(0.24 0.08 195));
  --c-moss:    linear-gradient(135deg, oklch(0.50 0.12 145), oklch(0.20 0.07 165));
  --c-firefly: linear-gradient(135deg, oklch(0.85 0.16 95),  oklch(0.40 0.12 165));
  --c-orchid:  linear-gradient(135deg, oklch(0.55 0.18 320), oklch(0.25 0.08 200));
  --c-citrus:  linear-gradient(135deg, oklch(0.82 0.18 110), oklch(0.30 0.10 175));
}

* { box-sizing: border-box; border-color: var(--border); }

html, body {
  margin: 0;
  padding: 0;
  background: var(--background);
  color: var(--foreground);
  min-height: 100%;
  font-family: ui-rounded, "SF Pro Rounded", "Nunito", "Quicksand", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, select { font-family: inherit; }
img { display: block; max-width: 100%; }

/* ============ Layout ============ */
.app {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.shell {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 420px;
  min-height: 820px;
  display: flex;
  flex-direction: column;
}

.screen { display: none; flex: 1; flex-direction: column; padding: 32px 24px; }
.screen.is-active { display: flex; }

.row { display: flex; align-items: center; }
.row-between { display: flex; align-items: center; justify-content: space-between; }
.center { display: flex; align-items: center; justify-content: center; }
.text-center { text-align: center; }
.flex-1 { flex: 1; }
.mt-auto { margin-top: auto; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.hidden { display: none !important; }

/* ============ Typography ============ */
.title {
  font-size: 38px;
  font-weight: 900;
  line-height: 0.95;
  margin: 20px 0 0;
}
.title .accent { color: var(--primary); }
.h2 { font-size: 28px; font-weight: 900; line-height: 1.1; margin: 12px 0 0; text-align: center; }
.h2 .accent { color: var(--primary); }
.subtitle {
  margin: 12px auto 0;
  max-width: 20rem;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted-foreground);
  text-align: center;
}
.kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.label-uppercase {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.help {
  margin-top: 12px;
  font-size: 11px;
  line-height: 16px;
  font-weight: 600;
  color: var(--muted-foreground);
  text-align: center;
}
.help-left { text-align: left; }
.footer-line {
  margin-top: auto;
  padding-top: 24px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: oklch(0.78 0.04 100 / 0.7);
}

/* ============ Chip ============ */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: oklch(0.30 0.07 170 / 0.6);
  border: 1px solid oklch(0.85 0.16 95 / 0.25);
  color: oklch(0.95 0.06 95);
}
.chip svg { width: 12px; height: 12px; color: var(--primary); }

/* ============ Cards ============ */
.jungle-card {
  background:
    linear-gradient(180deg,
      oklch(0.30 0.07 170 / 0.78) 0%,
      oklch(0.22 0.06 175 / 0.85) 100%);
  backdrop-filter: blur(8px);
  border: 1px solid oklch(0.85 0.16 95 / 0.18);
  box-shadow:
    0 1px 0 oklch(0.95 0.10 95 / 0.10) inset,
    0 18px 40px -20px oklch(0 0 0 / 0.6),
    0 0 0 1px oklch(0 0 0 / 0.15);
  border-radius: 24px;
}
.card-pad { padding: 20px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 56px;
  width: 100%;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 900;
  transition: transform 0.1s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-cta {
  background: linear-gradient(135deg,
    oklch(0.88 0.16 95) 0%,
    oklch(0.78 0.18 75) 100%);
  color: oklch(0.20 0.06 170);
  box-shadow:
    0 1px 0 oklch(1 0 0 / 0.4) inset,
    0 -2px 0 oklch(0.20 0.06 170 / 0.15) inset,
    0 12px 28px -10px oklch(0.85 0.16 95 / 0.55);
  letter-spacing: 0.01em;
}

.btn-hf {
  background: oklch(0.18 0.04 175);
  color: var(--foreground);
  border: 1px solid oklch(0.55 0.16 155 / 0.5);
}
.btn-hf:hover { background: oklch(0.22 0.05 175); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
}
.icon-btn.chip { background: oklch(0.30 0.07 170 / 0.6); border: 1px solid oklch(0.85 0.16 95 / 0.25); padding: 0; }

.round-btn {
  width: 40px; height: 40px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted-foreground);
}
.round-btn:hover { color: var(--foreground); }
.round-cta {
  width: 40px; height: 40px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, oklch(0.88 0.16 95) 0%, oklch(0.78 0.18 75) 100%);
  color: oklch(0.20 0.06 170);
  flex-shrink: 0;
}

.reshuffle-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: oklch(0.30 0.07 170 / 0.55);
  border: 1px solid oklch(0.85 0.16 95 / 0.18);
  color: var(--muted-foreground);
  font-size: 11px; font-weight: 700;
}
.reshuffle-btn:hover { color: var(--foreground); }
.reshuffle-btn svg { color: var(--primary); }

/* "Looking for your robot…" / "No robot found" line under the API key
 * card on step 2, with a small refresh button. */
.robot-status {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  background: oklch(0.30 0.07 170 / 0.45);
  border: 1px solid oklch(0.85 0.16 95 / 0.18);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted-foreground);
  line-height: 1.35;
}
.robot-status #robotStatusText { flex: 1; }
.robot-retry-btn {
  width: 32px; height: 32px;
  border-radius: 999px;
  background: oklch(0.20 0.05 175 / 0.7);
  border: 1px solid oklch(0.85 0.16 95 / 0.25);
  color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.robot-retry-btn:hover { background: oklch(0.30 0.07 170 / 0.8); }
.robot-retry-btn:active { transform: scale(0.92); }

/* Stop button — appears in the header only while Reachy is speaking. Tap
 * to instantly cancel the in-flight response (works even when voice
 * barge-in fails because of robot-mic speaker bleed). */
.stop-btn {
  width: 36px; height: 36px;
  border-radius: 999px;
  background: linear-gradient(135deg, oklch(0.72 0.20 30) 0%, oklch(0.62 0.22 25) 100%);
  border: 1px solid oklch(0.85 0.18 30 / 0.5);
  color: oklch(0.20 0.06 170);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 12px oklch(0.72 0.20 30 / 0.5);
  animation: stop-pulse 1.4s ease-in-out infinite;
}
.stop-btn:hover { transform: scale(1.05); }
.stop-btn:active { transform: scale(0.92); }
@keyframes stop-pulse {
  0%, 100% { box-shadow: 0 0 8px oklch(0.72 0.20 30 / 0.4); }
  50%      { box-shadow: 0 0 18px oklch(0.72 0.20 30 / 0.8); }
}

/* Flag-only language picker in the header. The button is just the flag;
 * tapping pops a small list of the other flags below it. No arrow, no
 * label — visual minimum. */
.lang-flag-wrap { position: relative; }
.lang-flag-btn {
  width: 36px; height: 36px;
  border-radius: 999px;
  background: oklch(0.30 0.07 170 / 0.55);
  border: 1px solid oklch(0.85 0.16 95 / 0.25);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; line-height: 1;
  cursor: pointer;
  transition: transform 0.1s ease;
}
.lang-flag-btn:hover { transform: scale(1.05); }
.lang-flag-btn:active { transform: scale(0.95); }

.lang-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  display: flex; flex-direction: column;
  gap: 4px;
  padding: 6px;
  background: oklch(0.20 0.06 175 / 0.95);
  border: 1px solid oklch(0.85 0.16 95 / 0.25);
  border-radius: 14px;
  box-shadow: 0 12px 32px -8px oklch(0 0 0 / 0.5);
  z-index: 30;
  animation: fade-in 0.15s ease;
}
.lang-popover.hidden { display: none; }
.lang-flag-opt {
  width: 36px; height: 36px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; line-height: 1;
  cursor: pointer;
  transition: transform 0.1s ease, border-color 0.15s ease, background 0.15s ease;
}
.lang-flag-opt:hover { background: oklch(0.30 0.07 170 / 0.6); transform: scale(1.05); }
.lang-flag-opt.is-current {
  border-color: oklch(0.85 0.16 95 / 0.7);
  box-shadow: 0 0 0 2px oklch(0.85 0.16 95 / 0.25);
}

/* ============ Input ============ */
.jungle-input {
  background: oklch(0.20 0.05 175 / 0.7);
  border: 1px solid oklch(0.55 0.16 155 / 0.4);
  color: var(--foreground);
  height: 48px;
  width: 100%;
  border-radius: 16px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 600;
  outline: none;
  margin-top: 12px;
}
.jungle-input::placeholder { color: oklch(0.70 0.05 100 / 0.6); }
.jungle-input:focus { border-color: oklch(0.85 0.16 95 / 0.7); box-shadow: 0 0 0 4px oklch(0.85 0.16 95 / 0.18); }

select.jungle-input { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--primary) 50%), linear-gradient(135deg, var(--primary) 50%, transparent 50%); background-position: calc(100% - 18px) center, calc(100% - 12px) center; background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; }

.ask-bar {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 16px;
  border-radius: 999px;
}
.ask-bar input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--foreground);
  font-size: 14px;
  font-weight: 600;
  height: 40px;
}
.ask-bar input::placeholder { color: oklch(0.78 0.04 100 / 0.6); }

/* ============ Header on ask screen ============ */
.ask-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.hf-status {
  display: flex; align-items: center; gap: 10px;
  background: oklch(0.30 0.07 170 / 0.55);
  border: 1px solid oklch(0.85 0.16 95 / 0.18);
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  min-width: 0;
}
.avatar-circle {
  width: 32px; height: 32px;
  border-radius: 999px;
  background: var(--muted);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  overflow: hidden;
  flex-shrink: 0;
}
.avatar-circle img { width: 100%; height: 100%; object-fit: cover; }
.hf-status-text { display: flex; flex-direction: column; min-width: 0; }
.hf-status-name { font-size: 12px; font-weight: 800; color: var(--foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 140px; }
.hf-status-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 700; color: var(--muted-foreground); letter-spacing: 0.06em; text-transform: uppercase; }
.dot { width: 6px; height: 6px; border-radius: 999px; display: inline-block; flex-shrink: 0; }
.dot--ok { background: oklch(0.78 0.18 145); box-shadow: 0 0 8px oklch(0.78 0.18 145 / 0.7); }
.dot--warn { background: oklch(0.82 0.18 80); box-shadow: 0 0 8px oklch(0.82 0.18 80 / 0.7); }
.dot--off { background: oklch(0.50 0.04 200); }

/* Live mic hint dot: idle (calm green), listening (pulsing brighter green),
 * speaking (warm amber). Sits in the help paragraph under the title. */
.mic-dot {
  display: inline-block;
  width: 8px; height: 8px; border-radius: 999px;
  vertical-align: middle;
  margin-right: 6px;
  margin-bottom: 2px;
}
.mic-dot--idle   { background: oklch(0.78 0.18 145); box-shadow: 0 0 6px oklch(0.78 0.18 145 / 0.7); animation: mic-breathe 2.4s ease-in-out infinite; }
.mic-dot--listen { background: oklch(0.85 0.20 135); box-shadow: 0 0 12px oklch(0.85 0.20 135 / 0.9); animation: mic-pulse 0.9s ease-in-out infinite; }
.mic-dot--talk   { background: oklch(0.85 0.18 80);  box-shadow: 0 0 10px oklch(0.85 0.18 80 / 0.85); }
@keyframes mic-breathe { 0%,100% { opacity: 0.55; } 50% { opacity: 1; } }
@keyframes mic-pulse   { 0%,100% { transform: scale(1);   opacity: 0.7; } 50% { transform: scale(1.5); opacity: 1; } }

/* Current question text — shown right under the "Reachy tell me…" title
 * once the kid asks something (voice or tap). Replaces the previous
 * full-screen overlay UX. */
.current-question {
  margin: 12px auto 0;
  max-width: 22rem;
  padding: 10px 16px;
  border-radius: 16px;
  background: oklch(0.30 0.07 170 / 0.55);
  border: 1px solid oklch(0.85 0.16 95 / 0.18);
  color: var(--foreground);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.3s ease, max-height 0.3s ease, padding 0.3s ease, margin 0.3s ease;
}
.current-question.is-visible {
  opacity: 1;
  max-height: 180px;
  padding: 10px 16px;
  margin-top: 12px;
}
.current-question .q-emoji-tag { margin-right: 6px; opacity: 0.85; }

/* ============ Robot ============ */
.robot-float { animation: robot-bob 4s ease-in-out infinite; filter: drop-shadow(0 18px 24px oklch(0 0 0 / 0.45)); display: flex; justify-content: center; }
.robot-float img { object-fit: contain; }
.robot-xl img { width: 224px; height: 224px; }
.robot-md img { width: 176px; height: 176px; }
.robot-sm img { width: 160px; height: 160px; }
.robot-tiny img { width: 128px; height: 128px; }
@keyframes robot-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

.thinking-ring { position: relative; display: inline-block; }
.thinking-ring.is-thinking::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 2px solid oklch(0.85 0.16 95 / 0.6);
  border-top-color: transparent;
  animation: spin 1.4s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ Step 2 header ============ */
.step-header { display: flex; align-items: flex-start; gap: 12px; }
.step-header .center-block { flex: 1; text-align: center; padding-right: 40px; }

/* ============ Question grid ============ */
.curious-row { display: flex; align-items: center; justify-content: space-between; margin-top: 20px; }
.curious-row h3 { margin: 0; font-size: 14px; font-weight: 900; }

.q-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding-bottom: 8px;
}
.q-card {
  position: relative;
  aspect-ratio: 5 / 3;            /* shorter — text-only, no thumbnail */
  overflow: hidden;
  border-radius: 14px;
  text-align: left;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  padding: 0;
  border: 1px solid oklch(0.85 0.16 95 / 0.18);
  box-shadow:
    0 1px 0 oklch(0.95 0.10 95 / 0.10) inset,
    0 14px 30px -18px oklch(0 0 0 / 0.55);
}
.q-card:hover { transform: translateY(-3px); box-shadow: 0 20px 40px -18px oklch(0 0 0 / 0.55); }
.q-card .q-bg {
  position: absolute; inset: 0;
  /* All cards share the same painted-jungle gradient. A small per-card
   * hue rotation (set via --hue-shift inline) keeps them distinct without
   * breaking the palette. */
  background: linear-gradient(135deg, oklch(0.42 0.13 170), oklch(0.22 0.08 175));
  filter: hue-rotate(var(--hue-shift, 0deg));
}
.q-card .q-bg::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 20%, oklch(1 0 0 / 0.18) 0%, transparent 35%),
    radial-gradient(circle at 80% 90%, oklch(0 0 0 / 0.35) 0%, transparent 55%);
}
.q-card .q-bg::after {
  /* faint firefly dots */
  content: "";
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle, oklch(0.95 0.10 95 / 0.55) 0.8px, transparent 1.2px),
    radial-gradient(circle, oklch(0.95 0.10 95 / 0.4) 0.7px, transparent 1.1px);
  background-size: 80px 60px, 50px 90px;
  background-position: 12px 30px, 60px 10px;
  opacity: 0.6;
  mix-blend-mode: screen;
}
.q-card .q-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, oklch(0.16 0.05 175 / 0.05) 0%, oklch(0.16 0.05 175 / 0.7) 100%);
}
.q-card .q-content {
  position: relative;
  display: flex; flex-direction: column; gap: 4px;
  height: 100%;
  padding: 10px 12px;
  justify-content: center;
}
.q-card .q-emoji-small { font-size: 18px; line-height: 1; opacity: 0.85; filter: drop-shadow(0 2px 4px oklch(0 0 0 / 0.4)); }
.q-card .q-text { margin: 0; font-size: 11.5px; font-weight: 800; line-height: 1.25; color: var(--foreground); text-shadow: 0 1px 2px oklch(0 0 0 / 0.5); }

/* ============ Answer overlay ============ */
.freeze-backdrop {
  position: fixed; inset: 0; z-index: 50;
  display: none; flex-direction: column;
  padding: 24px 20px;
  background: oklch(0.10 0.04 200 / 0.78);
  backdrop-filter: blur(14px) saturate(1.1);
  overflow-y: auto;
  animation: fade-in 0.25s ease;
}
.freeze-backdrop.is-active { display: flex; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes scale-in { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }

.overlay-close { align-self: flex-end; }
.overlay-robot { margin-top: 8px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.overlay-robot img { width: 128px; height: 128px; object-fit: contain; animation: scale-in 0.3s ease; }
.overlay-status { margin-top: 24px; }
.overlay-question { margin-top: 12px; font-size: 20px; font-weight: 900; padding: 0 8px; max-width: 28rem; }

.answer-card {
  margin: 16px auto 0;
  max-width: 32rem;
  padding: 18px 20px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--foreground);
  white-space: pre-wrap;
}

.media-loading {
  margin: 16px auto 0;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: oklch(0.30 0.07 170 / 0.55);
  border: 1px solid oklch(0.85 0.16 95 / 0.18);
  align-self: center;
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted-foreground);
}
.loading-dot {
  width: 6px; height: 6px; border-radius: 999px; background: var(--primary);
  animation: dot-pulse 1s ease-in-out infinite;
}
.loading-dot:nth-child(2) { animation-delay: 0.15s; }
.loading-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot-pulse {
  0%, 100% { opacity: 0.3; transform: scale(0.85); }
  50%      { opacity: 1;   transform: scale(1.1); }
}

.media-row {
  margin: 16px auto 0;
  max-width: 32rem;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 0 4px 8px;
}
.media-fig {
  flex-shrink: 0;
  width: 220px;
  overflow: hidden;
  border-radius: 16px;
  margin: 0;
  background: oklch(0.20 0.05 175 / 0.6);
  border: 1px solid oklch(0.85 0.16 95 / 0.18);
}
.media-fig img { width: 100%; height: 140px; object-fit: cover; background: oklch(0.20 0.05 175 / 0.7); }
.media-fig figcaption { padding: 8px 12px; font-size: 11px; line-height: 16px; font-weight: 600; color: var(--muted-foreground); }

.overlay-cta { margin: 24px auto 0; max-width: 28rem; height: 48px; }

/* ============ Toasts ============ */
.toast-host {
  position: fixed; left: 50%; bottom: 24px;
  transform: translateX(-50%);
  z-index: 100;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  background: oklch(0.20 0.06 175 / 0.92);
  border: 1px solid oklch(0.85 0.16 95 / 0.3);
  color: var(--foreground);
  box-shadow: 0 12px 28px -10px oklch(0 0 0 / 0.5);
  animation: toast-in 0.25s ease;
}
.toast--error { border-color: oklch(0.65 0.18 30 / 0.6); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ============ Jungle scene background ============ */
.jungle-stage {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 30%, oklch(0.30 0.10 170) 0%, oklch(0.18 0.06 180) 40%, oklch(0.10 0.04 200) 100%),
    #082128;
  overflow: hidden;
  isolation: isolate;
  z-index: 0;
}
.jungle-art {
  position: absolute;
  inset-inline: 0;
  top: 0;
  width: 100%;
  height: min(100%, 90vh);
  overflow: hidden;
}
.jungle-art-img {
  position: absolute;
  inset: 0;
  background-image: var(--bg-jungle);
  background-repeat: no-repeat;
  background-position: top center;
  background-size: cover;
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 50% 45%, #000 55%, rgba(0,0,0,0.65) 75%, rgba(0,0,0,0) 100%);
          mask-image: radial-gradient(ellipse 75% 70% at 50% 45%, #000 55%, rgba(0,0,0,0.65) 75%, rgba(0,0,0,0) 100%);
}
.jungle-vignette {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 40%, transparent 35%, oklch(0 0 0 / 0.35) 100%),
    linear-gradient(180deg, transparent 60%, oklch(0.10 0.04 200 / 0.45) 100%);
}

/* Mushroom glow */
.mushroom-glow { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen; z-index: 1; }
.mushroom-glow__spot {
  position: absolute; border-radius: 50%; filter: blur(10px); opacity: 1;
  animation: mushroom-pulse var(--mg-dur, 4s) ease-in-out infinite;
  animation-delay: var(--mg-delay, 0s);
}
.mushroom-glow__spot--right {
  left: 20%; top: 38%; width: 9vmin; height: 7vmin;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at center, rgba(140,255,230,0.95) 0%, rgba(80,220,210,0.45) 40%, rgba(40,160,180,0) 75%);
  --mg-dur: 4.6s; --mg-delay: -0.4s;
}
.mushroom-glow__spot--center {
  left: 50%; top: 60%; width: 14vmin; height: 10vmin;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at center, rgba(160,250,220,0.95) 0%, rgba(90,200,190,0.45) 40%, rgba(40,140,150,0) 78%);
  --mg-dur: 6.2s; --mg-delay: -1.3s;
}
.mushroom-glow__spot--left {
  left: 80%; top: 50%; width: 7vmin; height: 9vmin;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at center, rgba(150,250,225,0.85) 0%, rgba(80,200,200,0.35) 45%, rgba(40,160,180,0) 80%);
  --mg-dur: 5.4s; --mg-delay: -2.1s;
}
@keyframes mushroom-pulse {
  0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(0.95); }
  50%      { opacity: 1;   transform: translate(-50%, -50%) scale(1.08); }
}

/* Fireflies */
.fireflies { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.firefly {
  position: absolute;
  width: 5px; height: 5px; border-radius: 50%;
  background: #F8F6C2;
  box-shadow:
    0 0 6px #F8F6C2,
    0 0 14px #F6E09C,
    0 0 24px rgb(246 224 156 / 0.55);
  opacity: 0;
  animation:
    firefly-drift-x var(--ff-dur-x, 11s) cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite alternate,
    firefly-drift-y var(--ff-dur-y, 17s) cubic-bezier(0.37, 0, 0.63, 1) infinite alternate,
    firefly-glow var(--ff-glow, 2.6s) ease-in-out infinite;
  animation-delay: var(--ff-delay-x, 0s), var(--ff-delay-y, 0s), var(--ff-glow-delay, 0s);
}
@keyframes firefly-glow {
  0%, 100% { opacity: 0.15; filter: blur(0.2px); }
  50%      { opacity: 1;    filter: blur(0); }
}
@keyframes firefly-drift-x {
  0% { translate: 0 0; } 18% { translate: 22px 0; } 37% { translate: 8px 0; }
  55% { translate: 48px 0; } 72% { translate: 18px 0; } 100% { translate: 64px 0; }
}
@keyframes firefly-drift-y {
  0%   { transform: translateY(0) scale(1); }
  22%  { transform: translateY(-26px) scale(1.05); }
  44%  { transform: translateY(-12px) scale(0.95); }
  63%  { transform: translateY(-58px) scale(1.1); }
  82%  { transform: translateY(-30px) scale(0.98); }
  100% { transform: translateY(-72px) scale(1); }
}
.firefly--0  { top: 12%; left:  8%; --ff-dur-x: 11s; --ff-dur-y: 17s; --ff-delay-x: 0s;    --ff-delay-y: -3s;   --ff-glow-delay: -0.2s; }
.firefly--1  { top: 22%; left: 24%; --ff-dur-x: 13s; --ff-dur-y: 19s; --ff-delay-x: -2s;   --ff-delay-y: -7s;   --ff-glow-delay: -0.8s; --ff-glow: 3s; }
.firefly--2  { top:  8%; left: 42%; --ff-dur-x: 9s;  --ff-dur-y: 21s; --ff-delay-x: -4s;   --ff-delay-y: -1s;   --ff-glow-delay: -1.4s; }
.firefly--3  { top: 18%; left: 60%; --ff-dur-x: 14s; --ff-dur-y: 16s; --ff-delay-x: -6s;   --ff-delay-y: -9s;   --ff-glow-delay: -2.0s; --ff-glow: 2.2s; }
.firefly--4  { top: 30%; left: 78%; --ff-dur-x: 12s; --ff-dur-y: 23s; --ff-delay-x: -1s;   --ff-delay-y: -5s;   --ff-glow-delay: -0.5s; }
.firefly--5  { top: 36%; left: 14%; --ff-dur-x: 10s; --ff-dur-y: 18s; --ff-delay-x: -3s;   --ff-delay-y: -11s;  --ff-glow-delay: -1.1s; --ff-glow: 2.8s; }
.firefly--6  { top: 44%; left: 36%; --ff-dur-x: 15s; --ff-dur-y: 20s; --ff-delay-x: -5s;   --ff-delay-y: -2s;   --ff-glow-delay: -1.7s; }
.firefly--7  { top: 50%; left: 54%; --ff-dur-x: 8s;  --ff-dur-y: 22s; --ff-delay-x: -7s;   --ff-delay-y: -8s;   --ff-glow-delay: -2.3s; --ff-glow: 2.4s; }
.firefly--8  { top: 56%; left: 72%; --ff-dur-x: 13s; --ff-dur-y: 17s; --ff-delay-x: -2.5s; --ff-delay-y: -10s;  --ff-glow-delay: -0.9s; }
.firefly--9  { top: 64%; left: 88%; --ff-dur-x: 11s; --ff-dur-y: 19s; --ff-delay-x: -4.5s; --ff-delay-y: -4s;   --ff-glow-delay: -1.5s; --ff-glow: 3.2s; }
.firefly--10 { top: 70%; left:  6%; --ff-dur-x: 16s; --ff-dur-y: 24s; --ff-delay-x: -6.5s; --ff-delay-y: -6s;   --ff-glow-delay: -2.1s; }
.firefly--11 { top: 80%; left: 30%; --ff-dur-x: 9s;  --ff-dur-y: 18s; --ff-delay-x: -8s;   --ff-delay-y: -12s;  --ff-glow-delay: -2.6s; --ff-glow: 2.6s; }

/* Falling leaf */
.leaves { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 3; }
.leaf {
  position: absolute; top: -8%; left: 22%;
  width: 26px; height: 26px;
  color: #7CC58A; opacity: 0;
  animation: leaf-fall 30s ease-in infinite;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.35));
}
.leaf > svg { display: block; transform-origin: 50% 50%; animation: leaf-spin 4s ease-in-out infinite; }
@keyframes leaf-fall {
  0%   { transform: translate(0, 0) scale(1); opacity: 0; }
  2%   { opacity: 0; }
  6%   { opacity: 1; }
  12%  { transform: translate(30px, 18vh)  scale(1);    }
  20%  { transform: translate(-15px, 38vh) scale(0.97); }
  28%  { transform: translate(40px, 62vh)  scale(0.94); }
  34%  { transform: translate(60px, 88vh)  scale(0.92); opacity: 1; }
  38%  { transform: translate(70px, 102vh) scale(0.92); opacity: 0; }
  100% { transform: translate(70px, 102vh) scale(0.92); opacity: 0; }
}
@keyframes leaf-spin {
  0%   { rotate: -25deg; }
  50%  { rotate: 35deg; }
  100% { rotate: -25deg; }
}

/* ============ Mobile tweaks ============ */
@media (max-width: 480px) {
  .shell { min-height: 100vh; padding: 0; }
  .title { font-size: 32px; }
  .robot-xl img { width: 180px; height: 180px; }
  .robot-md img { width: 140px; height: 140px; }
  .robot-sm img { width: 128px; height: 128px; }
  .overlay-question { font-size: 18px; }
  .answer-card { font-size: 14px; padding: 16px; }
  .media-fig { width: 180px; }
  .media-fig img { height: 120px; }
}

@media (prefers-reduced-motion: reduce) {
  .robot-float, .leaf, .firefly, .mushroom-glow__spot { animation: none !important; }
}
