@charset "UTF-8";

/* ── Container ── */
.jelly-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Wrapper (GPU-only float) ── */
.jelly-wrapper {
  position: relative;
  width: 200px;
  height: 200px;
  will-change: transform;
  animation: jelly-float 3.5s infinite ease-in-out;
  z-index: 2;
}

/* ── Hair / Crown ── */
.jelly-hair {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 30px;
  background: #ff7ea5;
  border-radius: 50% 50% 10px 10px;
  z-index: 0;
}
.jelly-hair::before, .jelly-hair::after {
  content: "";
  position: absolute;
  background: #ff7ea5;
  border-radius: 50%;
}
.jelly-hair::before { width: 20px; height: 20px; left: -10px; top: 5px; }
.jelly-hair::after  { width: 20px; height: 20px; right: -10px; top: 5px; }

/* ── Body ── */
.jelly-body {
  position: absolute;
  top: 0;
  left: 0;
  width: 200px;
  height: 160px;
  background: linear-gradient(135deg, #ffd3e0 0%, #ffb6c1 100%);
  border-radius: 100px 100px 40px 40px;
  box-shadow: inset -10px -10px 20px rgba(0,0,0,0.05), inset 10px 10px 20px rgba(255,255,255,0.6);
  z-index: 1;
  will-change: transform;
  animation: body-squish 3.5s infinite ease-in-out;
  overflow: hidden;
}

/* ── Blush (static, no animation → zero cost) ── */
.jelly-blush {
  position: absolute;
  top: 85px;
  width: 30px;
  height: 18px;
  border-radius: 50%;
  background: #ff8da1;
  opacity: 0.45;
}
.jelly-blush::after {
  content: "";
  position: absolute;
  right: -110px;
  top: 0;
  width: 30px;
  height: 18px;
  border-radius: 50%;
  background: #ff8da1;
  opacity: 1;
}
.jelly-blush { left: 30px; }

/* ── Inner Face ── */
.jelly-inner {
  position: absolute;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 50px;
}

/* ── Eyes (blink uses scaleY = GPU) ── */
.jelly-eyes::before, .jelly-eyes::after {
  content: "";
  position: absolute;
  top: 0;
  width: 24px;
  height: 26px;
  border-radius: 50%;
  background-color: #5c3a21;
  background-image: radial-gradient(circle at 65% 35%, white 14%, transparent 15%),
                    radial-gradient(circle at 35% 70%, rgba(255,255,255,0.3) 10%, transparent 11%);
  will-change: transform;
  animation: blink 4s infinite;
}
.jelly-eyes::before { left: 10px; }
.jelly-eyes::after  { right: 10px; }

/* ── Mouth ── */
.jelly-mouth {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 12px;
  background: #ff6b81;
  border: 3px solid #5c3a21;
  border-top: none;
  border-radius: 0 0 14px 14px;
  overflow: hidden;
}
.jelly-mouth::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 6px;
  background: #ff9a9e;
  border-radius: 50%;
}

/* ── Hands (rotate = GPU) ── */
.jelly-hands::before, .jelly-hands::after {
  content: "";
  position: absolute;
  top: 40px;
  width: 24px;
  height: 20px;
  background: #ffb6c1;
  border-radius: 12px;
  border: 3px solid #ff9a9e;
  will-change: transform;
}
.jelly-hands::before { left: -15px; transform-origin: top right; animation: hand-wave-left 3.5s infinite ease-in-out; }
.jelly-hands::after  { right: -15px; transform-origin: top left; animation: hand-wave-right 3.5s infinite ease-in-out; }

/* ── Tentacles (translateY only = GPU) ── */
div[class^=jelly-tentacle-] {
  position: absolute;
  width: 28px;
  height: 40px;
  background: linear-gradient(to bottom, #ffb6c1, #ff9a9e);
  border-radius: 0 0 14px 14px;
  bottom: 0;
  z-index: 0;
  will-change: transform;
}
.jelly-tentacle-1 { left: 15px;  animation: tentacle-wave 2s infinite ease-in-out 0.1s; }
.jelly-tentacle-2 { left: 52px;  animation: tentacle-wave 2s infinite ease-in-out 0.3s; }
.jelly-tentacle-3 { left: 86px;  animation: tentacle-wave 2s infinite ease-in-out 0.5s; }
.jelly-tentacle-4 { left: 120px; animation: tentacle-wave 2s infinite ease-in-out 0.7s; }
.jelly-tentacle-5 { left: 157px; animation: tentacle-wave 2s infinite ease-in-out 0.9s; }

/* ── Shadow (static blur, animate with transform only) ── */
.jelly-shadow {
  position: absolute;
  bottom: -30px;
  left: 50%;
  width: 140px;
  height: 20px;
  border-radius: 50%;
  background: rgba(224, 26, 94, 0.2);
  filter: blur(5px);
  transform: translateX(-50%);
  will-change: transform, opacity;
  animation: shadow-scale 3.5s infinite ease-in-out;
}

/* ── Bubbles: use transform: scale() instead of width/height ── */
div[class^=bubble-] {
  width: 40px;
  height: 40px;
  position: absolute;
  background-color: rgba(255, 182, 193, 0.5);
  border-radius: 50%;
  will-change: transform, opacity;
  transform: translate(-50%, 0) scale(0);
}
div[class^=bubble-]:after {
  content: "";
  position: absolute;
  height: 85%;
  width: 85%;
  border-top: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotateZ(-45deg);
}

/* Only 8 bubbles (reduce from 20 to 8 for perf) */
.bubble-1  { bottom: 6px; left: 27%; animation: bubble-gpu 5s infinite ease-in -2.3s; }
.bubble-2  { bottom: 7px; left: 49%; animation: bubble-gpu 5s infinite ease-in -1.1s; }
.bubble-3  { bottom: 3px; left: 23%; animation: bubble-gpu 6s infinite ease-in -1.5s; }
.bubble-4  { bottom: 9px; left: 80%; animation: bubble-gpu 5s infinite ease-in -3.8s; }
.bubble-5  { bottom: 10px; left: 41%; animation: bubble-gpu 6s infinite ease-in -0.5s; }
.bubble-6  { bottom: 4px; left: 65%; animation: bubble-gpu 5s infinite ease-in -2.9s; }
.bubble-7  { bottom: 8px; left: 12%; animation: bubble-gpu 6s infinite ease-in -4.2s; }
.bubble-8  { bottom: 6px; left: 90%; animation: bubble-gpu 5s infinite ease-in -0.1s; }
/* Hide the rest that still exist in HTML */
.bubble-9, .bubble-10, .bubble-11, .bubble-12,
.bubble-13, .bubble-14, .bubble-15, .bubble-16,
.bubble-17, .bubble-18, .bubble-19, .bubble-20 {
  display: none;
}

/* ════════════ Keyframes (all GPU-only: transform + opacity) ════════════ */

@keyframes jelly-float {
  0%, 100% { transform: translateY(-10px); }
  50%      { transform: translateY(15px); }
}

@keyframes body-squish {
  0%, 100% { transform: scaleX(1) scaleY(1); }
  50%      { transform: scaleX(1.05) scaleY(0.95); }
}

@keyframes hand-wave-left {
  0%, 100% { transform: rotate(-20deg); }
  50%      { transform: rotate(-40deg); }
}

@keyframes hand-wave-right {
  0%, 100% { transform: rotate(20deg); }
  50%      { transform: rotate(40deg); }
}

/* Was animating `bottom` → now `translateY` */
@keyframes tentacle-wave {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(6px) rotate(3deg); }
}

/* Was animating transform + filter → just transform + opacity now */
@keyframes shadow-scale {
  0%, 100% { transform: translateX(-50%) scale(1);   opacity: 0.4; }
  50%      { transform: translateX(-50%) scale(0.8); opacity: 0.8; }
}

@keyframes blink {
  0%, 96%, 98%, 100% { transform: scaleY(1); }
  97%                { transform: scaleY(0.1); }
}

/* Bubbles: scale() + translateY instead of width/height */
@keyframes bubble-gpu {
  0%   { transform: translate(-50%, 0) scale(0);   opacity: 0.8; }
  100% { transform: translate(-50%, -350px) scale(1); opacity: 0; }
}
