/* Tales of the Duskwhisper
   Three looks built from one set of parts. Night elf pages (.world-elf) are moonlit Teldrassil:
   violet night, silver moonlight, moonwell teal, hanging lanterns. Human pages (.world-storm) are
   Stormwind: blue and gold, lion heraldry, carved stone, with Duskwood's lantern light. The home
   page (.world-home) stands between the two shores. No scripts; all artwork is in /assets/art. */

:root {
  --font-body: "Crimson Pro", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, "Noto Serif", serif;
  --font-elf: "Cormorant Garamond", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --font-storm: "Cinzel", "Trajan Pro", "Palatino Linotype", "Book Antiqua", Georgia, serif;

  --elf-night: #07061a; --elf-deep: #100e2c; --elf-panel: #171438; --elf-panel-2: #221d52;
  --elf-violet: #7c67d9; --elf-lilac: #c3b6ff; --elf-moon: #eef1ff; --elf-silver: #bcc3ea; --elf-mist: #9398c4;
  --elf-teal: #6fe4d0; --elf-gold: #dcbb74; --elf-gold-dim: #8c7846;

  --sw-night: #070b16; --sw-deep: #0d1730; --sw-panel: #132245; --sw-panel-2: #1b2f5c;
  --sw-blue: #2f63b8; --sw-sky: #8fb2ec; --sw-gold: #d9b24f; --sw-gold-bright: #f1d57f; --sw-gold-dim: #8a7232;
  --sw-stone-light: #aab1c2; --sw-ivory: #f0e9d8; --sw-parchment: #d2c8b0; --sw-amber: #ffb347;

  --blood: #c9665a;
}

.world-elf, .world-home {
  --bg: var(--elf-night); --bg-2: var(--elf-deep);
  --panel: var(--elf-panel); --panel-2: var(--elf-panel-2);
  --text: var(--elf-moon); --text-2: var(--elf-silver); --muted: var(--elf-mist);
  --accent: var(--elf-teal); --accent-2: var(--elf-lilac);
  --gold: var(--elf-gold); --gold-dim: var(--elf-gold-dim);
  --font-display: var(--font-elf);
  --glow: 124, 103, 217;
  --line: rgba(220, 187, 116, 0.38);
}
.world-storm {
  --bg: var(--sw-night); --bg-2: var(--sw-deep);
  --panel: var(--sw-panel); --panel-2: var(--sw-panel-2);
  --text: var(--sw-ivory); --text-2: var(--sw-parchment); --muted: var(--sw-stone-light);
  --accent: var(--sw-sky); --accent-2: var(--sw-amber);
  --gold: var(--sw-gold); --gold-dim: var(--sw-gold-dim);
  --font-display: var(--font-storm);
  --glow: 47, 99, 184;
  --line: rgba(217, 178, 79, 0.45);
}
.world-home { --bg: #08091c; --bg-2: #0d1130; --glow: 90, 100, 200; }
.world-horde {
  --bg: #0e0907; --bg-2: #1a100b;
  --panel: #22140d; --panel-2: #30190f;
  --text: #f2e5d3; --text-2: #d6bfa4; --muted: #a68d74;
  --accent: #e2673d; --accent-2: #f2a65a;
  --gold: #d3a24a; --gold-dim: #8d6b2f;
  --font-display: var(--font-storm);
  --glow: 200, 64, 44;
  --line: rgba(211, 162, 74, 0.45);
}
body.world-horde {
  background:
    radial-gradient(1100px 560px at 50% -220px, rgba(200, 64, 44, 0.32), transparent 70%),
    linear-gradient(180deg, #0e0907, #1a100b 38%, #0e0907);
}
.tale-form .opt { color: var(--muted); font-size: 0.8rem; letter-spacing: 0.08em; }
.tale-form input::placeholder, .tale-form textarea::placeholder { color: var(--muted); opacity: 0.7; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 19px;
  line-height: 1.7;
  background: var(--bg);
}
body.world-elf {
  background:
    radial-gradient(1100px 560px at 50% -220px, rgba(124, 103, 217, 0.34), transparent 70%),
    radial-gradient(700px 500px at 0% 45%, rgba(111, 228, 208, 0.06), transparent 70%),
    linear-gradient(180deg, var(--elf-night), var(--elf-deep) 38%, var(--elf-night));
}
body.world-storm {
  /* Stormwind blue, but lit from the side by Duskwood's lanterns */
  background:
    radial-gradient(1100px 560px at 50% -220px, rgba(47, 99, 184, 0.34), transparent 70%),
    radial-gradient(900px 600px at 92% 18%, rgba(255, 179, 71, 0.16), transparent 70%),
    radial-gradient(700px 500px at 6% 80%, rgba(255, 150, 60, 0.08), transparent 70%),
    linear-gradient(180deg, var(--sw-night), #121a33 38%, #0a0d18);
}
.world-storm .prose { box-shadow: inset 0 0 0 5px var(--sw-night), inset 0 0 0 6px var(--sw-gold-dim), 0 0 80px rgba(255, 179, 71, 0.08), 0 26px 60px rgba(0, 0, 0, 0.6); }
body.world-home {
  background: linear-gradient(100deg, #0f0d2c 0%, #090a1f 46%, #090d22 54%, #0d1b38 100%);
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s ease; }
a:hover, a:focus-visible { color: var(--text); }
a:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
img { display: block; }

.skip { position: absolute; left: -999px; top: 8px; padding: 8px 14px; background: var(--gold); color: #000; z-index: 9; }
.skip:focus { left: 8px; }

/* ---- top bar ---------------------------------------------------------------- */
.topbar {
  position: relative; z-index: 3;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: 1120px; margin: 0 auto; padding: 16px 22px 0;
  font-size: 0.74rem; letter-spacing: 0.24em; text-transform: uppercase;
}
.topbar .mark {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-size: 0.92rem; letter-spacing: 0.2em; color: var(--gold);
}
.topbar .mark svg { width: 24px; height: 24px; flex: none; }
.topbar nav a { color: var(--muted); margin-left: 22px; white-space: nowrap; }
.topbar nav a:hover, .topbar nav a:focus-visible { color: var(--gold); }

/* ---- hero: sky, scenery, title --------------------------------------------- */
.hero { position: relative; overflow: hidden; text-align: center; }
.hero .sky, .hero .scene, .hero .fade { position: absolute; inset: 0; pointer-events: none; }
.hero .sky { background: url(/assets/art/stars.svg) 0 0 / 420px 420px repeat; opacity: 0.85; }
.hero .sky::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(300px 300px at 50% 42%, rgba(var(--glow), 0.45), rgba(var(--glow), 0) 70%);
}
.hero .scene { background-repeat: no-repeat; background-size: auto 100%; background-position: left bottom; }
.hero .scene-r { transform: scaleX(-1); }
.hero-elf .scene { background-image: url(/assets/art/boughs.svg); }
.hero-storm .scene { background-image: url(/assets/art/towers.svg); }
.hero-home .scene-l { background-image: url(/assets/art/boughs.svg); }
.hero-home .scene-r { background-image: url(/assets/art/towers.svg); }
.hero .fade { top: auto; height: 140px; background: linear-gradient(180deg, rgba(0, 0, 0, 0), var(--bg)); }

.hero-inner { position: relative; z-index: 1; max-width: 780px; margin: 0 auto; padding: 44px 22px 60px; }
.hero-home .hero-inner { padding: 60px 22px 90px; }
.hero .sigil { width: 118px; height: 118px; margin: 0 auto; filter: drop-shadow(0 0 24px rgba(var(--glow), 0.6)); }
.hero-storm .sigil { width: 104px; height: 114px; filter: drop-shadow(0 0 22px rgba(217, 178, 79, 0.35)); }

.hero h1 {
  margin: 14px 0 6px;
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(2.1rem, 6vw, 3.9rem); line-height: 1.08;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--gold);
  text-shadow: 0 0 34px rgba(var(--glow), 0.55), 0 2px 0 rgba(0, 0, 0, 0.7);
}
.hero-storm h1 { font-size: clamp(1.6rem, 4.6vw, 2.9rem); letter-spacing: 0.14em; }
.hero h1 a { color: inherit; }
.hero .tagline {
  margin: 0; color: var(--text-2); font-style: italic; font-size: 1.12rem; letter-spacing: 0.04em;
}
.hero-home .tagline { font-family: var(--font-storm); font-style: normal; font-size: 0.86rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--accent-2); }

.worlds { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px 22px; margin: 34px 0 0; font-size: 0.8rem; letter-spacing: 0.16em; text-transform: uppercase; }
.worlds a { padding: 10px 18px; border: 1px solid var(--line); border-radius: 999px; color: var(--text-2); background: rgba(8, 9, 28, 0.55); }
.worlds a:hover, .worlds a:focus-visible { color: var(--gold); border-color: var(--gold); }
.worlds .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px var(--gold); }

.crumb { display: inline-block; margin-bottom: 18px; font-size: 0.72rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--accent); }
.medal {
  display: inline-grid; place-items: center;
  width: 78px; height: 78px; margin: 14px auto 0;
  border-radius: 50%; border: 1px solid var(--gold);
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 5px var(--gold-dim), 0 0 34px rgba(var(--glow), 0.55);
  font-family: var(--font-display); font-size: 2rem; color: var(--gold);
  background: radial-gradient(circle at 50% 36%, var(--panel-2), var(--bg) 85%);
}
.world-storm .medal { border-radius: 12% 12% 50% 50% / 12% 12% 62% 62%; font-size: 1.5rem; }
.hero .era { margin: 10px 0 0; font-size: 0.72rem; letter-spacing: 0.26em; text-transform: uppercase; color: var(--accent); }
.epigraph {
  position: relative; max-width: 560px; margin: 20px auto 0; padding: 0 22px;
  font-style: italic; font-size: 1.15rem; color: var(--text-2);
}
.epigraph::before, .epigraph::after {
  position: absolute; top: -14px; font-family: var(--font-elf); font-size: 2.6rem; line-height: 1; color: var(--gold-dim);
}
.epigraph::before { content: "\201C"; left: -4px; }
.epigraph::after { content: "\201D"; right: -4px; }

/* wisps on Teldrassil pages, lantern motes on Stormwind pages */
.wisp {
  position: absolute; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 16px 6px rgba(111, 228, 208, 0.45);
  opacity: 0.6; pointer-events: none;
  animation: drift 24s ease-in-out infinite alternate;
}
.world-storm .wisp { background: var(--sw-amber); box-shadow: 0 0 14px 5px rgba(255, 179, 71, 0.4); animation-duration: 18s; }
.wisp.w1 { left: 12%; top: 64%; }
.wisp.w2 { left: 84%; top: 40%; animation-duration: 31s; animation-delay: -11s; }
.wisp.w3 { left: 56%; top: 78%; width: 4px; height: 4px; animation-duration: 27s; animation-delay: -5s; }
@keyframes drift {
  from { transform: translate(0, 0); opacity: 0.15; }
  50% { opacity: 0.7; }
  to { transform: translate(40px, -90px); opacity: 0.2; }
}
/* one orchestrated page-load reveal: the painting first, then the words, then the shelves */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes appear { from { opacity: 0; } to { opacity: 1; } }
.hero .art, .hero .sky { animation: appear 1.4s ease-out both; }
.hero-inner > * { animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.hero-inner > :nth-child(1) { animation-delay: 0.25s; }
.hero-inner > :nth-child(2) { animation-delay: 0.4s; }
.hero-inner > :nth-child(3) { animation-delay: 0.55s; }
.hero-inner > :nth-child(4) { animation-delay: 0.7s; }
.hero-inner > :nth-child(5) { animation-delay: 0.85s; }
.hero-inner > :nth-child(n+6) { animation-delay: 1s; }
.books > .book, .story > * { animation: rise 1s cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: 0.6s; }
.books > .book:nth-child(2) { animation-delay: 0.8s; }
.books > .book:nth-child(n+3) { animation-delay: 1s; }
.tales li { animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: 0.9s; }
.tales li:nth-child(2) { animation-delay: 1s; }
.tales li:nth-child(3) { animation-delay: 1.1s; }
.tales li:nth-child(4) { animation-delay: 1.2s; }
.tales li:nth-child(5) { animation-delay: 1.3s; }
.tales li:nth-child(6) { animation-delay: 1.4s; }
.tales li:nth-child(n+7) { animation-delay: 1.5s; }

@media (prefers-reduced-motion: reduce) {
  .wisp { animation: none; }
  .tale, a { transition: none; }
  .hero .art, .hero .sky, .hero-inner > *, .books > .book, .story > *, .tales li { animation: none; }
}

/* ---- painted artwork (when the generated images are present) ------------------------- */
.hero.has-art { min-height: 600px; display: grid; align-items: end; }
.hero.has-art .hero-inner { padding-top: 250px; padding-bottom: 54px; }
.hero-home.has-art { min-height: 760px; }
.hero-home.has-art .hero-inner { padding-top: 330px; padding-bottom: 70px; }
.hero .art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.hero .veil {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(4, 4, 14, 0.38) 0%, rgba(4, 4, 14, 0.04) 28%, rgba(4, 4, 14, 0.5) 60%, var(--bg) 100%);
}
.hero.has-art .fade { display: none; }
.hero.has-art h1 { text-shadow: 0 2px 4px #000, 0 0 30px rgba(0, 0, 0, 0.9), 0 0 50px rgba(var(--glow), 0.5); }
.hero.has-art .tagline, .hero.has-art .era, .hero.has-art .crumb, .hero.has-art .epigraph { text-shadow: 0 1px 3px #000, 0 0 18px rgba(0, 0, 0, 0.9); }
.hero.has-art .sigil { filter: drop-shadow(0 2px 4px #000) drop-shadow(0 0 20px rgba(var(--glow), 0.6)); }
.hero.has-art:not(.hero-home) .sigil { display: none; }
.hero.has-art:not(.hero-home) .crumb { display: block; margin-bottom: 14px; }
.hero.has-art:not(.hero-home) .medal { display: grid; margin: 0 auto; }
.hero.has-art .medal { box-shadow: 0 0 0 4px rgba(4, 4, 14, 0.8), 0 0 0 5px var(--gold-dim), 0 0 34px rgba(0, 0, 0, 0.8); }
.hero.has-art .worlds a { background: rgba(4, 4, 14, 0.7); }

.book { overflow: hidden; }
.book .band {
  position: absolute; left: 0; top: 0; width: 100%; height: 340px; object-fit: cover; object-position: center 40%;
  opacity: 0.85; pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 20%, rgba(0, 0, 0, 0.5) 60%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 20%, rgba(0, 0, 0, 0.5) 60%, transparent 100%);
}
.book.has-band { padding-top: 60px; }
.book.has-band .book-head { position: relative; }
.book.has-band .book-head::before {
  content: ""; position: absolute; inset: -40px -60px -20px; z-index: -1; border-radius: 50%;
  background: radial-gradient(closest-side, var(--bg) 40%, rgba(0, 0, 0, 0) 100%); opacity: 0.85;
}
.book.has-band .book-head { z-index: 1; }
.portrait {
  display: block; width: 150px; height: 150px; margin: 0 auto 12px; border-radius: 50%; object-fit: cover; object-position: center 20%;
  border: 2px solid var(--gold); box-shadow: 0 0 0 6px var(--bg), 0 0 0 7px var(--gold-dim), 0 0 44px rgba(var(--glow), 0.6);
}
/* poster cards: the painting fills the card and the words sit over its lower edge */
.tale:has(> .thumb) {
  aspect-ratio: 1 / 1; min-height: 0; width: 100%; align-content: end;
  padding: 20px; border-radius: 6px; overflow: hidden; isolation: isolate;
}
.tale:has(> .thumb) p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.tale:has(> .thumb) h3 { font-size: 1.4rem; }
.tale:has(> .thumb) .thumb {
  position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; margin: 0;
  object-fit: cover; object-position: center 30%; border: 0; border-radius: 0; filter: none;
  transition: transform 0.7s ease;
}
.tale:has(> .thumb)::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgba(5, 5, 16, 0) 34%, rgba(5, 5, 16, 0.55) 62%, rgba(5, 5, 16, 0.95) 100%);
}
.tale:has(> .thumb)::after { z-index: 2; border-color: rgba(255, 255, 255, 0.12); }
.tale:has(> .thumb) > :not(.thumb) { position: relative; z-index: 2; }
.tale:has(> .thumb) .num { grid-row: 1 / span 4; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.8); background: rgba(5, 5, 16, 0.75); }
.tale:has(> .thumb) h3 { text-shadow: 0 1px 3px #000, 0 0 16px rgba(0, 0, 0, 0.9); }
.tale:has(> .thumb) p, .tale:has(> .thumb) .era, .tale:has(> .thumb) .reads { text-shadow: 0 1px 2px #000, 0 0 12px rgba(0, 0, 0, 0.9); }
.tale:has(> .thumb):hover .thumb, .tale:has(> .thumb):focus-visible .thumb { transform: scale(1.05); }
.tales:has(> li:only-child) { grid-template-columns: minmax(290px, 560px); justify-content: center; }
/* an editorial shelf: the first chapter leads, wide, and the rest follow in threes */
#saga .tales li:first-child { grid-column: 1 / -1; }
#saga .tales li:first-child .tale:has(> .thumb) { aspect-ratio: 21 / 9; grid-template-columns: 68px minmax(0, 1fr); align-content: end; }
#saga .tales li:first-child .tale h3 { font-size: 2.2rem; max-width: 18ch; }
#saga .tales li:first-child .tale p { -webkit-line-clamp: 3; max-width: 52ch; }
#saga .tales li:first-child .tale .num { width: 68px; height: 68px; font-size: 1.8rem; }
#saga .tales li:first-child .tale::before { background: linear-gradient(90deg, rgba(5, 5, 16, 0.92) 0%, rgba(5, 5, 16, 0.55) 45%, rgba(5, 5, 16, 0) 75%), linear-gradient(180deg, rgba(5, 5, 16, 0) 50%, rgba(5, 5, 16, 0.7) 100%); }

/* ---- the inn: the home page's living scene with an Alliance and a Horde face ---------------- */
.side-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.inn { position: relative; min-height: clamp(620px, 92vh, 900px); overflow: hidden; display: grid; align-items: end; isolation: isolate; }
.inn-scene { position: absolute; inset: 0; z-index: 0; }
.inn-art {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 60%;
  transition: opacity 1.4s ease; animation: breathe 40s ease-in-out infinite alternate;
}
.inn-art-horde { opacity: 0; }
body:has(#side-horde:checked) .inn-art-horde { opacity: 1; }
body:has(#side-horde:checked) .inn-art-alliance { opacity: 0; }
/* the looping clip sits over its painting and follows the same switch */
.inn-loop { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 60%; transition: opacity 1.4s ease; }
.inn-loop-horde { opacity: 0; }
body:has(#side-horde:checked) .inn-loop-horde { opacity: 1; }
body:has(#side-horde:checked) .inn-loop-alliance { opacity: 0; }
@media (max-width: 759px) { .inn-loop { display: none; } }
@media (prefers-reduced-motion: reduce) { .inn-loop { display: none; } }
@keyframes breathe { from { transform: scale(1) translateX(0); } to { transform: scale(1.07) translateX(-1.5%); } }
.firelight {
  position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen;
  background: radial-gradient(40% 52% at var(--fire-x, 64%) var(--fire-y, 72%), rgba(255, 170, 60, 0.5), rgba(255, 120, 30, 0.16) 40%, rgba(0, 0, 0, 0) 70%);
  animation: flicker 2.6s ease-in-out infinite alternate, flicker-slow 9s ease-in-out infinite;
}
body:has(#side-horde:checked) .firelight { --fire-x: 74%; --fire-y: 74%; }
@keyframes flicker { from { opacity: 0.55; } 35% { opacity: 0.95; } 60% { opacity: 0.7; } to { opacity: 1; } }
@keyframes flicker-slow { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.ember {
  position: absolute; bottom: 14%; left: var(--x); width: 4px; height: 4px; border-radius: 50%;
  background: #ffb347; box-shadow: 0 0 10px 3px rgba(255, 160, 60, 0.6); opacity: 0; pointer-events: none;
  animation: rise-ember var(--t) linear infinite; animation-delay: var(--d);
}
.ember.e1 { --x: 70%; --t: 9s; --d: 0s; }
.ember.e2 { --x: 76%; --t: 12s; --d: -4s; }
.ember.e3 { --x: 82%; --t: 10s; --d: -7s; }
.ember.e4 { --x: 66%; --t: 14s; --d: -2s; width: 3px; height: 3px; }
.ember.e5 { --x: 88%; --t: 11s; --d: -9s; width: 3px; height: 3px; }
.ember.e6 { --x: 73%; --t: 16s; --d: -12s; }
@keyframes rise-ember {
  0% { transform: translate(0, 0) scale(1); opacity: 0; }
  12% { opacity: 0.9; }
  100% { transform: translate(-60px, -75vh) scale(0.3); opacity: 0; }
}
.inn-veil {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(4, 4, 10, 0.45) 0%, rgba(4, 4, 10, 0.05) 30%, rgba(4, 4, 10, 0.35) 65%, var(--bg) 100%);
}
.inn-inner { position: relative; z-index: 1; display: grid; justify-items: center; gap: 22px; padding: 150px 20px 70px; text-align: center; }
.sign {
  position: relative; padding: 26px 44px 22px; max-width: 760px;
  border: 3px solid #3a2410; border-radius: 8px;
  background: linear-gradient(180deg, rgba(74, 46, 22, 0.96), rgba(42, 24, 10, 0.97));
  box-shadow: inset 0 0 0 1px rgba(255, 210, 140, 0.18), inset 0 0 40px rgba(0, 0, 0, 0.5), 0 24px 50px rgba(0, 0, 0, 0.7);
  animation: sway 9s ease-in-out infinite alternate; transform-origin: 50% -140px;
}
@keyframes sway { from { transform: rotate(-0.6deg); } to { transform: rotate(0.6deg); } }
.sign::before, .sign::after {
  content: ""; position: absolute; top: -140px; width: 2px; height: 140px;
  background: repeating-linear-gradient(180deg, #8a7232 0 6px, #3a2410 6px 10px);
}
.sign::before { left: 18%; } .sign::after { right: 18%; }
.inn-head { position: absolute; top: 64px; left: 0; right: 0; z-index: 1; text-align: center; padding: 0 20px; }
.inn-head h1 {
  margin: 0; font-family: var(--font-storm); font-weight: 500; font-size: clamp(1.8rem, 5vw, 3.2rem); line-height: 1.1;
  letter-spacing: 0.26em; text-transform: uppercase; color: var(--sw-gold-bright);
  text-shadow: 0 2px 3px #000, 0 0 30px rgba(0, 0, 0, 0.9), 0 0 40px rgba(255, 200, 120, 0.3);
}
.inn-head p { margin: 8px 0 0; font-family: var(--font-elf); font-style: italic; font-size: 1.15rem; letter-spacing: 0.06em; color: #e6d7b8; text-shadow: 0 1px 3px #000, 0 0 16px rgba(0, 0, 0, 0.9); }
.sign .inn-name {
  margin: 0; font-family: var(--font-elf); font-weight: 500; font-size: clamp(1.9rem, 5.2vw, 3.2rem); line-height: 1.08;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--sw-gold-bright);
  text-shadow: 0 2px 2px #000, 0 0 24px rgba(255, 200, 120, 0.35);
}
.sign .name-horde { display: none; }
body:has(#side-horde:checked) .sign .name-horde { display: inline; }
body:has(#side-horde:checked) .sign .name-alliance { display: none; }
.sign .sign-line { margin: 10px 0 0; font-family: var(--font-storm); font-size: 0.8rem; letter-spacing: 0.3em; text-transform: uppercase; color: #d9c7a3; }
.side-switch {
  display: inline-flex; padding: 4px; border-radius: 999px;
  border: 2px solid var(--sw-gold-dim); background: rgba(8, 6, 4, 0.78);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}
.side {
  display: inline-flex; align-items: center; gap: 10px; padding: 10px 22px; border-radius: 999px; cursor: pointer;
  font-family: var(--font-storm); font-size: 0.8rem; letter-spacing: 0.2em; text-transform: uppercase; color: #a89a86;
  transition: background 0.3s ease, color 0.3s ease;
}
.side img { width: 24px; height: 24px; filter: grayscale(1) opacity(0.6); transition: filter 0.3s ease; }
body:has(#side-alliance:checked) .side-alliance { background: linear-gradient(180deg, #3a74cf, #1f4a93); color: #fff; }
body:has(#side-horde:checked) .side-horde { background: linear-gradient(180deg, #c9452a, #7a1f12); color: #fff; }
body:has(#side-alliance:checked) .side-alliance img, body:has(#side-horde:checked) .side-horde img { filter: none; }
.side-input:focus-visible + .side-input ~ .inn-scene, .side-input:focus-visible ~ .inn-inner .side-switch { outline: 2px solid var(--gold); outline-offset: 4px; }
.inn-hint { margin: 0; font-style: italic; color: #d9c7a3; text-shadow: 0 1px 3px #000; }
/* the whole page follows the side chosen */
body.world-home:has(#side-horde:checked) {
  --bg: #0e0907; --bg-2: #1a100b; --panel: #22140d; --panel-2: #30190f;
  --text: #f2e5d3; --text-2: #d6bfa4; --muted: #a68d74; --accent: #e2673d; --accent-2: #f2a65a;
  --gold: #d3a24a; --gold-dim: #8d6b2f; --glow: 200, 64, 44; --line: rgba(211, 162, 74, 0.45);
  background: linear-gradient(180deg, #0e0907, #1a100b 38%, #0e0907);
}
body.world-home:has(#side-alliance:checked) {
  --bg: #070b16; --bg-2: #0d1730; --panel: #132245; --panel-2: #1b2f5c;
  --text: #f0e9d8; --text-2: #d2c8b0; --muted: #aab1c2; --accent: #8fb2ec; --accent-2: #ffb347;
  --gold: #d9b24f; --gold-dim: #8a7232; --glow: 47, 99, 184; --line: rgba(217, 178, 79, 0.45);
  background: linear-gradient(180deg, #070b16, #0d1730 38%, #070b16);
}

/* ---- the bookshelf -------------------------------------------------------------------- */
.library { max-width: 1000px; margin: -30px auto 0; padding: 0 22px 20px; position: relative; z-index: 2; }
.shelf {
  position: relative; padding: 10px 26px 0;
  border: 8px solid #1b1109; border-radius: 6px;
  background: url(/assets/art/gen/wood-dark-800.webp) center / 420px repeat, #2a1a10;
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.7), inset 0 0 0 2px rgba(255, 200, 120, 0.08), 0 30px 70px rgba(0, 0, 0, 0.65);
}
.shelf::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.1) 30%, rgba(0, 0, 0, 0.45)); }
.row {
  position: relative; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: center; gap: 8px;
  padding: 44px 12px 0; margin-bottom: 22px;
}
/* each book stands on its own slice of board, so a wrapped line of books still rests on wood */
.slot { position: relative; display: flex; align-items: flex-end; }
.slot::after {
  content: ""; position: absolute; left: -5px; right: -5px; bottom: -22px; height: 22px; pointer-events: none;
  background: linear-gradient(180deg, #6b4423, #3a2210 55%, #1b1109);
  box-shadow: inset 0 1px 0 rgba(255, 210, 140, 0.25);
}
.candle { position: relative; width: 16px; height: 62px; margin: 0 10px 0 18px; border-radius: 3px 3px 2px 2px; background: linear-gradient(90deg, #d9c9a6, #fff4d8 40%, #c9b48b); box-shadow: 0 10px 14px rgba(0, 0, 0, 0.6); }
.candle::before { content: ""; position: absolute; left: 50%; top: -22px; width: 10px; height: 22px; margin-left: -5px; border-radius: 50% 50% 45% 45%; background: radial-gradient(ellipse at 50% 70%, #fff6c8, #ffb347 55%, rgba(255, 120, 30, 0) 100%); animation: candle 1.1s ease-in-out infinite alternate; transform-origin: 50% 100%; }
.candle::after { content: ""; position: absolute; left: 50%; top: -60px; width: 120px; height: 120px; margin-left: -60px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 180, 80, 0.35), rgba(255, 180, 80, 0) 65%); pointer-events: none; animation: candle 1.7s ease-in-out infinite alternate; }
@keyframes candle { from { transform: scaleY(1) skewX(0); opacity: 0.85; } 50% { transform: scaleY(1.12) skewX(3deg); opacity: 1; } to { transform: scaleY(0.95) skewX(-2deg); opacity: 0.9; } }
.row::after {
  content: ""; position: absolute; left: -26px; right: -26px; bottom: -22px; height: 22px; pointer-events: none;
  background: linear-gradient(180deg, #6b4423, #3a2210 55%, #1b1109);
  box-shadow: 0 8px 14px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 210, 140, 0.25);
}
.plaque {
  position: absolute; left: 14px; bottom: -18px; z-index: 2; padding: 2px 12px;
  border-radius: 2px; background: linear-gradient(180deg, #e9c66a, #8a7232); color: #1a0f08;
  font-family: var(--font-storm); font-size: 0.62rem; letter-spacing: 0.22em; text-transform: uppercase;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
/* old leather-bound books: grained hide, raised bands, gold tooling, worn head and tail */
.spine {
  --spine: #2b2550; --ink: #d9b56b;
  position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  width: 62px; height: 270px; padding: 10px 0 8px; border-radius: 4px 4px 2px 2px; color: var(--ink);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.28 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E") 0 0 / 120px 120px repeat,
    linear-gradient(90deg, rgba(0, 0, 0, 0.5), rgba(255, 255, 255, 0.12) 14%, rgba(255, 255, 255, 0) 40%, rgba(0, 0, 0, 0.38) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0) 10%, rgba(0, 0, 0, 0) 90%, rgba(0, 0, 0, 0.45)),
    linear-gradient(180deg, rgba(0, 0, 0, 0.5), rgba(255, 255, 255, 0.2)) 0 42px / 100% 5px no-repeat,
    linear-gradient(180deg, rgba(0, 0, 0, 0.5), rgba(255, 255, 255, 0.2)) 0 calc(100% - 48px) / 100% 5px no-repeat,
    var(--spine);
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(0, 0, 0, 0.6), inset -5px 0 10px rgba(0, 0, 0, 0.45), inset 4px 0 6px rgba(255, 255, 255, 0.06), 3px 0 0 rgba(0, 0, 0, 0.4), 0 12px 18px rgba(0, 0, 0, 0.6);
  filter: saturate(0.82);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.spine::before {
  content: ""; flex: none; width: 70%; height: 16px; opacity: 0.9;
  border-top: 3px double var(--ink); border-bottom: 1px solid var(--ink);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23d9b56b' d='M12 3c3.2 3.6 3.2 10.4 0 14-3.2-3.6-3.2-10.4 0-14zM3 12l4-1.6v3.2zM21 12l-4-1.6v3.2z'/%3E%3C/svg%3E") center / 11px 11px no-repeat;
}
.row .slot .spine:hover, .row .slot .spine:focus-visible { transform: translateY(-16px) rotate(-1.2deg); color: #f3dc8c; box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(0, 0, 0, 0.6), 3px 0 0 rgba(0, 0, 0, 0.4), 0 26px 30px rgba(0, 0, 0, 0.7); filter: none; }
.spine-title {
  writing-mode: vertical-rl; transform: rotate(180deg);
  font-family: var(--font-elf); font-weight: 500; font-size: 0.94rem; letter-spacing: 0.05em; line-height: 1;
  max-height: 182px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  text-shadow: 0 1px 0 rgba(255, 235, 180, 0.22), 0 -1px 0 rgba(0, 0, 0, 0.75);
}
.spine-num { width: 70%; padding: 6px 0 5px; border-top: 1px solid var(--ink); border-bottom: 3px double var(--ink); text-align: center; font-family: var(--font-storm); font-size: 0.72rem; letter-spacing: 0.08em; opacity: 0.9; }
.spine.tome { width: 78px; height: 288px; --spine: #182a4c; }
.spine.tome .spine-title { font-family: var(--font-storm); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; max-height: 200px; }
.spine.reader { height: 250px; }
.spine.blank { --spine: #4a3a2a; --ink: #c9b58f; height: 256px; border: 1px dashed rgba(233, 216, 166, 0.45); }
.spine.tone-1 { --spine: #2b2550; }
.spine.tone-2 { --spine: #4a1d24; }
.spine.tone-3 { --spine: #1d3350; }
.spine.tone-4 { --spine: #2d3b25; }
.spine.tone-5 { --spine: #5a3a1a; }
.spine.tone-6 { --spine: #3d2448; }
.spine.tone-2, .spine.tone-5 { height: 278px; }
.spine.tone-4 { height: 262px; }
/* one book leans against its neighbour on a shelf that has room for it */
.row .slot:nth-child(4):not(:nth-last-child(-n+3)) { margin-right: 14px; }
.row .slot:nth-child(4):not(:nth-last-child(-n+3)) .spine { transform: rotate(-6deg); transform-origin: 100% 100%; }
.shelf-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 28px; margin: 28px 0 0; font-size: 0.76rem; letter-spacing: 0.22em; text-transform: uppercase; }

/* ---- ornamental rules ------------------------------------------------------- */
.rule { display: flex; align-items: center; justify-content: center; gap: 14px; max-width: 560px; margin: 0 auto; color: var(--gold-dim); }
.rule::before, .rule::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-dim)); }
.rule::after { background: linear-gradient(90deg, var(--gold-dim), transparent); }
.rule svg { height: 22px; width: auto; flex: none; }

/* ---- books on the home page --------------------------------------------------- */
.books { max-width: 1120px; margin: -30px auto 0; padding: 0 22px 20px; display: grid; gap: 54px; position: relative; z-index: 2; }
.book {
  position: relative;
  padding: 44px 34px 38px;
  border: 1px solid var(--line); border-radius: 6px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(var(--glow), 0.16), rgba(var(--glow), 0) 34%),
    linear-gradient(180deg, var(--panel), var(--bg-2) 70%);
  box-shadow: inset 0 0 0 5px var(--bg), inset 0 0 0 6px rgba(var(--glow), 0.25), 0 30px 70px rgba(0, 0, 0, 0.5);
}
.book.world-storm {
  background:
    linear-gradient(180deg, rgba(47, 99, 184, 0.22), rgba(13, 23, 48, 0.1) 40%, rgba(13, 23, 48, 0.55)),
    url(/assets/art/stone.svg) 0 0 / 120px 80px repeat,
    var(--sw-panel);
  box-shadow: inset 0 0 0 5px var(--sw-night), inset 0 0 0 6px var(--sw-gold-dim), 0 30px 70px rgba(0, 0, 0, 0.55);
}
.book::before, .book::after {
  content: ""; position: absolute; width: 26px; height: 26px; pointer-events: none;
  border-color: var(--gold); border-style: solid; border-width: 0; opacity: 0.8;
}
.book::before { top: 10px; left: 10px; border-top-width: 1px; border-left-width: 1px; }
.book::after { bottom: 10px; right: 10px; border-bottom-width: 1px; border-right-width: 1px; }

.book-head { text-align: center; max-width: 660px; margin: 0 auto 30px; }
.book-head .sigil { width: 84px; height: 84px; margin: 0 auto 6px; filter: drop-shadow(0 0 18px rgba(var(--glow), 0.55)); }
.world-storm .book-head .sigil { width: 76px; height: 84px; }
.book-label { margin: 0; font-size: 0.72rem; letter-spacing: 0.34em; text-transform: uppercase; color: var(--accent); }
.book h2 {
  margin: 6px 0 2px;
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(1.8rem, 4.4vw, 2.6rem); line-height: 1.1; letter-spacing: 0.08em;
  color: var(--gold); text-shadow: 0 0 26px rgba(var(--glow), 0.45);
}
.world-storm h2 { text-transform: uppercase; letter-spacing: 0.14em; font-size: clamp(1.35rem, 3.6vw, 2rem); }
.book-sub { margin: 0 0 12px; font-style: italic; color: var(--text-2); font-size: 1.08rem; }
.book .intro { margin: 0; color: var(--text-2); }
.book .rule { margin-top: 22px; }

/* ---- chapter cards ---------------------------------------------------------- */
.tales {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 18px;
}
.tales li { display: grid; }
.tale {
  --pad: 22px;
  position: relative;
  display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 2px 18px; align-content: start;
  padding: var(--pad) var(--pad) 20px;
  border: 1px solid var(--line); border-radius: 4px;
  background: linear-gradient(165deg, var(--panel-2), var(--panel) 55%, var(--bg-2));
  color: var(--text);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.tale::after {
  content: ""; position: absolute; inset: 5px; pointer-events: none; border-radius: 2px;
  border: 1px solid rgba(var(--glow), 0.22);
}
.world-storm .tale { background: linear-gradient(165deg, rgba(27, 47, 92, 0.95), rgba(19, 34, 69, 0.96) 55%, rgba(10, 18, 38, 0.98)), url(/assets/art/stone.svg) 0 0 / 120px 80px repeat; }
.tale:hover, .tale:focus-visible {
  transform: translateY(-3px); border-color: var(--gold); color: var(--text);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55), 0 0 36px rgba(var(--glow), 0.35);
}
.tale .thumb {
  grid-column: 1 / -1; min-width: 0;
  width: calc(100% + 2 * var(--pad)); height: auto;
  margin: calc(-1 * var(--pad)) calc(-1 * var(--pad)) 16px;
  border-bottom: 1px solid var(--line); border-radius: 3px 3px 0 0;
  filter: saturate(0.9);
}
.tale .num {
  grid-row: 2 / span 4; align-self: start;
  display: grid; place-items: center; width: 56px; height: 56px;
  border-radius: 50%; border: 1px solid var(--gold-dim);
  font-family: var(--font-display); font-size: 1.45rem; color: var(--gold);
  background: radial-gradient(circle at 50% 35%, var(--panel-2), var(--bg) 90%);
  box-shadow: 0 0 18px rgba(var(--glow), 0.35);
}
.world-storm .tale .num { border-radius: 12% 12% 50% 50% / 12% 12% 62% 62%; font-size: 1.1rem; }
.tale .era { font-size: 0.68rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent); }
.tale h3 { margin: 2px 0 4px; font-family: var(--font-display); font-weight: 500; font-size: 1.5rem; line-height: 1.18; color: var(--text); }
.world-storm .tale h3 { text-transform: uppercase; letter-spacing: 0.06em; font-size: 1.02rem; line-height: 1.35; }
.tale p { margin: 0; font-style: italic; font-size: 0.98rem; line-height: 1.5; color: var(--text-2); }
.tale .reads { margin-top: 10px; font-size: 0.72rem; letter-spacing: 0.1em; color: var(--muted); }
.mature { font-weight: 400; color: #e49a90; letter-spacing: 0.14em; text-transform: uppercase; }

/* ---- ink-sketch plates ----------------------------------------------------------- */
.plate {
  margin: 0 0 26px; padding: 12px;
  border: 1px solid var(--line); border-radius: 4px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  box-shadow: inset 0 0 0 5px var(--bg), inset 0 0 0 6px rgba(var(--glow), 0.3), 0 22px 50px rgba(0, 0, 0, 0.5);
}
.plate img { display: block; width: 100%; height: auto; border: 1px solid rgba(0, 0, 0, 0.45); }
.plate figcaption {
  margin: 12px 0 2px; text-align: center;
  font-size: 0.7rem; letter-spacing: 0.26em; text-transform: uppercase; color: var(--muted);
}
.plate-wide { position: relative; z-index: 2; max-width: 980px; margin: -48px auto 54px; padding: 14px; }

/* ---- story page ------------------------------------------------------------- */
.story { position: relative; z-index: 2; max-width: 760px; margin: -36px auto 0; padding: 0 20px 20px; }
.notice {
  display: inline-block; margin-top: 18px; padding: 6px 16px;
  border: 1px solid var(--blood); border-radius: 3px; background: rgba(201, 102, 90, 0.1);
  color: #e8a79d; font-size: 0.78rem; letter-spacing: 0.08em;
}
.prose {
  padding: 44px 46px;
  border: 1px solid var(--line); border-radius: 4px;
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  box-shadow: inset 0 0 0 5px var(--bg), inset 0 0 0 6px rgba(var(--glow), 0.3), 0 26px 60px rgba(0, 0, 0, 0.55);
  font-size: 1.08rem; line-height: 1.78;
}
.world-storm .prose {
  background: linear-gradient(180deg, rgba(19, 34, 69, 0.97), rgba(13, 23, 48, 0.985)), url(/assets/art/stone.svg) 0 0 / 120px 80px repeat;
  box-shadow: inset 0 0 0 5px var(--sw-night), inset 0 0 0 6px var(--sw-gold-dim), 0 26px 60px rgba(0, 0, 0, 0.6);
}
.prose p { margin: 0 0 1.1em; }
.prose p:last-child { margin-bottom: 0; }
.prose em { color: var(--text-2); }
.prose .scene { display: flex; justify-content: center; align-items: center; gap: 14px; margin: 1.9em 0; color: var(--gold-dim); }
.prose .scene::before, .prose .scene::after { content: ""; width: 64px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-dim)); }
.prose .scene::after { background: linear-gradient(90deg, var(--gold-dim), transparent); }
.prose .scene svg { height: 26px; width: auto; }
.prose > p:first-of-type::first-letter, .prose .scene + p::first-letter {
  float: left;
  font-family: var(--font-display); font-weight: 500;
  font-size: 4.4em; line-height: 0.78; padding: 0.1em 0.12em 0 0;
  color: var(--gold); text-shadow: 0 0 20px rgba(var(--glow), 0.55);
}
.world-storm .prose > p:first-of-type::first-letter, .world-storm .prose .scene + p::first-letter { font-size: 3.6em; line-height: 0.9; }

.pager { display: flex; justify-content: space-between; gap: 14px; margin: 26px 0 0; }
.pager a {
  flex: 1; padding: 14px 18px;
  border: 1px solid var(--line); border-radius: 4px;
  background: rgba(var(--glow), 0.1); color: var(--text); font-family: var(--font-display); font-size: 1.1rem;
}
.world-storm .pager a { font-size: 0.86rem; text-transform: uppercase; letter-spacing: 0.08em; }
.pager a:hover, .pager a:focus-visible { border-color: var(--gold); background: rgba(var(--glow), 0.2); }
.pager small { display: block; margin-bottom: 2px; font-family: var(--font-body); font-size: 0.66rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent); }
.pager .next { text-align: right; }
.pager .gap { flex: 1; }

.chapters { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 30px 0 0; }
.chapters .lbl { width: 100%; margin-bottom: 4px; text-align: center; font-size: 0.66rem; letter-spacing: 0.26em; text-transform: uppercase; color: var(--muted); }
.chapters a, .chapters b {
  display: grid; place-items: center; min-width: 42px; height: 42px; padding: 0 10px;
  border-radius: 50%; border: 1px solid var(--line);
  font-family: var(--font-display); font-weight: 500; font-size: 0.98rem; color: var(--muted);
}
.world-storm .chapters a, .world-storm .chapters b { font-size: 0.78rem; }
.chapters a:hover, .chapters a:focus-visible { color: var(--gold); border-color: var(--gold); }
.chapters b { color: #0a0a18; background: var(--gold); border-color: var(--gold); box-shadow: 0 0 18px rgba(var(--glow), 0.5); }

.home-link { margin: 26px 0 0; text-align: center; font-size: 0.76rem; letter-spacing: 0.26em; text-transform: uppercase; }

/* ---- submission form, readers' tales and the review page ----------------------------- */
.panel {
  padding: 34px 40px;
  border: 1px solid var(--line); border-radius: 4px;
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.55);
}
.panel + .panel, .panel + .prose { margin-top: 18px; }
.panel .intro { text-align: left; max-width: none; margin-bottom: 18px; }
.tale-form label { display: block; margin: 0 0 16px; font-size: 0.9rem; letter-spacing: 0.04em; color: var(--text-2); }
.tale-form input[type="text"], .tale-form input:not([type]), .tale-form select, .tale-form textarea {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 3px;
  background: rgba(4, 4, 14, 0.55); color: var(--text);
  font: inherit; font-size: 1rem; line-height: 1.5;
}
.tale-form textarea { min-height: 320px; resize: vertical; }
.tale-form input:focus, .tale-form select:focus, .tale-form textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold); }
.tale-form .check { display: flex; gap: 10px; align-items: flex-start; }
.tale-form .check input { margin-top: 5px; accent-color: var(--gold); }
.tale-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.tale-form .actions, .cta { margin: 22px 0 0; text-align: center; }
.tale-form button, .cta a, .decide button {
  display: inline-block; padding: 12px 26px; cursor: pointer;
  border: 1px solid var(--gold); border-radius: 999px;
  background: rgba(var(--glow), 0.25); color: var(--gold);
  font-family: var(--font-display); font-size: 1.05rem; letter-spacing: 0.1em; text-transform: uppercase;
}
.tale-form button:hover, .cta a:hover, .decide button:hover { background: var(--gold); color: #0a0a18; }
.decide button.quiet { border-color: var(--line); color: var(--muted); background: transparent; }
.decide button.quiet:hover { border-color: var(--blood); color: #fff; background: var(--blood); }
.invite .book-head { margin-bottom: 0; }
.review-item h3 { margin: 4px 0; font-family: var(--font-display); font-weight: 500; font-size: 1.5rem; }
.review-item h3 a { color: var(--text); }
.review-item .byline { margin: 0 0 10px; color: var(--text-2); font-style: italic; }
.review-item .preview { margin: 0 0 16px; color: var(--text-2); white-space: pre-line; font-size: 0.98rem; }
.review-item .actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.review-item .readfull { margin-left: auto; font-size: 0.78rem; letter-spacing: 0.2em; text-transform: uppercase; }
.decide { margin: 0; }
.sentinel { margin-top: 26px; font-size: 0.95rem; }
.sentinel h3 { margin: 0 0 6px; font-family: var(--font-display); font-weight: 500; font-size: 1.3rem; }
.sentinel table { width: 100%; margin: 12px 0 8px; border-collapse: collapse; font-size: 0.8rem; }
.sentinel th, .sentinel td { padding: 4px 8px; text-align: left; border-bottom: 1px solid rgba(255, 255, 255, 0.08); vertical-align: top; word-break: break-all; }
.sentinel th { color: var(--muted); font-weight: 400; letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.66rem; }
.sentinel .fine { margin: 0; color: var(--muted); font-size: 0.78rem; }

/* ---- lost page ---------------------------------------------------------------- */
.lost { max-width: 620px; margin: 0 auto; padding: 10px 22px 40px; text-align: center; color: var(--text-2); }

/* ---- footer ------------------------------------------------------------------- */
footer {
  max-width: 760px; margin: 40px auto 0; padding: 26px 20px 60px;
  text-align: center; color: var(--muted); font-size: 0.8rem; line-height: 1.6;
}
footer .rule { margin-bottom: 18px; }
footer p { margin: 6px auto; max-width: 620px; }

/* ---- smaller screens ------------------------------------------------------------- */
@media (max-width: 760px) {
  body { font-size: 18px; }
  .hero .scene { background-size: auto 58%; }
  .hero-home .scene { background-size: auto 46%; }
  .hero-inner { padding: 36px 18px 54px; }
  .hero-home .hero-inner { padding: 44px 18px 80px; }
  .hero .sigil { width: 96px; height: 96px; }
  .topbar { padding: 14px 16px 0; }
  .topbar nav a { margin-left: 14px; }
  .books { padding: 0 14px 20px; gap: 40px; }
  .book { padding: 34px 18px 28px; }
  .tales { grid-template-columns: 1fr; }
  .tale { --pad: 16px; grid-template-columns: 48px minmax(0, 1fr); gap: 2px 14px; padding: var(--pad) var(--pad) 18px; }
  .plate { padding: 8px; }
  .plate-wide { margin: -30px 14px 40px; }
  .hero.has-art { min-height: 480px; }
  .hero.has-art .hero-inner { padding-top: 170px; }
  .hero-home.has-art { min-height: 560px; }
  .hero-home.has-art .hero-inner { padding-top: 220px; }
  .tale:has(> .thumb) { aspect-ratio: 4 / 3; padding: 16px; }
  .inn { min-height: 560px; min-height: 80vh; }
  .inn-inner { padding: 150px 14px 50px; gap: 16px; }
  .inn-head { top: 54px; }
  .inn-head h1 { letter-spacing: 0.16em; }
  .sign { padding: 18px 20px 16px; }
  .row .slot:nth-child(4) { margin-right: 0; }
  .row .slot:nth-child(4) .spine { transform: none; }
  .sign::before, .sign::after { top: -120px; height: 120px; }
  .side { padding: 9px 14px; font-size: 0.7rem; letter-spacing: 0.14em; }
  .library { padding: 0 10px 20px; }
  .shelf { padding: 6px 10px 0; border-width: 6px; }
  .row { gap: 5px; padding: 36px 4px 0; }
  .row::after { left: -10px; right: -10px; }
  .spine { width: 46px; height: 236px; padding: 10px 0 8px; }
  .spine.tome { width: 60px; height: 250px; }
  .spine.reader, .spine.blank, .spine.tone-2, .spine.tone-5, .spine.tone-4 { height: 236px; }
  .spine-title { font-size: 0.8rem; max-height: 158px; }
  .spine.tome .spine-title { font-size: 0.6rem; letter-spacing: 0.04em; max-height: 168px; }
  .candle { height: 48px; margin: 0 4px 0 10px; }
  @keyframes candle { from { opacity: 0.85; } to { opacity: 1; } }
  #saga .tales li:first-child .tale:has(> .thumb) { aspect-ratio: 4 / 3; grid-template-columns: 48px minmax(0, 1fr); }
  #saga .tales li:first-child .tale h3 { font-size: 1.6rem; }
  #saga .tales li:first-child .tale .num { width: 46px; height: 46px; font-size: 1.2rem; }
  #saga .tales li:first-child .tale::before { background: linear-gradient(180deg, rgba(5, 5, 16, 0) 34%, rgba(5, 5, 16, 0.55) 62%, rgba(5, 5, 16, 0.95) 100%); }
  .book .band { height: 260px; }
  .tale .num { width: 46px; height: 46px; font-size: 1.2rem; }
  .story { padding: 0 14px 20px; }
  .prose { padding: 30px 20px; }
  .pager { flex-direction: column; }
  .pager .next { text-align: left; }
}
@media (max-width: 460px) {
  .topbar nav { display: none; }
  .hero h1 { letter-spacing: 0.06em; }
}
