/* Pure CSS iridescent soap bubble fallback when WebGL or ES module is unavailable */
.bubble--fallback {
  position: relative;
  display: grid;
  place-items: center;
  isolation: isolate;
}

.bubble--fallback::before,
.bubble--fallback::after {
  content: "";
  position: absolute;
  inset: 10.6%;
  border-radius: 50%;
  pointer-events: none;
  transition: transform 1.1s cubic-bezier(0.22, 1, 0.36, 1),
    filter 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Pearlescent thin-film shell with crystal-clear center */
.bubble--fallback::before {
  background:
    radial-gradient(circle at 50% 50%,
      rgba(6, 7, 13, 0.01) 0%,
      rgba(6, 7, 13, 0.03) 50%,
      rgba(128, 224, 240, 0.22) 70%,
      rgba(220, 124, 242, 0.52) 85%,
      rgba(246, 228, 196, 0.78) 95%,
      rgba(255, 255, 255, 0.90) 99%,
      transparent 100%),
    conic-gradient(
      from 30deg at 50% 50%,
      rgba(116, 236, 242, 0.68),
      rgba(240, 214, 162, 0.60),
      rgba(224, 108, 214, 0.72),
      rgba(136, 114, 252, 0.72),
      rgba(94, 226, 236, 0.70),
      rgba(232, 126, 226, 0.68),
      rgba(116, 236, 242, 0.68)
    );
  -webkit-mask-image: radial-gradient(circle at 50% 50%, transparent 48%, rgba(0, 0, 0, 0.4) 70%, #000 89%, #000 97%, transparent 100%);
  mask-image: radial-gradient(circle at 50% 50%, transparent 48%, rgba(0, 0, 0, 0.4) 70%, #000 89%, #000 97%, transparent 100%);
  box-shadow:
    inset 0 0 24px rgba(178, 146, 255, 0.32),
    inset 0 0 8px rgba(255, 255, 255, 0.48);
  animation: bubbleFallbackFloat 6.2s ease-in-out infinite, bubbleFallbackSpin 15s linear infinite;
}

/* Asymmetric upper-left pinpoint specular + soft elongated lower-right sheen */
.bubble--fallback::after {
  background:
    radial-gradient(ellipse 4.2% 3.2% at 28% 25%, rgba(255, 255, 255, 0.94) 0%, rgba(255, 255, 255, 0) 72%),
    radial-gradient(ellipse 14% 5% at 72% 76%, rgba(226, 238, 255, 0.34) 0%, rgba(255, 255, 255, 0) 72%),
    radial-gradient(circle at 50% 50%, transparent 74%, rgba(255, 255, 255, 0.28) 96%, rgba(255, 255, 255, 0) 100%);
  animation: bubbleFallbackFloat 6.2s ease-in-out infinite;
}

.bubble--fallback[data-state="escutando"]::before {
  transform: scale(0.9);
  filter: hue-rotate(-34deg) saturate(1.05);
}

.bubble--fallback[data-state="escutando"]::after {
  transform: scale(0.9);
}

.bubble--fallback[data-state="pensando"]::before {
  animation: bubbleFallbackFloat 4.4s ease-in-out infinite, bubbleFallbackSpin 4.4s linear infinite;
  filter: saturate(1.18);
}

.bubble--fallback[data-state="falando"]::before {
  animation: bubbleFallbackSpeak 1.5s ease-in-out infinite, bubbleFallbackSpin 9s linear infinite;
}

@keyframes bubbleFallbackFloat {
  0%, 100% {
    transform: translateY(0) scale(1, 1);
  }
  50% {
    transform: translateY(-7px) scale(0.985, 1.018);
  }
}

@keyframes bubbleFallbackSpin {
  from {
    filter: hue-rotate(0deg);
  }
  to {
    filter: hue-rotate(360deg);
  }
}

@keyframes bubbleFallbackSpeak {
  0%, 100% {
    transform: scale(1.025, 0.98);
  }
  33% {
    transform: scale(0.98, 1.03);
  }
  66% {
    transform: scale(1.03, 0.985);
  }
}

@media (prefers-reduced-motion: reduce) {
  .bubble--fallback::before,
  .bubble--fallback::after {
    animation: none;
  }
}
