/* FN Cheats chatbot — all classes prefixed cb- */
#cb-root {
  --cb-window-bg: #0f0a1e;
  --cb-header-bg: #1a1033;
  --cb-accent: #8b3dff;
  --cb-accent-light: #b98cff;
  --cb-bot-bg: #1e1536;
  --cb-bot-text: #f3ecff;
  --cb-visitor-bg: #8b3dff;
  --cb-visitor-text: #ffffff;
  --cb-input-bg: #140c28;
  --cb-input-text: #f3ecff;
  --cb-font: 'Segoe UI', system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --chat-icon-size: 130px;
  position: fixed;
  z-index: 99990;
  inset: auto auto max(20px, env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px));
  font-family: var(--cb-font);
  color: var(--cb-bot-text);
  pointer-events: none;
}

#cb-root * {
  box-sizing: border-box;
}

#cb-root.cb-root--open {
  pointer-events: auto;
}

.cb-launcher {
  pointer-events: auto;
  display: block;
  width: var(--chat-icon-size);
  min-width: var(--chat-icon-size);
  min-height: var(--chat-icon-size);
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  line-height: 0;
  filter: drop-shadow(0 0 12px rgba(139, 61, 255, 0.55))
    drop-shadow(0 4px 16px rgba(139, 61, 255, 0.35));
  transition: transform 0.25s ease, filter 0.25s ease;
  animation: cb-float 4.5s ease-in-out infinite;
}

.cb-launcher:hover,
.cb-launcher:focus-visible {
  transform: translateY(-3px);
  filter: drop-shadow(0 0 18px rgba(139, 61, 255, 0.75))
    drop-shadow(0 6px 20px rgba(139, 61, 255, 0.45));
  outline: none;
}

.cb-launcher img {
  width: var(--chat-icon-size);
  height: auto;
  object-fit: contain;
  display: block;
}

@media (max-width: 480px) {
  #cb-root {
    --chat-icon-size: 80px;
  }
}

@keyframes cb-launcher-shake {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  15% {
    transform: translateY(4px) rotate(-4deg);
  }
  30% {
    transform: translateY(6px) rotate(3deg);
  }
  45% {
    transform: translateY(3px) rotate(-3deg);
  }
  60% {
    transform: translateY(5px) rotate(2deg);
  }
  75% {
    transform: translateY(2px) rotate(-1deg);
  }
}

.cb-launcher.cb-launcher--shake {
  animation: cb-launcher-shake 0.5s ease-in-out;
}

@keyframes cb-launcher-glow {
  0%,
  100% {
    filter: drop-shadow(0 0 10px rgba(139, 61, 255, 0.45))
      drop-shadow(0 4px 12px rgba(139, 61, 255, 0.3));
  }
  50% {
    filter: drop-shadow(0 0 20px rgba(139, 61, 255, 0.85))
      drop-shadow(0 6px 18px rgba(139, 61, 255, 0.55));
  }
}

.cb-launcher.cb-launcher--glow-pulse {
  animation: cb-launcher-glow 2.5s ease-in-out infinite;
}

@keyframes cb-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cb-launcher {
    animation: none;
  }
  .cb-launcher.cb-launcher--shake {
    animation: none;
  }
}

.cb-panel {
  display: none;
  flex-direction: column;
  width: min(380px, calc(100vw - 2.5rem));
  max-height: min(520px, calc(100vh - 6rem));
  min-height: 0;
  margin-bottom: 0.75rem;
  border-radius: 14px;
  overflow: hidden;
  background: var(--cb-window-bg);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(139, 61, 255, 0.35);
  pointer-events: auto;
}

.cb-panel.cb-panel--visible {
  display: flex;
}

.cb-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  background: var(--cb-header-bg);
  border-bottom: 1px solid rgba(139, 61, 255, 0.45);
  box-shadow: inset 0 -1px 0 rgba(184, 140, 255, 0.15);
}

.cb-header-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--cb-bot-text);
  margin: 0;
}

.cb-header-actions {
  display: flex;
  gap: 0.35rem;
}

.cb-icon-btn {
  border: 1px solid rgba(139, 61, 255, 0.45);
  background: transparent;
  color: var(--cb-accent-light);
  border-radius: 8px;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  cursor: pointer;
}

.cb-icon-btn:hover,
.cb-icon-btn:focus-visible {
  border-color: var(--cb-accent);
  box-shadow: 0 0 10px rgba(139, 61, 255, 0.35);
  outline: none;
}

.cb-welcome {
  flex-shrink: 0;
  text-align: center;
  padding: 0.75rem 1rem 0.25rem;
}

.cb-welcome img {
  width: 120px;
  height: auto;
  object-fit: contain;
  margin: 0 auto 0.5rem;
  display: block;
  filter: drop-shadow(0 0 10px rgba(139, 61, 255, 0.4));
}

.cb-welcome p {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--cb-bot-text);
}

.cb-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.75rem 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  scroll-behavior: smooth;
}

.cb-msg {
  display: flex;
  gap: 0.45rem;
  align-items: flex-end;
  max-width: 92%;
}

.cb-msg--user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.cb-msg-avatar {
  flex-shrink: 0;
  width: 36px;
  line-height: 0;
}

.cb-msg-avatar img {
  width: 36px;
  height: auto;
  object-fit: contain;
  display: block;
}

.cb-bubble {
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  font-size: 0.875rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.cb-msg--bot .cb-bubble {
  background: var(--cb-bot-bg);
  color: var(--cb-bot-text);
  border: 1px solid rgba(139, 61, 255, 0.2);
}

.cb-msg--user .cb-bubble {
  background: var(--cb-visitor-bg);
  color: var(--cb-visitor-text);
}

.cb-typing {
  display: flex;
  gap: 0.25rem;
  padding: 0.55rem 0.75rem;
  align-items: center;
}

.cb-typing span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--cb-accent);
  box-shadow: 0 0 8px var(--cb-accent-light);
  animation: cb-dot 1.2s ease-in-out infinite;
}

.cb-typing span:nth-child(2) {
  animation-delay: 0.15s;
}
.cb-typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes cb-dot {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.cb-suggestions {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0 0.85rem 0.65rem;
}

.cb-suggestions:empty,
.cb-suggestions[hidden] {
  display: none;
  padding: 0;
}

.cb-suggestion {
  border: 1px solid rgba(139, 61, 255, 0.55);
  background: transparent;
  color: var(--cb-accent-light);
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  cursor: pointer;
  transition:
    opacity 0.15s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.cb-suggestion.cb-suggestion--out {
  opacity: 0;
  pointer-events: none;
}

.cb-suggestion:hover,
.cb-suggestion:focus-visible {
  border-color: var(--cb-accent);
  box-shadow: 0 0 12px rgba(139, 61, 255, 0.35);
  outline: none;
}

.cb-msg-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.35rem 0 0 2.65rem;
}

.cb-msg-links a {
  border: 1px solid rgba(139, 61, 255, 0.55);
  background: rgba(139, 61, 255, 0.1);
  color: var(--cb-accent-light);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.78rem;
  text-decoration: none;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.cb-msg-links a:hover,
.cb-msg-links a:focus-visible {
  border-color: var(--cb-accent);
  box-shadow: 0 0 12px rgba(139, 61, 255, 0.35);
  outline: none;
}

.cb-compose {
  flex-shrink: 0;
  display: flex;
  gap: 0.45rem;
  padding: 0.65rem 0.85rem;
  border-top: 1px solid rgba(139, 61, 255, 0.25);
  background: rgba(26, 16, 51, 0.65);
}

.cb-input {
  flex: 1;
  border: 1px solid rgba(139, 61, 255, 0.35);
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
  font-size: 0.875rem;
  background: var(--cb-input-bg);
  color: var(--cb-input-text);
  resize: none;
  min-height: 2.5rem;
  max-height: 5rem;
  font-family: inherit;
}

.cb-input:focus {
  outline: none;
  border-color: var(--cb-accent);
  box-shadow: 0 0 0 2px rgba(139, 61, 255, 0.25);
}

.cb-send {
  border: 1px solid var(--cb-accent);
  background: rgba(139, 61, 255, 0.15);
  color: var(--cb-visitor-text);
  border-radius: 10px;
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: box-shadow 0.2s ease;
}

.cb-send:hover,
.cb-send:focus-visible {
  box-shadow: 0 0 14px rgba(139, 61, 255, 0.45);
  outline: none;
}

.cb-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
