.flamey-container {
  position: fixed;
  display: flex;
  flex-direction: row; /* Avatar on left, text on right */
  align-items: flex-end; /* Align to bottom for natural look */
  gap: 8px; /* Space between avatar and text */
  z-index: 9998; /* Below chatbot (10000) */
  bottom: 140px; /* Above footer */
  left: 24px; /* Slight breathing room from edge */
  right: auto !important;
}

.position-bottom-right {
  bottom: 20px;
  right: 2rem;
  left: auto;
  flex-direction: row-reverse;
}

.position-bottom-left {
  bottom: 20px;
  left: 20px;
  right: auto !important;
  flex-direction: row;
}

.position-center {
  top: 50%;
  left: 50%;
  right: auto;
  transform: translate(-50%, -50%);
  flex-direction: row;
  text-align: center;
}

.flamey-text {
  background-color: rgba(10, 15, 30, 0.92);
  color: rgba(255, 255, 255, 0.95);
  padding: 14px 18px;
  border-radius: 16px;
  max-width: 260px;
  font-family: "Manrope", sans-serif;
  font-size: 0.95rem;
  line-height: 1.55;
  letter-spacing: 0.01em;
  opacity: 0;
  animation: fadeInUp 1s forwards;
  border: 1px solid rgba(155, 93, 255, 0.2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.flamey-avatar {
  width: 100px; /* Slightly smaller for better balance */
  height: auto;
  opacity: 0;
  animation: fadeInUp 1s forwards;
  animation-delay: 0.3s;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
  margin-bottom: 4px; /* Slight lift from bottom */
}

/* Fade in -up animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile/tablet responsive - keep Flamey in corner, don't overlap quest content */
@media (max-width: 768px) {
  .flamey-container,
  .flamey-container.position-bottom-left,
  .flamey-container.position-bottom-right {
    bottom: 100px !important; /* Lower - above chat toggle, below scrollable content */
    left: 12px !important;
    right: auto !important;
    transform: none !important;
    max-width: min(180px, calc(100vw - 100px)); /* Compact, leave space */
    gap: 6px;
  }

  .flamey-avatar {
    width: 45px;
    margin-bottom: 2px;
  }

  .flamey-text {
    font-size: 11px;
    padding: 8px 12px;
    max-width: 160px;
    line-height: 1.5;
    border-radius: 12px;
    background-color: rgba(10, 15, 30, 0.95); /* Stronger background for contrast */
    color: #ffffff !important;
    border: 1px solid rgba(155, 93, 255, 0.35);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  }
}

/* Extra small screens - minimal overlap with quest content */
@media (max-width: 480px) {
  .flamey-container,
  .flamey-container.position-bottom-left,
  .flamey-container.position-bottom-right {
    bottom: 90px !important;
    left: 8px !important;
    gap: 4px;
    max-width: min(150px, calc(100vw - 90px));
  }
  
  .flamey-avatar {
    width: 38px;
  }
  
  .flamey-text {
    font-size: 10px;
    padding: 6px 10px;
    max-width: 140px;
    border-radius: 10px;
    color: #ffffff !important;
  }
}
