/* Ocean effects layered on top of style.css.
   Delete the <link> to this file in index.html to switch every effect off. */
:root {
  --p: 0;
  --sun: rgba(255, 255, 255, .7);
  --depth-tint: #7dddf9;
  --sea-deep: #0b55b8;
  --sea-ink: #e6f3fc;
  --wl: max(900px, 100vw);
  --wave-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 110' preserveAspectRatio='none'%3E%3Cpath d='M0 60C240 20 480 100 720 60C960 20 1200 100 1440 60V110H0Z'/%3E%3C/svg%3E");
}

/* The page gets a little deeper in colour as you scroll */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--depth-tint);
  opacity: calc(var(--p) * .4);
}
body.is-admin::before { display: none; }

/* Animated waves under the hero and the sub-page headers */
.hero, .sub { position: relative; overflow: hidden; }
.hero {
  background:
    radial-gradient(ellipse 60% 50% at 75% 30%, var(--sun), transparent 70%),
    linear-gradient(180deg, var(--bg) 0%, var(--hero-bottom) 100%);
}
.sub { padding-bottom: clamp(76px, 10vw, 120px); }
.sub + .block { padding-top: clamp(16px, 3vw, 32px); }
.hero::before, .hero::after, .sub::before, .sub::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: clamp(60px, 9vw, 110px);
  pointer-events: none;
  -webkit-mask: var(--wave-mask) 0 0 / var(--wl) 100% repeat-x;
  mask: var(--wave-mask) 0 0 / var(--wl) 100% repeat-x;
}
.hero::before, .sub::before {
  bottom: 8px;
  background: var(--wave-back);
  animation: drift-back 17s linear -6s infinite;
}
.hero::after, .sub::after {
  background: var(--bg);
  animation: drift 11s linear infinite;
}
@keyframes drift {
  from { -webkit-mask-position: 0 0; mask-position: 0 0; }
  to { -webkit-mask-position: var(--wl) 0; mask-position: var(--wl) 0; }
}
@keyframes drift-back {
  from { -webkit-mask-position: var(--wl) 0; mask-position: var(--wl) 0; }
  to { -webkit-mask-position: 0 0; mask-position: 0 0; }
}
.hero .top, .hero .hero-grid { position: relative; z-index: 2; }

/* Rising bubbles and twinkling stars in the hero */
.rise {
  position: absolute;
  bottom: -40px;
  left: var(--x);
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  border: 2px solid var(--bubble-edge);
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .85), rgba(255, 255, 255, .08) 65%);
  pointer-events: none;
  z-index: 1;
  animation: rise var(--d) linear var(--dl) infinite;
}
@keyframes rise {
  0% { transform: translate(0, 0); opacity: 0; }
  10% { opacity: 1; }
  25% { transform: translate(14px, -25vh); }
  50% { transform: translate(-10px, -50vh); }
  75% { transform: translate(12px, -75vh); opacity: 1; }
  100% { transform: translate(0, -100vh); opacity: 0; }
}
.spark {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--s);
  height: var(--s);
  fill: var(--gold);
  stroke: var(--outline);
  stroke-width: 1.6;
  stroke-linejoin: round;
  pointer-events: none;
  z-index: 1;
  animation: twinkle 3s ease-in-out var(--dl) infinite;
}
@keyframes twinkle {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.28) rotate(18deg); }
}
@media (max-width: 820px) { .spark.d { display: none; } }

/* The whale surfaces on page load, then bobs. A ripple spreads under it. */
.logo-btn img {
  animation: surface 1.1s cubic-bezier(.2, 1.3, .4, 1) both, bob 5s ease-in-out 1.1s infinite;
}
@keyframes surface {
  from { transform: translateY(70px) scale(.9) rotate(-3deg); }
  to { transform: none; }
}
.logo-wrap::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 9%;
  height: 16%;
  border: 3px solid rgba(255, 255, 255, .9);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  animation: ripple 1.8s ease-out .5s both;
}
@keyframes ripple {
  0% { transform: scale(.4); opacity: 0; }
  15% { opacity: .9; }
  100% { transform: scale(1.35); opacity: 0; }
}

/* Particles made by fx.js */
.fx { position: fixed; display: block; pointer-events: none; z-index: 60; }
.fx.b {
  border-radius: 50%;
  border: 2px solid var(--bubble-edge);
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .9), rgba(125, 221, 249, .3) 65%);
}
.fx.s {
  background: var(--gold);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
.fx.d {
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, var(--water-1) 55%, var(--water-2));
}

/* Buttons get a water gloss on hover */
.btn { position: relative; overflow: hidden; }
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .55) 50%, transparent 65%);
  transform: translateX(-130%);
  pointer-events: none;
}
.btn:hover::after { transform: translateX(130%); transition: transform .6s ease; }

/* Cards lean like stickers */
.chip { transition: transform .2s cubic-bezier(.3, 1.6, .5, 1); }
.card:hover { transform: translateY(-4px) rotate(-.6deg); }
.cards li:nth-child(even) .card:hover { transform: translateY(-4px) rotate(.6deg); }
.card:hover .chip { transform: rotate(-6deg) scale(1.08); }

/* Steps: the dotted path flows from one step to the next */
.steps li:not(:last-child)::after {
  top: 25px;
  height: 6px;
  border: 0;
  background: radial-gradient(circle, var(--water-3) 2.2px, transparent 2.8px) 0 50% / 14px 6px repeat-x;
  animation: flow 1s linear infinite;
}
@keyframes flow { to { background-position: 14px 50%; } }

/* Discord panel logo waves hello */
.panel img { animation: wiggle 4.5s ease-in-out infinite; transform-origin: 50% 80%; }
@keyframes wiggle {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(4deg) translateY(-4px); }
}

/* Depth gauge on wide screens, thin dive bar everywhere else */
.dive-bar {
  position: fixed;
  top: env(safe-area-inset-top, 0px);
  left: 0;
  right: 0;
  height: 4px;
  z-index: 30;
  pointer-events: none;
  background: linear-gradient(90deg, var(--water-1), var(--water-4));
  transform-origin: left;
  transform: scaleX(var(--p));
}
.gauge {
  position: fixed;
  right: max(14px, env(safe-area-inset-right, 0px));
  top: 50%;
  transform: translateY(-50%);
  height: min(56vh, 460px);
  width: 56px;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 20;
  pointer-events: none;
  font: 600 .78rem/1.2 var(--font-display);
  color: var(--ink-soft);
  white-space: nowrap;
}
@media (min-width: 1260px) {
  .gauge { display: flex; }
  .dive-bar { display: none; }
}
.g-lab {
  padding: .05em .65em;
  border: 2px solid var(--outline);
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--ink);
}
.g-track {
  position: relative;
  flex: 1;
  width: 14px;
  border: 3px solid var(--outline);
  border-radius: 999px;
  background: var(--bg-soft);
}
.g-track::before {
  content: "";
  position: absolute;
  right: 100%;
  margin-right: 5px;
  top: 0;
  bottom: 0;
  width: 7px;
  background: repeating-linear-gradient(180deg, var(--line) 0 2px, transparent 2px 12.5%);
}
.g-fill {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: calc(var(--p) * 100%);
  border-radius: 999px;
  background: linear-gradient(180deg, var(--water-1), var(--water-4));
}
.g-whale {
  position: absolute;
  left: 50%;
  top: calc(var(--p) * (100% - 38px) + 19px);
  width: 38px;
  max-width: none;
  height: auto;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 3px 4px rgba(1, 54, 232, .35));
}
.g-depth {
  padding: .1em .7em;
  border: 3px solid var(--outline);
  border-radius: 999px;
  background: var(--gold);
  color: #061744;
  font-size: .95rem;
  font-variant-numeric: tabular-nums;
}

/* The seabed footer */
footer.seabed {
  position: relative;
  margin-top: 56px;
  padding-block: 64px 44px;
  color: var(--sea-ink);
  background: linear-gradient(180deg, var(--band-bg), var(--sea-deep));
  --outline: #020a26;
}
footer.seabed::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -39px;
  height: 40px;
  background: var(--band-bg);
  pointer-events: none;
  -webkit-mask: var(--wave-mask) 0 0 / var(--wl) 100% repeat-x;
  mask: var(--wave-mask) 0 0 / var(--wl) 100% repeat-x;
  animation: drift 12s linear infinite;
}
footer.seabed .wrap { position: relative; z-index: 1; }
footer.seabed .foot, footer.seabed .foot a, footer.seabed .brand { color: var(--sea-ink); }
.foot-side { display: grid; gap: 14px; justify-items: start; max-width: 34em; }
.weeds {
  position: absolute;
  bottom: 0;
  width: clamp(110px, 16vw, 210px);
  height: auto;
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
  pointer-events: none;
  opacity: .6;
  z-index: 0;
}
.weeds-l { left: max(8px, 2vw); }
.weeds-r { right: max(8px, 2vw); transform: scaleX(-1); }
.weeds .a { stroke: var(--water-2); }
.weeds .b { stroke: var(--water-3); }
.weeds .c { stroke: var(--water-1); }
.sway {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: sway 4s ease-in-out var(--dl, 0s) infinite alternate;
}
@keyframes sway {
  from { transform: rotate(-6deg); }
  to { transform: rotate(6deg); }
}
.seabed .spark { top: auto; bottom: 14px; }
@media (max-width: 560px) { .weeds-r { display: none; } }

/* Admin pages stay plain */
body.is-admin .gauge, body.is-admin .dive-bar { display: none; }


/* The whale is five stacked layers: tail and spout behind the body, then eyes on top */
.logo-btn .whale {
  position: relative;
  width: 100%;
  aspect-ratio: 1000 / 930;
  filter: drop-shadow(0 16px 22px rgba(1, 54, 232, .3));
  transform-origin: 50% 75%;
  animation: surface 1.1s cubic-bezier(.2, 1.3, .4, 1) both, whaleSwim 9s ease-in-out 1.1s infinite;
}
.logo-btn .whale img { position: absolute; inset: 0; width: 100%; height: 100%; animation: none; filter: none; }
.logo-btn .whale img.tail { transform-origin: 71.5% 39.2%; animation: tailFlap 2.2s ease-in-out infinite; }
.logo-btn .whale img.spout { transform-origin: 49% 16.3%; animation: spoutDance 2.6s ease-in-out infinite; }
.logo-btn .whale img.eye { animation: blinkOpen 4.6s linear infinite; }
.logo-btn .whale img.eye-shut { opacity: 0; animation: blinkShut 4.6s linear infinite; }
@keyframes whaleSwim {
  0%, 100% { transform: translate(-12px, 4px) rotate(-2.5deg); }
  25% { transform: translate(0, -9px) rotate(1.5deg); }
  50% { transform: translate(12px, 2px) rotate(3deg); }
  75% { transform: translate(0, -11px) rotate(-1deg); }
}
@keyframes tailFlap { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(5deg); } }
@keyframes spoutDance {
  0%, 100% { transform: scale(1, 1) rotate(0); }
  25% { transform: scale(1.04, 1.09) rotate(-2deg); }
  50% { transform: scale(.97, .95) rotate(1.5deg); }
  75% { transform: scale(1.03, 1.08) rotate(2deg); }
}
@keyframes blinkOpen { 0%, 92%, 100% { opacity: 1; } 93%, 96% { opacity: 0; } }
@keyframes blinkShut { 0%, 92%, 100% { opacity: 0; } 93%, 96% { opacity: 1; } }
.fx.bb {
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .95);
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .95) 0 14%, rgba(255, 255, 255, .25) 16%, rgba(125, 221, 249, .4) 72%);
  box-shadow: inset -2px -3px 6px rgba(20, 134, 245, .25), 0 0 8px rgba(125, 221, 249, .5);
}
.rb { position: absolute; bottom: 12%; left: var(--x); width: var(--s); height: var(--s); border: 2px solid rgba(255, 255, 255, .95); background: rgba(255, 255, 255, .35); border-radius: 50%; pointer-events: none; z-index: 1; animation: rbUp var(--d) ease-in infinite; animation-delay: var(--dl); }
@keyframes rbUp { 0% { transform: translateY(0) scale(.6); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(-240px) translateX(12px) scale(1.1); opacity: 0; } }

/* Penalty levels */
.pen .or { font: 600 .85rem var(--font-display); color: var(--ink-soft); }
.pen-note { flex: 1 1 100%; color: var(--ink-soft); font-size: .9rem; line-height: 1.6; }
.pbld .lvh { flex: 1 1 100%; font-size: .9rem; }

/* Animation switch in the header */
.theme .ic-play { display: none; }
.calm .theme .ic-play { display: block; }
.calm .theme .ic-pause { display: none; }

/* Edit history (super admin) */
.hist-item { border: 2px solid var(--line); border-radius: 12px; padding: 8px 12px; margin: 8px 0; background: var(--bg-soft); }
.hist-item summary { cursor: pointer; }
.hist-sum { margin-left: 8px; font: 600 .85rem var(--font-display); color: var(--ink-soft); }
.hist-body h4 { margin: 10px 0 2px; font: 600 1rem var(--font-display); }
.hist-body ul { margin: 0 0 8px; padding-left: 18px; font-size: .92rem; line-height: 1.6; }
.h-add { color: #13795b; } .h-del { color: #c23b3f; } .h-chg { color: #a35f00; }
.hist-body small { color: var(--ink-soft); }
