:root {
  --bg: #0e100f;
  --bg-2: #141715;
  --panel: #181c19;
  --panel-2: #1e2320;
  --line: #2a312c;
  --text: #e7eae4;
  --muted: #98a299;
  --accent: #f2b632;
  --accent-ink: #1a1405;
  --link: #f5c95c;
  --low: #6fcf7f;
  --medium: #f2b632;
  --high: #f2853a;
  --critical: #ef4f4f;
  --extreme: #d36bff;
  --radius: 10px;
  --font-head: 'Chakra Petch', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(242, 182, 50, 0.07), transparent 60%),
    repeating-linear-gradient(135deg, rgba(255,255,255,0.012) 0 2px, transparent 2px 12px),
    var(--bg);
  color: var(--text);
  font: 16px/1.65 var(--font-body);
}
img, svg { max-width: 100%; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #fff; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.2; letter-spacing: 0.01em; margin: 0 0 0.5em; }
h1 { font-size: clamp(1.9rem, 4.5vw, 2.8rem); font-weight: 700; }
h2 { font-size: 1.4rem; font-weight: 600; margin-top: 1.6em; }
h3 { font-size: 1.1rem; font-weight: 600; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.25em; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; z-index: 100; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.with-sidebar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; }
@media (min-width: 1100px) { .with-sidebar { grid-template-columns: minmax(0, 1fr) 300px; } }
main { min-width: 0; padding-bottom: 48px; }

/* header */
.site-header { border-bottom: 1px solid var(--line); background: rgba(14, 16, 15, 0.92); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.logo svg { width: 30px; height: 30px; color: var(--accent); flex: none; }
.logo span { font-family: var(--font-head); font-weight: 700; font-size: 1.2rem; text-transform: uppercase; letter-spacing: 0.06em; line-height: 1.1; }
.logo small { display: block; font-family: var(--font-body); font-weight: 500; font-size: 0.7rem; letter-spacing: 0.08em; color: var(--muted); }
.site-nav { display: flex; gap: 4px; }
.site-nav a { color: var(--muted); text-decoration: none; padding: 8px 12px; border-radius: 6px; font-weight: 500; font-size: 0.95rem; }
.site-nav a:hover, .site-nav a[aria-current='page'] { color: var(--text); background: var(--panel-2); }
.site-nav a[aria-current='page'] { box-shadow: inset 0 -2px 0 var(--accent); }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 6px; width: 42px; height: 38px; padding: 9px; cursor: pointer; }
.nav-toggle span { display: block; height: 2px; background: var(--text); margin: 4px 0; }
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; background: var(--bg-2); border-bottom: 1px solid var(--line); padding: 8px 16px 16px; }
  .site-nav.open { display: flex; }
}

/* ads */
.ad-row { display: flex; justify-content: center; padding-top: 12px; }
.ad { display: flex; justify-content: center; align-items: center; margin: 16px auto; max-width: 100%; overflow: hidden; }
.ad-placeholder { border: 1px dashed #3a433d; border-radius: 6px; color: #5d675f; font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; background: rgba(255,255,255,0.015); }
.ad-headerDesktop.ad-placeholder { width: 728px; height: 90px; }
.ad-headerMobile.ad-placeholder { width: 320px; height: 50px; }
.ad-inContent.ad-placeholder, .ad-sidebar.ad-placeholder { width: 300px; height: 250px; }
.ad-native.ad-placeholder { width: 100%; height: 120px; }
.ad-native-row { margin-top: 40px; }
/* Reserve space for live ads so the page doesn't jump when they load. */
.ad-header { min-height: 50px; }
@media (min-width: 768px) { .ad-header { min-height: 90px; } }
.ad-inContent, .ad-sidebar { min-height: 250px; }
.only-desktop { display: none; }
@media (min-width: 768px) { .only-desktop { display: flex; } .only-mobile { display: none; } }

/* breadcrumbs */
.crumbs { font-size: 0.85rem; color: var(--muted); margin: 16px 0 8px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.crumbs span { margin: 0 4px; }
.crumbs [aria-current] { color: var(--text); margin: 0; }

/* hero */
.hero { padding: 32px 0 8px; }
.eyebrow { font-family: var(--font-head); text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.78rem; color: var(--accent); margin-bottom: 8px; }
.lede { font-size: 1.1rem; color: #cfd5cc; max-width: 70ch; }
.search { position: relative; max-width: 620px; margin: 24px 0; }
.search input { width: 100%; font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 14px 44px; }
.search::before { content: ''; position: absolute; left: 16px; top: 50%; width: 14px; height: 14px; border: 2px solid var(--muted); border-radius: 50%; transform: translateY(-60%); }
.search::after { content: ''; position: absolute; left: 29px; top: 55%; width: 7px; height: 2px; background: var(--muted); transform: rotate(45deg); }
.search input:focus { border-color: var(--accent); outline: none; }
.results { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px); list-style: none; margin: 0; padding: 6px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 20px 40px rgba(0,0,0,0.5); }
.results a { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 6px; color: var(--text); text-decoration: none; }
.results a:hover, .results a.active { background: #2a312c; }
.results small { color: var(--muted); white-space: nowrap; }
.results .empty { padding: 10px 12px; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; max-width: 620px; }
.stats div { background: var(--panel); padding: 14px 16px; }
.stats strong { display: block; font-family: var(--font-head); font-size: 1.6rem; color: var(--accent); line-height: 1; }
.stats span { font-size: 0.8rem; color: var(--muted); }
@media (max-width: 520px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* panels and cards */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 20px 0; }
.panel > h2:first-child, .panel .section-head h2 { margin-top: 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-top: 1.6em; }
.panel .section-head { margin-top: 0; }
.section-head h2 { margin: 0 0 0.5em; }
.grid { display: grid; gap: 16px; }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); margin-top: 24px; }
.grid.three { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.grid.chapters { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); align-items: start; }
.grid.chapters .chapter { margin: 0; }
@media (max-width: 420px) { .grid.chapters { grid-template-columns: 1fr; } }
.card { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s; }
a.card:hover { border-color: #4a554d; transform: translateY(-2px); color: var(--text); }
.card p { font-size: 0.93rem; }
.card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.mission-card h3 { margin-bottom: 2px; }
.mission-card .loc { color: var(--accent); font-size: 0.88rem; margin-bottom: 8px; }
.card-foot { font-size: 0.8rem; color: var(--muted); }
.link-card h3::after { content: ' →'; color: var(--accent); }

/* badges */
.threat { display: inline-block; font-family: var(--font-head); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; padding: 2px 8px; border-radius: 4px; border: 1px solid currentColor; }
.threat-low { color: var(--low); } .threat-medium { color: var(--medium); } .threat-high { color: var(--high); } .threat-critical { color: var(--critical); } .threat-extreme { color: var(--extreme); }
.dot.threat { padding: 0; width: 8px; height: 8px; border-radius: 50%; background: currentColor; margin-right: 8px; vertical-align: middle; }
.badge { display: inline-block; font-size: 0.72rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.badge-verified { background: rgba(111, 207, 127, 0.14); color: var(--low); }
.badge-early { background: rgba(242, 133, 58, 0.15); color: var(--high); }
.chip { display: inline-block; font-size: 0.85rem; padding: 3px 10px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); color: #cfd5cc; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.legend { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.callout { border-left: 3px solid var(--high); background: rgba(242, 133, 58, 0.08); padding: 12px 16px; border-radius: 0 8px 8px 0; color: #ead8c8; }

/* chapter lists */
.chapter-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.chapter-head h2, .chapter-head h3 { margin: 0; }
.chapter-head .muted { font-size: 0.82rem; }
.part { color: var(--accent); font-size: 0.8em; margin-left: 4px; }
.order-list { list-style: none; padding: 0; margin: 0; }
.order-item a { display: grid; grid-template-columns: 22px 1fr; column-gap: 10px; padding: 9px 8px; border-radius: 6px; color: var(--text); text-decoration: none; }
.order-item a:hover { background: var(--panel-2); }
.order-item .check { grid-row: span 2; width: 18px; height: 18px; margin-top: 3px; border: 2px solid #4a554d; border-radius: 4px; }
.order-item.done .check { background: var(--low); border-color: var(--low); box-shadow: inset 0 0 0 3px var(--panel); }
.order-item.done .oname { color: var(--muted); text-decoration: line-through; }
.order-item .oname { font-weight: 600; }
.order-item .obj { font-size: 0.82rem; line-height: 1.4; }
.order-item.is-story .check { border-color: var(--accent); border-radius: 50%; }
.order-item .tag { font-size: 0.75rem; color: var(--accent); text-transform: uppercase; letter-spacing: 0.08em; }

/* guide */
.guide-head { padding-top: 8px; }
.steps { list-style: none; padding: 0; margin: 0; counter-reset: s; }
.step { display: grid; grid-template-columns: 32px 1fr; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); margin-bottom: 12px; transition: opacity .2s; }
.step h3 { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.step p { margin: 0; color: #d3d9d0; }
.num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; background: var(--accent); color: var(--accent-ink); font-size: 0.85rem; flex: none; }
.step.done { opacity: 0.55; }
.step.done h3 { text-decoration: line-through; }
.step-check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.step-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.step-check .box { flex: none; width: 24px; height: 24px; border: 2px solid #4a554d; border-radius: 6px; margin-top: 1px; display: grid; place-items: center; }
.step-check input:checked + .box { background: var(--low); border-color: var(--low); }
.step-check input:checked + .box::after { content: ''; width: 6px; height: 11px; border: solid #0e100f; border-width: 0 3px 3px 0; transform: rotate(45deg) translate(-1px, -1px); }
.step-check input:focus-visible + .box { outline: 2px solid var(--accent); outline-offset: 2px; }
.obj-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.obj-list li.done span:last-child { color: var(--muted); text-decoration: line-through; }
.progress { font-family: var(--font-head); color: var(--accent); font-weight: 600; }
.progress.complete { color: var(--low); }
.reset { margin-top: 8px; background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 6px; padding: 6px 12px; font: inherit; font-size: 0.85rem; cursor: pointer; }
.reset:hover { color: var(--text); border-color: #4a554d; }
.plain-steps li { margin-bottom: 10px; }
.plain-steps li::marker { color: var(--accent); font-family: var(--font-head); font-weight: 700; }
.tips ul { margin: 0; }
.tips li { margin-bottom: 8px; }
.tips li::marker { color: var(--accent); }
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { padding: 6px 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; font-size: 0.92rem; }
.reward-list { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.reward-list li { padding: 6px 12px; border-radius: 6px; background: rgba(242, 182, 50, 0.1); border: 1px solid rgba(242, 182, 50, 0.3); color: #f6dc9b; font-size: 0.92rem; }
.note { font-size: 0.88rem; color: var(--muted); margin: 0; }
.quickstart .inline-steps { margin: 0 0 8px; }
.inline-steps li { margin-bottom: 4px; }

.prev-next { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 32px; }
.pn { display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--text); text-decoration: none; font-weight: 600; }
.pn:hover { border-color: #4a554d; color: var(--text); }
.pn small { display: block; color: var(--muted); font-weight: 400; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; }
.pn.next { text-align: right; }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); margin: 16px 0; }
table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-family: var(--font-head); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.75rem; color: var(--muted); background: var(--bg-2); }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255,255,255,0.02); }
@media (max-width: 640px) { th, td { padding: 10px; } table { min-width: 560px; } }

/* sidebar */
.sidebar { padding-top: 16px; }
.sidebar .ad { margin-top: 0; }
.side-block { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.side-block h2 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin: 0 0 8px; }
.side-block ul { list-style: none; padding: 0; margin: 0; }
.side-block a { display: block; padding: 6px 0; color: var(--text); text-decoration: none; font-size: 0.93rem; }
.side-block a:hover { color: var(--accent); }
@media (min-width: 1100px) { .sidebar > :first-child { position: sticky; top: 80px; } }
@media (max-width: 1099px) { .sidebar { display: none; } }

/* footer */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-2); padding: 32px 0; font-size: 0.88rem; }
.footer-inner nav { display: flex; flex-wrap: wrap; gap: 16px; }
.footer-inner nav a { color: var(--muted); text-decoration: none; }
.footer-inner nav a:hover { color: var(--text); }

/* Updated date, chapter notes, what's new */
.updated { font-size: 0.85rem; margin: -4px 0 12px; }
.chapter .note { font-size: 0.85rem; margin: 0 0 10px; }
.whats-new ul { margin: 0; padding-left: 1.2em; }
.whats-new li + li { margin-top: 6px; }
.whats-new h3 { font-size: 0.95rem; margin: 14px 0 6px; }
.whats-new p:last-child { margin: 14px 0 0; }
.patch { margin-top: 32px; }
.patch td:first-child { width: 9.5em; }
@media (max-width: 640px) {
  .patch table { min-width: 0; }
  .patch thead { display: none; }
  .patch tr, .patch td { display: block; width: auto; }
  .patch td:first-child { padding-bottom: 0; border-bottom: 0; color: var(--accent); }
}
