/* Tap the sea: every swimming fish (.fish img) and anything with class "sea-tap" does a little
   dance and gives a burst of bubbles. Used by the homepage and the parent pages; load sea.js too.
   Pick the dances per element with data-dances="d-wiggle d-squish" (default: all five). */
.fish img, .sea-tap { pointer-events: auto; cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; -webkit-tap-highlight-color: transparent; transition: scale .15s; }
.fish img:hover, .sea-tap:hover { scale: 1.08; }
/* "html" in front so a dance always beats the page's own bob or sway animation */
html :is(.fish img, .sea-tap).d-spin { animation: f-spin .9s cubic-bezier(.3,1.4,.5,1); }
html :is(.fish img, .sea-tap).d-flip { animation: f-flip .9s ease-in-out; }
html :is(.fish img, .sea-tap).d-squish { animation: f-squish .8s ease-in-out; }
html :is(.fish img, .sea-tap).d-jump { animation: f-jump .8s cubic-bezier(.3,1.5,.5,1); }
html :is(.fish img, .sea-tap).d-wiggle { animation: f-wiggle .8s ease-in-out; }
@keyframes f-spin { 30% { scale: 1.2; } to { rotate: 360deg; } }
@keyframes f-flip { 25%, 75% { scale: -1 1; translate: 0 -10px; } }
@keyframes f-squish { 20% { scale: 1.25 .75; } 45% { scale: .8 1.2; translate: 0 -24px; } 70% { scale: 1.1 .9; translate: 0 0; } }
@keyframes f-jump { 40% { translate: 0 -46px; rotate: -18deg; } 70% { translate: 0 6px; rotate: 6deg; } }
@keyframes f-wiggle { 15%, 55% { rotate: -14deg; } 35%, 75% { rotate: 14deg; } }
.pop { position: fixed; z-index: 50; border-radius: 50%; pointer-events: none; border: 2px solid #fff; background: radial-gradient(circle at 30% 30%, #fff 0 20%, rgba(255,255,255,.3) 24%); animation: pop-out .9s ease-out forwards; }
@keyframes pop-out { from { transform: translate(-50%, -50%) scale(.3); opacity: 1; } to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1); opacity: 0; } }

/* Sea floor: <div class="sea-floor"></div> at the bottom of a sea-coloured block; sea.js puts the sand
   and the plants in (tap a plant and it wiggles). Height via --floor. */
.sea-floor { position: relative; height: var(--floor, 92px); pointer-events: none; }
.sea-floor .sand { position: absolute; inset: 0; background: #fbeccb; border-top: 4px solid #ecd7a6; border-radius: 50% 50% 0 0 / 28px 28px 0 0; }
.sea-floor .plant { position: absolute; left: var(--x); bottom: calc(100% - 18px); width: var(--w); transform-origin: 50% 100%; animation: sway 4.5s ease-in-out var(--delay) infinite; filter: drop-shadow(0 4px 0 rgba(43,43,58,.15)); }
.sea-floor .plant.flat { bottom: calc(100% - 52px); animation: none; }
@keyframes sway { 0%, 100% { rotate: -4deg; } 50% { rotate: 4deg; } }
@media (max-width: 600px) { .sea-floor .plant { width: calc(var(--w) * .75); } .sea-floor .plant.wide-only { display: none; } }

/* Rising bubbles: <div class="sea-bubbles"></div> inside a positioned block; sea.js adds them. */
.sea-bubbles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.sea-bubbles span { position: absolute; bottom: 8%; left: var(--x); width: var(--s); height: var(--s); border: 2px solid rgba(255,255,255,.8); border-radius: 50%; animation: rise var(--dur) ease-in var(--delay) infinite; opacity: 0; }
@keyframes rise { 0% { transform: translateY(0); opacity: 0; } 10% { opacity: 1; } 100% { transform: translateY(-80vh); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sea-floor .plant, .sea-bubbles span { animation: none; } .sea-bubbles { display: none; } }
