:root {
  color-scheme: dark;
  --ink: #120d26;
  --ink-2: #1b1438;
  --panel: rgba(255, 255, 255, 0.055);
  --line: rgba(255, 255, 255, 0.11);
  --cream: #fff4e2;
  --muted: #bdb3dc;
  --gold: #ffc94d;
  --gold-2: #ff9f1c;
  --gold-shadow: #a85c00;
  --tabby: #ff7a3d;
  --violet: #6b4bb8;
  --display: 'Lilita One', 'Arial Rounded MT Bold', system-ui, sans-serif;
  --body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1200px;
  --radius: 24px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font: 400 17px/1.6 var(--body);
  color: var(--cream);
  background: var(--ink);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); }
a:hover { color: #ffe08f; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.05; margin: 0; letter-spacing: 0.01em; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 8px; }

.skip-link { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--gold); color: #2a1600; padding: 8px 14px; border-radius: 999px; font-weight: 800; }
.skip-link:focus { left: 12px; }

.eyebrow { font: 800 13px/1 var(--body); letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.lede { color: var(--muted); font-size: clamp(17px, 1.6vw, 19px); max-width: 56ch; }

/* ---------- buttons ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 26px;
  border-radius: 999px; border: 0; cursor: pointer;
  font: 400 18px/1 var(--display); letter-spacing: 0.03em; text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}
.button.gold { color: #2a1600; background: linear-gradient(180deg, #ffe07a, var(--gold) 45%, var(--gold-2)); box-shadow: 0 5px 0 var(--gold-shadow), 0 12px 28px rgba(255, 159, 28, 0.25); }
.button.gold:hover { color: #2a1600; transform: translateY(-2px); box-shadow: 0 7px 0 var(--gold-shadow), 0 16px 32px rgba(255, 159, 28, 0.32); }
.button.gold:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--gold-shadow); }
.button.ghost { color: var(--cream); background: rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.22); }
.button.ghost:hover { color: var(--cream); background: rgba(255, 255, 255, 0.1); }
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }

/* ---------- header ---------- */
.header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 12px var(--gutter);
  background: rgba(18, 13, 38, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--cream); flex: none; }
.brand img { width: 44px; height: 44px; }
.brand span { font: 400 22px/0.9 var(--display); letter-spacing: 0.04em; display: flex; flex-direction: column; }
.brand small { font: 800 10px/1.2 var(--body); letter-spacing: 0.42em; color: var(--gold); margin-top: 3px; }
.header nav { display: flex; gap: 6px; }
.header nav a { color: var(--cream); text-decoration: none; font-weight: 800; font-size: 15px; padding: 10px 14px; border-radius: 999px; white-space: nowrap; }
.header nav a:hover { background: rgba(255, 255, 255, 0.08); color: var(--cream); }

/* ---------- hero ---------- */
.hero {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(40px, 7vw, 96px) var(--gutter) clamp(32px, 5vw, 64px);
  display: grid; grid-template-columns: 1.1fr 0.9fr; align-items: center; gap: 32px;
}
.hero h1 { font-size: clamp(52px, 8vw, 104px); text-shadow: 0 6px 0 rgba(0, 0, 0, 0.25); }
.twist {
  display: inline-block;
  background: linear-gradient(180deg, #fff1b0 5%, var(--gold) 45%, var(--gold-2) 95%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  transform-origin: 50% 60%;
  animation: twist 1.1s 0.35s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
@keyframes twist { from { transform: rotateX(180deg) translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.hero .lede { margin-top: 22px; }
.hero-art { position: relative; justify-self: center; width: min(460px, 100%); aspect-ratio: 640 / 718; }
.hero-cat { position: relative; z-index: 2; width: 100%; filter: drop-shadow(0 24px 40px rgba(0, 0, 0, 0.45)); animation: bob 5s ease-in-out infinite; -webkit-mask-image: linear-gradient(180deg, #000 74%, transparent 97%); mask-image: linear-gradient(180deg, #000 74%, transparent 97%); }
@keyframes bob { 50% { transform: translateY(-10px) rotate(-1deg); } }
.coin { position: absolute; z-index: 1; width: 36%; left: -4%; top: -2%; perspective: 800px; }
.coin img { width: 100%; animation: coin-flip 6s cubic-bezier(0.6, 0, 0.3, 1) infinite; filter: drop-shadow(0 10px 24px rgba(255, 159, 28, 0.35)); }
@keyframes coin-flip { 0%, 55% { transform: rotateY(0); } 80%, 100% { transform: rotateY(360deg); } }

/* ---------- live game ---------- */
.live { max-width: var(--max); margin: 0 auto; padding: clamp(24px, 4vw, 48px) var(--gutter); scroll-margin-top: 80px; }
.live-stage {
  position: relative; overflow: hidden; border-radius: calc(var(--radius) + 8px);
  min-height: 600px; display: flex; align-items: center;
  box-shadow: 0 0 0 1px var(--line), 0 40px 80px rgba(0, 0, 0, 0.45);
  background: #17111c;
}
.live-scene { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 50%; }
.live-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(23, 17, 28, 0.96) 0%, rgba(23, 17, 28, 0.82) 38%, rgba(23, 17, 28, 0.15) 70%, rgba(23, 17, 28, 0) 100%); }
.live-cat { position: absolute; right: 2%; bottom: 0; height: 96%; width: auto; filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.55)); }
.live-copy { position: relative; z-index: 2; max-width: 540px; padding: clamp(28px, 5vw, 64px); }
.live-title img { width: min(400px, 90%); margin: 4px 0 6px -6px; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.5)); }
.genre { font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; font-size: 14px; color: var(--cream); margin-bottom: 14px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.2); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); } }
.facts { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 0; }
.facts div { background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line); border-radius: 14px; padding: 9px 14px; }
.facts dt { font-size: 11px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 2px 0 0; font: 400 18px/1.1 var(--display); color: var(--gold); }

.features { list-style: none; margin: 20px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.tilt-slot { display: flex; perspective: 900px; }
.tilt { flex: 1; transform-origin: 50% 0; }
/* Text panels are frosted glass, so the whale passing behind them never fights the copy. */
.feature, .pillar { -webkit-backdrop-filter: blur(14px) saturate(130%); backdrop-filter: blur(14px) saturate(130%); }
.feature { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.feature h3 { font-size: 22px; color: var(--gold); margin-bottom: 8px; }
.feature p { color: var(--muted); font-size: 15.5px; }

/* ---------- sections ---------- */
.section { max-width: var(--max); margin: 0 auto; padding: clamp(48px, 7vw, 96px) var(--gutter); scroll-margin-top: 70px; }
.section-head { margin-bottom: 32px; max-width: 640px; }
.section-head h2 { font-size: clamp(38px, 5vw, 60px); }
.section-head p:not(.eyebrow) { color: var(--muted); margin-top: 12px; }

/* coming soon: cards that flip */
.flip-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.flip { perspective: 1400px; }
.flip-inner {
  all: unset; box-sizing: border-box; cursor: pointer; display: block; position: relative; width: 100%; aspect-ratio: 16 / 9;
  transform-style: preserve-3d; transition: transform 0.75s cubic-bezier(0.3, 1.35, 0.5, 1);
  border-radius: var(--radius);
}
.flip-inner:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }
.flip.is-flipped .flip-inner { transform: rotateY(180deg); }
@media (hover: hover) { .flip:hover .flip-inner { transform: rotateY(180deg); } }
.flip-face {
  position: absolute; inset: 0; border-radius: var(--radius); overflow: hidden;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: 0 0 0 1px var(--line), 0 24px 50px rgba(0, 0, 0, 0.4);
}
.flip-front img { width: 100%; height: 100%; object-fit: cover; }
.badge { position: absolute; left: 14px; top: 14px; background: rgba(18, 13, 38, 0.78); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: var(--gold); font: 800 12px/1 var(--body); letter-spacing: 0.16em; text-transform: uppercase; padding: 9px 12px; border-radius: 999px; border: 1px solid rgba(255, 201, 77, 0.35); }
.flip-back {
  transform: rotateY(180deg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 24px;
  background: radial-gradient(circle at 50% 0%, rgba(255, 201, 77, 0.22), transparent 60%), linear-gradient(160deg, #2a1d55, #17111c);
}
.flip-back .mini { width: 56px; height: 56px; }
.flip-back strong { font: 400 clamp(26px, 3vw, 34px)/1 var(--display); }
.flip-back span { color: var(--muted); max-width: 34ch; }
.flip-back em { font-style: normal; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; font-size: 12px; color: var(--gold); }

/* studio */
.studio-grid { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 28px; align-items: center; }
.pillars { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.pillar { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; }
.pillars h3 { font-size: 24px; margin-bottom: 6px; }
.pillars p { color: var(--muted); }
.mascot { margin: 0; text-align: center; }
.rack { display: flex; justify-content: center; align-items: flex-end; height: 200px; padding: 0 10px; }
.rack img { width: auto; height: 160px; margin: 0 -30px; transform: rotate(calc((var(--i) - 2) * 7deg)) translateY(calc(var(--i) * (4 - var(--i)) * -6px)); transform-origin: 50% 100%; filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.5)); transition: transform 0.35s cubic-bezier(0.3, 1.5, 0.5, 1); }
.rack img:nth-child(3) { z-index: 2; height: 176px; }
.rack img:hover { transform: rotate(0) translateY(-22px) scale(1.06); z-index: 3; }
.mascot figcaption { color: var(--muted); margin-top: 12px; }
.mascot strong { color: var(--cream); }

/* partners */
.partners-card {
  display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap;
  padding: clamp(28px, 5vw, 52px); border-radius: calc(var(--radius) + 8px);
  background: linear-gradient(135deg, rgba(107, 75, 184, 0.45), rgba(255, 122, 61, 0.18)), var(--ink-2);
  box-shadow: 0 0 0 1px rgba(255, 201, 77, 0.25), 0 30px 60px rgba(0, 0, 0, 0.35);
}
.partners-card > div { max-width: 600px; }
.partners-card h2 { font-size: clamp(30px, 4vw, 44px); margin-bottom: 10px; }
.partners-card p:not(.eyebrow) { color: var(--muted); }
.partners-card .button { word-break: break-all; }

/* ---------- prose pages ---------- */
.crumbs { max-width: var(--max); margin: 0 auto; padding: 20px var(--gutter) 0; color: var(--muted); font-size: 14px; }
.prose { max-width: 760px; }
.prose h1 { font-size: clamp(40px, 6vw, 64px); margin-bottom: 12px; }
.prose h2 { font-size: 26px; margin: 34px 0 8px; color: var(--gold); }
.prose p { color: var(--muted); }
.prose .button { margin-top: 36px; }
.notfound { text-align: center; }
.notfound h1 { font-size: clamp(40px, 6vw, 64px); margin: 18px 0 10px; }
.notfound p { color: var(--muted); }
.notfound .button { margin-top: 26px; }
.coin.big { position: relative; inset: auto; width: 160px; margin: 0 auto; }

/* ---------- adult check ---------- */
.gate { border: 0; padding: 0; background: transparent; color: var(--cream); max-width: min(480px, calc(100vw - 32px)); }
.gate::backdrop { background: rgba(8, 5, 20, 0.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.gate-panel {
  background: linear-gradient(170deg, #2a1d55, var(--ink-2)); border-radius: calc(var(--radius) + 4px);
  box-shadow: 0 0 0 1px rgba(255, 201, 77, 0.3), 0 30px 80px rgba(0, 0, 0, 0.6);
  padding: 32px 28px; text-align: center;
}
.gate-panel.standalone { max-width: 520px; margin: 0 auto; }
.gate-age { font: 400 64px/1 var(--display); color: var(--gold); }
.gate-age span { font-size: 0.55em; vertical-align: super; }
.gate-panel h1, .gate-panel h2 { font-size: 30px; margin: 10px 0 12px; }
.gate-panel p { color: var(--muted); }
.gate-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 24px; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 40px var(--gutter) 48px; background: rgba(0, 0, 0, 0.18); }
.footer-main { max-width: var(--max); margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 18px 36px; }
.footer-main p { color: var(--muted); flex: 1 1 200px; }
.footer-main nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.footer-main nav a { color: var(--cream); text-decoration: none; font-weight: 600; }
.footer-main nav a:hover { color: var(--gold); }
.footer-legal { max-width: var(--max); margin: 28px auto 0; color: var(--muted); font-size: 14px; display: flex; gap: 12px; align-items: flex-start; }
.age-badge { flex: none; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--muted); font-weight: 800; font-size: 12px; color: var(--cream); }

/* ---------- reveal on scroll (only when JS runs) ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease calc(var(--i, 0) * 80ms), transform 0.6s cubic-bezier(0.2, 0.9, 0.3, 1) calc(var(--i, 0) * 80ms); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .features { grid-template-columns: repeat(2, 1fr); }
  .studio-grid { grid-template-columns: 1fr; }
  .mascot { order: -1; }
}
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; text-align: left; }
  .hero-art { width: min(250px, 62%); grid-row: 1; }
  .live-stage { flex-direction: column; align-items: stretch; min-height: 0; }
  .live-stage picture { position: relative; display: block; aspect-ratio: 10 / 9; }
  .live-scene { position: absolute; object-position: 100% 50%; }
  .live-shade { display: none; }
  .live-stage picture { -webkit-mask-image: linear-gradient(180deg, #000 58%, transparent 100%); mask-image: linear-gradient(180deg, #000 58%, transparent 100%); }
  .live-cat { height: auto; width: 46%; top: 3%; bottom: auto; right: 6%; }
  .live-copy { max-width: none; padding: 0 22px 28px; margin-top: -18%; }
}
@media (max-width: 720px) {
  .header { flex-wrap: wrap; gap: 6px; padding-bottom: 6px; }
  .header nav { width: 100%; overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter); }
  .header nav::-webkit-scrollbar { display: none; }
  .header nav a { padding: 8px 10px; font-size: 14px; }
  .flip-grid { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr; }
  .actions .button { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
  .js .reveal { opacity: 1; transform: none; }
}


/* ===================== the cast ===================== */

/* Page mood: two colours that turn with each world as FlipyCat changes costume (buddy.js). */
@property --m1 { syntax: '<color>'; inherits: false; initial-value: #6b4bb8; }
@property --m2 { syntax: '<color>'; inherits: false; initial-value: #ff7a3d; }
.mood {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(1100px 700px at 8% -10%, color-mix(in srgb, var(--m1) 60%, transparent), transparent 60%),
    radial-gradient(900px 600px at 105% 30%, color-mix(in srgb, var(--m2) 24%, transparent), transparent 60%),
    radial-gradient(800px 600px at 50% 110%, color-mix(in srgb, var(--m1) 45%, transparent), transparent 60%);
  transition: --m1 1.4s ease, --m2 1.4s ease;
}

/* The whale's sea: behind every section, above the page colour. */
.depths { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.whale { position: absolute; left: 0; top: 0; width: 440px; height: 314px; visibility: hidden; will-change: transform; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.35)); }
.whale.on { visibility: visible; }
.whale .spine-player { position: relative; width: 100%; height: 100%; }
.whale canvas { display: block; width: 100% !important; height: 100% !important; }
.bubble { position: absolute; border-radius: 50%; border: 1.5px solid rgba(190, 240, 255, 0.75); background: radial-gradient(circle at 32% 30%, rgba(255, 255, 255, 0.85) 0 14%, rgba(160, 225, 255, 0.18) 30%, rgba(160, 225, 255, 0.05) 70%); }

/* Leadstone turns over from a card back. */
.live-card { perspective: 1800px; }
.live-turn { position: relative; transform-style: preserve-3d; }
.live-stage { backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.live-back {
  position: absolute; inset: 0; transform: rotateY(180deg);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: calc(var(--radius) + 8px); overflow: hidden;
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 201, 77, 0.28), transparent 45%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.035) 0 14px, transparent 14px 28px),
    linear-gradient(180deg, #5b3e8c, #17111c);
  box-shadow: 0 0 0 1px var(--line), 0 40px 80px rgba(0, 0, 0, 0.45);
  display: grid; place-items: center;
}
.live-back::before { content: ''; position: absolute; inset: 16px; border-radius: calc(var(--radius) - 2px); border: 2px solid rgba(255, 201, 77, 0.55); box-shadow: inset 0 0 0 6px rgba(255, 201, 77, 0.08); }
.live-back-inner { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.live-back-inner img { width: clamp(120px, 18vw, 200px); filter: drop-shadow(0 12px 30px rgba(255, 159, 28, 0.4)); }
.live-back-inner span { font: 400 clamp(28px, 4vw, 44px)/1 var(--display); letter-spacing: 0.12em; }
.live-back-inner em { font-style: normal; font-weight: 800; letter-spacing: 0.3em; text-transform: uppercase; font-size: 13px; color: var(--gold); }

/* Coming-soon cards are dealt by .deal (scroll) and turned by .flip-inner (hover/tap). */
.deal { transform-style: preserve-3d; height: 100%; }

/* Split-flap headings. */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.flap-word { display: inline-block; white-space: nowrap; perspective: 500px; }
.flap .flap-ch { display: inline-block; transform: rotateX(90deg); transform-origin: 50% 55%; backface-visibility: hidden; }
.flap.flap-in .flap-ch { animation: flap 0.62s cubic-bezier(0.25, 1.6, 0.45, 1) calc(var(--d) * 32ms) both; }
@keyframes flap {
  0% { transform: rotateX(-120deg); color: var(--gold); }
  55% { color: var(--gold); }
  100% { transform: none; }
}

/* FlipyCat, riding along. */
.buddy {
  all: unset; position: fixed; z-index: 30; cursor: pointer;
  right: max(14px, env(safe-area-inset-right)); bottom: calc(4px + env(safe-area-inset-bottom));
  width: 140px; height: 158px;
  pointer-events: none; visibility: hidden;
  -webkit-tap-highlight-color: transparent;
}
.buddy.on { visibility: visible; }
.buddy.on .buddy-body { pointer-events: auto; }
.buddy:focus-visible .buddy-body { outline: 3px solid var(--gold); outline-offset: 4px; border-radius: 16px; }
.buddy-follow { position: absolute; inset: 0; transform-origin: 50% 100%; will-change: transform; }
.buddy-body { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; transform-origin: 50% 100%; }
.buddy-body img { max-width: 100%; max-height: 100%; width: auto; height: auto; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.45)); }
.buddy-shadow { position: absolute; left: 50%; bottom: 0; width: 96px; height: 14px; border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 0, 0, 0.45), transparent); transform: translateX(-50%); }
.buddy-bubble {
  position: absolute; right: 74%; bottom: 82%; width: max-content; max-width: 210px;
  background: var(--cream); color: #2a1600; font: 800 14px/1.3 var(--body);
  padding: 10px 14px; border-radius: 16px 16px 4px 16px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  opacity: 0; transform: translateY(8px) scale(0.9); transform-origin: 100% 100%;
  transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.3, 1.6, 0.5, 1);
  pointer-events: none;
}
.buddy.talking .buddy-bubble { opacity: 1; transform: none; }
.spark { position: absolute; left: 50%; top: 55%; width: 9px; height: 9px; border-radius: 50%; background: radial-gradient(circle, #fff6c8, var(--gold) 60%, transparent 70%); pointer-events: none; }

/* The jelly pit above the footer. */
.jelly-pit { position: relative; height: 300px; margin-top: -40px; }
.jelly-pit canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: pan-y; }
.jelly-pit.over canvas { cursor: grab; }
.jelly-pit.grabbing canvas { cursor: grabbing; }
.jelly-pit::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: linear-gradient(90deg, transparent, rgba(255, 95, 162, 0.5), rgba(255, 201, 77, 0.5), transparent); }
.pit-hint { position: absolute; left: 50%; top: 18px; transform: translateX(-50%); color: var(--muted); font-size: 14px; font-weight: 600; white-space: nowrap; pointer-events: none; opacity: 0.8; }
html:not(.js) .jelly-pit { display: none; }
.jelly-pit + .footer { margin-top: 0; }

@media (max-width: 720px) {
  .buddy { width: 92px; height: 104px; }
  .buddy-shadow { width: 64px; height: 10px; }
  .buddy-bubble { max-width: 160px; font-size: 13px; padding: 8px 11px; }
  .jelly-pit { height: 230px; }
  .rack { height: 160px; }
  .rack img { height: 130px; margin: 0 -22px; }
  .rack img:nth-child(3) { height: 142px; }
}
@media (prefers-reduced-motion: reduce) {
  .flap .flap-ch { transform: none; }
  .mood { transition: none; }
}
