/* Dwelvers – homepage
   Look: "the Dark Ruler's codex". Basalt ground, warm stone panels with a
   bevelled edge like the in-game GUI frames, lava orange + gold accents
   taken from the logo. Display: Cinzel Decorative. Body: Alegreya Sans.
   Small labels: Silkscreen (pixel font, website only; the game itself uses
   renamed DejaVu fonts). Design rules: C:\Git\Dwelvers\DesignRules\hemsida.md */

:root {
  --ground: #0e0a08;
  --ground-2: #15100d;
  --stone: #1e1713;
  --stone-2: #2a201a;
  --edge: #43342a;
  --edge-hi: #6a5444;
  --text: #ece2d6;
  --text-dim: #b9a998;
  --text-faint: #8d7d6e;
  --lava: #ff6a1f;
  --lava-deep: #c43d0c;
  --gold: #f2b544;
  --gold-soft: #ffd98a;
  --imp: #9ccc4a;
  --mana: #5aa9ff;
  --radius: 6px;
  --maxw: 1180px;
  --display: "Cinzel Decorative", "Cinzel", Georgia, serif;
  --body: "Alegreya Sans", "Trebuchet MS", sans-serif;
  --pixel: "Silkscreen", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }	/* (2026-11-16) every #link lands below the sticky top bar (68 px) */
body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--gold); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--gold-soft); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 3px; }

.wrap { width: min(var(--maxw), 100% - 32px); margin-inline: auto; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(14, 10, 8, 0.92);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid var(--edge);
}
.topbar .wrap { display: flex; align-items: center; gap: 24px; min-height: 68px; flex-wrap: wrap; }
.topbar .brand img { height: 34px; width: auto; }
.topbar nav { display: flex; gap: 4px 20px; flex-wrap: wrap; flex: 1; }
.topbar nav a {
  color: var(--text-dim); text-decoration: none; font-weight: 500; font-size: 16px;
  padding: 10px 2px; border-bottom: 2px solid transparent;
}
.topbar nav a:hover, .topbar nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--lava); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 0 22px;
  font-family: var(--body); font-weight: 700; font-size: 17px; letter-spacing: 0.01em;
  text-decoration: none; border-radius: var(--radius); cursor: pointer;
  border: 1px solid transparent;
}
.btn-lava {
  color: #1a0a03;
  background: linear-gradient(#ff8a3d, var(--lava) 55%, var(--lava-deep));
  border-color: #ffb27a #c43d0c #7a2405;
  box-shadow: 0 0 0 1px #2a0f04, 0 6px 24px -8px rgba(255, 106, 31, 0.7);
}
.btn-lava:hover { color: #000; filter: brightness(1.08); }
.btn-stone {
  color: var(--text);
  background: linear-gradient(var(--stone-2), var(--stone));
  border-color: var(--edge-hi) var(--edge) #1a130f;
}
.btn-stone:hover { color: #fff; border-color: var(--gold); }
.btn svg { width: 20px; height: 20px; }
.topbar .btn { min-height: 42px; font-size: 15px; padding: 0 16px; }

/* ---------- hero ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: min(88vh, 860px);
  display: flex; align-items: flex-end;
  padding: 120px 0 72px;
}
.hero .bg { position: absolute; inset: 0; z-index: -2; }
.hero .bg img { width: 100%; height: 100%; object-fit: cover; object-position: 60% 40%; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse 70% 80% at 0% 100%, rgba(14,10,8,0.96) 25%, rgba(14,10,8,0.55) 60%, rgba(14,10,8,0) 85%),
    linear-gradient(180deg, rgba(14,10,8,0.6) 0%, rgba(14,10,8,0) 25%, rgba(14,10,8,0) 70%, var(--ground) 100%);
}
.hero-inner { max-width: 640px; }
.hero .logo { width: min(440px, 80vw); height: auto; filter: drop-shadow(0 8px 24px rgba(0,0,0,0.8)); }
.hero h1 {
  font-family: var(--display); font-weight: 900; font-size: clamp(34px, 5vw, 56px);
  line-height: 1.08; margin: 20px 0 16px; color: #fff4e6;
  text-shadow: 0 2px 18px rgba(0,0,0,0.9);
}
.hero p.lead { font-size: 21px; color: var(--text); margin: 0 0 28px; text-shadow: 0 1px 10px #000; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.price { font-family: var(--pixel); font-size: 13px; color: var(--text-dim); margin-left: 4px; }

.badge {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--pixel); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase;
  color: #10170a; background: var(--imp);
  padding: 7px 12px; border-radius: 3px;
  box-shadow: 0 0 0 1px #2c3d12, inset 0 1px 0 rgba(255,255,255,0.4);
  text-decoration: none;
}
.badge:hover { color: #000; filter: brightness(1.08); }
.badge .dot { width: 8px; height: 8px; border-radius: 50%; background: #10170a; }

/* ---------- facts strip ---------- */
.facts { border-block: 1px solid var(--edge); background: var(--ground-2); }
.facts ul {
  list-style: none; margin: 0 auto; padding: 18px 0;
  display: flex; flex-wrap: wrap; gap: 10px 32px; justify-content: center;
  font-family: var(--pixel); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim);
}
.facts li { display: flex; align-items: center; gap: 10px; }
.facts li::before { content: ""; width: 6px; height: 6px; background: var(--lava); transform: rotate(45deg); }

/* ---------- sections ---------- */
section { padding: 96px 0; }
section.tight { padding: 64px 0; }
.eyebrow {
  font-family: var(--pixel); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--lava); margin: 0 0 12px;
}
h2 {
  font-family: var(--display); font-weight: 700; font-size: clamp(28px, 3.6vw, 42px);
  line-height: 1.15; margin: 0 0 16px; color: #fff4e6;
}
h3 { font-family: var(--body); font-weight: 800; font-size: 22px; line-height: 1.25; margin: 0 0 8px; color: #fff4e6; }
.section-head { max-width: 720px; margin-bottom: 44px; }
.section-head p { color: var(--text-dim); margin: 0; font-size: 19px; }
.rune {
  height: 2px; width: 120px; margin: 0 0 22px;
  background: linear-gradient(90deg, var(--lava), var(--gold) 60%, transparent);
}

/* stone panel, bevelled like the in-game frames */
.panel {
  background: linear-gradient(180deg, var(--stone-2), var(--stone));
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255,220,180,0.06), inset 0 -1px 0 rgba(0,0,0,0.5), 0 10px 30px -18px #000;
}

/* ---------- pillars ---------- */
.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.pillar { padding: 26px 24px 24px; }
.pillar .icon {
  width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center; margin-bottom: 18px;
  background: radial-gradient(circle at 35% 30%, #4a3628, #1a120d);
  border: 1px solid var(--edge-hi);
  color: var(--gold);
}
.pillar .icon svg { width: 26px; height: 26px; }
.pillar p { color: var(--text-dim); margin: 0; font-size: 17px; }

/* ---------- split feature ---------- */
.feature { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 48px; align-items: center; }
.feature .media { padding: 8px; }
.feature .media img { border-radius: 3px; width: 100%; height: auto; }
.feature ul.ticks { list-style: none; padding: 0; margin: 22px 0 28px; display: grid; gap: 12px; }
.ticks li { display: grid; grid-template-columns: 22px 1fr; gap: 12px; color: var(--text); }
.ticks li::before {
  content: ""; width: 10px; height: 10px; margin: 9px 0 0 5px;
  background: var(--gold); transform: rotate(45deg);
  box-shadow: 0 0 10px rgba(242,181,68,0.6);
}
.caption { font-size: 15px; color: var(--text-faint); margin: 10px 4px 2px; }

/* ---------- before / after ---------- */
.compare {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: var(--radius); border: 1px solid var(--edge);
  user-select: none; --pos: 50%;
}
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare .after { clip-path: inset(0 0 0 var(--pos)); }
.compare .line {
  position: absolute; top: 0; bottom: 0; left: var(--pos); width: 3px; transform: translateX(-50%);
  background: #ffe8c8; box-shadow: 0 0 14px rgba(255,180,90,0.8); pointer-events: none;
}
.compare .knob {
  position: absolute; top: 50%; left: var(--pos); transform: translate(-50%, -50%);
  width: 46px; height: 46px; border-radius: 50%; pointer-events: none;
  background: var(--stone-2); border: 2px solid #ffe8c8; display: grid; place-items: center; color: #ffe8c8;
}
.compare .tag {
  position: absolute; top: 16px; padding: 6px 10px; border-radius: 3px;
  font-family: var(--pixel); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em;
  background: rgba(10,7,5,0.78); color: #fff; pointer-events: none;
}
.compare .tag.l { left: 16px; } .compare .tag.r { right: 16px; }
.compare input[type=range] {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize;
}
.compare-tabs { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.chip {
  min-height: 44px; padding: 0 16px; border-radius: 22px; cursor: pointer;
  font: 600 15px var(--body); color: var(--text-dim);
  background: var(--stone); border: 1px solid var(--edge);
}
.chip[aria-pressed="true"] { color: #1a0a03; background: var(--gold); border-color: var(--gold); }

/* ---------- creature cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 18px; }
.card { overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: inherit; }
.card:hover { border-color: var(--gold); color: inherit; }
.card .pic { aspect-ratio: 1 / 1; background: #0b0807; position: relative; overflow: hidden; }
.card .pic img { width: 100%; height: 100%; object-fit: cover; }
.card .ph {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 16px;
  font-family: var(--pixel); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint);
  background: repeating-linear-gradient(45deg, #120d0a 0 10px, #17110d 10px 20px);
}
.card .body { padding: 16px 18px 18px; }
.card .body p { margin: 0; font-size: 16px; color: var(--text-dim); }
.card .spawn {
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--edge);
  font-size: 15px; color: var(--text);
}
.card .spawn b { color: var(--gold); font-weight: 700; }

/* ---------- production chain ---------- */
.chain { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.node {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px;
  border-radius: 22px; border: 1px solid var(--edge-hi); background: var(--stone);
  font-weight: 600; font-size: 16px; color: var(--text);
}
.node.res { border-color: #5b4636; }
.node.bld { background: #2d1a10; border-color: #8a4a22; color: #ffd2b0; border-radius: 4px; }
.node.out { background: var(--gold); color: #1a0a03; border-color: var(--gold); }
.arrow { color: var(--lava); font-weight: 900; }

/* ---------- roadmap ---------- */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.timeline li { padding: 22px; position: relative; }
.timeline .when { font-family: var(--pixel); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gold); }
.timeline h3 { margin-top: 10px; }
.timeline p { margin: 0; color: var(--text-dim); font-size: 16px; }
.status {
  display: inline-block; margin-top: 14px; font-family: var(--pixel); font-size: 11px; text-transform: uppercase;
  padding: 4px 8px; border-radius: 3px; letter-spacing: 0.05em;
}
.status.done { background: #1e2a10; color: var(--imp); border: 1px solid #3c5520; }
.status.next { background: #3a1a08; color: #ffb27a; border: 1px solid #8a4a22; }
.status.later { background: #1b1b22; color: #aab3d4; border: 1px solid #3b3f55; }

/* ---------- news ---------- */
.news { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.news a.item { display: block; padding: 22px; text-decoration: none; color: inherit; }
.news a.item:hover { border-color: var(--gold); }
.news time { font-family: var(--pixel); font-size: 12px; color: var(--text-faint); text-transform: uppercase; }
.news h3 { margin: 8px 0; font-size: 20px; }
.news p { margin: 0; color: var(--text-dim); font-size: 16px; }

/* ---------- gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.gallery figure { margin: 0; padding: 6px; }
.gallery img { border-radius: 3px; width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.gallery figcaption { font-size: 15px; color: var(--text-faint); padding: 10px 6px 4px; }

/* ---------- call to action band ---------- */
.band {
  position: relative; overflow: hidden; isolation: isolate; text-align: center;
  padding: 88px 0;
}
.band::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse 60% 120% at 50% 120%, rgba(255,106,31,0.35), transparent 60%),
    var(--ground-2);
  border-top: 1px solid var(--edge);
}
.band h2 { max-width: 760px; margin-inline: auto; }
.band p { color: var(--text-dim); max-width: 620px; margin: 0 auto 28px; }
.band .cta-row { justify-content: center; }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--edge); padding: 40px 0 56px; color: var(--text-faint); font-size: 15px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 20px 40px; justify-content: space-between; }
footer nav { display: flex; gap: 8px 24px; flex-wrap: wrap; }
footer a { color: var(--text-dim); }

/* ---------- codex page ---------- */
.codex-hero { padding: 72px 0 40px; border-bottom: 1px solid var(--edge); background:
  radial-gradient(ellipse 50% 100% at 85% 0%, rgba(255,106,31,0.16), transparent 70%), var(--ground); }
.codex-hero p { color: var(--text-dim); max-width: 680px; font-size: 19px; }
.codex { display: flex; flex-wrap: wrap; gap: 40px; padding: 48px 0 96px; }
.codex aside { flex: 1 1 220px; max-width: 260px; }
.codex aside nav { position: sticky; top: 92px; display: grid; gap: 2px; }
.codex aside a {
  display: block; padding: 10px 14px; border-radius: 4px; color: var(--text-dim); text-decoration: none; font-weight: 600;
  border-left: 2px solid transparent;
}
.codex aside a:hover { color: var(--text); background: var(--stone); border-left-color: var(--lava); }
.codex .content { flex: 999 1 560px; min-width: 0; }
.codex .content > section { padding: 0 0 72px; }

.entry { display: grid; grid-template-columns: 120px 1fr; gap: 20px; padding: 20px; margin-bottom: 14px; }
.entry .thumb { width: 120px; height: 120px; border-radius: 4px; overflow: hidden; background: #0b0807; position: relative; border: 1px solid var(--edge); }
.entry .thumb img { width: 100%; height: 100%; object-fit: cover; }
.entry .thumb .ph { font-size: 10px; }
.entry p { margin: 0 0 10px; color: var(--text-dim); }
.stats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.stat {
  font-family: var(--pixel); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 5px 8px; border-radius: 3px; background: #120d0a; border: 1px solid var(--edge); color: var(--text-dim);
}
.stat b { color: var(--gold); font-weight: 400; }
@media (max-width: 560px) {
  .entry { grid-template-columns: 1fr; }
  .entry .thumb { width: 100%; height: 180px; }
}

.table-box { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--edge); }
table { width: 100%; border-collapse: collapse; font-size: 16px; min-width: 620px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--edge); vertical-align: top; }
th { font-family: var(--pixel); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gold); background: var(--stone-2); font-weight: 400; }
tr:last-child td { border-bottom: 0; }
td { color: var(--text-dim); }
td:first-child { color: var(--text); font-weight: 700; }
td span[id] { scroll-margin-top: 24px; }	/* (2026-11-16) a #link to a table row (items.html#wood): the whole row below the top bar */

/* interactive chain explorer */
.explorer .chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.explorer tr.dim td { opacity: 0.28; }
.explorer tr.hit td { background: rgba(242,181,68,0.07); }
.explorer .hint { font-size: 15px; color: var(--text-faint); margin: 10px 0 0; }

.subgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.mini { padding: 18px; }
.mini p { margin: 0; color: var(--text-dim); font-size: 16px; }
.mini h3 { font-size: 19px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
@media (max-width: 720px) {
  html { scroll-padding-top: 140px; }	/* the top bar has the menu on a row of its own: ~113 px */
  section { padding: 64px 0; }
  .hero { min-height: 640px; padding-top: 96px; }
  .hero p.lead { font-size: 19px; }
  .topbar .wrap { gap: 8px 16px; padding-top: 10px; }
  .topbar nav { order: 3; flex: 1 1 100%; padding-bottom: 4px; overflow-x: auto; flex-wrap: nowrap; }
  .topbar nav a { white-space: nowrap; }
  .topbar .btn { margin-left: auto; }
}

/* ==========================================================================
   Codex pages made by homepage/tools/build_codex.py (2026-11-11)
   ========================================================================== */
:root { --bronze: #c07a43; --silver: #cfc8bf; }
.page-title { font-family: var(--display); font-weight: 900; font-size: clamp(34px, 5vw, 54px); line-height: 1.08; margin: 0 0 14px; color: #fff4e6; }
.codex aside a[aria-current="page"] { color: var(--text); background: var(--stone); border-left-color: var(--gold); }
.codex aside a.sub { padding: 6px 14px 6px 28px; font-weight: 500; font-size: 15px; }
.codex .content > section h2 { margin-bottom: 12px; }
.intro { color: var(--text-dim); margin: 0 0 22px; max-width: 760px; }
.count { font-family: var(--pixel); font-size: 13px; color: var(--gold); vertical-align: middle; margin-left: 6px; }
.prose { padding: 22px 24px; margin-bottom: 18px; }
.prose p { margin: 0 0 12px; color: var(--text-dim); }
.prose p:last-child { margin-bottom: 0; }
.prose b { color: var(--text); }
.dim { color: var(--text-faint); }
img.ic { display: inline-block; width: 32px; height: 32px; vertical-align: middle; margin-right: 10px; }
td img.ic { width: 36px; height: 36px; }
td a { text-decoration: none; }

/* hub cards on codex.html */
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 16px; }
.hub { display: grid; grid-template-columns: 72px 1fr; gap: 16px; padding: 20px; text-decoration: none; color: inherit; align-items: start; }
.hub:hover { border-color: var(--gold); color: inherit; }
.hub .eyebrow { margin: 0 0 4px; display: block; }
.hub p { margin: 0; color: var(--text-dim); font-size: 16px; }

/* creature profiles */
.profile { padding: 0; margin-bottom: 28px; overflow: hidden; }
.profile-top { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.profile .render { display: block; background: #0b0807; border-right: 1px solid var(--edge); }
.profile .render img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 16 / 9; }
.profile .render.icon-only { display: grid; place-items: center; min-height: 220px; }
.profile .render.icon-only img { width: 128px; height: 128px; aspect-ratio: 1; }
.profile-head { padding: 22px 24px; }
.profile-head p { color: var(--text-dim); margin: 0 0 12px; font-size: 17px; }
.faces { display: flex; gap: 8px; margin-bottom: 12px; }
.faces img { width: 56px; height: 56px; border-radius: 4px; border: 1px solid var(--edge-hi); background: #0b0807; }
.block { padding: 20px 24px; border-top: 1px solid var(--edge); }
h4 { font-family: var(--pixel); font-weight: 400; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gold); margin: 0 0 12px; }
.block p { color: var(--text-dim); margin: 0 0 10px; }
.formula b { color: var(--text); }
.spawn-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; margin-top: 4px; }
.sp { background: #120d0a; border: 1px solid var(--edge); border-radius: 3px; padding: 6px 8px; display: grid; }
.sp span { font-family: var(--pixel); font-size: 10px; text-transform: uppercase; color: var(--text-faint); letter-spacing: 0.04em; }
.sp b { color: var(--gold); font-weight: 700; font-size: 17px; }
.table-box.levels table, .table-box.compare-t table { font-variant-numeric: tabular-nums; }
.table-box.levels td, .table-box.levels th { padding: 8px 12px; }
.skill { display: grid; grid-template-columns: 48px 1fr; gap: 14px; align-items: start; margin-bottom: 12px; }
.skill:last-child { margin-bottom: 0; }
.skill img { border-radius: 4px; }
h5 { font: 800 18px/1.3 var(--body); color: #fff4e6; margin: 0 0 4px; }
.lv { font-family: var(--pixel); font-size: 11px; font-weight: 400; color: var(--gold); margin-left: 6px; text-transform: uppercase; }
.skill p { margin: 0; }
.facts-list { display: grid; grid-template-columns: max-content 1fr; gap: 10px 18px; margin: 0; align-items: center; }
.facts-list dt { font-family: var(--pixel); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); }
.facts-list dd { margin: 0; color: var(--text-dim); }
.facts-list dd img { display: inline-block; vertical-align: middle; }

/* materials and costs */
.mats { display: inline-flex; flex-wrap: wrap; gap: 6px; vertical-align: middle; }
.mat { display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px 3px 5px; border-radius: 3px; background: #120d0a; border: 1px solid var(--edge);
  color: var(--text-dim); text-decoration: none; font-size: 15px; line-height: 1; white-space: nowrap; margin: 2px 4px 2px 0;
  font-variant-numeric: lining-nums; }	/* (2026-11-16, Rasmus: "detta ser konstigt ut") the icon off the edge, the text centred, the amount in lining figures (Alegreya's are old style: 25 hung below the line) */
.mat:hover { border-color: var(--gold); color: var(--text); }
.mat img { width: 22px; height: 22px; }
.mat b { color: var(--gold); }
.none { color: var(--text-faint); font-size: 15px; }
.cost { font-size: 15px; color: var(--text-faint) !important; }

/* icon entries (buildings, spells) */
.entry .thumb.icon { display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, #3a2b20, #120d0a); }
.entry .thumb.icon img { width: 96px; height: 96px; object-fit: contain; }
.ticks.small { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; font-size: 16px; }

/* rooms */
.room { padding: 0; margin-bottom: 22px; overflow: hidden; }
.room-head { display: grid; grid-template-columns: 96px minmax(0, 1fr) minmax(0, 300px); gap: 20px; padding: 20px 22px; align-items: start; }
.room-head > img { width: 96px; height: 96px; }
.room-head p { color: var(--text-dim); margin: 0 0 10px; }
.room-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.who { font-size: 15px; color: var(--text-faint); display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.who img { width: 32px; height: 32px; border-radius: 3px; border: 1px solid var(--edge); }
.room-shot img { border-radius: 3px; border: 1px solid var(--edge); width: 100%; height: auto; }
.addons { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr)); gap: 1px; background: var(--edge); border-top: 1px solid var(--edge); }
.addon { display: grid; grid-template-columns: 64px 1fr; gap: 14px; padding: 16px 18px; background: var(--stone); }
.addon h4 { font: 800 18px/1.3 var(--body); color: #fff4e6; text-transform: none; letter-spacing: 0; margin: 0 0 4px; }
.addon p { margin: 0 0 6px; color: var(--text-dim); font-size: 16px; }
.addon p.who { font-size: 15px; }

/* achievements */
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 12px; }
.ach { display: grid; grid-template-columns: 64px 1fr; gap: 14px; padding: 14px 16px; border-left: 3px solid var(--bronze); }
.ach.silver { border-left-color: var(--silver); }
.ach.gold { border-left-color: var(--gold); }
.ach img { border-radius: 4px; }
.ach h3 { font-size: 18px; margin: 0 0 4px; }
.ach p { margin: 0; color: var(--text-dim); font-size: 16px; }

/* gallery page + lightbox */
.gallery a { display: block; }
.gallery.squares { grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); }
.gallery.squares img { aspect-ratio: 1 / 1; }
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(8, 6, 5, 0.94); display: grid; grid-template-rows: 1fr auto; padding: 24px; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 110px); margin: auto; border-radius: 3px; box-shadow: 0 20px 60px #000; }
.lightbox p { text-align: center; color: var(--text-dim); margin: 12px 0 0; }
.lightbox button { position: absolute; min-width: 48px; min-height: 48px; border-radius: 24px; border: 1px solid var(--edge-hi);
  background: var(--stone-2); color: var(--text); font: 700 22px var(--body); cursor: pointer; }
.lightbox button:hover { border-color: var(--gold); }
.lightbox .close { top: 16px; right: 16px; }
.lightbox .prev { left: 16px; top: 50%; }
.lightbox .next { right: 16px; top: 50%; }

@media (max-width: 860px) {
  .profile-top { grid-template-columns: 1fr; }
  .profile .render { border-right: 0; border-bottom: 1px solid var(--edge); }
  .room-head { grid-template-columns: 72px 1fr; }
  .room-head > img { width: 72px; height: 72px; }
  .room-shot { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .block, .profile-head { padding: 18px 16px; }
  .facts-list { grid-template-columns: 1fr; gap: 4px; }
  .facts-list dd { margin-bottom: 8px; }
  .entry .thumb.icon { height: 120px; }
  .codex aside { max-width: none; }
  .codex aside nav { position: static; display: flex; flex-wrap: wrap; gap: 4px; }
  .codex aside a.sub { display: none; }
}
.gallery img { height: auto; }
.table-box th { white-space: nowrap; }
.compare-t td:first-child, .items-t td:first-child { white-space: nowrap; }
.addons { background: var(--stone); gap: 0; }
.addon { box-shadow: inset -1px -1px 0 var(--edge); }

/* (2026-11-11) trailer in the hero, click to load (index.html) */
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 520px); gap: 40px; align-items: end; }
.trailer { margin: 0; padding: 8px; }
.trailer .caption { margin: 8px 4px 0; font-size: 14px; }
.yt { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 3px; overflow: hidden; background: #000; }
.yt img { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.8); transition: filter 0.2s; }
.yt:hover img { filter: brightness(1); }
.yt .play { position: absolute; inset: 0; margin: auto; width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(14, 10, 8, 0.75); border: 2px solid #ffe8c8; color: #ffe8c8; box-shadow: 0 0 24px rgba(255, 106, 31, 0.45); }
.yt .play svg { width: 34px; height: 34px; margin-left: 4px; }
.yt:hover .play, .yt:focus-visible .play { border-color: var(--gold); color: var(--gold); }
.trailer iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 3px; background: #000; }
@media (max-width: 960px) { .hero-grid { grid-template-columns: 1fr; } .trailer { max-width: 640px; } }
@media (prefers-reduced-motion: reduce) { .yt img { transition: none; } }

/* ==========================================================================
   modding.html (2026-11-16): code blocks, inline code, lists
   ========================================================================== */
:root { --mono: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace; }
.code {
  margin: 0 0 22px; padding: 16px 18px; overflow-x: auto; white-space: pre; tab-size: 2;
  background: #0b0807; border: 1px solid var(--edge); border-radius: var(--radius);
  font: 15px/1.55 var(--mono); color: var(--text);
}
code { font-family: var(--mono); font-size: 0.86em; color: var(--gold-soft); background: #120d0a; border: 1px solid var(--edge); border-radius: 3px; padding: 1px 5px; overflow-wrap: anywhere; }
.code code { font-size: inherit; color: inherit; background: none; border: 0; padding: 0; overflow-wrap: normal; }
.codex .content b { color: var(--text); }
.codex .content ul.ticks { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 12px; max-width: 820px; }
.codex .content ul.ticks li { color: var(--text-dim); }
.codex .content .table-box { margin-bottom: 22px; }
.codex .content .gallery { margin-bottom: 22px; }
.gallery.one { grid-template-columns: 1fr; max-width: 900px; }
.prose h3 { margin: 0 0 14px; }
.prose ul.ticks { margin-bottom: 0; }
ol.steps { margin: 0 0 22px; padding-left: 26px; display: grid; gap: 10px; max-width: 820px; color: var(--text-dim); }
ol.steps li::marker { font-family: var(--pixel); font-size: 13px; color: var(--gold); }

/* (2026-11-16) skills column in the creature table: tighter cells so all 11 columns fit the 918 px column, headers may wrap */
.table-box.compare-t th, .table-box.compare-t td { padding-left: 7px; padding-right: 7px; }
.table-box.compare-t th { white-space: normal; vertical-align: bottom; line-height: 1.5; letter-spacing: 0; }
.table-box.compare-t td:first-child { padding-left: 14px; padding-right: 12px; }
.compare-t td:last-child { white-space: nowrap; }
.compare-t .sk-row { display: flex; align-items: center; gap: 8px; line-height: 1.3; }
.compare-t .sk-row + .sk-row { margin-top: 8px; }
.compare-t a.sk { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.compare-t .sk-row .dim { flex: none; }
.compare-t a.sk img { width: 22px; height: 22px; border-radius: 3px; }
.compare-t .sk-row .dim { font-size: 0.85em; }

/* (2026-11-20) beginner's guide (guide.html): keys, tip box, pictures that keep their own shape */
kbd { display: inline-block; min-width: 1.7em; padding: 0 7px; font: 700 0.86em/1.55 var(--body); color: var(--gold-soft); text-align: center;
      background: linear-gradient(var(--stone-2), var(--stone)); border: 1px solid var(--edge-hi); border-bottom-width: 2px; border-radius: 4px; white-space: nowrap; }
.codex .content .tip { max-width: 820px; margin: 0 0 22px; }
.codex .content .tip h3 { font-family: var(--pixel); font-size: 12px; font-weight: 400; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); margin: 0 0 6px; }
.gallery.natural img { aspect-ratio: auto; object-fit: contain; }
