/* Kitty after dark: her photo seen through a window in a moonlit castle keep, with her little
   adventure playing out on the road along the bottom (story.js). The page layout follows Lola's
   farm page; the look is medieval and World of Warcraft. Everything lives in this file because
   the page is served under a strict CSP (no inline style). */

:root {
  --night: #0d0916;
  --violet: #8b5cf6;
  --violet-deep: #4b2a7a;
  --violet-soft: #c9b0ff;
  --gold: #f2c14e;
  --gold-deep: #b9821f;
  --gold-soft: #ffe39a;
  --parchment: #f4e7c8;
  --parchment-deep: #e2cd9c;
  --ink: #2b1a12;
  --plum: #2b1440;
  --wine: #8c1f3a;
  --moonlight: #f1eaff;
  --wood: #4a2c1c;
  --wood-dark: #221107;
  --display: "Cinzel", "Trajan Pro", Georgia, serif;
  --hand: "IM Fell English", "Iowan Old Style", Georgia, serif;   /* an old-book face for the small lines */
  --sans: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  /* --w is the photo's width; it follows viewport height so the sign always lands above the fold.
     --ww is the whole window with its stone frame (viewBox 284 wide around a 240 opening). */
  --w: max(220px, min(calc(100vw - 95px), 380px, calc((100svh - 440px) * 0.86)));
  --ww: calc(var(--w) * 284 / 240);
  --hill-h: clamp(150px, 22svh, 300px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overflow-x: clip; background: var(--night); }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: linear-gradient(180deg, #0b0714, #1a1030 60%, #2a1747);
  color: var(--moonlight);
  font-family: var(--sans);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* ------------------------------------------------------------ world (fixed, behind everything) */
.world {
  position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  background: linear-gradient(180deg, #0b0714 0%, #150c27 34%, #24143f 64%, #351d58 100%);
}
.moon {
  position: absolute; right: 7vw; top: 9svh;
  width: min(30vmin, 240px); aspect-ratio: 1; border-radius: 50%;
  background:
    radial-gradient(circle at 40% 38%, rgba(176, 160, 214, .34) 0 7%, transparent 7.6%),
    radial-gradient(circle at 60% 56%, rgba(176, 160, 214, .28) 0 5%, transparent 5.6%),
    radial-gradient(circle at 46% 64%, rgba(176, 160, 214, .22) 0 3%, transparent 3.5%),
    radial-gradient(circle, #fbf8ff 0 44%, #e3d8ff 44% 46%, rgba(186, 160, 255, .24) 46% 60%, rgba(150, 110, 240, 0) 72%);
}

/* the castle keep Kitty looks out of: moonlit stone (#stones), battlements on top, round-tower
   shading, the warm glow of her window and torches, and a fade into the hills at its foot */
.keep {
  position: absolute; left: 50%; top: 36px; bottom: 0; translate: -50% 0;
  width: min(100vw, calc(var(--ww) + 130px));
  -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent 95%);
  mask-image: linear-gradient(180deg, #000 70%, transparent 95%);
}
.keep-wall { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; }
.keep::before {
  content: ""; position: absolute; left: 0; right: 0; top: -18px; height: 19px;
  background:
    linear-gradient(180deg, #5a5370 0 2px, transparent 2px),
    linear-gradient(90deg, #3a344a 0 58%, transparent 58%);
  background-size: 44px 100%, 44px 100%;
  background-position: 6px 0, 6px 0;
}
.keep::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(closest-side, rgba(255, 166, 80, .2), rgba(255, 166, 80, 0)) 50% calc(var(--ww) * .56 - 30px) / calc(var(--ww) + 180px) calc(var(--ww) * 1.25) no-repeat,
    linear-gradient(90deg, rgba(6, 3, 14, .8), rgba(6, 3, 14, .2) 16%, rgba(6, 3, 14, 0) 34%, rgba(6, 3, 14, 0) 62%, rgba(6, 3, 14, .3) 84%, rgba(6, 3, 14, .85));
}
.star {
  position: absolute; left: var(--x); top: var(--y); width: var(--s); height: var(--s); border-radius: 50%;
  background: radial-gradient(circle, #fff 0 30%, rgba(214, 196, 255, .7) 45%, rgba(214, 196, 255, 0) 72%);
  animation: twinkle var(--tw) ease-in-out var(--del) infinite alternate;
}
.mist { position: absolute; left: 0; width: 220px; fill: rgba(196, 170, 255, .11); animation: drift var(--dur) linear var(--del) infinite; will-change: transform; }
.mist--a { top: 22svh; --dur: 110s; --del: -30s; }
.mist--b { top: 50svh; width: 170px; --dur: 80s; --del: -52s; fill: rgba(196, 170, 255, .08); }
.mist--c { top: 9svh; width: 140px; --dur: 95s; --del: -12s; }

.land { position: absolute; left: 0; right: 0; bottom: 0; height: var(--hill-h); }
.hills { position: absolute; inset: 0; width: 100%; height: 100%; }
.hills .h1 { fill: #24183f; }
.hills .h2 { fill: #1a112f; }
.hills .h3 { fill: #110b20; }
.castle { position: absolute; left: 3vw; bottom: max(calc(var(--hill-h) * .34), calc(var(--rh, 0px) + var(--H, 88px) * .55)); width: clamp(84px, 22vw, 200px); overflow: visible; }
.spire { position: absolute; right: 4vw; bottom: max(calc(var(--hill-h) * .3), calc(var(--rh, 0px) + var(--H, 88px) * .5)); width: clamp(46px, 11vw, 112px); overflow: visible; }
.castle .sil, .spire .sil { fill: #1c1431; }
.castle .castle-door { fill: #0c0816; }
.castle .win, .spire .win { fill: #ffcf6e; filter: drop-shadow(0 0 4px rgba(255, 196, 90, .9)); animation: glimmer 5s ease-in-out infinite alternate; }
.castle .flag { fill: none; stroke: #8b5cf6; stroke-width: 3; stroke-linejoin: round; }
.spire .orb { fill: #d6bdff; filter: drop-shadow(0 0 8px #a77bff) drop-shadow(0 0 16px #8b5cf6); animation: orb 3.4s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 50% 50%; }

/* ------------------------------------------------------------ air: fireflies (taps pass through) */
.air { position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.ff {
  position: absolute; left: var(--x); top: var(--y);
  width: var(--s); height: var(--s); border-radius: 50%;
  background: radial-gradient(circle, #fffbe0 0 22%, var(--c, rgba(170, 255, 200, .85)) 44%, rgba(170, 255, 200, 0) 72%);
  opacity: 0;
  animation: wander var(--dur) ease-in-out var(--del) infinite alternate, blinkfly var(--tw) ease-in-out var(--del) infinite;
}

/* ------------------------------------------------------------ layout */
main { position: relative; pointer-events: none; }
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex; flex-direction: column; align-items: center;
  padding: 58px 16px 30px;
}

/* ------------------------------------------------------------ the castle window (stone frame drawn in index.html) */
.window { position: relative; z-index: 3; width: var(--ww); aspect-ratio: 284 / 321.1; pointer-events: auto; filter: drop-shadow(0 16px 20px rgba(0, 0, 0, .6)); }
/* the opening: a pointed (two-centred) gothic arch, same shape as the frame's inner edge */
.window-photo {
  position: absolute; left: 7.746%; width: 84.507%; top: 7.473%; height: 84.43%;
  background: #2a1d1d; overflow: hidden;
  clip-path: polygon(0% 100%, 0% 49.31%, .6% 42.08%, 2.38% 35%, 5.31% 28.23%, 9.32% 21.91%, 14.33% 16.17%, 20.24% 11.15%, 26.9% 6.93%, 34.19% 3.63%, 41.95% 1.3%, 50% 0%, 58.05% 1.3%, 65.81% 3.63%, 73.1% 6.93%, 79.76% 11.15%, 85.67% 16.17%, 90.68% 21.91%, 94.69% 28.23%, 97.62% 35%, 99.4% 42.08%, 100% 49.31%, 100% 100%);
}
.window-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0%; }
/* the deep stone reveal casts a little shadow into the room, and candlelight warms the top */
.window-photo::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 78% 70% at 50% 46%, rgba(20, 8, 10, 0) 58%, rgba(20, 8, 10, .5)),
    linear-gradient(180deg, rgba(255, 190, 120, .12), rgba(255, 190, 120, 0) 32%);
}
.window-frame { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.wf-stone { fill: url(#g-stone); }
.wf-joint { fill: none; stroke: #1c1726; stroke-width: 1.6; }
.wf-key { fill: #5f587b; stroke: #1c1726; stroke-width: 1.4; stroke-linejoin: round; }
.wf-moon { color: var(--gold); }
.wf-reveal { fill: none; stroke: #120d19; stroke-width: 5; opacity: .8; }
.wf-sill-top { fill: #6c6585; }
.wf-sill { fill: #3a344b; }

/* wall torches either side of the window */
.sconce { position: absolute; top: 44%; width: clamp(11px, calc(var(--ww) * .05), 22px); aspect-ratio: 20 / 70; }
.sconce--l { right: calc(100% + 5px); }
.sconce--r { left: calc(100% + 5px); }
.sconce > svg { width: 100%; height: 100%; overflow: visible; }
.sconce .flame > svg { filter: drop-shadow(0 0 5px #ffb347) drop-shadow(0 0 12px #ff8a2a); }
.sconce::before {
  content: ""; position: absolute; left: 50%; top: -10%; width: 700%; aspect-ratio: 1; translate: -50% -40%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 160, 70, .26), rgba(255, 160, 70, 0));
}

/* the carved stone plaque under the sill */
.plaque {
  position: relative; z-index: 3; margin-top: -1px; padding: 9px 26px 11px; min-width: calc(var(--w) * .8);
  text-align: center; pointer-events: auto; border-radius: 3px;
  background: linear-gradient(180deg, #4f4865, #3b354e 60%, #302a42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), inset 0 -3px 0 rgba(0, 0, 0, .35), inset 0 0 0 4px #2a2438, inset 0 0 0 5px rgba(201, 162, 74, .4), 0 12px 18px -6px rgba(0, 0, 0, .75);
}
.plaque h1 { margin: 0; line-height: 1; font-weight: 900; font-family: var(--display); }
.hello { display: block; font-family: var(--hand); font-style: italic; font-weight: 400; font-size: 18px; line-height: 1.1; color: #e7def5; margin-bottom: 4px; text-shadow: 0 1px 0 rgba(0, 0, 0, .7); }
.name {
  display: block; white-space: nowrap; font-size: clamp(34px, calc(var(--w) * .15), 58px); letter-spacing: .06em; line-height: 1.05;
  color: #f2c14e;
  background: linear-gradient(180deg, #fff3c4, #f2c14e 52%, #b9821f); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 0 rgba(10, 5, 15, .95));
}

/* ------------------------------------------------------------ sign (main CTA) */
.cta-burst { position: relative; margin-top: 30px; width: min(310px, calc(100vw - 44px)); }
.sign-wrap {
  position: relative; z-index: 3; transform-origin: 50% -34px;
  animation: sign-in 2s .2s cubic-bezier(.25, .6, .3, 1) both;
}
/* the idle sway lives on its own element: two transform animations on one element can't both run on the compositor */
.sign-sway { transform-origin: 50% -34px; animation: sign-idle 7s 2.6s ease-in-out infinite; }
.sign {
  /* a native button that keeps the old link's look: no UA font, border or centring */
  appearance: none; -webkit-appearance: none; border: 0; margin: 0; width: 100%; cursor: pointer;
  font: inherit; letter-spacing: inherit; word-spacing: inherit; text-align: inherit;
  position: relative; display: block; text-decoration: none; color: #fff1d6;
  padding: 17px 60px 16px 24px; min-height: 92px;
  border-radius: 4px;
  pointer-events: auto;
  background:
    linear-gradient(180deg, rgba(255, 225, 190, .14), transparent 34%, rgba(20, 8, 2, .3)),
    repeating-linear-gradient(180deg, rgba(20, 8, 2, .16) 0 1px, transparent 1px 6px, rgba(255, 210, 160, .06) 6px 8px, transparent 8px 13px),
    var(--wood);
  box-shadow: 0 7px 0 var(--wood-dark), 0 18px 24px -6px rgba(0, 0, 0, .7), 0 0 34px -4px rgba(160, 110, 255, .55), inset 0 1px 0 rgba(255, 220, 170, .4);
  transform-origin: 50% -34px;
  -webkit-tap-highlight-color: transparent;
  transition: filter .2s;
}
.sign::before {
  content: ""; position: absolute; inset: 8px; border-radius: 2px; pointer-events: none;
  border: 2px solid rgba(242, 193, 78, .55);
}
/* iron corner brackets, each with a rivet */
.sign::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: 4px;
  --iron: linear-gradient(#5d5672, #3d384e);
  background:
    radial-gradient(circle at 8px 8px, #d6cee4 0 1.8px, transparent 2.4px),
    radial-gradient(circle at calc(100% - 8px) 8px, #d6cee4 0 1.8px, transparent 2.4px),
    radial-gradient(circle at 8px calc(100% - 8px), #d6cee4 0 1.8px, transparent 2.4px),
    radial-gradient(circle at calc(100% - 8px) calc(100% - 8px), #d6cee4 0 1.8px, transparent 2.4px),
    var(--iron) left top / 24px 5px no-repeat, var(--iron) left top / 5px 24px no-repeat,
    var(--iron) right top / 24px 5px no-repeat, var(--iron) right top / 5px 24px no-repeat,
    var(--iron) left bottom / 24px 5px no-repeat, var(--iron) left bottom / 5px 24px no-repeat,
    var(--iron) right bottom / 24px 5px no-repeat, var(--iron) right bottom / 5px 24px no-repeat;
}
.chains { position: absolute; left: 0; top: -34px; width: 100%; height: 36px; overflow: visible; pointer-events: none; }
.chains path { fill: none; stroke: #a49cb6; stroke-width: 3.4; stroke-dasharray: 5 3; stroke-linecap: round; }
.chains circle { fill: #6d6580; }
.sign-title {
  position: relative; z-index: 1; display: block;
  font-family: var(--display); font-weight: 900; font-size: 25px; line-height: 1.1; letter-spacing: .01em;
  text-shadow: 0 2px 0 rgba(20, 8, 2, .7);
}
.sign-sub {
  position: relative; z-index: 1; display: block; margin-top: 4px; white-space: nowrap;
  font-family: var(--hand); font-style: italic; font-weight: 400; font-size: 20px; line-height: 1; color: var(--gold-soft);
  text-shadow: 0 1.5px 0 rgba(20, 8, 2, .6);
}
/* the WoW quest-giver "!" that floats beside the sign */
.quest { position: absolute; z-index: 2; top: -42px; right: -6px; width: 52px; height: 84px; pointer-events: none; display: grid; place-items: center; }
.quest-mark {
  display: block; font-family: var(--display); font-weight: 900; font-size: 74px; line-height: 1;
  color: #ffd43a;
  -webkit-text-stroke: 2.5px #2a1502;
  paint-order: stroke fill;
  text-shadow: 0 0 14px rgba(255, 210, 60, .85), 0 4px 0 #2a1502;
  animation: quest-bob 1.6s ease-in-out infinite alternate;
}
.sign:hover, .sign:focus-visible, .sign.swing { animation: swing 1.4s ease-in-out; filter: brightness(1.08); }
.sign.swing { box-shadow: 0 7px 0 var(--wood-dark), 0 18px 24px -6px rgba(0, 0, 0, .7), 0 0 50px 4px rgba(190, 140, 255, .8), inset 0 1px 0 rgba(255, 220, 170, .4); }
.sign:active { filter: brightness(.95); }
.sign:focus-visible { outline: 4px solid #fff; outline-offset: 6px; }

/* "what you are looking for": handwritten note with a self-drawing arrow */
.psst {
  position: absolute; z-index: 4; margin: 0; pointer-events: none;   /* above the story layer (.lane is 2) */
  display: flex; align-items: flex-start; gap: 2px;
  left: 14%; top: calc(100% + 12px);
  font-family: var(--hand); font-style: italic; font-weight: 400; font-size: 26px; line-height: 1; color: var(--moonlight);
  text-shadow: 0 1px 0 rgba(20, 8, 40, .9), 0 0 8px rgba(20, 8, 40, .95), 0 0 16px rgba(20, 8, 40, .8);
  rotate: -3deg;
  animation: pop .6s cubic-bezier(.34, 1.56, .64, 1) 1s both, nudge 3.6s ease-in-out 3s infinite;
}
.psst .arrow { width: 50px; height: 40px; margin-top: -20px; overflow: visible; color: var(--gold-soft); }
.psst .arrow--d { display: none; }
.psst .psst-text { padding-top: 4px; white-space: nowrap; }
.psst .draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw .8s ease-out 1.3s forwards; }
.psst .head { opacity: 0; animation: fade-in .25s ease-out 2s forwards; }

/* ------------------------------------------------------------ the Battle with Kitty link (the mini game) */
.battle {
  position: fixed; left: 50%; top: calc(6px + env(safe-area-inset-top, 0px)); z-index: 6;
  display: inline-flex; align-items: center; gap: 7px; min-height: 30px; white-space: nowrap;
  padding: 5px 14px 5px 11px; border-radius: 7px; text-decoration: none;
  /* the classic red-and-gold WoW interface button */
  background: linear-gradient(180deg, #c4271b 0%, #8e1610 48%, #5e0c08 100%); color: #ffd100;
  border: 2px solid #c9a24a;
  font: 700 12.5px/1.15 var(--display); letter-spacing: .06em;
  text-shadow: 0 1px 0 #2a0402, 0 0 6px rgba(0, 0, 0, .6);
  box-shadow: inset 0 1px 0 rgba(255, 180, 150, .45), inset 0 0 0 1px rgba(0, 0, 0, .45), 0 2px 0 rgba(0, 0, 0, .5), 0 8px 14px -6px rgba(0, 0, 0, .7);
  translate: -50% 0;
  -webkit-tap-highlight-color: transparent;
  transition: filter .2s, transform .2s;
}
.battle-icon { flex: none; width: 15px; height: 15px; color: #ffd100; filter: drop-shadow(0 1px 0 #2a0402); }
.battle:hover { filter: brightness(1.15); transform: translateY(1px); }
.battle:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.battle.nudge { animation: nudge-pill 1.1s ease-in-out 3; }

/* ------------------------------------------------------------ footer: the page ends on the road */
.foot {
  position: relative; z-index: 3; background: #120c20; margin-top: 46px;
  padding: 14px 16px calc(24px + env(safe-area-inset-bottom, 0px)); text-align: center;
  box-shadow: 0 -1px 0 rgba(242, 193, 78, .25);
}
.foot-line {
  display: inline-block; margin: 0; padding: 10px 18px; min-height: 40px;
  border-radius: 99px; background: rgba(43, 20, 64, .9); color: #d9cdf0;
  border: 1px solid rgba(242, 193, 78, .3);
  font-weight: 700; font-size: 13px; line-height: 1.4;
}

/* ============================================================ THE STORY (story.js)
   A one-minute adventure along the road: four zones, three fights, loot, a level-up and
   her secret cave at the end. --H is Kitty's height and --W her sprite cell width, both
   set on the lane by story.js from the room left under the sign. */

.road {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1; height: var(--rh, 22px); pointer-events: none; overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .07), transparent 3px),
    linear-gradient(180deg, #3a3150, #241d36 55%, #17111f);
  box-shadow: 0 -2px 0 #1f2b2a, 0 -5px 0 #182220;
}
/* the paving joints: they slide by while she rides (story.js sets --road-dur to match her speed) */
.road::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; right: -36px;
  background: repeating-linear-gradient(90deg, transparent 0 34px, rgba(0, 0, 0, .28) 34px 36px);
  animation: road-scroll var(--road-dur, .2s) linear infinite paused;
}
.road.scrolling::before { animation-play-state: running; }
/* a far treeline that drifts by at half speed */
.treeline {
  position: absolute; left: 0; bottom: 0; width: calc(var(--tile, 480px) * 2); height: calc(var(--H, 88px) * 1.1); pointer-events: none;
  animation: tl-scroll var(--tl-dur, 4s) linear infinite paused;
}
.treeline svg { display: block; max-width: none; }
.treeline.scrolling { animation-play-state: running; }
.lane {
  position: fixed; left: 0; right: 0; bottom: var(--ground, 10px); height: calc(var(--H, 88px) * 2.6); z-index: 2; pointer-events: none;
  /* sprite cells (docs/sprites/sprites.json): kitty 250 x 308, fight 315 x 308, ride 328 x 281 */
  --W: calc(var(--H, 88px) * 250 / 308);
  --WF: calc(var(--H, 88px) * 315 / 308);
  --WR: calc(var(--H, 88px) * 328 / 308);
  --HR: calc(var(--H, 88px) * 281 / 308);
}
.stage {
  position: absolute; bottom: 0; left: var(--sx, 0px); width: var(--sw, 100vw); height: 100%;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 var(--fade, 18px), #000 calc(100% - var(--fade, 18px)), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 var(--fade, 18px), #000 calc(100% - var(--fade, 18px)), transparent);
}
.props { position: absolute; inset: 0; }
.prop { position: absolute; bottom: 0; left: var(--px); width: var(--pw); height: var(--ph); transform: translateX(-50%); color: var(--c, #a77bff); }
.prop > svg { width: 100%; height: 100%; overflow: visible; }
.prop--glow > svg { filter: drop-shadow(0 0 6px var(--c)); }
.prop--sway { transform-origin: 50% 100%; animation: sway-x var(--dur, 4s) ease-in-out var(--del, 0s) infinite alternate; }
.prop--rear { z-index: 0; opacity: .82; }
.prop--cave { z-index: 0; }
.prop--cave > svg { filter: drop-shadow(0 0 18px rgba(170, 120, 255, .55)); }
.cave-glow { position: absolute; left: 30%; right: 30%; bottom: 0; height: 58%; border-radius: 50% 50% 0 0; background: radial-gradient(ellipse at 50% 90%, rgba(255, 190, 240, .55), rgba(170, 110, 255, 0) 70%); animation: cave-breathe 3s ease-in-out infinite alternate; }
.flame { position: absolute; left: 50%; top: -14%; width: 120%; height: 34%; transform: translateX(-50%); transform-origin: 50% 100%; animation: flicker .22s steps(2) infinite alternate; }
.flame > svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 0 6px #b98cff) drop-shadow(0 0 12px #8b5cf6); }

/* Kitty herself: three strips of six equal cells, shown one cell at a time.
   walk.webp  0-5 walk cycle (faces right)
   poses.webp 0 idle, 1 blink, 2-3 wave (3 winks), 4 cheer, 5 hugging a heart (all face the viewer)
   fight.webp 0 ready, 1 wind-up, 2 slash, 3 leap, 4 flinch, 5 holding the loot chest (all face right) */
.actor { position: absolute; bottom: 0; left: 0; z-index: 3; width: var(--W); height: var(--H); will-change: transform; }
.pose { position: absolute; inset: 0; transform-origin: 50% 100%; }
.kitty-btn {
  position: absolute; inset: 0; display: block; width: 100%; height: 100%; padding: 0; margin: 0; border: 0; background: none;
  cursor: pointer; pointer-events: auto; overflow: visible; border-radius: 14px; -webkit-tap-highlight-color: transparent;
}
.kitty-btn::after { content: ""; position: absolute; inset: -6px -9px; }
.kitty-btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.k-flip, .k-body, .k-sprite { position: absolute; inset: 0; display: block; }
.k-flip::before {
  content: ""; position: absolute; left: 20%; right: 20%; bottom: -1%; height: 6%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .55), rgba(0, 0, 0, 0));
}
.actor:not(.ready) .k-flip { visibility: hidden; }
.k-body { transform-origin: 50% 100%; animation: k-sway 5.2s ease-in-out infinite alternate; }
/* one cell of a 6-cell strip: the strip slides behind a cell-sized window with transform, so
   stepping through frames stays on the compositor (background-position would repaint each frame).
   Cell widths come from story.js as whole pixels, so every step lands on a cell edge. */
.k-sprite { overflow: hidden; }
.k-strip { position: absolute; top: 0; left: 0; width: 600%; height: 100%; background: url(/assets/story/poses.webp) no-repeat 0 0 / 100% 100%; }

/* only the side-view strips are ever mirrored; the front poses never are */
.actor.left.walking .k-flip, .actor.left[data-pose="ready"] .k-flip, .actor.left[data-pose="windup"] .k-flip,
.actor.left[data-pose="slash"] .k-flip, .actor.left[data-pose="leap"] .k-flip, .actor.left[data-pose="flinch"] .k-flip,
.actor.left[data-pose="loot"] .k-flip { transform: scaleX(-1); }

.actor.blink[data-pose="idle"] .k-strip { transform: translateX(calc(-100% / 6)); }
.actor.talking .k-body { animation: k-talk .34s ease-in-out infinite alternate; }
.actor[data-pose="wave"] .k-strip { transform: translateX(calc(-100% * 2 / 6)); animation: k-wave .8s step-end infinite; }
.actor[data-pose="wink"] .k-strip { transform: translateX(calc(-100% * 3 / 6)); }
.actor[data-pose="cheer"] .k-strip { transform: translateX(calc(-100% * 4 / 6)); }
.actor[data-pose="cheer"] .k-body { animation: k-cheer .5s ease-in-out infinite; }
.actor[data-pose="heart"] .k-strip { transform: translateX(calc(-100% * 5 / 6)); }
.actor[data-pose="heart"] .k-body { animation: k-proud 1.1s ease-in-out infinite; }
/* the fight cells are wider (the claw swipe), same height and scale: centred on her box */
.actor[data-pose="ready"] .k-sprite, .actor[data-pose="windup"] .k-sprite, .actor[data-pose="slash"] .k-sprite,
.actor[data-pose="leap"] .k-sprite, .actor[data-pose="flinch"] .k-sprite, .actor[data-pose="loot"] .k-sprite {
  left: calc((var(--W) - var(--WF)) / 2); right: auto; width: var(--WF);
}
.actor[data-pose="ready"] .k-strip, .actor[data-pose="windup"] .k-strip, .actor[data-pose="slash"] .k-strip,
.actor[data-pose="leap"] .k-strip, .actor[data-pose="flinch"] .k-strip, .actor[data-pose="loot"] .k-strip { background-image: url(/assets/story/fight.webp); }
.actor[data-pose="ready"] .k-body { animation: k-ready .6s ease-in-out infinite alternate; }
.actor[data-pose="windup"] .k-strip { transform: translateX(calc(-100% / 6)); }
.actor[data-pose="slash"] .k-strip { transform: translateX(calc(-100% * 2 / 6)); }
.actor[data-pose="leap"] .k-strip { transform: translateX(calc(-100% * 3 / 6)); }
.actor[data-pose="flinch"] .k-strip { transform: translateX(calc(-100% * 4 / 6)); }
.actor[data-pose="flinch"] .k-body { animation: k-hop .34s ease-in-out 2; }
.actor[data-pose="loot"] .k-strip { transform: translateX(calc(-100% * 5 / 6)); }
.actor[data-pose="loot"] .k-body { animation: k-proud 1.1s ease-in-out infinite; }
.actor[data-pose="windup"] .k-body, .actor[data-pose="slash"] .k-body, .actor[data-pose="leap"] .k-body { animation: none; }
/* riding Midnight, her nightsaber (ride.webp: 0-5 gallop, facing right); a bigger cell at the same scale */
.actor.riding .k-sprite { left: calc((var(--W) - var(--WR)) / 2); right: auto; top: auto; bottom: 0; width: var(--WR); height: var(--HR); }
.actor.riding .k-strip { background-image: url(/assets/story/ride.webp); transform: none; animation: k-cycle .5s steps(6) infinite; }
.actor.riding .k-body { animation: k-gallop .25s ease-in-out infinite alternate; }
.actor.riding .k-flip::before { left: calc(50% - var(--WR) * .32); right: calc(50% - var(--WR) * .32); }
.actor.left.riding .k-flip { transform: scaleX(-1); }

/* walking and running (also during a fight pose, e.g. the dash at the dragon: back to her own cell) */
.actor.walking .k-body { animation: none; }
.actor.walking .k-sprite { left: 0; right: 0; width: auto; }
.actor.walking .k-strip { background-image: url(/assets/story/walk.webp); transform: none; animation: k-cycle .78s steps(6) infinite; }
.actor.walking.running .k-strip { animation-duration: .42s; }
.actor.walking.running .k-body { animation: k-run .21s ease-in-out infinite alternate; }

/* the monsters: stickers from the Realm, scaled to Kitty */
.mob { position: absolute; bottom: 0; left: 0; z-index: 2; width: var(--mw); height: var(--mh); pointer-events: none; will-change: transform; }
.mob-flip, .mob-body { position: absolute; inset: 0; display: block; transform-origin: 50% 100%; }
.mob.flip .mob-flip { transform: scaleX(-1); }
.mob-body img { width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; }
.mob-flip::before {
  content: ""; position: absolute; left: 16%; right: 16%; bottom: -2%; height: 8%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .5), rgba(0, 0, 0, 0));
}
.mob--fly .mob-flip::before { display: none; }
.mob--slime .mob-body { animation: m-jiggle .9s ease-in-out infinite alternate; }
.mob--wolf .mob-body { animation: m-breathe 1.2s ease-in-out infinite alternate; }
.mob--dragon .mob-body { animation: m-hover 1.4s ease-in-out infinite alternate; }
.mob.hop .mob-body { animation: m-hop .42s ease-in-out infinite; }
.mob.run .mob-body { animation: m-run .2s ease-in-out infinite alternate; }
.mob.hit .mob-body { animation: m-hit .36s ease-out; }
.mob.hit img { animation: m-flash .36s ease-out; }

/* effects: combat text, claw marks, puffs, coins, fireballs, the level-up beam */
.fx { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.fx > * { position: absolute; left: 0; top: 0; }
.ft {
  font-family: var(--display); font-weight: 900; font-size: calc(var(--H) * .2 + 4px); line-height: 1; white-space: nowrap; color: #fff;
  -webkit-text-stroke: 3px #1c0b2c; paint-order: stroke fill;
  text-shadow: 0 2px 0 #1c0b2c;
}
.ft--crit { color: #ffd43a; font-size: calc(var(--H) * .3 + 6px); }
.ft--loot { color: var(--gold-soft); font-family: var(--sans); font-weight: 800; font-size: calc(var(--H) * .15 + 5px); }
.ft--xp { color: #d6bdff; font-family: var(--sans); font-weight: 800; font-size: calc(var(--H) * .15 + 5px); }
.ft--roar { color: #ffb4f0; font-size: calc(var(--H) * .26 + 6px); letter-spacing: .06em; }
.ft--level { color: #ffd43a; font-size: calc(var(--H) * .28 + 6px); letter-spacing: .05em; text-shadow: 0 2px 0 #1c0b2c, 0 0 18px rgba(255, 210, 60, .9); }
.claw { width: calc(var(--H) * .9); height: calc(var(--H) * .9); }
.claw svg { width: 100%; height: 100%; overflow: visible; }
.claw path { stroke: #f4ecff; stroke-width: 4.5; filter: drop-shadow(0 0 4px #b98cff) drop-shadow(0 0 9px #8b5cf6); }
.puff { width: calc(var(--H) * .5); height: calc(var(--H) * .5); border-radius: 50%; background: radial-gradient(circle, rgba(236, 226, 255, .9) 0 30%, rgba(180, 150, 255, .45) 55%, rgba(180, 150, 255, 0) 72%); }
.coin { width: calc(var(--H) * .12 + 4px); height: calc(var(--H) * .12 + 4px); border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff6c8, #f2c14e 45%, #a8701a); box-shadow: inset 0 0 0 1.5px #8a5a12; }
.orb { width: calc(var(--H) * .34); height: calc(var(--H) * .34); border-radius: 50%; background: radial-gradient(circle, #fff 0 18%, #e2c8ff 30%, #a66cff 55%, rgba(139, 92, 246, 0) 72%); filter: drop-shadow(0 0 10px #a66cff); }
.beam { width: calc(var(--H) * 1.1); height: calc(var(--H) * 2.5); background: linear-gradient(90deg, rgba(255, 220, 110, 0), rgba(255, 228, 140, .75) 35%, rgba(255, 252, 230, .95) 50%, rgba(255, 228, 140, .75) 65%, rgba(255, 220, 110, 0)); -webkit-mask-image: linear-gradient(0deg, #000 60%, transparent); mask-image: linear-gradient(0deg, #000 60%, transparent); transform-origin: 50% 100%; }
.spark { width: calc(var(--H) * .09 + 3px); height: calc(var(--H) * .09 + 3px); border-radius: 50%; background: radial-gradient(circle, #fff, #ffe08a 45%, rgba(255, 220, 110, 0) 72%); }
.drop-chest { width: calc(var(--H) * .5); height: calc(var(--H) * .42); filter: drop-shadow(0 0 8px rgba(255, 210, 90, .8)); }
.drop-chest svg { width: 100%; height: 100%; overflow: visible; }
.heart-fx { width: calc(var(--H) * .2 + 6px); height: calc(var(--H) * .2 + 6px); color: #e8a4ff; filter: drop-shadow(0 0 6px #b673ff); }
.heart-fx svg { width: 100%; height: 100%; }
.stage.shake { animation: shake .45s ease-in-out; }
.ring-fx { border-radius: 50%; border: 3px solid #d8c0ff; box-shadow: 0 0 14px #8b5cf6, inset 0 0 14px #8b5cf6; }

/* the pause button stops every animation on the page; it sits just above Kitty's head, above the
   bubble layer, and drops to the corner when the story is hidden */
.story-pause {
  position: fixed; left: 6px; bottom: max(calc(6px + env(safe-area-inset-bottom, 0px)), calc(var(--ground, 10px) + var(--H, 88px) + 6px)); z-index: 9;
  width: 30px; height: 30px; padding: 0; border-radius: 50%; display: grid; place-items: center;
  background: rgba(24, 14, 40, .72); color: var(--violet-soft); border: 1px solid rgba(201, 176, 255, .45);
  cursor: pointer; pointer-events: auto; opacity: .75; -webkit-tap-highlight-color: transparent;
}
.story-pause svg { width: 14px; height: 14px; }
.story-pause .i-play, .story-pause[aria-pressed="true"] .i-pause { display: none; }
.story-pause[aria-pressed="true"] .i-play { display: block; }
.story-pause:hover, .story-pause:focus-visible { opacity: 1; }
.story-pause:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.story-pause[hidden] { display: none; }

/* WoW-style zone name when she rides into a new place: top centre, where WoW shows it */
.zone {
  position: fixed; left: 50%; top: calc(48px + env(safe-area-inset-top, 0px)); translate: -50% 0; z-index: 7; pointer-events: none;
  text-align: center; white-space: nowrap;
  opacity: 0; transform: translateY(6px); transition: opacity .6s ease, transform .6s ease;
}
.zone.on { opacity: 1; transform: none; }
.zone-name {
  display: inline-block; font-family: var(--display); font-weight: 900; font-size: clamp(18px, 2.6vw, 32px); letter-spacing: .06em;
  color: #ffd76a; -webkit-text-stroke: 3px #1a0b26; paint-order: stroke fill;
  text-shadow: 0 2px 0 #1a0b26, 0 0 18px rgba(20, 6, 36, .9);
}
.zone-name::before, .zone-name::after { content: "✦"; color: var(--violet-soft); font-size: .6em; vertical-align: .3em; margin: 0 .5em; -webkit-text-stroke: 0; }

/* speech bubble, WoW chat style; data-side says where it sits relative to the speaker, so the tail faces them */
.bubble {
  position: fixed; left: 0; top: 0; z-index: 8; max-width: min(232px, calc(100vw - 20px)); padding: 7px 12px 8px;
  border-radius: 10px; background: #130c20; color: #fff6e2; border: 2px solid #c9a24a;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .7), inset 0 0 14px rgba(120, 80, 200, .25), 0 10px 18px -8px rgba(0, 0, 0, .85);
  font-family: var(--sans); font-weight: 800; font-size: 15px; line-height: 1.25; text-align: center;
  pointer-events: none; opacity: 0; transform: scale(.7); transform-origin: var(--tx, 50%) var(--ty, 100%);
  transition: opacity .18s, transform .3s cubic-bezier(.34, 1.56, .64, 1);
}
.bubble.on { opacity: 1; transform: none; }
.bubble::after { content: ""; position: absolute; width: 12px; height: 12px; background: #130c20; border: 2px solid #c9a24a; border-top: 0; border-left: 0; }
.bubble[data-side="up"]::after { bottom: -8px; left: calc(var(--tail, 50%) - 6px); transform: rotate(45deg); }
.bubble[data-side="down"]::after { top: -8px; left: calc(var(--tail, 50%) - 6px); transform: rotate(225deg); }
.bubble[data-side="right"]::after { left: -8px; top: calc(var(--tail, 50%) - 6px); transform: rotate(135deg); }
.bubble[data-side="left"]::after { right: -8px; top: calc(var(--tail, 50%) - 6px); transform: rotate(-45deg); }
/* monster yells, in WoW's red */
.bubble.roar { color: #ff4b3a; border-color: #8e1610; font-family: var(--display); font-weight: 900; font-size: 17px; letter-spacing: .05em; text-shadow: 0 1px 0 #000; }
.bubble.roar::after { border-color: #8e1610; }

/* WoW nameplates over the monsters: level, red hostile name, health bar (shown once the fight starts) */
.plate {
  position: absolute; left: 50%; bottom: var(--pb, 100%); z-index: 6; translate: -50% 0;
  display: flex; flex-direction: column; align-items: center; gap: 2px; white-space: nowrap;
  opacity: 0; transition: opacity .3s ease;
}
.mob.engaged .plate { opacity: 1; }
.plate-label { display: flex; align-items: center; gap: 4px; font: 800 calc(var(--H) * .1 + 4px)/1 var(--sans); color: #ff4b3a; -webkit-text-stroke: 2.5px #120306; paint-order: stroke fill; }
.plate-lvl { color: #ffd100; font-size: .9em; }
.plate--boss .plate-lvl { color: #ff4b3a; }
.plate-bar {
  display: block; width: calc(var(--H) * .78); height: calc(var(--H) * .05 + 3px); padding: 1px; border-radius: 2px;
  background: #120306; box-shadow: 0 0 0 1px rgba(201, 162, 74, .7);
}
.plate--boss .plate-bar { width: calc(var(--H) * 1.15); }
.plate-fill { display: block; width: 100%; height: 100%; border-radius: 1px; background: linear-gradient(180deg, #ff5a4a, #c41f1f 55%, #8a0f0f); transform-origin: 0 50%; transition: transform .35s ease-out; }

/* WoW toasts: loot and the achievement banner, up top where the story never goes */
.toast {
  position: fixed; left: 50%; top: calc(46px + env(safe-area-inset-top, 0px)); translate: -50% 0; z-index: 7; pointer-events: none;
  display: flex; align-items: center; gap: 10px; padding: 7px 14px 7px 8px; max-width: calc(100vw - 16px);
  border-radius: 8px; background: linear-gradient(180deg, rgba(28, 18, 8, .96), rgba(12, 8, 4, .96));
  border: 2px solid #c9a24a; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .7), 0 0 0 1px rgba(0, 0, 0, .6), 0 14px 22px -10px rgba(0, 0, 0, .9);
  opacity: 0; transform: translateY(-10px) scale(.96);
  transition: opacity .3s ease, transform .4s cubic-bezier(.34, 1.4, .64, 1);
}
.toast.on { opacity: 1; transform: none; }
.toast-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.toast-kicker { font: 800 11px/1.1 var(--sans); color: #fff6e2; letter-spacing: .02em; }
.loot-icon {
  flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 4px;
  background: radial-gradient(circle, #3a2160, #160b26); box-shadow: 0 0 0 2px #a335ee, 0 0 10px #a335ee;
}
.loot-icon svg { width: 28px; height: 28px; }
.loot-name { font: 800 14px/1.15 var(--sans); color: #c66cff; text-shadow: 0 1px 0 #000; white-space: nowrap; }
.toast--ach { padding: 8px 16px 8px 10px; border-width: 2.5px; background: linear-gradient(180deg, rgba(40, 26, 8, .97), rgba(16, 10, 4, .97)); }
.ach-shield {
  flex: none; position: relative; display: grid; place-items: center; width: 40px; height: 46px;
  background: linear-gradient(180deg, #fff0b8, #f2c14e 45%, #a8701a);
  clip-path: polygon(50% 0, 100% 14%, 94% 62%, 50% 100%, 6% 62%, 0 14%);
}
.ach-shield::before { content: ""; position: absolute; inset: 3px; background: linear-gradient(180deg, #4a2c0c, #2a1604); clip-path: inherit; }
.ach-points { position: relative; font: 900 15px/1 var(--display); color: #ffd100; text-shadow: 0 1px 0 #000; }
.toast--ach .toast-kicker { color: #ffd100; font-family: var(--display); font-weight: 700; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.ach-name { font: 700 15px/1.15 var(--display); color: #fff6e2; white-space: nowrap; }

/* ------------------------------------------------------------ pause everything while the tab is hidden or the story is paused */
html.is-hidden *, html.is-hidden *::before, html.is-hidden *::after { animation-play-state: paused !important; }
html.story-paused *, html.story-paused *::before, html.story-paused *::after { animation-play-state: paused !important; }
/* no room for the story on this screen: it waits, hidden */
html.no-story .lane, html.no-story .road, html.no-story .zone, html.no-story .bubble { display: none; }
html.no-story .story-pause { bottom: calc(6px + env(safe-area-inset-bottom, 0px)); }

/* ------------------------------------------------------------ keyframes */
@keyframes drift { from { transform: translateX(-260px); } to { transform: translateX(calc(100vw + 40px)); } }
@keyframes twinkle { from { opacity: .15; transform: scale(.7); } to { opacity: 1; transform: scale(1.1); } }
@keyframes glimmer { 0%, 70% { opacity: 1; } 85% { opacity: .55; } 100% { opacity: .95; } }
@keyframes orb { from { transform: translateY(0) scale(1); } to { transform: translateY(-5px) scale(1.15); } }
@keyframes wander { from { transform: translate(0, 0); } to { transform: translate(var(--dx), var(--dy)); } }
@keyframes blinkfly { 0%, 100% { opacity: 0; } 40%, 60% { opacity: .95; } }
@keyframes sway-x { from { transform: translateX(-50%) rotate(-2deg); } to { transform: translateX(-50%) rotate(2deg); } }
@keyframes sign-in {
  0% { transform: translateY(-140px) rotate(-7deg); opacity: 0; }
  30% { opacity: 1; }
  50% { transform: translateY(6px) rotate(4deg); }
  68% { transform: translateY(0) rotate(-2.4deg); }
  84% { transform: rotate(1.1deg); }
  100% { transform: none; }
}
@keyframes sign-idle { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(1.4deg); } }
@keyframes swing { 0% { transform: rotate(0); } 22% { transform: rotate(-5deg); } 48% { transform: rotate(3.6deg); } 72% { transform: rotate(-1.6deg); } 100% { transform: rotate(0); } }
@keyframes quest-bob { from { transform: translateY(0); } to { transform: translateY(-7px); } }
@keyframes pop { from { opacity: 0; scale: .6; } to { opacity: 1; scale: 1; } }
@keyframes nudge { 0%, 70%, 100% { translate: 0 0; } 80% { translate: -3px -3px; } 90% { translate: 1px 1px; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade-in { to { opacity: 1; } }
@keyframes nudge-pill { 0%, 100% { transform: scale(1); filter: none; } 50% { transform: scale(1.1); filter: brightness(1.35); } }
@keyframes cave-breathe { from { opacity: .55; transform: scaleY(.94); } to { opacity: 1; transform: scaleY(1.04); } }
@keyframes flicker { from { transform: translateX(-50%) scale(1, 1); } to { transform: translateX(-50%) scale(.9, 1.12); } }
@keyframes k-sway { from { transform: rotate(-1.2deg); } to { transform: rotate(1.2deg); } }
@keyframes k-talk { from { transform: translateY(0) scale(1); } to { transform: translateY(-2%) scale(1.01, .99); } }
@keyframes k-wave { 0% { transform: translateX(calc(-100% * 2 / 6)); } 50% { transform: translateX(calc(-100% * 3 / 6)); } }
@keyframes k-cheer { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9%); } }
@keyframes k-proud { 0%, 100% { transform: rotate(0deg) translateY(0); } 50% { transform: rotate(1.6deg) translateY(-2%); } }
@keyframes k-ready { from { transform: translateY(0) scaleY(1); } to { transform: translateY(1%) scaleY(.98); } }
@keyframes k-hop { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6%); } }
@keyframes k-cycle { from { transform: translateX(0); } to { transform: translateX(-100%); } }
@keyframes k-run { from { transform: translateY(0) rotate(3deg); } to { transform: translateY(-4%) rotate(4deg); } }
@keyframes k-gallop { from { transform: translateY(0); } to { transform: translateY(-3%); } }
@keyframes road-scroll { to { transform: translateX(-36px); } }
@keyframes tl-scroll { to { transform: translateX(calc(var(--tile, 480px) * -1)); } }
@keyframes m-jiggle { from { transform: scale(1.04, .96); } to { transform: scale(.97, 1.03); } }
@keyframes m-breathe { from { transform: scale(1); } to { transform: scale(1.015, .985); } }
@keyframes m-hover { from { transform: translateY(0); } to { transform: translateY(-5%); } }
@keyframes m-hop { 0%, 100% { transform: translateY(0) scale(1.08, .92); } 45% { transform: translateY(-28%) scale(.94, 1.06); } }
@keyframes m-run { from { transform: translateY(0) rotate(-2deg); } to { transform: translateY(-6%) rotate(2deg); } }
@keyframes m-hit { 0% { transform: translateX(0); } 25% { transform: translateX(9%) rotate(5deg); } 60% { transform: translateX(-4%) rotate(-2deg); } 100% { transform: translateX(0); } }
@keyframes m-flash { 0% { filter: brightness(1); } 20% { filter: brightness(2.6) saturate(.4); } 100% { filter: brightness(1); } }
@keyframes shake { 0%, 100% { transform: translate(0, 0); } 20% { transform: translate(-4px, 2px); } 40% { transform: translate(4px, -2px); } 60% { transform: translate(-3px, 1px); } 80% { transform: translate(2px, -1px); } }

/* ------------------------------------------------------------ short phones: keep the sign above the fold */
@media (max-height: 700px) {
  .castle { width: 64px; }
  .spire { width: 40px; }
  .hero { padding-top: 54px; }
  .cta-burst { margin-top: 26px; }
  .sign { min-height: 84px; padding-top: 14px; padding-bottom: 13px; }
  .psst { font-size: 24px; }
  :root { --hill-h: 140px; }
}
/* phones: the handwritten note stays on one line, so Kitty has room under it */
@media (max-width: 719px) {
  .zone-name { font-size: clamp(16px, 5.4vw, 22px); letter-spacing: .04em; }
  .psst { font-size: 24px; left: 9%; }
  .psst .arrow { width: 44px; height: 35px; margin-top: -16px; }
  .psst .psst-text br { display: none; }
}
/* short phones: no room for the note as well as Kitty and her lines; the quest "!" still points at the sign */
@media (max-height: 700px) and (max-width: 719px) {
  .psst { display: none; }
}

/* ------------------------------------------------------------ larger screens */
@media (min-width: 720px) {
  :root { --w: max(236px, min(380px, calc((100svh - 440px) * 0.86), calc(100svh * .3 + 56px))); }
  .hero { padding-top: 76px; }
  .hello { font-size: 20px; }
  .cta-burst { width: 380px; margin-top: 30px; }
  .sign { padding: 20px 76px 19px 30px; min-height: 108px; }
  .sign-title { font-size: 31px; }
  .sign-sub { font-size: 23px; margin-top: 5px; }
  .quest { width: 62px; height: 100px; top: -50px; right: -8px; }
  .quest-mark { font-size: 88px; }
  .battle { font-size: 13.5px; min-height: 34px; padding: 6px 16px 6px 12px; }
  .battle-icon { width: 17px; height: 17px; }
  .bubble { font-size: 16px; max-width: 260px; }
}

@media (min-width: 1000px) {
  .psst { left: calc(100% + 78px); top: 10px; font-size: 32px; width: 230px; }
  .psst .arrow--m { display: none; }
  .psst .arrow--d { display: block; position: absolute; left: -64px; top: 14px; width: 58px; height: 38px; margin: 0; }
  .psst .psst-text { white-space: normal; }
}

@media (max-width: 359px) {
  .sign { padding-right: 52px; }
  .sign-title { font-size: 22px; }
  .battle { font-size: 11.5px; }
}

/* ------------------------------------------------------------ very short viewports (in-app browsers with toolbars):
   shrink the card and trim the space above the sign so the whole sign stays on screen */
@media (max-height: 600px) {
  .bubble { font-size: 13px; padding: 5px 9px 6px; }
  .spire { width: 32px; }
  :root { --w: max(150px, min(calc(100vw - 95px), 380px, 220px, calc((100svh - 300px) * 0.86))); }
  .hero { padding-top: 40px; }
  .plaque { padding-top: 6px; padding-bottom: 8px; }
  .hello { font-size: 15px; }
  .name { font-size: clamp(30px, calc(var(--w) * .15), 58px); }
  .cta-burst { margin-top: 22px; }
  .sign { min-height: 78px; padding-top: 12px; padding-bottom: 11px; }
}

/* ------------------------------------------------------------ calmer motion when asked */
@media (prefers-reduced-motion: reduce) {
  .mist, .star, .ff, .sconce .flame, .quest-mark, .castle .win, .spire .win, .spire .orb,
  .prop--sway, .cave-glow, .flame, .k-body, .mob-body { animation: none !important; }
  .sign-wrap, .sign-sway, .psst { animation: none; }
  .road::before, .treeline, .k-strip, .stage.shake, .mob img, .mob .plate-fill { animation: none !important; transition: none !important; }
  .psst .draw { animation: none; stroke-dashoffset: 0; }
  .psst .head { animation: none; opacity: 1; }
  .sign:hover, .sign:focus-visible, .sign.swing { animation: none; }
  .battle.nudge { animation: none; }
}
