/* Solaria Wiki. Layout: navigation | article | contents. */

.wiki-page { --bar-h: 62px; background: var(--bg-0); }
.wiki-page .nav { position: relative; }

/* ------------------------------------------------------------------ the search bar */

.wiki-bar {
  position: sticky; top: 0; z-index: 40;
  height: var(--bar-h);
  background: rgb(16 13 10 / 0.97);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 6px 20px rgb(0 0 0 / 0.3);
}

.wiki-bar-inner {
  display: flex; align-items: center; gap: 20px;
  max-width: 1480px; height: 100%;
  margin: 0 auto; padding: 0 24px;
}

.wiki-logo { display: inline-flex; align-items: center; gap: 10px; flex: none; color: var(--text); }
.wiki-logo:hover { color: #fff; }
.wiki-logo svg { width: 30px; height: 30px; color: var(--gold); }
.wiki-logo span { font-family: var(--display); font-weight: 700; font-size: 1.05rem; letter-spacing: 0.08em; }
.wiki-logo b { color: var(--gold-hi); }

.wiki-search { position: relative; flex: 1; max-width: 620px; margin-left: 12px; }
.wiki-search input {
  width: 100%;
  height: 42px;
  padding: 0 44px 0 42px;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  background: #0b0907;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.wiki-search input::placeholder { color: var(--muted); }
.wiki-search input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgb(212 169 58 / 0.18); }
.wiki-search input::-webkit-search-cancel-button { filter: invert(0.7) sepia(1); }
.wiki-search-icon { position: absolute; left: 13px; top: 50%; width: 18px; height: 18px; margin-top: -9px; color: var(--muted); pointer-events: none; }
.wiki-search kbd {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  padding: 1px 8px;
  border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 3px;
  font-family: var(--mono); font-size: 0.78rem; color: var(--muted);
  pointer-events: none;
}
.wiki-search input:focus ~ kbd { opacity: 0; }

.wiki-random, .wiki-browse {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  height: 40px; padding: 0 14px;
  border: 1px solid var(--line-2); border-radius: 4px;
  background: var(--bg-2);
  color: var(--text-2);
  font: inherit; font-weight: 500; font-size: 0.95rem;
  cursor: pointer;
}
.wiki-random:hover, .wiki-browse:hover { color: var(--gold-hi); border-color: rgb(212 169 58 / 0.5); }
.wiki-random svg, .wiki-browse svg { width: 18px; height: 18px; }
.wiki-browse { display: none; }

/* Suggestions under the search box. */
.wiki-suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px);
  margin: 0; padding: 6px;
  list-style: none;
  background: #18130f;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  box-shadow: 0 20px 50px rgb(0 0 0 / 0.6);
  max-height: min(70vh, 560px);
  overflow-y: auto;
}
.wiki-suggest a { display: flex; gap: 12px; align-items: flex-start; padding: 9px 10px; border-radius: 3px; color: var(--text); }
.wiki-suggest li[aria-selected='true'] a, .wiki-suggest a:hover { background: rgb(212 169 58 / 0.1); color: var(--text); }
.sg-emblem { flex: none; width: 26px; height: 26px; margin-top: 2px; color: var(--gold); }
.sg-text { display: flex; flex-direction: column; min-width: 0; }
.sg-text b { font-weight: 700; }
.sg-text > span { font-size: 0.86rem; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sg-sec { font-weight: 500; color: var(--text-2); }
.sg-all { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }
.sg-all .sg-emblem { color: var(--muted); padding: 3px; }
mark { background: rgb(212 169 58 / 0.28); color: inherit; border-radius: 2px; padding: 0 1px; }

/* ------------------------------------------------------------------ the shell */

.wiki-shell {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr) 220px;
  gap: 36px;
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 24px;
  min-height: calc(100vh - var(--bar-h));
}

.wiki-shell.no-toc { grid-template-columns: 236px minmax(0, 1fr); }
.wiki-shell.no-toc .wiki-main { max-width: 1120px; }

.wiki-side, .wiki-toc {
  position: sticky; top: var(--bar-h);
  align-self: start;
  max-height: calc(100vh - var(--bar-h));
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-4) transparent;
}

.wiki-side { padding: 22px 4px 40px 0; }
.wiki-main { min-width: 0; padding: 22px 0 80px; outline: none; }
.wiki-toc { padding: 30px 0 40px; }

.side-head { display: none; }
.side-main { margin: 0 0 18px; padding: 0 0 14px; list-style: none; border-bottom: 1px solid var(--line); }
.side-main a, .side-cat li a {
  display: block;
  padding: 5px 10px;
  border-left: 2px solid transparent;
  border-radius: 0 3px 3px 0;
  color: var(--text-2);
  font-size: 0.96rem;
  line-height: 1.4;
}
.side-main a:hover, .side-cat li a:hover { color: var(--text); background: rgb(255 240 200 / 0.04); }
.wiki-side a.active { color: var(--gold-hi); border-left-color: var(--gold); background: linear-gradient(90deg, rgb(212 169 58 / 0.12), transparent); }

.side-cat { margin-bottom: 8px; }
.side-cat summary {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 6px 8px 4px;
  list-style: none;
  cursor: pointer;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}
.side-cat summary::-webkit-details-marker { display: none; }
.side-emblem { width: 20px; height: 20px; flex: none; }
.side-cat summary span { flex: 1; }
.chev { width: 14px; height: 14px; color: var(--muted); transform: rotate(90deg); transition: transform 0.2s; }
.side-cat:not([open]) .chev { transform: rotate(0); }
.side-cat ul { margin: 2px 0 0 13px; padding: 0 0 0 4px; list-style: none; border-left: 1px solid var(--line); }
.side-cat .side-more a { font-size: 0.86rem; color: var(--muted); font-style: italic; }

/* ------------------------------------------------------------------ breadcrumbs */

.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 14px; font-size: 0.9rem; color: var(--muted); }
.crumbs a { color: var(--text-2); }
.crumbs a:hover { color: var(--gold-hi); }
.crumbs svg { width: 12px; height: 12px; opacity: 0.6; }
.crumbs span { color: var(--muted); }

/* ------------------------------------------------------------------ the article */

.art {
  position: relative;
  padding: 34px 44px 30px;
  background: linear-gradient(180deg, #17130f, #14110d);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 20px 50px rgb(0 0 0 / 0.25);
}

.art::before {
  content: '';
  position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, var(--gold-lo), var(--gold), var(--gold-lo));
  border-radius: 4px 4px 0 0;
  opacity: 0.7;
}

.art-head { margin-bottom: 22px; padding-bottom: 14px; border-bottom: 1px solid var(--line-2); }
.art-head h1 { font-size: clamp(1.9rem, 1.5rem + 1.5vw, 2.6rem); line-height: 1.1; }
.art-from { margin: 6px 0 0; font-family: var(--accent); font-style: italic; color: var(--muted); font-size: 1.02rem; }

.art-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 12px; font-size: 0.88rem; color: var(--muted); }
.art-copy {
  display: inline-flex; align-items: center; gap: 6px;
  margin-left: auto;
  padding: 4px 10px;
  border: 1px solid var(--line-2); border-radius: 3px;
  background: none; color: var(--text-2);
  font: inherit; font-size: 0.85rem;
  cursor: pointer;
}
.art-copy:hover { color: var(--gold-hi); border-color: rgb(212 169 58 / 0.5); }
.art-copy svg { width: 14px; height: 14px; }

.status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}
.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-live { color: #8fd0b0; border-color: rgb(116 179 152 / 0.45); background: rgb(116 179 152 / 0.08); }
.status-partial { color: var(--gold-hi); border-color: rgb(212 169 58 / 0.45); background: rgb(212 169 58 / 0.08); }
.status-planned { color: var(--frost); border-color: rgb(156 196 216 / 0.4); background: rgb(156 196 216 / 0.08); }
.status-lore { color: #d0b2ec; border-color: rgb(192 154 226 / 0.4); background: rgb(192 154 226 / 0.08); }
.status-guide { color: var(--text-2); border-color: var(--line-2); }

/* Body text. */
.art-body { font-size: 1.07rem; line-height: 1.72; color: var(--text); }
.art-body::after { content: ''; display: table; clear: both; }
.art-body > p:first-of-type { font-size: 1.14rem; color: #f3ead6; }
.art-body p { margin: 0 0 1em; }
.art-body a, .art-see a, .dyk a, .recent a, .cat-card ul a, .az a, .featured h3 a { color: #ecc35c; }
.art-body a:hover, .art-see a:hover, .dyk a:hover, .recent a:hover, .cat-card ul a:hover, .az a:hover { color: #fff0c0; text-decoration: underline; text-underline-offset: 3px; }
.art-body a.new { color: #e4735d; }
.art-body a.ext::after { content: ' \2197'; font-size: 0.8em; }
.art-body b, .art-body strong { color: #fff4dc; font-weight: 700; }

.art-body h2 {
  position: relative;
  overflow: hidden; /* stops the rule beside the infobox instead of running under it */
  margin: 1.9em 0 0.75em;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line-2);
  font-size: 1.5rem;
  color: var(--text);
  scroll-margin-top: calc(var(--bar-h) + 18px);
}
.art-body h3 {
  position: relative;
  margin: 1.5em 0 0.5em;
  font-family: var(--body);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0;
  color: var(--gold-hi);
  scroll-margin-top: calc(var(--bar-h) + 18px);
}

.h-anchor {
  display: inline-grid; place-items: center;
  width: 26px; height: 26px;
  margin-left: 8px;
  vertical-align: middle;
  border-radius: 3px;
  color: var(--muted) !important;
  opacity: 0;
  transition: opacity 0.15s;
}
.h-anchor svg { width: 15px; height: 15px; }
h2:hover .h-anchor, h3:hover .h-anchor, .h-anchor:focus { opacity: 1; }
.h-anchor:hover { color: var(--gold-hi) !important; background: rgb(212 169 58 / 0.1); text-decoration: none !important; }

.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0%, 30% { background: rgb(212 169 58 / 0.18); } 100% { background: transparent; } }

.art-body ul, .art-body ol { margin: 0 0 1.1em; padding-left: 1.4em; }
.art-body li { margin-bottom: 0.35em; }
.art-body ul li::marker { color: var(--gold); }
.art-body ol li::marker { color: var(--gold); font-weight: 700; }

.art-body blockquote {
  margin: 1.4em 0;
  padding: 6px 0 6px 22px;
  border-left: 2px solid var(--gold);
  font-family: var(--accent);
  font-style: italic;
  font-size: 1.25rem;
  line-height: 1.45;
  color: #f2e5c8;
}

.art-body code { font-size: 0.82em; }

/* Infobox. */
.infobox {
  float: right;
  width: 300px;
  margin: 4px 0 20px 30px;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  background: #110e0b;
  font-size: 0.92rem;
  line-height: 1.45;
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.3);
}
.ib-title {
  padding: 10px 14px;
  text-align: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  color: var(--gold-hi);
  background: linear-gradient(180deg, rgb(212 169 58 / 0.18), rgb(212 169 58 / 0.06));
  border-bottom: 1px solid var(--line-2);
}
.ib-art {
  display: grid; place-items: center;
  padding: 22px 0;
  background: radial-gradient(circle at 50% 50%, rgb(212 169 58 / 0.12), transparent 65%), #0c0a08;
  border-bottom: 1px solid var(--line);
}
.ib-art .emblem { width: 92px; height: 92px; color: var(--gold); filter: drop-shadow(0 0 14px rgb(212 169 58 / 0.25)); }
.ib-art-img { display: flex; justify-content: center; gap: 14px; }
.ib-art-img img { width: 56px; height: 56px; image-rendering: pixelated; filter: drop-shadow(0 6px 10px rgb(0 0 0 / 0.6)); }
.ib-cap { padding: 8px 14px; text-align: center; font-size: 0.86rem; color: var(--muted); border-bottom: 1px solid var(--line); }
.infobox table { width: 100%; border-collapse: collapse; }
.infobox th, .infobox td { padding: 7px 12px; vertical-align: top; text-align: left; border-bottom: 1px solid var(--line); }
.infobox tr:last-child th, .infobox tr:last-child td { border-bottom: 0; }
.infobox th { width: 42%; font-weight: 700; color: var(--text-2); }
.infobox td { color: var(--text); }
.infobox .ib-sec { width: auto; padding: 7px 12px; text-align: center; background: rgb(212 169 58 / 0.07); font-family: var(--display); font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }

/* Wiki tables. */
.table-wrap { max-width: 100%; margin: 0 0 1.3em; overflow-x: auto; }
.wikitable {
  border-collapse: collapse;
  min-width: 60%;
  font-size: 0.97rem;
  line-height: 1.5;
  background: #120f0c;
  border: 1px solid var(--line-2);
}
.wikitable th, .wikitable td { padding: 8px 14px; text-align: left; vertical-align: top; border: 1px solid var(--line); }
.wikitable th { background: #231c14; color: var(--gold-hi); font-weight: 700; white-space: nowrap; }
.wikitable tbody tr:nth-child(even) td { background: rgb(255 240 200 / 0.02); }
.wikitable tbody tr:hover td { background: rgb(212 169 58 / 0.05); }
.wikitable td.num, .wikitable th.num { text-align: right; font-variant-numeric: tabular-nums; }
.wikitable code { white-space: nowrap; }
.wikitable.full { width: 100%; }
.wikitable th.sort { position: relative; padding-right: 30px; cursor: pointer; user-select: none; }
/* Two small triangles: up for ascending, down for descending. */
.wikitable th.sort::before, .wikitable th.sort::after {
  content: '';
  position: absolute; right: 11px; top: 50%;
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  opacity: 0.4;
}
.wikitable th.sort::after { margin-top: -6px; border-bottom: 5px solid currentColor; }
.wikitable th.sort::before { margin-top: 2px; border-top: 5px solid currentColor; }
.wikitable th[aria-sort='ascending']::after { opacity: 1; }
.wikitable th[aria-sort='ascending']::before { opacity: 0.15; }
.wikitable th[aria-sort='descending']::before { opacity: 1; }
.wikitable th[aria-sort='descending']::after { opacity: 0.15; }
.wikitable th.sort:hover { background: #2b2218; }

.plus { color: var(--green); }
.minus { color: #e08a7a; }

/* Callouts. */
.callout {
  margin: 1.3em 0;
  padding: 14px 18px 4px;
  border: 1px solid;
  border-left-width: 3px;
  border-radius: 3px;
  font-size: 1rem;
}
.callout > b:first-child {
  display: block;
  margin-bottom: 4px;
  font-family: var(--display);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.callout p { margin-bottom: 10px; }
.callout.note { border-color: rgb(212 169 58 / 0.35); border-left-color: var(--gold); background: rgb(212 169 58 / 0.06); }
.callout.note > b:first-child { color: var(--gold-hi); }
.callout.tip { border-color: rgb(116 179 152 / 0.35); border-left-color: var(--green); background: rgb(116 179 152 / 0.06); }
.callout.tip > b:first-child { color: #8fd0b0; }
.callout.warn { border-color: rgb(180 57 44 / 0.4); border-left-color: var(--red-hi); background: rgb(180 57 44 / 0.08); }
.callout.warn > b:first-child { color: #f0a090; }
.callout.soon { border-color: rgb(156 196 216 / 0.35); border-left-color: var(--frost); background: rgb(156 196 216 / 0.06); }
.callout.soon > b:first-child { color: var(--frost); }

/* Contents inside the article, shown when the side rail is hidden. */
.toc-inline { display: none; margin: 1.4em 0; }
.toc-inline details {
  display: inline-block;
  min-width: 260px;
  max-width: 100%;
  padding: 12px 22px 12px 18px;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  background: #110e0b;
}
.toc-inline summary { cursor: pointer; font-family: var(--display); font-weight: 700; font-size: 0.9rem; letter-spacing: 0.1em; color: var(--gold); }
.toc-inline .toc-list { margin: 10px 0 0; }
.toc-list { margin: 0; padding: 0; list-style: none; }
.toc-list ol { margin: 0; padding: 0 0 0 16px; list-style: none; }
.toc-inline .toc-list a { display: block; padding: 3px 0; color: var(--text-2); font-size: 0.97rem; text-decoration: none; }
.toc-inline .toc-list a:hover { color: var(--gold-hi); }
.toc-list b { display: inline-block; min-width: 30px; color: var(--muted); font-weight: 500; }

/* See also, categories and the pager. */
.art-see { margin-top: 2.2em; }
.art-see h2 { margin-bottom: 0.8em; padding-bottom: 6px; border-bottom: 1px solid var(--line-2); font-size: 1.5rem; scroll-margin-top: calc(var(--bar-h) + 18px); }
.art-see ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.art-see li { padding: 12px 14px; border: 1px solid var(--line); border-radius: 3px; background: #110e0b; }
.art-see li a { display: block; font-weight: 700; }
.art-see li span { font-size: 0.9rem; color: var(--muted); line-height: 1.45; }

.art-foot { margin-top: 2.2em; }
.art-cats {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: #110e0b;
  font-size: 0.92rem;
}
.art-cats b { color: var(--text-2); }
.art-cats a { color: #ecc35c; }
.art-cats span { padding-left: 12px; border-left: 1px solid var(--line-2); color: var(--muted); }
.art-edited { margin: 12px 0 0; font-size: 0.88rem; color: var(--muted); }
.art-edited a { color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.art-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 26px; }
.art-pager a {
  display: flex; flex-direction: column;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #110e0b;
  font-weight: 700;
  color: var(--text);
  transition: border-color 0.2s, transform 0.2s var(--ease);
}
.art-pager a:hover { border-color: rgb(212 169 58 / 0.5); color: var(--gold-hi); }
.art-pager span { font-size: 0.76rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.art-pager .prev span::before { content: '\2190  '; }
.art-pager .next { text-align: right; }
.art-pager .next span::after { content: '  \2192'; }

/* ------------------------------------------------------------------ the contents rail */

.toc-rail { padding-left: 14px; border-left: 1px solid var(--line); }
.toc-title { margin: 0 0 10px; font-family: var(--display); font-weight: 700; font-size: 0.74rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); }
.toc-rail a {
  display: block;
  margin-left: -15px;
  padding: 4px 0 4px 13px;
  border-left: 2px solid transparent;
  font-size: 0.9rem;
  line-height: 1.35;
  color: var(--muted);
}
.toc-rail .toc-list ol a { padding-left: 25px; font-size: 0.86rem; }
.toc-rail a:hover { color: var(--text); }
.toc-rail a.active { color: var(--gold-hi); border-left-color: var(--gold); }
.toc-top { font-weight: 700; margin-bottom: 4px; }

/* ------------------------------------------------------------------ main page */

.portal-hero {
  position: relative;
  overflow: hidden;
  display: flex; align-items: center; gap: 30px;
  padding: 38px 44px;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  background:
    radial-gradient(ellipse 60% 120% at 100% 0%, rgb(212 169 58 / 0.18), transparent 60%),
    radial-gradient(ellipse 50% 100% at 0% 100%, rgb(178 58 46 / 0.12), transparent 60%),
    #17130f;
}
.portal-hero-text { position: relative; z-index: 1; max-width: 640px; }
.portal-kicker { margin: 0 0 8px; font-family: var(--display); font-weight: 700; font-size: 0.74rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--gold); }
.portal-hero h1 { font-size: clamp(1.8rem, 1.3rem + 2vw, 2.8rem); line-height: 1.12; margin-bottom: 14px; }
.portal-hero h1 span { color: var(--gold-hi); }
.portal-hero p { color: var(--text-2); font-size: 1.08rem; }
.portal-hero p b { color: var(--text); }
.portal-quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.portal-quick a {
  padding: 6px 14px;
  border: 1px solid rgb(212 169 58 / 0.4);
  border-radius: 999px;
  background: rgb(212 169 58 / 0.07);
  color: var(--gold-hi);
  font-weight: 500;
  font-size: 0.95rem;
}
.portal-quick a:hover { background: rgb(212 169 58 / 0.16); color: #fff3cf; }
.portal-crown { position: absolute; right: -10px; top: 50%; width: 260px; height: 260px; transform: translateY(-50%) rotate(-8deg); color: var(--gold); opacity: 0.1; }

.notice {
  margin: 18px 0;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--frost);
  border-radius: 3px;
  background: rgb(156 196 216 / 0.04);
  font-size: 0.97rem;
  color: var(--text-2);
  line-height: 1.9;
}
.notice b { color: var(--text); }

.portal-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.portal-col { display: grid; gap: 18px; }

.pbox { border: 1px solid var(--line); border-radius: 4px; background: #15110d; overflow: hidden; }
.pbox-title {
  margin: 0;
  padding: 10px 18px;
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-hi);
  background: linear-gradient(90deg, rgb(212 169 58 / 0.16), rgb(212 169 58 / 0.02));
  border-bottom: 1px solid var(--line);
}
.pbox > :not(.pbox-title) { margin: 16px 18px; }

.featured-inner { display: flex; gap: 22px; align-items: flex-start; }
.featured-emblem { flex: none; width: 84px; height: 84px; padding: 14px; color: var(--gold); border: 1px solid var(--line-2); border-radius: 3px; background: radial-gradient(circle, rgb(212 169 58 / 0.14), transparent 70%), #0c0a08; }
.featured h3 { font-size: 1.45rem; margin-bottom: 6px; }
.featured p { margin: 0 0 10px; color: var(--text-2); }
.featured-lead { color: var(--muted) !important; font-size: 0.98rem; }

.cat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cat-card { padding: 14px 16px; border: 1px solid var(--line); border-radius: 3px; background: #110e0b; }
.cat-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; color: var(--text); font-family: var(--display); font-weight: 700; font-size: 0.95rem; letter-spacing: 0.02em; line-height: 1.25; }
.cat-card-head:hover { color: var(--gold-hi); }
.cat-card-head span { flex: 1; }
.cat-card-head em { font-style: normal; font-family: var(--body); font-size: 0.8rem; color: var(--muted); padding: 1px 8px; border: 1px solid var(--line); border-radius: 999px; }
.cat-emblem { width: 26px; height: 26px; color: var(--gold); }
.cat-card ul { margin: 0; padding: 0 0 0 36px; list-style: none; font-size: 0.95rem; line-height: 1.75; }
.cat-card .more-li a { color: var(--muted); font-style: italic; }

.dyk { margin: 16px 18px; padding: 0; list-style: none; }
.dyk li { position: relative; padding: 7px 0 7px 18px; border-bottom: 1px dashed var(--line); font-size: 0.97rem; color: var(--text-2); line-height: 1.5; }
.dyk li:last-child { border-bottom: 0; }
.dyk li::before { content: ''; position: absolute; left: 2px; top: 15px; width: 6px; height: 6px; transform: rotate(45deg); background: var(--gold); }

.glance { width: calc(100% - 36px); border-collapse: collapse; font-size: 0.95rem; }
.glance th, .glance td { padding: 6px 0; text-align: left; border-bottom: 1px dashed var(--line); }
.glance tr:last-child th, .glance tr:last-child td { border-bottom: 0; }
.glance th { color: var(--muted); font-weight: 500; padding-right: 12px; }
.glance td { text-align: right; color: var(--text); }

.recent { margin: 16px 18px; padding: 0; list-style: none; }
.recent li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 0.97rem; }
.recent li:last-child { border-bottom: 0; }
.recent time { flex: none; color: var(--muted); font-size: 0.88rem; }

/* ------------------------------------------------------------------ category, index, search */

.cat-head { display: flex; gap: 22px; align-items: center; margin-bottom: 18px; padding: 26px 30px; border: 1px solid var(--line-2); border-radius: 4px; background: radial-gradient(ellipse at 100% 0%, rgb(212 169 58 / 0.12), transparent 60%), #17130f; }
.cat-head h1 { font-size: clamp(1.7rem, 1.4rem + 1.2vw, 2.3rem); margin: 2px 0 8px; }
.cat-head p:last-child { margin: 0; color: var(--text-2); }
.cat-head-emblem { flex: none; width: 76px; height: 76px; color: var(--gold); }
.cat-count, .cat-others { color: var(--muted); font-size: 0.95rem; }
.cat-others a { color: var(--text-2); }

.card-list { display: grid; gap: 10px; margin: 0 0 20px; padding: 0; list-style: none; }
.card-list a {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #15110d;
  color: var(--text);
  transition: border-color 0.2s, background 0.2s;
}
.card-list a:hover { border-color: rgb(212 169 58 / 0.45); background: #1a1511; color: var(--text); }
.card-emblem { flex: none; width: 36px; height: 36px; color: var(--gold); }
.card-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.card-text b { font-size: 1.08rem; color: var(--gold-hi); }
.card-text span { color: var(--text-2); font-size: 0.95rem; }

.az { columns: 3 220px; column-gap: 30px; }
.az section { break-inside: avoid; margin-bottom: 20px; }
.az h2 { margin-bottom: 6px; padding-bottom: 4px; border-bottom: 1px solid var(--line-2); font-size: 1.3rem; color: var(--gold); }
.az ul { margin: 0; padding: 0; list-style: none; }
.az li { padding: 3px 0; }
.az li span { font-size: 0.84rem; color: var(--muted); }

.results { margin: 0; padding: 0; list-style: none; }
.results li { padding: 16px 0; border-bottom: 1px solid var(--line); }
.res-title { font-size: 1.18rem; font-weight: 700; color: #ecc35c; }
.res-title span { font-weight: 500; color: var(--text-2); }
.results p { margin: 4px 0 6px; color: var(--text-2); }
.res-meta { display: flex; align-items: center; gap: 10px; font-size: 0.86rem; color: var(--muted); }
.empty { padding: 30px; border: 1px dashed var(--line-2); border-radius: 4px; text-align: center; color: var(--text-2); }

.wiki-noscript { padding: 40px; border: 1px solid var(--line-2); background: var(--bg-2); }

/* ------------------------------------------------------------------ link preview */

.wiki-preview {
  position: fixed; z-index: 60;
  width: 340px;
  padding: 16px 18px 6px;
  border: 1px solid rgb(212 169 58 / 0.4);
  border-radius: 4px;
  background: #1b1611;
  box-shadow: 0 24px 60px rgb(0 0 0 / 0.65);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.16s, transform 0.16s;
  pointer-events: none;
  font-size: 0.95rem;
}
.wiki-preview.show { opacity: 1; transform: none; }
.pv-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.pv-emblem { width: 36px; height: 36px; color: var(--gold); flex: none; }
.pv-head b { display: block; font-family: var(--display); font-size: 1.05rem; color: var(--gold-hi); }
.pv-head span { font-size: 0.8rem; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }
.wiki-preview p { margin: 0 0 10px; color: var(--text); line-height: 1.5; }
.wiki-preview .pv-lead { color: var(--muted); font-size: 0.9rem; }

.wiki-footer { padding: 26px 0; }
.wiki-footer .footer-bottom { margin-top: 0; padding-top: 0; border-top: 0; }
.wiki-footer a { color: var(--text-2); }

/* ------------------------------------------------------------------ narrower screens */

@media (max-width: 1260px) {
  .wiki-shell, .wiki-shell.no-toc { grid-template-columns: 220px minmax(0, 1fr); }
  .wiki-toc { display: none; }
  .toc-inline { display: block; }
}

@media (max-width: 900px) {
  .wiki-shell, .wiki-shell.no-toc { grid-template-columns: minmax(0, 1fr); padding: 0 14px; }
  .wiki-browse { display: inline-flex; }
  .wiki-logo span { display: none; }
  .wiki-search { margin-left: 0; }
  .wiki-random span { display: none; }
  .wiki-random { padding: 0 10px; }
  .wiki-bar-inner { gap: 10px; padding: 0 14px; }
  .wiki-search kbd { display: none; }

  .wiki-side {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 80;
    width: min(86vw, 310px);
    max-height: none;
    padding: 0 12px 30px;
    background: #120f0c;
    border-right: 1px solid var(--line-2);
    transform: translateX(-102%);
    transition: transform 0.28s var(--ease);
  }
  .side-open .wiki-side { transform: none; box-shadow: 20px 0 60px rgb(0 0 0 / 0.6); }
  .side-head {
    display: flex; justify-content: space-between; align-items: center;
    position: sticky; top: 0; z-index: 1;
    margin: 0 -12px 14px; padding: 14px 16px;
    background: #120f0c;
    border-bottom: 1px solid var(--line);
    font-family: var(--display); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold);
  }
  .side-close { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line-2); border-radius: 3px; background: none; color: var(--text); cursor: pointer; }
  .side-close svg { width: 18px; height: 18px; }
  .wiki-scrim { position: fixed; inset: 0; z-index: 70; background: rgb(0 0 0 / 0.55); }

  .art { padding: 24px 20px 22px; }
  .portal-hero { padding: 28px 22px; }
  .portal-grid { grid-template-columns: minmax(0, 1fr); }
  .cat-head { padding: 20px; }
}

@media (max-width: 700px) {
  .infobox { float: none; width: 100%; margin: 0 0 20px; }
  .wikitable { min-width: 100%; font-size: 0.92rem; }
  .wikitable th, .wikitable td { padding: 7px 10px; }
  .cat-grid { grid-template-columns: minmax(0, 1fr); }
  .featured-inner { flex-direction: column; gap: 14px; }
  .featured-emblem { width: 64px; height: 64px; padding: 10px; }
  .art-pager { grid-template-columns: 1fr; }
  .art-copy { margin-left: 0; }
  .cat-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .cat-head-emblem { width: 52px; height: 52px; }
  .card-list a { flex-wrap: wrap; }
  .card-list .status { margin-left: 52px; }
  .toc-inline details { display: block; }
}
