/* ============================================================
   Subnautica 2 Guide — Premium Deep-Sea Design System
   Author: Senior Developer (高级开发工程师)
   ============================================================ */

/* ---------- Theme tokens ---------- */
:root {
  --bg-0: #04070d;
  --bg-1: #071019;
  --bg-2: #0b1825;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-strong: rgba(255, 255, 255, 0.07);
  --border: rgba(125, 211, 252, 0.14);
  --border-strong: rgba(125, 211, 252, 0.28);
  --text: #e6f1f5;
  --text-dim: #9fb3c0;
  --accent: #2de2e6;
  --accent-2: #57f2b0;
  --accent-3: #ff6b9d;
  --warn: #ffb454;
  --grad: linear-gradient(135deg, #2de2e6 0%, #57f2b0 100%);
  --grad-soft: linear-gradient(135deg, rgba(45,226,230,0.18), rgba(87,242,176,0.18));
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.7);
  --radius: 18px;
  --radius-sm: 12px;
  --maxw: 1180px;
  --nav-h: 68px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --font-display: "Sora", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;
}

:root[data-theme="light"] {
  --bg-0: #eaf3f7;
  --bg-1: #e1edf2;
  --bg-2: #d4e6ee;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: rgba(255, 255, 255, 0.9);
  --border: rgba(13, 60, 90, 0.14);
  --border-strong: rgba(13, 60, 90, 0.28);
  --text: #0a2233;
  --text-dim: #476577;
  --accent: #0aa3b0;
  --accent-2: #0e9b63;
  --accent-3: #d6336c;
  --warn: #c97a14;
  --grad: linear-gradient(135deg, #0aa3b0 0%, #0e9b63 100%);
  --grad-soft: linear-gradient(135deg, rgba(10,163,176,0.16), rgba(14,155,99,0.16));
  --shadow: 0 20px 50px -22px rgba(13, 60, 90, 0.35);
}

/* Reader mode — a warm, high-contrast "paper" palette for long-form reading.
   Independent of the global theme toggle; persisted separately. */
:root[data-reader="light"] {
  --bg-0: #f7f4ed;
  --bg-1: #f2ede2;
  --bg-2: #eae3d4;
  --surface: #fffdf8;
  --surface-strong: #fbf7ef;
  --border: rgba(60, 50, 30, 0.16);
  --border-strong: rgba(60, 50, 30, 0.3);
  --text: #23211c;
  --text-dim: #5d574b;
  --accent: #0e7490;
  --accent-2: #0f766e;
  --accent-3: #b45309;
  --warn: #b45309;
  --grad: linear-gradient(135deg, #0e7490 0%, #0f766e 100%);
  --grad-soft: linear-gradient(135deg, rgba(14,116,144,0.14), rgba(15,118,110,0.14));
  --shadow: 0 20px 50px -22px rgba(60, 50, 30, 0.3);
}

/* Reader-mode toggle button (long-form reading) */
.reader-toggle {
  display: inline-flex; align-items: center; gap: .45rem; margin-top: .9rem;
  padding: .5rem 1rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-dim);
  font-family: var(--font-body); font-size: .85rem; font-weight: 600;
  transition: all .25s var(--ease);
}
.reader-toggle:hover { color: var(--text); border-color: var(--accent); }
.reader-toggle.on { background: var(--grad-soft); color: var(--accent); border-color: var(--accent); }
.reader-toggle .reader-icon { font-size: 1rem; line-height: 1; }

/* Per-beat story spoilers */
.spoiler-banner { display: flex; align-items: center; gap: .6rem; padding: .8rem 1.1rem; border-radius: 12px;
  background: color-mix(in srgb, var(--warn) 12%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent);
  color: var(--text); font-size: .88rem; margin-bottom: 1.2rem; }
.story-timeline { display: flex; flex-direction: column; gap: .8rem; }
.spoiler.beat { margin: 0; }
.spoiler.beat > summary { align-items: center; gap: .8rem; padding: .9rem 1.1rem; transition: border-color .2s var(--ease); }
.spoiler.beat > summary:hover { border-color: var(--border-strong); }
.beat-when { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); flex: none; min-width: 84px; }
.beat-title { font-weight: 600; flex: 1; }
.beat-toggle { font-size: .8rem; color: var(--text-dim); flex: none; }
.spoiler.beat[open] > summary .beat-toggle::after { content: " ▴"; }
.spoiler.beat[open] > summary .beat-toggle { content: ""; }
.spoiler.beat .beat-body { padding: 0 1.1rem 1.1rem; color: var(--text); line-height: 1.7; font-size: .95rem; }

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg-0);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.5s var(--ease), color 0.5s var(--ease);
}
img, svg { display: block; max-width: 100%; }
a, button, .chip, .gallery-item, .theme-toggle, .nav-burger { -webkit-tap-highlight-color: transparent; }
.card, .item-card, .lead { overflow-wrap: break-word; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul { list-style: none; }

/* Ambient depth gradient + glow */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(1200px 700px at 80% -10%, rgba(45,226,230,0.10), transparent 60%),
    radial-gradient(900px 600px at 10% 110%, rgba(87,242,176,0.08), transparent 60%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0) 40%, var(--bg-2));
  transition: background 0.5s var(--ease);
}

/* ---------- Layout ---------- */
.container { width: min(100% - 2rem, var(--maxw)); margin-inline: auto; }
.section { padding: clamp(3.5rem, 8vw, 7rem) 0; }
.section-head { max-width: 720px; margin-bottom: 2.8rem; }
.section-head.center { margin-inline: auto; text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.78rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin-bottom: 0.9rem;
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: var(--accent); opacity: 0.7; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.12; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.8rem, 4vw, 2.7rem); }
h3 { font-size: 1.25rem; }
.lead { color: var(--text-dim); font-size: 1.05rem; margin-top: 0.9rem; }
.gradient-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Glass card ---------- */
.glass {
  background: var(--surface);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card {
  position: relative;
  padding: 1.6rem;
  border-radius: var(--radius);
  background: var(--surface);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.card:hover {
  transform: translateY(-6px);
  border-color: var(--border-strong);
  box-shadow: 0 28px 70px -24px rgba(45,226,230,0.35);
}
.card::after {
  content: "";
  position: absolute; inset: 0;
  background: var(--grad-soft);
  opacity: 0; transition: opacity 0.4s var(--ease);
  pointer-events: none;
}
.card:hover::after { opacity: 1; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  font-weight: 600; font-size: 0.95rem;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s var(--ease);
  will-change: transform;
}
.btn-primary { background: var(--grad); color: #021018; box-shadow: 0 12px 30px -10px rgba(45,226,230,0.6); }
.btn-primary:hover { box-shadow: 0 18px 44px -12px rgba(45,226,230,0.75); }
.btn-ghost { border: 1px solid var(--border-strong); color: var(--text); background: var(--surface); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn .arrow { transition: transform 0.3s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

/* ---------- Navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  display: flex; align-items: center;
  background: color-mix(in srgb, var(--bg-0) 72%, transparent);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border-bottom: 1px solid var(--border);
}
.nav .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: flex; align-items: center; gap: 0.6rem; min-width: 0; font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.brand .logo {
  width: 32px; height: 32px; border-radius: 9px; background: var(--grad);
  display: grid; place-items: center; color: #021018; font-size: 1.1rem;
  box-shadow: 0 8px 22px -8px rgba(45,226,230,0.7);
}
.nav-actions { display: flex; align-items: center; gap: 0.5rem; }

/* Nav grouped dropdowns */
.nav-groups { display: flex; align-items: center; gap: 0.2rem; }
.nav-group { position: relative; }
.nav-group-btn {
  padding: 0.5rem 0.85rem; border-radius: 999px; font-size: 0.92rem; font-weight: 500;
  color: var(--text-dim); display: inline-flex; align-items: center; gap: 0.25rem;
  background: none; border: 0; cursor: pointer; font-family: inherit;
  transition: color 0.25s, background 0.25s;
}
.nav-group-btn:hover, .nav-group.open .nav-group-btn, .nav-group-btn.active { color: var(--text); background: var(--surface); }
.nav-group-btn.active { color: var(--accent); }
.nav-group-btn .caret { font-size: 0.7rem; transition: transform 0.25s var(--ease); }
.nav-group.open .nav-group-btn .caret { transform: rotate(180deg); }
.nav-group-panel {
  position: absolute; top: calc(100% + 10px); left: 0; min-width: 200px;
  background: color-mix(in srgb, var(--bg-0) 92%, transparent);
  backdrop-filter: blur(18px) saturate(150%); -webkit-backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid var(--border); border-radius: 14px; padding: 0.5rem;
  display: none; flex-direction: column; gap: 0.15rem; box-shadow: var(--shadow); z-index: 60;
}
.nav-group.open .nav-group-panel { display: flex; }
.nav-group-panel a { padding: 0.6rem 0.85rem; border-radius: 10px; font-size: 0.92rem; color: var(--text-dim); }
.nav-group-panel a:hover { color: var(--text); background: var(--surface); }
.nav-group-panel a.active { color: var(--accent); background: var(--surface-strong); }

/* Standalone nav link (e.g. About) */
.nav-standalone {
  padding: 0.5rem 0.85rem; border-radius: 999px; font-size: 0.92rem; font-weight: 500;
  color: var(--text-dim); transition: color 0.25s, background 0.25s;
}
.nav-standalone:hover { color: var(--text); background: var(--surface); }
.nav-standalone.active { color: var(--accent); background: var(--surface-strong); }

/* Theme toggle */
.theme-toggle {
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--border); display: grid; place-items: center;
  color: var(--text-dim); transition: color 0.3s, border-color 0.3s, transform 0.4s var(--ease);
}
.theme-toggle:hover { color: var(--accent); border-color: var(--border-strong); transform: rotate(18deg); }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }

.nav-burger { display: none; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--border); place-items: center; color: var(--text); }
.nav-burger svg { width: 22px; height: 22px; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: clamp(4rem, 11vw, 9rem) 0 clamp(3rem, 7vw, 6rem); overflow: hidden; }
#bubbles { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.hero .container { position: relative; z-index: 1; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 0.9rem; border-radius: 999px; font-size: 0.8rem; font-weight: 600;
  background: var(--surface-strong); border: 1px solid var(--border); color: var(--accent);
  margin-bottom: 1.4rem;
}
.hero h1 { font-size: clamp(2.4rem, 7vw, 4.6rem); font-weight: 700; }
.hero p.lead { max-width: 640px; font-size: 1.15rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 2rem; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 2.2rem; margin-top: 3rem; }
.hero-stats .stat .num { font-family: var(--font-display); font-size: 2rem; font-weight: 700; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-stats .stat .lbl { color: var(--text-dim); font-size: 0.9rem; }

/* Feature grid on home */
.grid { display: grid; gap: 1.4rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.feature-link { display: block; }
.feature-link .ico {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  background: var(--grad-soft); border: 1px solid var(--border); font-size: 1.5rem; margin-bottom: 1rem;
}
.feature-link h3 { margin-bottom: 0.4rem; }
.feature-link p { color: var(--text-dim); font-size: 0.95rem; }

/* ---------- Section cards (data lists) ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 2rem; align-items: center; }
.chip {
  padding: 0.45rem 1rem; border-radius: 999px; font-size: 0.85rem; font-weight: 500;
  border: 1px solid var(--border); color: var(--text-dim); background: var(--surface);
  transition: all 0.25s var(--ease);
}
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip.active { background: var(--grad); color: #021018; border-color: transparent; font-weight: 600; }
/* Threat-coloured filter chips (match the 5-colour legend) */
.filter-group { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.5rem; }
.chip-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); font-weight: 700; margin-right: 0.1rem; }
.chip.th-safe { border-color: color-mix(in srgb, var(--accent-2) 45%, var(--border)); }
.chip.th-caution { border-color: color-mix(in srgb, var(--warn) 50%, var(--border)); }
.chip.th-danger { border-color: color-mix(in srgb, var(--accent-3) 55%, var(--border)); }
.chip.th-leviathan { border-color: color-mix(in srgb, var(--accent-3) 55%, var(--border)); background: color-mix(in srgb, var(--accent-3) 9%, transparent); }
.chip.th-info { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.chip.th-leviathan.active, .chip.th-danger.active, .chip.th-caution.active, .chip.th-safe.active, .chip.th-info.active { color: #021018; border-color: transparent; }
.search {
  flex: 1; min-width: 200px; display: flex; align-items: center; gap: 0.6rem;
  padding: 0.55rem 1rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--border);
}
.search input { flex: 1; min-width: 0; background: none; border: none; outline: none; color: var(--text); font-size: 1rem; }
.search input::placeholder { color: var(--text-dim); }

/* ---------- Biomes explorer (depth slider + resource/creature cross-filter) ---------- */
.explorer-controls { display: flex; flex-direction: column; gap: 1.1rem; margin-bottom: 2rem;
  padding: 1.1rem 1.2rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.depth-filter .df-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: .65rem; }
.df-readout { font-family: var(--font-display); font-weight: 600; color: var(--accent); font-size: .95rem; }
.df-sliders { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.df-lbl { display: flex; flex-direction: column; gap: .35rem; font-size: .72rem; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-dim); font-weight: 700; }
.df-lbl input[type="range"] { width: 100%; accent-color: var(--accent); cursor: pointer; }
.xc-group { display: flex; flex-direction: column; gap: .45rem; }
.xc-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); font-weight: 700; }
.xc-chips { display: flex; flex-wrap: wrap; gap: .35rem; max-height: 132px; overflow-y: auto; padding-right: 2px; }
.xc-chip { padding: .3rem .7rem; border-radius: 999px; font-size: .8rem; border: 1px solid var(--border);
  background: var(--surface-strong); color: var(--text-dim); transition: all .2s var(--ease); cursor: pointer; }
.xc-chip:hover { color: var(--text); border-color: var(--border-strong); }
.xc-chip.active { background: var(--grad); color: #021018; border-color: transparent; font-weight: 600; }
/* Biome cards react to cross-filter selection */
.item-card.hl { border-color: color-mix(in srgb, var(--accent) 60%, var(--border));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent), 0 18px 40px -22px color-mix(in srgb, var(--accent) 70%, transparent); }
.item-card.hl .thumb { border-color: color-mix(in srgb, var(--accent) 60%, var(--border)); }
.item-card.dim { opacity: .35; filter: saturate(.5); transition: opacity .25s var(--ease); }

.cards { display: grid; gap: 1.3rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.item-card { display: flex; flex-direction: column; gap: 0.7rem; }
.item-card .thumb {
  height: 132px; border-radius: var(--radius-sm); position: relative; overflow: hidden;
  display: grid; place-items: center; font-size: 2.6rem;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, var(--bg-2)), color-mix(in srgb, var(--accent-2) 18%, var(--bg-2)));
  border: 1px solid var(--border);
}
.item-card .th-name { position: absolute; bottom: 8px; left: 10px; right: 10px; font-size: 0.72rem; color: var(--text-dim); opacity: 0.85; }
.item-card h3 { font-size: 1.1rem; }
.item-card .meta { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: auto; }
.item-card p.desc { color: var(--text-dim); font-size: 0.9rem; }

/* Real in-game item icons (replace emoji placeholders in the item grids) */
.game-icon {
  width: 76px; height: 76px; object-fit: contain;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, .45));
  transition: transform .35s cubic-bezier(.16, 1, .3, 1);
  pointer-events: none;
}
.item-card:hover .game-icon { transform: scale(1.07) translateY(-2px); }
.card > .thumb .game-icon { width: 104px; height: 104px; }

/* Vehicles board: the depth caption (th-name) must stay small and anchored
   inside the thumb. Without this it inherits the 3.4rem icon font-size. */
.card > .thumb { position: relative; overflow: hidden; display: grid; place-items: center; }
.card > .thumb .th-name {
  position: absolute; bottom: 8px; left: 10px; right: 10px;
  font-size: 0.72rem; line-height: 1.25; color: var(--text-dim);
  opacity: 0.95; text-align: left;
}

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.2rem 0.6rem; border-radius: 999px; font-size: 0.72rem; font-weight: 600;
  border: 1px solid var(--border);
}
.badge.safe { color: var(--accent-2); border-color: color-mix(in srgb, var(--accent-2) 40%, transparent); }
.badge.caution { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.badge.danger { color: var(--accent-3); border-color: color-mix(in srgb, var(--accent-3) 45%, transparent); }
.badge.info { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.badge.leviathan { background: color-mix(in srgb, var(--accent-3) 18%, transparent); color: var(--accent-3); }

/* Detail list inside cards */
.spec { display: grid; grid-template-columns: auto 1fr; gap: 0.3rem 0.8rem; font-size: 0.85rem; margin-top: 0.2rem; }
.spec dt { color: var(--text-dim); }
.biome-advice { margin-top: 0.75rem; padding: 0.6rem 0.85rem; font-size: 0.85rem; line-height: 1.5; color: var(--text); background: color-mix(in srgb, var(--accent) 12%, transparent); border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; }
.spec dd { color: var(--text); }

/* Recipe ingredients */
.ings { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.4rem; }
.ing { font-size: 0.78rem; padding: 0.2rem 0.55rem; border-radius: 8px; background: var(--surface-strong); border: 1px solid var(--border); color: var(--text-dim); }
.rarity { font-size: 0.95rem; color: var(--warn); letter-spacing: 0.12em; margin-top: 0.1rem; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 3rem 0 2rem; margin-top: 3rem; }
.footer .container { display: grid; gap: 2rem; grid-template-columns: 1.5fr repeat(5, minmax(0, 1fr)); }
.footer h4 { font-size: 0.95rem; margin-bottom: 0.9rem; }
.footer a { color: var(--text-dim); font-size: 0.9rem; display: block; padding: 0.25rem 0; transition: color 0.25s; }
.footer a:hover { color: var(--accent); }
.footer .copy { grid-column: 1 / -1; border-top: 1px solid var(--border); padding-top: 1.4rem; color: var(--text-dim); font-size: 0.82rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.6rem; }
.note-tbd { font-size: 0.78rem; color: var(--warn); }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Mobile menu ---------- */
.mobile-menu {
  position: fixed; inset: var(--nav-h) 0 0 0; z-index: 49;
  background: color-mix(in srgb, var(--bg-0) 96%, transparent);
  backdrop-filter: blur(20px); padding: 1.5rem; display: none; flex-direction: column; gap: 0.4rem;
}
.mobile-menu a { padding: 0.9rem 1rem; border-radius: 12px; font-size: 1.05rem; color: var(--text); border: 1px solid var(--border); }
.mobile-menu a.active { color: var(--accent); border-color: var(--border-strong); }
.mobile-group-label {
  font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-dim); opacity: 0.65; font-weight: 700; margin: 0.7rem 0.2rem 0.25rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer .container { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .nav-groups { display: none; }
  .nav-burger { display: grid; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .footer .container { grid-template-columns: 1fr; }
  .hero-stats { gap: 1.4rem; }
  .mobile-menu.open { display: flex; }
}

/* ---------- Small phones ---------- */
@media (max-width: 560px) {
  .gallery { grid-template-columns: repeat(2, 1fr); gap: 0.7rem; }
  .gallery-item img { height: 150px; }
  .video-grid { grid-template-columns: 1fr; }
  .video-frame { aspect-ratio: 16 / 10; }
}
@media (max-width: 480px) {
  :root { --nav-h: 60px; }
  .section { padding: 3rem 0; }
  .card { padding: 1.25rem; }
  .hero { padding-top: clamp(3rem, 14vw, 5rem); }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { width: 100%; justify-content: center; }
  .toolbar { gap: 0.5rem; }
  .search { min-width: 0; width: 100%; }
  .section-head { margin-bottom: 2rem; }
  .mobile-menu a { font-size: 1.05rem; padding: 0.85rem 1rem; }
  .lb-close { top: 0.8rem; right: 0.8rem; width: 40px; height: 40px; font-size: 1.4rem; }
  .footer .copy { font-size: 0.78rem; }
}
@media (max-width: 380px) {
  .brand { font-size: 0.9rem; gap: 0.35rem; }
  .brand .logo { width: 28px; height: 28px; font-size: 1rem; }
}

.badge.extreme { color: #ff3b6b; border-color: color-mix(in srgb, #ff3b6b 50%, transparent); background: color-mix(in srgb, #ff3b6b 14%, transparent); }

/* Vertical timeline (Story page) */
.timeline { position: relative; margin-top: 1rem; padding-left: 1.7rem; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--accent), var(--accent-2)); opacity: 0.5; }
.timeline .tl-item { position: relative; padding: 0 0 1.6rem; }
.timeline .tl-item::before { content: ""; position: absolute; left: -1.7rem; top: 5px; width: 14px; height: 14px; border-radius: 50%; background: var(--grad); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.timeline .tl-item .when { font-size: 0.78rem; color: var(--accent); font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }
.timeline .tl-item h3 { font-size: 1.12rem; margin-top: 0.2rem; }
.timeline .tl-item p { color: var(--text-dim); font-size: 0.95rem; margin-top: 0.35rem; }
.lore-callout { border-left: 3px solid var(--accent); padding: 0.3rem 0 0.3rem 1rem; color: var(--text-dim); font-style: italic; }
.fact-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Media page ---------- */
.hero-media { min-height: 58vh; min-height: 58svh; }
.video-wrap { position: relative; max-width: 960px; margin: 0 auto; border-radius: 18px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.45); border: 1px solid var(--line); }
.video-wrap video { display: block; width: 100%; height: auto; background: #04141d; }
.gallery { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-top: 1.5rem; }
.gallery-item { position: relative; padding: 0; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; cursor: pointer; background: var(--surface); transition: transform .35s cubic-bezier(.16,1,.3,1), box-shadow .35s, border-color .35s; }
.gallery-item img { display: block; width: 100%; height: 220px; object-fit: cover; transition: transform .5s cubic-bezier(.16,1,.3,1); }
.gallery-item:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(0,0,0,.4); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.gallery-item:hover img { transform: scale(1.06); }
.gallery-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: .8rem 1rem; display: flex; flex-direction: column; gap: 2px; background: linear-gradient(to top, rgba(2,10,15,.92), rgba(2,10,15,0)); pointer-events: none; }
.gallery-cap strong { font-size: .98rem; color: #fff; }
.gallery-cap em { font-style: normal; font-size: .78rem; color: var(--accent); letter-spacing: .03em; }

/* YouTube video grid */
.video-grid { display: grid; gap: 1.3rem; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); margin-top: 1.5rem; }
.video-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; transition: transform .35s cubic-bezier(.16,1,.3,1), box-shadow .35s, border-color .35s; }
.video-card:hover { transform: translateY(-4px); box-shadow: 0 18px 44px rgba(0,0,0,.4); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.video-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #04141d; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-meta { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .45rem; }
.video-topic { align-self: flex-start; font-size: .7rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); padding: .2rem .55rem; border-radius: 999px; }
.video-meta h3 { font-family: var(--font-display); font-size: 1.05rem; line-height: 1.25; margin: 0; }
.video-desc { font-size: .88rem; color: var(--text-dim); margin: 0; line-height: 1.5; }
.video-sub { font-size: .76rem; color: var(--text-dim); opacity: .8; margin: .1rem 0 0; }
.video-link { font-size: .82rem; font-weight: 600; color: var(--accent); text-decoration: none; margin-top: .2rem; }
.video-link:hover { text-decoration: underline; }
.lightbox { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 4vw; background: rgba(2,8,12,.92); backdrop-filter: blur(8px); }
.lightbox.open { display: flex; animation: lbIn .25s ease; }
@keyframes lbIn { from { opacity: 0 } to { opacity: 1 } }
.lb-fig { margin: 0; max-width: 1100px; max-height: 90vh; max-height: 90svh; display: flex; flex-direction: column; gap: .8rem; }
.lb-fig img { max-width: 100%; max-height: 78vh; max-height: 78svh; border-radius: 14px; object-fit: contain; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.lb-fig figcaption { text-align: center; color: var(--text-dim); }
.lb-fig figcaption strong { color: #fff; font-size: 1.1rem; margin-right: .5rem; }
.lb-fig figcaption em { font-style: normal; color: var(--accent); }
.lb-fig figcaption p { margin-top: .3rem; font-size: .92rem; }
.lb-close { position: absolute; top: 1.4rem; right: 1.8rem; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255,255,255,.06); color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer; transition: background .2s, transform .2s; }
.lb-close:hover { background: rgba(255,255,255,.16); transform: rotate(90deg); }

/* ---------- Walkthrough & progression ---------- */
.chip-static {
  display: inline-block; font-size: .76rem; font-weight: 600; letter-spacing: .02em;
  padding: .28rem .7rem; border-radius: 999px;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}

/* Chapter timeline */
#walkthroughRoot { display: flex; flex-direction: column; gap: 1.4rem; margin-top: 1.4rem; }
.wf-chapter {
  position: relative; display: grid; grid-template-columns: 64px 1fr; gap: 1.2rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.6rem 1.8rem; transition: transform .4s var(--ease), border-color .35s, box-shadow .4s;
}
.wf-chapter:hover { transform: translateY(-3px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.wf-chapter[data-phase="Early Game"] { border-left: 3px solid var(--accent-2); }
.wf-chapter[data-phase="Mid Game"] { border-left: 3px solid var(--accent); }
.wf-chapter[data-phase="Late Game"] { border-left: 3px solid var(--warn); }
.wf-chapter[data-phase="Endgame"] { border-left: 3px solid var(--accent-3); }
.wf-num {
  display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%;
  font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: #021018;
  background: var(--grad); box-shadow: 0 10px 26px -10px rgba(45,226,230,.7);
}
.wf-tag { font-size: .76rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--accent-2); margin-bottom: .3rem; }
.wf-chapter h3 { font-family: var(--font-display); font-size: 1.35rem; line-height: 1.2; }
.wf-body .desc { color: var(--text-dim); margin: .5rem 0 1rem; font-size: .98rem; }
.wf-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.wf-cols h4 { font-size: .85rem; color: var(--text); margin-bottom: .5rem; letter-spacing: .02em; }
.wf-pois, .wf-objs { list-style: none; display: flex; flex-direction: column; gap: .55rem; }
.wf-pois li, .wf-objs li { position: relative; padding-left: 1.1rem; font-size: .9rem; color: var(--text-dim); line-height: 1.5; }
.wf-pois li::before, .wf-objs li::before { content: ""; position: absolute; left: 0; top: .55em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.wf-pois li strong { display: block; color: var(--text); font-size: .92rem; margin-bottom: .05rem; }
.wf-unlocks { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.wf-unlock-label { font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); margin-right: .2rem; }

/* Biome unlock order cards */
.wf-phase { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1.2rem 1.4rem; }
.wf-phase-tag { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); background: color-mix(in srgb, var(--accent) 13%, transparent); padding: .25rem .6rem; border-radius: 999px; margin-bottom: .6rem; }
.wf-phase p { color: var(--text-dim); font-size: .92rem; line-height: 1.55; }

/* Vehicle progression cards */
.wf-veh { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1.3rem 1.5rem; transition: transform .35s var(--ease), border-color .35s; }
.wf-veh:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.wf-veh-step { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-2); margin-bottom: .35rem; }
.wf-veh h4 { font-family: var(--font-display); font-size: 1.1rem; }
.wf-veh .desc { color: var(--text-dim); font-size: .9rem; margin: .4rem 0 .8rem; }
.wf-recipe { font-size: .85rem; font-weight: 500; color: var(--text); background: color-mix(in srgb, var(--accent) 8%, transparent); border: 1px dashed color-mix(in srgb, var(--accent) 40%, transparent); border-radius: 10px; padding: .6rem .8rem; line-height: 1.5; }

@media (max-width: 720px) {
  .wf-chapter { grid-template-columns: 1fr; gap: .9rem; }
  .wf-num { width: 46px; height: 46px; font-size: 1.2rem; }
  .wf-cols { grid-template-columns: 1fr; }
}

/* Recipe source attribution (fully traceable) */
.item-card .src-link,
.wf-veh .src-link {
  display: inline-flex; align-items: center; gap: .3em;
  margin-top: .7rem; font-size: .76rem; font-weight: 600;
  color: var(--accent, #46e6c8); text-decoration: none;
  border: 1px solid color-mix(in srgb, var(--accent, #46e6c8) 35%, transparent);
  padding: .25rem .55rem; border-radius: 999px;
  background: color-mix(in srgb, var(--accent, #46e6c8) 10%, transparent);
  transition: background .2s ease, transform .2s ease;
}
.item-card .src-link:hover,
.wf-veh .src-link:hover { background: color-mix(in srgb, var(--accent, #46e6c8) 22%, transparent); transform: translateY(-1px); }
.item-card .src-note,
.wf-veh .src-note {
  display: block; margin-top: .7rem; font-size: .74rem; font-style: italic;
  color: var(--muted, #9fb0c3); opacity: .85;
}

/* ============================================================
   EXPERIENCE LAYER — PDA-assistant enhancements
   ============================================================ */

/* Small button */
.btn-sm { padding: .5rem 1rem; font-size: .85rem; }

/* ---------- Global fuzzy search ---------- */
.global-search {
  display: flex; align-items: center; gap: .5rem;
  padding: .4rem .8rem; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  max-width: 240px; flex: 0 1 240px; color: var(--text-dim);
  transition: border-color .25s, box-shadow .25s;
}
.global-search:focus-within { border-color: var(--border-strong); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.global-search svg { flex: none; }
.global-search input { flex: 1; min-width: 0; background: none; border: none; outline: none; color: var(--text); font-size: .9rem; }
.global-search input::placeholder { color: var(--text-dim); }
.global-search.mobile { max-width: none; flex: 1 1 auto; width: 100%; margin-bottom: .8rem; }

.search-results {
  position: absolute; top: var(--nav-h); right: 1rem; width: min(400px, 92vw);
  max-height: 72vh; overflow-y: auto;
  background: color-mix(in srgb, var(--bg-0) 94%, transparent);
  backdrop-filter: blur(20px) saturate(150%); -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid var(--border); border-radius: 16px; padding: .5rem;
  display: none; flex-direction: column; gap: .15rem; box-shadow: var(--shadow); z-index: 60;
}
.search-results.open { display: flex; }
.search-hit { display: flex; flex-direction: column; gap: .1rem; padding: .6rem .8rem; border-radius: 10px; transition: background .2s; }
.search-hit:hover { background: var(--surface-strong); }
.search-hit.hit-alias { background: color-mix(in srgb, var(--accent-2) 10%, transparent); border-left: 3px solid var(--accent-2); }
.search-kind { font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.search-name { font-weight: 600; font-size: .95rem; color: var(--text); }
.search-desc { font-size: .78rem; color: var(--text-dim); line-height: 1.4; }
.search-empty { padding: .8rem; color: var(--text-dim); font-size: .9rem; }

/* ---------- Creature scan progress + threat legend ---------- */
.scan-progress { margin-bottom: 1.6rem; }
.scan-bar { height: 10px; border-radius: 999px; background: var(--surface-strong); border: 1px solid var(--border); overflow: hidden; }
.scan-fill { height: 100%; background: var(--grad); width: 0; transition: width .6s var(--ease); }
.scan-meta { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .6rem; color: var(--text-dim); font-size: .9rem; }
.scan-meta strong { color: var(--text); }
.scan-btn {
  margin-top: .6rem; align-self: flex-start; padding: .4rem .9rem; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-dim);
  font-size: .82rem; font-weight: 600; transition: all .25s var(--ease);
}
.scan-btn:hover { color: var(--accent); border-color: var(--accent); }
.scan-btn.on { background: color-mix(in srgb, var(--accent-2) 18%, transparent); border-color: color-mix(in srgb, var(--accent-2) 50%, transparent); color: var(--accent-2); }

.threat-legend { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: 1.6rem; }
.legend-title { font-size: .76rem; text-transform: uppercase; letter-spacing: .12em; color: var(--text-dim); margin-right: .3rem; }

.drops { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .2rem; }
.drops-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); }
.renew-note { font-size: .72rem; color: var(--text-dim); margin-left: .3rem; }

/* ---------- Beginner phased route ---------- */
.phase-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.3rem; margin-top: 1rem; }
.phase-col { display: flex; flex-direction: column; }
.phase-head { display: flex; align-items: center; gap: .7rem; margin-bottom: 1rem; }
.phase-head h3 { font-size: 1.12rem; }
.phase-head p { margin-top: .15rem; font-size: .85rem; }
.phase-badge { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; background: var(--grad-soft); border: 1px solid var(--border); flex: none; }
.phase-badge.day { background: color-mix(in srgb, var(--warn) 16%, transparent); }
.phase-badge.week { background: color-mix(in srgb, var(--accent-3) 16%, transparent); }

/* Death causes */
.death-card { padding: 1.4rem; border-left: 3px solid var(--border); }
.death-card.badge-caution { border-left-color: var(--warn); }
.death-card.badge-danger { border-left-color: var(--accent-3); }
.death-card.badge-leviathan { border-left-color: var(--accent-3); background: color-mix(in srgb, var(--accent-3) 8%, transparent); }
.death-card.badge-info { border-left-color: var(--accent); }
.death-icon { font-size: 1.8rem; margin-bottom: .4rem; }
.death-card h4 { font-size: 1.02rem; margin-bottom: .3rem; }

/* ---------- Adaptations gene tree ---------- */
.gene-tree { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.4rem; }
.gene-branch { display: flex; flex-direction: column; gap: .6rem; }
.gene-root { align-self: flex-start; padding: .6rem 1rem; border-radius: 14px; border: 1px solid var(--border-strong); background: var(--surface-strong); }
.gene-root.leviathan { border-color: color-mix(in srgb, var(--accent-3) 50%, transparent); }
.gene-root-label { display: block; font-family: var(--font-display); font-weight: 600; font-size: 1rem; }
.gene-root-sub { font-size: .78rem; color: var(--text-dim); }
.gene-kids { display: flex; flex-direction: column; gap: .5rem; padding-left: 1rem; border-left: 2px dashed var(--border); }
.gene-node { display: flex; flex-direction: column; gap: .1rem; padding: .7rem .9rem; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); transition: all .3s var(--ease); }
.gene-node:hover { transform: translateX(4px); border-color: var(--border-strong); }
.gene-node-icon { font-size: 1.3rem; }
.gene-node-name { font-weight: 600; font-size: .95rem; }
.gene-node-how { font-size: .78rem; color: var(--text-dim); }

/* ---------- Vehicle compare + Base planner + Co-op tables ---------- */
.cmp-checks, .plan-checks { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.cmp-check, .plan-check { display: inline-flex; align-items: center; gap: .45rem; padding: .4rem .85rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: .88rem; cursor: pointer; transition: border-color .2s, color .2s; }
.cmp-check:hover, .plan-check:hover { border-color: var(--border-strong); color: var(--text); }
.cmp-check input, .plan-check input { accent-color: var(--accent); }
.table-wrap { overflow-x: auto; margin-top: 1rem; -webkit-overflow-scrolling: touch; }
.cmp-table, .coop-table { width: 100%; border-collapse: collapse; min-width: 440px; }
.cmp-table th, .cmp-table td, .coop-table th, .coop-table td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--border); font-size: .9rem; vertical-align: top; }
.cmp-table thead th, .coop-table thead th { color: var(--accent); font-family: var(--font-display); font-size: .95rem; }
.cmp-spec { color: var(--text-dim); font-weight: 600; white-space: nowrap; }
.plan-list { display: flex; flex-direction: column; gap: .8rem; margin-top: 1rem; }
.plan-list li { display: flex; gap: .8rem; align-items: flex-start; padding: .8rem 1rem; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.plan-icon { font-size: 1.4rem; flex: none; }

/* ---------- Vehicle VS compare cards ---------- */
.vs-grid { display: flex; flex-wrap: wrap; align-items: stretch; gap: 0; margin-top: 1.1rem; }
.vs-card { flex: 1 1 260px; min-width: 240px; padding: 1.1rem 1.2rem; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); }
.vs-divider { display: flex; align-items: center; justify-content: center; padding: 0 1rem; font-family: var(--font-display); font-weight: 700; color: var(--accent); font-size: 1.1rem; }
.vs-head { display: flex; align-items: center; gap: .7rem; margin-bottom: .9rem; }
.vs-icon { font-size: 2rem; line-height: 1; }
.vs-head h4 { font-family: var(--font-display); font-size: 1.15rem; margin: 0; }
.vs-head .badge { font-size: .7rem; padding: .12rem .55rem; }
.vs-specs { display: flex; flex-direction: column; gap: .55rem; }
.vs-spec { display: grid; grid-template-columns: 7.5rem 1fr; gap: .6rem; align-items: center; font-size: .86rem; }
.vs-label { color: var(--text-dim); font-weight: 600; }
.vs-val { color: var(--text); }
.vs-sub { color: var(--text-dim); font-weight: 400; font-size: .78rem; }
.vs-spec-bar .vs-bar { height: 7px; border-radius: 999px; background: var(--surface-strong); overflow: hidden; }
.vs-spec-bar .vs-fill { display: block; height: 100%; border-radius: 999px; background: var(--grad); transition: width .5s var(--ease); }
.vs-verdict { margin-top: .9rem; padding-top: .8rem; border-top: 1px solid var(--border); font-size: .82rem; color: var(--text-dim); line-height: 1.5; }

/* ---------- Build calculator ---------- */
.calc-banner { margin: 1rem 0 1.2rem; padding: .8rem 1rem; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--warn) 12%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); font-size: .82rem; color: var(--text); line-height: 1.55; }
.calc-banner strong { color: var(--warn); }
.calc-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 1.4rem; }
.calc-steppers { display: flex; flex-direction: column; gap: .55rem; }
.calc-step { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .5rem .8rem; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.calc-step-label { font-size: .88rem; }
.stepper { display: inline-flex; align-items: center; gap: .5rem; }
.step-btn { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface-strong); color: var(--text); font-size: 1.1rem; line-height: 1; cursor: pointer; transition: all .15s var(--ease); }
.step-btn:hover { border-color: var(--accent); color: var(--accent); }
.step-val { min-width: 1.6rem; text-align: center; font-weight: 700; font-family: var(--font-display); }
.calc-rates-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin-bottom: .6rem; font-size: .85rem; color: var(--text-dim); font-weight: 600; flex-wrap: wrap; }
.calc-rates-actions { display: flex; gap: .5rem; }
.rate-row { display: grid; grid-template-columns: 9.5rem repeat(8, 1fr); gap: .3rem; align-items: center; padding: .28rem 0; }
.rate-head { position: sticky; top: 0; font-size: .72rem; color: var(--text-dim); font-weight: 700; border-bottom: 1px solid var(--border); padding-bottom: .4rem; }
.rate-piece { font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rate-res { font-size: .72rem; color: var(--text-dim); text-align: center; }
.rate-cell { width: 100%; min-width: 42px; padding: .3rem .25rem; border-radius: 7px; border: 1px solid var(--border); background: var(--bg-1); color: var(--text); font-size: .8rem; text-align: center; }
.rate-cell:focus { outline: none; border-color: var(--accent); }
.calc-tally { margin-top: 1.4rem; }
.calc-tally-head { font-family: var(--font-display); font-size: 1.05rem; margin-bottom: .7rem; }
.calc-tally-grid { display: flex; flex-wrap: wrap; gap: .6rem; }
.tally-chip { display: inline-flex; align-items: center; gap: .5rem; padding: .5rem .9rem; border-radius: 999px; background: var(--grad-soft); border: 1px solid var(--border-strong); }
.tally-res { font-weight: 600; font-size: .88rem; }
.tally-qty { color: var(--accent-2); font-weight: 700; font-family: var(--font-display); }
.calc-empty { font-size: .88rem; color: var(--text-dim); }
.calc-hint { margin: .4rem 0 1.1rem; font-size: .82rem; color: var(--text-dim); }
.calc-hint summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: .84rem; }
.calc-hint summary:hover { text-decoration: underline; }
.calc-hint ul { margin: .55rem 0; padding-left: 1.15rem; display: grid; gap: .35rem; }
.calc-hint p { margin: .45rem 0; line-height: 1.55; }
.calc-status { margin: 0 0 .4rem; font-size: .82rem; color: var(--accent-2); min-height: 1.1rem; font-weight: 600; }

/* ---------- Crafting dependency tech tree ---------- */
.tech-tree { display: block; }
.tt-desktop { overflow-x: auto; padding-bottom: .5rem; -webkit-overflow-scrolling: touch; }
.tt-canvas { position: relative; min-width: 100%; }
.tt-wires { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; overflow: visible; }
.tt-wires path { fill: none; stroke: var(--border-strong); stroke-width: 2; opacity: .65; }
.tt-node {
  position: absolute; z-index: 2; box-sizing: border-box;
  display: flex; align-items: center; gap: .55rem; padding: .5rem .7rem;
  border-radius: 12px; background: var(--surface); border: 1px solid var(--border);
  text-decoration: none; color: var(--text);
  transition: transform .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.tt-node:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 8px 22px rgba(0,0,0,.35); z-index: 5; }
.tt-icon { font-size: 1.4rem; flex: none; line-height: 1; }
.tt-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.tt-name { font-weight: 600; font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-station { font-size: .7rem; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-hint { margin-top: .8rem; color: var(--text-dim); font-size: .82rem; }
.tt-mobile { display: none; }
.tt-tier { margin-bottom: 1.2rem; }
.tt-tier-label { font-family: var(--font-display); font-weight: 600; font-size: .92rem; color: var(--accent); margin-bottom: .6rem; }
.tt-card { padding: .8rem 1rem; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); margin-bottom: .6rem; }
.tt-card-head { display: flex; align-items: center; gap: .6rem; }
.tt-card-head .tt-icon { font-size: 1.3rem; }
.tt-card-head .tt-name { font-weight: 600; font-size: .95rem; flex: 1; min-width: 0; }
.tt-card-head .tt-station { font-size: .74rem; color: var(--text-dim); flex: none; }
.tt-builds { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin-top: .55rem; font-size: .8rem; color: var(--text-dim); }
.tt-req { display: inline-flex; align-items: center; gap: .25rem; padding: .15rem .55rem; border-radius: 999px; background: var(--grad-soft); border: 1px solid var(--border-strong); color: var(--text); text-decoration: none; font-size: .78rem; transition: border-color .2s var(--ease); }
.tt-req:hover { border-color: var(--accent); }
.tt-arrow { color: var(--text-dim); }
.tt-base { font-style: italic; }
@media (max-width: 720px) {
  .tt-desktop { display: none; }
  .tt-mobile { display: block; }
}

/* ---------- Resources respawn mechanics ---------- */
.respawn-note { display: block; }
.rn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.rn-col { padding: 1.2rem 1.4rem; border-radius: 16px; border: 1px solid var(--border); }
.rn-renew { background: color-mix(in srgb, var(--accent-2) 8%, transparent); border-color: color-mix(in srgb, var(--accent-2) 35%, transparent); }
.rn-finite { background: color-mix(in srgb, var(--warn) 9%, transparent); border-color: color-mix(in srgb, var(--warn) 38%, transparent); }
.rn-head { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; margin-bottom: .6rem; }
.rn-blurb { font-size: .9rem; color: var(--text-dim); line-height: 1.55; margin: 0; }
.rn-blurb strong { color: var(--text); }
.rn-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .55rem; }
.rn-list li { display: flex; align-items: baseline; gap: .5rem; font-size: .9rem; }
.rn-icon { flex: none; font-size: 1.1rem; }
.rn-name { font-weight: 600; }
.rn-note { color: var(--text-dim); font-size: .8rem; margin-left: auto; text-align: right; }
.rn-empty { color: var(--text-dim); }
.rn-foot { margin-top: 1.1rem; font-size: .85rem; color: var(--text-dim); line-height: 1.55; }
.rn-foot strong { color: var(--text); }
@media (max-width: 720px) { .rn-grid { grid-template-columns: 1fr; } .rn-note { margin-left: 0; text-align: left; } }

/* ---------- Story spoilers ---------- */
.spoiler { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: .2rem; margin: 1.5rem 0; }
.spoiler > summary { cursor: pointer; list-style: none; padding: 1rem 1.2rem; font-family: var(--font-display); font-weight: 600; display: flex; align-items: center; gap: .6rem; }
.spoiler > summary::-webkit-details-marker { display: none; }
.spoiler-warn { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--warn); background: color-mix(in srgb, var(--warn) 16%, transparent); padding: .2rem .6rem; border-radius: 999px; }
.spoiler[open] > summary { border-bottom: 1px solid var(--border); margin-bottom: 1rem; }
.spoiler .timeline { padding-left: 2.4rem; }

/* ---------- Interactive depth map ---------- */
.map-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; }
.map-layers { display: flex; flex-wrap: wrap; gap: .5rem; }
.map-layer { padding: .45rem 1rem; border-radius: 999px; border: 1px solid var(--border); color: var(--text-dim); font-size: .85rem; font-weight: 500; background: var(--surface); transition: all .25s var(--ease); }
.map-layer:hover { color: var(--text); }
.map-layer.active { background: var(--grad); color: #021018; border-color: transparent; font-weight: 600; }
.map-hint { color: var(--text-dim); font-size: .85rem; flex: 1; min-width: 200px; text-align: right; }
.map-legend { margin: 0 0 1.4rem; color: var(--text-dim); font-size: .88rem; max-width: 72ch; line-height: 1.55; }

.map-column {
  display: flex; flex-direction: column; gap: 1rem;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 6%, transparent), color-mix(in srgb, var(--accent-3) 11%, transparent));
  border-radius: var(--radius); border: 1px solid var(--border); padding: 1.1rem;
}
.map-zone-sec {
  display: grid; grid-template-columns: 150px 1fr; gap: 1rem; align-items: start;
}
.map-zone-sec + .map-zone-sec { border-top: 1px dashed color-mix(in srgb, var(--border) 60%, transparent); padding-top: 1rem; }
.zone-aside { display: flex; flex-direction: column; gap: .12rem; padding: .6rem .7rem; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.zone-name { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; letter-spacing: .02em; }
.zone-depth { font-size: .74rem; color: var(--text-dim); }
.zone-nodes { display: flex; flex-wrap: wrap; gap: .6rem; min-width: 0; }

.map-chip {
  display: inline-flex; align-items: center; gap: .55rem; padding: .5rem .72rem; min-width: 168px;
  border-radius: 12px; background: var(--surface-strong); border: 1px solid var(--border);
  text-decoration: none; color: var(--text);
  transition: transform .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.map-chip:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: 0 12px 28px -18px rgba(0,0,0,.55); z-index: 5; }
.mc-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-dim); flex: none; }
.map-chip.safe .mc-dot { background: var(--accent-2); }
.map-chip.caution .mc-dot { background: var(--warn); }
.map-chip.danger .mc-dot { background: var(--accent-3); }
.map-chip.leviathan .mc-dot { background: var(--accent-3); }
.map-chip.landmark .mc-dot { background: var(--accent); }
.map-chip.res .mc-dot { background: var(--accent-2); }
.mc-body { display: flex; flex-direction: column; gap: .12rem; min-width: 0; }
.mc-name { font-weight: 600; font-size: .9rem; line-height: 1.2; }
.mc-meta { font-size: .72rem; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-chip.safe { border-left: 4px solid var(--accent-2); }
.map-chip.caution { border-left: 4px solid var(--warn); }
.map-chip.danger { border-left: 4px solid var(--accent-3); }
.map-chip.leviathan { border-left: 4px solid var(--accent-3); background: color-mix(in srgb, var(--accent-3) 13%, transparent); }
.map-chip.landmark { border-left: 4px solid var(--accent); }
.map-chip.res { border-left: 4px solid var(--accent-2); }

/* per-zone accent on the aside */
.map-zone-sec.z-shallows .zone-aside { border-left: 3px solid var(--accent-2); }
.map-zone-sec.z-mid .zone-aside { border-left: 3px solid var(--accent); }
.map-zone-sec.z-deep .zone-aside { border-left: 3px solid var(--accent-3); }
.map-zone-sec.z-abyss .zone-aside { border-left: 3px solid var(--warn); }

/* hover tooltips */
.map-chip[data-tip] { cursor: help; position: relative; }
.map-chip[data-tip]:hover::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 9px); left: 50%; transform: translateX(-50%);
  width: max-content; max-width: 280px; padding: .5rem .7rem; border-radius: 10px;
  background: var(--surface-strong); border: 1px solid var(--border-strong); color: var(--text);
  font-size: .78rem; line-height: 1.45; white-space: normal; text-align: left; z-index: 30;
  box-shadow: 0 8px 26px rgba(0,0,0,.4);
}
.map-chip[data-tip]:hover::before {
  content: ""; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
  border: 6px solid transparent; border-bottom-color: var(--border-strong); z-index: 30;
}
.map-empty { color: var(--text-dim); padding: 1rem; }

/* ---------- Experience-layer responsive ---------- */
@media (max-width: 920px) {
  .nav .global-search:not(.mobile) { display: none; }
}
@media (max-width: 720px) {
  .phase-grid { grid-template-columns: 1fr; }
  .map-hint { text-align: left; }
  .calc-grid { grid-template-columns: 1fr; }
  .vs-grid { flex-direction: column; }
  .vs-divider { padding: .6rem 0; }
}
@media (max-width: 480px) {
  .search-results { right: .5rem; left: .5rem; width: auto; }
  .map-zone-sec { grid-template-columns: 1fr; }
  .zone-aside { position: static; flex-direction: row; align-items: baseline; gap: .6rem; }
  .map-chip { min-width: 0; flex: 1 1 46%; }
}

/* >>> SEO/STATIC PATCH v1 */
.page-title { font-size: clamp(2rem, 5vw, 3rem); font-weight: 700; line-height: 1.06; margin: 0 0 .5rem; letter-spacing: -0.02em; }
.section-head .page-title + .eyebrow { margin-top: .2rem; }
.static-ref { margin: 1.6rem 0 2.4rem; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); padding: .4rem .2rem; }
.static-ref > summary { cursor: pointer; padding: .9rem 1.1rem; font-weight: 600; color: var(--text-dim); font-size: .95rem; list-style: none; }
.static-ref > summary::-webkit-details-marker { display: none; }
.static-ref > summary::before { content: "▸ "; color: var(--accent); }
.static-ref[open] > summary::before { content: "▾ "; }
.ref-table-wrap { overflow-x: auto; padding: 0 .8rem 1rem; }
.ref-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.ref-table th, .ref-table td { text-align: left; padding: .55rem .7rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.ref-table thead th { color: var(--accent); font-family: var(--font-display); }
.ref-list { margin: 0; padding: 0 1.2rem 1.1rem 2.4rem; columns: 2; column-gap: 2rem; }
.ref-list li { padding: .25rem 0; color: var(--text-dim); break-inside: avoid; }
@media (max-width: 600px) { .ref-list { columns: 1; } }


/* WEB:enrich-patch — sourced-content meta lines on creature/biome cards */
.cre-meta { font-size: .82rem; opacity: .82; margin: .4rem 0 0; line-height: 1.35; }
.cre-meta em { opacity: .8; font-style: italic; }

/* >>> ENRICH/STATIC PATCH v1 */
.ref-note { font-size: .76rem; color: var(--text-dim); opacity: .75; padding: .4rem 1.1rem .9rem; margin: 0; font-style: italic; }

