@import url("https://fonts.googleapis.com/css2?family=Metamorphous&family=Oxanium:wght@600;700;800&family=Sora:wght@400;500;600;700;800&display=swap");

:root {
  color-scheme: dark;
  --bg-0: #050607;
  --bg-1: #0b0d11;
  --bg-2: #170f10;
  --panel: rgba(12, 15, 19, 0.82);
  --panel-strong: rgba(11, 13, 18, 0.95);
  --panel-soft: rgba(79, 23, 13, 0.42);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(209, 79, 44, 0.42);
  --line-gold: rgba(233, 191, 107, 0.36);
  --text: #f6efe5;
  --muted: #bba58e;
  --muted-strong: #dfcebc;
  --accent: #cb4928;
  --accent-hot: #ff8455;
  --accent-deep: #6a1509;
  --gold: #e9bf6b;
  --gold-soft: rgba(233, 191, 107, 0.18);
  --steel: #9eb3c6;
  --moss: #90a88e;
  --ember-glow: rgba(255, 104, 56, 0.24);
  --shadow-lg: 0 28px 70px rgba(0, 0, 0, 0.42);
  --shadow-xl: 0 42px 120px rgba(0, 0, 0, 0.56);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --wiki-bg: url("fate-wiki-bg.png");
  --font-ui: "Sora", "Segoe UI Variable", "Trebuchet MS", sans-serif;
  --font-display: "Oxanium", "Segoe UI Variable", "Trebuchet MS", sans-serif;
  --font-brand: "Metamorphous", "Oxanium", "Segoe UI Variable", sans-serif;
  font-family: var(--font-ui);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.68;
  background:
    radial-gradient(circle at 18% 0%, rgba(228, 94, 60, 0.26), transparent 24%),
    radial-gradient(circle at 82% 10%, rgba(233, 191, 107, 0.11), transparent 22%),
    linear-gradient(180deg, rgba(7, 7, 10, 0.28), rgba(7, 8, 11, 0.76) 24%, rgba(5, 6, 9, 0.95)),
    linear-gradient(135deg, rgba(128, 23, 15, 0.3), transparent 42%),
    linear-gradient(225deg, rgba(81, 18, 14, 0.18), transparent 36%),
    var(--wiki-bg);
  background-attachment: fixed, fixed, fixed, fixed, fixed, fixed;
  background-position: left top, right top, center top, left top, right top, center top;
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat;
  background-size: auto, auto, auto, auto, auto, cover;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

body::before {
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.02) 0 1px, transparent 1px 112px),
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.015) 0 1px, transparent 1px 96px);
  opacity: 0.5;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.78), transparent 88%);
}

body::after {
  background:
    radial-gradient(circle at 18% 11%, rgba(233, 191, 107, 0.12), transparent 18%),
    radial-gradient(circle at 78% 16%, rgba(255, 116, 72, 0.16), transparent 24%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.22) 72%, rgba(0, 0, 0, 0.55)),
    linear-gradient(90deg, rgba(0, 0, 0, 0.34), transparent 16%, transparent 84%, rgba(0, 0, 0, 0.34));
}

.sprite-sheet {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.site-shell {
  width: min(1780px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 44px;
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

a {
  color: #f7b889;
  text-decoration: none;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

a:hover,
a:focus-visible {
  color: #ffe0aa;
}

code {
  padding: 0.25rem 0.5rem;
  border: 1px solid rgba(232, 189, 111, 0.18);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(117, 31, 18, 0.34), rgba(27, 17, 16, 0.88));
  color: #f8d497;
  font-family: "Consolas", "SFMono-Regular", monospace;
  font-size: 0.9em;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.04em;
}

strong {
  font-weight: 700;
}

h1,
h2,
h3,
h4,
p,
li,
td,
th,
a,
button,
span,
strong,
small {
  overflow-wrap: anywhere;
  word-break: normal;
}

th,
td {
  white-space: normal;
}

:where(
  .topbar,
  .topbar > *,
  .portal-card,
  .wiki-card,
  .feature-gallery-card,
  .card-grid > *,
  .table-wrap,
  .table-wrap table,
  .article-section,
  .article-section > *,
  .brand,
  .brand-copy,
  .quick-links,
  .quick-link,
  .fact-strip,
  .fact-chip
) {
  min-width: 0;
}

p,
li,
td,
th,
span,
small,
input,
button {
  font-family: inherit;
}

::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.28);
}

::-webkit-scrollbar-thumb {
  background: rgba(232, 189, 111, 0.24);
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(220px, 1fr) minmax(240px, 1.1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border: 1px solid rgba(233, 191, 107, 0.16);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, rgba(36, 11, 8, 0.92), rgba(12, 14, 18, 0.96) 38%, rgba(16, 21, 28, 0.96)),
    linear-gradient(90deg, rgba(233, 191, 107, 0.08), transparent 30%, rgba(203, 73, 40, 0.12));
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

.topbar::before,
.topbar::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.topbar::before {
  background:
    linear-gradient(115deg, transparent 0 42%, rgba(255, 255, 255, 0.05) 47%, transparent 52% 100%),
    linear-gradient(180deg, rgba(255, 132, 85, 0.08), transparent 36%),
    repeating-linear-gradient(120deg, transparent 0 36px, rgba(233, 191, 107, 0.04) 36px 37px, transparent 37px 76px);
}

.topbar::after {
  inset: auto 18px 0 18px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(233, 191, 107, 0.9), rgba(255, 255, 255, 0.48), rgba(255, 104, 56, 0.85), transparent);
  box-shadow: 0 0 24px rgba(255, 104, 56, 0.42);
}

.brand {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  color: var(--text);
}

.brand:hover,
.brand:focus-visible {
  color: var(--text);
}

.brand-mark {
  position: relative;
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  border: 1px solid rgba(232, 189, 111, 0.65);
  border-radius: 18px;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 171, 111, 0.5), rgba(164, 52, 28, 0.88) 38%, rgba(19, 8, 8, 0.98));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 14px 36px rgba(0, 0, 0, 0.42),
    0 0 26px rgba(205, 90, 55, 0.24);
  overflow: hidden;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
}

.brand-mark img {
  position: relative;
  width: 54px;
  height: 54px;
  object-fit: contain;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.36));
}

.brand strong {
  display: block;
  font-family: var(--font-brand);
  font-size: 29px;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: transparent;
  background: linear-gradient(180deg, #ffe7bf 0%, #f5cb88 44%, #d94f2f 100%);
  background-clip: text;
  -webkit-background-clip: text;
  text-shadow: 0 0 26px rgba(255, 111, 69, 0.18);
}

.brand small {
  display: block;
  margin-top: 6px;
  color: #f4d8a4;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.search-box {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid rgba(233, 191, 107, 0.12);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(63, 20, 14, 0.38), rgba(8, 10, 14, 0.94)),
    rgba(9, 12, 16, 0.8);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 14px 28px rgba(0, 0, 0, 0.18);
}

.search-box span {
  color: #eac791;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.98rem;
}

.search-box input::placeholder {
  color: #9d8676;
}

.top-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px;
}

.top-actions a,
.plain-button,
.portal-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid rgba(233, 191, 107, 0.14);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(84, 18, 11, 0.28), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.03);
  color: #ebdccb;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.top-actions a:hover,
.top-actions a:focus-visible,
.plain-button:hover,
.plain-button:focus-visible,
.portal-button:hover,
.portal-button:focus-visible {
  border-color: rgba(255, 137, 82, 0.34);
  background:
    linear-gradient(135deg, rgba(203, 73, 40, 0.3), rgba(233, 191, 107, 0.12)),
    rgba(255, 255, 255, 0.04);
  color: #fff2d7;
  transform: translateY(-2px);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.18);
}

.plain-button {
  position: relative;
  z-index: 1;
  cursor: pointer;
}

.page-frame {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr) 254px;
  gap: 24px;
  margin-top: 24px;
  align-items: start;
}

.sidebar,
.toc {
  position: sticky;
  top: 104px;
}

.sidebar,
.toc-inner,
.infobox,
.article-header,
.article-section,
.home-portal,
.search-results {
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
}

.sidebar,
.toc-inner {
  padding: 18px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(20, 9, 10, 0.72), rgba(11, 14, 19, 0.95) 22%, rgba(12, 14, 19, 0.96)),
    linear-gradient(145deg, rgba(233, 191, 107, 0.05), transparent 44%, rgba(255, 104, 56, 0.08));
  backdrop-filter: blur(14px);
  box-shadow:
    var(--shadow-lg),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.sidebar {
  align-self: start;
  max-height: calc(100vh - 128px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.toc-inner {
  max-height: calc(100vh - 128px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.side-section + .side-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.side-section h2,
.toc-inner h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  color: #f2dfbb;
  font-size: 1.02rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.nav-list,
.compact {
  display: block;
}

.nav-group + .nav-group {
  margin-top: 14px;
}

.nav-group-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: #f0cd8b;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.nav-group a,
.toc a,
.compact a {
  display: block;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #d1bcaa;
  font-size: 0.97rem;
  letter-spacing: 0.03em;
  overflow-wrap: break-word;
  word-break: normal;
}

.nav-group a:hover,
.nav-group a:focus-visible,
.toc a:hover,
.toc a:focus-visible,
.compact a:hover,
.compact a:focus-visible {
  border-color: rgba(233, 191, 107, 0.18);
  background:
    linear-gradient(90deg, rgba(203, 73, 40, 0.18), rgba(233, 191, 107, 0.1)),
    rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.nav-group a.active {
  border-color: rgba(255, 132, 85, 0.28);
  background:
    linear-gradient(90deg, rgba(203, 73, 40, 0.3), rgba(233, 191, 107, 0.1)),
    rgba(255, 255, 255, 0.02);
  color: #fff2db;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.compact a + a {
  margin-top: 8px;
}

.compact code {
  display: inline-flex;
  width: 100%;
  justify-content: center;
  padding: 0.55rem 0.75rem;
}

.article {
  min-width: 0;
}

#content:focus {
  outline: none;
}

.article-header,
.search-results {
  position: relative;
  overflow: hidden;
  border-radius: 30px;
  background:
    radial-gradient(circle at top right, rgba(233, 191, 107, 0.12), transparent 26%),
    radial-gradient(circle at left center, rgba(203, 73, 40, 0.16), transparent 30%),
    linear-gradient(135deg, rgba(39, 12, 10, 0.84), rgba(15, 18, 24, 0.95) 42%, rgba(15, 20, 27, 0.96));
  animation: rise-fade 560ms ease both;
}

.article-header {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.95fr);
  gap: 24px;
  padding: 34px;
  border-color: rgba(233, 191, 107, 0.18);
  box-shadow:
    var(--shadow-xl),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.article-header::before,
.home-portal::before,
.article-section::before,
.search-results::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, transparent 0 58%, rgba(255, 255, 255, 0.05) 61%, transparent 64% 100%);
}

.article-title {
  position: relative;
  z-index: 1;
}

.article-eyebrow,
.portal-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--gold);
  font-family: var(--font-ui);
  font-size: 0.94rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.article-title h1,
.search-results h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 4vw, 4.7rem);
  line-height: 0.92;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-shadow:
    0 0 22px rgba(255, 108, 56, 0.14),
    0 10px 30px rgba(0, 0, 0, 0.28);
}

.subtitle,
.portal-lead {
  color: var(--muted-strong);
  font-size: 1.12rem;
}

.subtitle {
  margin: 14px 0 0;
  max-width: 66ch;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(233, 191, 107, 0.14);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(203, 73, 40, 0.18), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.04);
  color: #f1ddbf;
  font-family: var(--font-ui);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: none;
}

.hero-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.hero-stat,
.metric {
  padding: 16px 18px;
  border: 1px solid rgba(233, 191, 107, 0.13);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(89, 17, 11, 0.26), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.hero-stat strong,
.metric strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.45rem;
  letter-spacing: 0.06em;
}

.hero-stat span,
.metric span {
  display: block;
  margin-top: 6px;
  color: #d4bfac;
  font-family: var(--font-ui);
  font-size: 0.92rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.brand-showcase {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 24px;
  padding: 18px 20px;
  border: 1px solid rgba(233, 191, 107, 0.2);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(233, 191, 107, 0.12), transparent 52%, rgba(255, 104, 56, 0.12)),
    rgba(255, 255, 255, 0.02);
}

.brand-showcase img {
  width: clamp(72px, 10vw, 110px);
  height: auto;
  flex: 0 0 auto;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.42));
}

.brand-showcase strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.45rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.brand-showcase span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.infobox {
  position: relative;
  z-index: 1;
  align-self: start;
  padding: 20px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015)),
    linear-gradient(145deg, rgba(86, 18, 12, 0.22), transparent 42%),
    rgba(11, 13, 17, 0.68);
}

.infobox h2 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.facts {
  width: 100%;
  border-collapse: collapse;
}

.facts th,
.facts td {
  padding: 9px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: top;
  text-align: left;
}

.facts tr:first-child th,
.facts tr:first-child td {
  border-top: 0;
}

.facts th {
  width: 42%;
  color: #f0d29b;
  font-family: var(--font-ui);
  font-size: 0.92rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.facts td {
  color: var(--muted-strong);
}

.home-portal {
  position: relative;
  margin-top: 24px;
  padding: 28px;
  border-radius: 30px;
  background:
    radial-gradient(circle at top right, rgba(233, 191, 107, 0.14), transparent 24%),
    radial-gradient(circle at left center, rgba(203, 73, 40, 0.16), transparent 28%),
    linear-gradient(135deg, rgba(19, 10, 11, 0.96), rgba(24, 17, 18, 0.92) 42%, rgba(15, 18, 24, 0.97));
  animation: rise-fade 640ms ease both;
}

.portal-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.9fr);
  gap: 22px;
  align-items: stretch;
}

.portal-copy h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 3.2vw, 3.6rem);
  line-height: 0.94;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.portal-lead {
  margin: 14px 0 0;
  max-width: 62ch;
}

.portal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.portal-button {
  min-width: 172px;
}

.portal-button.primary {
  background: linear-gradient(135deg, rgba(203, 73, 40, 0.38), rgba(233, 191, 107, 0.14));
  border-color: rgba(255, 132, 85, 0.36);
  color: #fff1de;
}

.portal-button.ghost {
  background: rgba(255, 255, 255, 0.02);
}

.command-ribbon {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.command-ribbon span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px 10px;
  border: 1px solid rgba(233, 191, 107, 0.12);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(203, 73, 40, 0.14), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.03);
}

.command-ribbon small {
  color: #d8c4af;
  font-family: var(--font-ui);
  font-size: 0.88rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.portal-sidebar {
  padding: 18px;
  border: 1px solid rgba(233, 191, 107, 0.14);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(90, 19, 12, 0.22), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.03);
}

.portal-metrics {
  display: grid;
  gap: 12px;
}

.portal-note {
  margin: 16px 0 0;
  color: var(--muted-strong);
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.portal-card,
.wiki-card,
.result-item {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid rgba(233, 191, 107, 0.12);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015)),
    linear-gradient(145deg, rgba(94, 21, 13, 0.18), transparent 42%),
    rgba(11, 14, 18, 0.74);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.portal-card {
  padding: 18px;
}

.portal-card::after,
.wiki-card::after,
.result-item::after {
  content: "";
  position: absolute;
  inset: auto -20% 0 auto;
  width: 90px;
  height: 90px;
  background: radial-gradient(circle, rgba(233, 191, 107, 0.14), transparent 68%);
  pointer-events: none;
}

.portal-card:hover,
.portal-card:focus-visible,
.wiki-card:hover,
.wiki-card:focus-visible,
.result-item:hover,
.result-item:focus-visible {
  border-color: rgba(255, 132, 85, 0.3);
  transform: translateY(-4px);
  box-shadow:
    0 24px 46px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(233, 191, 107, 0.06) inset;
}

.portal-card-icon,
.card-icon {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(203, 73, 40, 0.46), rgba(233, 191, 107, 0.12));
  color: #fff1cf;
  font-family: var(--font-ui);
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow:
    0 12px 26px rgba(0, 0, 0, 0.22),
    0 0 22px rgba(255, 104, 56, 0.14);
}

.portal-card strong,
.wiki-card h3,
.result-item strong {
  display: block;
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.32rem;
  line-height: 1.08;
  letter-spacing: 0.05em;
  color: var(--text);
  text-transform: uppercase;
}

.portal-card p,
.wiki-card p,
.result-item span {
  margin: 10px 0 0;
  color: var(--muted-strong);
}

.article-section {
  position: relative;
  overflow: hidden;
  scroll-margin-top: 128px;
  margin-top: 22px;
  padding: 28px;
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(233, 191, 107, 0.08), transparent 22%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015)),
    linear-gradient(145deg, rgba(80, 18, 12, 0.16), transparent 40%),
    rgba(13, 16, 21, 0.9);
  animation: rise-fade 620ms ease both;
  border-color: rgba(233, 191, 107, 0.13);
  box-shadow:
    var(--shadow-lg),
    inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.article-section h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 2vw, 2.25rem);
  line-height: 1.05;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.section-number {
  display: inline-grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(233, 191, 107, 0.34);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(203, 73, 40, 0.2), rgba(233, 191, 107, 0.12)),
    rgba(233, 191, 107, 0.08);
  color: var(--gold);
  font-family: var(--font-ui);
  font-size: 0.94rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

.article-section p:last-child,
.article-section ul:last-child,
.article-section .table-wrap:last-child,
.article-section .card-grid:last-child,
.article-section .feature-gallery-grid:last-child,
.article-section .callout:last-child {
  margin-bottom: 0;
}

.article-section ul {
  margin: 16px 0 0;
  padding-left: 20px;
}

.article-section li + li {
  margin-top: 8px;
}

.callout {
  margin: 18px 0;
  padding: 16px 18px;
  border: 1px solid rgba(233, 191, 107, 0.16);
  border-left: 3px solid var(--gold);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(233, 191, 107, 0.14), rgba(255, 255, 255, 0.02)),
    rgba(233, 191, 107, 0.08);
  color: #fff1d6;
}

.callout.warning {
  border-left-color: var(--accent-hot);
  border-color: rgba(203, 73, 40, 0.22);
  background:
    linear-gradient(135deg, rgba(203, 73, 40, 0.22), rgba(255, 255, 255, 0.02)),
    rgba(203, 73, 40, 0.12);
}

.callout.info {
  border-left-color: var(--steel);
  border-color: rgba(151, 168, 186, 0.2);
  background:
    linear-gradient(135deg, rgba(151, 168, 186, 0.14), rgba(255, 255, 255, 0.02)),
    rgba(151, 168, 186, 0.1);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.feature-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.feature-gallery-card {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid rgba(233, 191, 107, 0.14);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015)),
    linear-gradient(145deg, rgba(92, 20, 12, 0.2), transparent 42%),
    rgba(10, 12, 17, 0.84);
  color: var(--text);
  box-shadow:
    0 20px 44px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
  text-decoration: none;
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.feature-gallery-card:hover,
.feature-gallery-card:focus-visible {
  border-color: rgba(255, 132, 85, 0.32);
  transform: translateY(-4px);
  box-shadow:
    0 28px 54px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(233, 191, 107, 0.06) inset;
}

.feature-gallery-card.wide {
  grid-column: 1 / -1;
}

.feature-gallery-media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-bottom: 1px solid rgba(233, 191, 107, 0.1);
  background: #080a0d;
}

.feature-gallery-card.wide .feature-gallery-media {
  aspect-ratio: 21 / 9;
}

.feature-gallery-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.04), transparent 30%, rgba(4, 5, 8, 0.72)),
    linear-gradient(135deg, rgba(203, 73, 40, 0.18), transparent 34%),
    radial-gradient(circle at top right, rgba(233, 191, 107, 0.14), transparent 22%);
  pointer-events: none;
}

.feature-gallery-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.feature-gallery-copy {
  padding: 20px;
}

.feature-gallery-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(233, 191, 107, 0.18);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(203, 73, 40, 0.18), rgba(233, 191, 107, 0.1)),
    rgba(255, 255, 255, 0.03);
  color: #f4d7a4;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.feature-gallery-copy h3 {
  margin: 14px 0 0;
  font-family: var(--font-display);
  font-size: 1.34rem;
  line-height: 1.04;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
}

.feature-gallery-copy p {
  margin: 12px 0 0;
  color: var(--muted-strong);
}

.feature-gallery-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.feature-gallery-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(233, 191, 107, 0.12);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(203, 73, 40, 0.12), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.03);
  color: #ddc7ae;
  font-family: var(--font-ui);
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.feature-gallery-copy .meta {
  margin-top: 16px;
}

.wiki-card {
  padding: 18px;
}

.wiki-card h3 {
  margin-top: 0;
}

.meta {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin-top: 12px;
  padding: 0 10px;
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(203, 73, 40, 0.16), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.05);
  color: #f1d59f;
  font-family: var(--font-ui);
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.table-wrap {
  margin-top: 18px;
  overflow-x: auto;
  border: 1px solid rgba(233, 191, 107, 0.12);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(72, 18, 13, 0.14), transparent 40%),
    rgba(6, 8, 12, 0.6);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  text-align: left;
  vertical-align: top;
}

.data-table thead th {
  border-top: 0;
  background:
    linear-gradient(180deg, rgba(203, 73, 40, 0.22), rgba(233, 191, 107, 0.08)),
    rgba(255, 255, 255, 0.02);
  color: #fff0d3;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.data-table tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02);
}

.article-donator-premium .table-wrap {
  margin-top: 20px;
}

.article-donator-premium .data-table {
  min-width: 1080px;
}

.article-donator-premium .data-table th,
.article-donator-premium .data-table td {
  overflow-wrap: break-word;
  word-break: normal;
}

.article-donator-premium .data-table thead th {
  white-space: nowrap;
}

.article-donator-premium .data-table th:first-child,
.article-donator-premium .data-table td:first-child {
  min-width: 180px;
}

.article-donator-premium .data-table td:first-child {
  font-weight: 700;
  color: #fff0d3;
}

.article-donator-premium .data-table th:nth-child(2),
.article-donator-premium .data-table td:nth-child(2) {
  min-width: 130px;
}

.article-donator-premium .article-section h2 {
  align-items: flex-start;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pill.easy {
  background: rgba(116, 174, 123, 0.18);
  color: #caefd0;
}

.pill.mid {
  background: rgba(104, 149, 183, 0.18);
  color: #d5ebff;
}

.pill.hard {
  background: rgba(208, 136, 76, 0.18);
  color: #ffe2bd;
}

.pill.elite {
  background: rgba(198, 94, 74, 0.22);
  color: #ffd1c7;
}

.pill.master {
  background: rgba(176, 130, 214, 0.2);
  color: #f0dcff;
}

.search-results {
  padding: 30px;
}

.result-item + .result-item {
  margin-top: 14px;
}

.result-item {
  padding: 18px 20px;
}

.empty-state {
  padding: 20px;
  border: 1px dashed rgba(233, 191, 107, 0.18);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(203, 73, 40, 0.12), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.03);
  color: var(--muted-strong);
}

.category-overview {
  --header-tone: var(--gold);
}

.category-basics {
  --header-tone: #d7a166;
}

.category-progression {
  --header-tone: #e17658;
}

.category-power-systems {
  --header-tone: #c7a5eb;
}

.category-economy {
  --header-tone: #97c4aa;
}

.category-activities {
  --header-tone: #e39e7d;
}

.category-completion {
  --header-tone: #9fb9d9;
}

.article-header[class*="category-"] {
  border-color: rgba(232, 189, 111, 0.18);
}

.article-header[class*="category-"] .article-eyebrow {
  color: var(--header-tone, var(--gold));
}

.article-header[class*="category-"] .section-number,
.article-header[class*="category-"] .hero-stat strong {
  color: var(--header-tone, var(--gold));
}

@keyframes rise-fade {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1500px) {
  .page-frame {
    grid-template-columns: 270px minmax(0, 1fr) 228px;
  }

  .portal-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1300px) {
  .topbar {
    grid-template-columns: minmax(240px, 1fr) minmax(220px, 1fr);
    grid-template-areas:
      "brand clear"
      "search search"
      "actions actions";
  }

  .brand {
    grid-area: brand;
  }

  .search-box {
    grid-area: search;
  }

  .top-actions {
    grid-area: actions;
  }

  .plain-button {
    grid-area: clear;
    justify-self: end;
  }

  .page-frame {
    grid-template-columns: 270px minmax(0, 1fr);
  }

  .toc {
    display: none;
  }

  .portal-hero,
  .article-header {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .site-shell {
    width: min(100%, calc(100% - 20px));
    padding-top: 10px;
  }

  .topbar {
    top: 8px;
    padding: 16px;
    border-radius: 24px;
  }

  .page-frame {
    grid-template-columns: 1fr;
  }

  .sidebar,
  .toc {
    position: static;
  }

  .sidebar,
  .toc-inner {
    max-height: none;
    overflow: visible;
  }

  .sidebar {
    order: 2;
  }

  .article {
    order: 1;
  }

  .portal-grid,
  .card-grid,
  .hero-strip,
  .feature-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  body {
    font-size: 14px;
  }

  .site-shell {
    width: calc(100% - 14px);
  }

  .topbar,
  .article-header,
  .home-portal,
  .article-section,
  .search-results,
  .sidebar,
  .toc-inner,
  .infobox {
    border-radius: 20px;
  }

  .top-actions,
  .portal-actions,
  .command-ribbon,
  .tag-row {
    gap: 8px;
  }

  .top-actions a,
  .plain-button,
  .portal-button {
    width: 100%;
  }

  .hero-strip,
  .portal-grid,
  .card-grid,
  .feature-gallery-grid {
    grid-template-columns: 1fr;
  }

  .feature-gallery-card.wide .feature-gallery-media {
    aspect-ratio: 16 / 10;
  }

  .article-header,
  .home-portal,
  .article-section,
  .search-results {
    padding: 22px;
  }

  .article-title h1,
  .search-results h1 {
    font-size: 2.35rem;
  }

  .portal-copy h2 {
    font-size: 2rem;
  }

  .brand strong {
    font-size: 24px;
  }

  .brand-showcase {
    flex-direction: column;
    align-items: flex-start;
  }

  .data-table {
    min-width: 620px;
  }
}
