/* Valaciel Floating Companion Mascot — Bottom Left */

.floating-mascot {
  position: fixed;
  left: 2rem;
  bottom: 1.5rem;
  z-index: 95;
  display: none;
  flex-direction: column;
  align-items: flex-start;
  pointer-events: auto;
  user-select: none;
  cursor: pointer;
  transform: translateX(0);
  transition: transform 1.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.floating-mascot.is-visible {
  display: flex;
}

.floating-mascot__body {
  position: relative;
  margin: 0;
  padding: 0;
  white-space: pre;
  line-height: 1;
  letter-spacing: 0;
  font-family: Consolas, "Cascadia Mono", "DejaVu Sans Mono", Menlo, ui-monospace, monospace;
  font-size: 13px;
  color: var(--muted, #abb6cc);
  transform-origin: bottom center;
  transition: transform 0.2s ease;
}

.floating-mascot:hover .floating-mascot__body {
  transform: scale(1.05);
}

.floating-mascot__body .y {
  color: var(--gold, #f0bc25);
  text-shadow: 0 0 8px rgba(240, 188, 37, 0.4);
}

.floating-mascot__body .n {
  color: #3a5695;
}

.floating-mascot__body .f {
  color: var(--error, #e5484d);
  background: #3a5695;
  text-shadow: 0 0 10px rgba(229, 72, 77, 0.7);
}

/* Speech / Thought Bubble */
.floating-mascot__bubble {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  min-width: 100%;
  width: max-content;
  max-width: min(240px, calc(100vw - 3rem));
  padding: 0.55rem 0.85rem;
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid var(--gold, #f0bc25);
  border-radius: 6px;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.55),
    0 0 14px rgba(240, 188, 37, 0.22);
  color: var(--text, #f3ead2);
  font-family: var(--font-mono, Consolas, "Cascadia Mono", monospace);
  font-size: 0.78rem;
  line-height: 1.35;
  text-align: center;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px) scale(0.96) translateX(var(--bubble-shift-x, 0px));
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
  backdrop-filter: blur(6px);
  z-index: 100;
}

.floating-mascot__bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: calc(36px + var(--tail-offset, 0px));
  border-width: 6px 6px 0;
  border-style: solid;
  border-color: var(--gold, #f0bc25) transparent transparent;
}

.floating-mascot__bubble::before {
  content: "";
  position: absolute;
  top: 100%;
  left: calc(37px + var(--tail-offset, 0px));
  border-width: 5px 5px 0;
  border-style: solid;
  border-color: rgba(15, 23, 42, 0.94) transparent transparent;
  z-index: 1;
}

.floating-mascot__bubble.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1) translateX(var(--bubble-shift-x, 0px));
}

@media (max-width: 600px) {
  .floating-mascot {
    left: 1.25rem;
    bottom: 1rem;
  }
  .floating-mascot__body {
    font-size: 11px;
  }
  .floating-mascot__bubble {
    font-size: 0.72rem;
    max-width: min(180px, calc(100vw - 2.5rem));
  }
}

@media (prefers-reduced-motion: reduce) {
  .floating-mascot {
    transition: none !important;
  }
  .floating-mascot__body {
    transition: none !important;
  }
  .floating-mascot:hover .floating-mascot__body {
    transform: none;
  }
}
