/* ── EarthStonks Wiki Shared Stylesheet ── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green:   #4ade80;
  --gold:    #fbbf24;
  --red:     #f87171;
  --blue:    #60a5fa;
  --discord: #5865F2;
  --store:   #f97316;
  --vote:    #22d3ee;
  --map:     #a78bfa;
  --economy: #00e87a;
  --wiki:    #e2b714;
  --dark:    #0a0f0d;
  --dark2:   #0d1410;
  --card:    rgba(255,255,255,0.04);
  --border:  rgba(255,255,255,0.06);
  --text:    #e2e8f0;
  --muted:   #64748b;
  --sub:     #94a3b8;
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--dark);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.7;
}

/* ── NAV ── */
.site-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2.5rem; height: 58px;
  border-bottom: 1px solid rgba(74,222,128,0.12);
  backdrop-filter: blur(12px);
  background: rgba(10,15,13,0.90);
  position: sticky; top: 0; z-index: 200; gap: 1rem;
}
.nav-logo {
  font-family: 'Press Start 2P', monospace; font-size: 0.8rem;
  color: var(--green); text-decoration: none; white-space: nowrap;
  text-shadow: 0 0 12px rgba(74,222,128,0.6); flex-shrink: 0;
}
.nav-links { display: flex; align-items: center; gap: 0.2rem; flex: 1; justify-content: center; }
.nav-link {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.4rem 0.85rem; border-radius: 8px; font-size: 0.82rem; font-weight: 600;
  text-decoration: none; color: var(--muted); transition: all 0.2s;
  white-space: nowrap; border: 1px solid transparent;
}
.nav-link:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.nav-link.active { color: var(--wiki); background: rgba(226,183,20,0.08); border-color: rgba(226,183,20,0.2); }
.nav-link.nl-home:hover    { color: var(--green);   background: rgba(74,222,128,0.08); }
.nav-link.nl-wiki:hover    { color: var(--wiki);    background: rgba(226,183,20,0.08); }
.nav-link.nl-map:hover     { color: var(--map);     background: rgba(167,139,250,0.08); }
.nav-link.nl-economy:hover { color: var(--economy); background: rgba(0,232,122,0.08); }
.nav-link.nl-store:hover   { color: var(--store);   background: rgba(249,115,22,0.08); }
.nav-link.nl-vote:hover    { color: var(--vote);    background: rgba(34,211,238,0.08); }
.nav-link.nl-discord:hover { color: var(--discord); background: rgba(88,101,242,0.08); }
.nav-ip {
  display: flex; align-items: center; gap: 0.5rem;
  background: rgba(74,222,128,0.08); border: 1px solid rgba(74,222,128,0.25);
  border-radius: 8px; padding: 0.4rem 0.85rem; font-size: 0.75rem;
  color: var(--green); cursor: pointer; transition: background 0.2s;
  white-space: nowrap; flex-shrink: 0;
}
.nav-ip:hover { background: rgba(74,222,128,0.15); }
.nav-hamburger { display: none; background: none; border: none; color: var(--green); font-size: 1.2rem; cursor: pointer; padding: 0.3rem; }
.nav-mobile { display: none; flex-direction: column; gap: 0.3rem; padding: 1rem 1.5rem; background: rgba(10,15,13,0.97); border-bottom: 1px solid rgba(74,222,128,0.1); position: sticky; top: 58px; z-index: 199; }
.nav-mobile.open { display: flex; }
.nav-mobile .nav-link { justify-content: flex-start; padding: 0.6rem 1rem; }

/* ── WIKI LAYOUT ── */
.wiki-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  grid-template-rows: auto;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 6rem;
  gap: 2.5rem;
  align-items: start;
}

/* ── SIDEBAR ── */
.wiki-sidebar {
  position: sticky;
  top: 78px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(74,222,128,0.3) transparent;
}
.wiki-sidebar::-webkit-scrollbar { width: 4px; }
.wiki-sidebar::-webkit-scrollbar-track { background: transparent; }
.wiki-sidebar::-webkit-scrollbar-thumb { background: rgba(74,222,128,0.3); border-radius: 4px; }

.sidebar-section { margin-bottom: 1.8rem; }
.sidebar-heading {
  font-family: 'Press Start 2P', monospace; font-size: 0.5rem;
  letter-spacing: 0.18em; color: var(--green); text-transform: uppercase;
  opacity: 0.7; margin-bottom: 0.6rem; padding-left: 0.6rem;
}
.sidebar-link {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.45rem 0.6rem; border-radius: 8px;
  font-size: 0.84rem; font-weight: 500; text-decoration: none;
  color: var(--muted); transition: all 0.15s; margin-bottom: 0.1rem;
  border-left: 2px solid transparent;
}
.sidebar-link:hover { color: var(--text); background: rgba(255,255,255,0.04); border-left-color: rgba(74,222,128,0.3); }
.sidebar-link.active { color: var(--green); background: rgba(74,222,128,0.07); border-left-color: var(--green); font-weight: 600; }
.sidebar-link i { font-size: 0.75rem; width: 14px; text-align: center; flex-shrink: 0; }

/* ── MAIN CONTENT ── */
.wiki-content { min-width: 0; }

.wiki-breadcrumb {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.8rem; color: var(--muted);
  margin-bottom: 2rem;
}
.wiki-breadcrumb a { color: var(--muted); text-decoration: none; transition: color 0.15s; }
.wiki-breadcrumb a:hover { color: var(--green); }
.wiki-breadcrumb .sep { color: #334155; }

.wiki-page-title {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(1.1rem, 3vw, 1.8rem);
  color: #fff; line-height: 1.4; margin-bottom: 0.8rem;
  text-shadow: 0 0 20px rgba(74,222,128,0.2);
}
.wiki-page-title span { color: var(--green); }

.wiki-meta {
  font-size: 0.8rem; color: var(--muted);
  margin-bottom: 2.5rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.wiki-meta i { font-size: 0.7rem; }

.wiki-divider { height: 1px; background: linear-gradient(90deg, rgba(74,222,128,0.15), transparent); margin: 2rem 0; }

/* ── TYPOGRAPHY ── */
.wiki-body h2 {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(0.7rem, 1.8vw, 0.95rem);
  color: #f1f5f9; margin: 2.5rem 0 1rem; line-height: 1.5;
  padding-bottom: 0.6rem; border-bottom: 1px solid var(--border);
}
.wiki-body h3 {
  font-size: 1.05rem; font-weight: 700; color: #e2e8f0;
  margin: 1.8rem 0 0.6rem;
}
.wiki-body h4 {
  font-size: 0.92rem; font-weight: 700; color: var(--sub);
  margin: 1.2rem 0 0.4rem; text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.78rem;
}
.wiki-body p { color: var(--sub); font-size: 0.96rem; line-height: 1.8; margin-bottom: 1rem; }
.wiki-body p strong { color: #e2e8f0; }
.wiki-body a { color: var(--green); text-decoration: none; border-bottom: 1px solid rgba(74,222,128,0.3); }
.wiki-body a:hover { border-bottom-color: var(--green); }
.wiki-body ul, .wiki-body ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.wiki-body li { color: var(--sub); font-size: 0.96rem; line-height: 1.8; margin-bottom: 0.3rem; }
.wiki-body li strong { color: #e2e8f0; }

/* ── CALLOUTS ── */
.callout {
  border-radius: 10px; padding: 1rem 1.2rem;
  margin: 1.5rem 0; display: flex; gap: 0.8rem; align-items: flex-start;
  font-size: 0.9rem; line-height: 1.7;
}
.callout i { margin-top: 0.1rem; flex-shrink: 0; }
.callout-body { flex: 1; }
.callout-body strong { display: block; margin-bottom: 0.25rem; font-size: 0.88rem; }
.callout-body p, .callout-body span { color: inherit; font-size: 0.88rem; }
.callout.tip    { background: rgba(74,222,128,0.06);  border: 1px solid rgba(74,222,128,0.2);  color: #86efac; }
.callout.tip i  { color: var(--green); }
.callout.warn   { background: rgba(251,191,36,0.06);  border: 1px solid rgba(251,191,36,0.2);  color: #fde68a; }
.callout.warn i { color: var(--gold); }
.callout.danger { background: rgba(248,113,113,0.06); border: 1px solid rgba(248,113,113,0.2); color: #fca5a5; }
.callout.danger i { color: var(--red); }
.callout.info   { background: rgba(96,165,250,0.06);  border: 1px solid rgba(96,165,250,0.2);  color: #93c5fd; }
.callout.info i { color: var(--blue); }

/* ── COMMAND BLOCKS ── */
.cmd-block {
  background: rgba(0,0,0,0.4); border: 1px solid rgba(74,222,128,0.15);
  border-radius: 10px; padding: 1rem 1.2rem; margin: 1rem 0; overflow-x: auto;
}
.cmd-row { display: flex; align-items: baseline; gap: 0.8rem; margin-bottom: 0.5rem; flex-wrap: wrap; }
.cmd-row:last-child { margin-bottom: 0; }
.cmd { font-family: monospace; font-size: 0.88rem; color: var(--green); background: rgba(74,222,128,0.08); border: 1px solid rgba(74,222,128,0.2); border-radius: 5px; padding: 0.1rem 0.5rem; white-space: nowrap; }
.cmd-desc { font-size: 0.84rem; color: var(--muted); }
code { font-family: monospace; font-size: 0.88rem; color: var(--green); background: rgba(74,222,128,0.08); border: 1px solid rgba(74,222,128,0.15); border-radius: 4px; padding: 0.1rem 0.4rem; }

/* ── STAT / INFO CARDS ── */
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.info-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 1.2rem; text-align: center; }
.info-card .val { font-family: 'Press Start 2P', monospace; font-size: 0.9rem; color: var(--green); margin-bottom: 0.4rem; display: block; }
.info-card .lbl { font-size: 0.78rem; color: var(--muted); }

/* ── PHASE CARDS (siegewar etc.) ── */
.phase-list { display: flex; flex-direction: column; gap: 1.2rem; margin: 1.5rem 0; }
.phase {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 1.5rem;
  border-left: 3px solid var(--green);
}
.phase h3 { font-size: 1rem; font-weight: 700; color: #f1f5f9; margin-bottom: 0.5rem; }
.phase p { font-size: 0.9rem; color: var(--muted); line-height: 1.75; margin-bottom: 0.5rem; }
.phase p:last-child { margin-bottom: 0; }
.phase.warn-phase { border-left-color: var(--gold); }
.phase.danger-phase { border-left-color: var(--red); }

/* ── TABLE ── */
.wiki-table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 0.88rem; }
.wiki-table th { background: rgba(74,222,128,0.08); color: var(--green); font-weight: 700; padding: 0.7rem 1rem; text-align: left; border-bottom: 1px solid rgba(74,222,128,0.2); font-size: 0.8rem; letter-spacing: 0.04em; }
.wiki-table td { padding: 0.65rem 1rem; border-bottom: 1px solid var(--border); color: var(--sub); vertical-align: top; }
.wiki-table tr:last-child td { border-bottom: none; }
.wiki-table tr:hover td { background: rgba(255,255,255,0.02); }
.wiki-table td strong { color: #e2e8f0; }

/* ── RELATED ARTICLES ── */
.related { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.related h3 { font-family: 'Press Start 2P', monospace; font-size: 0.6rem; letter-spacing: 0.15em; color: var(--muted); text-transform: uppercase; margin-bottom: 1rem; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.8rem; }
.related-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 1rem; text-decoration: none; transition: border-color 0.2s, transform 0.2s; display: block; }
.related-card:hover { border-color: rgba(74,222,128,0.25); transform: translateY(-2px); }
.related-card i { font-size: 0.9rem; color: var(--green); margin-bottom: 0.4rem; display: block; }
.related-card span { font-size: 0.85rem; font-weight: 600; color: #e2e8f0; display: block; margin-bottom: 0.2rem; }
.related-card small { font-size: 0.75rem; color: var(--muted); }

/* ── FOOTER ── */
footer { text-align: center; padding: 2.5rem 1.5rem; border-top: 1px solid rgba(255,255,255,0.05); color: #1e293b; font-size: 0.78rem; }
footer span { color: #334155; }
footer a { color: #475569; text-decoration: none; }
footer a:hover { color: var(--green); }
.footer-links { display: flex; gap: 1.5rem; justify-content: center; margin-top: 0.8rem; flex-wrap: wrap; }

/* ── TOAST ── */
#copy-toast { position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--green); color: #0a0f0d; font-weight: 700; padding: 0.6rem 1.4rem; border-radius: 50px; font-size: 0.82rem; opacity: 0; transition: all 0.3s; z-index: 999; pointer-events: none; }
#copy-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .site-nav { padding: 0 1.2rem; }
  .nav-links { display: none; }
  .nav-hamburger { display: block; }
  .nav-ip span { display: none; }
  .wiki-shell { grid-template-columns: 1fr; padding: 1.5rem 1rem 4rem; gap: 0; }
  .wiki-sidebar { position: static; max-height: none; margin-bottom: 2rem; border-bottom: 1px solid var(--border); padding-bottom: 1.5rem; }
  .wiki-sidebar .sidebar-section { margin-bottom: 0.5rem; }
}
