/* WRITTEN BY tools/seo.js — the field guide's sheet. The :root block is the game's
   own token block, copied out of style.css on every build (declarations only);
   the rest is tools/seo/page.css. Edit those, never this file. */
:root {
  --gilt-ink: #2a1c06;
  --gilt-seat: #6d5117;
  --gilt-deep: #7a5e20;
  --gold-dk: #9c7a2a;
  --gilt-body: #c6ae76;
  --gold: #d8b24a;
  --gold-lt: #f3d889;
  --gilt-lit: #ffd86a;
  --gold-hi: #ffe9a8;
  --gold-bright: #fff3c8;
  --gold-rgb: 216, 178, 74;
  --gilt-lit-rgb: 255, 216, 106;
  --lit-rgb: 255, 230, 170;
  --shade-rgb: 0, 0, 0;
  --bg: #0a0b08;
  --ink: #ecdfc4;
  --muted: #b7a98c;
  --ready: #7fe09a;
  --ready-lt: #b4f7c6;
  --ready-dk: #3fb463;
  --ready-rgb: 127, 224, 154;
  --peril: #e0786a;
  --peril-lt: #f2a293;
  --peril-rgb: 216, 50, 44;
  --ready-ink: #06150b;
  --hall-rgb: 12, 9, 16;
  --hall-lit-rgb: 30, 22, 38;
  --cloth-ink: #fff8ea;
  --panel-1: rgba(36, 30, 22, 0.94);
  --panel-2: rgba(18, 14, 10, 0.96);
  --plate: linear-gradient(160deg, var(--panel-1), var(--panel-2));
  --edge: rgba(var(--gold-rgb), 0.45);
  --edge-strong: rgba(var(--gold-rgb), 0.72);
  --edge-quiet: rgba(var(--gold-rgb), 0.22);
  --sh-0: 0 1px 2px rgba(var(--shade-rgb), 0.60);
  --sh-1: 0 2px 6px rgba(var(--shade-rgb), 0.40);
  --sh-2: 0 4px 12px rgba(var(--shade-rgb), 0.45);
  --sh-3: 0 6px 22px rgba(var(--shade-rgb), 0.55);
  --sh-4: 0 12px 34px rgba(var(--shade-rgb), 0.62);
  --bevel: inset 0 1px 0 rgba(var(--lit-rgb), 0.08);
  --seat: inset 0 0 0 1px rgba(var(--shade-rgb), 0.45);
  --r-xs: 3px;
  --r-sm: 5px;
  --r-md: 7px;
  --r-lg: 9px;
  --r-xl: 12px;
  --r-2xl: 16px;
  --r-3xl: 20px;
  --r-pill: 999px;
  --sp-1: 3px;
  --sp-2: 5px;
  --sp-3: 8px;
  --sp-4: 12px;
  --sp-5: 16px;
  --sp-6: 22px;
  --pad-plate: 9px 12px;
  --gutter: 8px;
  --e-out: cubic-bezier(.2, .8, .3, 1);
  --e-back: cubic-bezier(.2, .85, .3, 1.35);
  --e-back-lg: cubic-bezier(.2, .85, .3, 1.5);
  --e-in: cubic-bezier(.5, 0, .75, 0);
  --t-1: 90ms;
  --t-2: 160ms;
  --t-3: 280ms;
  --t-4: 460ms;
  --font-logo: "Grenze Gotisch", "Grenze", Georgia, serif;
  --font-hero: "Grenze Gotisch", "Grenze", Georgia, serif;
  --font-display: "Grenze", Georgia, serif;
  --font-flavor: "Grenze", Georgia, serif;
  --font-ui: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
  --font-title: var(--font-display);
  --font-body: var(--font-ui);
  --nums: tabular-nums lining-nums;
  --rack: 0.825;
  --ui: 1;
  --screenw: min(1320px, 94vw);
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
}

/* ═══════════════════════════════════════════════════════════════════════════
              THE FIELD GUIDE — the manuscript, off the battlefield
   ═══════════════════════════════════════════════════════════════════════════
   The layout half of public/css/pages.css. tools/seo.js writes that file as the
   game's own token block — read out of style.css's :root, so a token changed
   there is changed here — followed by this. Every colour, face, radius, shadow
   and curve below is a var(); the literals are sizes and one breakpoint.

   WHY NOT style.css ITSELF: it is a 991 KB battlefield HUD, and a page a search
   engine sends somebody to has to paint its words long before that would have
   finished arriving on a phone. The guide carries the language, not the game.

   THE GAME'S RULES HOLD HERE TOO. One candle, from above. No italics. Every
   figure tabular. A kingdom's colour is cloth — a stripe down a plate — and
   never the colour of a word. The gilt button is the only gilt fill on a page. */

.pg {
  /* the measure every page is set to: a reading width, not the glass */
  --pg-w: min(1120px, calc(100vw - 32px));
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(90% 55% at 50% -12%, rgba(var(--gold-rgb), 0.11), transparent 62%), var(--bg);
  color: var(--ink);
  font: 400 17px/1.65 var(--font-ui);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
.pg *, .pg *::before, .pg *::after { box-sizing: border-box; }
.pg img { max-width: 100%; }
.pg em, .pg i { font-style: normal; }
.pg strong { font-weight: 700; color: var(--gold-lt); }
.pg p { margin: 14px 0 0; }

/* a word that is a link reads as gilt, underlined in engraved gold */
.pg a:not([class]) {
  color: var(--gold-lt);
  text-decoration: underline;
  text-decoration-color: rgba(var(--gold-rgb), 0.45);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--t-2) var(--e-out), text-decoration-color var(--t-2) var(--e-out);
}
.pg a:not([class]):hover { color: var(--gilt-lit); text-decoration-color: var(--gilt-lit); }
.pg :focus-visible { outline: 2px solid var(--gilt-lit); outline-offset: 2px; }

.pg-skip {
  position: absolute; left: 16px; top: -64px; z-index: 10;
  padding: 10px 14px; border-radius: var(--r-md);
  background: var(--plate); border: 1px solid var(--edge-strong);
  color: var(--gold-lt); text-decoration: none;
}
.pg-skip:focus { top: 12px; }

/* ---- the bar ------------------------------------------------------------ */
.pg-top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: var(--sp-5);
  padding: 10px max(16px, calc((100vw - var(--pg-w)) / 2));
  background: linear-gradient(180deg, var(--panel-1), var(--panel-2));
  border-bottom: 1px solid var(--edge);
  box-shadow: var(--sh-3), var(--bevel);
}
.pg-brand {
  display: inline-flex; align-items: center; gap: var(--sp-3); flex: none;
  font: 800 23px/1 var(--font-logo); letter-spacing: 0.4px;
  color: var(--gold-lt); text-decoration: none;
}
.pg-brand img { width: 76px; height: auto; }
.pg-brand span { font-size: 19px; }
.pg-nav { display: flex; gap: var(--sp-1); flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.pg-nav a {
  flex: none; padding: 9px 10px; border-radius: var(--r-sm);
  font: 700 13px/1 var(--font-display); letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--gilt-body); text-decoration: none;
  transition: color var(--t-2) var(--e-out), background-color var(--t-2) var(--e-out);
}
.pg-nav a:hover { color: var(--gold-lt); background: rgba(var(--gold-rgb), 0.08); }
.pg-nav a.on, .pg-nav a[aria-current] { color: var(--gold-lt); box-shadow: inset 0 -2px 0 var(--gold); }

/* the one gilt act: play */
.pg-play, .pg-cta {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  padding: 11px 18px; border-radius: var(--r-md);
  border: 1px solid var(--gilt-seat);
  background: linear-gradient(180deg, var(--gilt-lit), var(--gold) 55%, var(--gold-dk));
  box-shadow: var(--sh-2), inset 0 1px 0 var(--gold-hi);
  font: 800 14px/1 var(--font-display); letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--gilt-ink); text-decoration: none; white-space: nowrap;
  transition: box-shadow var(--t-2) var(--e-out), transform var(--t-1) var(--e-out);
}
.pg-play:hover, .pg-cta:hover { box-shadow: var(--sh-3), inset 0 1px 0 var(--gold-hi); }
.pg-play:active, .pg-cta:active { transform: translateY(1px); box-shadow: var(--sh-1), inset 0 1px 0 var(--gold-hi); }
.pg-cta { padding: 14px 22px; font-size: 15px; }

/* ---- where you are ------------------------------------------------------ */
.pg-crumbs {
  width: var(--pg-w); margin: var(--sp-5) auto 0;
  font: 600 13.5px/1.4 var(--font-display); letter-spacing: 0.5px; color: var(--muted);
}
.pg-crumbs ol { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: 0; padding: 0; list-style: none; }
.pg-crumbs li + li::before { content: '›'; margin-right: var(--sp-2); color: var(--gilt-deep); }
.pg-crumbs a:not([class]) { color: var(--gilt-body); text-decoration: none; }
.pg-crumbs a:not([class]):hover { color: var(--gold-lt); }

.pg-main { width: var(--pg-w); margin: 0 auto; padding: 8px 0 24px; }

/* ---- the head of a page ------------------------------------------------- */
.pg-hero {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 28px;
  margin: 18px 0 0; padding: 30px 32px; border-radius: var(--r-xl);
  background: radial-gradient(120% 140% at 0% 0%, rgba(var(--gold-rgb), 0.10), transparent 58%), var(--plate);
  border: 1px solid var(--edge);
  box-shadow: var(--sh-3), var(--seat), var(--bevel);
}
.pg-hero.plain { grid-template-columns: 1fr; }
/* A kingdom's cloth, where a page belongs to one: a banner stripe down the
   plate's edge, in the colours of its FACTIONS row. Never a word's colour. */
.pg-hero[data-cloth]::before, .pg-card[data-cloth]::before {
  content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 6px;
  background: linear-gradient(180deg, var(--cloth), var(--cloth-dk));
}
.pg-card[data-cloth]::before { width: 4px; }
.pg h1 {
  margin: 0;
  font: 900 clamp(34px, 5.6vw, 58px)/1.02 var(--font-logo);
  letter-spacing: 0.5px; color: var(--gold-lt);
  text-shadow: 0 2px 0 var(--gold-dk), 0 3px 0 var(--gilt-seat), 0 10px 26px rgba(var(--shade-rgb), 0.8);
  text-wrap: balance;
}
.pg-kicker {
  margin: 0 0 var(--sp-2);
  font: 700 13px/1.3 var(--font-display); letter-spacing: 3px; text-transform: uppercase;
  color: var(--gilt-body);
}
.pg-lede { margin: var(--sp-4) 0 0; max-width: 64ch; font-size: 19px; line-height: 1.55; color: var(--ink); text-wrap: pretty; }
.pg-motto {
  margin: var(--sp-3) 0 0;
  font: 800 15px/1.3 var(--font-display); letter-spacing: 2.2px; text-transform: uppercase;
  color: var(--gold);
}
.pg-figure {
  display: grid; place-items: center; margin: 0;
  width: 184px; height: 184px; border-radius: var(--r-xl);
  background: radial-gradient(closest-side, rgba(var(--hall-lit-rgb), 0.95), rgba(var(--hall-rgb), 0.9));
  border: 1px solid var(--edge);
  box-shadow: var(--seat), var(--bevel);
}
.pg-figure img { width: 160px; height: 160px; object-fit: contain; }
.pg-figure.crest img { width: 134px; height: 160px; }

/* ---- sections ----------------------------------------------------------- */
.pg-sec { margin-top: 46px; }
.pg-sec > h2 {
  margin: 0;
  font: 800 clamp(25px, 3.3vw, 32px)/1.15 var(--font-logo);
  letter-spacing: 0.3px; color: var(--gold-lt);
}
.pg-sec > h2::after {
  content: ''; display: block; height: 1px; margin-top: 10px;
  background: linear-gradient(90deg, var(--edge-strong), transparent);
}
.pg-sec h3 {
  margin: 26px 0 0;
  font: 800 14px/1.3 var(--font-display); letter-spacing: 1.8px; text-transform: uppercase;
  color: var(--gold);
}
.pg-sec > p, .pg-sec > .pg-ul, .pg-sec > .pg-say { max-width: 74ch; }
.pg-muted { color: var(--muted); }
.pg-ul { margin: 14px 0 0; padding-left: 22px; }
.pg-ul li { margin: 7px 0; }
.pg-ul li::marker { color: var(--gold-dk); }
.pg-cols { margin: 14px 0 0; padding: 0; list-style: none; columns: 3 220px; column-gap: 24px; }
.pg-cols li { break-inside: avoid; padding: 3px 0; }

/* ---- plates ------------------------------------------------------------- */
.pg-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); margin-top: 18px; }
.pg-grid.tight { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.pg-card {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 6px;
  padding: 18px 18px 18px 20px; border-radius: var(--r-lg);
  background: var(--plate); border: 1px solid var(--edge);
  box-shadow: var(--sh-2), var(--seat), var(--bevel);
  color: var(--ink); text-decoration: none;
  transition: border-color var(--t-2) var(--e-out), box-shadow var(--t-2) var(--e-out), transform var(--t-2) var(--e-out);
}
a.pg-card:hover { border-color: var(--edge-strong); box-shadow: var(--sh-3), var(--seat), var(--bevel); transform: translateY(-2px); }
.pg-card h3 { margin: 0; font: 800 21px/1.15 var(--font-display); letter-spacing: 0.2px; text-transform: none; color: var(--gold-lt); }
.pg-card p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--muted); }
.pg-card .pg-kicker { margin: 0; font-size: 11px; letter-spacing: 2px; }
.pg-card .art { display: block; width: 72px; height: 72px; object-fit: contain; margin-bottom: 4px; }

/* ---- figures ------------------------------------------------------------ */
.pg-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 18px 0 0; }
.pg-stats > div {
  padding: 14px; border-radius: var(--r-md);
  background: var(--plate); border: 1px solid var(--edge-quiet);
  box-shadow: var(--sh-1), var(--bevel);
}
.pg-stats dt { font: 700 11px/1.25 var(--font-display); letter-spacing: 1.6px; text-transform: uppercase; color: var(--gilt-body); }
.pg-stats dd { margin: 6px 0 0; font: 800 26px/1 var(--font-display); color: var(--ink); font-variant-numeric: var(--nums); }
.pg-stats dd small { display: block; margin-top: 6px; font: 500 13px/1.3 var(--font-ui); color: var(--muted); }

.pg-tablewrap {
  margin-top: 18px; overflow-x: auto;
  border: 1px solid var(--edge-quiet); border-radius: var(--r-lg);
  background: rgba(var(--shade-rgb), 0.28);
}
.pg-table { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: var(--nums); }
.pg-table caption {
  padding: 12px 14px 0; text-align: left;
  font: 700 13px var(--font-display); letter-spacing: 1.4px; text-transform: uppercase; color: var(--gilt-body);
}
.pg-table th, .pg-table td { padding: 9px 12px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--edge-quiet); white-space: nowrap; }
.pg-table thead th {
  background: var(--panel-2);
  font: 700 12px/1.2 var(--font-display); letter-spacing: 1.4px; text-transform: uppercase; color: var(--gilt-body);
}
.pg-table tbody tr:last-child > * { border-bottom: 0; }
.pg-table tbody tr:hover { background: rgba(var(--gold-rgb), 0.05); }
.pg-table tbody th { font-weight: 700; }
.pg-table .n { text-align: right; }
.pg-table .w { white-space: normal; min-width: 26ch; font-size: 14.5px; color: var(--muted); }
.pg-table .thumb { display: inline-block; width: 34px; height: 34px; object-fit: contain; vertical-align: middle; margin-right: 10px; }

.pg-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.pg-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; border-radius: var(--r-pill);
  border: 1px solid var(--edge); background: rgba(var(--gold-rgb), 0.06);
  font: 700 13px/1.2 var(--font-display); letter-spacing: 0.6px;
  color: var(--gold-lt); text-decoration: none;
  transition: border-color var(--t-2) var(--e-out), background-color var(--t-2) var(--e-out);
}
a.pg-chip:hover { border-color: var(--edge-strong); background: rgba(var(--gold-rgb), 0.13); }
.pg-chip b { font-variant-numeric: var(--nums); color: var(--gilt-body); }

/* a swatch whose colour is data — a tincture, a division — set by the page as --sw */
.pg-swatch {
  display: inline-block; width: 18px; height: 18px; margin-right: 10px; vertical-align: -3px;
  border-radius: var(--r-xs); background: var(--sw);
  border: 1px solid var(--edge-quiet); box-shadow: var(--seat);
}

.pg kbd {
  display: inline-block; min-width: 28px; padding: 3px 8px; border-radius: var(--r-sm);
  border: 1px solid var(--edge); background: var(--plate);
  box-shadow: var(--sh-0), var(--bevel);
  font: 700 13px/1.4 var(--font-display); color: var(--gold-lt); text-align: center;
}

/* ---- the words the game speaks ----------------------------------------- */
/* Voice is colour, face and size — never italics. */
.pg-say { margin: 16px 0 0; padding: 4px 0 4px 18px; border-left: 2px solid var(--gold-dk); }
.pg-say p { margin: 0; font: 500 19px/1.5 var(--font-flavor); color: var(--gilt-body); }
.pg-say cite {
  display: block; margin-top: 6px; font-style: normal;
  font: 700 12px/1.3 var(--font-display); letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted);
}

/* a numbered run of fields — the campaign's ten, the guide's steps */
.pg-steps { display: grid; gap: 12px; margin: 18px 0 0; padding: 0; list-style: none; }
.pg-steps > li {
  display: grid; grid-template-columns: 52px 1fr; gap: 16px;
  padding: 16px 18px; border-radius: var(--r-lg);
  background: var(--plate); border: 1px solid var(--edge-quiet);
  box-shadow: var(--sh-1), var(--bevel);
}
.pg-steps .no { font: 900 30px/1 var(--font-logo); color: var(--gold); text-align: center; font-variant-numeric: var(--nums); }
.pg-steps h3 { margin: 0; font: 800 21px/1.2 var(--font-display); letter-spacing: 0.2px; text-transform: none; color: var(--gold-lt); }
.pg-steps p { margin: 6px 0 0; }
.pg-steps .tag { font: 700 12.5px/1.3 var(--font-display); letter-spacing: 1.3px; text-transform: uppercase; color: var(--gilt-body); }

/* questions and their answers */
.pg-qa > h3 { margin-top: 30px; font: 800 21px/1.3 var(--font-display); letter-spacing: 0.2px; text-transform: none; color: var(--gold-lt); }

/* ---- the ask ------------------------------------------------------------ */
.pg-call {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 24px;
  margin-top: 52px; padding: 24px 28px; border-radius: var(--r-xl);
  background: radial-gradient(120% 180% at 0% 0%, rgba(var(--gold-rgb), 0.14), transparent 60%), var(--plate);
  border: 1px solid var(--edge-strong);
  box-shadow: var(--sh-3), var(--seat), var(--bevel);
}
.pg-call p { margin: 0; max-width: 52ch; font: 700 21px/1.35 var(--font-display); color: var(--gold-lt); }

/* ---- the foot ----------------------------------------------------------- */
.pg-foot {
  margin-top: 72px;
  padding: 40px max(16px, calc((100vw - var(--pg-w)) / 2)) 44px;
  border-top: 1px solid var(--edge);
  background: linear-gradient(180deg, rgba(var(--hall-rgb), 0.55), rgba(var(--hall-rgb), 0.95));
}
.pg-foot-cols { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.pg-foot h2 {
  margin: 0 0 10px;
  font: 700 12px/1.2 var(--font-display); letter-spacing: 2px; text-transform: uppercase;
  color: var(--gilt-body);
}
.pg-foot ul { margin: 0; padding: 0; list-style: none; }
.pg-foot li { margin: 7px 0; }
.pg-foot a:not([class]) { color: var(--ink); text-decoration: none; }
.pg-foot a:not([class]):hover { color: var(--gold-lt); }
.pg-foot-play { margin: 28px 0 0; font: 700 18px/1.4 var(--font-display); color: var(--gold-lt); }
.pg-foot-play a:not([class]) { color: var(--gold-lt); text-decoration: underline; text-decoration-color: rgba(var(--gold-rgb), 0.45); }
.pg-foot-fine { margin: 10px 0 0; max-width: 80ch; font-size: 14px; color: var(--muted); }

@media (max-width: 760px) {
  .pg { font-size: 16px; }
  .pg-top { flex-wrap: wrap; row-gap: 6px; }
  .pg-nav { order: 3; flex-basis: 100%; }
  .pg-play { margin-left: auto; padding: 9px 13px; font-size: 13px; }
  .pg-hero { grid-template-columns: 1fr; padding: 22px 20px; gap: 18px; }
  .pg-figure { width: 140px; height: 140px; }
  .pg-figure img { width: 120px; height: 120px; }
  .pg-figure.crest img { width: 100px; height: 120px; }
  .pg-lede { font-size: 17.5px; }
  .pg-steps > li { grid-template-columns: 38px 1fr; gap: 12px; padding: 14px; }
  .pg-steps .no { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  a.pg-card:hover { transform: none; }
}
