:root {
  --dungeon-ink: #17121F;
  --quest-parchment: #EADCB8;
  --acid-moss: #B7F23A;
  --goblin-violet: #7D4DFF;
  --coin-bruise: #C89B2C;
  --lantern-coral: #FF6B5A;
  --cold-cyan: #5BE7E0;
  --title-font: "Grenze Gotisch", serif;
  --body-font: "Chivo", sans-serif;
  --monster-font: "Cherry Bomb One", system-ui;
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  min-height: 100%;
  overflow: hidden;
  background: var(--dungeon-ink);
  color: var(--quest-parchment);
  font-family: var(--body-font);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 14% 20%, rgba(125, 77, 255, .24), transparent 28%),
    radial-gradient(circle at 82% 72%, rgba(255, 107, 90, .2), transparent 26%),
    radial-gradient(circle at 50% 50%, transparent 0 38%, rgba(23, 18, 31, .72) 72%),
    repeating-linear-gradient(78deg, rgba(234, 220, 184, .035) 0 1px, transparent 1px 9px);
  mix-blend-mode: screen;
  z-index: 4;
}

button {
  color: inherit;
  font: inherit;
}

.quest-scroll {
  height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
}

.chamber {
  position: relative;
  min-height: 100vh;
  scroll-snap-align: start;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 10% 80%, rgba(91, 231, 224, .1), transparent 20rem),
    linear-gradient(135deg, #17121F 0%, #241936 45%, #17121F 100%);
}

.chamber::before {
  content: "";
  position: absolute;
  inset: 3vmin;
  border: 2px solid rgba(234, 220, 184, .18);
  clip-path: polygon(2% 7%, 96% 3%, 98% 88%, 87% 96%, 12% 92%, 4% 82%);
  pointer-events: none;
}

.chamber::after {
  content: "¤ △ ✦ ◇ ✕ ¤ △ ✦ ◇ ✕";
  position: absolute;
  inset: auto -10vw 4vh auto;
  width: 70vw;
  color: rgba(183, 242, 58, .12);
  font-family: var(--title-font);
  font-size: clamp(2rem, 6vw, 6rem);
  letter-spacing: .35em;
  transform: rotate(-13deg);
  pointer-events: none;
}

.map-pins {
  position: fixed;
  right: 2.2vmin;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  display: grid;
  gap: .65rem;
}

.map-pin {
  width: 5.7rem;
  padding: .45rem .55rem;
  border: 2px solid var(--coin-bruise);
  background: linear-gradient(120deg, rgba(234, 220, 184, .94), rgba(200, 155, 44, .9));
  color: var(--dungeon-ink);
  border-radius: 44% 56% 51% 49% / 64% 35% 65% 36%;
  font-family: var(--monster-font);
  font-size: .86rem;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: .2rem .3rem 0 rgba(23, 18, 31, .6);
  transform: rotate(var(--pin-tilt, -4deg));
  transition: transform .25s ease, background .25s ease;
}

.map-pin:nth-child(even) { --pin-tilt: 5deg; }
.map-pin.is-active { background: var(--acid-moss); transform: rotate(0deg) scale(1.08); }

h1,
h2,
.orbit,
.moon-token {
  font-family: var(--title-font);
  font-weight: 900;
}

.story-scrap {
  position: absolute;
  z-index: 5;
  width: min(33rem, 44vw);
  padding: 1.2rem 1.35rem 1.4rem;
  color: var(--dungeon-ink);
  background:
    linear-gradient(140deg, rgba(234, 220, 184, .98), rgba(234, 220, 184, .84)),
    repeating-linear-gradient(-6deg, rgba(200, 155, 44, .22) 0 1px, transparent 1px 8px);
  border: 3px solid var(--coin-bruise);
  box-shadow: .8rem .8rem 0 rgba(23, 18, 31, .45), inset 0 0 2.2rem rgba(200, 155, 44, .2);
  clip-path: polygon(1% 9%, 15% 3%, 31% 7%, 53% 1%, 73% 6%, 97% 3%, 94% 30%, 99% 48%, 94% 70%, 97% 95%, 72% 92%, 51% 98%, 28% 93%, 5% 97%, 8% 72%, 2% 50%, 7% 28%);
}

.story-scrap h2 {
  margin: .1rem 0 .45rem;
  font-size: clamp(2.2rem, 4.8vw, 5rem);
  line-height: .82;
  color: var(--dungeon-ink);
}

.story-scrap p {
  margin: 0;
  font-size: clamp(1rem, 1.35vw, 1.25rem);
  line-height: 1.45;
}

.seed-line {
  margin-top: .55rem !important;
  color: var(--goblin-violet);
  font-weight: 800;
}

.stamp {
  display: inline-block;
  margin-bottom: .4rem !important;
  padding: .18rem .55rem;
  background: var(--lantern-coral);
  color: var(--dungeon-ink);
  border: 2px dashed var(--dungeon-ink);
  font-family: var(--monster-font);
  transform: rotate(-3deg);
}

.crooked-path {
  position: absolute;
  z-index: 1;
  height: 11rem;
  width: 115vw;
  left: -7vw;
  border-top: 1.2rem dotted rgba(183, 242, 58, .6);
  transform: rotate(-16deg);
  filter: drop-shadow(0 0 1rem rgba(183, 242, 58, .42));
}

.path-one { top: 58%; }
.path-two { top: 42%; transform: rotate(12deg); }

.price-rune {
  display: inline-grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  margin: -2.6rem 9vw 0;
  border: 3px solid var(--acid-moss);
  border-radius: 50%;
  color: var(--acid-moss);
  background: var(--dungeon-ink);
  font-size: 2rem;
  animation: runePulse 2.7s ease-in-out infinite;
}

.toll-gate {
  background:
    radial-gradient(circle at 78% 16%, rgba(200, 155, 44, .22), transparent 18rem),
    radial-gradient(circle at 26% 84%, rgba(91, 231, 224, .16), transparent 21rem),
    linear-gradient(155deg, #17121F, #26193D 56%, #17121F);
}

.moon-token {
  position: absolute;
  top: 6vh;
  left: 7vw;
  display: grid;
  place-items: center;
  width: clamp(7rem, 13vw, 13rem);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #EADCB8, #C89B2C 55%, #6c4619);
  color: var(--dungeon-ink);
  font-size: clamp(2.3rem, 5vw, 5.4rem);
  box-shadow: 0 0 2rem rgba(200, 155, 44, .48);
  transform: rotate(-12deg);
}

.hanging-title {
  position: absolute;
  top: 3vh;
  left: 50%;
  z-index: 8;
  transform: translateX(-50%);
  text-align: center;
  transform-origin: top center;
  animation: titleSwing 4s ease-in-out infinite;
}

.hanging-title i {
  display: inline-block;
  width: .35rem;
  height: 8vh;
  margin: 0 2.2rem;
  background: repeating-linear-gradient(to bottom, var(--coin-bruise) 0 .35rem, transparent .35rem .7rem);
}

.hanging-title h1 {
  margin: -.4rem 0 0;
  padding: .12em .38em .22em;
  font-size: clamp(4.2rem, 12vw, 13rem);
  line-height: .7;
  letter-spacing: .03em;
  color: var(--quest-parchment);
  text-shadow: .08em .08em 0 var(--goblin-violet), .14em .14em 0 var(--dungeon-ink), 0 0 1.4rem rgba(91, 231, 224, .35);
  background: rgba(23, 18, 31, .55);
  border: 4px solid rgba(234, 220, 184, .2);
  clip-path: polygon(4% 0, 96% 8%, 100% 80%, 88% 100%, 8% 92%, 0 18%);
}

.gate-illustration {
  position: absolute;
  left: 50%;
  bottom: 2vh;
  z-index: 3;
  width: min(78vw, 64rem);
  height: 68vh;
  transform: translateX(-50%);
  perspective: 1100px;
}

.gate-leaf {
  position: absolute;
  bottom: 0;
  width: 50%;
  height: 82%;
  background:
    linear-gradient(90deg, rgba(23, 18, 31, .18), transparent),
    repeating-linear-gradient(90deg, #EADCB8 0 2.6rem, #d7bd76 2.6rem 2.85rem, #C89B2C 2.85rem 3.2rem);
  border: .55rem solid var(--coin-bruise);
  box-shadow: inset 0 0 4rem rgba(23, 18, 31, .55), 0 1rem 2rem rgba(0, 0, 0, .4);
  transition: transform 1.35s cubic-bezier(.18, .8, .2, 1);
}

.gate-leaf.left { left: 0; transform-origin: left center; border-radius: 46% 0 0 8%; }
.gate-leaf.right { right: 0; transform-origin: right center; border-radius: 0 46% 8% 0; }
.gate-illustration.is-open .gate-leaf.left { transform: rotateY(-62deg) rotateZ(-2deg); }
.gate-illustration.is-open .gate-leaf.right { transform: rotateY(62deg) rotateZ(2deg); }

.tag,
.coin,
.hinge {
  position: absolute;
  display: grid;
  place-items: center;
}

.tag {
  width: 7.5rem;
  height: 4.4rem;
  background: var(--lantern-coral);
  border: 3px solid var(--dungeon-ink);
  border-radius: 8% 42% 12% 31%;
  color: var(--dungeon-ink);
  font-family: var(--monster-font);
  box-shadow: .4rem .45rem 0 rgba(23, 18, 31, .35);
}

.tag-a { top: 20%; left: 15%; transform: rotate(-13deg); }
.tag-b { top: 35%; right: 14%; transform: rotate(9deg); background: var(--cold-cyan); }
.hinge { top: 50%; width: 3rem; height: 7rem; background: var(--goblin-violet); font: 900 3rem var(--title-font); color: var(--acid-moss); }
.left .hinge { right: -1.5rem; }
.right .hinge { left: -1.5rem; }
.coin { bottom: 16%; left: 38%; width: 5rem; height: 5rem; border-radius: 50%; background: var(--coin-bruise); color: var(--dungeon-ink); font: 900 3rem var(--title-font); }

.toll-mouth {
  position: absolute;
  bottom: 10%;
  left: 50%;
  z-index: -1;
  transform: translateX(-50%);
  width: 28rem;
  height: 18rem;
  border-radius: 50% 50% 5% 5%;
  background: radial-gradient(circle at 50% 15%, rgba(91, 231, 224, .35), transparent 5rem), #0b0710;
  color: var(--acid-moss);
  font: 400 2rem var(--monster-font);
  display: grid;
  place-items: end center;
  padding-bottom: 2rem;
}

.gate-copy { left: 4vw; bottom: 8vh; transform: rotate(-2deg); }
.choice-token {
  position: absolute;
  z-index: 9;
  border: 3px solid var(--acid-moss);
  border-radius: 999px;
  padding: .7rem 1.1rem;
  background: var(--dungeon-ink);
  color: var(--acid-moss);
  font-family: var(--monster-font);
  box-shadow: 0 0 1.1rem rgba(183, 242, 58, .42), .35rem .45rem 0 rgba(0,0,0,.35);
  cursor: pointer;
  transition: transform .2s ease, background .2s ease;
}
.choice-token:hover,
.choice-token.is-paid { transform: scale(1.08) rotate(-2deg); background: var(--goblin-violet); }
.gate-choice { right: 9vw; bottom: 12vh; }

.inventory-room { background: radial-gradient(circle at 12% 25%, rgba(183,242,58,.13), transparent 16rem), linear-gradient(120deg, #17121F, #211932 70%); }
.inventory-copy { top: 8vh; left: 8vw; transform: rotate(2deg); }
.inventory-tray {
  position: absolute;
  left: 7vw;
  right: 4vw;
  bottom: 14vh;
  z-index: 6;
  display: flex;
  gap: 1.3rem;
  align-items: end;
  min-width: 62rem;
  transform: rotate(-3deg);
}
.inventory-relic {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto auto;
  width: 12rem;
  height: 17rem;
  padding: .8rem;
  border: 4px solid var(--goblin-violet);
  background: linear-gradient(160deg, rgba(234, 220, 184, .96), rgba(200, 155, 44, .75));
  color: var(--dungeon-ink);
  clip-path: polygon(5% 1%, 95% 5%, 100% 76%, 87% 100%, 9% 94%, 0 18%);
  cursor: pointer;
  box-shadow: .7rem .8rem 0 rgba(0,0,0,.35);
  transition: transform .35s ease, filter .35s ease;
}
.inventory-relic:nth-child(even) { transform: translateY(-3rem) rotate(5deg); }
.inventory-relic:nth-child(odd) { transform: rotate(-4deg); }
.inventory-relic.is-chosen { filter: drop-shadow(0 0 1rem var(--cold-cyan)); background: linear-gradient(160deg, #5BE7E0, #EADCB8); }
.inventory-relic:hover { transform: translateY(-1rem) rotate(0deg) scale(1.04); }
.inventory-relic b { font: 900 2.2rem var(--title-font); }
.inventory-relic em { font-style: normal; font-size: .85rem; }
.relic-shape { align-self: center; justify-self: center; width: 5.5rem; height: 5.5rem; background: var(--lantern-coral); border: 3px solid var(--dungeon-ink); box-shadow: inset -.6rem -.6rem 0 rgba(23,18,31,.18); }
.pillow { border-radius: 45% 55% 40% 60%; }
.hand { clip-path: polygon(14% 44%, 27% 18%, 38% 43%, 48% 8%, 60% 43%, 72% 22%, 82% 52%, 69% 92%, 24% 88%); background: var(--cold-cyan); }
.knot { border-radius: 50%; background: conic-gradient(from 20deg, #FF6B5A, #7D4DFF, #C89B2C, #FF6B5A); }
.bell { clip-path: polygon(40% 8%, 60% 8%, 66% 22%, 78% 77%, 90% 87%, 10% 87%, 22% 77%, 34% 22%); background: var(--coin-bruise); }
.tooth { clip-path: polygon(8% 7%, 92% 7%, 69% 100%, 52% 48%, 34% 100%); background: var(--quest-parchment); }
.goblin-note {
  position: absolute;
  right: 9vw;
  top: 18vh;
  z-index: 7;
  max-width: 24rem;
  padding: .8rem 1rem;
  border: 2px dashed var(--cold-cyan);
  color: var(--cold-cyan);
  background: rgba(23, 18, 31, .76);
  font-family: var(--monster-font);
  transform: rotate(-7deg);
}

.bridge-room { background: radial-gradient(circle at 72% 18%, rgba(255,107,90,.2), transparent 18rem), linear-gradient(150deg, #17121F, #291a24); }
.bridge-copy { top: 9vh; right: 10vw; transform: rotate(-2deg); }
.receipt-bridge {
  position: absolute;
  z-index: 6;
  left: 5vw;
  top: 47vh;
  display: flex;
  gap: .45rem;
  transform: rotate(-14deg);
  transform-origin: left center;
}
.receipt-plank {
  position: relative;
  width: 18rem;
  height: 7rem;
  padding: .6rem 1rem;
  border: 3px solid var(--coin-bruise);
  background: repeating-linear-gradient(0deg, #EADCB8 0 .7rem, #ddcb9d .7rem .82rem);
  color: var(--dungeon-ink);
  clip-path: polygon(2% 9%, 92% 0, 100% 23%, 96% 91%, 15% 100%, 0 73%);
  cursor: pointer;
  box-shadow: .55rem .7rem 0 rgba(0,0,0,.38);
  transition: transform .28s ease, background .28s ease;
}
.receipt-plank span { display: block; font: 900 2.1rem var(--title-font); }
.receipt-plank small { font-family: var(--monster-font); color: var(--lantern-coral); }
.receipt-plank.is-cracked { transform: translateY(2.6rem) rotate(7deg); background: linear-gradient(110deg, #EADCB8 46%, #FF6B5A 47% 50%, #EADCB8 51%); }
.receipt-plank.is-chosen { background: linear-gradient(110deg, #B7F23A, #EADCB8); transform: translateY(-1rem) rotate(-3deg); }
.crack-field span {
  position: absolute;
  z-index: 5;
  width: .35rem;
  height: 12rem;
  background: var(--lantern-coral);
  box-shadow: 0 0 1.4rem var(--lantern-coral);
  opacity: .2;
  transform: rotate(var(--crack-tilt));
}
.crack-field.is-lit span { opacity: 1; }
.crack-field span:nth-child(1) { --crack-tilt: 22deg; left: 24vw; top: 62vh; }
.crack-field span:nth-child(2) { --crack-tilt: -18deg; left: 48vw; top: 41vh; height: 16rem; }
.crack-field span:nth-child(3) { --crack-tilt: 35deg; left: 70vw; top: 55vh; }
.crack-field span:nth-child(4) { --crack-tilt: -30deg; left: 38vw; top: 72vh; height: 7rem; }
.bridge-room.cost-time::before { box-shadow: inset 0 -5rem 5rem rgba(91,231,224,.12); }
.bridge-room.cost-trust::before { box-shadow: inset 0 0 5rem rgba(125,77,255,.22); }
.bridge-room.cost-courage::before { box-shadow: inset 0 0 5rem rgba(183,242,58,.18); }

.beast-room { background: radial-gradient(circle at 49% 55%, rgba(125,77,255,.26), transparent 23rem), linear-gradient(135deg, #17121F, #21142b); }
.beast-copy { left: 5vw; top: 8vh; transform: rotate(3deg); }
.beast-glow { position: absolute; inset: 12vh 12vw; border-radius: 50%; background: radial-gradient(circle, rgba(91,231,224,.18), transparent 58%); filter: blur(1rem); }
.appraisal-beast {
  position: absolute;
  z-index: 5;
  right: 12vw;
  top: 22vh;
  width: min(45rem, 58vw);
  height: 35rem;
  animation: beastBreathe 4s ease-in-out infinite;
}
.beast-face {
  position: absolute;
  inset: 20% 21% 9%;
  border: .55rem solid var(--goblin-violet);
  background: radial-gradient(circle at 50% 30%, #5BE7E0, #7D4DFF 58%, #17121F 59%);
  border-radius: 47% 53% 43% 57% / 37% 36% 64% 63%;
  box-shadow: 0 0 2rem rgba(125,77,255,.65), inset 0 -2rem 0 rgba(23,18,31,.4);
}
.beast-horn { position: absolute; top: 4%; width: 9rem; height: 13rem; background: var(--coin-bruise); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.beast-horn.left { left: 22%; transform: rotate(-28deg); }
.beast-horn.right { right: 22%; transform: rotate(28deg); }
.eye { position: absolute; top: 28%; width: 4.2rem; height: 4.2rem; border-radius: 50%; background: var(--acid-moss); box-shadow: inset 1.2rem 0 0 var(--dungeon-ink); }
.eye:first-child { left: 25%; }
.eye:nth-child(2) { right: 25%; }
.decimal-teeth { position: absolute; left: 18%; right: 18%; bottom: 12%; display: flex; justify-content: center; gap: .45rem; }
.decimal-teeth i { width: 3.3rem; height: 4.8rem; padding-top: .55rem; background: var(--quest-parchment); color: var(--dungeon-ink); clip-path: polygon(0 0,100% 0,50% 100%); font: 900 1.1rem var(--monster-font); text-align: center; }
.beast-arm { position: absolute; width: 14rem; height: 4rem; border: .35rem solid var(--coin-bruise); background: var(--quest-parchment); color: var(--dungeon-ink); border-radius: 999px; display: grid; place-items: center; font-family: var(--monster-font); box-shadow: .4rem .4rem 0 rgba(0,0,0,.35); }
.arm-one { left: 0; top: 35%; transform: rotate(-24deg); }
.arm-two { right: 0; top: 31%; transform: rotate(24deg); }
.arm-three { left: 3%; bottom: 12%; transform: rotate(18deg); }
.arm-four { right: 3%; bottom: 14%; transform: rotate(-18deg); }
.orbit { position: absolute; display: grid; place-items: center; width: 6.4rem; height: 6.4rem; border-radius: 50%; background: var(--dungeon-ink); border: 3px solid var(--acid-moss); color: var(--acid-moss); font-size: 1.8rem; animation: orbitDrift 5s linear infinite; }
.orbit-a { left: 2rem; top: 2rem; }
.orbit-b { right: 4rem; top: 0; animation-delay: -1.4s; }
.orbit-c { left: 44%; bottom: -1rem; animation-delay: -2.7s; }
.beast-choice { left: 13vw; bottom: 14vh; }
.speech-bubble { position: absolute; right: 8vw; bottom: 10vh; z-index: 7; max-width: 28rem; padding: 1rem 1.2rem; background: var(--acid-moss); color: var(--dungeon-ink); border: 4px solid var(--dungeon-ink); border-radius: 48% 52% 58% 42% / 48% 38% 62% 52%; font: 1.25rem var(--monster-font); transform: rotate(-4deg) scale(.96); transition: transform .25s ease; }
.speech-bubble.is-stamped { transform: rotate(2deg) scale(1.08); background: var(--lantern-coral); }

.lantern-ending { background: radial-gradient(circle at 50% 50%, rgba(255,107,90,.24), transparent 28rem), linear-gradient(180deg, #17121F, #0c0811); }
.folding-map { position: absolute; inset: 8vh 8vw; display: grid; place-items: center; }
.map-fold { position: absolute; width: 38vw; height: 62vh; background: linear-gradient(130deg, #EADCB8, #C89B2C); border: 4px solid var(--coin-bruise); box-shadow: inset 0 0 3rem rgba(23,18,31,.35); transition: transform 1.1s ease; }
.fold-left { left: 12vw; clip-path: polygon(5% 6%, 100% 0, 88% 100%, 0 92%); transform-origin: right center; }
.fold-right { right: 12vw; clip-path: polygon(0 0, 95% 7%, 100% 91%, 10% 100%); transform-origin: left center; }
.lantern-ending.is-bright .fold-left { transform: rotateY(62deg) rotate(-7deg); }
.lantern-ending.is-bright .fold-right { transform: rotateY(-62deg) rotate(7deg); }
.last-price-lantern { position: relative; z-index: 4; width: 18rem; height: 32rem; display: grid; justify-items: center; filter: drop-shadow(0 0 2rem rgba(255,107,90,.65)); }
.lantern-cap, .lantern-base { width: 12rem; height: 3rem; background: var(--coin-bruise); border: 4px solid var(--dungeon-ink); border-radius: 50%; }
.lantern-light { width: 15rem; height: 23rem; margin: -1rem 0; display: grid; place-items: center; background: radial-gradient(circle, #EADCB8 0 18%, #FF6B5A 42%, rgba(255,107,90,.18) 72%); border: 5px solid var(--coin-bruise); border-radius: 45% 55% 49% 51% / 32% 32% 68% 68%; animation: lanternFlicker 1.9s infinite; }
.lantern-light i { color: var(--dungeon-ink); font: 900 4.4rem var(--title-font); }
.lantern-copy { right: 6vw; bottom: 9vh; transform: rotate(2deg); }
.lantern-choice { left: 9vw; bottom: 12vh; }
.lantern-ending.is-bright .lantern-light { background: radial-gradient(circle, #B7F23A 0 20%, #5BE7E0 38%, #FF6B5A 68%, rgba(255,107,90,.2)); box-shadow: 0 0 7rem rgba(183,242,58,.7); }

.cursor-rune {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  border: 2px solid var(--cold-cyan);
  border-radius: 50%;
  color: var(--acid-moss);
  background: rgba(23, 18, 31, .72);
  pointer-events: none;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 1rem rgba(91, 231, 224, .45);
}
.spark { position: fixed; z-index: 39; pointer-events: none; color: var(--acid-moss); font-family: var(--title-font); animation: sparkFade .65s ease forwards; }

@keyframes runePulse { 50% { transform: scale(1.12) rotate(9deg); box-shadow: 0 0 1.2rem var(--acid-moss); } }
@keyframes titleSwing { 0%, 100% { transform: translateX(-50%) rotate(-1.5deg); } 50% { transform: translateX(-50%) rotate(1.5deg); } }
@keyframes beastBreathe { 50% { transform: translateY(-.8rem) scale(1.02); } }
@keyframes orbitDrift { to { transform: rotate(360deg) translateX(.5rem) rotate(-360deg); } }
@keyframes lanternFlicker { 0%, 100% { opacity: .92; transform: scaleY(1); } 35% { opacity: 1; transform: scaleY(1.04); } 70% { opacity: .86; transform: scaleY(.97); } }
@keyframes sparkFade { to { opacity: 0; transform: translate(var(--sx), var(--sy)) scale(.25) rotate(100deg); } }

@media (max-width: 820px) {
  .map-pins { right: .5rem; }
  .story-scrap { width: min(86vw, 31rem); }
  .gate-copy, .inventory-copy, .bridge-copy, .beast-copy, .lantern-copy { left: 5vw; right: auto; top: auto; bottom: 7vh; }
  .inventory-tray { left: 3vw; bottom: 36vh; transform: rotate(-2deg) scale(.72); transform-origin: left bottom; }
  .receipt-bridge { transform: rotate(-16deg) scale(.62); transform-origin: left center; top: 43vh; }
  .appraisal-beast { right: -8vw; width: 95vw; transform: scale(.78); }
  .appraisal-beast { animation: none; }
  .speech-bubble { right: 4vw; bottom: 29vh; }
  .map-fold { width: 52vw; }
}
