/* ===========================================================
   SECTION 1 — GLOBAL RESET + ROOT + VIEWPORT
=========================================================== */

/* ================= RESET ================= */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* Decorative layers must never block clicks */
.hero-input::before,
.hero-input::after,
.neon-btn::before,
.neon-btn::after,
.chat-header::before,
.chat-message.leocore.thinking::before {
  pointer-events: none;
}

/* ================= ROOT VARIABLES ================= */
:root {
  --bg-dark: rgba(6, 18, 30, 0.78);
  --neon-a: #00eaff;
  --neon-b: #8a3cff;
  --neon-c: #ff3bd4;
}

/* ================= HTML / BODY ================= */
html,
body {
  margin: 0;
  width: 100%;
  height: calc(var(--vh, 1vh) * 100);
  overflow-x: hidden;
  background: #000;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #fff;
  color-scheme: dark;
}

/* Prevent OLED greying + boost perceived contrast */
body {
  text-shadow: 0 0 0.01px rgba(255,255,255,0.01);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: none;
}

/* ================= CHAT OPEN STATE ================= */
body.chat-open {
  overflow: hidden;
  height: 100%;
}
/* ============================================================
   SECTION 2 — BACKGROUND (LOCKED STACK)
============================================================ */

/* ================= BACKGROUND ROOT ================= */
#bg-root {
  position: fixed;
  inset: 0;
  height: calc(var(--vh, 1vh) * 100);
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  isolation: isolate;
}

/* ================= BACKGROUND VIDEO ================= */
#bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.1);
  filter:
    saturate(1.05)
    contrast(0.82)
    brightness(0.85);
}

/* ================= SOFT LIGHT LAYER ================= */
.bg-soften {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(
    120% 120% at 50% 20%,
    rgba(255,255,255,0.06),
    transparent 60%
  );
  filter: blur(30px);
  opacity: 0.6;
}

/* ================= COLOR BLOOM ================= */
.bg-bloom {
  position: absolute;
  inset: -12%;
  z-index: 2;
  background:
    radial-gradient(40% 60% at 25% 30%, rgba(0,234,255,0.09), transparent 60%),
    radial-gradient(50% 70% at 75% 70%, rgba(138,60,255,0.08), transparent 65%);
  filter: blur(46px);
  opacity: 0.85;
}

/* ================= VIGNETTE ================= */
.bg-vignette {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: radial-gradient(
    120% 120% at 50% 0%,
    rgba(0,0,0,0.15),
    rgba(0,0,0,0.82)
  );
}
/* ============================================================
   SECTION 3 — APP WRAPPER + HERO + MODES
============================================================ */

/* ================= APP BASE ================= */
.app-wrapper {
  position: relative;
  z-index: 10;
  isolation: isolate;

  height: calc(var(--vh, 1vh) * 100);
  overflow-y: auto;

  padding: 72px 18px 56px;
  display: flex;
  flex-direction: column;

  scroll-behavior: smooth;
  overscroll-behavior: contain;

  animation: fadeUp 0.8s cubic-bezier(.22,.61,.36,1) both;
}

/* Ambient depth layer */
.app-wrapper::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(80% 60% at 50% 20%, rgba(0,234,255,0.06), transparent 60%),
    radial-gradient(70% 60% at 50% 80%, rgba(138,60,255,0.05), transparent 65%);
}

/* ================= HERO ================= */
.center-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin: 24px;
}

.main-title {
  font-size: 36px;
  font-weight: 800;
  margin: 0;
  letter-spacing: 0.6px;
}

.subtitle {
  opacity: 0.85;
  margin: 0;
}

/* ================= HERO INPUT ================= */
.hero-input {
  width: 320px;
  height: 56px;
  border-radius: 18px;
  border: none;
  cursor: pointer;
  touch-action: manipulation;

  background: linear-gradient(
    180deg,
    rgba(10,18,30,0.92),
    rgba(6,12,22,0.92)
  );

  position: relative;
  overflow: hidden;
  isolation: isolate;

  display: flex;
  align-items: center;
  justify-content: center;

  pointer-events: auto;

  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04),
    0 12px 32px rgba(0,0,0,0.55),
    0 0 22px rgba(0,234,255,0.28);
}

/* Hero ambient glow */
.hero-ambient {
  position: absolute;
  inset: -25%;
  z-index: 1;
  background:
    radial-gradient(40% 60% at 30% 20%, rgba(0,234,255,0.14), transparent 60%),
    radial-gradient(50% 70% at 70% 80%, rgba(180,0,255,0.12), transparent 65%);
  filter: blur(20px);
  opacity: 0.6;
  animation: heroAmbientDrift 22s linear infinite;
}

/* Energy sweep */
.hero-energy {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: linear-gradient(
    120deg,
    transparent 30%,
    rgba(0,234,255,0.9),
    rgba(180,0,255,0.85),
    rgba(255,59,212,0.85),
    transparent 70%
  );
  transform: translateX(-120%);
  animation: heroEnergyFlow 4s linear infinite;
}

/* Hero text */
.hero-text {
  position: relative;
  z-index: 5;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.4px;
  color: #eaf9ff;
  white-space: nowrap;
  animation: heroTextBreath 3s ease-in-out infinite;
}

/* ================= HERO INTERACTION ================= */
.hero-input:active,
.hero-input:focus-visible {
  box-shadow:
    0 0 0 1px rgba(0,234,255,0.35),
    0 0 28px rgba(0,234,255,0.45),
    0 0 48px rgba(138,60,255,0.25);
}

.hero-input:active .hero-ambient,
.hero-input:focus-visible .hero-ambient {
  opacity: 0.9;
  filter: blur(16px);
}

.hero-input:active .hero-energy,
.hero-input:focus-visible .hero-energy {
  animation-duration: 2.2s;
}

/* ================= HERO ANIMATIONS ================= */
@keyframes heroEnergyFlow {
  to { transform: translateX(120%); }
}

@keyframes heroAmbientDrift {
  0% { transform: translate(0,0); }
  50% { transform: translate(-6%,4%); }
  100% { transform: translate(0,0); }
}

@keyframes heroTextBreath {
  0%,100% { opacity: 0.88; }
  50% { opacity: 1; }
}

/* ================= MODES ================= */
.modes-wrapper {
  margin-top: 34px;
}

.section-title {
  text-align: center;
  font-size: 26px;
  margin-bottom: 18px;
  letter-spacing: 0.4px;
}

.mode-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ================= MODE CARD ================= */
.neon-btn {
  width: 100%;
  min-height: 86px;
  border-radius: 22px;
  border: none;

  background: linear-gradient(
    180deg,
    rgba(14,22,36,0.92),
    rgba(8,14,26,0.92)
  );

  position: relative;
  overflow: hidden;
  isolation: isolate;

  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;

  color: #eaf9ff;
  pointer-events: auto;

  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04),
    0 18px 42px rgba(0,0,0,0.6);
}

/* Neon border */
.neon-btn::before {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: 1;
  border-radius: inherit;

  background: conic-gradient(
    var(--neon-a),
    var(--neon-b),
    var(--neon-c),
    var(--neon-a)
  );

  animation: neonSpin 3.6s linear infinite;
}

/* Inner surface */
.neon-btn::after {
  content: "";
  position: absolute;
  inset: 3px;
  z-index: 2;
  border-radius: 19px;

  background: linear-gradient(
    180deg,
    rgba(12,20,34,0.95),
    rgba(6,10,18,0.95)
  );
}

/* Mode content */
.mode-content {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.mode-title {
  font-size: 15px;
  font-weight: 600;
}

.mode-desc {
  font-size: 12.5px;
  opacity: 0.75;
  max-width: 85%;
}

/* Recommended badge */
.mode-badge {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 4;

  font-size: 10px;
  padding: 4px 8px;
  border-radius: 999px;

  background: rgba(0,234,255,0.14);
  color: #7df6ff;
  border: 1px solid rgba(0,234,255,0.35);
}

/* Recommended emphasis */
.neon-btn.recommended {
  box-shadow:
    0 0 0 1px rgba(0,234,255,0.25),
    0 0 26px rgba(0,234,255,0.35),
    0 24px 60px rgba(0,0,0,0.7);
}

/* Interaction */
.neon-btn:active {
  transform: scale(0.985);
}

.neon-btn:active::before {
  filter: brightness(1.2);
}

@keyframes neonSpin {
  to { transform: rotate(360deg); }
     }
/* ============================================================
   SECTION 4 — CHAT OVERLAY + PANEL + HEADER
   (Layering + Click Safety — NO VISUAL CHANGES)
============================================================ */

/* ================= CHAT OVERLAY ================= */
/* ================= CHAT OVERLAY — HARD GATE (FIX) ================= */

#chat-overlay {
  position: fixed;
  inset: 0;

  z-index: -1;            /* 👈 CRITICAL */
  visibility: hidden;    /* 👈 CRITICAL */
  pointer-events: none;

  transition: none;
}

#chat-overlay[aria-hidden="false"] {
  z-index: 100;
  visibility: visible;
  pointer-events: auto;
}

/* ================= BACKDROP ================= */
.chat-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;

  background: radial-gradient(
    120% 120% at 50% 0%,
    rgba(0,0,0,0.45),
    rgba(0,0,0,0.8)
  );

  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.35s ease;

  /* Backdrop blocks clicks ONLY when chat is open */
  pointer-events: none;
}

#chat-overlay[aria-hidden="false"] .chat-backdrop {
  opacity: 1;
  pointer-events: auto;
}

/* ================= CHAT PANEL ================= */
.chat-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;

  height: calc(var(--vh, 1vh) * 100);
  max-height: 100dvh;

  z-index: 1;
  pointer-events: auto;

  background: linear-gradient(
    180deg,
    rgba(12,18,30,0.97),
    rgba(6,10,18,0.99)
  );

  border-radius: 22px 22px 0 0;

  opacity: 0;
  transform: translateY(18px);

  transition:
    opacity 0.35s ease,
    transform 0.45s cubic-bezier(.22,.61,.36,1);

  display: flex;
  flex-direction: column;
  isolation: isolate;

  /* CRITICAL: prevents click bleed-through */
  overflow: hidden;

  box-shadow:
    0 -14px 44px rgba(0,0,0,0.7),
    0 0 0 1px rgba(255,255,255,0.06);
}

#chat-overlay[aria-hidden="false"] .chat-panel {
  opacity: 1;
  transform: translateY(0);
}

/* ================= CHAT HEADER ================= */
.chat-header {
  position: relative;
  z-index: 2;

  padding: 18px 18px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;

  background: linear-gradient(
    180deg,
    rgba(18,26,40,0.88),
    rgba(10,16,26,0.7)
  );

  border-bottom: 1px solid rgba(255,255,255,0.06);

  /* Header must always be clickable */
  pointer-events: auto;
}

/* Neon aura (visual only) */
.chat-header::before {
  content: "";
  position: absolute;
  inset: -40px -20px -20px -20px;
  z-index: -1;

  background:
    radial-gradient(
      120% 80% at 50% 0%,
      rgba(0,234,255,0.25),
      rgba(138,60,255,0.18),
      transparent 70%
    );

  filter: blur(32px);
  opacity: 0.95;

  pointer-events: none;
}

/* Header text */
.chat-mode {
  font-size: 16px;
  font-weight: 600;
  color: #eaf9ff;
}

.chat-mode-desc {
  font-size: 12.5px;
  opacity: 0.7;
  margin-top: 2px;
}

/* Close button */
.chat-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  opacity: 0.75;

  cursor: pointer;
  pointer-events: auto;
}
/* ============================================================
   SECTION 5 — CHAT MESSAGES + EMPTY STATE + SCROLL PHYSICS
   (No visual changes — stability + interaction fixes)
============================================================ */

/* ================= CHAT MESSAGES ================= */
.chat-messages {
  position: relative;
  z-index: 1;

  flex: 1;
  padding: 18px;

  display: flex;
  flex-direction: column;
  gap: 14px;

  overflow-y: auto;
  overflow-x: hidden;

  /* Critical for iOS / Android momentum scrolling */
  -webkit-overflow-scrolling: touch;

  /* Prevent scroll chaining to page */
  overscroll-behavior: contain;

  background:
    radial-gradient(
      120% 120% at 50% 0%,
      rgba(0,234,255,0.06),
      transparent 60%
    );
}

/* ================= MESSAGE BASE ================= */
.chat-message {
  max-width: 80%;
  padding: 12px 14px;

  border-radius: 14px;
  font-size: 14.5px;
  line-height: 1.45;

  pointer-events: auto;

  /* Entry animation */
  opacity: 0;
  transform: translateY(6px) scale(0.985);
  animation: messageSettle 0.42s cubic-bezier(.16,.84,.44,1) forwards;

  will-change: transform, opacity;
}

/* User message */
.chat-message.user {
  align-self: flex-end;

  background: linear-gradient(
    135deg,
    rgba(0,234,255,0.24),
    rgba(0,140,255,0.2)
  );

  color: #eaf9ff;

  box-shadow:
    0 8px 22px rgba(0,0,0,0.5);

  animation-duration: 0.34s;
}

/* LeoCore message */
.chat-message.leocore {
  align-self: flex-start;

  background: linear-gradient(
    180deg,
    rgba(255,255,255,0.12),
    rgba(255,255,255,0.06)
  );

  color: #eaf9ff;

  box-shadow:
    0 12px 30px rgba(0,0,0,0.6),
    inset 0 0 0 1px rgba(255,255,255,0.06);

  animation-duration: 0.46s;
}

/* ================= THINKING STATE ================= */
.chat-message.leocore.thinking {
  position: relative;
  isolation: isolate;

  background: rgba(255,255,255,0.05);
  padding: 12px 16px;
  width: fit-content;
}

/* Visual glow only */
.chat-message.leocore.thinking::before {
  content: "";
  position: absolute;
  inset: -22px -30px;
  z-index: -1;

  background:
    radial-gradient(
      60% 60% at 30% 50%,
      rgba(0,234,255,0.22),
      transparent 65%
    );

  filter: blur(26px);
  opacity: 0.9;

  pointer-events: none;
}

/* ================= ENTRY ANIMATION ================= */
@keyframes messageSettle {
  0% {
    opacity: 0;
    transform: translateY(6px) scale(0.985);
  }
  65% {
    opacity: 1;
    transform: translateY(-1px) scale(1.002);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ================= EMPTY STATE ================= */
#emptyState {
  position: absolute;
  inset: 0;

  display: none;
  place-items: center;

  text-align: center;
  pointer-events: none;

  z-index: 0;

  animation: emptyIn 0.6s cubic-bezier(.22,.61,.36,1);
}

.empty-title {
  font-size: 26px;
  font-weight: 600;
  opacity: 0.9;
}

.empty-sub {
  margin-top: 10px;
  font-size: 14px;
  opacity: 0.6;
}

/* Empty state entrance */
@keyframes emptyIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* ============================================================
   SECTION 6 — INPUT BAR + SEND BUTTON + FINAL INTERACTION FIX
   (No visuals changed — ONLY interaction + stacking fixes)
============================================================ */

/* ================= CHAT PANEL ROOT ================= */
.chat-panel {
  position: relative;
  isolation: isolate;

  /* HARD stop for scroll bleed */
  overflow: hidden;

  /* Prevent browser gesture conflicts */
  touch-action: manipulation;
}

/* ================= INPUT BAR ================= */
.chat-input-bar {
  position: relative;
  z-index: 10; /* ABOVE messages */

  display: flex;
  align-items: center;
  gap: 10px;

  padding: 14px;

  flex-shrink: 0;

  background: linear-gradient(
    180deg,
    rgba(12,18,30,0.9),
    rgba(6,10,18,0.97)
  );

  border-top: 1px solid rgba(255,255,255,0.06);

  /* CRITICAL */
  pointer-events: auto;
  touch-action: manipulation;
}

/* ================= INPUT FIELD ================= */
#chatInput {
  position: relative;
  z-index: 11;

  flex: 1;

  background: rgba(255,255,255,0.12);
  border: none;
  border-radius: 14px;

  padding: 12px 14px;

  font-size: 14.5px;
  color: #fff;

  outline: none;

  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.06);

  pointer-events: auto;
  touch-action: manipulation;

  /* Prevent zoom + weird focus loss on mobile */
  -webkit-user-select: text;
  user-select: text;
}

/* Placeholder polish (no layout shift) */
#chatInput::placeholder {
  color: rgba(255,255,255,0.55);
}

/* ================= SEND BUTTON — LIQUID CORE ================= */

#sendBtn {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  cursor: pointer;

  display: grid;
  place-items: center;

  background: #05080f;
  overflow: visible;

  box-shadow:
    0 0 0 1px rgba(255,255,255,0.06),
    0 10px 28px rgba(0,0,0,0.6);

  transition:
    transform 0.15s ease,
    box-shadow 0.25s ease;
}

#sendBtn:active {
  transform: scale(0.92);
}

/* ================= LIQUID CORE ================= */

.morph-core {
  position: absolute;
  inset: 6px;
  border-radius: 42% 58% 60% 40% / 45% 45% 55% 55%;

  background:
    radial-gradient(circle at 30% 30%, #7df6ff, transparent 60%),
    linear-gradient(135deg, #00eaff, #7c3aed);

  filter: blur(0.2px);
  animation: liquidIdle 4.8s ease-in-out infinite;

  transition:
    border-radius 0.45s cubic-bezier(.22,.61,.36,1),
    background 0.35s ease,
    transform 0.35s ease,
    opacity 0.3s ease;
}

/* ================= LIQUID MOTION ================= */

@keyframes liquidIdle {
  0% {
    border-radius: 42% 58% 60% 40% / 45% 45% 55% 55%;
  }
  50% {
    border-radius: 55% 45% 42% 58% / 50% 60% 40% 50%;
  }
  100% {
    border-radius: 42% 58% 60% 40% / 45% 45% 55% 55%;
  }
}

/* ================= CROSS ARMS (HIDDEN BY DEFAULT) ================= */

.morph-arm {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 26px;
  height: 4px;

  background: linear-gradient(90deg, #ff4d4d, #ff0066);
  border-radius: 999px;

  opacity: 0;
  transform-origin: center;
  transform: translate(-50%, -50%) scale(0.4);

  transition:
    opacity 0.2s ease,
    transform 0.35s cubic-bezier(.22,.61,.36,1);
}

.morph-arm.a {
  transform: translate(-50%, -50%) rotate(45deg) scale(0.4);
}

.morph-arm.b {
  transform: translate(-50%, -50%) rotate(-45deg) scale(0.4);
}

#sendBtn.streaming .morph-arm.a {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(45deg) scale(1);
}

#sendBtn.streaming .morph-arm.b {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(-45deg) scale(1);
}

#sendBtn.streaming .morph-core {
  animation: none !important;
  opacity: 0;
  transform: scale(0.4);
}
/* ================= KEYBOARD + VIEWPORT SAFETY ================= */
body.chat-open {
  position: fixed;
  inset: 0;
  width: 100%;
  height: calc(var(--vh, 1vh) * 100);

  overflow: hidden;
  touch-action: none;
}

/* Allow interaction ONLY inside chat */
body.chat-open .chat-panel {
  touch-action: manipulation;
}

/* ================= STREAMING RING ================= */

.stream-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;

  border: 2px solid transparent;
  border-top-color: rgba(255,255,255,0.9);
  border-right-color: rgba(0,234,255,0.9);

  opacity: 0;
  transform: scale(0.9);
  pointer-events: none;
}

/* Active while streaming */
#sendBtn.streaming .stream-ring {
  opacity: 1;
  animation: none;
}

/* ================= LEOCORE TYPING INDICATOR ================= */

.orbit-loader {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
}

.orbit-loader span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00eaff, #8a3cff);
/* ============================================================
   SECTION 6 — INPUT BAR + SEND BUTTON + STREAMING MORPH
   (Authoritative version — replace entire old Section 6)
============================================================ */

/* ================= CHAT PANEL ROOT ================= */
.chat-panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  touch-action: manipulation;
}

/* ================= INPUT BAR ================= */
.chat-input-bar {
  position: relative;
  z-index: 10;

  display: flex;
  align-items: center;
  gap: 10px;

  padding: 14px;
  flex-shrink: 0;

  background: linear-gradient(
    180deg,
    rgba(12,18,30,0.9),
    rgba(6,10,18,0.97)
  );

  border-top: 1px solid rgba(255,255,255,0.06);

  pointer-events: auto;
  touch-action: manipulation;
}

/* ================= INPUT FIELD ================= */
#chatInput {
  position: relative;
  z-index: 11;
  flex: 1;

  background: rgba(255,255,255,0.12);
  border: none;
  border-radius: 14px;

  padding: 12px 14px;

  font-size: 14.5px;
  color: #fff;

  outline: none;

  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.06);

  pointer-events: auto;
  touch-action: manipulation;

  -webkit-user-select: text;
  user-select: text;
}

#chatInput::placeholder {
  color: rgba(255,255,255,0.55);
}

/* ================= SEND BUTTON ================= */
#sendBtn {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  cursor: pointer;

  display: grid;
  place-items: center;

  background: #05080f;
  overflow: visible;

  box-shadow:
    0 0 0 1px rgba(255,255,255,0.06),
    0 10px 28px rgba(0,0,0,0.6);

  transition:
    transform 0.15s ease,
    box-shadow 0.25s ease;
}

#sendBtn:active {
  transform: scale(0.92);
}

/* ================= LIQUID CORE (IDLE STATE) ================= */
.morph-core {
  position: absolute;
  inset: 6px;

  border-radius: 42% 58% 60% 40% / 45% 45% 55% 55%;

  background:
    radial-gradient(circle at 30% 30%, #7df6ff, transparent 60%),
    linear-gradient(135deg, #00eaff, #7c3aed);

  filter: blur(0.2px);

  animation: liquidIdle 4.8s ease-in-out infinite;

  transition:
    border-radius 0.45s cubic-bezier(.22,.61,.36,1),
    transform 0.35s ease,
    opacity 0.3s ease,
    filter 0.3s ease;
}

@keyframes liquidIdle {
  0% {
    border-radius: 42% 58% 60% 40% / 45% 45% 55% 55%;
  }
  50% {
    border-radius: 55% 45% 42% 58% / 50% 60% 40% 50%;
  }
  100% {
    border-radius: 42% 58% 60% 40% / 45% 45% 55% 55%;
  }
}

/* ================= CROSS ARMS (STREAMING SYMBOL) ================= */
.morph-arm {
  position: absolute;
  left: 50%;
  top: 50%;

  width: 26px;
  height: 4px;

  background: linear-gradient(90deg, #ff4d4d, #ff0066);
  border-radius: 999px;

  opacity: 0;
  transform-origin: center;
  transform: translate(-50%, -50%) scale(0.4);

  transition:
    opacity 0.2s ease,
    transform 0.35s cubic-bezier(.22,.61,.36,1);
}

.morph-arm.a {
  transform: translate(-50%, -50%) rotate(45deg) scale(0.4);
}

.morph-arm.b {
  transform: translate(-50%, -50%) rotate(-45deg) scale(0.4);
}

/* ================= STREAMING STATE ================= */
#sendBtn.streaming .morph-arm.a {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(45deg) scale(1);
}

#sendBtn.streaming .morph-arm.b {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(-45deg) scale(1);
}

#sendBtn.streaming .morph-core {
  animation: none !important;
  border-radius: 12%;
  transform: scale(0.55) rotate(45deg);
  filter: blur(0.6px);
  opacity: 0;
}

/* ================= STREAMING RING ================= */
.stream-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;

  border: 2px solid transparent;
  border-top-color: rgba(255,255,255,0.9);
  border-right-color: rgba(0,234,255,0.9);

  opacity: 0;
  pointer-events: none;
}

#sendBtn.streaming .stream-ring {
  opacity: 1;
}
.orbit-loader span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00eaff, #8a3cff);
  animation: orbitPulse 1.4s infinite ease-in-out;
}

.orbit-loader span:nth-child(2) { animation-delay: 0.2s; }
.orbit-loader span:nth-child(3) { animation-delay: 0.4s; }

@keyframes orbitPulse {
  0%, 80%, 100% { transform: scale(0.3); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}