/* Aldervast website (2026-11-12 redesign): the game's own interface on the page. Frosted navy glass, silver-gold filigree,
   pale-blue crystal shards and the Lattice behind it all. Fonts are the game's own (Cinzel, Alegreya, Alegreya Sans; OFL).
   Ornaments are SVG in ../ui/ (written by build_site.py from ornaments.py). */
@font-face { font-family: "Cinzel"; src: url("../assets/fonts/Cinzel.woff2") format("woff2"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Alegreya"; src: url("../assets/fonts/Alegreya.woff2") format("woff2"); font-weight: 400 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Alegreya"; src: url("../assets/fonts/Alegreya-Italic.woff2") format("woff2"); font-weight: 400 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("../assets/fonts/AlegreyaSans-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("../assets/fonts/AlegreyaSans-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #050a15;
  --bg-2: #081021;
  --navy: #0c1830;
  --panel: rgba(14, 26, 50, 0.82);
  --panel-2: rgba(22, 40, 74, 0.78);
  --panel-solid: #0d1a33;
  --line: rgba(150, 185, 230, 0.15);
  --line-2: rgba(217, 180, 106, 0.45);
  --line-ice: rgba(159, 220, 255, 0.32);
  --ink: #e9eef8;
  --ink-2: #c4cfe1;
  --muted: #8e9fbb;
  --gold: #d9b46a;
  --gold-2: #f2d995;
  --gold-3: #fff1c6;
  --gold-deep: #8a6a32;
  --lattice: #9fdcff;
  --crystal: #9fdcff;
  --crystal-2: #dff5ff;
  --ember: #e0743a;
  --magic: #8fb0ff;
  --rare: #e9d66b;
  --unique: #e8904a;
  --set: #6cd36c;
  --bad: #ef6b63;
  --good: #7fd08a;
  --radius: 14px;
  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 44px);
  --display: "Cinzel", "Trajan Pro", Georgia, serif;
  --serif: "Alegreya", Georgia, "Times New Roman", serif;
  --body: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.55);
  --glass: linear-gradient(180deg, rgba(24, 42, 78, 0.86) 0%, rgba(12, 22, 44, 0.9) 55%, rgba(9, 17, 35, 0.92) 100%);
  --frame: linear-gradient(155deg, rgba(255, 238, 190, 0.9) 0%, rgba(217, 180, 106, 0.55) 18%, rgba(140, 165, 205, 0.32) 40%, rgba(159, 220, 255, 0.3) 62%, rgba(217, 180, 106, 0.6) 85%, rgba(255, 238, 190, 0.85) 100%);
  --pill: linear-gradient(180deg, rgba(40, 60, 104, 0.95), rgba(14, 26, 52, 0.95));
  --glow-gold: 0 0 0 1px rgba(232, 196, 120, 0.85), 0 0 16px rgba(232, 196, 120, 0.38), inset 0 0 14px rgba(232, 196, 120, 0.18);
  --nav-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; color: var(--ink); background: var(--bg);
  font: 400 1.075rem/1.62 var(--body);
  overflow-x: hidden;
}
/* The night sky behind every page: deep navy, a cold aurora, and the Lattice's threads fading out from the top */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -10; pointer-events: none;
  background:
    radial-gradient(900px 620px at 12% -8%, rgba(74, 132, 230, 0.20), transparent 70%),
    radial-gradient(760px 560px at 96% 22%, rgba(159, 220, 255, 0.09), transparent 70%),
    radial-gradient(1100px 760px at 50% 118%, rgba(104, 78, 196, 0.13), transparent 70%),
    linear-gradient(180deg, #08142b 0%, #050a15 58%, #04080f 100%);
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: -9; pointer-events: none; opacity: 0.11;
  background: url("../ui/lattice.svg") 0 0 / 96px auto repeat;
  -webkit-mask-image: radial-gradient(140% 90% at 50% 0%, #000 0%, rgba(0, 0, 0, 0.35) 45%, transparent 75%);
  mask-image: radial-gradient(140% 90% at 50% 0%, #000 0%, rgba(0, 0, 0, 0.35) 45%, transparent 75%);
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--gold-2); text-decoration-color: rgba(242, 217, 149, 0.35); text-underline-offset: 3px; transition: color 0.2s, text-decoration-color 0.2s; }
a:hover { color: var(--gold-3); text-decoration-color: currentColor; }
::selection { background: rgba(159, 220, 255, 0.3); color: #fff; }
:focus-visible { outline: 2px solid var(--crystal); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; letter-spacing: 0.04em; line-height: 1.2; color: var(--gold-2); margin: 0 0 0.5em; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.35rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.38rem); }
h4 { font-size: 1.02rem; letter-spacing: 0.06em; }
p { margin: 0 0 1em; text-wrap: pretty; }
small, .small { font-size: 0.9rem; }
.muted { color: var(--muted); }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.wrap.narrow { max-width: 860px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: #000; padding: 8px 14px; z-index: 100; border-radius: 6px; }
.skip:focus { left: 8px; }

/* ---------- The frame: glass, a gilt edge and crystal corners (the game's windows) ---------- */
.framed, .card, .table-wrap, .wiki-side, .track, .map-wrap, .plate-card, .glance, .status-panel, .entry:target, .cat-tile:hover, .lore-panel {
  position: relative; isolation: isolate;
}
.framed::before, .card::before, .wiki-side::before, .track::before, .map-wrap::before, .plate-card::before,
.glance::before, .status-panel::before, .cat-tile::before, .entry::before, .lore-panel::before, .clip::before, .feature-media::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; z-index: 2;
  background: var(--frame);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.framed::after, .plate-card::after, .glance::after, .status-panel::after, .wiki-side::after, .map-wrap::after, .lore-panel::after, .entry:target::after, a.card:hover::after, .feature-media::after {
  content: ""; position: absolute; inset: -9px; pointer-events: none; z-index: 3;
  background:
    url("../ui/corner-tl.svg") top left / 38px 38px no-repeat, url("../ui/corner-tr.svg") top right / 38px 38px no-repeat,
    url("../ui/corner-bl.svg") bottom left / 38px 38px no-repeat, url("../ui/corner-br.svg") bottom right / 38px 38px no-repeat;
}
.framed, .plate-card, .glance, .status-panel, .lore-panel { background: var(--glass); border-radius: var(--radius); box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.07); }

/* The crest that sits on a title plate's top edge */
.crest { display: block; width: 150px; height: 68px; margin: 0 auto; background: url("../ui/crest.svg") center / contain no-repeat; filter: drop-shadow(0 0 14px rgba(159, 220, 255, 0.4)); }

/* ---------- Navigation ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; height: var(--nav-h); z-index: 50;
  display: flex; align-items: center;
  background: linear-gradient(to bottom, rgba(4, 9, 19, 0.82), rgba(4, 9, 19, 0));
  transition: background 0.35s, box-shadow 0.35s;
}
.nav::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; opacity: 0; transition: opacity 0.35s;
  background: linear-gradient(90deg, transparent, rgba(217, 180, 106, 0.6) 22%, rgba(159, 220, 255, 0.75) 50%, rgba(217, 180, 106, 0.6) 78%, transparent); }
.nav.solid { background: rgba(7, 14, 30, 0.8); backdrop-filter: blur(14px) saturate(1.25); -webkit-backdrop-filter: blur(14px) saturate(1.25); box-shadow: 0 12px 34px rgba(0, 0, 0, 0.4); }
.nav.solid::after { opacity: 1; }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-family: var(--display); font-weight: 700; letter-spacing: 0.24em; font-size: 1.08rem; }
.brand span { background: linear-gradient(180deg, #fff6dc, #f0d48c 55%, #c39446); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand .mark { width: 34px; height: 34px; flex: none; background: url("../ui/mark.svg") center / contain no-repeat; filter: drop-shadow(0 0 8px rgba(159, 220, 255, 0.45)); }
.nav-links { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  display: block; padding: 8px 14px; border-radius: 999px; text-decoration: none; color: var(--ink-2);
  font-family: var(--display); font-size: 0.78rem; letter-spacing: 0.15em; text-transform: uppercase; font-weight: 600;
  transition: color 0.2s, background 0.2s, box-shadow 0.2s;
}
.nav-links a:hover { color: var(--gold-3); background: rgba(159, 220, 255, 0.07); }
.nav-links a[aria-current="page"] { color: var(--gold-3); background: var(--pill); box-shadow: var(--glow-gold); }
.nav-toggle { display: none; background: rgba(12, 24, 48, 0.6); border: 1px solid var(--line-2); color: var(--gold-2); width: 46px; height: 42px; border-radius: 10px; cursor: pointer; }
.nav-toggle span { display: block; width: 18px; height: 2px; background: currentColor; margin: 4px auto; transition: transform 0.3s, opacity 0.3s; }
.nav-open .nav-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 980px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: fixed; top: var(--nav-h); left: 0; right: 0; height: calc(100vh - var(--nav-h)); height: calc(100dvh - var(--nav-h)); flex-direction: column; gap: 4px;
    background: rgba(6, 12, 26, 0.985) !important; padding: 16px var(--gutter) 40px; overflow-y: auto;
    transform: translateY(-8px); opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.25s;
  }
  .nav-open .nav-links { opacity: 1; transform: none; pointer-events: auto; }
  .nav-links a { padding: 15px 18px; font-size: 0.95rem; border-radius: 12px; border: 1px solid var(--line); background: rgba(14, 26, 50, 0.55); }
  .nav-open .nav { background: rgb(6, 12, 26); }
}

/* ---------- Hero (home) ---------- */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: grid; align-items: end; overflow: hidden; isolation: isolate; }
.hero-slides { position: absolute; inset: 0; z-index: -2; background: #02050b; }
.hero-slides img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.06); transition: opacity 1.8s ease, transform 9s linear; }
.hero-slides img.on { opacity: 1; transform: scale(1.0); }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(to top, var(--bg) 0%, rgba(5, 10, 21, 0.86) 18%, rgba(5, 10, 21, 0.18) 52%, rgba(5, 10, 21, 0.5) 100%),
    radial-gradient(120% 85% at 50% 42%, transparent 45%, rgba(2, 5, 12, 0.62) 100%);
}
.hero::before { /* the Lattice, faint over the sky */
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0.16; pointer-events: none;
  background: url("../ui/lattice.svg") 50% 0 / 120px auto repeat;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 46%); mask-image: linear-gradient(to bottom, #000 0%, transparent 46%);
}
.hero-inner { padding: calc(var(--nav-h) + 40px) var(--gutter) clamp(36px, 7vh, 80px); text-align: center; }
@media (max-width: 560px) { .hero-kicker { letter-spacing: 0.2em; font-size: 0.7rem; } }
.hero .crest { width: clamp(150px, 18vw, 210px); height: clamp(68px, 8.2vw, 95px); margin-bottom: 6px; }
.hero-kicker { font-family: var(--display); font-weight: 700; letter-spacing: 0.34em; text-transform: uppercase; font-size: 0.78rem; color: var(--crystal-2); margin-bottom: 14px; text-shadow: 0 1px 2px #000, 0 0 18px rgba(0, 0, 0, 0.9); }
.wordmark {
  font-family: var(--display); font-weight: 700; font-size: clamp(2.8rem, 11vw, 7.6rem); letter-spacing: 0.15em; line-height: 1;
  margin: 0 0 0.12em; padding-left: 0.15em;
  background: linear-gradient(180deg, #fffaf0 0%, #f6e2a8 38%, #d9b46a 62%, #a77a35 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 22px rgba(0, 0, 0, 0.75)) drop-shadow(0 0 30px rgba(159, 220, 255, 0.22));
}
.hero .rule { margin-bottom: 20px; }
.hero-tag { font-family: var(--serif); font-size: clamp(1.12rem, 2.2vw, 1.4rem); color: #e3e9f4; max-width: 660px; margin: 0 auto 30px; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9); }
.hero-caption { position: absolute; right: var(--gutter); bottom: 18px; font-size: 0.82rem; color: rgba(233, 238, 248, 0.62); text-align: right; transition: opacity 0.6s; font-style: italic; font-family: var(--serif); }
.hero-dots { display: flex; gap: 10px; justify-content: center; margin-top: 30px; }
.hero-dots button { width: 11px; height: 11px; border: 1px solid rgba(217, 180, 106, 0.7); padding: 0; background: rgba(5, 10, 21, 0.5); cursor: pointer; transform: rotate(45deg); transition: background 0.3s, box-shadow 0.3s; position: relative; }
.hero-dots button.on { background: linear-gradient(135deg, #f6fdff, #8fd3ff); border-color: #dff5ff; box-shadow: 0 0 12px rgba(159, 220, 255, 0.85); }
.hero-dots button::before { content: ""; position: absolute; inset: -12px; } /* a larger tap target */
.hero-ribbon {
  display: flex; align-items: center; justify-content: center; gap: 10px 16px; flex-wrap: wrap; margin: 26px auto 0; max-width: 820px;
  padding: 10px 20px; border-radius: 999px; font-size: 0.95rem; color: var(--ink-2);
  background: rgba(8, 16, 34, 0.62); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 0 0 1px rgba(159, 220, 255, 0.22), 0 10px 30px rgba(0, 0, 0, 0.4);
}
.hero-ribbon b { font-family: var(--display); letter-spacing: 0.12em; font-size: 0.78rem; text-transform: uppercase; color: var(--crystal-2); }
.hero-ribbon .ver { color: var(--gold-2); font-family: var(--display); font-weight: 700; letter-spacing: 0.06em; }
@media (max-width: 640px) { .hero-ribbon { border-radius: 16px; padding: 10px 14px; } }

/* ---------- Page heroes (inner pages): a framed title plate over the picture ---------- */
.page-hero { position: relative; padding: calc(var(--nav-h) + clamp(56px, 11vh, 110px)) 0 clamp(36px, 6vh, 64px); overflow: hidden; isolation: isolate; text-align: center; }
.page-hero .bgimg { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; opacity: 0.85; }
.page-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, var(--bg) 0%, rgba(5, 10, 21, 0.55) 40%, rgba(5, 10, 21, 0.35) 100%); }
.plate-card { max-width: 780px; margin: 0 auto; padding: 48px clamp(20px, 5vw, 56px) 30px; background: linear-gradient(180deg, rgba(14, 28, 56, 0.72), rgba(6, 13, 28, 0.82)); backdrop-filter: blur(12px) saturate(1.15); -webkit-backdrop-filter: blur(12px) saturate(1.15); }
.plate-card > .crest { position: absolute; left: 50%; top: -40px; transform: translateX(-50%); z-index: 4; }
.plate-card h1 { color: var(--gold-2); text-shadow: 0 2px 18px rgba(0, 0, 0, 0.6); margin-bottom: 4px; }
.page-hero p { color: var(--ink-2); max-width: 680px; margin: 0 auto; font-size: 1.16rem; font-family: var(--serif); }
.eyebrow { font-family: var(--display); letter-spacing: 0.3em; text-transform: uppercase; font-size: 0.74rem; color: var(--crystal-2); margin-bottom: 12px; display: inline-flex; align-items: center; gap: 12px; }
.eyebrow::before, .eyebrow::after { content: ""; width: 7px; height: 7px; transform: rotate(45deg); background: linear-gradient(135deg, #f6fdff, #6fb8ff); box-shadow: 0 0 8px rgba(159, 220, 255, 0.9); flex: none; }

/* ---------- Buttons ---------- */
.btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 13px 28px; border-radius: 999px; text-decoration: none;
  font-family: var(--display); font-weight: 700; font-size: 0.84rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--gold-3); background: var(--pill); box-shadow: var(--glow-gold), 0 10px 26px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s, box-shadow 0.25s, color 0.2s;
}
.btn:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 0 0 1px #ffe6a6, 0 0 26px rgba(232, 196, 120, 0.55), inset 0 0 18px rgba(232, 196, 120, 0.28), 0 14px 30px rgba(0, 0, 0, 0.45); }
.btn.ghost { color: var(--crystal-2); background: rgba(8, 18, 38, 0.55); box-shadow: 0 0 0 1px rgba(159, 220, 255, 0.4), inset 0 0 14px rgba(159, 220, 255, 0.08); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.btn.ghost:hover { color: #fff; box-shadow: 0 0 0 1px rgba(200, 238, 255, 0.85), 0 0 22px rgba(159, 220, 255, 0.35), inset 0 0 16px rgba(159, 220, 255, 0.14); }

/* ---------- Sections ---------- */
section { position: relative; }
.section { padding: clamp(56px, 8vw, 104px) 0; }
.section.tight { padding: clamp(40px, 6vw, 70px) 0; }
.section-head { text-align: center; max-width: 780px; margin: 0 auto clamp(32px, 5vw, 56px); }
.section-head h2::after { content: ""; display: block; width: min(340px, 86%); height: 22px; margin: 14px auto 0; background: url("../ui/rule.svg") center / contain no-repeat; }
.section-head p { color: var(--ink-2); font-size: 1.14rem; font-family: var(--serif); }
.rule { display: block; width: min(360px, 86%); height: 22px; margin: 0 auto 18px; background: url("../ui/rule.svg") center / contain no-repeat; }
.rule i { display: none; }
.band { background: linear-gradient(180deg, transparent, rgba(12, 26, 54, 0.55) 14%, rgba(12, 26, 54, 0.55) 86%, transparent); }
.band::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0.08; pointer-events: none; background: url("../ui/lattice.svg") 0 0 / 96px auto repeat;
  -webkit-mask-image: radial-gradient(70% 60% at 50% 50%, #000, transparent); mask-image: radial-gradient(70% 60% at 50% 50%, #000, transparent); }
.band { isolation: isolate; }

.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.9s ease, transform 0.9s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-slides img { transition: opacity 0.6s; transform: none !important; }
  html { scroll-behavior: auto; }
}

/* Lead paragraph with drop cap */
.lead { font-family: var(--serif); font-size: clamp(1.14rem, 1.8vw, 1.3rem); color: var(--ink-2); line-height: 1.72; }
.dropcap::first-letter { font-family: var(--display); float: left; font-size: 3.7em; line-height: 0.82; padding: 0.06em 0.12em 0 0; color: var(--gold-2); text-shadow: 0 0 22px rgba(217, 180, 106, 0.35); }

/* Intro split (home): the story beside a framed "at a glance" plate */
.intro-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(26px, 5vw, 64px); align-items: center; }
@media (max-width: 900px) { .intro-grid { grid-template-columns: 1fr; } }
.glance { padding: 34px 28px 26px; }
.glance h3 { text-align: center; font-size: 1.05rem; letter-spacing: 0.22em; text-transform: uppercase; margin-bottom: 16px; }
.glance > .crest { position: absolute; left: 50%; top: -36px; transform: translateX(-50%); width: 120px; height: 54px; z-index: 4; }

/* Stat tiles: a number cut in gold over a bead of crystal */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat { position: relative; background: rgba(8, 17, 36, 0.66); border: 1px solid var(--line); border-radius: 12px; padding: 14px 10px 12px; text-align: center; }
.stat::before { content: ""; position: absolute; left: 50%; top: -4px; width: 7px; height: 7px; transform: translateX(-50%) rotate(45deg); background: linear-gradient(135deg, #f6fdff, #6fb8ff); box-shadow: 0 0 8px rgba(159, 220, 255, 0.85); }
.stat b { display: block; font-family: var(--display); font-size: clamp(1.45rem, 2.6vw, 1.95rem); color: var(--gold-2); font-weight: 600; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 0.9rem; }
.stats.wide { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); margin-top: 34px; }

/* ---------- Cards & grids ---------- */
.grid { display: grid; gap: clamp(16px, 2.2vw, 26px); }
.g2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }

.card {
  background: var(--glass); border-radius: var(--radius); overflow: visible;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.06); transition: transform 0.3s, box-shadow 0.3s;
}
a.card { text-decoration: none; color: inherit; display: block; }
a.card:hover { transform: translateY(-4px); box-shadow: 0 22px 54px rgba(0, 0, 0, 0.55), 0 0 30px rgba(159, 220, 255, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.08); }
.card .media { aspect-ratio: 16 / 9; overflow: hidden; background: #000; border-radius: var(--radius) var(--radius) 0 0; position: relative; }
.card .media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(9, 17, 35, 0.85), transparent 45%); pointer-events: none; }
.card .media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s ease; }
a.card:hover .media img { transform: scale(1.05); }
.card .body { padding: 16px 22px 22px; position: relative; }
.card .body p:last-child { margin-bottom: 0; }
.card .body p { color: var(--ink-2); }
.card h3 { margin-bottom: 6px; }
.card .meta { margin: 0 0 8px; }
.card .media + .body > .meta:first-child { margin: -30px 0 10px; position: relative; z-index: 3; }
.card .meta, .pill, .chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 0.82rem; padding: 3px 12px; border-radius: 999px; white-space: nowrap; line-height: 1.5;
  color: var(--gold-3); background: var(--pill); box-shadow: 0 0 0 1px rgba(217, 180, 106, 0.55);
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; }
.chip { color: var(--ink-2); box-shadow: 0 0 0 1px var(--line-2); }
.chip.lat { color: var(--crystal-2); box-shadow: 0 0 0 1px rgba(159, 220, 255, 0.45); }
.chip.emb { color: #f6ae80; box-shadow: 0 0 0 1px rgba(224, 116, 58, 0.5); }

/* Bento (home features): one big card and five beside and under it */
.bento { display: grid; gap: clamp(16px, 2.2vw, 26px); grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bento > :first-child { grid-column: span 2; grid-row: span 2; display: flex; flex-direction: column; }
.bento > :first-child .media { aspect-ratio: auto; flex: 1 1 auto; min-height: clamp(240px, 26vw, 380px); }
.bento > :first-child .media img { position: absolute; inset: 0; }
.bento > :first-child h3 { font-size: clamp(1.35rem, 2.4vw, 1.8rem); }
@media (max-width: 900px) { .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); } .bento > :first-child { grid-row: auto; } .bento > :first-child .media { min-height: 0; aspect-ratio: 16 / 9; } }
@media (max-width: 620px) { .bento { grid-template-columns: 1fr; } .bento > :first-child { grid-column: auto; } }

/* Region band: big image + text alternating */
.feature { display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(24px, 4vw, 60px); align-items: center; margin-bottom: clamp(56px, 8vw, 100px); }
.feature:nth-of-type(even) { grid-template-columns: 1fr 1.25fr; }
.feature:nth-of-type(even) .feature-media { order: 2; }
.feature-media { position: relative; border-radius: var(--radius); box-shadow: var(--shadow); aspect-ratio: 16 / 9; background: #000; margin: 0; }
.feature-media img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius); }
.feature-media figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 16px 12px; font-size: 0.86rem; color: var(--ink-2); background: linear-gradient(transparent, rgba(4, 9, 20, 0.85)); border-radius: 0 0 var(--radius) var(--radius); font-family: var(--serif); font-style: italic; }
.feature h3 { font-size: clamp(1.4rem, 2.6vw, 1.95rem); }
.feature p { font-family: var(--serif); color: var(--ink-2); font-size: 1.08rem; }
.feature ul { padding-left: 1.1em; color: var(--ink-2); }
.feature li { margin-bottom: 4px; }
.feature li::marker { color: var(--crystal); content: "\25C6  "; font-size: 0.7em; }
@media (max-width: 820px) {
  .feature, .feature:nth-of-type(even) { grid-template-columns: 1fr; }
  .feature:nth-of-type(even) .feature-media { order: 0; }
}

/* Small figure grid */
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 12px; }
.thumbs figure { margin: 0; border-radius: 10px; overflow: hidden; background: #000; aspect-ratio: 16 / 9; cursor: zoom-in; position: relative; box-shadow: 0 0 0 1px var(--line), 0 10px 26px rgba(0, 0, 0, 0.35); transition: box-shadow 0.3s; }
.thumbs figure:hover { box-shadow: 0 0 0 1px rgba(217, 180, 106, 0.7), 0 0 20px rgba(159, 220, 255, 0.18), 0 12px 30px rgba(0, 0, 0, 0.45); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s, filter 0.4s; }
.thumbs figure:hover img { transform: scale(1.05); }
.thumbs figcaption { position: absolute; inset: auto 0 0 0; padding: 24px 10px 8px; font-size: 0.84rem; background: linear-gradient(transparent, rgba(3, 7, 16, 0.88)); color: var(--ink); opacity: 0; transition: opacity 0.3s; }
.thumbs figure:hover figcaption, .thumbs figure:focus-visible figcaption { opacity: 1; }
@media (hover: none) { .thumbs figcaption { opacity: 1; } }
.thumbs.feature-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.thumbs.feature-strip figure:first-child { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }
@media (max-width: 760px) { .thumbs.feature-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } .thumbs.feature-strip figure:first-child { aspect-ratio: 16 / 9; grid-row: auto; } }

/* ---------- Map ---------- */
.map-wrap { max-width: 920px; margin: 0 auto; border-radius: 18px; box-shadow: var(--shadow), 0 0 60px rgba(159, 220, 255, 0.08); background: #10324c; }
.map-wrap img { width: 100%; height: auto; border-radius: 18px; }
.map-wrap svg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; }
.map-wrap .rlabel { font-family: var(--display); font-weight: 700; letter-spacing: 0.2em; fill: rgba(255, 244, 214, 0.9); text-transform: uppercase; paint-order: stroke; stroke: rgba(4, 10, 22, 0.75); stroke-width: 5px; pointer-events: none; }
.pin { cursor: pointer; }
.pin circle.dot { stroke: #08101f; stroke-width: 2.5; transition: r 0.2s; }
.pin:hover circle.dot, .pin.on circle.dot { r: 11; }
.pin circle.halo { fill: none; stroke-width: 2; opacity: 0.0; }
.pin.on circle.halo { opacity: 0.85; }
.pin text { font-family: var(--body); font-weight: 700; font-size: 17px; fill: #fff; paint-order: stroke; stroke: rgba(3, 8, 18, 0.85); stroke-width: 4px; pointer-events: none; }
.map-tip { position: absolute; z-index: 5; max-width: 260px; background: rgba(9, 18, 38, 0.96); border-radius: 10px; padding: 10px 12px; font-size: 0.92rem; box-shadow: 0 0 0 1px var(--line-2), var(--shadow); pointer-events: none; opacity: 0; transform: translate(-50%, calc(-100% - 16px)); transition: opacity 0.15s; }
.map-tip.on { opacity: 1; }
.map-tip b { font-family: var(--display); letter-spacing: 0.04em; color: var(--gold-2); display: block; }
.map-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; margin-top: 18px; color: var(--muted); font-size: 0.92rem; }
.map-legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 7px; vertical-align: -1px; background: var(--c); border: 1.5px solid #000; }
@media (max-width: 640px) { .pin text { display: none; } .map-wrap .rlabel { font-size: 46px; letter-spacing: 0.08em; } .pin circle.dot { r: 12; } .pin:hover circle.dot, .pin.on circle.dot { r: 16; } .eyebrow { letter-spacing: 0.2em; } }

/* Locator maps in the wiki (crops of the game's painted map, north up) */
.locmap { position: relative; margin: 4px 0 12px; border-radius: 12px; overflow: hidden; background: #10324c; box-shadow: 0 0 0 1px var(--line-2), 0 10px 26px rgba(0, 0, 0, 0.4); aspect-ratio: 8 / 5; max-width: 100%; }
.locmap img { width: 100%; height: 100%; object-fit: cover; }
.locmap::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 40px rgba(3, 8, 18, 0.55); }
.lm { position: absolute; z-index: 2; width: 0; height: 0; }
.lm i { position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; transform: rotate(45deg); background: var(--c, #f2d995); border: 1.5px solid #08101f; box-shadow: 0 0 6px rgba(0, 0, 0, 0.6); }
.lm b { position: absolute; left: 10px; top: -10px; white-space: nowrap; font: 700 0.76rem/1.2 var(--body); color: #fff; text-shadow: 0 0 3px #000, 0 0 6px #000, 0 1px 2px #000; }
.lm.left b { left: auto; right: 10px; }
.lm a { color: #fff; text-decoration: none; }
.lm a:hover { color: var(--gold-3); }
.lm.here i { left: -8px; top: -8px; width: 16px; height: 16px; background: linear-gradient(135deg, #f6fdff, #6fb8ff); border-color: #fff; box-shadow: 0 0 0 3px rgba(5, 10, 21, 0.6), 0 0 16px rgba(159, 220, 255, 0.95); }
.lm.here b { font-family: var(--display); font-size: 0.86rem; letter-spacing: 0.05em; color: var(--gold-3); left: 14px; top: -11px; }
.lm.here.left b { left: auto; right: 14px; }
.lm.town i { --c: #f2d995; border-radius: 50%; transform: none; }
.lm.small b { display: none; }
.locmap .north { position: absolute; z-index: 2; right: 10px; top: 8px; font: 700 0.8rem var(--display); color: var(--gold-3); text-shadow: 0 0 4px #000; text-align: center; line-height: 1; }
.locmap .north::before { content: ""; display: block; width: 0; height: 0; margin: 0 auto 2px; border: 6px solid transparent; border-bottom: 10px solid var(--gold-2); border-top: 0; }
.locmap .scale { position: absolute; z-index: 2; left: 10px; bottom: 8px; font: 700 0.72rem var(--body); color: #fff; text-shadow: 0 0 3px #000; }
.locmap .scale i { display: block; height: 4px; margin-bottom: 3px; border: 1.5px solid #fff; border-top: 0; box-shadow: 0 1px 2px #000; }
@media (max-width: 560px) { .lm:not(.here) b { display: none; } }

/* Weather bars */
.bars { display: grid; gap: 6px; margin: 10px 0 0; }
.bar { display: grid; grid-template-columns: 70px 1fr; align-items: center; gap: 10px; font-size: 0.88rem; color: var(--muted); }
.bar i { height: 6px; border-radius: 3px; background: linear-gradient(90deg, #2b63a6, var(--crystal)); display: block; box-shadow: 0 0 8px rgba(159, 220, 255, 0.35); }

/* Attribute bars */
.attr { display: grid; grid-template-columns: 34px 1fr 26px; gap: 8px; align-items: center; font-size: 0.85rem; color: var(--muted); margin: 3px 0; }
.attr i { height: 5px; border-radius: 3px; display: block; }
.attr .str { background: #d0584a; } .attr .dex { background: #6cc66c; } .attr .int { background: #6a9cf0; }

/* Quote */
.quote { font-family: var(--serif); font-style: italic; color: var(--ink-2); border-left: 2px solid rgba(159, 220, 255, 0.45); padding: 2px 0 2px 14px; margin: 10px 0; }
.quote cite { display: block; font-family: var(--body); font-style: normal; color: var(--muted); font-size: 0.86rem; margin-top: 4px; }

/* Clips */
.clips { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); gap: 16px; }
.clip { margin: 0; border-radius: var(--radius); background: #000; position: relative; box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45); }
.clip video { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: #000; border-radius: var(--radius) var(--radius) 0 0; }
.clip figcaption { padding: 10px 14px; font-size: 0.92rem; color: var(--ink-2); background: var(--panel-solid); border-radius: 0 0 var(--radius) var(--radius); }

/* Audio */
.tracks { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 14px; }
.track { display: grid; grid-template-columns: 52px 1fr; gap: 14px; align-items: center; padding: 14px 18px; border-radius: var(--radius); background: var(--glass); }
.track button { width: 52px; height: 52px; border-radius: 50%; border: 0; background: radial-gradient(circle at 50% 32%, #2a4a80, #0b1730 72%); box-shadow: 0 0 0 1px rgba(217, 180, 106, 0.8), inset 0 0 12px rgba(159, 220, 255, 0.25); color: var(--gold-3); cursor: pointer; display: grid; place-items: center; transition: box-shadow 0.3s; }
.track button:hover { box-shadow: 0 0 0 1px #ffe6a6, 0 0 18px rgba(232, 196, 120, 0.45), inset 0 0 12px rgba(159, 220, 255, 0.35); }
.track button svg { width: 20px; height: 20px; }
.track b { font-family: var(--display); font-weight: 600; letter-spacing: 0.03em; display: block; font-size: 1rem; color: var(--gold-2); }
.track span { color: var(--muted); font-size: 0.9rem; display: block; }
.track .prog { height: 3px; background: rgba(255, 255, 255, 0.08); border-radius: 2px; margin-top: 8px; overflow: hidden; cursor: pointer; }
.track .prog i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--crystal)); }

/* ---------- Gallery ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 28px; }
.filters button { font: 600 0.78rem var(--display); letter-spacing: 0.12em; text-transform: uppercase; padding: 9px 16px; border-radius: 999px; border: 0; background: rgba(12, 24, 48, 0.6); color: var(--ink-2); cursor: pointer; box-shadow: 0 0 0 1px var(--line); transition: box-shadow 0.2s, color 0.2s; }
.filters button:hover { color: #fff; box-shadow: 0 0 0 1px var(--line-ice); }
.filters button[aria-pressed="true"] { color: var(--gold-3); background: var(--pill); box-shadow: var(--glow-gold); }
.masonry { columns: 3 320px; column-gap: 14px; }
.masonry figure { break-inside: avoid; margin: 0 0 14px; border-radius: 10px; overflow: hidden; cursor: zoom-in; position: relative; background: #000; box-shadow: 0 0 0 1px var(--line), 0 10px 26px rgba(0, 0, 0, 0.35); }
.masonry figure.hide { display: none; }
.masonry img { width: 100%; height: auto; transition: transform 0.8s; }
.masonry figure:hover img { transform: scale(1.04); }
.masonry figcaption { position: absolute; inset: auto 0 0 0; padding: 30px 12px 10px; background: linear-gradient(transparent, rgba(3, 7, 16, 0.88)); font-size: 0.9rem; opacity: 0; transition: opacity 0.3s; }
.masonry figcaption b { font-family: var(--display); font-weight: 600; display: block; letter-spacing: 0.03em; color: var(--gold-2); }
.masonry figure:hover figcaption { opacity: 1; }
@media (hover: none) { .masonry figcaption { opacity: 1; } }

.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(3, 7, 15, 0.96); display: none; align-items: center; justify-content: center; flex-direction: column; padding: 56px 12px 20px; }
.lightbox.on { display: flex; }
.lightbox img { max-height: calc(100vh - 160px); max-height: calc(100svh - 160px); width: auto; max-width: 100%; border-radius: 8px; box-shadow: 0 0 0 1px var(--line-2), 0 20px 80px #000; }
.lightbox .cap { max-width: 860px; text-align: center; margin-top: 14px; color: var(--ink-2); font-family: var(--serif); }
.lightbox .cap b { font-family: var(--display); color: var(--gold-2); display: block; letter-spacing: 0.04em; }
.lightbox button { position: absolute; background: var(--pill); border: 0; box-shadow: 0 0 0 1px var(--line-2); color: var(--gold-3); width: 48px; height: 48px; border-radius: 50%; cursor: pointer; font-size: 1.4rem; display: grid; place-items: center; }
.lightbox button:hover { box-shadow: var(--glow-gold); }
.lightbox .x { top: 12px; right: 12px; }
.lightbox .prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lightbox .next { right: 12px; top: 50%; transform: translateY(-50%); }
@media (max-width: 640px) { .lightbox .prev, .lightbox .next { top: auto; bottom: 14px; transform: none; } }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 12px; margin: 12px 0 24px; background: rgba(9, 18, 37, 0.82); box-shadow: 0 0 0 1px rgba(217, 180, 106, 0.38), 0 10px 26px rgba(0, 0, 0, 0.3); }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-family: var(--display); font-weight: 600; font-size: 0.76rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-2); background: rgba(20, 36, 68, 0.95); white-space: nowrap; position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(159, 220, 255, 0.045); }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
table.wide { min-width: 760px; }
table.wide td:first-child { white-space: nowrap; }

/* ---------- Wiki: the Encounter Journal's two panes ---------- */
.wiki-layout { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: clamp(20px, 3vw, 40px); align-items: start; padding-top: calc(var(--nav-h) + 30px); padding-bottom: 80px; }
.wiki-side { position: sticky; top: calc(var(--nav-h) + 20px); max-height: calc(100vh - var(--nav-h) - 40px); border-radius: var(--radius); background: var(--glass); box-shadow: var(--shadow); }
.wiki-side nav { max-height: calc(100vh - var(--nav-h) - 40px); overflow-y: auto; padding: 18px 14px 20px; scrollbar-width: thin; scrollbar-color: rgba(217, 180, 106, 0.4) transparent; border-radius: inherit; }
.wiki-side h4 { display: flex; align-items: center; gap: 9px; font-size: 0.8rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-2); margin: 18px 4px 8px; padding-bottom: 7px; border-bottom: 1px solid rgba(217, 180, 106, 0.22); }
.wiki-side h4 .gi { width: 19px; height: 19px; flex: none; color: var(--gold); }
.wiki-side ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.wiki-side a { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; text-decoration: none; color: var(--ink-2); font-size: 0.97rem; transition: background 0.2s, color 0.2s, box-shadow 0.2s; }
.wiki-side a span { color: var(--muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.wiki-side a:hover { background: rgba(159, 220, 255, 0.07); color: #fff; }
.wiki-side a[aria-current="page"] { background: var(--pill); color: var(--gold-3); box-shadow: var(--glow-gold); }
.wiki-side a[aria-current="page"] span { color: var(--gold-2); }
.wiki-side-toggle { display: none; }
@media (max-width: 960px) {
  .wiki-layout { grid-template-columns: minmax(0, 1fr); }
  .wiki-side { position: relative; top: auto; max-height: none; }
  .wiki-side::after { display: none; }
  .wiki-side nav { max-height: none; overflow: visible; display: none; padding-top: 4px; }
  .wiki-side.open nav { display: block; }
  .wiki-side-toggle { display: flex; width: 100%; justify-content: space-between; align-items: center; padding: 14px 18px; border: 0; border-radius: var(--radius); background: transparent; color: var(--gold-2); font: 600 0.85rem var(--display); letter-spacing: 0.14em; text-transform: uppercase; cursor: pointer; }
}
.crumbs { font-size: 0.88rem; color: var(--muted); margin-bottom: 10px; letter-spacing: 0.02em; }
.crumbs a { color: var(--muted); }
.wiki-main { min-width: 0; }
.wiki-head { position: relative; padding: 4px 0 6px; margin-bottom: 18px; }
.wiki-main h1 { margin-bottom: 4px; font-size: clamp(1.9rem, 4vw, 2.8rem); text-shadow: 0 0 30px rgba(217, 180, 106, 0.18); }
.wiki-main h1::after { content: ""; display: block; width: min(300px, 80%); height: 20px; margin: 10px 0 0 -6px; background: url("../ui/rule.svg") left center / contain no-repeat; }
.wiki-main > .intro, .wiki-head .intro { color: var(--ink-2); font-size: 1.1rem; max-width: 780px; font-family: var(--serif); }
.searchbox { position: relative; margin: 20px 0 26px; }
.searchbox input { width: 100%; padding: 15px 18px 15px 50px; font: inherit; color: var(--ink); background: rgba(9, 18, 37, 0.85); border: 0; border-radius: 999px; box-shadow: 0 0 0 1px var(--line-2), inset 0 2px 10px rgba(0, 0, 0, 0.35); }
.searchbox input::placeholder { color: var(--muted); }
.searchbox input:focus { outline: none; box-shadow: var(--glow-gold), inset 0 2px 10px rgba(0, 0, 0, 0.35); }
.searchbox svg { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); width: 19px; height: 19px; color: var(--gold); }
.results { list-style: none; margin: 0 0 26px; padding: 0; border-radius: 12px; overflow: hidden; display: none; box-shadow: 0 0 0 1px var(--line-2), var(--shadow); }
.results.on { display: block; }
.results li a { display: block; padding: 10px 16px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); background: rgba(10, 20, 41, 0.97); }
.results li a:hover, .results li a.sel { background: rgba(26, 46, 84, 0.97); }
.results li a small { color: var(--muted); display: block; }
.results li a em { font-style: normal; color: var(--crystal); font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; margin-left: 8px; }
.results .none { padding: 12px 16px; color: var(--muted); background: rgba(10, 20, 41, 0.97); }

.cat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 14px; }
.cat-tile { position: relative; display: block; padding: 16px 18px 15px; border-radius: 12px; background: linear-gradient(180deg, rgba(20, 36, 68, 0.8), rgba(10, 19, 38, 0.86)); text-decoration: none; color: var(--ink); transition: transform 0.2s, box-shadow 0.25s; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3); }
.cat-tile::before { opacity: 0.55; transition: opacity 0.25s; }
.cat-tile:hover { transform: translateY(-2px); color: #fff; box-shadow: 0 14px 30px rgba(0, 0, 0, 0.4), 0 0 24px rgba(159, 220, 255, 0.12); }
.cat-tile:hover::before { opacity: 1; }
.cat-tile b { font-family: var(--display); font-weight: 600; letter-spacing: 0.03em; display: flex; justify-content: space-between; gap: 8px; color: var(--gold-2); }
.cat-tile b span { color: var(--crystal-2); font-family: var(--body); font-variant-numeric: tabular-nums; }
.cat-tile small { color: var(--muted); display: block; margin-top: 4px; line-height: 1.4; }
.hub-group { display: flex; align-items: center; gap: 10px; }
.hub-group .gi { width: 26px; height: 26px; color: var(--gold); flex: none; }

.entries { display: grid; gap: 16px; }
.entry { position: relative; border-radius: 12px; background: linear-gradient(180deg, rgba(19, 34, 64, 0.82), rgba(9, 18, 37, 0.86)); padding: 18px 22px; scroll-margin-top: calc(var(--nav-h) + 20px); min-width: 0; box-shadow: 0 10px 26px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05); }
.entry::before { opacity: 0.45; }
.entry:target { box-shadow: 0 0 0 1px rgba(232, 196, 120, 0.7), 0 0 30px rgba(232, 196, 120, 0.2), var(--shadow); }
.entry:target::before { opacity: 1; }
.entry:target::after { inset: -8px; }
.entry.hide { display: none; }
.entry-head { display: flex; justify-content: space-between; align-items: baseline; gap: 6px 14px; flex-wrap: wrap; margin-bottom: 8px; }
.entry h3 { margin: 0; color: var(--gold-2); }
.entry h3 a { color: inherit; text-decoration: none; }
.entry h3 a:hover { color: var(--gold-3); }
.entry .sub { display: inline-flex; align-items: center; padding: 2px 12px; border-radius: 999px; font-size: 0.82rem; color: var(--ink-2); background: rgba(8, 17, 36, 0.7); box-shadow: 0 0 0 1px var(--line-2); white-space: normal; line-height: 1.45; }
.entry .desc { color: var(--ink-2); margin: 6px 0 10px; font-family: var(--serif); font-size: 1.06rem; }
.entry .two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 6px 24px; }
.entry .with-img { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; }
.entry .with-img > img { border-radius: 10px; aspect-ratio: 16/9; object-fit: cover; width: 100%; box-shadow: 0 0 0 1px var(--line-2), 0 8px 22px rgba(0, 0, 0, 0.4); }
@media (max-width: 700px) { .entry .with-img { grid-template-columns: minmax(0, 1fr); } .entry .with-img > img { order: -1; } }
dl.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 16px; margin: 8px 0; font-size: 0.96rem; }
dl.facts dt { color: var(--muted); font-size: 0.86rem; letter-spacing: 0.04em; padding-top: 0.12em; }
dl.facts dd { margin: 0; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 480px) { dl.facts { grid-template-columns: minmax(0, 1fr); gap: 0; } dl.facts dt { margin-top: 6px; } }
ul.mods { list-style: none; margin: 6px 0; padding: 0; }
ul.mods li { color: var(--magic); font-size: 0.96rem; padding: 1px 0; }
ul.mods.unique li { color: var(--unique); }
ul.mods.set li { color: var(--set); }
ul.mods.flags li { color: #ffb060; }
ul.plain { margin: 6px 0; padding-left: 1.1em; color: var(--ink-2); }
ul.plain li::marker { color: var(--crystal); }
.lore { font-family: var(--serif); font-style: italic; color: #d8c49a; }
.rarity-unique { color: var(--unique) !important; }
.rarity-set { color: var(--set) !important; }
.tagline { display: inline-block; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-2); border: 1px solid var(--line-2); border-radius: 999px; padding: 1px 9px; }
.tagline.boss { color: #ffab80; border-color: rgba(255, 120, 80, 0.45); }
.tagline.hostile { color: var(--bad); border-color: rgba(239, 107, 99, 0.45); }
.phase { border-left: 2px solid rgba(159, 220, 255, 0.4); padding: 2px 0 2px 12px; margin: 8px 0; font-size: 0.95rem; }
.phase b { color: var(--gold-2); font-weight: 700; }
.group-title { display: flex; align-items: center; gap: 12px; margin: 38px 0 14px; font-size: clamp(1.15rem, 2.2vw, 1.45rem); letter-spacing: 0.1em; text-transform: uppercase; }
.group-title::before { content: ""; width: 12px; height: 12px; flex: none; transform: rotate(45deg); background: linear-gradient(135deg, #f6fdff, #6fb8ff 60%, #2b63a6); box-shadow: 0 0 10px rgba(159, 220, 255, 0.85); }
.group-title::after { content: ""; flex: 1; min-width: 20px; height: 1px; background: linear-gradient(90deg, rgba(217, 180, 106, 0.6), transparent); }
.group-title small { font-family: var(--body); color: var(--muted); letter-spacing: 0; font-size: 0.9rem; text-transform: none; }
.toc { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 20px; }
.toc a { font-size: 0.86rem; padding: 4px 13px; border-radius: 999px; text-decoration: none; color: var(--ink-2); background: rgba(10, 20, 41, 0.7); box-shadow: 0 0 0 1px var(--line); transition: box-shadow 0.2s, color 0.2s; }
.toc a:hover { color: var(--gold-3); box-shadow: 0 0 0 1px rgba(217, 180, 106, 0.7), 0 0 12px rgba(217, 180, 106, 0.2); }
.filter-line { display: flex; gap: 12px; align-items: center; margin: 6px 0 20px; }
.filter-line input { flex: 1; min-width: 0; padding: 11px 16px; font: inherit; color: var(--ink); background: rgba(9, 18, 37, 0.85); border: 0; border-radius: 999px; box-shadow: 0 0 0 1px var(--line-2); }
.filter-line input:focus { outline: none; box-shadow: var(--glow-gold); }
.filter-line span { color: var(--muted); font-size: 0.9rem; white-space: nowrap; }

/* Changelog */
.timeline { position: relative; margin: 0; padding: 0 0 0 28px; list-style: none; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 1px; background: linear-gradient(var(--crystal), rgba(217, 180, 106, 0.5) 40%, transparent); }
.timeline li { position: relative; margin-bottom: 14px; }
.timeline li::before { content: ""; position: absolute; left: -25px; top: 9px; width: 9px; height: 9px; transform: rotate(45deg); background: linear-gradient(135deg, #f6fdff, #6fb8ff); box-shadow: 0 0 8px rgba(159, 220, 255, 0.7); }
.timeline b { font-family: var(--display); color: var(--gold-2); margin-right: 8px; letter-spacing: 0.04em; }
.timeline time { color: var(--muted); font-size: 0.88rem; margin-right: 8px; }

/* Notes */
.note { border-radius: 12px; padding: 14px 18px; color: var(--ink-2); background: rgba(14, 34, 64, 0.6); box-shadow: 0 0 0 1px rgba(159, 220, 255, 0.3), inset 0 0 24px rgba(159, 220, 255, 0.05); }
.note b { color: var(--crystal-2); }

/* Footer */
footer { position: relative; background: linear-gradient(180deg, rgba(4, 9, 19, 0.6), #03060d 40%); padding: 64px 0 34px; color: var(--muted); font-size: 0.94rem; margin-top: 50px; }
footer::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(217, 180, 106, 0.55) 25%, rgba(159, 220, 255, 0.6) 50%, rgba(217, 180, 106, 0.55) 75%, transparent); }
footer > .crest { position: absolute; left: 50%; top: -34px; transform: translateX(-50%); width: 120px; height: 54px; }
footer .cols { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 28px; }
footer h4 { color: var(--gold-2); font-size: 0.78rem; letter-spacing: 0.2em; text-transform: uppercase; }
footer ul { list-style: none; margin: 0; padding: 0; }
footer li { margin: 5px 0; }
footer a { color: var(--ink-2); text-decoration: none; }
footer a:hover { color: var(--gold-3); }
footer .fine { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 0.85rem; }
@media (max-width: 760px) { footer .cols { grid-template-columns: 1fr 1fr; } footer .cols > :first-child { grid-column: 1 / -1; } }

/* Class cards */
.class-card .body { display: grid; gap: 8px; }
.class-crest { display: flex; align-items: center; gap: 14px; }
.class-crest .glyph { width: 48px; height: 48px; flex: none; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 50% 32%, #2a4a80, #0b1730 72%); box-shadow: 0 0 0 1px rgba(217, 180, 106, 0.8), inset 0 0 12px rgba(159, 220, 255, 0.25); color: var(--gold-3); font-family: var(--display); font-size: 1.3rem; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; }
@media (max-width: 520px) { .split { grid-template-columns: 1fr; } }

.kv { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: 0.92rem; }
.kv b { color: var(--ink); font-weight: 700; }
.kv .kv-skill { flex-basis: 100%; display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.kv .kv-skill img { border-radius: 6px; box-shadow: 0 0 0 1px var(--line-2); }

.center { text-align: center; }
.mt { margin-top: 28px; }
.mb0 { margin-bottom: 0; }
.hide-sm { }
@media (max-width: 640px) { .hide-sm { display: none; } }

/* Item icons in the wiki: rendered from the game's own 3D models (0.68.0), shown on a dark slot like the game's bags */
.entry-head.has-ico { justify-content: flex-start; align-items: center; }
.entry-head.has-ico .sub { margin-left: auto; }
.ico, .tico, .pico, .rico { display: inline-block; flex: none; background: radial-gradient(circle at 50% 36%, #1f3560, #0a1428 74%); border: 1px solid rgba(217, 180, 106, 0.5); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.55), inset 0 0 12px rgba(159, 220, 255, 0.12); }
.entry .ico { width: 56px; height: 56px; padding: 3px; border-radius: 10px; }
td.nm { white-space: nowrap; }
td.nm .tico { width: 36px; height: 36px; padding: 2px; border-radius: 7px; vertical-align: middle; margin: -7px 10px -7px 0; }
.plain .pico { width: 30px; height: 30px; padding: 2px; border-radius: 6px; vertical-align: middle; margin: -4px 8px -2px 0; }
.plain li:has(> .pico) { padding: 4px 0; }
.results li a.r-ico { display: flex; gap: 12px; align-items: center; }
.results li a .rico { width: 38px; height: 38px; padding: 2px; border-radius: 7px; }
@media (max-width: 560px) { .entry .ico { width: 48px; height: 48px; } }
.icon-strip { margin: -50px 0 90px; text-align: center; }
.icon-strip .tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; }
.icon-strip p { color: var(--muted); font-size: 0.92rem; margin: 14px 0 0; }
.itile { display: block; width: 60px; height: 60px; padding: 3px; border-radius: 11px; border: 1px solid rgba(217, 180, 106, 0.55); background: radial-gradient(circle at 50% 36%, #1f3560, #0a1428 74%); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.55), inset 0 0 12px rgba(159, 220, 255, 0.12), 0 6px 18px rgba(0, 0, 0, 0.35); transition: transform 0.25s, box-shadow 0.25s; }
.itile img { width: 100%; height: 100%; }
.itile:hover, .itile:focus-visible { transform: translateY(-3px); box-shadow: var(--glow-gold), 0 8px 20px rgba(0, 0, 0, 0.4); }
@media (max-width: 560px) { .icon-strip { margin-top: -30px; } .itile { width: 58px; height: 58px; } }
.entry .ico.u { border-color: color-mix(in srgb, var(--unique) 70%, transparent); }
.entry .ico.s { border-color: color-mix(in srgb, var(--set) 70%, transparent); }
.entry-head.has-ico h3 { flex: 1 1 200px; min-width: 0; }

/* Passive emblems (0.81.0): painted rounds with their own bronze rim, so no tile behind them */
.entry .ico.r, .results li a .rico.r { padding: 0; border: 0; border-radius: 50%; background: none; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45); }
.itile.r { padding: 0; border: 0; border-radius: 50%; background: none; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4); }
.itile.r:hover, .itile.r:focus-visible { box-shadow: 0 0 0 2px var(--gold), 0 8px 22px rgba(0, 0, 0, 0.45); }
.ks-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.ks-head h3 { margin: 0; min-width: 0; }
.ks-ico { width: 56px; height: 56px; flex: none; border-radius: 50%; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45); }
ul.mods.emb li { display: flex; align-items: center; gap: 10px; padding: 3px 0; }
ul.mods.emb .emb { width: 30px; height: 30px; flex: none; border-radius: 50%; }
h4.emb-h { margin: 22px 0 8px; }
.emblems { display: flex; flex-wrap: wrap; gap: 14px 8px; margin: 0 0 8px; }
.emblems figure { margin: 0; width: 96px; text-align: center; }
.emblems .emb { display: block; width: 52px; height: 52px; margin: 0 auto 6px; border-radius: 50%; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4); }
.emblems figcaption { font-size: 0.8rem; line-height: 1.3; color: var(--muted); }
.emblems a { color: inherit; text-decoration: none; }
.emblems a:hover figcaption, .emblems a:focus-visible figcaption { color: var(--gold-2); }
@media (max-width: 560px) { .emblems figure { width: 84px; } .ks-ico { width: 48px; height: 48px; } }

/* 0.85.0 Hourglass runs: sigil colours, omen emblems in tables, this week's row of the rotation */
.rarity-magic { color: var(--magic) !important; }
.rarity-rare { color: var(--rare) !important; }
.ico.tiny { width: 22px; height: 22px; padding: 0; vertical-align: middle; margin: -3px 7px 0 0; }
.ico.r.tiny { border: 0; border-radius: 50%; background: none; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45); }
.now-tag { display: none; margin-left: 6px; padding: 1px 8px; border-radius: 99px; font-size: 0.72rem; letter-spacing: 0.04em; color: #08101f; background: linear-gradient(135deg, #f6fdff, #8fd3ff); vertical-align: 1px; white-space: nowrap; }
tr.now td { background: rgba(159, 220, 255, 0.08); }
tr.now .now-tag { display: inline-block; }
.thumbs.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.thumbs.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 640px) { .thumbs.three { grid-template-columns: 1fr; } }

/* Wide strip renders (0.93.0 effects): two to a row at their own shape, one to a row on phones */
.thumbs.strips { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.thumbs.strips figure { aspect-ratio: auto; }
.thumbs.strips img { height: auto; display: block; }
@media (max-width: 640px) { .thumbs.strips { grid-template-columns: 1fr; } }
.thumbs.strips.one { grid-template-columns: 1fr; }
@media (max-width: 640px) { .thumbs.dense { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Key caps and How to play lists (0.94.0, the Getting started page) */
kbd { display: inline-block; min-width: 1.7em; padding: 0 6px; margin: 0 1px; border-radius: 5px; background: linear-gradient(180deg, #2a4676, #142846); color: var(--gold-3); font: 700 0.86em/1.55 var(--body); text-align: center; border: 1px solid rgba(217, 180, 106, 0.55); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.5); white-space: nowrap; vertical-align: 0.05em; }
ul.how { list-style: none; padding: 0; margin: 6px 0 10px; }
ul.how li { position: relative; padding-left: 20px; margin: 6px 0; }
ul.how li::before { content: "\25C6"; position: absolute; left: 0; top: 0.2em; color: var(--crystal); font-size: 0.78em; }
table.keys th { text-align: left; color: var(--gold-2); font: 600 0.95rem var(--display); letter-spacing: 0.04em; padding-top: 14px; }
table.keys td:first-child { color: var(--ink-2); }
/* 1.14.31 guides: the story step by step, with where to go */
ol.walk { margin: 10px 0; padding-left: 1.6em; color: var(--ink-2); }
ol.walk > li { margin: 0 0 16px; padding-left: 4px; }
ol.walk > li::marker { color: var(--gold-2); font-family: var(--display); }
ol.walk > li > p { margin: 4px 0; }
ol.walk ul.plain { margin: 4px 0; }

/* Locations (2026-11-12): what people say, the story there, and nearby places */
.says { display: grid; gap: 8px; margin: 10px 0 4px; }
.says .quote { margin: 0; }
.nearby { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; padding: 0; list-style: none; }
.nearby li { font-size: 0.88rem; padding: 2px 11px; border-radius: 999px; background: rgba(8, 17, 36, 0.6); box-shadow: 0 0 0 1px var(--line); color: var(--muted); }
.nearby li a { text-decoration: none; }
.loc-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 26px; align-items: start; }
.loc-grid > .locmap, .loc-grid > .shot { margin-top: 6px; }
.loc-grid .shot { border-radius: 12px; aspect-ratio: 8 / 5; object-fit: cover; width: 100%; box-shadow: 0 0 0 1px var(--line-2), 0 10px 26px rgba(0, 0, 0, 0.4); }
@media (max-width: 760px) { .loc-grid { grid-template-columns: minmax(0, 1fr); } }
.entry h4.sub-h { font-size: 0.82rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-2); margin: 16px 0 6px; display: flex; align-items: center; gap: 8px; }
.entry h4.sub-h::before { content: ""; width: 7px; height: 7px; transform: rotate(45deg); background: linear-gradient(135deg, #f6fdff, #6fb8ff); box-shadow: 0 0 6px rgba(159, 220, 255, 0.8); flex: none; }
.entry h4.sub-h::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(217, 180, 106, 0.4), transparent); }
.region-banner { position: relative; margin: -18px -22px 14px; border-radius: 12px 12px 0 0; overflow: hidden; aspect-ratio: 21 / 7; background: #000; }
.region-banner img { width: 100%; height: 100%; object-fit: cover; }
.region-banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(10, 19, 38, 0.95), transparent 60%); }
@media (max-width: 560px) { .region-banner { aspect-ratio: 16 / 9; } }
.status-panel { padding: clamp(26px, 4vw, 44px); }
.lore-panel { padding: clamp(26px, 4vw, 40px); }
