/* ════════════════════════════════════════════════════════════
   SLIME CITY — stylesheet.
   External file because the site ships a strict CSP
   (style-src 'self'): no inline styles allowed, and that's fine.
   Self-hosted fonts only (font-src 'self'), no CDNs, no libraries.
   ════════════════════════════════════════════════════════════ */

/* Baloo 2: a gooey rounded display face for arcade headings.
   Self-hosted woff2 (variable font, one file serves all weights). */
@font-face {
  font-family: "Baloo 2";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/assets/fonts/baloo2-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Baloo 2";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/assets/fonts/baloo2-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --slime: #7fff00;
  --slime-dark: #39b500;
  --slime-deep: #1d6b00;
  --goo: #a4ff4f;
  --ink: #062b00;
  --bg: #000;
  --purple-goo: #c84fff;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { overflow-x: hidden; }

body {
  background: var(--bg);
  font-family: "Comic Sans MS", "Chalkboard SE", "Marker Felt", cursive, sans-serif;
  color: var(--goo);
  min-height: 100vh;
  position: relative;
  cursor: url('/cursor.svg') 14 14, crosshair;  /* custom slime-blob cursor */
}

::selection { background: var(--slime); color: #000; }

/* slime-themed scrollbar */
::-webkit-scrollbar { width: 14px; }
::-webkit-scrollbar-track { background: #050a02; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--goo), var(--slime-deep));
  border-radius: 99px;
  border: 3px solid #050a02;
}

.hidden-svg { position: absolute; width: 0; height: 0; }

/* ════════ LAYER 0: CANVAS METABALL LAVA ════════
   blobs are drawn blurry, then CSS contrast() crushes the
   blur into sharp gooey edges — the classic metaball trick */
#metaballs {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  filter: blur(18px) contrast(26) saturate(1.3);
  opacity: .5;
}

/* ════════ LAYER 1: MINECRAFT SLIMES (clickable!) ════════ */
.slimes {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  perspective: 1200px;
}
.mc-slime {
  position: absolute;
  width: var(--s);
  height: var(--s);
  animation: hop var(--dur, 3s) ease-in-out infinite;
  filter: drop-shadow(0 0 18px rgba(127,255,0,.3));
  pointer-events: auto;            /* you can click these */
  cursor: pointer;
}
.cube {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: rotateX(-12deg) rotateY(var(--ry, 25deg));
}
.face {
  position: absolute;
  inset: 0;
  background: rgba(112, 217, 90, .4);
  border: 1px solid rgba(166, 255, 128, .35);
}
.face.front {
  transform: translateZ(calc(var(--s) / 2));
  /* the classic slime face: two square eyes + tiny mouth, pixel-crisp */
  background-image: url('/slime-face.svg');
  background-size: 100% 100%;
  image-rendering: pixelated;
}
.face.back   { transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); }
.face.right  { transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); }
.face.left   { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); }
.face.top    { transform: rotateX(90deg) translateZ(calc(var(--s) / 2)); background: rgba(150, 240, 120, .5); }
.face.bottom { transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); background: rgba(60, 140, 45, .45); }
/* darker inner core cube, like the real mob */
.core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--s);
  height: var(--s);
  transform: translate(-50%, -50%);
  transform-style: preserve-3d;
}
.core .face { background: rgba(72, 168, 52, .85); border: none; background-image: none; }
.core .face.top { background: rgba(110, 210, 85, .9); }
.core .face.bottom { background: rgba(40, 100, 30, .9); }
@keyframes hop {
  0%, 100% { transform: translateY(0) scale(1.08, .9); }
  18%      { transform: translateY(0) scale(1.16, .78); }
  55%      { transform: translateY(calc(var(--jump, 40px) * -1)) scale(.94, 1.08); }
  88%      { transform: translateY(0) scale(1.03, .97); }
}

/* ════════ DRIPPING CEILING ════════ */
.drips {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 180px;
  z-index: 50;
  pointer-events: none;
  filter: url(#goo) drop-shadow(0 6px 12px rgba(127,255,0,.35));
}
.drips .bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 42px;
  background: linear-gradient(180deg, var(--slime) 0%, var(--slime-dark) 100%);
}
.drip {
  position: absolute;
  top: 20px;
  width: 34px;
  border-radius: 0 0 50% 50%;
  background: linear-gradient(180deg, var(--slime-dark), var(--slime));
  animation: dripdown ease-in-out infinite alternate;
}
.blob-drop {
  position: absolute;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--slime);
  animation: fall linear infinite;
  opacity: 0;
}
@keyframes dripdown { from { height: 26px; } to { height: 140px; } }
@keyframes fall {
  0%   { transform: translateY(0) scale(1, 1.2); opacity: 1; }
  85%  { opacity: 1; }
  100% { transform: translateY(105vh) scale(.8, 1.6); opacity: 0; }
}

/* ════════ HERO + THE LOGO ════════ */
main {
  position: relative;
  z-index: 10;
  text-align: center;
  max-width: 980px;
  margin: 0 auto;
  padding: 0 20px 60px;
}
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 60px;
}
.logo {
  width: min(82vw, 620px);
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 0 28px rgba(127,255,0,.45)) drop-shadow(0 0 90px rgba(127,255,0,.18));
}
.logo-text {
  font-family: "Baloo 2", "Arial Black", Impact, sans-serif;
  font-weight: 800;
  text-anchor: middle;
  fill: url(#slimeGrad);
  paint-order: stroke fill;
  stroke: var(--ink);
  stroke-width: 12;
  stroke-linejoin: round;
}
/* mascot blink: squash the whole eye flat every few seconds */
.eye { animation: blink 4.2s infinite; transform-box: fill-box; transform-origin: center; }
.eye.l { animation-delay: .15s; }
@keyframes blink {
  0%, 91%, 100% { transform: scaleY(1); }
  94%, 97%      { transform: scaleY(.08); }
}
.mascot { animation: bob 3.4s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes bob {
  0%, 100% { transform: translateY(0) scale(1, 1); }
  50%      { transform: translateY(-10px) scale(.97, 1.05); }
}

.tagline {
  margin-top: 26px;
  font-family: "Baloo 2", "Comic Sans MS", cursive, sans-serif;
  font-size: clamp(1.1rem, 3vw, 1.55rem);
  font-weight: 700;
  letter-spacing: .02em;
  /* animated gradient ink, clipped to the letters themselves */
  background: linear-gradient(90deg, var(--slime), var(--purple-goo), var(--goo), var(--slime));
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 6s linear infinite;
}
@keyframes shimmer { to { background-position: -250% 0; } }

.hint {
  margin-top: 30px;
  font-size: .9rem;
  color: rgba(164,255,79,.65);
}

/* visually hidden but accessible to screen readers and the a11y tree */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ════════ FULL-BLEED GOO TICKER ════════ */
.ticker {
  width: 100vw;
  margin-left: calc(50% - 50vw);   /* break out of the centered column */
  margin-top: 30px;
  border-top: 3px solid var(--slime-dark);
  border-bottom: 3px solid var(--slime-dark);
  background: rgba(127,255,0,.06);
  overflow: hidden;
  white-space: nowrap;
  padding: 12px 0;
  font-size: 1.05rem;
}
.ticker span {
  display: inline-block;
  padding-left: 100%;
  animation: tick 30s linear infinite;
  color: #bfff85;
}
.tick-ico { width: 1.1em; height: 1.1em; vertical-align: -.2em; }
.h2-ico { width: 1em; height: 1em; vertical-align: -.12em; }
.foot-ico { width: 1.05em; height: 1.05em; vertical-align: -.2em; }
.hud-ico { width: 1.1em; height: 1.1em; vertical-align: -.22em; }
@keyframes tick { to { transform: translateX(-100%); } }

/* ════════ THE GOO LIST ════════ */
.goo-list {
  margin: 90px auto 0;
  max-width: 680px;
  text-align: left;
  background: rgba(127,255,0,.06);
  border: 2px solid rgba(127,255,0,.3);
  border-radius: 34px 12px 30px 14px;
  padding: 34px 38px 40px;
  backdrop-filter: blur(3px);
}
.goo-list h2 {
  color: var(--slime);
  font-family: "Baloo 2", "Comic Sans MS", cursive, sans-serif;
  font-weight: 700;
  font-size: 1.8rem;
  margin-bottom: 18px;
  text-shadow: 0 0 16px rgba(127,255,0,.5);
}
.goo-list ul { list-style: none; }
.goo-list li {
  position: relative;
  padding: 8px 0 8px 34px;
  color: #c9f5a2;
  line-height: 1.45;
}
.goo-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 9px;
  width: 18px; height: 18px;
  background: url('/assets/icons/goo-bullet.svg') center / contain no-repeat;
  display: inline-block;
  animation: squish 2.2s ease-in-out infinite;
}
/* stagger the bullet squishes down the list */
.goo-list li:nth-child(2)::before  { animation-delay: .2s; }
.goo-list li:nth-child(3)::before  { animation-delay: .4s; }
.goo-list li:nth-child(4)::before  { animation-delay: .6s; }
.goo-list li:nth-child(5)::before  { animation-delay: .8s; }
.goo-list li:nth-child(6)::before  { animation-delay: 1s; }
.goo-list li:nth-child(7)::before  { animation-delay: 1.2s; }
.goo-list li:nth-child(8)::before  { animation-delay: 1.4s; }
.goo-list li:nth-child(9)::before  { animation-delay: 1.6s; }
.goo-list li:nth-child(10)::before { animation-delay: 1.8s; }
.goo-list li:nth-child(11)::before { animation-delay: 2s; }
.goo-list li:nth-child(12)::before { animation-delay: 2.2s; }
.goo-list li strong { color: var(--goo); }
@keyframes squish {
  0%, 100% { transform: scaleY(1) translateY(0); }
  40%      { transform: scaleY(.78) translateY(8%) scaleX(1.15); }
  60%      { transform: scaleY(1.12) translateY(-4%) scaleX(.94); }
}

/* scroll-in reveal (driven by IntersectionObserver) */
.reveal { opacity: 0; transform: translateY(40px) scale(.97); }
.reveal.show {
  opacity: 1;
  transform: none;
  transition: opacity .8s ease, transform .8s cubic-bezier(.2, .9, .3, 1.15);
}

/* ════════ BUBBLES ════════ */
.bubble {
  position: fixed;
  bottom: -40px;
  border-radius: 50%;
  border: 2px solid rgba(164,255,79,.5);
  background: radial-gradient(circle at 30% 30%, rgba(164,255,79,.25), rgba(164,255,79,.05));
  animation: rise linear infinite;
  z-index: 5;
  pointer-events: none;
}
@keyframes rise {
  0%   { transform: translateY(0) translateX(0); opacity: 0; }
  10%  { opacity: 1; }
  100% { transform: translateY(-110vh) translateX(40px); opacity: 0; }
}

/* ════════ SLIME POOL FOOTER ════════ */
footer {
  position: relative;
  z-index: 10;
  margin-top: 110px;
  padding: 70px 20px 30px;
  text-align: center;
  color: var(--bg);
  font-weight: bold;
  background: linear-gradient(180deg, var(--slime-dark), var(--slime));
}
footer::before {
  content: "";
  position: absolute;
  top: -38px; left: 0; right: 0;
  height: 40px;
  background:
    radial-gradient(circle at 10% 100%, var(--slime-dark) 22px, transparent 23px),
    radial-gradient(circle at 30% 100%, var(--slime-dark) 34px, transparent 35px),
    radial-gradient(circle at 52% 100%, var(--slime-dark) 18px, transparent 19px),
    radial-gradient(circle at 70% 100%, var(--slime-dark) 30px, transparent 31px),
    radial-gradient(circle at 90% 100%, var(--slime-dark) 24px, transparent 25px);
}
footer .small { font-size: .85rem; opacity: .75; margin-top: 8px; }

/* ════════ HUD + SOUND TOGGLE ════════ */
.hud {
  position: fixed;
  bottom: 14px; left: 14px;
  z-index: 90;
  font-family: monospace;
  font-size: .85rem;
  color: var(--goo);
  background: rgba(0, 20, 0, .75);
  border: 2px solid var(--slime-deep);
  border-radius: 12px;
  padding: 8px 14px;
  pointer-events: none;
}
.hud b { color: var(--slime); font-size: 1.1rem; }
#soundToggle {
  position: fixed;
  top: 56px; right: 14px;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,20,0,.75);
  border: 2px solid var(--slime-deep);
  border-radius: 50%;
  width: 48px; height: 48px;
  cursor: pointer;
  transition: transform .15s ease;
}
#soundToggle:hover { transform: scale(1.15) rotate(-8deg); }

/* ════════ PARTICLES ════════ */
.splat {
  position: fixed;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--slime);
  pointer-events: none;
  z-index: 99;
  animation: splat-fade .9s ease-out forwards;
}
@keyframes splat-fade { to { transform: translateY(26px) scale(.1); opacity: 0; } }
.rain {
  position: fixed;
  top: -30px;
  border-radius: 50%;
  background: var(--slime);
  pointer-events: none;
  z-index: 95;
  animation: fall linear forwards;
}

/* ════════ SLIME ON THE GLASS ════════ */
#screenGoo {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 150;
  pointer-events: none;
}
#wipeBtn {
  position: fixed;
  top: 112px; right: 14px;
  z-index: 160;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,20,0,.75);
  border: 2px solid var(--slime-deep);
  border-radius: 50%;
  width: 48px; height: 48px;
  cursor: pointer;
  transition: transform .15s ease;
}
#wipeBtn:hover { transform: scale(1.15) rotate(12deg); }

/* shared sizing for the inline SVG icons inside control buttons */
#soundToggle svg, #wipeBtn svg { width: 24px; height: 24px; display: block; }
#gameClose svg { width: 16px; height: 16px; display: block; }

/* ════════ THE PET (jelly physics) ════════ */
.pet { margin-top: 90px; text-align: center; }
.pet h2 {
  color: var(--slime);
  font-family: "Baloo 2", "Comic Sans MS", cursive, sans-serif;
  font-weight: 700;
  font-size: 2rem;
  text-shadow: 0 0 18px rgba(127,255,0,.5);
}
.pet-sub { margin: 8px 0 20px; color: #9adf78; }
#petCanvas {
  width: min(92vw, 560px);
  aspect-ratio: 56 / 30;
  background:
    radial-gradient(ellipse at 50% 110%, rgba(127,255,0,.1), transparent 70%),
    rgba(0, 12, 0, .55);
  border: 3px solid var(--slime-deep);
  border-radius: 22px;
  cursor: grab;
  touch-action: none;
}
#petCanvas:active { cursor: grabbing; }

/* jelly scrolling pivots from the top of the page */
main { transform-origin: 50% 0; }

/* ════════ THE GOO ARCADE ════════ */
.cabinets {
  margin-top: 40px;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 22px;
}
.cabinet {
  position: relative;
  overflow: hidden;
  font-family: "Baloo 2", "Comic Sans MS", cursive, sans-serif;
  cursor: pointer;
  padding: 24px 14px 16px;
  border-radius: 18px 18px 10px 10px;
  background: linear-gradient(180deg, #0d2603, #051303);
  color: var(--goo);
  border: 3px solid var(--slime-deep);
  font-size: 1.1rem;
  font-weight: bold;
  line-height: 1.5;
  text-align: center;
  user-select: none;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.cabinet:hover {
  transform: translateY(-7px) scale(1.04) rotate(-1deg);
  border-color: var(--slime);
  box-shadow: 0 14px 34px rgba(127,255,0,.28);
}
.cabinet:active { transform: scale(.95); }
.cabinet::after {
  /* wet glossy sweep on hover */
  content: "";
  position: absolute;
  top: -60%; left: -90%;
  width: 45%; height: 230%;
  background: linear-gradient(105deg, transparent, rgba(220,255,180,.16), transparent);
  transform: rotate(8deg);
  transition: left .45s ease;
  pointer-events: none;
}
.cabinet:hover::after { left: 140%; }
.cabinet .big { font-size: 2.3rem; display: block; margin-bottom: 4px; }
.cabinet small {
  display: block;
  color: #9adf78;
  font-family: "Comic Sans MS", "Chalkboard SE", "Marker Felt", cursive, sans-serif;
  font-weight: normal;
  font-size: .82rem;
}
.cabinet .best {
  display: block;
  margin-top: 10px;
  font-family: monospace;
  font-size: .8rem;
  color: var(--slime);
}
.cabinet .big svg { width: 2.3rem; height: 2.3rem; display: block; margin: 0 auto 4px; }

/* staggered goo entrance for every game card.
   The rise uses the standalone `translate` property (not `transform`)
   so the finished entrance never pins down the :hover lift. */
.cabinet {
  opacity: 0;
  animation: cabinet-in .6s cubic-bezier(.2, .9, .3, 1.15) both;
}
@keyframes cabinet-in {
  from { opacity: 0; translate: 0 28px; }
  to   { opacity: 1; translate: 0 0; }
}
.cabinet:nth-child(1) { animation-delay: .05s; }
.cabinet:nth-child(2) { animation-delay: .12s; }
.cabinet:nth-child(3) { animation-delay: .19s; }
.cabinet:nth-child(4) { animation-delay: .26s; }
.cabinet:nth-child(5) { animation-delay: .33s; }
.cabinet:nth-child(6) { animation-delay: .40s; }
.cabinet:nth-child(7) { animation-delay: .47s; }
.cabinet:nth-child(8) { animation-delay: .54s; }
.cabinet:nth-child(9) { animation-delay: .61s; }

/* ════════ GAME MODAL ════════ */
.game-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 10, 0, .9);
  backdrop-filter: blur(5px);
}
.game-modal.hidden { display: none; }
.game-frame {
  background: #061a04;
  border: 3px solid var(--slime);
  border-radius: 16px;
  padding: 12px 12px 10px;
  box-shadow: 0 0 70px rgba(127,255,0,.45);
}
.game-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
  font-family: monospace;
  color: var(--goo);
}
#gameTitle { display: inline-flex; align-items: center; gap: 6px; font-family: "Baloo 2", monospace; font-weight: 700; color: var(--slime); font-size: 1.1rem; }
#gameTitle .title-ico { width: 1.2em; height: 1.2em; }
#gameScore { margin-left: auto; }
#gameClose {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 2px solid var(--slime-deep);
  color: var(--goo);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  cursor: pointer;
}
#gameClose:hover { border-color: var(--slime); }
#gameCanvas {
  display: block;
  width: min(88vw, 560px);
  aspect-ratio: 4 / 3;
  background: #000;
  border-radius: 10px;
  image-rendering: pixelated;
  touch-action: none;
}
.game-help {
  margin-top: 8px;
  text-align: center;
  font-size: .85rem;
  color: #9adf78;
  max-width: min(88vw, 560px);
}
body.no-scroll { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
  .splat, .rain { display: none; }
  .reveal { opacity: 1; transform: none; }
  /* the staggered cabinet entrance is animation-driven, so keep the
     cards visible when that animation is switched off */
  .cabinet { opacity: 1; }
}
