/* The rules pages (/rules/ and /rules/full/). Same faces and palette as the
   landing page and the gallery; colors from art/STYLE.md. */

@font-face { font-family: "Grenze Gotisch"; src: url("/fonts/GrenzeGotisch.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Cinzel"; src: url("/fonts/Cinzel.woff2") format("woff2"); font-weight: 500 700; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("/fonts/EBGaramond.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("/fonts/EBGaramond-Italic.woff2") format("woff2"); font-weight: 400 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/Inter.woff2") format("woff2"); font-weight: 400 600; font-display: swap; }

:root {
  --char: #16110c; --char-soft: #221a12; --char-line: #3a2e21;
  --parchment: #e7d9bb; --parchment-deep: #d7c49d; --parchment-soft: #cdbb97;
  --ink: #211a12; --ink-soft: #5a4c39;
  --ember: #b3491a; --ember-deep: #983c13;
  --green: #4f7434; --green-shadow: #2b4419; --green-accent: #3d6224;
  --blue: #33639a; --blue-shadow: #1b3559; --blue-accent: #27507f;
  --orange: #b8521d; --orange-shadow: #6e2a0e; --orange-accent: #9c4217;
  --neutral: #7d6649; --spectral: #6a4f8e; --spectral-shadow: #33244a;
  --rule: rgba(33, 26, 18, 0.28);
  --display: "Grenze Gotisch", "Cinzel", serif;
  --eyebrow: "Cinzel", serif;
  --body: "EB Garamond", Georgia, serif;
  --ui: "Inter", system-ui, -apple-system, sans-serif;
  --pad: clamp(1.1rem, 6vw, 4.5rem);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-padding-top: 1rem; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
body {
  min-height: 100vh;
  background: radial-gradient(ellipse 70% 30% at 50% -5%, rgba(179, 73, 26, 0.14), transparent 65%), var(--char);
  color: var(--ink); font-family: var(--body); font-size: 1.1875rem; line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; }
a { color: inherit; }
.wrap { max-width: 1320px; margin: 0 auto; padding: 0 clamp(0.5rem, 3vw, 2rem) clamp(1rem, 4vw, 2.5rem); }
.nw { white-space: nowrap; }

.skip { position: absolute; left: -9999px; top: 0; z-index: 20; background: var(--parchment); color: var(--ink); padding: 0.5rem 1rem; font-family: var(--ui); }
.skip:focus { left: 1rem; top: 1rem; }

/* ---------- site header (as on the gallery) ---------- */
.top { display: flex; align-items: center; gap: 1.2rem; padding: 1rem clamp(0.25rem, 1vw, 0.5rem); color: var(--parchment); }
.wordmark { font-family: var(--display); font-weight: 600; font-size: 1.6rem; text-decoration: none; line-height: 1; }
.top nav { display: flex; align-items: center; gap: 1.1rem; margin-left: auto; font-family: var(--ui); font-size: 0.9rem; }
.top nav a { text-decoration: none; color: var(--parchment-soft); }
.top nav a:hover { color: var(--parchment); }
.top nav a[aria-current] { color: var(--parchment); font-weight: 600; box-shadow: inset 0 -2px 0 var(--ember); padding-bottom: 0.15rem; }
.top nav a.play { color: #fff; background: var(--ember); border-radius: 999px; padding: 0.15rem 0.8rem; }
.top a:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; }

/* ---------- the parchment sheet (as on the landing page) ---------- */
.sheet {
  position: relative;
  max-width: 1060px; margin: 0 auto;
  background:
    radial-gradient(circle 240px at 85% 4%, rgba(122, 89, 41, 0.10), transparent 70%),
    radial-gradient(circle 320px at 8% 30%, rgba(122, 89, 41, 0.08), transparent 70%),
    radial-gradient(circle 280px at 90% 62%, rgba(122, 89, 41, 0.07), transparent 70%),
    radial-gradient(circle 200px at 70% 96%, rgba(74, 48, 22, 0.12), transparent 70%),
    repeating-linear-gradient(94deg, rgba(122, 89, 41, 0.035) 0 2px, transparent 2px 5px),
    linear-gradient(178deg, var(--parchment) 0%, var(--parchment) 80%, var(--parchment-deep) 100%);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55), 0 24px 70px rgba(0, 0, 0, 0.55), inset 0 0 90px rgba(74, 48, 22, 0.18);
  overflow: hidden;
  /* clip, not hidden, where supported: it clips the same but lets the chapter bar stick */
  overflow: clip;
}

/* ---------- type ---------- */
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.05; letter-spacing: 0.005em; }
h2 { font-size: clamp(1.8rem, 4vw, 2.4rem); }
h3 { font-size: clamp(1.35rem, 2.6vw, 1.6rem); }
p + p { margin-top: 0.75rem; }
strong { font-weight: 700; }
.eyebrow { font-family: var(--eyebrow); font-weight: 600; font-size: 0.82rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft); }
.marginalia { font-style: italic; color: var(--ink-soft); font-size: 1rem; }
.subtitle { font-style: italic; color: var(--ember); font-size: clamp(1.2rem, 2.6vw, 1.5rem); }
.text-link, .prose a { color: var(--ink); text-decoration: underline; text-decoration-color: rgba(33, 26, 18, 0.4); text-underline-offset: 3px; }
.text-link:hover, .prose a:hover { color: var(--ember); text-decoration-color: var(--ember); }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid var(--ember); outline-offset: 3px; }

.btn {
  display: inline-block; font-family: var(--ui); font-weight: 600; font-size: 0.98rem; letter-spacing: 0.01em;
  text-decoration: none; padding: 0.8rem 1.35rem; border: 1.5px solid var(--ink); color: var(--ink);
  background: transparent; cursor: pointer; transition: background 0.18s ease, transform 0.18s ease;
  line-height: 1.3;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--ember); border-color: var(--ember); color: var(--parchment); }
.btn-primary:hover { background: var(--ember-deep); border-color: var(--ember-deep); }
.btn-ghost:hover { background: rgba(33, 26, 18, 0.08); }
.btn-light { border-color: var(--parchment); color: var(--parchment); }
.btn-light:hover { background: rgba(231, 217, 187, 0.12); }
.cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }

/* ---------- icons (art/icons) ---------- */
/* Mechanical icons: a bare ink glyph. */
.i { display: inline-block; width: 1em; height: 1em; vertical-align: -0.14em; fill: currentColor; margin-right: 0.18em; }
/* Elemental icons: always the glyph in a filled color disc. */
.pip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.15em; height: 1.15em; border-radius: 50%; vertical-align: -0.2em; margin-right: 0.2em;
  color: var(--parchment); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}
.pip .i { width: 0.72em; height: 0.72em; margin: 0; vertical-align: 0; }
.pip-green { background: var(--green); }
.pip-blue { background: var(--blue); }
.pip-orange { background: var(--orange); }
.stat { white-space: nowrap; font-family: var(--ui); font-weight: 600; font-size: 0.9em; font-variant-numeric: tabular-nums; }

/* ======================================================================
   /rules/ — the simple rules
   ====================================================================== */

.simple .sheet { animation: sheet-in 0.8s ease-out both; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* hero: the painting, with the title over its foot */
.hero { position: relative; color: var(--parchment); background: var(--char); }
.hero img { display: block; width: 100%; height: clamp(250px, 30vw, 360px); object-fit: cover; object-position: 50% 42%; }
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to top, rgba(22, 17, 12, 0.96) 0%, rgba(22, 17, 12, 0.72) 30%, rgba(22, 17, 12, 0.08) 62%, transparent 75%),
    linear-gradient(to right, rgba(22, 17, 12, 0.55), transparent 55%);
}
.hero-text { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 0 var(--pad) clamp(1.1rem, 3vw, 2rem); }
.hero .eyebrow { color: rgba(231, 217, 187, 0.75); }
.hero h1 { font-size: clamp(2.6rem, 7vw, 4.6rem); line-height: 0.92; margin: 0.15rem 0 0.35rem; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.6); }
.hero .subtitle { color: #f0b98f; max-width: 48ch; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7); }
.hero .btn-ghost { border-color: var(--parchment); color: var(--parchment); }
.hero .btn-ghost:hover { background: rgba(231, 217, 187, 0.12); }
.hero-credit { position: absolute; top: 0.8rem; right: 1rem; z-index: 1; font-size: 0.85rem; font-style: italic; color: rgba(231, 217, 187, 0.65); }

/* chapter bar: sticks to the top of the window, one scrollable row */
.chapters {
  position: sticky; top: 0; z-index: 6;
  padding: 0.55rem clamp(0.6rem, 3vw, 2.2rem); border-bottom: 1.5px solid var(--rule); border-top: 1.5px solid var(--rule);
  background: rgba(231, 217, 187, 0.97);
  box-shadow: 0 6px 14px -10px rgba(33, 26, 18, 0.55);
}
.chapters ol {
  list-style: none; display: flex; flex-wrap: nowrap; gap: 0.3rem; overflow-x: auto; scrollbar-width: none;
}
/* fade the edge only when the row really scrolls (set by the page script) */
.chapters ol.scrolls { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 2rem), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 2rem), transparent); padding-right: 1.5rem; }
.chapters ol::-webkit-scrollbar { display: none; }
.chapters li { flex: none; }
.chapters a {
  display: inline-flex; align-items: baseline; gap: 0.35rem; text-decoration: none; font-family: var(--ui); font-size: 0.8rem; white-space: nowrap;
  padding: 0.3rem 0.6rem; border: 1px solid var(--rule); border-radius: 999px; background: rgba(255, 250, 240, 0.35);
}
.chapters a:hover { background: rgba(255, 250, 240, 0.85); border-color: var(--ink-soft); }
.chapters a span { font-family: var(--eyebrow); font-weight: 600; font-size: 0.7rem; letter-spacing: 0.08em; color: var(--ember-deep); }
.chapters a[aria-current] { background: var(--ink); border-color: var(--ink); color: var(--parchment); }
.chapters a[aria-current] span { color: #f0b98f; }
.chapters a:focus-visible { outline-offset: 1px; }
/* sections land below the bar */
.simple .chapter, .simple .quick { scroll-margin-top: 3.4rem; }

/* Learn in 90 seconds */
.quick { padding: clamp(1.6rem, 4vw, 2.5rem) var(--pad) clamp(1.6rem, 4vw, 2.4rem); }
.quick-head .eyebrow { display: block; color: var(--ember-deep); margin-bottom: 0.3rem; }
.quick-head h2 { font-size: clamp(1.7rem, 3.6vw, 2.2rem); }
.quick-lead { margin-top: 0.5rem; max-width: 62ch; }
.quick-steps { list-style: none; counter-reset: q; margin: 1.1rem 0 0; display: grid; gap: 0.45rem; }
.quick-steps li {
  counter-increment: q; position: relative; padding: 0.6rem 0.9rem 0.65rem 3.1rem; line-height: 1.45;
  border: 1px solid var(--rule); background: rgba(255, 250, 240, 0.45);
}
.quick-steps li::before {
  content: counter(q); position: absolute; left: 0.75rem; top: 0.55rem; width: 1.65rem; height: 1.65rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; background: var(--ember-deep); color: var(--parchment);
  font-family: var(--ui); font-weight: 600; font-size: 0.85rem;
}
.quick-steps b { font-family: var(--display); font-weight: 600; font-size: 1.15em; margin-right: 0.2rem; }
.quick-golden { margin: 1rem 0 1.2rem; font-size: 1.02rem; color: var(--ink-soft); }
.quick-golden b { color: var(--ink); }

.lead { padding: clamp(1.75rem, 4vw, 2.75rem) var(--pad) 0; font-size: clamp(1.2rem, 2.4vw, 1.4rem); max-width: calc(40ch + 2 * var(--pad)); }

/* a chapter */
.chapter { padding: clamp(2.6rem, 5.5vw, 4rem) var(--pad); border-bottom: 1.5px solid var(--rule); position: relative; }
.simple { font-size: 1.25rem; line-height: 1.66; }
.simple .prose p + p { margin-top: 1rem; }
.chapter:last-of-type { border-bottom: 0; }
.chapter-head { margin-bottom: 1.4rem; }
.chapter-head h2 { padding-bottom: 0.45rem; border-bottom: 3px solid var(--ink); display: inline-block; min-width: min(100%, 11ch); }
.chapter-head .eyebrow { display: block; margin-bottom: 0.35rem; }
.chapter.c-green .chapter-head h2 { border-color: var(--green); }
.chapter.c-blue .chapter-head h2 { border-color: var(--blue); }
.chapter.c-orange .chapter-head h2 { border-color: var(--ember); }
.chapter.c-spectral .chapter-head h2 { border-color: var(--spectral); }
.prose { max-width: 62ch; }
.prose ul, .prose ol { margin: 0.6rem 0 0 1.2rem; }
.prose li + li { margin-top: 0.3rem; }
.prose ul, .prose ol { margin-bottom: 0.75rem; }
.prose .key, .prose .checklist, .prose .steps { margin-left: 0; }
.prose .key li + li, .prose .checklist li + li { margin-top: 0; }
.prose h3 { margin: 2rem 0 0.5rem; }
.prose > :first-child { margin-top: 0; }

/* text beside a plate */
.split { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
.split.flip { grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr); }
.split.flip > .plate { order: -1; }

/* a painting tipped into the page */
.plate { margin: 0; }
.plate .frame {
  position: relative; padding: 7px; background: #f1e6cc;
  box-shadow: 0 0 0 1px rgba(33, 26, 18, 0.35), 0 10px 26px rgba(33, 26, 18, 0.3);
  transform: rotate(var(--tilt, 0.6deg));
}
.plate img { display: block; width: 100%; height: auto; }
.plate .frame::after { content: ""; position: absolute; inset: 7px; box-shadow: inset 0 0 0 1px rgba(33, 26, 18, 0.25), inset 0 0 40px rgba(22, 17, 12, 0.35); pointer-events: none; }
.plate figcaption { margin-top: 0.7rem; font-style: italic; font-size: 0.95rem; color: var(--ink-soft); text-align: center; }
.plate.soft .frame { padding: 0; background: none; box-shadow: none; transform: none; }
.plate.soft .frame::after { display: none; }
.plate.soft img { -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 60%, transparent 100%); mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 60%, transparent 100%); }

/* a painting across the sheet, fading into the paper */
.band { margin: 0 calc(-1 * var(--pad)) 1.6rem; position: relative; }
.chapter > .band:first-child { margin-top: calc(-1 * clamp(2.6rem, 5.5vw, 4rem)); }
.band img {
  display: block; width: 100%; height: clamp(170px, 30vw, 320px); object-fit: cover;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.6) 0%, #000 9%, #000 70%, transparent 100%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.6) 0%, #000 9%, #000 70%, transparent 100%);
}
.band figcaption { position: absolute; right: 1rem; top: 0.6rem; font-style: italic; font-size: 0.85rem; color: rgba(231, 217, 187, 0.8); text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8); }

/* a note in the margin */
.aside-note { margin-top: 1.3rem; padding: 0.75rem 1.05rem; border-left: 3px solid var(--neutral); background: rgba(255, 250, 240, 0.35); font-size: 1.04em; max-width: 62ch; }
.aside-note b { font-family: var(--ui); font-weight: 600; font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); margin-right: 0.35rem; }

/* Callouts: one look per kind, so they can be scanned for.
   Definition (ink, boxed), Example (dashed), Common mistake (red),
   Important rule (gold), Exception (spectral). */
.callout {
  --co: var(--ink); --co-bg: rgba(255, 250, 240, 0.5);
  margin: 1.3rem 0; padding: 0.75rem 1.05rem 0.85rem; max-width: 62ch;
  border: 1.5px solid var(--co); border-left-width: 6px; background: var(--co-bg);
  font-size: 1.04em; line-height: 1.55;
}
.callout p + p { margin-top: 0.4rem; }
.co-label {
  display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.3rem;
  font-family: var(--ui); font-weight: 600; font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--co);
}
.co-ico {
  flex: none; width: 1.45rem; height: 1.45rem; border-radius: 50%; background: var(--co); color: var(--parchment);
  display: inline-flex; align-items: center; justify-content: center; font-size: 0.85rem; font-weight: 700; letter-spacing: 0; line-height: 1;
}
.co-ico .i { width: 0.95rem; height: 0.95rem; margin: 0; vertical-align: 0; }
.callout b { font-weight: 700; }
.co-def { --co: var(--ink); --co-bg: rgba(255, 250, 240, 0.62); box-shadow: 3px 3px 0 rgba(33, 26, 18, 0.12); }
.co-ex { --co: #6b5636; --co-bg: repeating-linear-gradient(135deg, rgba(255, 250, 240, 0.3) 0 10px, rgba(255, 250, 240, 0.12) 10px 20px); border-style: dashed; border-left-style: solid; }
.co-mistake { --co: #8f2f1a; --co-bg: rgba(143, 47, 26, 0.08); }
.co-rule { --co: #6e5308; --co-bg: rgba(201, 150, 30, 0.16); border-top-width: 1.5px; box-shadow: inset 0 3px 0 rgba(201, 150, 30, 0.35); }
.co-except { --co: #5e4582; --co-bg: rgba(106, 79, 142, 0.09); }
.co-mistake .co-ico { font-size: 0.8rem; }

/* back to the top */
.to-top {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 12; opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
  font-family: var(--ui); font-size: 0.85rem; font-weight: 600; text-decoration: none;
  color: var(--parchment); background: var(--char); border: 1px solid var(--char-line);
  padding: 0.55rem 0.95rem; border-radius: 999px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}
.to-top::before { content: "↑ "; color: #f0b98f; }
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:focus-visible { outline: 3px solid #f0b98f; outline-offset: 2px; }

/* key: icon + word grids */
.key { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin: 1rem 0 0; padding: 0.7rem 0.95rem; border: 1px solid var(--rule); background: rgba(255, 250, 240, 0.3); font-size: 1.02rem; list-style: none; }
.key li { white-space: nowrap; }
.key .i { width: 1.15em; height: 1.15em; }
.key .pip { width: 1.3em; height: 1.3em; }

/* The three goals of a Shatter */
.checklist { list-style: none; counter-reset: c; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; margin: 1.3rem 0 0.4rem; }
.checklist li { counter-increment: c; padding: 0.8rem 0.9rem 0.85rem; border: 1.5px solid var(--ink); background: rgba(255, 250, 240, 0.35); line-height: 1.35; font-size: 1.05rem; }
.checklist li::before { content: counter(c); display: block; font-family: var(--display); font-size: 2rem; line-height: 1; color: var(--ember); margin-bottom: 0.3rem; }

/* ---------- diagram: the Spire ---------- */
.diagram { margin: 1.6rem 0 1.6rem; }
.diagram figcaption { margin-top: 0.7rem; font-style: italic; font-size: 0.95rem; color: var(--ink-soft); }
.spire-fig {
  position: relative; padding: 1.2rem clamp(0.6rem, 3vw, 1.6rem) 1.4rem; border: 1.5px solid var(--ink);
  background: rgba(255, 250, 240, 0.28); overflow: hidden;
}
.nml { text-align: center; font-family: var(--eyebrow); font-weight: 600; font-size: 0.74rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-soft);
  border: 1px dashed rgba(33, 26, 18, 0.45); padding: 0.45rem; margin-bottom: 1.2rem; background: repeating-linear-gradient(135deg, transparent 0 8px, rgba(33, 26, 18, 0.04) 8px 16px); }
.plinth-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(0.5rem, 2.5vw, 1.6rem); align-items: end; }
.pcol { display: flex; flex-direction: column; justify-content: flex-end; min-width: 0; }
.pcol-label { font-family: var(--eyebrow); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); text-align: center; margin-bottom: 0.4rem; min-height: 2.2em; display: flex; align-items: flex-end; justify-content: center; line-height: 1.15; }
.slip {
  position: relative; display: flex; align-items: center; gap: 0.35rem; min-width: 0;
  padding: 0.36rem 0.45rem; background: #f4ead2; border: 1px solid rgba(33, 26, 18, 0.55); border-bottom: 0;
  box-shadow: 0 -2px 5px rgba(33, 26, 18, 0.12); font-size: 0.82rem; line-height: 1.15;
}
.slip:last-child { border-bottom: 1px solid rgba(33, 26, 18, 0.55); }
.slip .nm { font-family: var(--display); font-size: 1.02rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.slip .st { font-family: var(--ui); font-weight: 600; font-size: 0.72rem; white-space: nowrap; color: var(--ink-soft); }
.slip .st .i { margin-right: 0.08em; }
.slip.crown { background: #fbf4e2; padding-top: 0.55rem; padding-bottom: 0.55rem; box-shadow: 0 -3px 10px rgba(33, 26, 18, 0.2); }
.slip.crown::before { content: ""; position: absolute; left: -1px; right: -1px; top: -4px; height: 4px; background: var(--ember); }
.slip .pip { flex: none; }
.plinth-base {
  margin-top: 0; padding: 0.45rem 0.4rem 0.4rem; text-align: center; color: var(--parchment);
  background: linear-gradient(#6d6a64, #4a463f); border: 1px solid #2c2925; border-top: 3px solid #8a857c;
  font-family: var(--display); font-size: 0.98rem; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.plinth-base small { display: block; font-family: var(--ui); font-size: 0.66rem; color: #d9d2c4; margin-top: 0.15rem; white-space: nowrap; }
.empty-plinth { height: 2.4rem; border: 1px dashed rgba(33, 26, 18, 0.45); border-bottom: 0; display: flex; align-items: center; justify-content: center; font-style: italic; font-size: 0.85rem; color: var(--ink-soft); }
.monolith-slab {
  margin: 1.1rem auto 0; width: min(62%, 320px); text-align: center; color: var(--parchment); padding: 0.7rem 0.6rem 0.6rem;
  background: linear-gradient(#4a3c2a, #2b2218); border: 1px solid #16110c; border-top: 3px solid #7d6649;
  clip-path: polygon(6% 0, 94% 0, 100% 100%, 0 100%);
}
.monolith-slab .nm { font-family: var(--display); font-size: 1.15rem; display: block; line-height: 1.1; }
.monolith-slab small { font-family: var(--ui); font-size: 0.72rem; color: #d9cbb0; }
.you { text-align: center; margin-top: 0.6rem; font-family: var(--eyebrow); font-weight: 600; font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-soft); }

/* ---------- diagram: one Pillar, labelled ---------- */
.pillar-fig { display: grid; grid-template-columns: minmax(0, 17.5rem) minmax(0, 1fr); column-gap: 1.2rem; row-gap: 0; margin: 1.4rem 0 0.4rem; max-width: 42rem; }
.pillar-fig .slip { font-size: 0.9rem; padding: 0.55rem 0.6rem; border-bottom: 0; }
.pillar-fig .slip:nth-last-child(3) { border-bottom: 1px solid rgba(33, 26, 18, 0.55); }
.pillar-fig .slip .nm { font-size: 1.12rem; }
.pillar-fig .slip.crown { padding: 0.8rem 0.6rem; }
.pillar-fig .lab { display: flex; align-items: center; gap: 0.6rem; font-size: 1rem; line-height: 1.25; border-left: 2px solid var(--ink); padding: 0.3rem 0 0.3rem 0.7rem; }
.pillar-fig .lab b { font-family: var(--eyebrow); font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; min-width: 4.6rem; flex: none; }
.pillar-fig .lab.crown-l { border-color: var(--ember); }
.pillar-fig .lab.crown-l b { color: var(--ember); }
.pillar-fig .enters { grid-column: 1 / -1; font-style: italic; font-size: 0.95rem; color: var(--ink-soft); margin-top: 0.5rem; }
.pillar-fig .enters::before { content: "↑ "; font-style: normal; color: var(--ember); }

/* ---------- diagram: the turn ---------- */
.turn-strip { list-style: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; margin: 1.4rem 0 1.5rem; counter-reset: step; }
.turn-strip > li {
  position: relative; padding: 0.85rem 0.85rem 0.95rem 0.95rem; border: 1.5px solid var(--ink); margin-left: -1.5px;
  background: rgba(255, 250, 240, 0.35); font-size: 0.98rem; line-height: 1.35; counter-increment: step;
}
.turn-strip > li:first-child { margin-left: 0; }
.turn-strip > li::before { content: counter(step); position: absolute; top: 0.55rem; right: 0.7rem; font-family: var(--display); font-size: 1.4rem; line-height: 1; color: rgba(33, 26, 18, 0.25); }
.turn-strip h3 { font-size: 1.35rem; margin-bottom: 0.3rem; }
.turn-strip .theater { background: var(--char); color: var(--parchment); border-color: var(--char); }
.turn-strip .theater::before { color: rgba(231, 217, 187, 0.35); }
.turn-strip .theater ol { list-style: none; margin-top: 0.35rem; font-family: var(--ui); font-size: 0.78rem; line-height: 1.5; color: var(--parchment-soft); }
.turn-strip .theater ol li::before { content: "› "; color: #f0b98f; }

/* ---------- diagram: the Countdown track ---------- */
.countdown-fig svg { display: block; width: 100%; height: auto; }
.countdown-fig { padding: 0.8rem clamp(0.4rem, 2vw, 1rem) 0.6rem; border: 1.5px solid var(--ink); background: rgba(255, 250, 240, 0.28); }
.cd-key { display: flex; flex-wrap: wrap; gap: 0.3rem 1.4rem; font-family: var(--ui); font-size: 0.82rem; margin-top: 0.4rem; color: var(--ink-soft); }
.cd-key span::before { content: ""; display: inline-block; width: 1.4rem; height: 0; border-top: 2.5px solid var(--c); vertical-align: middle; margin-right: 0.4rem; }
.cd-key .dash::before { border-top-style: dashed; }

/* ---------- diagram: a landing hit ---------- */
.hit-fig { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.2fr); gap: 1rem; align-items: center; margin: 1.3rem 0 0.4rem; padding: 1rem clamp(0.7rem, 2.5vw, 1.4rem); border: 1.5px solid var(--ink); background: rgba(255, 250, 240, 0.28); }
.hit-fig .attacker { text-align: center; }
.hit-fig .attacker .slip { border-bottom: 1px solid rgba(33, 26, 18, 0.55); justify-content: center; }
.hit-fig .attacker p { font-family: var(--ui); font-size: 0.8rem; margin-top: 0.4rem; color: var(--ink-soft); line-height: 1.35; }
.hit-fig .arrow { font-family: var(--ui); font-weight: 600; text-align: center; color: var(--ember); font-size: 0.8rem; line-height: 1.2; }
.hit-fig .arrow span { display: block; font-size: 2rem; line-height: 1; }
.hit-fig .stack .slip { font-size: 0.88rem; }
.hit-fig .dmg { margin-left: auto; font-family: var(--ui); font-weight: 600; font-size: 0.74rem; white-space: nowrap; color: #fff; background: #8f2f1a; border-radius: 999px; padding: 0.1rem 0.5rem; }
.hit-fig .falls .nm, .hit-fig .falls .st, .hit-fig .falls .pip { opacity: 0.55; }
.hit-fig .falls .nm { text-decoration: line-through; text-decoration-color: #8f2f1a; text-decoration-thickness: 2px; }
.hit-fig .repel { grid-column: 1 / -1; font-size: 1rem; border-top: 1px solid var(--rule); padding-top: 0.65rem; }
.steps { counter-reset: s; list-style: none; margin: 0.8rem 0 0 !important; }
.steps > li { counter-increment: s; position: relative; padding-left: 2rem; }
.steps > li::before { content: counter(s); position: absolute; left: 0; top: 0.05rem; width: 1.4rem; height: 1.4rem; border-radius: 50%; background: var(--ink); color: var(--parchment); font-family: var(--ui); font-size: 0.75rem; font-weight: 600; display: flex; align-items: center; justify-content: center; }

/* ---------- two-up boxes ---------- */
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem; margin: 1.1rem 0 1.5rem; }
.duo > div { padding: 0.85rem 1rem 0.95rem; border: 1.5px solid var(--ink); background: rgba(255, 250, 240, 0.35); font-size: 1.04rem; line-height: 1.45; }
.duo h3 { font-size: 1.35rem; margin-bottom: 0.3rem; }
.trio { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: 0.6rem 1.4rem; margin-top: 1rem; }
.cards-grid div { font-size: 1.02rem; line-height: 1.45; padding-top: 0.5rem; border-top: 1px solid var(--rule); }
.cards-grid b { font-family: var(--display); font-weight: 600; font-size: 1.2rem; display: block; }

/* ---------- the Dusk: a charred strip ---------- */
.dusk { position: relative; color: var(--parchment); background: var(--char); padding: 0; border-bottom: 0; overflow: hidden; }
.dusk > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; opacity: 0.85; }
.dusk::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to right, rgba(22, 17, 12, 0.97) 0%, rgba(22, 17, 12, 0.9) 42%, rgba(22, 17, 12, 0.4) 72%, rgba(22, 17, 12, 0.15) 100%); }
.dusk-inner { position: relative; z-index: 2; padding: clamp(2.5rem, 6vw, 4rem) var(--pad); }
.dusk::before { z-index: 1; }
.dusk .hero-credit { z-index: 2; }
.dusk .eyebrow { color: rgba(231, 217, 187, 0.7); }
.dusk .chapter-head h2 { border-color: #c0392b; }
.dusk .prose { max-width: 52ch; }
.dusk .prose a { color: var(--parchment); text-decoration-color: rgba(231, 217, 187, 0.5); }
.dusk .aside-note { background: rgba(22, 17, 12, 0.55); border-color: #f0b98f; }
.dusk .aside-note b { color: #f0b98f; }
.clock { list-style: none; display: flex; flex-wrap: wrap; gap: 3px; margin: 1.2rem 0 0.4rem; max-width: 34rem; align-items: stretch; }
.clock li { flex: 1 0 1.35rem; min-height: 1.9rem; display: flex; align-items: center; justify-content: center; font-family: var(--ui); font-size: 0.68rem; font-weight: 600; background: rgba(231, 217, 187, 0.14); border: 1px solid rgba(231, 217, 187, 0.25); color: var(--parchment-soft); }
.clock li.late { background: rgba(192, 57, 43, 0.35); border-color: rgba(240, 185, 143, 0.5); color: #fff; }
.clock li.dusk-turn { flex: 2 0 3.2rem; background: #8f2f1a; border-color: #f0b98f; color: #fff; }
.clock-cap { font-family: var(--ui); font-size: 0.8rem; color: var(--parchment-soft); }

/* ---------- setup ---------- */
.bring { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.6rem; margin: 1rem 0 1.2rem; }
.bring li { padding: 0.7rem 0.8rem; border: 1.5px solid var(--ink); background: rgba(255, 250, 240, 0.35); font-size: 0.98rem; line-height: 1.35; }
.bring b { display: block; font-family: var(--display); font-weight: 600; font-size: 1.25rem; }
.bring .n { font-family: var(--ui); font-weight: 600; font-size: 0.8rem; color: var(--ember); display: block; margin-bottom: 0.15rem; }
.setup-steps { margin-left: 1.3rem !important; }

/* ---------- ending ---------- */
.next { padding: clamp(2.5rem, 6vw, 4rem) var(--pad); text-align: center; background: repeating-linear-gradient(to bottom, transparent 0 35px, rgba(33, 26, 18, 0.08) 35px 36px); }
.next h2 { margin-bottom: 0.5rem; }
.next p { max-width: 46ch; margin: 0 auto 1.4rem; }
.next .cta-row { justify-content: center; }
.page-foot { padding: 1.6rem var(--pad) 2rem; border-top: 1.5px solid var(--rule); font-family: var(--ui); font-size: 0.85rem; color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: 0.6rem 1.6rem; justify-content: space-between; }
.page-foot a { color: var(--ink); text-underline-offset: 3px; text-decoration-color: rgba(33, 26, 18, 0.35); }
.page-foot nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.2rem; }

/* ---------- responsive (simple) ---------- */
@media (max-width: 860px) {
  .split, .split.flip { grid-template-columns: 1fr; }
  .split > .plate, .split.flip > .plate { order: -1; max-width: 32rem; margin: 0 auto 0.2rem; width: 100%; }
  .split > .plate.soft { max-width: 17rem; }
  .plate.tall img { aspect-ratio: 3 / 2; object-fit: cover; object-position: var(--pos, 50% 50%); }
  .turn-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
  .turn-strip > li { margin-left: 0; }
  .turn-strip .theater { grid-column: 1 / -1; grid-row: 3; }
  .bring { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dusk > img { position: relative; height: clamp(200px, 50vw, 340px); object-position: 50% 30%; opacity: 1; }
  .dusk::before { inset: 0 0 auto 0; height: clamp(200px, 50vw, 340px); z-index: 1; background: linear-gradient(to bottom, rgba(22, 17, 12, 0) 40%, rgba(22, 17, 12, 1) 100%); }
  .dusk-inner { margin-top: -3.5rem; z-index: 2; padding-top: 0; }
  .dusk .hero-credit { z-index: 2; }
}
@media (max-width: 600px) {
  body { font-size: 1.125rem; }
  .simple { font-size: 1.1875rem; line-height: 1.65; }
  .wrap { padding-left: 0; padding-right: 0; }
  .top { padding-left: 0.9rem; padding-right: 0.9rem; gap: 0.8rem; }
  .top nav { gap: 0.85rem; font-size: 0.85rem; }
  .hero img { height: 260px; object-position: 50% 35%; }
  .callout { padding: 0.7rem 0.85rem 0.8rem; }
  .quick-steps li { padding-left: 2.8rem; }
  .quick-steps li::before { left: 0.6rem; }
  .to-top { right: 0.75rem; bottom: 0.75rem; }
  .checklist { grid-template-columns: 1fr; }
  .checklist li { display: flex; gap: 0.8rem; align-items: baseline; }
  .checklist li::before { margin: 0; font-size: 1.6rem; }
  .duo, .trio { grid-template-columns: 1fr; }
  .turn-strip { grid-template-columns: 1fr; }
  .turn-strip .theater { grid-row: auto; }
  .pillar-fig { grid-template-columns: minmax(0, 42%) minmax(0, 1fr); column-gap: 0.7rem; }
  .pillar-fig .lab { flex-direction: column; align-items: flex-start; gap: 0.1rem; font-size: 0.92rem; padding-left: 0.55rem; }
  .pillar-fig .slip .nm { white-space: normal; font-size: 1rem; line-height: 1.05; }
  .pillar-fig .slip .st { display: none !important; }
  .spire-fig { padding-left: 0.5rem; padding-right: 0.5rem; }
  .plinth-row { gap: 0.35rem; }
  .slip { padding: 0.3rem 0.3rem; gap: 0.25rem; }
  .slip .nm { white-space: normal; font-size: 0.86rem; line-height: 1.05; overflow-wrap: anywhere; }
  .slip .pip { font-size: 0.8rem; }
  .plinth-base { white-space: normal; font-size: 0.82rem; padding: 0.35rem 0.2rem; }
  .pcol-label { font-size: 0.6rem; letter-spacing: 0.06em; min-height: 3.4em; }
  .monolith-slab { width: 78%; }
  .clock { gap: 2px; }
  .clock li { flex: 1 1 0; min-width: 0; font-size: 0.62rem; min-height: 1.7rem; }
  .clock li.dusk-turn { flex: 1 0 100%; }
  .hit-fig { grid-template-columns: 1fr; }
  .hit-fig .arrow span { transform: rotate(90deg); }
  .slip .st { display: none; }
  .pillar-fig .slip .st, .hit-fig .slip .st { display: inline; }
  .plinth-base small { white-space: normal; }
  .bring { grid-template-columns: 1fr 1fr; }
  .chapters { padding-top: 0.45rem; padding-bottom: 0.45rem; }
  .chapters a { font-size: 0.8rem; padding: 0.25rem 0.6rem; }
}

/* ======================================================================
   /rules/full/ — the comprehensive rules
   ====================================================================== */

.full-grid { display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); gap: clamp(1rem, 2.5vw, 2rem); align-items: start; }
.full .sheet { max-width: 920px; margin: 0; width: 100%; }

.toc-side {
  position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; overscroll-behavior: contain;
  color: var(--parchment-soft); font-family: var(--ui); font-size: 0.84rem; line-height: 1.35;
  padding: 0.2rem 0.5rem 1rem 0.25rem; scrollbar-width: thin; scrollbar-color: var(--char-line) transparent;
}
.toc-title { font-family: var(--eyebrow); font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; font-size: 0.76rem; color: var(--parchment); margin: 0.3rem 0 0.6rem; }
.toc-list, .toc-sub { list-style: none; }
.toc-list > li { margin: 0.1rem 0; }
.toc-list a { display: flex; gap: 0.5rem; text-decoration: none; padding: 0.22rem 0.4rem; border-radius: 4px; }
.toc-side .toc-list a:hover { color: var(--parchment); background: rgba(231, 217, 187, 0.06); }
.toc-side a[aria-current] { color: var(--parchment); background: rgba(179, 73, 26, 0.22); box-shadow: inset 2px 0 0 var(--ember); }
.toc-no { flex: none; width: 1.3rem; text-align: right; color: #8d7c62; font-variant-numeric: tabular-nums; }
.toc-sub { margin: 0 0 0.2rem 1.8rem; font-size: 0.8rem; }
.toc-sub a { padding: 0.14rem 0.4rem; }
.toc-qr > a { color: #f0b98f; font-weight: 600; }

.rules-sheet { padding: 0 0 0; }
.rules-title { padding: clamp(1.5rem, 4vw, 2.6rem) var(--pad) 1.3rem; position: relative; }
.rules-title h1 { font-size: clamp(2.3rem, 6vw, 3.9rem); line-height: 0.95; margin: 0.35rem 0 0.35rem; }
.rules-title .h1-small { display: block; font-size: 0.55em; color: var(--ink-soft); margin-top: 0.15rem; }
.rules-title .subtitle { margin-bottom: 1rem; }
.rules-title .lede { font-size: clamp(1.15rem, 2.3vw, 1.3rem); max-width: 50ch; margin-bottom: 1.1rem; }
.rules-title .btn { font-size: 0.88rem; padding: 0.6rem 1rem; }

.toc-inline { display: none; margin: 0 var(--pad) 1.2rem; border: 1.5px solid var(--ink); background: rgba(255, 250, 240, 0.35); font-family: var(--ui); font-size: 0.92rem; }
.toc-inline summary { cursor: pointer; padding: 0.7rem 1rem; font-family: var(--eyebrow); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; font-size: 0.8rem; }
.toc-inline .toc-list { padding: 0 0.6rem 0.8rem; columns: 2; column-gap: 1rem; }
.toc-inline .toc-list > li { break-inside: avoid; }
.toc-inline .toc-no { color: var(--ember); }
.toc-inline .toc-qr > a { color: var(--ember); }
.toc-inline .toc-sub { display: none; }
.toc-inline a:hover { background: rgba(33, 26, 18, 0.06); }

.rules-body { padding: 0 var(--pad) 1rem; line-height: 1.7; }
.rules-body h2[id], .rules-body h3[id], .rules-body [id] { scroll-margin-top: 1rem; }
.rules-body h2 { font-size: clamp(1.8rem, 3.6vw, 2.3rem); margin: 3rem 0 1rem; padding-bottom: 0.45rem; border-bottom: 3px solid var(--ink); display: flex; align-items: baseline; gap: 0.6rem; }
.rules-body h3 { margin: 1.9rem 0 0.6rem; display: flex; align-items: baseline; gap: 0.5rem; }
.sec-no { font-family: var(--eyebrow); font-weight: 600; font-size: 0.55em; color: var(--ember); min-width: 1.3em; letter-spacing: 0.04em; }
.anchor { margin-left: auto; font-family: var(--body); font-size: 0.6em; color: rgba(33, 26, 18, 0.28); text-decoration: none; padding: 0 0.2rem; }
h2:hover .anchor, h3:hover .anchor, .anchor:focus-visible { color: var(--ember); }
.rules-body p, .rules-body li { max-width: 68ch; }
.rules-body p { margin-top: 0.85rem; }
.rules-body ul, .rules-body ol { margin: 0.6rem 0 0 1.4rem; }
.rules-body li { margin-top: 0.45rem; padding-left: 0.15rem; }
.rules-body li::marker { color: var(--ink-soft); font-family: var(--ui); font-size: 0.85em; }
.rules-body ol > li::marker { font-weight: 600; }
.rules-body a { color: var(--ink); text-decoration: underline; text-decoration-color: rgba(179, 73, 26, 0.5); text-underline-offset: 2px; }
.rules-body a:hover { color: var(--ember); }
.rules-body code { font-family: ui-monospace, "DejaVu Sans Mono", Menlo, monospace; font-size: 0.82em; background: rgba(33, 26, 18, 0.07); padding: 0.05em 0.3em; border-radius: 3px; }
.rules-body p.example { margin-top: 0.5rem; padding: 0.5rem 0.8rem; border-left: 3px solid var(--rule); background: rgba(255, 250, 240, 0.35); }
.rules-body :target { animation: flash 1.6s ease-out; }
@keyframes flash { from { background-color: rgba(179, 73, 26, 0.18); } to { background-color: transparent; } }
.rules-body .arrow { color: var(--ember); }
.rules-body .i { width: 0.95em; height: 0.95em; }

.table-wrap { margin: 0.8rem 0 0.5rem; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
table { border-collapse: collapse; width: 100%; font-size: 1rem; line-height: 1.4; background: rgba(255, 250, 240, 0.35); }
th, td { text-align: left; vertical-align: top; padding: 0.5rem 0.7rem; border: 1px solid rgba(33, 26, 18, 0.25); }
thead th { font-family: var(--eyebrow); font-weight: 600; font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; background: var(--ink); color: var(--parchment); border-color: var(--ink); }
tbody th { font-weight: 600; min-width: 9rem; }
tbody tr:nth-child(even) { background: rgba(33, 26, 18, 0.035); }
.table-title { font-family: var(--eyebrow); font-weight: 600; font-size: 0.85rem; letter-spacing: 0.1em; text-transform: uppercase; margin-top: 1.4rem !important; display: flex; align-items: baseline; }
.table-title strong { font-weight: 600; }

.changes { margin-top: 0.4rem; padding: 0.2rem 1.1rem 1.1rem; border: 1.5px solid var(--ink); background: rgba(255, 250, 240, 0.25); }
.changes > h2 { margin-top: 1rem; font-size: 1.6rem; border-bottom-width: 2px; }
.change h3 { font-size: 1.3rem; margin: 1.1rem 0 0.4rem; }
details.change { border-top: 1px solid var(--rule); }
details.change > summary { cursor: pointer; list-style: none; }
details.change > summary::-webkit-details-marker { display: none; }
details.change > summary h3 { margin: 0.7rem 0; font-size: 1.15rem; color: var(--ink-soft); }
details.change > summary h3::before { content: "▸"; font-family: var(--ui); font-size: 0.8em; color: var(--ember); margin-right: 0.2rem; transition: transform 0.15s; }
details.change[open] > summary h3::before { content: "▾"; }
details.change[open] { padding-bottom: 0.8rem; }
.change .table-wrap table { font-size: 0.95rem; }

.rules-body .callout { max-width: 68ch; }
.rules-body .callout ol { margin-top: 0.2rem; }
.rules-body li .callout { margin: 0.7rem 0 0.4rem; }
.rules-body .callout p, .rules-body .callout li { max-width: none; }
.rules-body .callout .co-label { margin-top: 0; }

/* The quick reference is a card of its own. */
.quickref { margin: 2.6rem calc(-1 * var(--pad) + 0.6rem) 0; padding: 0.3rem calc(var(--pad) - 0.6rem) 1.6rem; background: var(--char); color: var(--parchment); border-radius: 2px; }
.quickref h2 { color: var(--parchment); border-color: var(--ember); margin-top: 1.6rem; }
.quickref h2 .anchor { color: rgba(231, 217, 187, 0.35); }
.quickref p { padding: 0.65rem 0 0.1rem; border-top: 1px solid rgba(231, 217, 187, 0.15); margin-top: 0.4rem; max-width: none; }
.quickref p:first-of-type { border-top: 0; }
.quickref strong { color: #f0b98f; }
.quickref .arrow { color: #f0b98f; }
.quickref a { color: var(--parchment); }
.quickref em { color: #fff; }

figure.layout { margin: 1.2rem 0 0.4rem; }
figure.layout pre {
  font-family: ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace; line-height: 1.3;
  font-size: min(0.9rem, 2.3vw); background: rgba(255, 250, 240, 0.45); border: 1.5px solid var(--ink);
  padding: 1rem; overflow-x: auto; white-space: pre;
}
figure.layout figcaption { font-style: italic; font-size: 0.95rem; color: var(--ink-soft); margin-top: 0.5rem; }

.sheet-foot { margin-top: 2rem; padding: 1.4rem var(--pad) 2rem; border-top: 1.5px solid var(--rule); font-family: var(--ui); font-size: 0.85rem; color: var(--ink-soft); }
.sheet-foot p + p { margin-top: 0.4rem; }
.sheet-foot a { color: var(--ink); text-underline-offset: 3px; }

.sec-bar { display: none; }
.cid { white-space: nowrap; font-family: var(--ui); font-size: 0.78em; color: var(--ink-soft); }
tbody th .cid { display: block; margin-top: 0.1rem; }

@media (max-width: 1080px) {
  .full-grid { display: block; }
  .full .sheet { margin: 0 auto; }
  .toc-side { display: none; }
  .toc-inline { display: block; }
  /* the section you're in, once the inline contents are off screen */
  .sec-bar {
    display: flex; align-items: center; gap: 0.75rem; position: fixed; left: 0; right: 0; top: 0; z-index: 11;
    padding: 0.5rem 0.9rem; background: rgba(22, 17, 12, 0.96); color: var(--parchment); border-bottom: 1px solid var(--char-line);
    font-family: var(--ui); font-size: 0.85rem; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    transform: translateY(-110%); visibility: hidden; transition: transform 0.2s, visibility 0.2s;
  }
  .sec-bar.away { transform: none; visibility: visible; }
  .sec-toc { flex: none; text-decoration: none; font-weight: 600; color: var(--char); background: var(--parchment); border-radius: 999px; padding: 0.3rem 0.75rem; }
  .sec-toc::before { content: "☰ "; }
  .sec-now { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--parchment-soft); }
  .sec-toc:focus-visible { outline: 3px solid #f0b98f; outline-offset: 2px; }
  .rules-body h2[id], .rules-body h3[id], .rules-body [id] { scroll-margin-top: 3.4rem; }
}
@media (max-width: 600px) {
  .toc-inline .toc-list { columns: 1; }
  .rules-body h2 { font-size: 1.75rem; }
  .rules-body { line-height: 1.62; }
  .changes { padding: 0.1rem 0.8rem 0.9rem; }
  table { font-size: 0.92rem; }
  th, td { padding: 0.45rem 0.5rem; }
  tbody th { min-width: 7rem; }
  .quickref { margin-left: -0.4rem; margin-right: -0.4rem; padding-left: calc(var(--pad) + 0.4rem); padding-right: calc(var(--pad) + 0.4rem); }
  figure.layout pre { padding: 0.7rem 0.5rem; font-size: 2.35vw; }
}

/* ---------- print (both pages; mostly the full rules) ---------- */
@media print {
  @page { margin: 16mm 15mm 18mm; }
  html { scroll-behavior: auto; }
  body { background: #fff; color: #000; font-size: 10.5pt; line-height: 1.42; }
  .wrap { max-width: none; padding: 0; }
  .top, .toc-side, .noprint, .to-contents, .to-top, .sec-bar, .skip, .anchor, .chapters, .band, .hero-credit { display: none !important; }
  .callout { break-inside: avoid; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .quick .cta-row { display: none; }
  .sheet { background: none; box-shadow: none; max-width: none; overflow: visible; animation: none; }
  .full-grid { display: block; }
  :root { --pad: 0; }
  .rules-title { padding: 0 0 8pt; }
  .rules-title h1 { font-size: 30pt; }
  .toc-inline { display: block; border: 0; background: none; margin: 0 0 10pt; break-after: page; }
  .toc-inline summary { display: none; }
  .toc-inline .toc-list { columns: 2; padding: 0; font-size: 10pt; }
  .toc-inline .toc-sub { display: block; font-size: 9pt; }
  .toc-inline a { padding: 1pt 0; }
  .rules-body h2 { font-size: 17pt; margin: 16pt 0 6pt; border-bottom-width: 1.5pt; break-after: avoid; }
  .rules-body h3 { font-size: 13pt; margin: 10pt 0 4pt; break-after: avoid; }
  .rules-body p, .rules-body li { max-width: none; orphans: 3; widows: 3; }
  .rules-body a { color: inherit; text-decoration: none; }
  table { background: none; font-size: 9.5pt; }
  thead th { background: #eee; color: #000; border-color: #999; }
  th, td { border-color: #999; }
  tr, .table-wrap, figure, .example { break-inside: avoid; }
  .table-wrap { overflow: visible; }
  .changes { border: 1pt solid #999; background: none; break-after: page; }
  details.change > summary h3::before { content: none !important; }
  details.change:not([open]) { display: none; }
  .changes::after { content: "Earlier changes: spiretcg.com/rules/full/#changes"; display: block; font-family: var(--ui); font-size: 8.5pt; color: #555; margin-top: 6pt; }
  .table-title { break-after: avoid; }
  .quickref { background: none; color: #000; border: 1.5pt solid #000; margin: 14pt 0 0; padding: 4pt 10pt 8pt; break-before: page; break-inside: avoid; }
  .quickref h2 { color: #000; }
  .quickref strong, .quickref .arrow, .quickref em, .quickref a { color: #000; }
  .quickref p { border-color: #ccc; }
  figure.layout pre { font-size: 8pt; background: none; }
  .sheet-foot { margin-top: 12pt; padding: 6pt 0 0; }
  .pip, .plinth-base, .monolith-slab, .slip, .dmg, .checklist li, .countdown-fig svg { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .hero .cta-row, .next .cta-row, .page-foot nav { display: none; }
  /* the simple page prints plainly */
  .hero { background: none; color: #000; }
  .hero img, .hero::after { display: none; }
  .hero-text { position: static; padding: 0 0 8pt; }
  .hero .subtitle, .hero .eyebrow { color: #000; }
  .chapter { padding: 10pt 0; break-inside: auto; }
  .plate { display: none; }
  .split, .split.flip { grid-template-columns: 1fr; }
  .dusk { background: none; color: #000; }
  .dusk > img, .dusk::before { display: none; }
  .dusk-inner { padding: 10pt 0; }
  .dusk .eyebrow, .dusk .prose a { color: #000; }
  .clock li { color: #000; border-color: #999; background: none; }
  .clock li.late, .clock li.dusk-turn { background: #ddd; color: #000; }
  .turn-strip .theater { background: #eee; color: #000; }
  .turn-strip .theater ol { color: #000; }
}

/* The site-wide header and footer (/css/site.css) inside these pages' layout. */
.wrap > .site-top { padding-left: clamp(0.25rem, 1vw, 0.5rem); padding-right: clamp(0.25rem, 1vw, 0.5rem); }
.site-foot { max-width: 1320px; margin: 0 auto; padding-left: clamp(1rem, 3vw, 2.5rem); padding-right: clamp(1rem, 3vw, 2.5rem); box-sizing: border-box; }
@media (max-width: 720px) { .wrap > .site-top { padding-left: 0.9rem; padding-right: 0.9rem; } }
@media print { .site-top, .site-foot { display: none !important; } }
