/* One visual world: Mordavia at night. Crypt-black pages, bone-white text, candle gold for
   the hand of the narrator, blood red for the title and the danger. Sections are framed with
   the remake's own UI art (gold skull corners, scroll, wax seal, journal book). */
:root {
  --night: #0b090e;
  --crypt: #15111a;
  --stone: #221c28;
  --bone: #ece1ca;
  --ash: #a89d92;
  --gold: #d2a94e;
  --blood: #b3141c;
  --moss: #6fd17a;
  --amber: #e5a33b;
  --font-display: "UnifrakturCook", "Old English Text MT", Georgia, serif;
  --font-script: "Pinyon Script", "Great Vibes", cursive;
  --font-body: "Alegreya", "Iowan Old Style", Georgia, serif;
  --font-sc: "Alegreya SC", "Alegreya", Georgia, serif;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0; background: var(--night); color: var(--bone);
  font-family: var(--font-body); font-size: 1.125rem; line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--gold); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { text-wrap: balance; margin: 0; font-weight: 400; }
p { margin: 0; }
.wrap { width: min(1180px, 100% - 40px); margin-inline: auto; }
.prose { max-width: 64ch; }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: 60px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 clamp(16px, 3vw, 36px);
  background: linear-gradient(to bottom, rgba(11,9,14,.92), rgba(11,9,14,.72));
  backdrop-filter: blur(8px); border-bottom: 1px solid rgba(210,169,78,.18);
  transition: transform .35s var(--ease-out);
}
.nav.hide { transform: translateY(-100%); }
.brand { font-family: var(--font-display); color: var(--blood); font-size: 1.45rem; text-decoration: none; text-shadow: 0 0 12px rgba(179,20,28,.5); white-space: nowrap; }
.nav ul { display: flex; gap: clamp(10px, 2vw, 26px); list-style: none; margin: 0; padding: 0; }
.nav a.link { font-family: var(--font-sc); font-size: .92rem; letter-spacing: .06em; color: var(--ash); text-decoration: none; position: relative; padding: 6px 0; transition: color .2s; }
.nav a.link::after { content: ""; position: absolute; left: 50%; right: 50%; bottom: 0; height: 1px; background: var(--gold); transition: left .25s var(--ease-out), right .25s var(--ease-out); }
.nav a.link:hover, .nav a.link.on { color: var(--gold); }
.nav a.link:hover::after, .nav a.link.on::after { left: 0; right: 0; }
@media (max-width: 860px) { .nav ul { display: none; } }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; background: #05040a; height: min(56.25vw, 92vh); }
@media (min-width: 900px) { .hero { min-height: 480px; } }
@media (max-width: 899px) { .hero { margin-top: 60px; } }
.hero-img { position: absolute; inset: -4% 0 0 0; width: 100%; height: 108%; object-fit: cover; object-position: center 35%; transform-origin: 50% 30%; animation: drift 28s ease-in-out infinite alternate; will-change: transform; }
@keyframes drift { from { transform: scale(1.02); } to { transform: scale(1.09) translateY(-1.2%); } }
/* desktop: show the whole title art (incl. "Quest for Glory:") below the nav, edges faded into the dark */
@media (min-width: 900px) { .hero-img { top: 54px; bottom: auto; height: calc(104% - 54px); left: 0; right: 0; margin: 0 auto; width: auto; max-width: none; aspect-ratio: 16 / 9; -webkit-mask-image: linear-gradient(to right, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(to right, transparent, #000 10%, #000 90%, transparent); } }
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 38%; background: linear-gradient(to bottom, transparent, var(--night)); pointer-events: none; }
.moonglow { position: absolute; left: 50%; top: 24%; width: 46vw; height: 46vw; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle, rgba(220,225,255,.18), transparent 60%); animation: glow 6s ease-in-out infinite alternate; pointer-events: none; mix-blend-mode: screen; }
@keyframes glow { from { opacity: .45; } to { opacity: 1; } }
.bat { position: absolute; left: 0; top: 0; width: 220px; height: 120px; background: url(/img/anim/badder_fly.webp) 0 0 / 5280px 120px no-repeat; animation: flap .72s steps(24) infinite; pointer-events: none; z-index: 3; filter: drop-shadow(0 6px 10px rgba(0,0,0,.6)); }
.bat.front { width: 178px; background-image: url(/img/anim/badder_front.webp); background-size: 4272px 120px; animation-name: flapf; }
@keyframes flap { to { background-position: -5280px 0; } }
@keyframes flapf { to { background-position: -4272px 0; } }

.intro-band { position: relative; z-index: 2; margin-top: -9vw; padding-bottom: 40px; text-align: center; }
.tagline { font-family: var(--font-script); color: var(--gold); font-size: clamp(2rem, 4.6vw, 3.6rem); line-height: 1.15; text-shadow: 0 2px 20px rgba(0,0,0,.9), 0 0 30px rgba(210,169,78,.25); }
.sub { margin: 14px auto 0; max-width: 58ch; color: var(--ash); font-size: 1.15rem; }
.cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 26px; }
.btn { font-family: var(--font-sc); letter-spacing: .06em; font-size: 1rem; text-decoration: none; padding: 12px 22px; border-radius: 3px; border: 1px solid var(--gold); color: var(--gold); background: rgba(210,169,78,.06); transition: background .2s, color .2s, transform .2s var(--ease-out), box-shadow .2s; }
.btn:hover { background: var(--gold); color: var(--night); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(210,169,78,.25); }
.btn.red { border-color: var(--blood); color: #f0c9c9; background: rgba(179,20,28,.15); }
.btn.red:hover { background: var(--blood); color: #fff; box-shadow: 0 8px 24px rgba(179,20,28,.35); }

/* ---------- section scaffolding ---------- */
section.block { padding: clamp(64px, 9vw, 120px) 0; position: relative; }
.eyebrow { font-family: var(--font-sc); letter-spacing: .14em; font-size: .85rem; color: var(--blood); display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.eyebrow img { width: 22px; height: 22px; }
h2 { font-family: var(--font-display); font-size: clamp(2.3rem, 5vw, 3.6rem); line-height: 1.05; color: var(--bone); }
h2 .script { font-family: var(--font-script); color: var(--gold); font-size: .9em; display: block; margin-top: 4px; }
h3 { font-family: var(--font-sc); font-weight: 700; letter-spacing: .04em; font-size: 1.25rem; color: var(--gold); }
.lede { color: var(--ash); font-size: 1.2rem; margin-top: 18px; }
.divider { height: 32px; background: url(/img/ui/gold_strip.webp) center / auto 32px repeat-x; opacity: .85; -webkit-mask: linear-gradient(90deg, transparent, #000 20%, #000 80%, transparent); mask: linear-gradient(90deg, transparent, #000 20%, #000 80%, transparent); }
.reveal { transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); }
.js .reveal.pre { opacity: .25; transform: translateY(28px); }

/* ---------- tribute ---------- */
.tribute { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.tribute .prose p + p { margin-top: 16px; }
.scroll { position: relative; aspect-ratio: 600 / 367; background: url(/img/ui/scroll.webp) center / 100% 100% no-repeat; container-type: inline-size; filter: drop-shadow(0 20px 40px rgba(0,0,0,.6)); }
.scroll blockquote { position: absolute; inset: 22% 14% 14% 14%; margin: 0; display: flex; flex-direction: column; justify-content: center; color: #3a2a1a; font-size: clamp(.8rem, 3.6cqw, 1.2rem); line-height: 1.45; font-style: italic; }
.scroll cite { margin-top: .6em; font-family: var(--font-script); font-style: normal; font-size: 1.5em; color: #7a1d14; text-align: right; }
.typed .caret { display: inline-block; width: 1px; height: 1em; background: #3a2a1a; vertical-align: -2px; animation: blink 1s steps(2) infinite; }
@keyframes blink { to { opacity: 0; } }
@media (max-width: 860px) { .tribute { grid-template-columns: 1fr; } }

.stats { margin-top: clamp(56px, 7vw, 90px); display: grid; grid-template-columns: repeat(5, 1fr); border-block: 1px solid rgba(210,169,78,.25); }
.stat { padding: 26px 12px; text-align: center; }
.stat + .stat { border-left: 1px solid rgba(210,169,78,.15); }
.stat b { display: block; font-family: var(--font-display); font-weight: 400; font-size: clamp(2.2rem, 4vw, 3.2rem); color: var(--gold); line-height: 1; font-variant-numeric: tabular-nums; }
.stat span { display: block; margin-top: 8px; font-family: var(--font-sc); font-size: .85rem; letter-spacing: .06em; color: var(--ash); }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, 1fr); } .stat:nth-child(odd) { border-left: 0; } .stat:last-child { grid-column: span 2; } }

/* ---------- before / after ---------- */
.compare-wrap { position: relative; margin-top: 40px; padding: 10px; }
.corner { position: absolute; width: clamp(70px, 10vw, 130px); aspect-ratio: 337 / 392; background: url(/img/ui/gold_corner.webp) 0 0 / 100% 100% no-repeat; z-index: 6; pointer-events: none; filter: drop-shadow(0 4px 8px rgba(0,0,0,.7)); }
.corner.tl { top: -18px; left: -18px; }
.corner.tr { top: -18px; right: -18px; transform: scaleX(-1); }
.corner.bl { bottom: -18px; left: -18px; transform: scaleY(-1); }
.corner.br { bottom: -18px; right: -18px; transform: scale(-1, -1); }
.compare { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 2px; background: #000; touch-action: pan-y; cursor: ew-resize; user-select: none; box-shadow: 0 30px 80px rgba(0,0,0,.7), 0 0 0 1px rgba(210,169,78,.35); }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.compare .after { clip-path: inset(0 0 0 var(--pos, 50%)); }
.compare .handle { position: absolute; top: 0; bottom: 0; left: var(--pos, 50%); width: 2px; background: linear-gradient(var(--gold), #fff3c9, var(--gold)); transform: translateX(-1px); z-index: 4; box-shadow: 0 0 16px rgba(210,169,78,.8); }
.compare .knob { position: absolute; top: 50%; left: 50%; width: 58px; height: 58px; transform: translate(-50%, -50%); background: url(/img/ui/gem_red.webp) center / contain no-repeat; filter: drop-shadow(0 0 10px rgba(179,20,28,.8)); transition: transform .2s var(--ease-out); }
.compare:hover .knob { transform: translate(-50%, -50%) scale(1.12) rotate(45deg); }
.tag { position: absolute; top: 16px; z-index: 3; font-family: var(--font-sc); letter-spacing: .1em; font-size: .85rem; padding: 4px 12px; background: rgba(8,6,10,.75); border: 1px solid rgba(236,225,202,.25); border-radius: 2px; }
.tag.l { left: 16px; color: var(--ash); }
.tag.r { right: 16px; color: var(--gold); border-color: rgba(210,169,78,.5); }
.compare input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; z-index: 5; }
.compare.swap .after, .compare.swap img { animation: fadein .45s var(--ease-out); }
@keyframes fadein { from { opacity: 0; filter: blur(6px); } }
.room-info { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: baseline; margin-top: 26px; }
.room-info h3 { font-size: 1.5rem; }
.room-info .num { font-family: var(--font-sc); color: var(--blood); font-size: .9rem; letter-spacing: .1em; }
.room-info p { color: var(--ash); grid-column: 1 / -1; max-width: 70ch; }
.thumbs { display: grid; grid-template-columns: repeat(9, 1fr); gap: 10px; margin-top: 26px; }
.thumb { padding: 0; border: 1px solid rgba(236,225,202,.12); background: none; cursor: pointer; border-radius: 2px; overflow: hidden; position: relative; aspect-ratio: 16 / 9; transition: transform .25s var(--ease-out), border-color .2s, box-shadow .25s; }
.thumb img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.6) brightness(.7); transition: filter .25s; }
.thumb:hover { transform: translateY(-3px); }
.thumb:hover img, .thumb[aria-pressed="true"] img { filter: none; }
.thumb[aria-pressed="true"] { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 8px 24px rgba(210,169,78,.25); }
.thumb span { position: absolute; left: 6px; bottom: 4px; font-family: var(--font-sc); font-size: .72rem; color: #fff; text-shadow: 0 1px 4px #000; }
@media (max-width: 760px) { .thumbs { grid-template-columns: repeat(5, 1fr); } }

/* ---------- the intro path ---------- */
.path { position: relative; margin-top: 54px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.path svg.trail { position: absolute; left: 0; right: 0; top: 92px; width: 100%; height: 40px; overflow: visible; pointer-events: none; z-index: 0; }
.trail path { fill: none; stroke: var(--blood); stroke-width: 2; stroke-dasharray: 6 8; opacity: .8; }
.stop { position: relative; z-index: 1; background: linear-gradient(to bottom, var(--stone), var(--crypt)); border: 1px solid rgba(236,225,202,.1); border-radius: 3px; overflow: hidden; transition: transform .3s var(--ease-out), border-color .3s, box-shadow .3s; }
.stop:hover { transform: translateY(-6px); border-color: rgba(210,169,78,.45); box-shadow: 0 18px 40px rgba(0,0,0,.6); }
.stop .pic { aspect-ratio: 16 / 9; overflow: hidden; }
.stop .pic img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease-out); }
.stop:hover .pic img { transform: scale(1.08); }
.stop .body { padding: 18px 18px 22px; display: grid; gap: 10px; }
.stop .step { font-family: var(--font-sc); color: var(--blood); letter-spacing: .1em; font-size: .8rem; }
.stop h3 { color: var(--bone); font-size: 1.15rem; }
.stop p { color: var(--ash); font-size: 1rem; line-height: 1.5; }
.chip { justify-self: start; display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-sc); font-size: .78rem; letter-spacing: .06em; padding: 3px 10px; border-radius: 20px; border: 1px solid currentColor; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.chip.done { color: var(--moss); }
.chip.test { color: var(--amber); }
.chip.plan { color: var(--ash); }
@media (max-width: 960px) { .path { grid-template-columns: repeat(2, 1fr); } .path svg.trail { display: none; } }
@media (max-width: 520px) { .path { grid-template-columns: 1fr; } }

/* ---------- the hero ---------- */
.stage { position: relative; margin-top: 46px; padding: 30px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: end; isolation: isolate; }
.stage::before { content: ""; position: absolute; inset: 15% 5% -6% 5%; background: radial-gradient(ellipse at 50% 85%, rgba(229,163,59,.22), transparent 62%); z-index: -1; }
.stage::after { content: ""; position: absolute; left: 6%; right: 6%; bottom: 52px; height: 30px; background: radial-gradient(ellipse, rgba(0,0,0,.75), transparent 70%); z-index: -1; }
.cls { position: relative; display: grid; justify-items: center; gap: 12px; text-align: center; cursor: default; }
.cls img.fig { height: clamp(260px, 34vw, 430px); width: auto; object-fit: contain; transition: transform .45s var(--ease-out), filter .45s; filter: drop-shadow(0 12px 18px rgba(0,0,0,.6)) brightness(.88); }
.cls:hover img.fig { transform: translateY(-12px) scale(1.04); filter: drop-shadow(0 22px 26px rgba(0,0,0,.6)) drop-shadow(0 0 22px rgba(229,163,59,.35)) brightness(1.05); }
.cls .name { font-family: var(--font-script); font-size: 2.2rem; color: var(--gold); line-height: 1; }
.cls .badge { width: 46px; height: 46px; object-fit: contain; position: absolute; right: 14%; top: 18%; opacity: 0; transform: scale(.6) rotate(-20deg); transition: opacity .3s, transform .4s var(--ease-out); }
.cls:hover .badge { opacity: 1; transform: none; }
.hero-story { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 64px; }
.card { background: linear-gradient(to bottom, var(--stone), var(--crypt)); border: 1px solid rgba(236,225,202,.1); border-radius: 3px; padding: 22px; display: grid; gap: 14px; align-content: start; }
.card .media { aspect-ratio: 4 / 3; border-radius: 2px; overflow: hidden; background: radial-gradient(circle at 50% 60%, #2c2532, #120f16); display: grid; place-items: center; position: relative; }
.card .media img { max-height: 100%; object-fit: contain; }
.card .media.cover img { width: 100%; height: 100%; object-fit: cover; }
.card p { color: var(--ash); font-size: 1rem; line-height: 1.55; }
.media .flybat { position: static; transform: scale(1.3); }
@media (max-width: 860px) { .stage { grid-template-columns: 1fr 1fr 1fr; gap: 6px; } .cls .name { font-size: 1.6rem; } .hero-story { grid-template-columns: 1fr; } }

/* ---------- voices ---------- */
.voices { display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(32px, 5vw, 70px); align-items: center; }
.portrait { position: relative; border-radius: 50% 50% 4px 4px / 34% 34% 4px 4px; overflow: hidden; box-shadow: 0 0 0 1px rgba(210,169,78,.4), 0 0 0 10px var(--crypt), 0 0 0 11px rgba(210,169,78,.25), 0 30px 70px rgba(0,0,0,.7); }
.portrait img { width: 100%; aspect-ratio: 1; object-fit: cover; animation: breathe 7s ease-in-out infinite alternate; }
@keyframes breathe { from { transform: scale(1.0); } to { transform: scale(1.05) translateY(-1%); } }
.portrait::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 70% 30%, rgba(255,170,80,.18), transparent 50%); mix-blend-mode: screen; animation: flick 3s ease-in-out infinite alternate; }
.portrait.talking video { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: #120f16; }
.portrait.talking video::cue { font-family: var(--font-body); font-size: 1rem; background: rgba(8,6,10,.78); color: var(--bone); }
.portrait .play { position: absolute; inset: 0; display: grid; justify-items: center; align-content: end; gap: 8px; padding-bottom: 7%; border: 0; background: linear-gradient(to bottom, transparent 50%, rgba(8,6,10,.75)); cursor: pointer; color: var(--gold); transition: background .3s; }
.portrait .play:hover { background: linear-gradient(to bottom, transparent 55%, rgba(8,6,10,.6)); }
.portrait .play .ring { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--gold); background: rgba(11,9,14,.6); box-shadow: 0 0 0 0 rgba(210,169,78,.5); animation: pulse 2.4s ease-out infinite; transition: transform .25s var(--ease-out); }
.portrait .play:hover .ring { transform: scale(1.1); }
.portrait .play svg { width: 28px; height: 28px; fill: var(--gold); margin-left: 4px; }
.portrait .play .lbl { font-family: var(--font-script); font-size: 2rem; text-shadow: 0 2px 10px #000; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(210,169,78,.45); } 100% { box-shadow: 0 0 0 22px rgba(210,169,78,0); } }
.portrait.playing .play { opacity: 0; pointer-events: none; }
.portrait.talking figcaption { display: none; }
.portrait.playing::after { opacity: 0; }
.portrait figcaption { transition: opacity .3s; pointer-events: none; }
.portrait figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 20px 16px; background: linear-gradient(transparent, rgba(0,0,0,.85)); font-family: var(--font-script); font-size: 2rem; color: var(--gold); text-align: center; }
.rows { display: grid; gap: 4px; margin-top: 26px; }
.row { display: grid; grid-template-columns: 34px 1fr; gap: 16px; padding: 16px 0; border-top: 1px solid rgba(236,225,202,.1); }
.row:last-child { border-bottom: 1px solid rgba(236,225,202,.1); }
.row p { color: var(--ash); font-size: 1rem; }
.row b { color: var(--bone); font-weight: 500; }
.wave { display: flex; align-items: center; gap: 3px; height: 28px; padding-top: 4px; }
.wave i { width: 3px; height: 12px; border-radius: 2px; background: var(--gold); animation: wave 1.1s ease-in-out infinite; }
.wave i:nth-child(2) { animation-delay: -.2s; } .wave i:nth-child(3) { animation-delay: -.45s; } .wave i:nth-child(4) { animation-delay: -.7s; }
@keyframes wave { 0%, 100% { height: 5px; } 50% { height: 22px; } }
@media (max-width: 860px) { .voices { grid-template-columns: 1fr; } .portrait { max-width: 420px; } }

/* ---------- journal ---------- */
.book-wrap { margin-top: 44px; }
.book { position: relative; aspect-ratio: 1000 / 584; background: url(/img/art/ui_book.webp) center / 100% 100% no-repeat; container-type: inline-size; filter: drop-shadow(0 30px 50px rgba(0,0,0,.7)); max-width: 1000px; margin-inline: auto; }
.page { position: absolute; color: #3b2a19; overflow: hidden; }
.page { top: 8.4%; bottom: 11%; }
.page.l { left: 12.7%; width: 31%; }   /* journal.json pages[0] = 270,105 .. 930,1110 */
.page.r { left: 52.8%; width: 31.6%; } /* journal.json pages[1] = 1125,105 .. 1800,1110 */
.page .ptitle { font-family: var(--font-script); color: #8a5a12; font-size: 6.2cqw; line-height: 1.05; text-shadow: 0 1px 0 rgba(255,240,200,.6); }
.page .pkicker { font-family: var(--font-sc); font-size: 1.45cqw; letter-spacing: .12em; color: #8b1d16; margin-top: 1.4cqw; }
.page .ptext { font-size: 1.75cqw; line-height: 1.55; margin-top: 1.6cqw; }
.page ul { margin: 0; padding-left: 1.1em; font-size: 1.75cqw; line-height: 1.55; }
.page ul li + li { margin-top: .5cqw; }
.page.flip { animation: pagein .5s var(--ease-out); }
@keyframes pagein { from { opacity: 0; transform: translateX(14px); filter: blur(3px); } }
.coins { position: absolute; inset: 0; pointer-events: none; }
/* each coin is centred on its brass plate (journal.json tabs[].at), 104 px of 2132 wide */
.coin { position: absolute; left: var(--x); top: var(--y); width: 4.88cqw; height: 4.88cqw; transform: translate(-50%, -50%); border: 0; padding: 0; background: none; cursor: pointer; border-radius: 50%; pointer-events: auto; transition: transform .25s var(--ease-out), filter .25s; filter: brightness(.8) saturate(.85); }
.coin img { width: 100%; height: 100%; }
.coin:hover { transform: translate(-50%, -50%) scale(1.1); filter: none; }
.coin[aria-pressed="true"] { transform: translate(calc(-50% - .47cqw), -50%); filter: drop-shadow(0 0 .8cqw rgba(255,210,120,.85)); }
.book-hint { text-align: center; color: var(--ash); font-size: .95rem; margin-top: 14px; font-style: italic; }
@media (max-width: 640px) {
  .book { background: linear-gradient(#efe1c1, #e2cfa8); border-radius: 4px; aspect-ratio: auto; padding: 20px 20px 24px 78px; box-shadow: inset 0 0 40px rgba(120,80,30,.35); }
  .page { position: static; width: auto !important; }
  .page .ptitle { font-size: 2.2rem; } .page .pkicker { font-size: .8rem; margin-top: 6px; } .page .ptext, .page ul { font-size: 1rem; margin-top: 10px; }
  .coins { inset: auto; left: 12px; top: 18px; display: flex; flex-direction: column; gap: 10px; } .coin, .coin:hover, .coin[aria-pressed="true"] { position: static; transform: none; width: 48px; height: 48px; }
}

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 60px; }
.spells { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.spells img { width: 100%; aspect-ratio: 1; border-radius: 3px; transition: transform .3s var(--ease-out), filter .3s; }
.spells img:hover { transform: scale(1.14) rotate(-3deg); filter: drop-shadow(0 0 14px rgba(140,200,255,.65)) brightness(1.15); position: relative; z-index: 1; }
.ach { position: relative; aspect-ratio: 1000 / 761; background: url(/img/art/ui_parchment.webp) center / 100% 100% no-repeat; display: grid; place-items: center; text-align: center; padding: 12% 14%; color: #3b2a19; container-type: inline-size; }
.ach .t { font-family: var(--font-script); font-size: 15cqw; color: #7a1d14; line-height: 1; }
.ach .d { font-size: 6.4cqw; line-height: 1.35; margin-top: 2cqw; max-width: 80%; margin-inline: auto; }
.ach img.seal { position: absolute; right: 6%; bottom: 4%; width: 26%; transform: rotate(-12deg); animation: stamp 3.6s var(--ease-out) infinite; }
@keyframes stamp { 0%, 12% { transform: scale(2.2) rotate(-30deg); opacity: 0; } 22% { transform: scale(.92) rotate(-12deg); opacity: 1; } 28%, 85% { transform: scale(1) rotate(-12deg); opacity: 1; } 100% { opacity: 0; transform: scale(1) rotate(-12deg); } }
.toast-demo { aspect-ratio: 4 / 3; border-radius: 2px; position: relative; overflow: hidden; background: url(/img/rooms/710_thumb.jpg) center / cover; }
.toast-demo::before { content: ""; position: absolute; inset: 0; background: rgba(8,6,10,.35); }
.skill-note { position: absolute; left: 50%; top: 46%; transform: translateX(-50%); font-family: var(--font-sc); font-size: 1.35rem; color: var(--gold); white-space: nowrap; text-shadow: 0 0 10px #000, 0 0 2px #000; animation: rise 2.8s var(--ease-out) infinite; }
.skill-note:nth-child(2) { animation-delay: 1.4s; color: #9fd7ff; top: 64%; }
@keyframes rise { 0% { opacity: 0; transform: translate(-50%, 18px); } 15% { opacity: 1; transform: translate(-50%, 0); } 60% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -46px); } }
.card.choice { grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: clamp(20px, 4vw, 48px); align-items: center; }
.opts { display: grid; gap: 18px; }
.opt { display: grid; gap: 8px; }
.choice-text { display: grid; gap: 10px; }
.opt p { font-size: .95rem; }
.opt-name { font-family: var(--font-sc); color: var(--bone); font-size: 1.1rem; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.status { font-family: var(--font-body); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 99px; border: 1px solid; }
.status.ok { color: var(--moss); border-color: rgba(111,209,122,.45); }
.status.plan { color: var(--amber); border-color: rgba(229,163,59,.45); }
.pick { display: inline-flex; width: max-content; max-width: 100%; flex-wrap: wrap; border: 1px solid rgba(210,169,78,.35); border-radius: 3px; overflow: hidden; background: rgba(8,6,10,.5); }
.pick span { padding: 7px 14px; font-family: var(--font-sc); font-size: .95rem; color: var(--ash); border-left: 1px solid rgba(210,169,78,.2); animation: segpick 7.5s infinite; }
.pick span:first-child { border-left: 0; }
.pick span:nth-child(2) { animation-delay: 2.5s; }
.pick span:nth-child(3) { animation-delay: 5s; }
.opt:nth-child(2) .pick span { animation-duration: 6s; }
.opt:nth-child(2) .pick span:nth-child(2) { animation-delay: 3s; }
@keyframes segpick { 0%, 30% { background: rgba(210,169,78,.9); color: #1a1208; } 34%, 100% { background: transparent; color: var(--ash); } }
@media (max-width: 960px) { .card.choice { grid-template-columns: 1fr; } }
@media (max-width: 960px) { .features { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .features { grid-template-columns: 1fr; } }

/* ---------- workshop ---------- */
.workshop { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 64px); margin-top: 44px; align-items: start; }
.rules { list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; }
.rules li { display: grid; grid-template-columns: 40px 1fr; gap: 14px; }
.rules .n { font-family: var(--font-display); font-size: 1.9rem; color: var(--blood); line-height: 1; }
.rules b { display: block; color: var(--bone); font-weight: 500; }
.rules span { color: var(--ash); font-size: 1rem; }
.term { background: #08070a; border: 1px solid rgba(236,225,202,.14); border-radius: 6px; overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,.6); }
.term .bar { display: flex; gap: 7px; padding: 10px 12px; background: #16131a; border-bottom: 1px solid rgba(236,225,202,.08); }
.term .bar i { width: 11px; height: 11px; border-radius: 50%; background: #3a3340; }
.term pre { margin: 0; padding: 18px; min-height: 238px; font: 0.88rem/1.6 ui-monospace, "JetBrains Mono", "DejaVu Sans Mono", monospace; color: #cfc6b8; white-space: pre-wrap; overflow-x: auto; }
.term .ok { color: var(--moss); font-weight: 700; }
.term .dim { color: #7c7383; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.tools span { font-family: var(--font-sc); font-size: .82rem; letter-spacing: .04em; padding: 5px 12px; border: 1px solid rgba(210,169,78,.3); border-radius: 2px; color: var(--bone); background: rgba(210,169,78,.05); transition: background .2s, border-color .2s, transform .2s; }
.tools span:hover { background: rgba(210,169,78,.16); border-color: var(--gold); transform: translateY(-2px); }
@media (max-width: 860px) { .workshop { grid-template-columns: 1fr; } }

/* ---------- progress ---------- */
.board { margin-top: 40px; display: grid; gap: 0; border-top: 1px solid rgba(236,225,202,.12); }
.item { display: grid; grid-template-columns: 1fr auto; gap: 8px 20px; padding: 16px 4px; border-bottom: 1px solid rgba(236,225,202,.12); align-items: center; transition: background .2s; }
.item:hover { background: rgba(210,169,78,.04); }
.item b { font-weight: 500; }
.item p { grid-column: 1 / -1; color: var(--ash); font-size: .98rem; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 22px; }
.meter { margin-top: 30px; }
.meter .lbl { display: flex; justify-content: space-between; font-family: var(--font-sc); font-size: .9rem; color: var(--ash); letter-spacing: .05em; }
.segs { margin-top: 10px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.seg { display: grid; gap: 6px; font-family: var(--font-sc); font-size: .8rem; color: var(--ash); letter-spacing: .06em; }
.seg .fill { display: block; height: 14px; border-radius: 3px; background: linear-gradient(90deg, #6b0d12, var(--blood), #e2484f); box-shadow: 0 0 14px rgba(179,20,28,.55); transform-origin: left; transition: transform 1s var(--ease-out); }
.seg:nth-child(2) .fill { transition-delay: .15s; } .seg:nth-child(3) .fill { transition-delay: .3s; } .seg:nth-child(4) .fill { transition-delay: .45s; }
.seg:first-child .fill { background: repeating-linear-gradient(-45deg, #8a5a12 0 8px, var(--amber) 8px 16px); box-shadow: 0 0 14px rgba(229,163,59,.45); animation: march 1.2s linear infinite; }
@keyframes march { to { background-position: 22.6px 0; } }
.js .seg .fill.pre { transform: scaleX(0); }

/* ---------- road ahead ---------- */
.road { margin-top: 44px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; counter-reset: r; }
.leg { border-top: 2px solid var(--blood); padding-top: 18px; display: grid; gap: 10px; align-content: start; }
.leg:nth-child(n+2) { border-top-color: rgba(179,20,28,.45); }
.leg:nth-child(n+3) { border-top-style: dashed; }
.leg .when { font-family: var(--font-script); color: var(--gold); font-size: 2rem; line-height: 1; }
.leg ul { margin: 0; padding-left: 1.1em; color: var(--ash); font-size: 1rem; display: grid; gap: 6px; }
@media (max-width: 860px) { .road { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .road { grid-template-columns: 1fr; } }

/* ---------- the Adventurers' Guild (GitHub Discussions via giscus) ---------- */
.forum { margin-top: 40px; padding: clamp(18px, 3vw, 34px); background: linear-gradient(to bottom, var(--stone), var(--crypt)); border: 1px solid rgba(210,169,78,.25); border-radius: 3px; box-shadow: 0 24px 60px rgba(0,0,0,.5); min-height: 160px; }
.forum-wait { color: var(--ash); font-style: italic; text-align: center; padding: 40px 0; }

/* ---------- footer ---------- */
footer { position: relative; overflow: hidden; padding: 90px 0 50px; text-align: center; background: radial-gradient(ellipse at 50% 120%, rgba(179,20,28,.18), transparent 60%), var(--night); border-top: 1px solid rgba(210,169,78,.15); }
footer .script { font-family: var(--font-script); font-size: clamp(2rem, 5vw, 3.2rem); color: var(--gold); line-height: 1.1; }
footer p { color: var(--ash); max-width: 70ch; margin: 16px auto 0; font-size: .98rem; }
footer .fine { font-size: .82rem; color: #7c7383; margin-top: 30px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal.pre, .js .seg .fill.pre { opacity: 1; transform: none; }
  .bat { display: none; }
}

/* ---------- the Chronicle (update posts): teaser cards on the main page + chronicle.html ---------- */
.teasers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 40px; }
.post-card { display: grid; grid-template-rows: auto 1fr; text-decoration: none; color: inherit; background: linear-gradient(to bottom, var(--stone), var(--crypt)); border: 1px solid rgba(236,225,202,.1); border-radius: 3px; overflow: hidden; transition: transform .3s var(--ease-out), border-color .3s, box-shadow .3s; }
.post-card:hover { transform: translateY(-6px); border-color: rgba(210,169,78,.45); box-shadow: 0 18px 40px rgba(0,0,0,.6); }
.post-card .pic { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: radial-gradient(circle at 50% 60%, #2c2532, #120f16); display: grid; place-items: center; }
.post-card .pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease-out); }
.post-card .pic img.fit { object-fit: contain; padding: 10px; }
.post-card:hover .pic img { transform: scale(1.06); }
.post-card .body { padding: 18px 18px 22px; display: grid; gap: 10px; align-content: start; }
.post-card h3 { color: var(--bone); font-size: 1.15rem; }
.post-card p { color: var(--ash); font-size: 1rem; line-height: 1.5; }
.post-card .more { font-family: var(--font-sc); color: var(--gold); font-size: .85rem; letter-spacing: .06em; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-family: var(--font-sc); font-size: .8rem; letter-spacing: .08em; color: var(--blood); }
.meta time { font-variant-numeric: tabular-nums; }
.tagchip { font-family: var(--font-sc); font-size: .74rem; letter-spacing: .06em; color: var(--gold); border: 1px solid rgba(210,169,78,.35); border-radius: 20px; padding: 1px 9px; background: rgba(210,169,78,.06); }
.teaser-foot { margin-top: 30px; display: flex; justify-content: center; }
@media (max-width: 960px) { .teasers { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .teasers { grid-template-columns: 1fr; } }

.page-head { padding: 130px 0 30px; position: relative; overflow: hidden; }
.page-head::before { content: ""; position: absolute; inset: 0; background: url(/img/rooms/250_after.jpg) center 30% / cover; opacity: .16; -webkit-mask: linear-gradient(to bottom, #000 30%, transparent); mask: linear-gradient(to bottom, #000 30%, transparent); }
.page-head .wrap { position: relative; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.filter { font-family: var(--font-sc); font-size: .85rem; letter-spacing: .06em; padding: 5px 14px; border-radius: 20px; border: 1px solid rgba(210,169,78,.3); background: transparent; color: var(--ash); cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.filter:hover { color: var(--gold); border-color: var(--gold); }
.filter[aria-pressed="true"] { background: var(--gold); color: var(--night); border-color: var(--gold); }
.posts { display: grid; gap: 22px; margin-top: 36px; padding-bottom: 90px; }
.post-row { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); text-decoration: none; color: inherit; background: linear-gradient(to right, var(--stone), var(--crypt)); border: 1px solid rgba(236,225,202,.1); border-radius: 3px; overflow: hidden; transition: transform .3s var(--ease-out), border-color .3s, box-shadow .3s; }
.post-row:hover { transform: translateX(6px); border-color: rgba(210,169,78,.45); box-shadow: 0 18px 40px rgba(0,0,0,.5); }
.post-row .pic { background: radial-gradient(circle at 50% 60%, #2c2532, #120f16); display: grid; place-items: center; min-height: 170px; }
.post-row .pic img { width: 100%; height: 100%; object-fit: cover; }
.post-row .pic img.fit { object-fit: contain; padding: 12px; max-height: 220px; }
.post-row .body { padding: 22px 26px; display: grid; gap: 10px; align-content: center; }
.post-row h2 { font-family: var(--font-sc); font-weight: 700; font-size: 1.45rem; color: var(--bone); letter-spacing: .02em; }
.post-row p { color: var(--ash); max-width: 70ch; }
@media (max-width: 720px) { .post-row { grid-template-columns: 1fr; } .post-row .pic { aspect-ratio: 16 / 9; min-height: 0; } }

.post-full { padding-bottom: 60px; }
.post-full .back { font-family: var(--font-sc); letter-spacing: .06em; font-size: .9rem; color: var(--gold); text-decoration: none; }
.post-full .back:hover { text-decoration: underline; }
.post-full h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(2.3rem, 5vw, 3.4rem); line-height: 1.08; margin-top: 14px; text-wrap: balance; }
.post-full .hero-pic { margin: 28px 0 30px; border-radius: 3px; overflow: hidden; box-shadow: 0 0 0 1px rgba(210,169,78,.3), 0 30px 70px rgba(0,0,0,.6); background: radial-gradient(circle at 50% 60%, #2c2532, #120f16); }
.post-full .hero-pic img { width: 100%; max-height: 520px; object-fit: cover; }
.post-full .hero-pic img.fit { object-fit: contain; max-height: 420px; padding: 20px; margin-inline: auto; width: auto; }
.post-full .text { max-width: 66ch; display: grid; gap: 18px; font-size: 1.15rem; }
.post-full .text p:first-child::first-letter { font-family: var(--font-display); float: left; font-size: 3.4em; line-height: .8; padding: 6px 10px 0 0; color: var(--blood); }
.post-nav { display: flex; justify-content: space-between; gap: 16px; margin-top: 50px; padding-top: 22px; border-top: 1px solid rgba(236,225,202,.12); }
.post-nav a { text-decoration: none; color: var(--ash); max-width: 45%; display: grid; gap: 4px; }
.post-nav a span { font-family: var(--font-sc); font-size: .8rem; letter-spacing: .08em; color: var(--blood); }
.post-nav a b { color: var(--bone); font-weight: 500; }
.post-nav a:hover b { color: var(--gold); }
.post-nav .next { text-align: right; margin-left: auto; }
.discuss { margin-top: 56px; }
.discuss h2 { font-size: clamp(1.8rem, 3.6vw, 2.4rem); }
@media (prefers-reduced-motion: reduce) { .pick span:first-child { background: rgba(210,169,78,.9); color: #1a1208; } }
