/* ==========================================================
   SPEAKIE OCEAN POOL & PET HABITAT STYLING
   ========================================================== */

/* The swimming habitat container inside .hero-banner-ocean */
.ocean-pool-habitat {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}

/* Base style for each swimming pet entity */
.swimming-pet {
  position: absolute;
  pointer-events: auto;
  cursor: pointer;
  user-select: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.4s ease;
  z-index: 10;
}

.swimming-pet:hover {
  filter: drop-shadow(0 6px 14px rgba(37, 99, 235, 0.45));
  z-index: 25;
}

/* Inner body containing image and bubble trail */
.pet-inner-body {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: petBobFloat 3.8s ease-in-out infinite alternate;
}

.pet-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.12));
  transition: transform 0.25s ease;
}

.swimming-pet:hover .pet-img {
  transform: scale(1.12);
}

/* Joyful Backflip animation when clicked */
.pet-backflip {
  animation: petJoySpin 0.85s cubic-bezier(0.34, 1.56, 0.64, 1) forwards !important;
}

@keyframes petJoySpin {
  0% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-24px) rotate(-180deg) scale(1.25); }
  100% { transform: translateY(0) rotate(-360deg); }
}

/* Newly adopted pet celebration bounce */
.pet-celebrate-spawn {
  animation: petSpawnBounce 1.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes petSpawnBounce {
  0% { transform: scale(0) translateY(50px); opacity: 0; }
  60% { transform: scale(1.3) translateY(-18px); opacity: 1; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* Trailing bubble stream effect */
.pet-bubbles-stream {
  position: absolute;
  bottom: 10%;
  left: 20%;
  width: 6px;
  height: 6px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.9);
  pointer-events: none;
  animation: petBubbleTrail 2.5s infinite;
}

@keyframes petBubbleTrail {
  0% {
    transform: translate(0, 0) scale(0.6);
    opacity: 0.8;
  }
  50% {
    transform: translate(-12px, -14px) scale(1.2);
    opacity: 0.6;
  }
  100% {
    transform: translate(-22px, -30px) scale(1.6);
    opacity: 0;
  }
}

/* Ocean Titan Sparkling Aura (Streak >= 20) */
.pet-titan-aura {
  filter: drop-shadow(0 0 10px rgba(250, 204, 21, 0.9)) drop-shadow(0 0 20px rgba(56, 189, 248, 0.75));
  animation: titanPulse 2.8s ease-in-out infinite alternate;
}

@keyframes titanPulse {
  0% { filter: drop-shadow(0 0 8px rgba(250, 204, 21, 0.8)) drop-shadow(0 0 16px rgba(56, 189, 248, 0.6)); }
  100% { filter: drop-shadow(0 0 16px rgba(245, 158, 11, 1)) drop-shadow(0 0 26px rgba(14, 165, 233, 0.95)); }
}

/* Floating Bobbing Keyframes */
@keyframes petBobFloat {
  0% {
    transform: translateY(-5px) rotate(-1.5deg);
  }
  100% {
    transform: translateY(6px) rotate(2deg);
  }
}

/* ==========================================================
   SWIMMING LANES & PATROLS ACROSS THE WATER (LEFT <-> RIGHT)
   ========================================================== */

/* Lane A: gentle wide patrol */
@keyframes swimAcrossA {
  0% {
    left: 28%;
    transform: scaleX(1);
  }
  48% {
    transform: scaleX(1);
  }
  50% {
    left: 82%;
    transform: scaleX(-1);
  }
  98% {
    transform: scaleX(-1);
  }
  100% {
    left: 28%;
    transform: scaleX(1);
  }
}
.lane-swim-a {
  animation: swimAcrossA 24s ease-in-out infinite;
}

/* Lane B: cruising across middle */
@keyframes swimAcrossB {
  0% {
    left: 78%;
    transform: scaleX(-1);
  }
  48% {
    transform: scaleX(-1);
  }
  50% {
    left: 32%;
    transform: scaleX(1);
  }
  98% {
    transform: scaleX(1);
  }
  100% {
    left: 78%;
    transform: scaleX(-1);
  }
}
.lane-swim-b {
  animation: swimAcrossB 28s ease-in-out infinite;
}

/* Lane C: playful lower patrol */
@keyframes swimAcrossC {
  0% {
    left: 36%;
    transform: scaleX(1);
  }
  48% {
    transform: scaleX(1);
  }
  50% {
    left: 85%;
    transform: scaleX(-1);
  }
  98% {
    transform: scaleX(-1);
  }
  100% {
    left: 36%;
    transform: scaleX(1);
  }
}
.lane-swim-c {
  animation: swimAcrossC 26s ease-in-out infinite;
}

/* Lane D: leisurely top swimmer */
@keyframes swimAcrossD {
  0% {
    left: 72%;
    transform: scaleX(-1);
  }
  48% {
    transform: scaleX(-1);
  }
  50% {
    left: 40%;
    transform: scaleX(1);
  }
  98% {
    transform: scaleX(1);
  }
  100% {
    left: 72%;
    transform: scaleX(-1);
  }
}
.lane-swim-d {
  animation: swimAcrossD 30s ease-in-out infinite;
}

/* Additional lanes E through J for smooth distributed swimming */
@keyframes swimAcrossE {
  0% { left: 45%; transform: scaleX(1); }
  50% { left: 80%; transform: scaleX(-1); }
  100% { left: 45%; transform: scaleX(1); }
}
.lane-swim-e { animation: swimAcrossE 22s ease-in-out infinite; }

@keyframes swimAcrossF {
  0% { left: 65%; transform: scaleX(-1); }
  50% { left: 30%; transform: scaleX(1); }
  100% { left: 65%; transform: scaleX(-1); }
}
.lane-swim-f { animation: swimAcrossF 25s ease-in-out infinite; }

@keyframes swimAcrossG {
  0% { left: 52%; transform: scaleX(1); }
  50% { left: 86%; transform: scaleX(-1); }
  100% { left: 52%; transform: scaleX(1); }
}
.lane-swim-g { animation: swimAcrossG 29s ease-in-out infinite; }

@keyframes swimAcrossH {
  0% { left: 75%; transform: scaleX(-1); }
  50% { left: 42%; transform: scaleX(1); }
  100% { left: 75%; transform: scaleX(-1); }
}
.lane-swim-h { animation: swimAcrossH 33s ease-in-out infinite; }

@keyframes swimAcrossI {
  0% { left: 38%; transform: scaleX(1); }
  50% { left: 74%; transform: scaleX(-1); }
  100% { left: 38%; transform: scaleX(1); }
}
.lane-swim-i { animation: swimAcrossI 27s ease-in-out infinite; }

@keyframes swimAcrossJ {
  0% { left: 60%; transform: scaleX(-1); }
  50% { left: 34%; transform: scaleX(1); }
  100% { left: 60%; transform: scaleX(-1); }
}
.lane-swim-j { animation: swimAcrossJ 31s ease-in-out infinite; }


/* ==========================================================
   SPEECH BUBBLE TOOLTIP OVER SWIMMING PETS
   ========================================================== */
.pet-speech-bubble {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) scale(0.85);
  background: white;
  color: #1e293b;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-lg, 14px);
  box-shadow: 0 10px 25px -4px rgba(0, 0, 0, 0.18), 0 0 0 1.5px rgba(59, 130, 246, 0.25);
  font-family: inherit;
  font-size: 0.775rem;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), visibility 0.25s;
  z-index: 100;
}

.pet-speech-bubble::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: white transparent transparent transparent;
}

.swimming-pet:hover .pet-speech-bubble,
.pet-speech-bubble.visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) scale(1);
}

.pet-bubble-title {
  font-weight: 900;
  font-size: 0.825rem;
  color: #1e40af;
  margin-bottom: 0.15rem;
}

.pet-bubble-desc {
  font-size: 0.72rem;
  font-weight: 700;
  color: #059669;
  margin-bottom: 0.25rem;
}

.pet-bubble-quote {
  font-style: italic;
  color: #64748b;
  font-size: 0.725rem;
}


/* ==========================================================
   HERO OCEAN POOL STATUS BUTTON (ON HERO BANNER)
   ========================================================== */
.hero-pool-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  background: rgba(255, 255, 255, 0.94);
  border: 1.5px solid #93c5fd;
  border-radius: 18px;
  padding: 0.5rem 0.95rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.15);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  margin-top: 0.5rem;
  margin-left: 135px;
  backdrop-filter: blur(8px);
  color: #1e293b;
  font-family: inherit;
  font-size: 0.825rem;
  position: relative;
  z-index: 5;
  width: fit-content;
  max-width: 175px;
  text-align: center;
}

.hero-pool-btn:hover {
  background: #ffffff;
  border-color: #3b82f6;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}

.pool-badge-title {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: #1e3a8a;
  white-space: nowrap;
  line-height: 1.2;
}

.pool-growth-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  white-space: nowrap;
}

.pool-growth-tag.lv-2 {
  background: #f0fdf4;
  color: #16a34a;
  border-color: #bbf7d0;
}

.pool-growth-tag.lv-3 {
  background: #fffbeb;
  color: #d97706;
  border-color: #fde68a;
}

.pool-growth-tag.lv-4 {
  background: #fdf4ff;
  color: #9333ea;
  border-color: #f5d0fe;
}

.pool-growth-tag.lv-5 {
  background: linear-gradient(135deg, #fef08a, #fde047);
  color: #854d0e;
  border-color: #eab308;
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.6);
  font-weight: 900;
}

.pool-token-pill {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  font-weight: 900;
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  animation: pulseAdoptBadge 1.2s infinite;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
}

@keyframes pulseAdoptBadge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

/* Pulsing glow when adoption slots are waiting */
.pool-adopt-ready-glow {
  border-color: #10b981 !important;
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.45) !important;
  animation: glowPulse 2s infinite;
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(16, 185, 129, 0.35); }
  50% { box-shadow: 0 0 20px rgba(16, 185, 129, 0.7); }
}

/* Responsive adjustment for small screens */
@media (max-width: 768px) {
  .hero-pool-btn {
    font-size: 0.78rem;
    padding: 0.35rem 0.75rem;
  }
}


/* Ensure Modal is 100% visible and interactive when opened */
#petAdoptionModal {
  z-index: 99999 !important;
}
#petAdoptionModal.show {
  opacity: 1 !important;
  pointer-events: auto !important;
  display: flex !important;
}
#petAdoptionModal.show .cute-modal-card {
  transform: translateY(0) scale(1) !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}


#petAdoptionModal .cute-modal-card {
  background: #ffffff !important;
  border-radius: 24px !important;
  padding: 1.5rem !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
  border: 1.5px solid #e2e8f0 !important;
}

/* ==========================================================
   OCEAN REEF & SEABED FLORA (SWAYING CORALS & SEAWEEDS)
   Anchored firmly to seabed, sways naturally with water currents
   ========================================================== */
.ocean-flora-bed {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.flora-plant {
  position: absolute;
  bottom: 0;
  transform-origin: bottom center;
  pointer-events: auto;
  cursor: pointer;
  user-select: none;
  filter: drop-shadow(0 4px 10px rgba(15, 23, 42, 0.15));
  transition: transform 0.4s ease, filter 0.3s ease;
  will-change: transform;
}

.flora-plant:hover {
  filter: drop-shadow(0 8px 18px rgba(37, 99, 235, 0.4)) brightness(1.12);
}

/* 1. Green wavy kelp on stones (Left edge) */
.flora-seaweed-1 {
  left: 16px;
  height: 128px;
  width: auto;
  bottom: 0;
  animation: floraSwayGentle 5.2s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite alternate;
}

/* 2. Purple coral sponge sitting next to kelp */
.flora-coral-purple {
  left: 78px;
  height: 75px;
  width: auto;
  bottom: 0;
  animation: floraSwayShort 4.2s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite alternate 0.6s;
}

/* 3. Cyan graceful seaweed around 35% */
.flora-seaweed-cyan {
  left: 35%;
  height: 110px;
  width: auto;
  bottom: 0;
  animation: floraSwayDeep 6.2s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite alternate 1.2s;
}

/* 4. Pink tubular coral sponge around 52% */
.flora-coral-tubes {
  left: 52%;
  height: 86px;
  width: auto;
  bottom: 2px;
  animation: floraSwayShort 4.8s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite alternate 0.9s;
}

/* 5. Green bushy kelp on the right */
.flora-seaweed-bush {
  right: 120px;
  height: 115px;
  width: auto;
  bottom: 0;
  animation: floraSwayGentle 5.6s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite alternate 0.3s;
}

/* 6. Pink coral fingers on the far right */
.flora-coral-fingers {
  right: 22px;
  height: 108px;
  width: auto;
  bottom: 0;
  animation: floraSwayDeep 5.0s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite alternate 1.5s;
}

/* Fluid underwater swaying keyframes (firmly rooted to seabed, swaying rhythmically with ocean swells) */
@keyframes floraSwayGentle {
  0% {
    transform: rotate(-7deg) skewX(-4deg) scaleY(1);
  }
  35% {
    transform: rotate(-1deg) skewX(-1deg) scaleY(1.02);
  }
  70% {
    transform: rotate(5deg) skewX(3deg) scaleY(0.99);
  }
  100% {
    transform: rotate(8deg) skewX(5deg) scaleY(0.97);
  }
}

@keyframes floraSwayDeep {
  0% {
    transform: rotate(8deg) skewX(5deg) scaleY(0.98);
  }
  35% {
    transform: rotate(1deg) skewX(1deg) scaleY(1.02);
  }
  70% {
    transform: rotate(-4deg) skewX(-3deg) scaleY(1.01);
  }
  100% {
    transform: rotate(-8deg) skewX(-5deg) scaleY(0.97);
  }
}

@keyframes floraSwayShort {
  0% {
    transform: rotate(-4deg) skewX(-2deg) scaleY(1);
  }
  50% {
    transform: rotate(2deg) skewX(1.5deg) scaleY(1.03);
  }
  100% {
    transform: rotate(5deg) skewX(3deg) scaleY(0.98);
  }
}

/* Responsive scaling for mobile / small screens */
@media (max-width: 768px) {
  .flora-seaweed-1 { height: 90px; left: 8px; }
  .flora-coral-purple { height: 55px; left: 55px; }
  .flora-seaweed-cyan { display: none; }
  .flora-coral-tubes { height: 60px; left: 50%; }
  .flora-seaweed-bush { height: 80px; right: 65px; }
  .flora-coral-fingers { height: 75px; right: 10px; }
}
