/* Scarab Online: the "Scribe's Desk" look of the game client, for the web.
   Papyrus and ink, collar friezes of gold, lapis, turquoise and carnelian, red-ink rubrics.
   Palette from client/scripts/ui/egypt.gd. Fonts: Cinzel + Alegreya Sans (SIL OFL 1.1). */

@font-face { font-family: "Cinzel"; src: url("../fonts/Cinzel.ttf") format("truetype"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("../fonts/AlegreyaSans-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("../fonts/AlegreyaSans-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --papyrus: #e3cf9c;
  --papyrus-light: #efe1b8;
  --papyrus-dark: #c8ae76;
  --ink: #2b1b0e;
  --ink-soft: #5a4428;
  --red-ink: #9a2a14;
  --lapis: #1f3f8f;
  --lapis-deep: #10204f;
  --turquoise: #2a9d8f;
  --gold: #d9a520;
  --gold-light: #f2c94c;
  --carnelian: #b5401f;
  --wood: #7a5230;
  --desk: #24150a;
  --desk-2: #33200f;
  --night: #140c26;
  --display: "Cinzel", "Trajan Pro", Georgia, serif;
  --body: "Alegreya Sans", "Gill Sans", "Segoe UI", system-ui, sans-serif;
  --wrap: 1180px;
  --gutter: 16px;
  /* one bead of the broad-collar frieze, 7px per colour with an ink seam */
  --frieze-x: linear-gradient(90deg, var(--gold) 0 6px, var(--ink) 6px 7px, var(--lapis) 7px 13px, var(--ink) 13px 14px, var(--gold) 14px 20px, var(--ink) 20px 21px, var(--turquoise) 21px 27px, var(--ink) 27px 28px, var(--gold) 28px 34px, var(--ink) 34px 35px, var(--carnelian) 35px 41px, var(--ink) 41px 42px);
  --frieze-y: linear-gradient(180deg, var(--gold) 0 6px, var(--ink) 6px 7px, var(--lapis) 7px 13px, var(--ink) 13px 14px, var(--gold) 14px 20px, var(--ink) 20px 21px, var(--turquoise) 21px 27px, var(--ink) 27px 28px, var(--gold) 28px 34px, var(--ink) 34px 35px, var(--carnelian) 35px 41px, var(--ink) 41px 42px);
  /* woven papyrus strips: horizontal fibres over fainter vertical ones */
  --papyrus-fibres:
    repeating-linear-gradient(0deg, rgba(140, 100, 40, .10) 0 1px, transparent 1px 5px),
    repeating-linear-gradient(0deg, rgba(120, 80, 30, .07) 0 2px, transparent 2px 13px),
    repeating-linear-gradient(90deg, rgba(140, 100, 40, .06) 0 1px, transparent 1px 9px),
    repeating-linear-gradient(90deg, rgba(110, 75, 30, .06) 0 3px, transparent 3px 31px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--desk) radial-gradient(ellipse at 50% 0, #3b2412 0, var(--desk) 70%) fixed;
  color: var(--ink);
  font: 18px/1.6 var(--body);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
a { color: var(--lapis); text-underline-offset: 2px; }
a:hover { color: var(--red-ink); }
:focus-visible { outline: 3px solid var(--turquoise); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: var(--ink); padding: 8px 14px; z-index: 50; border-radius: 6px; }
.skip:focus { left: 8px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.2; letter-spacing: .02em; }
code { font-size: .88em; background: rgba(43, 27, 14, .08); padding: 1px 5px; border-radius: 4px; }

/* ---------------------------------------------------------------- friezes, papyrus, panels */
.frieze { height: 9px; background: var(--frieze-x) 0 1px / 42px 7px repeat-x, var(--ink); position: relative; }
.frieze::after { /* the drop beads hanging off a broad collar */
  content: ""; position: absolute; left: 0; right: 0; top: 8px; height: 6px;
  background: radial-gradient(circle at 3px 1px, var(--gold) 0 2.2px, transparent 2.7px) 0 0 / 14px 6px repeat-x;
}
.papyrus { background-color: var(--papyrus); background-image: var(--papyrus-fibres); }
.panel {
  position: relative;
  background:
    var(--frieze-x) left top / 42px 6px repeat-x,
    var(--frieze-x) left bottom / 42px 6px repeat-x,
    var(--frieze-y) left top / 6px 42px repeat-y,
    var(--frieze-y) right top / 6px 42px repeat-y,
    radial-gradient(ellipse at 50% 50%, transparent 60%, rgba(120, 80, 30, .18) 100%),
    var(--papyrus-fibres),
    var(--papyrus);
  border: 1px solid var(--ink);
  padding: 30px 30px 26px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
}
.panel::before { content: ""; position: absolute; inset: 8px; border: 1px solid rgba(217, 165, 32, .75); pointer-events: none; }
.scroll { position: relative; margin: 0 22px; }
.scroll::before, .scroll::after { /* wooden rollers */
  content: ""; position: absolute; top: -10px; bottom: -10px; width: 20px; z-index: 1;
  background: linear-gradient(90deg, #4a2f18, #9a6a3e 30%, #c08a55 42%, #8a5a30 60%, #4a2f18);
  border: 1px solid #1e1208; border-radius: 6px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, .4);
}
.scroll::before { left: -20px; }
.scroll::after { right: -20px; }
.rubric { color: var(--red-ink); }

/* ---------------------------------------------------------------- buttons: cartouches */
.cartouche {
  --bg: var(--papyrus-light);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .5em 1.4em; margin-right: 10px;
  font: 700 1rem/1.2 var(--display); letter-spacing: .04em; color: var(--ink); text-decoration: none;
  background: var(--bg); border: 3px solid var(--ink); border-radius: 999px;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .35);
  transition: transform .12s ease, box-shadow .12s ease, background-color .12s;
}
.cartouche::after { /* the knotted tie at the end of a cartouche */
  content: ""; position: absolute; right: -10px; top: 18%; bottom: 18%; width: 4px; border-radius: 2px; background: var(--ink);
}
.cartouche:hover { color: var(--ink); transform: translateY(-1px); box-shadow: 0 5px 0 rgba(0, 0, 0, .35); background: #fff3cf; }
.cartouche:active { transform: translateY(1px); box-shadow: 0 1px 0 rgba(0, 0, 0, .35); }
.cartouche.gold { --bg: var(--gold); background: linear-gradient(#f2c94c, var(--gold) 60%, #c08a14); }
.cartouche.gold:hover { background: linear-gradient(#ffdb6e, #e8b42c 60%, #c99418); }
.cartouche.big { font-size: clamp(1.25rem, 3.6vw, 1.9rem); padding: .55em 1.6em; border-width: 4px; }
.cartouche.big::after { width: 6px; right: -14px; }
.cartouche.small { font-size: .82rem; padding: .35em 1em; border-width: 2px; }
.cartouche.small::after { width: 3px; right: -8px; }
.cartouche small { font: 400 .62em/1 var(--body); letter-spacing: 0; opacity: .8; }

/* ---------------------------------------------------------------- header */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(20, 12, 6, .94); border-bottom: 1px solid #000; backdrop-filter: blur(6px); }
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -7px; height: 7px; background: var(--frieze-x) 0 0 / 42px 6px repeat-x, var(--ink); border-bottom: 1px solid var(--ink); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--gold-light); text-decoration: none; font: 700 1.25rem/1 var(--display); letter-spacing: .06em; text-shadow: 0 2px 0 #000; white-space: nowrap; }
.brand:hover { color: #fff1b0; }
.brand img { width: 64px; height: 32px; }
.mainnav { display: flex; align-items: center; gap: 4px 18px; flex-wrap: wrap; justify-content: flex-end; }
.mainnav a:not(.cartouche) { color: var(--papyrus); text-decoration: none; font: 700 .95rem/1 var(--display); letter-spacing: .05em; padding: 8px 2px; border-bottom: 2px solid transparent; }
.mainnav a:not(.cartouche):hover, .mainnav a[aria-current] { color: var(--gold-light); border-bottom-color: var(--gold); }
.mainnav .cartouche { margin-right: 10px; }
@media (max-width: 560px) {
  .brand span { display: none; }
  .mainnav { gap: 4px 14px; }
}

/* ---------------------------------------------------------------- homepage hero */
.hero {
  position: relative; overflow: hidden; color: var(--papyrus-light); text-align: center;
  min-height: min(92vh, 860px); display: flex; flex-direction: column; justify-content: center;
  background: linear-gradient(180deg, #0d0a26 0%, #241038 26%, #5a1f2a 52%, #b5401f 74%, #e08a3a 88%, #f0b45a 100%);
  isolation: isolate;
}
.hero-stars { /* gold five-pointed stars on a tomb ceiling */
  position: absolute; inset: 0 0 35% 0; z-index: -2;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='56'%3E%3Cpath fill='%23d9a520' d='M16 6l1.9 5.4 5.6.1-4.5 3.4 1.6 5.5-4.6-3.3-4.6 3.3 1.6-5.5-4.5-3.4 5.6-.1zM48 34l1.9 5.4 5.6.1-4.5 3.4 1.6 5.5-4.6-3.3-4.6 3.3 1.6-5.5-4.5-3.4 5.6-.1z'/%3E%3C/svg%3E");
  background-size: 64px 56px; opacity: .55;
  -webkit-mask-image: linear-gradient(#000 0%, rgba(0, 0, 0, .7) 45%, transparent 100%); mask-image: linear-gradient(#000 0%, rgba(0, 0, 0, .7) 45%, transparent 100%);
}
.hero-art { position: absolute; inset: auto 0 0 0; width: 100%; height: 62%; z-index: -1; }
.hero-in { position: relative; padding: 64px var(--gutter) 170px; max-width: 1120px; margin: 0 auto; }
.hero h1 {
  margin: 0; font-size: clamp(2.4rem, 8.6vw, 5.8rem); font-weight: 900; letter-spacing: .04em; line-height: 1.02;
  color: var(--gold-light);
  background: linear-gradient(180deg, #ffe99a 10%, #f2c94c 45%, #c8921a 90%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 0 #2b1406) drop-shadow(0 10px 24px rgba(0, 0, 0, .55));
}
.hero .winged { width: min(420px, 80vw); height: auto; display: block; margin: 0 auto 14px; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .5)); }
.hero .tagline { font: 700 clamp(1.15rem, 3vw, 1.6rem)/1.35 var(--display); margin: 18px auto 10px; color: #fff3d6; text-shadow: 0 2px 8px rgba(0, 0, 0, .7); max-width: 34em; text-wrap: balance; }
.hero .sub { font-size: clamp(1rem, 2.3vw, 1.2rem); margin: 0 auto 30px; max-width: 36em; color: #f6e2c0; text-shadow: 0 1px 6px rgba(0, 0, 0, .9), 0 0 2px rgba(0, 0, 0, .8); text-wrap: balance; }
.hero .ctas { display: flex; flex-wrap: wrap; gap: 18px 22px; justify-content: center; align-items: center; }
.hero .platforms { margin: 16px 0 0; font-size: .95rem; color: #f6e2c0; text-shadow: 0 1px 4px rgba(0, 0, 0, .8); }

/* ---------------------------------------------------------------- homepage sections */
.band { padding: 72px 0; position: relative; }
.band-desk { background: var(--desk); }
.band-lapis { background: linear-gradient(180deg, var(--lapis-deep), #172d6a); color: var(--papyrus-light); }
.band-lapis h2 { color: var(--gold-light); }
.section-title { text-align: center; margin: 0 auto 36px; max-width: 760px; }
.section-title h2 { font-size: clamp(1.7rem, 4.4vw, 2.6rem); margin: 0 0 8px; color: var(--gold-light); text-shadow: 0 2px 0 #000; text-wrap: balance; }
.section-title p { margin: 0; color: var(--papyrus); font-size: 1.1rem; }
.story { max-width: 860px; margin: 0 auto; }
.story .panel { padding: 40px clamp(22px, 5vw, 56px) 34px; }
.story h2 { color: var(--red-ink); font-size: clamp(1.5rem, 3.6vw, 2.1rem); margin: 0 0 14px; text-align: center; }
.story p { font-size: 1.12rem; margin: 0 0 1em; }
.story .dropcap::first-letter { float: left; font: 900 3.4em/0.85 var(--display); color: var(--red-ink); margin: .06em .08em 0 0; }
.story blockquote { margin: 22px 0; padding: 14px 20px; border-left: 4px solid var(--carnelian); background: rgba(154, 42, 20, .07); font-style: italic; font-size: 1.15rem; }
.story blockquote cite { display: block; font-style: normal; font-size: .9rem; color: var(--ink-soft); margin-top: 6px; }
.features { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 24px; }
.feature { position: relative; background: var(--papyrus-fibres), var(--papyrus); border: 1px solid var(--ink); border-radius: 4px 4px 60px 60px / 4px 4px 22px 22px; padding: 74px 22px 26px; box-shadow: 0 8px 20px rgba(0, 0, 0, .4); }
.feature::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 8px; background: var(--frieze-x) 0 1px / 42px 6px repeat-x, var(--ink); border-radius: 3px 3px 0 0; }
.feature svg.glyph { position: absolute; top: 20px; left: 22px; width: 46px; height: 46px; }
.feature h3 { margin: 0 0 8px; font-size: 1.22rem; color: var(--red-ink); }
.feature p { margin: 0; font-size: 1rem; }
.feature .stat { position: absolute; top: 26px; right: 20px; font: 700 .85rem/1 var(--display); color: var(--ink-soft); }
.stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 40px; list-style: none; padding: 0; margin: 0; }
.stats li { text-align: center; font: 700 .95rem/1.2 var(--display); letter-spacing: .06em; color: var(--papyrus); text-transform: uppercase; }
.stats b { display: block; font-size: clamp(2rem, 5vw, 2.8rem); color: var(--gold-light); font-weight: 900; text-shadow: 0 2px 0 #000; }
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; list-style: none; margin: 0; padding: 0; }
.gallery figure { margin: 0; height: 100%; display: flex; flex-direction: column; }
.gallery li.big { grid-column: span 2; grid-row: span 2; }
.gallery li.big a { flex: 1; }
.gallery li.big img { height: 100%; aspect-ratio: auto; }
.gallery li.fit img { object-fit: contain; background: #d9c79a; }
.gallery a { display: block; position: relative; border: 1px solid var(--ink); background: var(--ink); padding: 10px 5px 5px; box-shadow: 0 8px 20px rgba(0, 0, 0, .5); }
.gallery a::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--frieze-x) 0 0 / 42px 6px repeat-x; }
.gallery a:hover { border-color: var(--gold); }
.gallery img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.gallery figcaption { color: var(--papyrus); font-size: .95rem; margin-top: 8px; text-align: center; }
@media (max-width: 820px) { .gallery { grid-template-columns: 1fr; } .gallery li.big { grid-column: auto; grid-row: auto; } .gallery li.big img { aspect-ratio: 16 / 10; } }
.lightbox { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 94vh; }
.lightbox::backdrop { background: rgba(10, 6, 2, .88); }
.lightbox img { display: block; max-width: 96vw; max-height: 86vh; width: auto; border: 2px solid var(--gold); }
.lightbox p { color: var(--papyrus); text-align: center; margin: 8px 0 0; }
.lightbox button { position: absolute; top: 8px; right: 8px; font: 700 1rem var(--display); background: var(--gold); border: 2px solid var(--ink); border-radius: 999px; padding: 4px 12px; cursor: pointer; }
.cta-end { text-align: center; }
.cta-end h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); color: var(--gold-light); margin: 0 0 10px; text-shadow: 0 2px 0 #000; }
.cta-end p { color: var(--papyrus); margin: 0 auto 28px; max-width: 40em; }
.cta-end .ctas { display: flex; flex-wrap: wrap; gap: 18px 24px; justify-content: center; }
.pillars { display: grid; grid-template-columns: 1fr 1fr; gap: 0; max-width: 980px; margin: 0 auto; border: 1px solid var(--ink); box-shadow: 0 10px 30px rgba(0, 0, 0, .45); }
.pillars > div { padding: 30px clamp(18px, 4vw, 36px); }
.pillars h3 { margin: 0 0 8px; font-size: 1.5rem; }
.pillars p { margin: 0 0 .7em; }
.kemet { background: linear-gradient(160deg, #2c3a1a, #1d2a12); color: #e8eccb; }
.kemet h3 { color: #b8d66a; }
.deshret { background: linear-gradient(160deg, #6a2414, #3a120a); color: #f6dcc8; }
.deshret h3 { color: #ffb08a; }
.pillars small { display: block; font: 700 .8rem var(--display); letter-spacing: .12em; text-transform: uppercase; opacity: .75; margin-bottom: 4px; }
@media (max-width: 720px) { .pillars { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- generic content pages */
.page-plain { padding: 48px 0 64px; }
.page-plain .panel { max-width: 860px; margin: 0 auto; }
.page-plain h1 { color: var(--red-ink); margin-top: 0; }

/* ---------------------------------------------------------------- wiki */
.wiki { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; padding-top: 36px; padding-bottom: 56px; align-items: start; }
.wiki-side { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: auto; background: var(--papyrus-fibres), var(--papyrus-dark); border: 1px solid var(--ink); padding: 14px; box-shadow: 0 8px 20px rgba(0, 0, 0, .4); scrollbar-width: thin; }
.wiki-menu summary { display: none; }
.wiki-group h2 { font-size: .85rem; letter-spacing: .1em; text-transform: uppercase; color: var(--red-ink); margin: 16px 0 6px; border-bottom: 1px solid rgba(43, 27, 14, .3); padding-bottom: 4px; }
.wiki-group ul { list-style: none; margin: 0; padding: 0; }
.wiki-group a { display: block; padding: 3px 6px; color: var(--ink); text-decoration: none; border-radius: 4px; font-size: .98rem; }
.wiki-group a:hover { background: rgba(43, 27, 14, .1); color: var(--ink); }
.sheet { position: relative; min-width: 0;
  background:
    var(--frieze-x) left top / 42px 6px repeat-x,
    var(--frieze-x) left bottom / 42px 6px repeat-x,
    var(--papyrus-fibres), var(--papyrus);
  border: 1px solid var(--ink); padding: 28px clamp(16px, 3.4vw, 40px) 36px; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); }
.sheet h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); margin: 6px 0 12px; color: var(--ink); }
.sheet h2 { color: var(--red-ink); font-size: 1.35rem; margin: 30px 0 10px; clear: none; }
.sheet h3 { font-size: 1.05rem; margin: 22px 0 8px; color: var(--ink); }
.lede { font-size: 1.12rem; color: var(--ink-soft); }
.muted { color: var(--ink-soft); font-size: .95rem; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 0; margin: 0 0 6px; font-size: .9rem; }
.crumbs li + li::before { content: "›"; margin: 0 6px; color: var(--ink-soft); }
.crumbs a { color: var(--ink-soft); }
.page-head { display: contents; }
.sheet::after { content: ""; display: block; clear: both; }
.infobox { float: right; width: 300px; margin: 0 0 18px 24px; background: var(--papyrus-light); border: 1px solid var(--ink); box-shadow: 0 4px 12px rgba(43, 27, 14, .25); font-size: .95rem; }
.infobox h2 { margin: 0; padding: 8px 12px; background: var(--lapis); color: var(--gold-light); font-size: 1rem; text-align: center; border-bottom: 3px solid var(--gold); }
.infobox-icon { text-align: center; padding: 14px 0 6px; background: radial-gradient(circle, rgba(217, 165, 32, .25), transparent 65%); }
.infobox-icon img { width: 72px; height: 72px; image-rendering: auto; }
.infobox dl { display: grid; grid-template-columns: auto 1fr; margin: 0; padding: 8px 12px 12px; gap: 4px 12px; }
.infobox dt { font-weight: 700; color: var(--ink-soft); }
.infobox dd { margin: 0; }
.examine { font-style: italic; font-size: 1.1rem; color: var(--ink-soft); }
.examine::before { content: "“"; } .examine::after { content: "”"; }
@media (max-width: 1000px) { .infobox { float: none; width: auto; margin: 0 0 18px; } }
.table-scroll { overflow-x: auto; margin: 8px 0 16px; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: .96rem; background: rgba(255, 248, 225, .35); }
th { text-align: left; font: 700 .78rem/1.2 var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--red-ink); border-bottom: 2px solid var(--ink); padding: 8px 10px; white-space: nowrap; }
td { border-bottom: 1px solid rgba(43, 27, 14, .18); padding: 7px 10px; vertical-align: top; }
tbody tr:nth-child(even) td { background: rgba(200, 174, 118, .22); }
tbody tr:hover td { background: rgba(217, 165, 32, .18); }
td small { color: var(--ink-soft); }
.unlocks td:first-child { width: 4em; text-align: center; font-size: 1.05rem; }
.ilink { white-space: nowrap; }
.ilink img { width: 22px; height: 22px; vertical-align: -6px; margin-right: 4px; }
.qty { color: var(--ink-soft); font-size: .9em; }
.missing { color: var(--carnelian); border-bottom: 1px dotted; }
.danger { display: inline-block; font: 700 .7rem/1 var(--display); letter-spacing: .05em; padding: 3px 6px; border-radius: 999px; background: var(--carnelian); color: #fff3e6; vertical-align: 2px; }
.slink { white-space: nowrap; }
.sdot { display: inline-block; width: .7em; height: .7em; border-radius: 50%; background: var(--c); border: 1px solid var(--ink); margin-right: 5px; vertical-align: 0; }
.sdot.big { width: .65em; height: .65em; margin-right: 12px; }
.bonuses, .stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin: 8px 0 16px; }
.bonuses div, .stats div { display: flex; justify-content: space-between; gap: 8px; padding: 6px 10px; background: rgba(255, 248, 225, .45); border: 1px solid rgba(43, 27, 14, .2); border-radius: 4px; }
.bonuses dt, .stats dt { font-size: .9rem; }
.bonuses dd, .stats dd { margin: 0; font-weight: 700; }
.bonuses .pos dd { color: #2f6b2a; } .bonuses .neg dd { color: var(--red-ink); } .bonuses .zero { opacity: .55; }
.where { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.where p { flex: 1 1 260px; margin: 0; }
.minimap { margin: 0; flex: 0 0 auto; }
.minimap-map { position: relative; width: 260px; height: 260px; border: 2px solid var(--ink); background-repeat: no-repeat; box-shadow: 0 4px 10px rgba(43, 27, 14, .3); }
.minimap-map i { position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: var(--gold-light); border: 2px solid var(--red-ink); box-shadow: 0 0 0 1px #fff8; }
.minimap figcaption { font-size: .85rem; text-align: right; }
.specials li { margin-bottom: 8px; }
.specials q, .sayings q { display: block; font-style: italic; color: var(--ink-soft); }
.sayings { list-style: none; padding: 0; columns: 2 280px; }
.sayings li { break-inside: avoid; margin-bottom: 6px; }
.journal { list-style: none; padding: 0; margin: 0; counter-reset: none; border-left: 3px solid var(--gold); }
.journal li { position: relative; padding: 4px 0 14px 22px; }
.journal li::before { content: ""; position: absolute; left: -9px; top: 10px; width: 15px; height: 15px; border-radius: 50%; background: var(--papyrus-light); border: 3px solid var(--lapis); }
.journal li.done::before { background: var(--gold); border-color: var(--ink); }
.journal .stage { font: 700 .78rem var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--red-ink); }
.journal p { margin: 2px 0; }
.journal small { color: var(--ink-soft); }
.cards { list-style: none; padding: 0; margin: 10px 0 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.cards a { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 14px 16px; text-decoration: none; color: var(--ink); background: rgba(255, 248, 225, .5); border: 1px solid rgba(43, 27, 14, .3); border-left: 5px solid var(--lapis); border-radius: 4px; transition: border-color .15s, transform .15s; }
.cards a:hover { border-left-color: var(--gold); transform: translateY(-2px); color: var(--ink); }
.cards strong { font-family: var(--display); color: var(--red-ink); }
.cards span { font-size: .95rem; color: var(--ink-soft); }
.item-grid, .skill-grid { list-style: none; padding: 0; margin: 8px 0 18px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 16px; }
.item-grid li, .skill-grid li { padding: 4px 0; border-bottom: 1px dotted rgba(43, 27, 14, .25); }
.item-grid small, .skill-grid small { display: block; color: var(--ink-soft); font-size: .82rem; padding-left: 26px; }
.skill-grid small { padding-left: 18px; }
.toc { display: flex; flex-wrap: wrap; gap: 6px 10px; margin: 10px 0; }
.toc a { font-size: .9rem; padding: 3px 10px; border: 1px solid rgba(43, 27, 14, .35); border-radius: 999px; text-decoration: none; color: var(--ink); background: rgba(255, 248, 225, .45); }
.cols { columns: 3 220px; padding-left: 20px; }
.loot { border-top: 1px solid rgba(43, 27, 14, .25); margin-top: 14px; }
.prose { max-width: 46em; }
.prose h2 { margin-top: 32px; }
.prose li { margin-bottom: 6px; }
.prose kbd { font: 700 .85em var(--body); padding: 1px 7px; border: 1px solid var(--ink-soft); border-bottom-width: 3px; border-radius: 5px; background: var(--papyrus-light); white-space: nowrap; }
.prose .note { padding: 12px 16px; border-left: 4px solid var(--turquoise); background: rgba(42, 157, 143, .1); }
.prose .warn { padding: 12px 16px; border-left: 4px solid var(--carnelian); background: rgba(181, 64, 31, .09); }
.prose table { margin: 10px 0 18px; }
.worldmap { margin: 10px 0 20px; }
.worldmap-in { position: relative; max-width: 760px; margin: 0 auto; border: 2px solid var(--ink); box-shadow: 0 6px 18px rgba(43, 27, 14, .35); }
.worldmap-in img { display: block; width: 100%; height: auto; }
.ml { position: absolute; transform: translate(-50%, -50%); font: 700 .7rem/1.1 var(--display); color: var(--ink); white-space: nowrap; text-shadow: 0 0 3px var(--papyrus-light), 0 0 3px var(--papyrus-light), 0 0 2px var(--papyrus-light); pointer-events: none; }
.ml-city { font-size: .85rem; color: var(--red-ink); }
.ml-region { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--lapis); opacity: .85; }
.ml-landmark { font: italic 400 .72rem var(--body); }
.mm, .key-deshret { display: inline-block; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--ink); }
.worldmap-in .mm { position: absolute; transform: translate(-50%, -50%); }
.mm-0 { background: var(--carnelian); } .mm-1 { background: var(--turquoise); } .mm-2 { background: var(--gold); } .mm-3 { background: var(--lapis); }
.key-deshret { border-radius: 2px; background: repeating-linear-gradient(45deg, #cd8c5c 0 2px, #b5401f 2px 4px); }
.worldmap figcaption { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; font-size: .9rem; margin-top: 8px; }
.worldmap figcaption i { margin-right: 6px; vertical-align: -1px; }
@media (max-width: 600px) { .ml-landmark, .ml-town { display: none; } .ml-city { font-size: .62rem; } }

/* wiki search */
.wiki-search { position: relative; }
.wiki-search input { width: 100%; font: 1rem var(--body); padding: 9px 12px; border: 2px solid var(--ink); border-radius: 999px; background: var(--papyrus-light); color: var(--ink); }
.wiki-search.big { margin: 18px 0 8px; max-width: 640px; }
.wiki-search.big input { font-size: 1.1rem; padding: 12px 18px; }
.wiki-results { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); list-style: none; margin: 0; padding: 4px; background: var(--papyrus-light); border: 2px solid var(--ink); border-radius: 8px; box-shadow: 0 10px 24px rgba(0, 0, 0, .35); max-height: 60vh; overflow: auto; }
.wiki-results.open { position: static; box-shadow: none; max-height: none; }
.wiki-side .wiki-results { min-width: 280px; }
.wiki-results a { display: flex; align-items: center; gap: 8px; padding: 6px 8px; color: var(--ink); text-decoration: none; border-radius: 5px; }
.wiki-results a:hover, .wiki-results a.on { background: rgba(217, 165, 32, .3); }
.wiki-results img { width: 22px; height: 22px; flex: none; }
.wiki-results .c { margin-left: auto; font: 700 .68rem var(--display); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); white-space: nowrap; }
.wiki-results .none { padding: 8px; color: var(--ink-soft); }
@media (max-width: 900px) {
  .wiki { grid-template-columns: 1fr; padding-top: 24px; }
  .wiki-side { position: static; max-height: none; }
  .wiki-menu summary { display: block; cursor: pointer; font: 700 .9rem var(--display); color: var(--red-ink); margin-top: 10px; }
  .wiki-menu:not([open]) .wiki-group { display: none; }
  .wiki-menu .wiki-group { columns: 2 150px; }
}

/* ---------------------------------------------------------------- footer */
.foot { margin-top: 0; background: #120a04; color: var(--papyrus-dark); }
.foot .frieze { border-top: 1px solid #000; }
.foot-in { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 24px; padding-top: 36px; padding-bottom: 12px; }
.foot-brand { font: 700 1.2rem var(--display); color: var(--gold-light); display: flex; gap: 10px; align-items: center; margin: 0 0 8px; }
.foot p { margin: 0 0 10px; font-size: .95rem; }
.foot h2 { font-size: .85rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); margin: 0 0 8px; }
.foot nav a { display: block; color: var(--papyrus); text-decoration: none; padding: 2px 0; font-size: .97rem; }
.foot nav a:hover { color: var(--gold-light); }
.foot-small { font-size: .82rem; opacity: .7; padding-bottom: 24px; }
@media (max-width: 760px) { .foot-in { grid-template-columns: 1fr 1fr; } .foot-in > div:first-child { grid-column: 1 / -1; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media print { .topbar, .foot, .wiki-side { display: none; } body { background: #fff; } .sheet { box-shadow: none; border: 0; background: #fff; } }
