/* /JElliefish: countdown to JElliefish day, in a glowing jellyfish sea. */

.jf {
  --pink: #ff8fd8; --lilac: #b69bff; --aqua: #7ff6ff; --ink: #fdf4ff;
  position: relative; isolation: isolate; overflow: hidden; margin: 20px 0 8px; min-height: 78vh;
  padding: clamp(28px, 6vw, 64px) 16px 36px; border-radius: 28px; text-align: center; color: var(--ink);
  background:
    radial-gradient(60% 40% at 20% 10%, rgba(255, 143, 216, .35), transparent 70%),
    radial-gradient(50% 35% at 85% 30%, rgba(127, 246, 255, .25), transparent 70%),
    linear-gradient(180deg, #3b1d7a 0%, #241256 40%, #120a35 75%, #07041a 100%);
  font-family: "Fredoka", system-ui, sans-serif;
}

/* Bubbles */
.jf-bubbles, .jf-swarm { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.jf-bubbles i {
  position: absolute; bottom: -20px; left: calc(var(--i) * 7% + 2%); width: calc(5px + mod(var(--i) * 7, 4) * 4px); aspect-ratio: 1;
  border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .5);
  animation: jf-rise calc(8s + mod(var(--i) * 13, 6) * 1.3s) linear infinite; animation-delay: calc(var(--i) * -1.6s);
}
@keyframes jf-rise { from { transform: translate(0, 0); opacity: 0; } 10% { opacity: .9; } 50% { transform: translate(12px, -45vh); } to { transform: translate(-8px, -95vh); opacity: 0; } }

/* Jellyfish */
.jf-jelly {
  position: absolute; width: calc(70px + mod(var(--i) * 23, 50) * 1px);
  left: calc(mod(var(--i) * 41, 92) * 1%); top: calc(8% + mod(var(--i) * 29, 70) * 1%);
  filter: drop-shadow(0 0 14px rgba(255, 143, 216, .55)); opacity: .9;
  animation: jf-drift calc(9s + var(--i) * 1.7s) ease-in-out infinite alternate; animation-delay: calc(var(--i) * -2.3s);
}
.jf-jelly:nth-child(2n) { --tint: var(--aqua); filter: drop-shadow(0 0 14px rgba(127, 246, 255, .55)); }
.jf-jelly:nth-child(3n) { --tint: var(--lilac); filter: drop-shadow(0 0 14px rgba(182, 155, 255, .55)); }
@keyframes jf-drift { from { transform: translate(0, 20px) rotate(-6deg); } to { transform: translate(18px, -40px) rotate(6deg); } }
.jf-bell { transform-box: fill-box; transform-origin: 50% 100%; animation: jf-pulse 1.8s ease-in-out infinite; }
.jf-bell path:first-child { fill: var(--tint, var(--pink)); fill-opacity: .82; stroke: rgba(255, 255, 255, .7); stroke-width: 2; }
@keyframes jf-pulse { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.08, .86); } }
.jf-shine { fill: rgba(255, 255, 255, .55); }
.jf-eye { fill: #2a1050; }
.jf-smile { fill: none; stroke: #2a1050; stroke-width: 2.4; stroke-linecap: round; }
.jf-blush { fill: #ff5fa2; opacity: .45; }
.jf-tentacles { stroke: var(--tint, var(--pink)); stroke-width: 3.5; stroke-opacity: .75; transform-box: fill-box; transform-origin: 50% 0; animation: jf-sway 2.2s ease-in-out infinite alternate; }
.jf-frill { stroke-width: 5; stroke-opacity: .5; }
@keyframes jf-sway { from { transform: skewX(-9deg); } to { transform: skewX(9deg); } }

/* Heading */
.jf-kicker { font-weight: 700; letter-spacing: .2em; text-transform: uppercase; font-size: clamp(.8rem, 2.6vw, 1rem); color: var(--aqua); }
.jf-title {
  margin: 6px 0 clamp(20px, 5vw, 36px); font: 700 clamp(2.8rem, 12vw, 6.4rem)/1 "Fredoka", system-ui, sans-serif;
  background: linear-gradient(90deg, var(--pink), var(--lilac), var(--aqua), var(--pink)); background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: var(--pink);
  filter: drop-shadow(0 0 18px rgba(255, 143, 216, .45)); animation: jf-shimmer 8s linear infinite;
}
@keyframes jf-shimmer { to { background-position: 300% 0; } }

/* Countdown */
.jf-count { display: flex; justify-content: center; gap: clamp(6px, 2.4vw, 18px); max-width: 640px; margin: 0 auto; }
.jf-count[hidden] { display: none; }
.jf-count div {
  flex: 1 1 0; min-width: 0; max-width: 140px; padding: clamp(12px, 3vw, 22px) 4px; border-radius: clamp(16px, 4vw, 24px);
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .25);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 0 30px rgba(255, 143, 216, .2);
}
.jf-count b { display: block; font: 700 clamp(2.2rem, 9vw, 4.6rem)/1 "Fredoka", sans-serif; font-variant-numeric: tabular-nums; }
.jf-count b.tick { animation: jf-tick .45s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes jf-tick { from { transform: translateY(-10px) scale(1.15); color: var(--aqua); } }
.jf-count span { font-size: clamp(.62rem, 2.6vw, .85rem); text-transform: uppercase; letter-spacing: .12em; color: #e7d8ff; }

.jf-when { margin-top: 22px; font-size: clamp(1.05rem, 3.4vw, 1.35rem); font-weight: 700; }
.jf-place { margin-top: 6px; font-size: 1.1rem; color: var(--aqua); }
.jf-wait, .jf-gone { font-size: 1.25rem; font-weight: 500; }

/* The day itself */
.jf-party-msg { font: 700 clamp(2rem, 8vw, 4rem)/1.1 "Fredoka", sans-serif; color: #fff; text-shadow: 0 0 20px var(--pink), 0 0 40px var(--lilac); animation: jf-party 1s ease-in-out infinite alternate; }
@keyframes jf-party { from { transform: scale(1) rotate(-2deg); } to { transform: scale(1.07) rotate(2deg); } }
.jf.party .jf-jelly { animation-duration: 3s; }
.jf.party .jf-bell { animation-duration: .6s; }
.jf [hidden] { display: none !important; }

/* Admin form */
.jf-admin { max-width: 26rem; margin: 34px auto 0; padding: 14px 18px; border-radius: 18px; text-align: left; background: rgba(0, 0, 0, .3); border: 1px solid rgba(255, 255, 255, .2); }
.jf-admin summary { cursor: pointer; font-weight: 700; color: var(--aqua); }
.jf-admin form { display: grid; gap: 12px; margin-top: 12px; }
.jf-admin label { display: grid; gap: 4px; margin: 0; font-size: .9rem; }
.jf-admin input { width: 100%; color-scheme: dark; background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .3); }
.jf-admin button { justify-self: start; background: linear-gradient(90deg, var(--pink), var(--lilac)); color: #2a1050; border: none; }
.jf-msg { margin-top: 8px; color: #ffb3c8; }

@media (prefers-reduced-motion: reduce) {
  .jf *, .jf *::before, .jf *::after { animation: none !important; }
}
