/* Elena aquarium launcher: purple fish-bowl with a swimming TV-eyed robot */
.elena-aqua-dock {
  position: fixed;
  right: 18px;
  bottom: 96px;
  z-index: 40;
  display: flex;
  align-items: center;
}

#elena-launcher.elena-aqua-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
#elena-launcher.elena-aqua-container:focus-visible {
  outline: 3px solid #c084fc;
  outline-offset: 3px;
}

.elena-aqua-sphere {
  display: block;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f5d0fe 0%, #d8b4fe 45%, #9333ea 90%, #581c87 100%);
  border: 4px solid #3b0764;
  box-shadow:
    0 6px 20px rgba(88, 28, 135, .45),
    inset 0 -6px 12px rgba(59, 7, 100, .5),
    inset 0 6px 10px rgba(255, 255, 255, .7);
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  transition: transform .25s cubic-bezier(.34, 1.56, .64, 1), box-shadow .25s ease;
}
.elena-aqua-container:hover .elena-aqua-sphere,
.elena-aqua-container:focus-visible .elena-aqua-sphere {
  transform: scale(1.08);
  box-shadow: 0 8px 28px rgba(147, 51, 234, .65), inset 0 6px 12px rgba(255, 255, 255, .8);
}

.elena-aqua-gloss {
  position: absolute;
  top: 5px;
  left: 10px;
  width: 24px;
  height: 12px;
  background: rgba(255, 255, 255, .55);
  border-radius: 50%;
  transform: rotate(-25deg);
  pointer-events: none;
  z-index: 5;
}

.elena-swimming-bot {
  width: 58px;
  height: 58px;
  position: absolute;
  top: 6px;
  left: 1px;
  animation: elenaSwimFloat 3.6s ease-in-out infinite;
  z-index: 3;
}
@keyframes elenaSwimFloat {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-5px) rotate(4deg); }
}

.elena-tv-pupils {
  transform-box: fill-box;
  transform-origin: center;
  animation: elenaLookAround 4.5s ease-in-out infinite;
}
@keyframes elenaLookAround {
  0%, 15% { transform: translateX(0); }
  25%, 40% { transform: translateX(-3.2px); }
  50%, 60% { transform: translateX(0) translateY(-1px); }
  70%, 85% { transform: translateX(3.2px); }
  92% { transform: translateX(0) scaleY(.15); }
  100% { transform: translateX(0) scaleY(1); }
}

.elena-bot-fin {
  transform-box: fill-box;
  transform-origin: center;
  animation: elenaFinPaddle 1.2s ease-in-out infinite;
}
.elena-bot-fin.right { animation-name: elenaFinPaddleRight; animation-delay: .6s; }
@keyframes elenaFinPaddle {
  0%, 100% { transform: rotate(-25deg) scaleX(1); }
  50% { transform: rotate(10deg) scaleX(.75); }
}
@keyframes elenaFinPaddleRight {
  0%, 100% { transform: rotate(25deg) scaleX(1); }
  50% { transform: rotate(-10deg) scaleX(.75); }
}
.elena-bot-antenna { animation: elenaAntennaGlow 2.2s ease-in-out infinite; }
@keyframes elenaAntennaGlow {
  0%, 100% { fill: #f43f5e; }
  50% { fill: #fb7185; }
}

.aqua-bubble {
  position: absolute;
  display: block;
  background: rgba(255, 255, 255, .75);
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 50%;
  bottom: -10px;
  z-index: 4;
  pointer-events: none;
}
.aqua-bubble.b1 { width: 7px; height: 7px; left: 46px; animation: elenaBubbleRise 2.4s infinite ease-in .2s; }
.aqua-bubble.b2 { width: 5px; height: 5px; left: 14px; animation: elenaBubbleRise 3.1s infinite ease-in 1.1s; }
.aqua-bubble.b3 { width: 9px; height: 9px; left: 49px; animation: elenaBubbleRise 2.8s infinite ease-in 1.7s; }
.aqua-bubble.b4 { width: 4px; height: 4px; left: 26px; animation: elenaBubbleRise 2.2s infinite ease-in .7s; }
@keyframes elenaBubbleRise {
  0% { bottom: 12px; opacity: 0; transform: translateX(0) scale(.5); }
  20% { opacity: .9; }
  80% { opacity: .8; transform: translateX(-4px) scale(1.1); }
  100% { bottom: 64px; opacity: 0; transform: translateX(3px) scale(.8); }
}

.elena-speech-bubble {
  position: absolute;
  top: 50%;
  right: 86px;
  transform: translateY(-50%) scale(.85);
  transform-origin: right center;
  background: linear-gradient(135deg, #ffffff 0%, #faf5ff 100%);
  color: #3b0764;
  border: 2px solid #7e22ce;
  padding: 10px 30px 10px 14px;
  border-radius: 14px;
  font: 700 13px/1.35 Manrope, system-ui, sans-serif;
  text-align: left;
  width: max-content;
  max-width: min(240px, calc(100vw - 120px));
  box-shadow: 0 8px 24px rgba(88, 28, 135, .28);
  opacity: 0;
  visibility: hidden;
  cursor: pointer;
  transition: opacity .35s ease, transform .35s cubic-bezier(.34, 1.56, .64, 1), visibility 0s linear .35s;
}
.elena-speech-bubble.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) scale(1);
  transition: opacity .35s ease, transform .35s cubic-bezier(.34, 1.56, .64, 1), visibility 0s;
}
.elena-speech-bubble::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -9px;
  transform: translateY(-50%);
  border-width: 8px 0 8px 9px;
  border-style: solid;
  border-color: transparent transparent transparent #7e22ce;
}
.elena-speech-close {
  position: absolute;
  top: 4px;
  right: 6px;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #7e22ce;
  font: 700 15px/20px system-ui, sans-serif;
  cursor: pointer;
}
.elena-speech-close:hover { background: #f3e8ff; }

.elena-aqua-dock.panel-open .elena-speech-bubble { display: none; }

@media (max-width: 640px) {
  .elena-aqua-dock { right: 10px; bottom: 84px; }
}

@media (prefers-reduced-motion: reduce) {
  .elena-swimming-bot,
  .elena-tv-pupils,
  .elena-bot-fin,
  .elena-bot-antenna,
  .aqua-bubble { animation: none; }
  .aqua-bubble { display: none; }
}
