/* Shared civilization palettes: game gateway, encyclopedia index, and dossiers. */
:root { --wiki-human:#e7c77c; --wiki-bugvex:#c2e85b; --wiki-cryvum:#bca3ff; }
.wiki-faction-human,.wiki-entry-card.human,.universe-faction-human {
  --faction-color:#e7c77c; --faction:#e7c77c; --theme-accent:#e7c77c; --theme-secondary:#8cacdf;
  --theme-bg:#090f1e; --theme-panel:#142139; --theme-section:#0e192c; --theme-glow:#293959;
  --theme-text:#faf3e2; --theme-muted:#bfc9dc; --theme-line:#e7c77c44;
}
.wiki-faction-bugvex,.wiki-entry-card.bugvex,.universe-faction-bugvex {
  --faction-color:#c2e85b; --faction:#c2e85b; --theme-accent:#c2e85b; --theme-secondary:#ef9471;
  --theme-bg:#0d1209; --theme-panel:#1c2913; --theme-section:#141e0e; --theme-glow:#374622;
  --theme-text:#eff4df; --theme-muted:#c0cbb0; --theme-line:#c2e85b44;
}
.wiki-faction-cryvum,.wiki-entry-card.cryvum,.universe-faction-cryvum {
  --faction-color:#bca3ff; --faction:#bca3ff; --theme-accent:#bca3ff; --theme-secondary:#86ebef;
  --theme-bg:#100c20; --theme-panel:#231a3c; --theme-section:#19122d; --theme-glow:#423163;
  --theme-text:#f2edff; --theme-muted:#c8bedc; --theme-line:#bca3ff44;
}
.wiki-page:is(.wiki-faction-human,.wiki-faction-bugvex,.wiki-faction-cryvum,.wiki-faction-other) {
  --wiki-ink:var(--theme-text); --wiki-muted:var(--theme-muted); --wiki-line:var(--theme-line);
  color:var(--theme-text); background:var(--theme-bg); color-scheme:dark;
}
.wiki-page[class*="wiki-faction-"] .site-header,
.wiki-page[class*="wiki-faction-"] .site-header.scrolled { background:var(--theme-bg); border-bottom:1px solid var(--theme-line); }
.wiki-page[class*="wiki-faction-"] .header-cta { background:var(--theme-accent); color:var(--theme-bg); }
.wiki-page[class*="wiki-faction-"] .nav-links a[aria-current="page"] { color:var(--theme-accent); box-shadow:0 2px var(--theme-accent); }
.wiki-page[class*="wiki-faction-"] .wiki-hero { background:radial-gradient(ellipse at 85% 25%,var(--theme-glow),transparent 60%),var(--theme-bg); border-bottom:1px solid var(--theme-line); }
.wiki-page[class*="wiki-faction-"] .wiki-hero::after { opacity:.14; }
.wiki-page.wiki-faction-human .wiki-hero::after { background-image:repeating-linear-gradient(90deg,transparent 0 100px,var(--theme-accent) 101px 102px); }
.wiki-page.wiki-faction-bugvex .wiki-hero::after { background-image:repeating-linear-gradient(125deg,transparent 0 70px,var(--theme-accent) 71px 73px,transparent 74px 88px); }
.wiki-page.wiki-faction-cryvum .wiki-hero::after { background-image:repeating-linear-gradient(60deg,transparent 0 90px,var(--theme-secondary) 91px 92px),repeating-linear-gradient(-60deg,transparent 0 90px,var(--theme-accent) 91px 92px); }
.wiki-page[class*="wiki-faction-"] .wiki-hero h1 { color:var(--theme-text); }
.wiki-page[class*="wiki-faction-"] .wiki-hero h1 em,
.wiki-page[class*="wiki-faction-"] .wiki-kicker,
.wiki-page[class*="wiki-faction-"] .wiki-label,
.wiki-page[class*="wiki-faction-"] .wiki-backlink { color:var(--theme-accent); }
.wiki-page[class*="wiki-faction-"] .wiki-lede,
.wiki-page[class*="wiki-faction-"] .wiki-breadcrumb { color:var(--theme-muted); }
.wiki-page[class*="wiki-faction-"] .wiki-breadcrumb a:hover { color:var(--theme-accent); }
.wiki-page[class*="wiki-faction-"] .wiki-meta span { color:var(--theme-secondary); border-color:var(--theme-line); background:var(--theme-panel); }
.wiki-page[class*="wiki-faction-"] :is(.wiki-faction-summary,.wiki-detail-section) { background:var(--theme-bg); }
.wiki-page[class*="wiki-faction-"] :is(.wiki-section,.wiki-detail-footer) { background:var(--theme-section); }
.wiki-page[class*="wiki-faction-"] :is(.wiki-group,.wiki-specs div,.wiki-ship-link) { background:var(--theme-panel); border-color:var(--theme-line); }
.wiki-page[class*="wiki-faction-"] .wiki-group-code { color:var(--theme-accent); }
.wiki-page[class*="wiki-faction-"] .wiki-group-links a { color:var(--theme-accent); background:var(--theme-bg); border-color:var(--theme-line); }
.wiki-page[class*="wiki-faction-"] .wiki-group-links a:hover { color:var(--theme-bg); background:var(--theme-accent); }
.wiki-page[class*="wiki-faction-"] .wiki-video small { color:var(--theme-secondary); background:var(--theme-panel); }
.wiki-page[class*="wiki-faction-"] .site-footer { background:var(--theme-bg); border-top:1px solid var(--theme-line); }
.wiki-page[class*="wiki-faction-"] a:focus-visible { outline:2px solid var(--theme-accent); outline-offset:4px; }
.wiki-entry-card:is(.human,.bugvex,.cryvum,.other),.universe-faction {
  background:var(--theme-panel); color:var(--theme-text); border-color:var(--theme-line); border-top:3px solid var(--theme-accent);
}
.wiki-entry-card:is(.human,.bugvex,.cryvum,.other) h3 { color:var(--theme-text); }
.wiki-entry-card:is(.human,.bugvex,.cryvum,.other) p,.universe-faction-copy>p:not(.universe-kicker) { color:var(--theme-muted); }
.wiki-entry-card:is(.human,.bugvex,.cryvum,.other) a,.wiki-entry-card:is(.human,.bugvex,.cryvum,.other)>span { color:var(--theme-accent); }
.universe-emblem { background:radial-gradient(ellipse at center,var(--theme-glow),transparent 75%),var(--theme-bg); }
.universe-faction-human .universe-emblem { border-bottom:3px double var(--theme-line); }
.universe-faction-bugvex .universe-emblem,
.universe-faction-cryvum .universe-emblem { background:radial-gradient(ellipse at center,var(--theme-glow),var(--theme-bg)); }
.wiki-faction-other,.wiki-entry-card.other,.universe-faction-other { --faction-color:#ff819b; --faction:#ff819b; --theme-accent:#ff819b; --theme-secondary:#c5a3ff; --theme-bg:#190d18; --theme-panel:#30182a; --theme-section:#221020; --theme-glow:#552641; --theme-text:#ffedf3; --theme-muted:#d9bacb; --theme-line:#ff819b44; }
.universe-entry-grid,.wiki-entry-grid { grid-template-columns:repeat(4,minmax(0,1fr)); }
.universe-emblem .faction-icon { width:78%; height:88%; max-height:220px; object-fit:contain; }
.encyclopedia-card-icon { width:112px; height:112px; object-fit:contain; margin-bottom:25px; }
.wiki-entry-card h3 { margin-top:24px; }
.faction-hero-icon { width:145px; height:145px; object-fit:contain; float:right; margin:15px 0 20px 30px; }
@media(max-width:1100px) { .universe-entry-grid,.wiki-entry-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:680px) { .universe-entry-grid,.wiki-entry-grid { grid-template-columns:1fr; }.faction-hero-icon { width:96px; height:96px; float:none; margin:0 0 25px; } }
.universe-emblem .faction-icon[data-original-format] { width:78%; height:88%; max-height:220px; object-fit:contain; }
.encyclopedia-card-icon[data-original-format],.faction-hero-icon[data-original-format] { border-radius:8px; }
/* Emblems retain their native alpha against each civilization’s page color. */
.encyclopedia-card-icon,.faction-hero-icon,.universe-emblem .faction-icon { background:transparent; border-radius:0; }

/* Faction index environments retain clear copy and opaque ship cards. */
.wiki-faction-human { --environment-art: url("assets/faction-human-hero-v2.png"); --directory-art: url("assets/faction-human-directory-v2.png"); --environment-position: center; }
.wiki-faction-bugvex { --environment-art: url("assets/faction-bugvex-hero-v2.png"); --directory-art: url("assets/faction-bugvex-directory-v2.png"); --environment-position: center; }
.wiki-faction-cryvum { --environment-art: url("assets/faction-cryvum-hero-v2.png"); --directory-art: url("assets/faction-cryvum-directory-v2.png"); --environment-position: center; }
.wiki-faction-other { --environment-art: url("assets/faction-other-hero-v2.png"); --directory-art: url("assets/faction-other-directory-v2.png"); --environment-position: center; }
.wiki-page[class*="wiki-faction-"] .faction-environment-hero {
  background: linear-gradient(90deg, rgba(5, 9, 16, .88), rgba(5, 9, 16, .62) 48%, rgba(5, 9, 16, .2)), var(--environment-art);
  background-size: cover;
  background-position: var(--environment-position);
}
.wiki-page[class*="wiki-faction-"] .faction-environment-hero::after { display: none; }
.wiki-page[class*="wiki-faction-"] .faction-environment-hero .wiki-lede { color: #e0e6ed; }
.faction-environment-hero .faction-hero-icon { filter: drop-shadow(0 4px 20px rgba(0, 0, 0, .8)); }
.wiki-page[class*="wiki-faction-"] #directory {
  background: linear-gradient(180deg, rgba(5, 9, 16, .6), var(--theme-section) 950px), var(--directory-art) center top / 100% auto no-repeat, var(--theme-section);
}
@media (max-width: 680px) {
  .wiki-page[class*="wiki-faction-"] .faction-environment-hero {
    background-image: linear-gradient(90deg, rgba(5, 9, 16, .83), rgba(5, 9, 16, .6)), var(--environment-art);
  }
}
