/* ============================================================
   RUNNIT LIVE CHAT — "Ru" the Runnit guide
   Front-page chat widget, brand tokens from site.css
   ============================================================ */

/* ── Launcher ──────────────────────────────────────────────── */
.rlc-launcher {
  position: fixed; right: 24px; bottom: 24px; z-index: 320;
  display: flex; align-items: center; gap: 12px;
  background: var(--color-guava); color: #000;
  border: none; border-radius: 999px; padding: 10px 20px 10px 10px; cursor: pointer;
  box-shadow: 0 8px 40px rgba(255, 81, 168, 0.45);
  transition: transform 0.15s, box-shadow 0.15s;
}
.rlc-launcher:hover { transform: translateY(-2px); box-shadow: 0 12px 48px rgba(255, 81, 168, 0.6); }
.rlc-launcher .rlc-avatar { width: 44px; height: 44px; }
.rlc-launcher span {
  font-family: var(--font-display-bold); font-weight: 700; font-size: 14px;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.rlc-launcher.rlc-hidden, .rlc-panel.rlc-hidden { display: none; }

/* ── Mascot ────────────────────────────────────────────────── */
.rlc-avatar { display: block; }
/* Eyes glance around on a slow cycle… */
.rlc-avatar .rlc-eyes {
  transform-box: fill-box; transform-origin: center;
  animation: rlcLook 12s ease-in-out infinite;
}
@keyframes rlcLook {
  0%, 48%, 100% { transform: translate(0, 0); }
  52%, 60% { transform: translate(2.4px, -0.6px); }
  66%, 74% { transform: translate(-2px, 0.4px); }
  80% { transform: translate(0, 0); }
}
/* …both eyes blink twice per cycle, the right eye adds a wink */
.rlc-avatar .rlc-eye {
  transform-box: fill-box; transform-origin: center;
  animation: rlcBlink 12s infinite;
}
.rlc-avatar .rlc-eye-r { animation-name: rlcBlinkWink; }
@keyframes rlcBlink {
  0%, 22%, 26%, 61%, 65%, 100% { transform: scaleY(1); }
  24%, 63% { transform: scaleY(0.12); }
}
@keyframes rlcBlinkWink {
  0%, 22%, 26%, 61%, 65%, 86%, 92%, 100% { transform: scaleY(1); }
  24%, 63%, 89% { transform: scaleY(0.12); }
}
/* Desktop: eyes are driven by the cursor instead of the idle glance */
.rlc-avatar.rlc-follow .rlc-eyes { animation: none; }

/* Little "o" mouth: hidden until Ru is typed at or replying */
.rlc-avatar .rlc-mouth {
  transform-box: fill-box; transform-origin: center;
  transform: scale(0); opacity: 0;
  transition: transform 0.22s cubic-bezier(0.34, 1.6, 0.64, 1), opacity 0.15s;
}
.rlc-avatar.rlc-surprise .rlc-mouth, .rlc-avatar.rlc-talk .rlc-mouth { transform: scale(1); opacity: 1; }
.rlc-avatar.rlc-talk .rlc-mouth-o {
  transform-box: fill-box; transform-origin: center;
  animation: rlcTalk 0.6s ease-in-out infinite alternate;
}
@keyframes rlcTalk { from { transform: scaleY(1); } to { transform: scaleY(0.4); } }

.rlc-avatar .rlc-antenna-dot { animation: rlcGlow 2.4s ease-in-out infinite; }
@keyframes rlcGlow { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) {
  .rlc-avatar .rlc-eyes, .rlc-avatar .rlc-eye, .rlc-avatar .rlc-antenna-dot, .rlc-avatar .rlc-mouth-o { animation: none; }
}

/* ── Panel ─────────────────────────────────────────────────── */
.rlc-panel {
  position: fixed; right: 24px; bottom: 24px; z-index: 330;
  width: 392px; max-width: calc(100vw - 24px); height: 620px; max-height: calc(100vh - 48px);
  background: #0B0B0C; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 20px;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 0 90px rgba(255, 81, 168, 0.22), 0 30px 90px rgba(0, 0, 0, 0.65);
  font-family: var(--font-body); color: #FFFFFF;
}
.rlc-head {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: var(--color-guava); color: #000; flex: none;
}
.rlc-head .rlc-avatar { width: 42px; height: 42px; }
.rlc-head .nm {
  font-family: var(--font-display-ultra); font-weight: 900; font-size: 20px; letter-spacing: 0.03em;
  line-height: 1;
}
.rlc-head .rl {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase;
  color: rgba(0, 0, 0, 0.65); margin-top: 3px;
}
.rlc-head .spacer { flex: 1; }
.rlc-close {
  background: rgba(0, 0, 0, 0.18); border: none; color: #000; width: 32px; height: 32px;
  border-radius: 9px; font-size: 18px; line-height: 1; cursor: pointer;
}
.rlc-close:hover { background: rgba(0, 0, 0, 0.3); }

.rlc-log {
  flex: 1; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 12px;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 81, 168, 0.07) 0%, rgba(255, 81, 168, 0) 40%),
    #0B0B0C;
}
.rlc-msg { max-width: 88%; font-size: 14px; line-height: 1.5; }
.rlc-msg.user { align-self: flex-end; background: var(--color-guava); color: #000; border-radius: 14px 14px 4px 14px; padding: 10px 14px; }
.rlc-msg.bot {
  align-self: flex-start; background: #171615; border: 1px solid #2C2B2B; color: #E4E2DE;
  border-radius: 14px 14px 14px 4px; padding: 11px 14px;
}
.rlc-msg.bot p + p { margin-top: 8px; }
.rlc-msg.bot strong { color: #FFFFFF; }
.rlc-msg.bot a { color: #FFFFFF; border-bottom: 1px solid var(--color-guava); text-decoration: none; }
.rlc-status {
  align-self: flex-start; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.05em;
  text-transform: uppercase; color: #BAB9B5; display: flex; align-items: center; gap: 8px;
}
.rlc-status .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--color-acai); animation: rlcGlow 1s infinite; }
.rlc-note {
  align-self: center; text-align: center; font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.05em; text-transform: uppercase; color: #BAB9B5;
  border: 1px dashed #2C2B2B; border-radius: 9px; padding: 8px 12px;
}
.rlc-typing { display: inline-flex; gap: 4px; padding: 12px 14px; align-self: flex-start; background: #171615; border: 1px solid #2C2B2B; border-radius: 14px 14px 14px 4px; }
.rlc-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--color-guava); animation: rlcGlow 1.2s infinite; }
.rlc-typing span:nth-child(2) { animation-delay: 0.2s; }
.rlc-typing span:nth-child(3) { animation-delay: 0.4s; }

.rlc-input-row { flex: none; border-top: 1px solid #2C2B2B; padding: 12px; display: flex; gap: 8px; align-items: flex-end; background: #0B0B0C; }
.rlc-input {
  flex: 1; resize: none; max-height: 110px; min-height: 42px;
  font-family: var(--font-body); font-size: 14px; color: #FFF; line-height: 1.4;
  background: #171615; border: 1px solid #2C2B2B; border-radius: 12px; padding: 10px 12px;
}
.rlc-input:focus { outline: none; border-color: var(--color-guava); }
.rlc-input::placeholder { color: rgba(186, 185, 181, 0.55); }
.rlc-input:disabled { opacity: 0.55; }
.rlc-send {
  width: 42px; height: 42px; flex: none; border-radius: 11px; border: none; cursor: pointer;
  background: var(--color-guava); color: #000; display: flex; align-items: center; justify-content: center;
}
.rlc-send:disabled { opacity: 0.35; cursor: not-allowed; }
.rlc-foot {
  flex: none; text-align: center; padding: 0 12px 10px;
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.05em; text-transform: uppercase;
  color: #414040; background: #0B0B0C;
}

/* Verification veil over the input while Turnstile runs */
.rlc-verify {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.05em; text-transform: uppercase;
  color: #BAB9B5; border-top: 1px solid #2C2B2B;
}
.rlc-verify .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--color-matcha); animation: rlcGlow 1.2s infinite; }
.rlc-verify[hidden] { display: none; }

@media (max-width: 480px) {
  .rlc-panel { right: 8px; bottom: 8px; height: 78vh; }
  .rlc-launcher { right: 16px; bottom: 16px; }
  .rlc-launcher span { display: none; }
  .rlc-launcher { padding: 8px; }
}
