/* =========================================================
   Megabonk Wiki & Guides — theme
   Dark survivor-roguelike palette, orange accent
   ========================================================= */

:root {
  --bg: #0e1119;
  --bg-2: #131726;
  --surface: #171d2e;
  --surface-2: #1e263c;
  --border: #2a3350;
  --border-soft: #232c46;

  --text: #e8ecf4;
  --muted: #9aa5bd;
  --muted-2: #707c98;

  --accent: #ff6b35;        /* orange-500 */
  --accent-light: #ff8a5e;
  --accent-dark: #e0552a;
  --accent-glow: rgba(255, 107, 53, 0.35);

  --purple: #8a7bff;
  --green: #3ddc84;
  --blue: #57b8ff;
  --gold: #ffc94d;
  --red: #ff5c72;

  --s-tier: #ffb020;
  --a-tier: #3ddc84;
  --b-tier: #57b8ff;
  --c-tier: #7b879d;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --font: "Segoe UI", system-ui, -apple-system, "PingFang SC",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-light); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 22px; }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(14, 17, 25, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
}
.navbar {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 62px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 1.08rem;
  color: var(--text);
  letter-spacing: 0.2px;
}
.brand:hover { text-decoration: none; }
.brand .logo {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #ff9d3c);
  color: #1a0f05;
  border-radius: 8px;
  font-weight: 900;
  font-size: 0.95rem;
}
.brand small {
  display: block;
  font-weight: 500;
  font-size: 0.62rem;
  color: var(--muted);
  letter-spacing: 0.4px;
  line-height: 1;
  margin-top: 2px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.nav-links a {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 7px 11px;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav-links a.active { color: var(--accent-light); }
.nav-cta {
  background: var(--accent);
  color: #160a04 !important;
  font-weight: 700;
}
.nav-cta:hover { background: var(--accent-light) !important; color: #160a04 !important; }
.nav-toggle {
  display: none;
  margin-left: auto;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 11px;
  font-size: 1rem;
  cursor: pointer;
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 64px 0 48px;
  border-bottom: 1px solid var(--border-soft);
  background:
    radial-gradient(900px 420px at 80% -10%, rgba(255, 107, 53, 0.14), transparent 60%),
    radial-gradient(700px 380px at 10% 110%, rgba(138, 123, 255, 0.12), transparent 60%),
    var(--bg-2);
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--accent-light);
  background: rgba(255, 107, 53, 0.1);
  border: 1px solid rgba(255, 107, 53, 0.28);
  padding: 6px 12px;
  border-radius: 999px;
}
.hero h1 {
  font-size: clamp(2.4rem, 5.5vw, 3.6rem);
  line-height: 1.05;
  margin: 18px 0 14px;
  letter-spacing: -0.5px;
}
.hero .lede {
  font-size: 1.12rem;
  color: var(--muted);
  max-width: 640px;
  margin: 0 0 22px;
}
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 26px;
}
.stat-pill {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 11px;
  font-weight: 700;
  font-size: 0.95rem;
  transition: transform 0.12s, background 0.15s, box-shadow 0.15s;
  cursor: pointer;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #160a04; box-shadow: 0 6px 18px rgba(255, 107, 53, 0.3); }
.btn-primary:hover { background: var(--accent-light); }
.btn-ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: #252e49; }

/* ---------- sections ---------- */
.section { padding: 52px 0; }
.section.alt { background: var(--bg-2); border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); }
.section-title {
  font-size: 1.7rem;
  margin: 0 0 8px;
  letter-spacing: -0.3px;
}
.section-sub { color: var(--muted); margin: 0 0 28px; max-width: 720px; }
.section-head { margin-bottom: 26px; }

/* ---------- cards ---------- */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.card:hover {
  transform: translateY(-3px);
  border-color: #35406a;
  box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 8px; font-size: 1.1rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.card .num {
  display: inline-flex;
  width: 30px; height: 30px;
  align-items: center; justify-content: center;
  border-radius: 8px;
  background: rgba(255, 107, 53, 0.14);
  color: var(--accent-light);
  font-weight: 800;
  margin-bottom: 12px;
}

/* ---------- badges ---------- */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.4px;
  line-height: 1.5;
}
.badge.s { background: rgba(255, 176, 32, 0.16); color: var(--s-tier); }
.badge.a { background: rgba(61, 220, 132, 0.16); color: var(--a-tier); }
.badge.b { background: rgba(87, 184, 255, 0.16); color: var(--b-tier); }
.badge.c { background: rgba(123, 135, 157, 0.2); color: var(--c-tier); }
.badge.default { background: rgba(87, 184, 255, 0.14); color: var(--blue); }
.badge.unlock { background: rgba(255, 107, 53, 0.14); color: var(--accent-light); }
.badge.starter { background: rgba(61, 220, 132, 0.14); color: var(--green); }

/* ---------- entity cards ---------- */
.entity-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.15s, transform 0.15s;
}
.entity-card:hover { border-color: #35406a; transform: translateY(-2px); }
.entity-top { display: flex; align-items: center; gap: 10px; }
.entity-top h3 { margin: 0; font-size: 1.04rem; flex: 1; }
.entity-meta { font-size: 0.84rem; color: var(--muted); }
.entity-meta b { color: var(--text); font-weight: 600; }
.entity-tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- tier list ---------- */
.tier-block { margin-bottom: 34px; }
.tier-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.tier-head .tier-label {
  font-size: 1.3rem;
  font-weight: 900;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 10px;
}
.tier-head .tier-label.s { background: rgba(255, 176, 32, 0.15); color: var(--s-tier); }
.tier-head .tier-label.a { background: rgba(61, 220, 132, 0.15); color: var(--a-tier); }
.tier-head .tier-label.b { background: rgba(87, 184, 255, 0.15); color: var(--b-tier); }
.tier-head .tier-label.c { background: rgba(123, 135, 157, 0.18); color: var(--c-tier); }
.tier-head .tier-info h4 { margin: 0; font-size: 1.05rem; }
.tier-head .tier-info span { color: var(--muted); font-size: 0.82rem; }
.tier-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
  margin-left: 56px;
}
.tier-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
.tier-item .ti-name { font-weight: 700; font-size: 0.95rem; }
.tier-item .ti-note { color: var(--muted); font-size: 0.82rem; margin-top: 2px; }

/* ---------- tables ---------- */
.table-scroll { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 640px;
}
table.data thead th {
  text-align: left;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
}
table.data tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
}
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data td strong { color: var(--text); }

/* ---------- callouts ---------- */
.callout {
  border-radius: 12px;
  padding: 16px 18px;
  margin: 18px 0;
  font-size: 0.92rem;
  border: 1px solid;
}
.callout.tip { background: rgba(61, 220, 132, 0.08); border-color: rgba(61, 220, 132, 0.3); }
.callout.warn { background: rgba(255, 201, 77, 0.08); border-color: rgba(255, 201, 77, 0.3); }
.callout.danger { background: rgba(255, 92, 114, 0.08); border-color: rgba(255, 92, 114, 0.3); }
.callout .ct { font-weight: 800; display: block; margin-bottom: 4px; }

/* ---------- breadcrumbs ---------- */
.crumbs { padding: 16px 0 0; }
.crumb-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  font-size: 0.82rem;
  color: var(--muted-2);
}
.crumb-list li { display: inline-flex; align-items: center; gap: 8px; }
.crumb-list li + li::before { content: "/"; color: var(--muted-2); }
.crumb-list a { color: var(--muted); }
.crumb-list a:hover { color: var(--text); text-decoration: none; }
.crumb-list [aria-current="page"] { color: var(--text); font-weight: 600; }

/* ---------- FAQ ---------- */
.faq-list { max-width: 760px; margin-top: 8px; }
.faq {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 10px;
  overflow: hidden;
}
.faq summary {
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--text);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent-light); font-size: 1.2rem; font-weight: 700; }
.faq[open] summary::after { content: "-"; }
.faq p { margin: 0; padding: 0 16px 16px; color: var(--muted); font-size: 0.92rem; }

/* ---------- page hero (inner pages) ---------- */
.page-hero {
  padding: 40px 0 28px;
  background:
    radial-gradient(700px 320px at 85% -20%, rgba(255, 107, 53, 0.12), transparent 60%),
    var(--bg-2);
  border-bottom: 1px solid var(--border-soft);
}
.page-hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 12px 0 10px; letter-spacing: -0.4px; }
.page-hero .sub { color: var(--muted); max-width: 760px; margin: 0; }
.fact-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

/* ---------- prose ---------- */
.prose { max-width: 760px; }
.prose h2 { font-size: 1.4rem; margin: 34px 0 12px; letter-spacing: -0.2px; }
.prose h3 { font-size: 1.1rem; margin: 24px 0 8px; }
.prose p { color: #cdd5e3; margin: 0 0 14px; }
.prose ul, .prose ol { color: #cdd5e3; padding-left: 22px; margin: 0 0 16px; }
.prose li { margin-bottom: 7px; }
.prose code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 0.85em;
  color: var(--accent-light);
}

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--border-soft);
  background: var(--bg-2);
  padding: 48px 0 28px;
  margin-top: 20px;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; }
.footer-col h4 { margin: 0 0 12px; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: var(--muted); font-size: 0.9rem; }
.footer-col a:hover { color: var(--text); text-decoration: none; }
.footer-about { color: var(--muted); font-size: 0.88rem; }
.footer-about .fname { color: var(--text); font-weight: 800; font-size: 1.05rem; }
.footer-note {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--border-soft);
  color: var(--muted-2);
  font-size: 0.78rem;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .nav-links {
    display: none;
    position: absolute;
    top: 62px;
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 10px 16px 16px;
    gap: 2px;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 10px; }
  .nav-toggle { display: block; }
  .tier-items { margin-left: 0; }
  .footer-grid { grid-template-columns: 1fr; }
}
