/* ============================================================
   PRIMORDIA — VIKIPEDIA
   Field archive styling. Matches the in-game retro terminal theme:
   black everywhere, blue window frames, amber headings, one font.
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=VT323&display=swap');

:root {
  --bg: #000000;
  --text: #c0c0c0;
  --dim: #888888;
  --dim2: #5a5a5a;
  --blue: #1a3a5c;
  --blue-deep: #0f2440;
  --blue-border: #4a7a9c;
  --amber: #d4a017;
  --amber-bright: #e8b830;
  --green: #4a9a4a;
  --red: #e06b6b;
  --gold: #d4a017;
  --font: 'Share Tech Mono', 'VT323', Consolas, 'Courier New', monospace;
  --head: 'VT323', 'Share Tech Mono', monospace;
}

* { box-sizing: border-box; }

html { font-size: 16px; }

body {
  margin: 0;
  background: #050505;
  color: var(--c0, #c0c0c0);
  color: #c0c0c0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}

/* CRT scanlines */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0,0,0,0.14) 0px,
    rgba(0,0,0,0.14) 2px,
    transparent 2px,
    transparent 6px
  );
  pointer-events: none;
  z-index: 999;
}

a { color: var(--amber); text-decoration: none; }
a:hover { color: var(--amber-bright); text-decoration: underline; }

h1, h2, h3, h4 { font-family: var(--head); letter-spacing: 2px; color: var(--gold); margin: 0 0 12px; }
h1 { font-size: 40px; }
h2 { font-size: 30px; }
h3 { font-size: 24px; }
h4 { font-size: 20px; }

p { color: #a8a8a8; }

code, .mono { font-family: var(--font); color: #9be8ff; }

/* ---------- Layout ---------- */
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 18px; }

.toolbar {
  background: #1a3a5c;
  border-bottom: 4px solid #4a7a9c;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 1000;
}
.toolbar .brand {
  font-family: var(--head);
  font-size: 26px;
  letter-spacing: 4px;
  color: #c0e0ff;
}
.toolbar .brand span { color: var(--amber); }
.toolbar .play {
  font-family: var(--head);
  font-size: 20px;
  letter-spacing: 3px;
  background: #0f2440;
  border: 3px solid #4a7a9c;
  padding: 6px 20px;
  color: #c0e0ff;
}
.toolbar .play:hover { border-color: var(--amber); color: var(--amber-bright); text-decoration: none; }

.pathbar {
  background: #111;
  border-bottom: 3px solid #333;
  padding: 6px 20px;
  font-size: 15px;
  color: #6a8a6a;
  letter-spacing: 1px;
}
.pathbar b { color: #4a9a4a; font-weight: normal; }

/* Top tabs */
.tabs {
  background: #0a0a0a;
  border-bottom: 3px solid #333;
  padding: 0 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  position: sticky;
  top: 70px;
  z-index: 900;
}
.tabs a {
  font-family: var(--head);
  font-size: 20px;
  letter-spacing: 2px;
  color: #8a8a8a;
  padding: 8px 14px;
  border-bottom: 4px solid transparent;
}
.tabs a:hover { color: var(--amber-bright); text-decoration: none; }
.tabs a.active { color: var(--amber); border-bottom-color: var(--amber); }

/* Body grid */
.layout { display: grid; grid-template-columns: 250px 1fr; gap: 22px; padding: 22px 0 60px; }
.sidebar { align-self: start; position: sticky; top: 135px; }
.sidebar .box {
  background: #000;
  border: 3px solid #1a3a5c;
  outline: 1px solid rgba(74,122,156,0.4);
  outline-offset: -6px;
  padding: 14px;
}
.sidebar h4 { color: var(--amber); font-size: 18px; margin-bottom: 10px; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { margin: 0 0 4px; }
.sidebar a { color: #b8b8b8; font-size: 16px; display: block; padding: 4px 6px; border-left: 3px solid transparent; }
.sidebar a:hover { color: var(--amber-bright); border-left-color: var(--amber); background: #0a0a0a; text-decoration: none; }
.sidebar a.active { color: var(--amber); border-left-color: var(--amber); background: #0a0a0a; }

main { min-width: 0; }

/* Windows / panels */
.window {
  background: #000;
  border: 3px solid #1a3a5c;
  outline: 1px solid rgba(74,122,156,0.4);
  outline-offset: -6px;
  box-shadow: inset 0 1px 0 rgba(110,190,255,0.15), 0 12px 32px rgba(0,0,0,0.6);
  padding: 26px 28px;
  margin-bottom: 22px;
  position: relative;
}
.window::before, .window::after {
  content: ''; position: absolute; width: 14px; height: 14px; pointer-events: none;
}
.window::before { top: -3px; left: -3px; border-top: 3px solid var(--amber); border-left: 3px solid var(--amber); }
.window::after { bottom: -3px; right: -3px; border-bottom: 3px solid var(--amber); border-right: 3px solid var(--amber); }

.window > h1:first-child, .window > h2:first-child { margin-top: 0; }

.lead { color: #b0b0b0; font-size: 18px; }
.muted { color: #888; }
.small { font-size: 14px; }

/* Cards */
.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.c3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card {
  background: #0a0a0a;
  border: 2px solid #333;
  padding: 16px 18px;
}
.card:hover { border-color: #4a7a9c; }
.card h3 { color: var(--amber); font-size: 22px; margin-bottom: 4px; }
.card p { margin: 6px 0 0; font-size: 15px; }

.tile {
  display: block;
  background: #0a0a0a;
  border: 2px solid #333;
  padding: 16px 18px;
}
.tile:hover { border-color: var(--amber); text-decoration: none; background: #111; }
.tile .k { font-family: var(--head); font-size: 24px; color: var(--amber); letter-spacing: 2px; }
.tile .d { color: #888; font-size: 15px; margin-top: 4px; }

/* Tables */
table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 15px; }
th, td { border: 1px solid #333; padding: 7px 10px; text-align: left; vertical-align: top; }
th { background: #0f2440; color: #c0e0ff; font-family: var(--head); font-size: 18px; letter-spacing: 1px; }
tr:nth-child(even) td { background: #0a0a0a; }
td.num, th.num { text-align: right; }

/* Tags / badges */
.tag {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 1px;
  padding: 1px 8px;
  border: 1px solid #333;
  color: #9a9a9a;
  margin-right: 4px;
}
.tag.land { border-color: #4a7a4a; color: #6a9a6a; }
.tag.water { border-color: #4a6a8a; color: #6a9ac0; }
.tag.air { border-color: #8a8a4a; color: #c0c06a; }
.tag.carn { border-color: #8a4a4a; color: #c07a7a; }
.tag.herb { border-color: #4a7a4a; color: #7ab07a; }

.rar-common { color: #c0c0c0; }
.rar-uncommon { color: #4a9a4a; }
.rar-rare { color: #4a9adc; }
.rar-epic { color: #c084fc; }
.rar-legendary { color: #d4a017; }
.rar-pioneer { color: #ff8c42; }

.note {
  background: #0a0a0a;
  border: 2px solid #333;
  border-left: 5px solid var(--amber);
  padding: 12px 16px;
  margin: 16px 0;
  color: #a8a8a8;
}
.note strong { color: var(--amber); }
.note.warn { border-left-color: var(--red); }
.note.warn strong { color: var(--red); }
.note.ok { border-left-color: var(--green); }
.note.ok strong { color: var(--green); }

.formula {
  display: block;
  background: #050505;
  border: 1px solid #333;
  padding: 10px 14px;
  margin: 10px 0;
  color: #9be8ff;
  white-space: pre-wrap;
}

ul.clean { list-style: none; padding-left: 0; }
ul.clean li { padding: 3px 0 3px 22px; position: relative; color: #a8a8a8; }
ul.clean li::before { content: '\25B8'; position: absolute; left: 0; color: var(--amber); }

.toc { columns: 2; column-gap: 26px; margin: 10px 0; }
.toc a { display: block; padding: 2px 0; }

footer {
  border-top: 3px solid #333;
  background: #111;
  padding: 14px 20px;
  color: #666;
  font-size: 14px;
  letter-spacing: 1px;
}
footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

hr { border: 0; border-top: 2px solid #333; margin: 22px 0; }

/* ---------- Contextual help "?" ---------- */
.help {
  display: inline-block;
  width: 14px; height: 14px; margin: 0 1px 0 3px;
  font-size: 11px; line-height: 13px; font-weight: bold; text-align: center;
  color: #d4a017; background: #0a1a2a;
  border: 1px solid #4a7a9c; border-radius: 0;
  text-decoration: none; vertical-align: super;
}
.help:hover { color: #000; background: #d4a017; border-color: #d4a017; text-decoration: none; }

/* ---------- Game art ---------- */
.wiki-img { display: block; max-width: 100%; height: auto; }
.thumb {
  width: 100%; height: 150px; object-fit: contain;
  background: #050505; border: 2px solid #1a3a5c; margin: 0 0 10px;
}
.banner {
  width: 100%; height: 150px; object-fit: cover;
  border: 2px solid #1a3a5c; margin: 0 0 10px;
}
.hero {
  width: 100%; max-height: 320px; object-fit: cover;
  border: 2px solid #1a3a5c; margin: 0 0 18px;
}
.ico {
  display: inline-block; width: 28px; height: 28px; object-fit: contain;
  vertical-align: middle; margin-right: 8px;
}
.card > .thumb:first-child { margin-top: 0; }
.art-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 12px 0; }
.art-row .cell { width: 132px; text-align: center; font-size: 13px; color: #888; }
.art-row .cell .wiki-img {
  width: 100%; height: 104px; object-fit: contain;
  background: #050505; border: 2px solid #1a3a5c; margin-bottom: 4px;
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .toc { columns: 1; }
  .tabs { top: 64px; }
}
