/* Footfall: the Wayfarer's Journal. The guild's map room: leather, brass,
   gold leaf, aged vellum, candlelight, and one spirit-green glow.
   No external requests: fonts are self-hosted (OFL, see /static/fonts/). Art
   comes from art.css as custom properties; every painted slot has a CSS
   fallback painted in the palette, so missing art never leaves a hole. */

@font-face {
  font-family: "Cinzel";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("fonts/cinzel-latin-wght-normal.woff2") format("woff2-variations"), url("fonts/cinzel-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Cinzel";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("fonts/cinzel-latin-ext-wght-normal.woff2") format("woff2-variations"), url("fonts/cinzel-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Alegreya";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("fonts/alegreya-latin-wght-normal.woff2") format("woff2-variations"), url("fonts/alegreya-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Alegreya";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("fonts/alegreya-latin-ext-wght-normal.woff2") format("woff2-variations"), url("fonts/alegreya-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: dark;
  /* Palette (images-needed.md section 1) */
  --glow: #5be89a;
  --green: #1e8f5a;
  --enamel: #17774a;
  --gold: #f2c14e;
  --brass: #b8862f;
  --leather: #3a2418;
  --black: #17100c;
  --vellum: #e9dbb8;
  --tea: #c9b182;
  --ink: #3b2a1a;
  --midnight: #16223a;
  /* Text */
  --text: #eadfc6;
  --muted: #bfae8c;
  --ink-strong: #2e1f12;
  --ink-head: #5a2a10;
  --ink-link: #135a38;
  --ground: #120c09;
  /* Item quality */
  --q-common: #9d9d9d;
  --q-uncommon: #1eff00;
  --q-rare: #0070dd;
  --q-epic: #a335ee;
  --q-legendary: #ff8000;
  --display: "Cinzel", "Trajan Pro", "Cormorant SC", "Times New Roman", serif;
  --body: "Alegreya", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --wrap: 72rem;
}

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

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  font: 400 1.125rem/1.65 var(--body);
  background-color: var(--ground);
  /* Leather by candlelight: a warm pool top left, cool night at the edges. */
  background-image:
    radial-gradient(ellipse 70% 40% at 15% 0%, rgba(242, 193, 78, 0.1), transparent 70%),
    radial-gradient(ellipse 60% 50% at 100% 30%, rgba(22, 34, 58, 0.55), transparent 70%),
    repeating-radial-gradient(circle at 30% 40%, rgba(255, 255, 255, 0.012) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, var(--ground) 0%, #170f0b 45%, #0d0907 100%);
}
[hidden] { display: none !important; }
/* Home: the hero fades into a plain ground so there is no seam under it. */
.page-home { background-image: linear-gradient(180deg, var(--ground) 0%, var(--ground) 30%, #170f0b 60%, #0d0907 100%); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2.5rem); }
.narrow { max-width: 50rem; }

a { color: var(--glow); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--glow); outline-offset: 3px; border-radius: 4px; }

.skip { position: absolute; left: -999px; top: 0.5rem; z-index: 50; background: var(--vellum); color: var(--ink); padding: 0.6rem 1rem; border-radius: 6px; font-weight: 700; }
.skip:focus { left: 0.75rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.15; letter-spacing: 0.02em; color: var(--gold); margin: 0 0 0.6em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 5.2vw, 3.6rem); }
h2 { font-size: clamp(1.45rem, 3vw, 2.1rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
.lead { font-size: clamp(1.15rem, 2vw, 1.35rem); color: var(--text); }
.muted { color: var(--muted); }
.note { color: var(--muted); font-size: 0.98rem; }
.center { text-align: center; }
.gilded {
  color: var(--gold);
  background: linear-gradient(180deg, #fff1c2 0%, #f6cf68 45%, #c99232 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.75));
}
.eyebrow { font-family: var(--display); font-size: 0.85rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--tea); margin: 0 0 0.5rem; }
code { font-family: var(--mono); font-size: 0.88em; background: rgba(242, 193, 78, 0.12); color: #f6dfa0; padding: 0.08em 0.4em; border-radius: 4px; }

/* ------------------------------------------------------------------ header */

.top { position: relative; z-index: 10; background: linear-gradient(180deg, #2b1a11, #1d120c); border-bottom: 1px solid #000; box-shadow: 0 1px 0 rgba(242, 193, 78, 0.35), 0 6px 18px rgba(0, 0, 0, 0.5); }
.top-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.4rem 1.25rem; padding-top: 0.55rem; padding-bottom: 0.55rem; }
.top.over { position: absolute; left: 0; right: 0; top: 0; background: linear-gradient(180deg, rgba(12, 8, 20, 0.85), rgba(12, 8, 20, 0)); border-bottom: 0; box-shadow: none; }
.brand { display: inline-flex; align-items: center; gap: 0.65rem; color: var(--gold); text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 1.35rem; letter-spacing: 0.06em; text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7); }
.brand:hover { color: #ffd772; }
.crest { width: 48px; height: 48px; display: block; filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.7)); }
.crest-fallback { width: 44px; height: 44px; border-radius: 50%; display: block; background: radial-gradient(circle at 50% 45%, var(--glow) 0 18%, var(--green) 19% 52%, #b8862f 53% 70%, #f2c14e 71% 78%, #5a3d12 79%); box-shadow: 0 3px 6px rgba(0, 0, 0, 0.6); }
.top nav { display: flex; flex-wrap: wrap; gap: 0.15rem 0.35rem; }
.top nav a { font-family: var(--display); font-size: 0.95rem; letter-spacing: 0.08em; color: var(--vellum); text-decoration: none; padding: 0.4rem 0.75rem; border-radius: 4px; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8); }
.top nav a:hover { color: var(--gold); background: rgba(242, 193, 78, 0.08); }
.top nav a[aria-current="page"] { color: var(--gold); box-shadow: inset 0 -2px 0 var(--gold); }

/* ------------------------------------------------------------------ buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 48px; padding: 0.7rem 1.5rem;
  font: 700 1.02rem/1.2 var(--display); letter-spacing: 0.07em; text-decoration: none; cursor: pointer;
  border-radius: 7px; transition: filter 0.15s, box-shadow 0.15s, transform 0.15s;
}
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: progress; }
/* Green enamel in a gold-leaf frame: the one important action on a page. */
.btn-primary {
  color: #f8f1db;
  background: radial-gradient(ellipse 80% 70% at 50% 0%, rgba(91, 232, 154, 0.4), transparent 65%), linear-gradient(180deg, #24955e 0%, var(--enamel) 48%, #0f5233 100%);
  border: 2px solid var(--gold);
  box-shadow: 0 0 0 2px #4a3110, 0 0 0 3px #c99232, inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 -4px 8px rgba(0, 0, 0, 0.35), 0 8px 20px rgba(0, 0, 0, 0.55), 0 0 26px rgba(91, 232, 154, 0.22);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}
.btn-primary:hover { box-shadow: 0 0 0 2px #4a3110, 0 0 0 3px #e2b04a, inset 0 1px 0 rgba(255, 255, 255, 0.4), inset 0 -4px 8px rgba(0, 0, 0, 0.3), 0 8px 22px rgba(0, 0, 0, 0.55), 0 0 34px rgba(91, 232, 154, 0.45); }
/* Hammered brass plate: everything else. */
.btn-brass {
  color: #24160a;
  background: radial-gradient(ellipse 60% 50% at 30% 20%, rgba(255, 245, 210, 0.55), transparent 70%), linear-gradient(180deg, #f1cf78 0%, #c9973a 52%, #8f6522 100%);
  border: 1px solid #4a3110;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), inset 0 -3px 5px rgba(0, 0, 0, 0.3), 0 5px 14px rgba(0, 0, 0, 0.5);
  text-shadow: 0 1px 0 rgba(255, 240, 200, 0.5);
}
.actions { display: flex; flex-wrap: wrap; gap: 0.9rem 1.1rem; align-items: center; margin-top: 1.25rem; }
.actions.centered { justify-content: center; }
.plain { list-style: none; padding: 0; margin: 0; }

/* ------------------------------------------------------------------ gold rule */

.rule {
  height: 32px; margin: clamp(2rem, 5vw, 3.5rem) auto; max-width: 52rem; border: 0;
  background:
    var(--art-divider, none) center / min(100%, 800px) 32px no-repeat,
    radial-gradient(circle, #f6d27a 0 3px, #8f6522 3.5px 5px, transparent 5.5px) center / 14px 14px no-repeat,
    linear-gradient(90deg, transparent, rgba(184, 134, 47, 0.7) 18%, #f2c14e 50%, rgba(184, 134, 47, 0.7) 82%, transparent) center / 100% 1px no-repeat;
}

/* ------------------------------------------------------------------ footprints */

/* A trail of softly glowing prints walking across a section. Decorative only. */
.trail { position: relative; height: 70px; max-width: 46rem; margin: 0 auto; overflow: hidden; pointer-events: none; }
.trail i {
  position: absolute; top: 14px; width: 17px; height: 41px;
  background: url("ui/footprint.svg") center / contain no-repeat;
  transform: rotate(90deg); opacity: 0.12; filter: drop-shadow(0 0 5px rgba(91, 232, 154, 0.9));
  animation: footstep 7s infinite ease-in-out;
}
.trail i:nth-child(odd) { top: 30px; }
.trail i:nth-child(1) { left: 4%; animation-delay: 0s; }
.trail i:nth-child(2) { left: 16%; animation-delay: 0.45s; }
.trail i:nth-child(3) { left: 28%; animation-delay: 0.9s; }
.trail i:nth-child(4) { left: 40%; animation-delay: 1.35s; }
.trail i:nth-child(5) { left: 52%; animation-delay: 1.8s; }
.trail i:nth-child(6) { left: 64%; animation-delay: 2.25s; }
.trail i:nth-child(7) { left: 76%; animation-delay: 2.7s; }
.trail i:nth-child(8) { left: 88%; animation-delay: 3.15s; }
@keyframes footstep { 0%, 100% { opacity: 0.08; } 8% { opacity: 0.75; } 40% { opacity: 0.18; } }

/* ------------------------------------------------------------------ hero */

.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: clamp(560px, 86vh, 880px);
  display: flex; align-items: center;
  /* Painted dusk while the painting is missing or loading. */
  background:
    radial-gradient(ellipse 50% 30% at 72% 62%, rgba(242, 160, 90, 0.45), transparent 70%),
    radial-gradient(ellipse 35% 25% at 85% 72%, rgba(91, 232, 154, 0.12), transparent 70%),
    linear-gradient(180deg, #2a2160 0%, #4b3378 35%, #b0607a 62%, #3b2a33 80%, var(--ground) 100%);
}
.hero-art img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: 66% 50%; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(18, 12, 9, 0) 70%, rgba(18, 12, 9, 0.7) 88%, var(--ground) 100%),
    linear-gradient(90deg, rgba(14, 10, 30, 0.9) 0%, rgba(14, 10, 30, 0.72) 28%, rgba(14, 10, 30, 0.3) 50%, rgba(14, 10, 30, 0) 64%);
}
.hero-copy { width: 100%; padding-top: 6rem; padding-bottom: 4rem; }
.hero-copy > div { max-width: 33rem; }
.hero h1 { font-size: clamp(2.3rem, 5.4vw, 4.2rem); margin-bottom: 0.35em; }
.hero .lead { color: #f1e6cc; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9); max-width: 30rem; }
.hero .secondary-link { font-family: var(--display); letter-spacing: 0.05em; color: var(--vellum); text-shadow: 0 1px 3px #000; }

@media (max-width: 760px) {
  .hero { min-height: clamp(620px, 118vw, 900px); align-items: flex-start; }
  .hero-art img { object-position: 50% 100%; }
  .hero::before {
    background:
      linear-gradient(180deg, rgba(14, 10, 30, 0.9) 0%, rgba(14, 10, 30, 0.78) 50%, rgba(14, 10, 30, 0.5) 72%, rgba(18, 12, 9, 0.2) 86%, var(--ground) 100%);
  }
  .hero-copy { padding-top: 7.5rem; }
}
@media (max-width: 560px) { .hero-copy { padding-top: 9.5rem; } }

/* ------------------------------------------------------------------ sections */

.section { padding: clamp(2rem, 4.5vw, 3.5rem) 0; }
.section-head { text-align: center; max-width: 42rem; margin: 0 auto clamp(1.5rem, 4vw, 2.5rem); }
.section-head p { color: var(--muted); }

/* Totals: three large figures in gold leaf. */
.totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; text-align: center; margin: 0 auto; max-width: 60rem; }
.total { padding: 0.5rem 0.75rem; position: relative; }
.total + .total::before { content: ""; position: absolute; left: -0.5rem; top: 15%; bottom: 15%; width: 1px; background: linear-gradient(180deg, transparent, rgba(242, 193, 78, 0.55), transparent); }
.total-figure { display: block; font: 800 clamp(2.2rem, 6.5vw, 4rem)/1.05 var(--display); font-variant-numeric: lining-nums tabular-nums; overflow-wrap: anywhere; }
.total-label { display: block; margin-top: 0.4rem; font-family: var(--display); font-size: clamp(0.78rem, 1.6vw, 0.95rem); letter-spacing: 0.14em; text-transform: uppercase; color: var(--tea); }
@media (max-width: 520px) {
  .totals { grid-template-columns: 1fr; gap: 1.25rem; }
  .total + .total::before { left: 25%; right: 25%; top: -0.65rem; bottom: auto; width: auto; height: 1px; background: linear-gradient(90deg, transparent, rgba(242, 193, 78, 0.55), transparent); }
}

/* Dark leather cards. */
.cards { display: grid; gap: clamp(1rem, 2.5vw, 1.5rem); }
.cards-3 { grid-template-columns: repeat(3, 1fr); }
.cards-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 960px) { .cards-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) { .cards-3 { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .cards-4 { grid-template-columns: 1fr; } }
.card {
  position: relative; text-align: center; padding: 1.4rem 1.2rem 1.5rem;
  background: radial-gradient(ellipse 90% 60% at 50% 0%, rgba(242, 193, 78, 0.09), transparent 70%), linear-gradient(180deg, #2c1b12, #1c120c);
  border: 1px solid #0b0705; border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(242, 193, 78, 0.2), inset 0 0 0 5px #24160f, inset 0 0 0 6px rgba(242, 193, 78, 0.12), 0 12px 28px rgba(0, 0, 0, 0.5);
}
.card h3 { margin: 0.75rem 0 0.4rem; }
.card p { color: var(--muted); margin: 0; font-size: 1.02rem; }
.card .art { display: block; margin: 0 auto; }
.card .art img { display: block; width: 100%; max-width: 220px; height: auto; margin: 0 auto; }
.step-num { font: 700 0.85rem var(--display); letter-spacing: 0.2em; color: var(--tea); text-transform: uppercase; }

/* A painted medallion: the fallback for any missing spot painting. */
.medallion {
  width: 128px; height: 128px; margin: 0.25rem auto 0; border-radius: 50%; position: relative;
  display: grid; place-items: center;
  background: radial-gradient(circle at 40% 30%, rgba(91, 232, 154, 0.35), transparent 45%), radial-gradient(circle, #1b6f46 0 55%, #0e3d26 70%);
  box-shadow: 0 0 0 5px #b8862f, 0 0 0 7px #f2c14e, 0 0 0 9px #4a3110, inset 0 0 18px rgba(0, 0, 0, 0.55), 0 10px 22px rgba(0, 0, 0, 0.6), 0 0 30px rgba(91, 232, 154, 0.18);
}
.medallion svg { width: 56%; height: 56%; filter: drop-shadow(0 0 6px rgba(91, 232, 154, 0.75)); }
.medallion .numeral { font: 800 3.2rem/1 var(--display); color: var(--glow); text-shadow: 0 0 12px rgba(91, 232, 154, 0.8), 0 2px 2px rgba(0, 0, 0, 0.6); }
.feature .art img { max-width: 180px; }

.qualities { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.35rem; margin-top: 0.75rem; padding: 0; list-style: none; }
.qualities li { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #1a110b; box-shadow: 0 0 0 1px rgba(242, 193, 78, 0.35); }
.q-common { background: var(--q-common); }
.q-uncommon { background: var(--q-uncommon); }
.q-rare { background: var(--q-rare); }
.q-epic { background: var(--q-epic); }
.q-legendary { background: var(--q-legendary); box-shadow: 0 0 0 1px rgba(242, 193, 78, 0.35), 0 0 8px rgba(255, 128, 0, 0.8) !important; }

/* ------------------------------------------------------------------ parchment */

.parchment {
  position: relative; color: var(--ink-strong);
  padding: clamp(1.25rem, 4vw, 2.4rem) clamp(1.1rem, 4.5vw, 2.75rem);
  background:
    radial-gradient(ellipse 70% 55% at 25% 15%, rgba(255, 251, 236, 0.5), transparent 70%),
    radial-gradient(ellipse 60% 45% at 85% 95%, rgba(140, 95, 45, 0.25), transparent 70%),
    radial-gradient(ellipse 120% 90% at 50% 50%, transparent 55%, rgba(120, 78, 30, 0.35) 100%),
    var(--art-parchment, none) 0 0 / 512px 512px repeat,
    linear-gradient(180deg, #efe3c3, #e3d0a5);
  border-radius: 4px 9px 5px 11px / 10px 4px 11px 5px;
  box-shadow: inset 0 0 0 1px rgba(59, 42, 26, 0.45), inset 0 0 26px rgba(110, 70, 25, 0.35), inset 0 0 3px rgba(70, 40, 15, 0.6), 0 14px 34px rgba(0, 0, 0, 0.6), 0 2px 0 rgba(0, 0, 0, 0.4);
}
.parchment::before { content: ""; position: absolute; inset: 9px; border: 1px solid rgba(59, 42, 26, 0.32); border-radius: inherit; pointer-events: none; }
.parchment h1, .parchment h2, .parchment h3 { color: var(--ink-head); text-shadow: 0 1px 0 rgba(255, 248, 225, 0.6); }
.parchment a { color: var(--ink-link); font-weight: 600; }
.parchment a.btn-primary { color: #f8f1db; }
.parchment a.btn-brass { color: #24160a; }
.parchment .muted, .parchment .note { color: #5c4630; }
.parchment code { background: rgba(59, 42, 26, 0.1); color: #3b2a1a; }
.parchment ul, .parchment ol { padding-left: 1.3rem; }
.parchment li { margin: 0.35rem 0; }
.parchment li::marker { color: #8a5a20; }
.parchment strong { color: #2a1a0d; }
.parchment :focus-visible { outline-color: #0f5a35; }
.panels { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1rem, 3vw, 2rem); align-items: start; }
@media (max-width: 860px) { .panels { grid-template-columns: 1fr; } }

/* Numbered steps in wax seals (install). */
.seals { list-style: none; padding: 0 !important; counter-reset: seal; }
.seals li { counter-increment: seal; position: relative; padding-left: 3.25rem; margin: 0.9rem 0 !important; min-height: 2.4rem; }
.seals li::before {
  content: counter(seal); position: absolute; left: 0; top: -0.1rem; width: 2.3rem; height: 2.3rem; border-radius: 50%;
  display: grid; place-items: center; font: 700 1.1rem var(--display); color: #f4ecd2;
  background: radial-gradient(circle at 38% 32%, #3fc07e, #1a7a4b 55%, #0c4a2c);
  box-shadow: 0 0 0 2px rgba(12, 74, 44, 0.6), 0 2px 4px rgba(0, 0, 0, 0.45), inset 0 -2px 3px rgba(0, 0, 0, 0.35);
}

/* "Have a link?" banner. */
.banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; padding: 1.4rem clamp(1.1rem, 4vw, 2.2rem); border-radius: 10px;
  background: radial-gradient(ellipse 60% 120% at 0% 50%, rgba(91, 232, 154, 0.14), transparent 70%), linear-gradient(180deg, #23170f, #170f0a);
  box-shadow: inset 0 0 0 1px rgba(242, 193, 78, 0.3), 0 10px 24px rgba(0, 0, 0, 0.5); }
.banner h2 { margin: 0 0 0.2rem; font-size: 1.45rem; }
.banner p { margin: 0; color: var(--muted); }

/* ------------------------------------------------------------------ inner pages */

/* The map room: a candlelit table behind the top of every inner page. */
.room { position: relative; isolation: isolate; padding-top: clamp(2rem, 6vw, 4rem); }
.room::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: clamp(380px, 62vh, 660px); z-index: -1;
  /* Fade the table into the page instead of ending on an edge. */
  -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 55%, transparent 100%);
  background:
    linear-gradient(180deg, rgba(18, 12, 9, 0.55) 0%, rgba(18, 12, 9, 0.78) 55%, var(--ground) 100%),
    var(--art-map-room, none) center 35% / cover no-repeat,
    radial-gradient(ellipse 40% 60% at 12% 10%, rgba(255, 190, 90, 0.35), transparent 70%),
    radial-gradient(ellipse 80% 70% at 50% 40%, rgba(150, 110, 60, 0.35), transparent 75%),
    linear-gradient(180deg, #2e1d12, var(--ground));
}
@media (max-width: 760px) { .room::before { background-image: linear-gradient(180deg, rgba(18, 12, 9, 0.6) 0%, rgba(18, 12, 9, 0.8) 55%, var(--ground) 100%), var(--art-map-room-small, none), radial-gradient(ellipse 50% 60% at 12% 10%, rgba(255, 190, 90, 0.35), transparent 70%), linear-gradient(180deg, #2e1d12, var(--ground)); } }
.page-head { text-align: center; margin-bottom: clamp(1.5rem, 4vw, 2.5rem); }
.page-head h1 { margin-bottom: 0.25em; }
.page-head p { color: var(--text); max-width: 40rem; margin: 0 auto; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9); }

/* Tabs: leather bookmarks; the open one is edged in gold and glows. */
.tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin: 0 0 0.75rem; }
.tabs a {
  font: 700 0.98rem var(--display); letter-spacing: 0.06em; text-decoration: none; color: var(--vellum);
  padding: 0.55rem 1.1rem; border-radius: 6px 6px 3px 3px; min-height: 44px; display: inline-flex; align-items: center;
  background: linear-gradient(180deg, #3d2719, #26170f); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 220, 160, 0.12), 0 3px 8px rgba(0, 0, 0, 0.4);
}
.tabs a:hover { color: var(--gold); }
.tabs a[aria-current="page"] { color: #1d1208; background: linear-gradient(180deg, #f3d283, #c9973a); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 0 0 1px #4a3110, 0 0 16px rgba(91, 232, 154, 0.3); }
.tabs.small a { font-size: 0.88rem; min-height: 40px; padding: 0.4rem 0.9rem; }
.tab-label { text-align: center; font-family: var(--display); font-size: 0.8rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--tea); margin: 0.75rem 0 0.35rem; }

/* The ledger: a parchment table. */
.ledger { margin: 1.5rem 0; padding-left: clamp(0.5rem, 2.5vw, 2rem); padding-right: clamp(0.5rem, 2.5vw, 2rem); }
.ledger-scroll { overflow-x: auto; }
.ledger table { width: 100%; border-collapse: collapse; font-variant-numeric: lining-nums tabular-nums; }
.ledger caption { caption-side: top; text-align: center; font: 700 1rem var(--display); letter-spacing: 0.12em; color: var(--ink-head); padding: 0.25rem 0 0.9rem; }
.ledger th { font: 700 0.82rem var(--display); letter-spacing: 0.12em; text-transform: uppercase; color: #5c3a1a; text-align: left; padding: 0.55rem 0.6rem; border-bottom: 2px solid rgba(59, 42, 26, 0.55); white-space: nowrap; }
.ledger td { padding: 0.6rem 0.6rem; border-bottom: 1px dashed rgba(59, 42, 26, 0.35); vertical-align: middle; }
.ledger tr:last-child td { border-bottom: 0; }
.ledger .num { text-align: right; white-space: nowrap; }
.ledger .who { font-weight: 700; font-size: 1.08rem; color: #24160a; overflow-wrap: anywhere; }
.ledger .sub { display: block; font-size: 0.92rem; color: #5c4630; font-weight: 400; }
.ledger tr.me td { background: rgba(30, 143, 90, 0.16); }
.ledger tr.me td:first-child { box-shadow: inset 4px 0 0 var(--green); }
.you { display: inline-block; margin-left: 0.4rem; padding: 0 0.45rem; border-radius: 999px; font: 700 0.72rem/1.6 var(--display); letter-spacing: 0.1em; color: #f4ecd2; background: var(--enamel); vertical-align: 0.1em; }
.faction { display: inline-block; margin-left: 0.35rem; font: 600 0.75rem/1.5 var(--body); padding: 0 0.45rem; border-radius: 999px; border: 1px solid rgba(59, 42, 26, 0.4); color: #4d3720; vertical-align: 0.1em; }
.rank { width: 3.2rem; text-align: center; font: 700 1.05rem var(--display); color: #5c3a1a; }
/* Medals: painted art when delivered, else a struck coin on a ribbon. */
.medal { position: relative; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; font: 800 0.95rem var(--display); color: #2a1a0a; box-shadow: inset 0 -2px 3px rgba(0, 0, 0, 0.35), inset 0 2px 2px rgba(255, 255, 255, 0.55), 0 2px 3px rgba(0, 0, 0, 0.4); }
.medal::before { content: ""; position: absolute; top: -10px; left: 9px; width: 16px; height: 11px; clip-path: polygon(0 0, 100% 0, 75% 100%, 25% 100%); }
.medal-1 { background: radial-gradient(circle at 35% 30%, #fff1b8, #f2c14e 45%, #a8761f); }
.medal-1::before { background: var(--green); }
.medal-2 { background: radial-gradient(circle at 35% 30%, #ffffff, #c9cdd3 45%, #7e858f); }
.medal-2::before { background: #2f5fa8; }
.medal-3 { background: radial-gradient(circle at 35% 30%, #ffd6ae, #c47a3c 45%, #7a4318); }
.medal-3::before { background: #7a3a24; }
.medal-art img { width: 40px; height: 40px; display: block; margin: 0 auto; }

/* Empty board, lost page: a picture or a quiet painted note. */
.empty { text-align: center; padding: 1rem 0 0.5rem; }
.empty .art img { width: min(100%, 420px); height: auto; display: block; margin: 0 auto 1rem; }
.empty p { max-width: 34rem; margin-left: auto; margin-right: auto; }

/* Race rules plaque. */
.plaque { display: inline-block; padding: 0.8rem 1.4rem; margin: 0 auto; border-radius: 8px; color: #24160a; font-size: 1.1rem;
  background: radial-gradient(ellipse 60% 60% at 30% 20%, rgba(255, 245, 210, 0.55), transparent 70%), linear-gradient(180deg, #e9c56e, #b98a33);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), inset 0 -2px 4px rgba(0, 0, 0, 0.3), 0 0 0 1px #4a3110, 0 8px 18px rgba(0, 0, 0, 0.5); }
.plaque strong { color: #1b1006; }

/* Forms. */
label { display: block; font-weight: 700; margin-bottom: 0.4rem; }
textarea, input[type="text"] {
  width: 100%; font: 1rem/1.45 var(--mono); color: #23170c; background: #fbf4e0;
  border: 1px solid rgba(59, 42, 26, 0.55); border-radius: 6px; padding: 0.7rem 0.8rem; margin-bottom: 0.9rem;
  box-shadow: inset 0 2px 4px rgba(59, 42, 26, 0.2);
}
.codebox { word-break: break-all; }
.error { color: #ffb4a8; font-weight: 700; }
.parchment .error { color: #8e1c12; }

/* ------------------------------------------------------------------ share page */

.status { text-align: center; }
.status p { font-size: 1.15rem; }
.sending { display: flex; justify-content: center; gap: 0.9rem; height: 46px; margin: 0.25rem 0 0.75rem; }
.sending i { width: 16px; height: 38px; background: url("ui/footprint.svg") center / contain no-repeat; opacity: 0.15; filter: drop-shadow(0 0 6px rgba(91, 232, 154, 0.9)); animation: footstep 1.6s infinite ease-in-out; }
.sending i:nth-child(even) { margin-top: 8px; }
.sending i:nth-child(2) { animation-delay: 0.2s; }
.sending i:nth-child(3) { animation-delay: 0.4s; }
.sending i:nth-child(4) { animation-delay: 0.6s; }
.moment { text-align: center; }
.moment .art img { width: min(60%, 220px); height: auto; display: block; margin: 0 auto 0.5rem; }
/* The wax seal, painted in CSS until seal.png arrives. */
.seal-fallback { width: 112px; height: 112px; margin: 0 auto 0.75rem; border-radius: 47% 53% 50% 50% / 52% 48% 52% 48%; display: grid; place-items: center;
  background: radial-gradient(circle at 38% 32%, #47c886, #1b8150 50%, #0b4a2b 80%);
  box-shadow: 0 0 0 4px rgba(11, 74, 43, 0.65), 0 0 0 7px rgba(27, 129, 80, 0.35), inset 0 -6px 10px rgba(0, 0, 0, 0.4), inset 0 4px 6px rgba(255, 255, 255, 0.25), 0 10px 22px rgba(0, 0, 0, 0.55), 0 0 30px rgba(91, 232, 154, 0.35); }
.seal-fallback i { width: 28px; height: 66px; background: url("ui/footprint.svg") center / contain no-repeat; opacity: 0.9; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.5)); }
.moment h2 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); }
.figure { margin: 0.25rem 0 0.75rem; }
.figure-number { display: block; font: 800 clamp(3.4rem, 12vw, 6rem)/1 var(--display); }
.figure-label { display: block; font-family: var(--display); letter-spacing: 0.16em; text-transform: uppercase; color: var(--tea); font-size: 0.95rem; margin-top: 0.3rem; }
.place { font: 700 1.25rem var(--display); color: var(--glow); text-shadow: 0 0 14px rgba(91, 232, 154, 0.5); margin: 0.5rem 0; }
.facts { list-style: none; padding: 0; margin: 1rem auto; max-width: 36rem; }
.facts li { margin: 0.45rem 0; }
.part { font: 700 1.15rem var(--display); color: var(--gold); }
details { margin: 1.25rem auto 0; max-width: 40rem; text-align: left; }
summary { cursor: pointer; font-family: var(--display); color: var(--tea); letter-spacing: 0.06em; text-align: center; }
details .facts { text-align: left; color: var(--muted); font-size: 1rem; list-style: disc; padding-left: 1.2rem; }

/* ------------------------------------------------------------------ footer */

.foot { margin-top: clamp(3rem, 7vw, 5rem); border-top: 1px solid #000; box-shadow: 0 -1px 0 rgba(242, 193, 78, 0.25); background: linear-gradient(180deg, #1a110c, #0e0907); color: var(--muted); font-size: 0.98rem; }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem 2rem; padding-top: 1.6rem; padding-bottom: 2rem; }
.foot p { margin: 0; }
.foot a { color: var(--vellum); }

@media (max-width: 520px) {
  body { font-size: 1.06rem; }
  .ledger td, .ledger th { padding: 0.5rem 0.35rem; }
  .ledger .hide-narrow { display: none; }
  .top nav a { padding: 0.35rem 0.5rem; font-size: 0.9rem; }
  .crest { width: 40px; height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .trail i { opacity: 0.3; }
  .sending i { opacity: 0.5; }
}
