:root {
  --paper:#f4f0e7; --paper-deep:#e8e1d2; --page:#faf8f2;
  --ink:#20211d; --ink-soft:#484941; --faded:#777267;
  --rule:#cac4b5; --accent:#893f31; --accent-dark:#6d3025;
  --sans: "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --nav: "Helvetica Neue", Arial, sans-serif;
  --serif: Iowan Old Style, Baskerville, "Palatino Linotype", Palatino, Georgia, serif;
}
*, *::before, *::after {box-sizing:border-box}
html {scroll-behavior:smooth;scroll-padding-top:20px}
body {margin:0;color:var(--ink);background:var(--paper);font-family:var(--serif);-webkit-font-smoothing:antialiased}
body.drawer-open {overflow:hidden}
::selection {background:#d8b99e;color:#181916}
a {color:var(--accent-dark);text-underline-offset:.18em}
a:hover {color:#be4a30}
button {font:inherit}
button:focus-visible,a:focus-visible,summary:focus-visible,.table-scroll:focus-visible {outline:3px solid #b06949;outline-offset:3px}
.skip-link {position:fixed;top:-70px;left:15px;z-index:300;padding:12px 20px;background:var(--paper);color:var(--ink)}
.skip-link:focus {top:12px}

/* Book-cover opening: original woodcut, re-composed for a digital viewport. */
.cover {height:100vh;height:100svh;min-height:530px;max-height:none;background:#0a0b09;color:#fff;position:relative;isolation:isolate;overflow:hidden}
.cover::before {content:"";position:absolute;inset:18px;border:1px solid rgba(255,255,255,.28);z-index:3;pointer-events:none}
.cover::after {content:"";position:absolute;inset:auto 0 0;height:28%;background:linear-gradient(transparent,#0a0b09 94%);z-index:1;pointer-events:none}
.cover-inner {height:100%;margin:auto;max-width:1500px;padding:clamp(26px,4.6vh,55px) clamp(26px,4.5vw,80px) 36px;position:relative;display:flex;flex-direction:column;align-items:center}
.cover-titles {position:relative;text-align:center;margin-top:clamp(24px,6vh,65px);z-index:4;text-shadow:0 2px 8px #080808}
.cover-kicker {margin:0 0 9px;font:700 .79rem/1 var(--sans);text-transform:uppercase;letter-spacing:.37em;color:#ece7df}
.cover h1 {margin:0;font-family:Impact,"Arial Black", "Helvetica Neue",Arial,sans-serif;font-size:clamp(2.8rem,7.7vw,8.1rem);line-height:1.07;letter-spacing:.016em;white-space:nowrap;font-weight:900}
.cover h1 span {font-family:var(--sans);font-size:.65em;font-weight:700;text-transform:lowercase;letter-spacing:-.045em}
.cover-subtitle {margin:8px 0 0;font:700 clamp(.82rem,1.42vw,1.27rem)/1.3 var(--sans);letter-spacing:.1em}
.cover-subtitle span {letter-spacing:.07em;padding:0 .4em}
.cover-illustration {position:absolute;z-index:0;width:min(1040px,92vw);height:min(73svh,830px);left:50%;bottom:1.5%;transform:translateX(-50%);object-fit:contain;object-position:center bottom;mix-blend-mode:screen;opacity:.96;pointer-events:none}
.cover-footline {position:absolute;z-index:4;inset:auto clamp(27px,4.5vw,80px) 35px;display:flex;justify-content:center;gap:10px;color:#cfcec8;font:700 .61rem/1.3 var(--sans);letter-spacing:.23em;text-transform:uppercase}

/* The in-flow contents page is an editorial frontispiece, not a second sidebar. */
.contents-section {background:var(--paper);padding:clamp(55px,7vw,105px) 22px clamp(60px,7vw,105px)}
.contents-frame {max-width:1200px;margin:auto}
.toc-headpiece {display:block;width:min(100%,700px);height:auto;max-height:260px;object-fit:contain;margin:0 auto 39px;mix-blend-mode:multiply}
.eyebrow {text-align:center;font:700 .68rem/1.5 var(--sans);letter-spacing:.32em;color:var(--accent);text-transform:uppercase}
.contents-section h2 {overflow-wrap:anywhere;font:900 clamp(2.5rem,5.7vw,5.8rem)/1 var(--sans);text-align:center;letter-spacing:-.035em;margin:15px 0 18px;text-transform:uppercase}
.toc-grid {display:grid;gap:30px;margin-top:48px}
.toc-card {min-width:0;display:grid;grid-template-columns:minmax(190px,1fr) minmax(0,2.4fr);gap:24px 40px;border-top:2px solid var(--ink);padding-top:22px}
.toc-frontmatter > ul {grid-column:2}
.toc-card:last-child {border-bottom:2px solid var(--ink);padding-bottom:22px}
.toc-card h3 {font:800 clamp(1.15rem,1.4vw,1.4rem)/1.3 var(--sans);margin:0;letter-spacing:.015em}
.toc-card h3 a {text-decoration:none;color:var(--ink)}
.toc-card h3 a:hover {color:var(--accent)}
.toc-card ul,.spell-index ul {list-style:none;padding:0;margin:0}
.toc-card > ul {columns:2;column-gap:32px}
.toc-card li {margin:0 0 10px}
.toc-card li a {display:inline-block}
.toc-card li li,.toc-card .toc-class-group {break-inside:avoid}
.toc-card li ul {margin:9px 0 0 8px;padding-left:14px;border-left:1px solid var(--rule)}
.toc-card li a {color:var(--ink-soft);text-decoration:none;font:400 1.0625rem/1.5 var(--nav)}
.toc-card li a:hover {text-decoration:underline;color:var(--accent)}
.spell-index {margin-top:64px;padding:23px 0;border-top:1px solid var(--rule);border-bottom:1px solid var(--rule)}
.chapter-six > .spell-index {grid-column:2;margin-top:0;min-width:0}
.chapter-six .letter-grid {grid-template-columns:repeat(3,minmax(0,1fr))}
.toc-card .letter-list li a {font:inherit}
.spell-index>summary {cursor:pointer;font:800 1rem/1.4 var(--sans);letter-spacing:.05em;list-style-position:inside}
.letter-grid {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:20px 26px;margin-top:25px}
.letter-list {border-top:1px solid var(--rule);padding-top:8px}
.letter-list summary {cursor:pointer;font:800 1rem var(--sans)}
.letter-list ul {padding-top:10px}
.letter-list li {margin:0 0 9px;font:1rem/1.5 var(--nav)}
.letter-list li a {text-decoration:none}
.toc-tailpiece {display:block;width:min(100%,670px);height:auto;mix-blend-mode:multiply;margin:63px auto 0}

/* Reading column: high-legibility paperback proportions, no imposed print columns. */
.reading-shell {display:flex;flex-direction:column;gap:clamp(32px,5vw,72px);max-width:1270px;margin:0 auto}
.book-section {background:var(--page);border-left:1px solid #e7e1d4;border-right:1px solid #e7e1d4;box-shadow:0 0 80px rgba(60,45,21,.045)}
.book-text {max-width:790px;margin:0 auto;padding:clamp(60px,7vw,110px) clamp(24px,4vw,38px) 115px;font:400 clamp(1.03rem,1.1vw,1.13rem)/1.77 var(--serif);text-wrap:pretty;overflow-wrap:break-word}
.book-text > * {scroll-margin-top:80px}
.book-text :is(h2,h3,h4,h5) {text-wrap:balance;overflow-wrap:anywhere}
.book-text .chapter-title {font:900 clamp(1.85rem,3vw,2.65rem)/1.16 var(--sans);letter-spacing:.012em;background:var(--ink);color:#fffdf6;margin:105px 0 48px;padding:23px 26px;text-transform:uppercase}
.book-text :is(.section-title,.frontmatter-title) {font:800 clamp(1.42rem,2.5vw,1.93rem)/1.28 var(--serif);letter-spacing:-.012em;margin:66px 0 21px;padding-top:14px;border-top:1px solid #c3bdad}
.book-text h2 + h3.section-title {border-top:0}
.book-text > .frontmatter-title:first-of-type,.book-text > .chapter-title:first-child {margin-top:0}
.book-text > :last-child {margin-bottom:0}
.book-text #kezdet {border-top:0;padding-top:0}
.book-text .detail-title {font:800 1.1rem/1.4 var(--serif);margin:30px 0 14px}
.book-text .subsection-title {font:800 clamp(1.13rem,1.85vw,1.36rem)/1.3 var(--serif);margin:36px 0 15px}
.book-text .spell-title {font:800 clamp(1.16rem,1.85vw,1.37rem)/1.36 var(--serif);margin-top:47px;padding-bottom:9px;border-bottom:1px solid var(--rule)}
.book-text p {margin:0 0 1.16em;hyphens:auto}
.book-text .ability-formula {font-size:1.25em;line-height:1.5}
.book-text strong {font-weight:800;color:#141511}
.preface-signoff {margin:32px 0 0;text-align:right;font-family:var(--nav);font-size:clamp(.8rem,2.5vw,1rem)}
.preface-signoff .author-signature {display:block;width:11.5em;max-width:100%;height:auto;margin:0 0 4px auto}
.preface-signoff p {margin:0;font-size:inherit;line-height:1.6}
.preface-signoff strong {display:block;font-size:1.1em}
.preface-date {display:block;white-space:nowrap}
.book-text em {font-style:italic}
.book-text ul,.book-text ol {margin:0 0 1.5em;padding-left:1.45em}
.book-text li {margin-bottom:.42em}
.book-text li::marker {color:currentColor}
.book-text li p {margin-bottom:.55em}
.book-text blockquote {margin:1.7em 0;padding:0 1.5em;border-left:3px solid var(--accent);color:var(--ink-soft);font-style:italic}
.book-text hr {height:1px;background:var(--rule);border:0;margin:45px 0}
.book-text code {background:#e7e3d8;padding:.1rem .22rem;border-radius:2px;font-size:.84em;overflow-wrap:anywhere}
.book-text pre {overflow-x:auto;padding:16px;background:#ebe6da}
.book-text a {text-decoration-thickness:.8px}

/* Tables are complete and accessible on narrow screens, with no clipped values. */
.table-scroll {position:relative;left:50%;transform:translateX(-50%);width:max-content;min-width:calc(100% + min(32px,4vw));max-width:min(calc(100vw - 32px),1192px);margin:24px 0 35px;overflow-x:auto;overscroll-behavior-inline:contain;scrollbar-width:thin;scrollbar-color:#aaa293 transparent;border:1px solid var(--rule);background:#fffefa;box-shadow:0 3px 12px rgba(40,30,10,.028)}
.table-scroll:focus {outline-offset:1px}
.rules-table {width:100%;border-collapse:collapse;line-height:1.42;font:400 clamp(.82rem,1vw,.9rem)/1.45 var(--sans);color:#282a25;min-width:max-content}
.rules-table th,.rules-table td {padding:9px 12px;border-right:1px solid #dbd5c8;border-bottom:1px solid #e2dcce;vertical-align:top;max-width:300px;min-width:70px;white-space:normal;text-align:left}
.rules-table th:last-child,.rules-table td:last-child {border-right:0}
.rules-table tr:last-child td {border-bottom:0}
.rules-table thead th {background:#272922;color:#f9f7f0;border-right-color:#616156;font-weight:800}
.rules-table thead th strong {color:inherit}
.rules-table.bonus-spells thead th[rowspan] {vertical-align:middle}
.rules-table tbody tr:nth-child(even) {background:#f5f0e7}
.rules-table.units-table :is(th,td) {border-right:0}
.rules-table.check-examples thead tr:first-child th {border-right:0}
.rules-table.check-examples tbody {background:#fffefa}
.rules-table.check-examples tbody:nth-of-type(even) {background:#f5f0e7}
.rules-table.check-examples tbody tr {background:transparent}
.rules-table.check-examples tbody:not(:last-child) tr:last-child td {border-bottom:1px solid #e2dcce}
/* The skill columns alternate independently; the empty corner is outside the frame. */
.table-scroll.skills-table-frame {border:0;background:transparent;box-shadow:none}
.rules-table.skills-table {border-top:1px solid var(--rule);border-left:1px solid var(--rule)}
.rules-table.skills-table td {background:#fffefa}
.rules-table.skills-table tbody tr:nth-child(even) td {background:#f5f0e7}
.rules-table.skills-table tbody tr:nth-child(odd) td:nth-child(2) {background:#f5f0e7}
.rules-table.skills-table tbody tr:nth-child(even) td:nth-child(2) {background:#fffefa}
.rules-table.skills-table tr:not(:last-child) td:last-child {border-right:1px solid var(--rule)}
.rules-table.skills-table tr:last-child td {border-bottom:1px solid var(--rule)}
.rules-table.skills-table tr:last-child td:nth-child(2) {border-right:1px solid var(--rule)}
.rules-table.skills-table tr:nth-last-child(2) td:last-child {border-bottom:1px solid var(--rule)}
.rules-table.skills-table tr:last-child td.table-cutout {background:var(--page);border-top:1px solid var(--rule);border-left:1px solid var(--rule);border-right:0;border-bottom:0}
.rules-table p {margin:0}
.rules-table ul {margin:0;padding-left:1.1em}

/* Original ink art is inserted in approximate original reading order. */
.illustration {clear:both;margin:38px auto 43px;text-align:center;break-inside:avoid}
.illustration img {display:block;width:auto;height:auto;max-width:100%;max-height:410px;margin:0 auto;object-fit:contain;mix-blend-mode:multiply}
.illustration.portrait-art img {max-height:475px;max-width:min(100%,395px)}
.illustration.square-art img {max-height:385px}
.illustration.full-width-art img {width:100%;height:auto;max-width:100%;max-height:none}
.illustration.character-sheet {padding:clamp(8px,1.2vw,16px);border:1px solid #c7c7c7;background:#fff;box-shadow:0 3px 10px rgba(0,0,0,.08)}
.illustration.character-sheet img {background:#fff;mix-blend-mode:normal}
.illustration.panorama-art img {max-width:min(100%,800px);max-height:350px}
.illustration.castle-art img {width:400px;max-width:100%;max-height:none}
.illustration.divider-art {margin:36px auto}
.illustration.divider-art img {max-height:115px;max-width:min(100%,400px)}
.book-text > .illustration + .illustration {margin-top:-8px}
.illustration.chapter-art {margin:0 auto 32px}
.illustration.chapter-art img {width:100%;height:auto;max-width:100%;max-height:none}
.book-text > .chapter-art + .chapter-title {margin-top:0}
.illustration.chapter-art-cropped {position:relative;aspect-ratio:16/9;overflow:hidden}
.illustration.chapter-art-cropped img {position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center}
/* Retain the original wizard artwork's upper two-thirds at a larger size. */
.illustration.wizard-art {position:relative;width:420px;max-width:100%;aspect-ratio:630/880;overflow:hidden}
.illustration.wizard-art img {position:absolute;inset:0;width:100%;height:100%;max-width:none;max-height:none;object-fit:cover;object-position:top}
/* Frame the upper balcony and thief to match the supplied crop reference. */
.illustration.thief-art {position:relative;width:100%;aspect-ratio:584/356;overflow:hidden}
.illustration.thief-art img {position:absolute;inset:0;width:100%;height:100%;max-width:none;max-height:none;object-fit:cover;object-position:50% 20.64%}
.illustration.quickstart-art {position:relative;width:100%;aspect-ratio:16/9;overflow:hidden}
.illustration.quickstart-art img {position:absolute;inset:0;width:100%;height:100%;max-width:none;max-height:none;object-fit:cover;object-position:50% 45%}

.endmark {border-top:2px solid var(--ink);text-align:center;margin-top:100px;padding-top:44px;color:var(--ink-soft)}
.endmark .end-sigil {font-size:2.2rem;display:block;line-height:1.4}
.endmark p {font-style:italic;margin-bottom:10px}
.endmark a {font:800 .78rem var(--sans);text-transform:uppercase;letter-spacing:.08em}

/* Small, optional, accessible jump navigation. */
.drawer-toggle {position:fixed;z-index:110;right:max(20px,env(safe-area-inset-right));top:max(17px,env(safe-area-inset-top));display:flex;gap:9px;align-items:center;justify-content:center;padding:12px 16px;color:#f8f3e9;background:#1c1e19;border:1px solid #48473d;border-radius:100px;box-shadow:0 6px 22px rgba(0,0,0,.22);font:800 .77rem/1 var(--sans);letter-spacing:.08em;text-transform:uppercase;cursor:pointer;opacity:0;visibility:hidden;transform:translateY(-12px);transition:opacity .2s,transform .2s,visibility .2s}
body.past-contents .drawer-toggle,body.drawer-open .drawer-toggle {opacity:1;visibility:visible;transform:translateY(0)}
.drawer-toggle:hover {background:#33362e}
.drawer-backdrop {position:fixed;inset:0;background:rgba(17,18,15,.6);z-index:120}
.drawer-backdrop[hidden] {display:none}
.toc-drawer {visibility:hidden;position:fixed;z-index:125;top:0;right:0;bottom:0;width:min(460px,100%);background:var(--paper);box-shadow:-8px 0 50px rgba(0,0,0,.25);transform:translateX(103%);transition:transform .27s cubic-bezier(.22,.8,.22,1),visibility .27s;display:flex;flex-direction:column;overscroll-behavior:contain}
body.drawer-open .toc-drawer {visibility:visible;transform:translateX(0)}
.drawer-header {display:flex;align-items:flex-start;justify-content:space-between;gap:10px;padding:28px 28px 20px;border-bottom:1px solid var(--rule)}
.drawer-header h2 {margin:0;font:900 1.65rem/1 var(--sans);text-transform:uppercase}
.drawer-close {display:grid;place-items:center;flex-shrink:0;padding:0;background:transparent;border:1px solid var(--rule);color:var(--ink);width:40px;height:40px;cursor:pointer}
.drawer-navigation {overflow-y:auto;padding:26px 28px 42px;flex:1;scrollbar-width:thin}
.drawer-navigation .toc-grid {display:block}
.drawer-navigation .toc-card {display:block;margin:0 0 27px;padding-top:22px}
.drawer-navigation .toc-card > ul {columns:auto}
.drawer-navigation .toc-card h3 {font-size:1rem;margin-bottom:12px}
.drawer-navigation .toc-card li {margin-bottom:7px}
.drawer-navigation .toc-card li a {font-size:1.0625rem}
.drawer-navigation .spell-index {margin-top:25px}
.drawer-navigation .toc-grid {margin-top:0}
.drawer-navigation .letter-grid {grid-template-columns:1fr 1fr;gap:15px}
.drawer-footer {padding:18px 28px;border-top:1px solid var(--rule);font:800 .68rem var(--sans);letter-spacing:.13em}
.drawer-footer span {color:var(--accent)}

@media (max-width:1100px) {
 .toc-card {grid-template-columns:minmax(165px,1fr) minmax(0,2.4fr);gap:24px}
 .letter-grid {grid-template-columns:repeat(3,minmax(0,1fr))}
 .chapter-six .letter-grid {grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:690px) {
 .cover::before {inset:10px}
 .cover-inner {padding:29px 24px 32px}
 .cover-titles {margin-top:clamp(38px,7vh,65px)}
 .cover-kicker {font-size:.67rem;letter-spacing:.22em}
 .cover h1 {font-size:clamp(2.16rem,9.1vw,4.65rem);letter-spacing:-.018em}
 .cover-subtitle {font-size:.73rem;letter-spacing:.025em}
 .cover-illustration {width:126vw;max-width:none;height:66svh;bottom:4%;}
 .cover-footline {inset:auto 23px 26px;font-size:.48rem;letter-spacing:.08em}
 .contents-section {padding:55px 24px 75px}
 .contents-section h2 {font-size:clamp(1.8rem,8vw,2.5rem)}
 .toc-grid {gap:30px;margin-top:36px}
 .toc-card {grid-template-columns:1fr;gap:18px}
 .toc-card > ul {columns:auto}
 .toc-frontmatter > ul {grid-column:auto}
 .chapter-six > .spell-index {grid-column:auto}
 .toc-card h3 {font-size:1.3rem}
 .toc-card li a {font-size:1.0625rem}
 .letter-grid {grid-template-columns:repeat(2,minmax(0,1fr))}
 .book-text {padding:60px 22px 85px;font-size:1.05rem;line-height:1.72}
 .book-text .chapter-title {margin:80px -8px 40px;padding:20px 17px;font-size:1.8rem}
 .book-text :is(.section-title,.frontmatter-title) {margin-top:54px;font-size:1.5rem}
 .book-text .subsection-title {font-size:1.21rem}
 .table-scroll {min-width:calc(100% + 20px);max-width:calc(100% + 20px)}
 .rules-table {font-size:.82rem}
 .rules-table th,.rules-table td {padding:8px 10px;min-width:72px}
 .drawer-toggle {top:15px;right:14px;width:45px;height:45px;padding:0}
 .drawer-toggle span {display:none}
 .illustration {margin:30px auto 35px}
 .illustration img {max-height:340px}
}
@media (max-width:390px) {
 .cover h1 {font-size:9.05vw}
 .cover-subtitle {font-size:.66rem}
 .letter-grid,.chapter-six .letter-grid {grid-template-columns:1fr}
 .book-text {padding-left:18px;padding-right:18px}
}
@media (max-height:650px) and (min-width:690px) {
 .cover-titles {margin-top:15px}
 .cover h1 {font-size:min(6.4vw,6rem)}
 .cover-illustration {height:72vh;bottom:0}
}
@media (prefers-reduced-motion: reduce) {
 html {scroll-behavior:auto}
 *,*::before,*::after {transition:none!important;animation:none!important}
}
@media print {
 .cover {height:auto;min-height:650px;page-break-after:always}
 .drawer-toggle,.drawer-backdrop,.toc-drawer {display:none!important}
 .reading-shell {display:block;max-width:none}
 .book-section {box-shadow:none;border:0}
 .book-text {max-width:none}
 .table-scroll {overflow:visible;width:100%;min-width:0;max-width:100%;left:auto;transform:none}
 .rules-table {min-width:0}
 .book-text .chapter-title {break-before:page}
}
/* The original preface has engraved vertical borders, not separate story scenes. */
.book-text {position:relative}
.preface-ornaments {position:absolute;pointer-events:none;top:200px;left:-82px;right:-82px;height:420px;display:flex;justify-content:space-between;align-items:stretch}
.preface-ornaments .illustration {margin:0;width:45px;height:420px}
.preface-ornaments .illustration img {width:45px;height:420px;max-height:none;max-width:none;object-fit:fill}
.anchor-alias {display:block;height:0;position:relative;top:0;scroll-margin-top:20px}
@media (max-width:1000px) {.preface-ornaments {display:none}}
