/* ═══════════════════════════════════════════════
   ATHAR WIKI — Docs-style Stylesheet
   Inspired by Anthropic Docs, adapted for Athar
   ═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Cinzel:wght@400;600;700;900&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  /* Layout */
  --sidebar-width: 260px;
  --toc-width: 200px;
  --topbar-height: 56px;
  --content-max: 860px;

  /* Colors — Dark theme with warm accents */
  --bg-000: #0c0c11;
  --bg-100: #101018;
  --bg-200: #15151f;
  --bg-300: #1c1c2a;
  --bg-400: #242436;

  --text-000: #e8e6f0;
  --text-100: #c8c4d8;
  --text-200: #9892b0;
  --text-300: #706a88;
  --text-400: #504a68;

  --accent-000: #c8a84e;
  --accent-100: #a08030;
  --accent-200: #8a6a20;
  --accent-bg: #c8a84e12;

  --border-100: #1e1e2e;
  --border-200: #2a2a3e;
  --border-300: #363650;

  /* Callout colors */
  --info-border: var(--border-300);
  --info-bg: var(--bg-300);
  --tip-border: #40806a;
  --tip-bg: #40806a15;
  --tip-text: #60c0a0;
  --warning-border: #806040;
  --warning-bg: #80604015;
  --warning-text: #e0a060;

  /* Rarity */
  --legendary: #ff8800;
  --epic: #c040ff;
  --rare: #4080ff;
  --common: #808080;

  /* Element */
  --fire: #e04030;
  --frost: #40a0e0;
  --nature: #40c060;
  --shadow: #a040d0;
  --earth: #c08040;
  --arcane: #8060f0;

  /* Fonts */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Cinzel', serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Legacy aliases (for inline styles in pages) */
  --bg-deep: var(--bg-000);
  --bg-card: var(--bg-200);
  --bg-card-hover: var(--bg-300);
  --bg-surface: var(--bg-300);
  --border: var(--border-200);
  --border-glow: var(--border-300);
  --text: var(--text-000);
  --text-dim: var(--text-200);
  --text-bright: var(--text-000);
  --accent-gold: var(--accent-000);
  --accent-gold-dim: var(--accent-200);
  --accent-fire: var(--fire);
  --accent-frost: var(--frost);
  --accent-nature: var(--nature);
  --accent-shadow: var(--shadow);
  --accent-earth: var(--earth);
  --accent-arcane: var(--arcane);
  --glow-gold: 0 0 20px #c8a84e22;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: var(--border-300) var(--bg-000); }

body {
  background: var(--bg-100);
  color: var(--text-000);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ══════════════════════════════════════
   TOP BAR
   ══════════════════════════════════════ */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--topbar-height);
  background: var(--bg-000);
  border-bottom: 1px solid var(--border-200);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
}

.topbar-logo {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.2rem;
  color: var(--accent-000);
  text-decoration: none;
  letter-spacing: 3px;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

.topbar-logo:hover { color: #e0c870; text-decoration: none; }

.topbar-label {
  font-size: 0.8rem;
  color: var(--text-300);
  padding-left: 1rem;
  border-left: 1px solid var(--border-200);
  white-space: nowrap;
}

.topbar-search {
  flex: 1;
  max-width: 400px;
  margin-left: auto;
  position: relative;
}

.topbar-search input {
  width: 100%;
  padding: 0.45rem 0.85rem 0.45rem 2.2rem;
  background: var(--bg-200);
  border: 1px solid var(--border-200);
  border-radius: 8px;
  color: var(--text-000);
  font-family: var(--font-body);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

.topbar-search input:focus {
  border-color: var(--accent-200);
  background: var(--bg-300);
}

.topbar-search input::placeholder { color: var(--text-400); }

.topbar-search::before {
  content: '';
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 14px; height: 14px;
  border: 2px solid var(--text-400);
  border-radius: 50%;
  pointer-events: none;
}

.topbar-search::after {
  content: '';
  position: absolute;
  left: 1.55rem;
  top: calc(50% + 6px);
  width: 2px; height: 5px;
  background: var(--text-400);
  transform: rotate(-45deg);
  pointer-events: none;
}

.topbar-shortcut {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-400);
  background: var(--bg-100);
  border: 1px solid var(--border-200);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  pointer-events: none;
}

/* Search results dropdown */
#search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--bg-300);
  border: 1px solid var(--border-300);
  border-radius: 8px;
  max-height: 360px;
  overflow-y: auto;
  display: none;
  z-index: 200;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

#search-results.visible { display: block; }

.search-result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 1rem;
  text-decoration: none;
  color: var(--text-000);
  transition: background 0.15s;
  border-bottom: 1px solid var(--border-100);
}

.search-result-item:hover {
  background: var(--bg-400);
  text-decoration: none;
}

.search-result-title { font-size: 0.9rem; font-weight: 500; }
.search-result-page { font-size: 0.75rem; color: var(--text-300); font-family: var(--font-mono); }
.search-empty { padding: 1rem; color: var(--text-300); text-align: center; font-size: 0.85rem; }

#search-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
}
#search-overlay.visible { display: block; }

/* Mobile menu toggle */
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-100);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}

/* ══════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════ */
.sidebar {
  position: fixed;
  top: var(--topbar-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-000);
  border-right: 1px solid var(--border-100);
  overflow-y: auto;
  padding: 1.25rem 0;
  z-index: 50;
  scrollbar-width: thin;
  scrollbar-color: var(--border-200) transparent;
}

.nav-group {
  margin-bottom: 0.25rem;
}

.nav-group-title {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-300);
  padding: 0.75rem 1.25rem 0.35rem;
  cursor: pointer;
  user-select: none;
}

.nav-group .nav-items {
  display: none;
}

.nav-group.expanded .nav-items {
  display: block;
}

.sidebar-nav a {
  display: block;
  padding: 0.35rem 1.25rem 0.35rem 1.75rem;
  color: var(--text-200);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 400;
  transition: all 0.15s;
  border-left: 2px solid transparent;
}

.sidebar-nav a:hover {
  color: var(--text-000);
  background: var(--bg-200);
  text-decoration: none;
}

.sidebar-nav a.active {
  color: var(--accent-000);
  background: var(--accent-bg);
  border-left-color: var(--accent-000);
  font-weight: 500;
}

/* ══════════════════════════════════════
   MAIN CONTENT AREA
   ══════════════════════════════════════ */
.doc-layout {
  display: flex;
  margin-left: var(--sidebar-width);
  margin-top: var(--topbar-height);
  min-height: calc(100vh - var(--topbar-height));
}

.doc-content {
  flex: 1;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 2.5rem 3rem 4rem;
  min-width: 0;
}

/* ══════════════════════════════════════
   TABLE OF CONTENTS (right)
   ══════════════════════════════════════ */
.toc-sidebar {
  width: var(--toc-width);
  flex-shrink: 0;
  position: sticky;
  top: var(--topbar-height);
  height: calc(100vh - var(--topbar-height));
  overflow-y: auto;
  padding: 2.5rem 1rem 2rem 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border-200) transparent;
}

.toc-sidebar.empty { display: none; }

.toc-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-300);
  margin-bottom: 0.75rem;
}

#toc-list {
  list-style: none;
  padding: 0;
}

.toc-item {
  border-left: 1px solid var(--border-200);
}

.toc-item a {
  display: block;
  padding: 0.25rem 0 0.25rem 0.75rem;
  font-size: 0.78rem;
  color: var(--text-300);
  text-decoration: none;
  transition: all 0.15s;
  line-height: 1.4;
}

.toc-item a:hover { color: var(--text-000); text-decoration: none; }
.toc-item a.active {
  color: var(--accent-000);
  border-left: 1px solid var(--accent-000);
  margin-left: -1px;
}

.toc-sub a { padding-left: 1.5rem; font-size: 0.75rem; }

/* ══════════════════════════════════════
   TYPOGRAPHY
   ══════════════════════════════════════ */
h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 2.2rem;
  color: var(--accent-000);
  margin-bottom: 0.5rem;
  letter-spacing: 1px;
  line-height: 1.2;
}

h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text-000);
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-200);
  scroll-margin-top: calc(var(--topbar-height) + 1rem);
}

h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--accent-000);
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  scroll-margin-top: calc(var(--topbar-height) + 1rem);
}

h4 {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-000);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

p { margin-bottom: 1rem; }

.subtitle {
  font-size: 1.05rem;
  color: var(--text-200);
  margin-bottom: 2rem;
  line-height: 1.6;
}

.intro-text {
  font-size: 1rem;
  color: var(--text-100);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

a { color: var(--accent-000); text-decoration: none; transition: color 0.2s; }
a:hover { color: #e0c870; text-decoration: underline; }

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-300);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  color: var(--text-000);
}

pre {
  background: var(--bg-300);
  border: 1px solid var(--border-200);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin: 1rem 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
}

blockquote {
  border-left: 3px solid var(--accent-200);
  padding: 0.75rem 1.25rem;
  margin: 1.25rem 0;
  background: var(--bg-200);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--text-200);
}

blockquote cite {
  display: block;
  margin-top: 0.5rem;
  font-style: normal;
  font-size: 0.85rem;
  color: var(--accent-200);
}

hr {
  border: none;
  border-top: 1px solid var(--border-200);
  margin: 2.5rem 0;
}

ul, ol { margin-left: 1.5rem; margin-bottom: 1rem; }
li { margin-bottom: 0.3rem; }

strong { color: var(--text-000); }

/* ══════════════════════════════════════
   CALLOUT BOXES
   ══════════════════════════════════════ */
.callout {
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border: 1px solid;
  font-size: 0.9rem;
  line-height: 1.6;
}

.callout-title {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 0.5rem;
}

/* Info (neutral — replaces lore-box) */
.callout-info, .lore-box {
  border-color: var(--info-border);
  background: var(--info-bg);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border: 1px solid var(--info-border);
  font-size: 0.9rem;
  line-height: 1.6;
}

.callout-info .callout-title, .lore-box .lore-title {
  color: var(--text-200);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 0.5rem;
}

/* Tip (green) */
.callout-tip, .tip-box {
  border-color: var(--tip-border);
  background: var(--tip-bg);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border: 1px solid var(--tip-border);
  font-size: 0.9rem;
  line-height: 1.6;
}

.callout-tip .callout-title, .tip-box .tip-title {
  color: var(--tip-text);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 0.5rem;
}

/* Warning (amber) */
.callout-warning, .warning-box {
  border-color: var(--warning-border);
  background: var(--warning-bg);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border: 1px solid var(--warning-border);
  font-size: 0.9rem;
  line-height: 1.6;
}

.callout-warning .callout-title, .warning-box .warning-title {
  color: var(--warning-text);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 0.5rem;
}

/* ══════════════════════════════════════
   CARDS
   ══════════════════════════════════════ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.card-grid-3 {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.card {
  background: var(--bg-200);
  border: 1px solid var(--border-200);
  border-radius: 10px;
  padding: 1.25rem;
  transition: all 0.2s;
  position: relative;
}

.card:hover {
  background: var(--bg-300);
  border-color: var(--border-300);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.card a { color: inherit; text-decoration: none; }
.card a:hover { text-decoration: none; }

.card .card-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  display: block;
}

.card .card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-000);
  margin-bottom: 0.4rem;
}

.card .card-desc {
  font-size: 0.85rem;
  color: var(--text-200);
  line-height: 1.5;
}

.card .card-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  margin-top: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: var(--bg-400);
  color: var(--text-200);
}

/* Rarity */
.rarity-legendary { border-color: var(--legendary) !important; }
.rarity-legendary .card-tag { background: #ff880018; color: var(--legendary); }
.rarity-epic { border-color: var(--epic) !important; }
.rarity-epic .card-tag { background: #c040ff18; color: var(--epic); }
.rarity-rare { border-color: var(--rare) !important; }
.rarity-rare .card-tag { background: #4080ff18; color: var(--rare); }

/* ══════════════════════════════════════
   STAT BARS
   ══════════════════════════════════════ */
.stat-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.3rem 0;
  font-size: 0.8rem;
}

.stat-label {
  width: 90px;
  color: var(--text-300);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
}

.stat-bar {
  flex: 1;
  height: 5px;
  background: var(--border-200);
  border-radius: 3px;
  overflow: hidden;
}

.stat-bar-fill {
  height: 100%;
  border-radius: 3px;
}

.stat-bar-fill.power { background: linear-gradient(90deg, var(--fire), #ff6040); }
.stat-bar-fill.speed { background: linear-gradient(90deg, var(--frost), #60c0ff); }
.stat-bar-fill.range { background: linear-gradient(90deg, var(--nature), #60e080); }
.stat-bar-fill.efficiency { background: linear-gradient(90deg, var(--arcane), #a080ff); }
.stat-bar-fill.buff { background: linear-gradient(90deg, var(--accent-000), #e0c060); }

.stat-value {
  width: 40px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-300);
}

/* ══════════════════════════════════════
   TABLES
   ══════════════════════════════════════ */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.9rem;
}

.wiki-table { /* alias */ }

thead { border-bottom: 2px solid var(--accent-200); }

th {
  font-family: var(--font-body);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 1px;
  color: var(--accent-000);
  text-align: left;
  padding: 0.6rem 0.85rem;
}

td {
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--border-100);
}

tr:hover td { background: var(--bg-200); }

/* ══════════════════════════════════════
   TABS
   ══════════════════════════════════════ */
.tabs-container {}

.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-200);
  margin-bottom: 1.5rem;
}

.tab-btn {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.65rem 1.25rem;
  background: none;
  border: none;
  color: var(--text-300);
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 2px solid transparent;
}

.tab-btn:hover { color: var(--text-000); }
.tab-btn.active {
  color: var(--accent-000);
  border-bottom-color: var(--accent-000);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ══════════════════════════════════════
   SKILL TREE
   ══════════════════════════════════════ */
.skill-tree {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.6rem;
  margin: 1rem 0;
}

.skill-node {
  background: var(--bg-200);
  border: 1px solid var(--border-200);
  border-radius: 8px;
  padding: 0.65rem;
  text-align: center;
  font-size: 0.8rem;
  transition: all 0.2s;
}

.skill-node:hover {
  border-color: var(--accent-000);
  background: var(--bg-300);
}

.skill-node .skill-name {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-000);
}

.skill-node .skill-branch {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-300);
  text-transform: uppercase;
  margin-top: 0.15rem;
}

/* Branch colors */
.branch-heavy .skill-name { color: var(--fire) !important; }
.branch-agile .skill-name { color: var(--frost) !important; }
.branch-defensive .skill-name { color: var(--earth) !important; }
.branch-crippling .skill-name { color: var(--shadow) !important; }
.branch-cleaving .skill-name { color: var(--nature) !important; }

/* ══════════════════════════════════════
   CREATURE ROWS
   ══════════════════════════════════════ */
.creature-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border-100);
  transition: background 0.15s;
  border-radius: 6px;
}

.creature-row:hover { background: var(--bg-200); }

.creature-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.creature-info { flex: 1; }

.creature-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-000);
}

.creature-meta {
  font-size: 0.78rem;
  color: var(--text-200);
}

.creature-threat {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.threat-low { background: #40c06018; color: var(--nature); }
.threat-medium { background: #c8a84e18; color: var(--accent-000); }
.threat-high { background: #e0403018; color: var(--fire); }
.threat-deadly { background: #a040d018; color: var(--shadow); }
.threat-boss { background: #ff880018; color: var(--legendary); }

/* ══════════════════════════════════════
   DUNGEON CARDS
   ══════════════════════════════════════ */
.dungeon-card {
  background: var(--bg-200);
  border: 1px solid var(--border-200);
  border-radius: 10px;
  padding: 1.5rem;
  margin: 1.25rem 0;
  position: relative;
  overflow: hidden;
}

.dungeon-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: 10px 10px 0 0;
}

.dungeon-card.tier-1::before { background: linear-gradient(90deg, var(--nature), transparent); }
.dungeon-card.tier-2::before { background: linear-gradient(90deg, var(--frost), transparent); }
.dungeon-card.tier-3::before { background: linear-gradient(90deg, var(--fire), transparent); }
.dungeon-card.tier-4::before { background: linear-gradient(90deg, var(--shadow), transparent); }
.dungeon-card.tier-5::before { background: linear-gradient(90deg, var(--legendary), transparent); }

.dungeon-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.dungeon-tier {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  border: 1px solid;
  flex-shrink: 0;
}

/* ══════════════════════════════════════
   BIOME SECTIONS
   ══════════════════════════════════════ */
.biome-section {
  background: var(--bg-200);
  border: 1px solid var(--border-200);
  border-radius: 10px;
  padding: 1.5rem;
  margin: 1.25rem 0;
  position: relative;
  overflow: hidden;
}

.biome-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: 10px 10px 0 0;
}

.biome-section.b-temperate::before { background: linear-gradient(90deg, #80c080, #40a040); }
.biome-section.b-desert::before { background: linear-gradient(90deg, #d0a040, #e06020); }
.biome-section.b-jungle::before { background: linear-gradient(90deg, #40c060, #20a040); }
.biome-section.b-taiga::before { background: linear-gradient(90deg, #60a0c0, #408080); }
.biome-section.b-tundra::before { background: linear-gradient(90deg, #80c0e0, #a0d0f0); }
.biome-section.b-tropical::before { background: linear-gradient(90deg, #c0d040, #80c020); }

.biome-creatures {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.biome-creature-tag {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  background: var(--bg-100);
  border: 1px solid var(--border-200);
}

.biome-creature-tag.hostile { border-color: #e0403030; color: var(--fire); }
.biome-creature-tag.peaceful { border-color: #40c06030; color: var(--nature); }

.danger-meter {
  display: flex;
  gap: 2px;
}

.danger-pip {
  width: 18px; height: 5px;
  border-radius: 3px;
  background: var(--border-200);
}

.danger-pip.active { background: var(--fire); }

/* ══════════════════════════════════════
   QUEST CARDS
   ══════════════════════════════════════ */
.quest-card {
  background: var(--bg-200);
  border-radius: 10px;
  padding: 1.25rem;
  margin: 0.85rem 0;
  border-left: 4px solid var(--accent-000);
  transition: transform 0.2s;
}

.quest-card:hover {
  transform: translateX(2px);
}

.quest-card.daily { border-left-color: var(--nature); }
.quest-card.weekly { border-left-color: var(--rare); }
.quest-card.faction { border-left-color: var(--shadow); }

.quest-type-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 0.15rem 0.6rem;
  border-radius: 10px;
  margin-bottom: 0.4rem;
}

.tag-daily { background: #40c06025; color: var(--nature); }
.tag-weekly { background: #4080ff25; color: var(--rare); }
.tag-faction { background: #d040a025; color: #d040a0; }

.quest-points {
  float: right;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--accent-000);
}

.quest-flavor {
  font-style: italic;
  color: var(--text-300);
  margin-top: 0.4rem;
  font-size: 0.85rem;
}

/* ══════════════════════════════════════
   FACTION BANNERS
   ══════════════════════════════════════ */
.faction-banner {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin: 1.5rem 0;
}

.faction {
  flex: 1;
  min-width: 280px;
  background: var(--bg-200);
  border: 1px solid var(--border-200);
  border-radius: 10px;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

.faction::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: 10px 10px 0 0;
}

.faction.cendres::before { background: var(--fire); }
.faction.abysses::before { background: var(--shadow); }
.faction.forge::before { background: var(--accent-000); }
.faction.marees::before { background: var(--frost); }
.faction.canopee::before { background: var(--nature); }

.faction-icon { font-size: 2rem; margin-bottom: 0.75rem; }

/* Faction banner (quest page) */
.faction-cendres { background: linear-gradient(90deg, #cc330015, transparent); border-left: 3px solid var(--fire); border-radius: 8px; padding: 0.75rem; margin: 0.5rem 0; }
.faction-forge { background: linear-gradient(90deg, #daa52015, transparent); border-left: 3px solid var(--accent-000); border-radius: 8px; padding: 0.75rem; margin: 0.5rem 0; }
.faction-canopee { background: linear-gradient(90deg, #40c06015, transparent); border-left: 3px solid var(--nature); border-radius: 8px; padding: 0.75rem; margin: 0.5rem 0; }
.faction-marees { background: linear-gradient(90deg, #4080ff15, transparent); border-left: 3px solid var(--frost); border-radius: 8px; padding: 0.75rem; margin: 0.5rem 0; }
.faction-abysses { background: linear-gradient(90deg, #a040d015, transparent); border-left: 3px solid var(--arcane); border-radius: 8px; padding: 0.75rem; margin: 0.5rem 0; }

/* ══════════════════════════════════════
   HERO SECTION (index only)
   ══════════════════════════════════════ */
.hero {
  text-align: center;
  padding: 3rem 0;
}

.hero h1 {
  font-size: 3.5rem;
  letter-spacing: 8px;
  text-shadow: 0 0 40px #c8a84e30;
  margin-bottom: 0.75rem;
}

.hero .subtitle {
  font-size: 1.1rem;
  max-width: 560px;
  margin: 0 auto 1.5rem;
  color: var(--text-200);
}

.hero-cta {
  display: inline-flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.world-stat {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
  margin: 1.5rem 0;
}

.world-stat-item { text-align: center; padding: 1rem; }

.world-stat-num {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--accent-000);
}

.world-stat-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-300);
}

/* ══════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════ */
.btn {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.6rem 1.5rem;
  border-radius: 8px;
  border: 1px solid;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  display: inline-block;
}

.btn-primary {
  background: var(--accent-000);
  color: var(--bg-000);
  border-color: var(--accent-000);
}

.btn-primary:hover {
  background: #e0c060;
  text-decoration: none;
  color: var(--bg-000);
}

.btn-ghost {
  background: transparent;
  color: var(--accent-000);
  border-color: var(--accent-200);
}

.btn-ghost:hover {
  background: var(--accent-bg);
  border-color: var(--accent-000);
  text-decoration: none;
}

/* ══════════════════════════════════════
   MISC
   ══════════════════════════════════════ */
.stat-highlight {
  background: var(--bg-300);
  border: 1px solid var(--accent-200);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 1rem 0;
  font-size: 1rem;
  text-align: center;
}

.tip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.tip-card {
  background: var(--bg-200);
  border: 1px solid var(--border-200);
  border-radius: 8px;
  padding: 1.25rem;
}

.tip-card h4 {
  margin-top: 0;
  font-size: 0.9rem;
  color: var(--accent-000);
}

.tip-card p {
  font-size: 0.85rem;
  color: var(--text-200);
  margin-bottom: 0;
}

/* Search box (creature page) */
.search-box {
  width: 100%;
  padding: 0.6rem 1rem;
  background: var(--bg-200);
  border: 1px solid var(--border-200);
  border-radius: 8px;
  color: var(--text-000);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
  margin-bottom: 1.25rem;
}

.search-box:focus { border-color: var(--accent-000); }
.search-box::placeholder { color: var(--text-400); }

/* Keybind tags */
.keybind {
  display: inline-block;
  background: var(--bg-300);
  border: 1px solid var(--border-300);
  border-radius: 4px;
  padding: 0.05rem 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-000);
}

/* Checklist (guide) */
.checklist { list-style: none; padding: 0; }
.checklist li {
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border-100);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.checklist li::before {
  content: '';
  width: 16px; height: 16px;
  border-radius: 4px;
  border: 2px solid var(--accent-200);
  flex-shrink: 0;
}

/* Step (guide) */
.step {
  display: flex;
  gap: 1.25rem;
  margin: 1.25rem 0;
  align-items: flex-start;
}
.step-num {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 2rem;
  color: var(--accent-000);
  line-height: 1;
  min-width: 50px;
  text-align: center;
}
.step-content { flex: 1; }
.step-content h3 { margin-top: 0; }

/* Timeline (lore) */
.timeline { position: relative; padding-left: 2rem; margin: 1.5rem 0; }
.timeline::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(var(--accent-000), var(--accent-200), transparent);
}
.timeline-event { position: relative; margin-bottom: 2rem; padding-left: 1.25rem; }
.timeline-event::before {
  content: '';
  position: absolute;
  left: -2.1rem; top: 0.5rem;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent-000);
  border: 2px solid var(--bg-100);
  box-shadow: 0 0 6px #c8a84e33;
}
.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent-200);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 0.2rem;
}
.timeline-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-000);
  margin-bottom: 0.4rem;
}

/* Mystery box (lore) */
.mystery-box {
  background: linear-gradient(135deg, #1a0a2020, var(--bg-200));
  border: 1px solid #4a2a6a30;
  border-radius: 8px;
  padding: 1.25rem;
  margin: 1rem 0;
}
.mystery-box .mystery-title {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--shadow);
  margin-bottom: 0.4rem;
}

/* ══════════════════════════════════════
   FOOTER
   ══════════════════════════════════════ */
footer {
  text-align: center;
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--border-200);
  margin-top: 3rem;
  color: var(--text-300);
  font-size: 0.8rem;
}

footer a { color: var(--accent-200); }

/* ══════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════ */
@media (max-width: 1400px) {
  .toc-sidebar { display: none; }
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 80;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: block; }
  .doc-layout { margin-left: 0; }
  .doc-content { padding: 2rem 1.25rem 3rem; }
  .topbar-label { display: none; }
}

@media (max-width: 600px) {
  h1 { font-size: 1.8rem; }
  .hero h1 { font-size: 2.5rem; letter-spacing: 4px; }
  .card-grid { grid-template-columns: 1fr; }
  .skill-tree { grid-template-columns: repeat(2, 1fr); }
  .faction-banner { flex-direction: column; }
  .world-stat { gap: 0.75rem; }
  .world-stat-num { font-size: 1.8rem; }
}

/* ══════════════════════════════════════
   LIGHT THEME
   Inspired by Anthropic / Android docs
   ══════════════════════════════════════ */
[data-theme="light"] {
  --bg-000: #ffffff;
  --bg-100: #f8f9fa;
  --bg-200: #f0f1f3;
  --bg-300: #e8e9ec;
  --bg-400: #dcdee2;

  --text-000: #1a1a2e;
  --text-100: #2d2d44;
  --text-200: #5c5c78;
  --text-300: #8a8aa0;
  --text-400: #b0b0c0;

  --accent-000: #9a6e1e;
  --accent-100: #7a5510;
  --accent-200: #5c4008;
  --accent-bg: #9a6e1e0c;

  --border-100: #e8e8f0;
  --border-200: #d8d8e4;
  --border-300: #c4c4d4;

  --info-border: var(--border-300);
  --info-bg: #f0f0f8;
  --tip-border: #2a8060;
  --tip-bg: #2a806010;
  --tip-text: #1a6848;
  --warning-border: #a07030;
  --warning-bg: #a0703010;
  --warning-text: #8a5a18;

  --legendary: #c06800;
  --epic: #9020d0;
  --rare: #2060d0;
  --common: #707080;

  --fire: #c03020;
  --frost: #2080c0;
  --nature: #208040;
  --shadow: #7030a0;
  --earth: #a06830;
  --arcane: #5040c0;

  --bg-deep: var(--bg-000);
  --bg-card: var(--bg-200);
  --bg-card-hover: var(--bg-300);
  --bg-surface: var(--bg-300);
  --border: var(--border-200);
  --border-glow: var(--border-300);
  --text: var(--text-000);
  --text-dim: var(--text-200);
  --text-bright: var(--text-000);
  --accent-gold: var(--accent-000);
  --accent-gold-dim: var(--accent-200);
  --accent-fire: var(--fire);
  --accent-frost: var(--frost);
  --accent-nature: var(--nature);
  --accent-shadow: var(--shadow);
  --accent-earth: var(--earth);
  --accent-arcane: var(--arcane);
  --glow-gold: 0 0 20px #9a6e1e10;
}

[data-theme="light"] html { scrollbar-color: var(--border-300) var(--bg-100); }
[data-theme="light"] .hero h1 { text-shadow: none; }
[data-theme="light"] .card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
[data-theme="light"] #search-results { box-shadow: 0 8px 32px rgba(0,0,0,0.12); }
[data-theme="light"] .mystery-box { background: linear-gradient(135deg, #f0e8f820, var(--bg-200)); border-color: #d0c0e030; }
[data-theme="light"] .timeline-event::before { border-color: var(--bg-100); }
[data-theme="light"] a:hover { color: #b8841e; }
[data-theme="light"] .topbar-logo:hover { color: #b8841e; }
[data-theme="light"] .btn-primary { color: #fff; }
[data-theme="light"] .btn-primary:hover { background: #b8841e; color: #fff; }

/* Theme toggle button */
.theme-toggle {
  background: none;
  border: 1px solid var(--border-200);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-200);
  font-size: 1.1rem;
  transition: all 0.2s;
  flex-shrink: 0;
  line-height: 1;
}

.theme-toggle:hover {
  border-color: var(--accent-000);
  color: var(--accent-000);
  background: var(--accent-bg);
}

/* Smooth transition between themes */
body, .topbar, .sidebar, .card, .dungeon-card, .biome-section, .quest-card,
.callout-info, .callout-tip, .callout-warning, .lore-box, .tip-box, .warning-box,
.search-box, .topbar-search input, .tab-btn, .skill-node, .creature-row,
.faction, .mystery-box, .tip-card, .stat-highlight, .keybind, code, pre, blockquote,
#search-results, .search-result-item, .toc-item a, .sidebar-nav a, footer,
.theme-toggle, .topbar-shortcut {
  transition: background-color 0.25s, border-color 0.25s, color 0.25s;
}

/* ══════════════════════════════════════
   ANIMATIONS
   ══════════════════════════════════════ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.card, .dungeon-card, .biome-section, .quest-card {
  animation: fadeIn 0.3s ease both;
}

/* ══════════════════════════════════════
   PRINT
   ══════════════════════════════════════ */
@media print {
  .topbar, .sidebar, .toc-sidebar { display: none; }
  .doc-layout { margin-left: 0; }
  body { background: white; color: black; }
  .card { break-inside: avoid; border: 1px solid #ccc; }
}
