@font-face {
  font-family: Tektur;
  src: url("../assets/tektur.ttf") format("truetype");
  font-weight: 400 900;
  font-display: swap;
}

@font-face {
  font-family: "Exo 2";
  src: url("../assets/exo2.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ink: #faf3df;
  --muted: #b3c9c6;
  --dim: #7f9e9b;
  --accent: #ddfc72;
  --bio: #4ff4d8;
  --gold: #e6ca95;
  --brass: #b59a65;
  --danger: #ff6b6b;
  --warn: #ffbe5c;
  --ok: #78f27a;
  --glass: rgba(11, 34, 35, 0.78);
  --glass-strong: rgba(8, 26, 27, 0.94);
  --surface: #0a1d1e;
  --surface-deep: #051213;
  --background: #071617;
  --line: rgba(79, 130, 126, 0.36);
  --line-gold: rgba(230, 202, 149, 0.34);
  --display: Tektur, "Arial Narrow", sans-serif;
  --body: "Exo 2", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --header-h: 68px;
  --sidebar-w: 272px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.42);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scrollbar-color: #3a5f5c #051213; scrollbar-width: thin; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 82% -10%, rgba(79, 244, 216, 0.08), transparent 65%),
    radial-gradient(900px 500px at 10% 10%, rgba(230, 202, 149, 0.06), transparent 60%),
    var(--background);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.62;
  overflow-x: clip;
}

a { color: var(--bio); text-decoration: none; transition: color .18s, border-color .18s; }
a:hover { color: var(--accent); }
img { display: block; max-width: 100%; height: auto; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Header */
.w-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: var(--header-h);
  padding: 10px clamp(14px, 2.6vw, 32px);
  background: linear-gradient(100deg, rgba(5, 18, 19, 0.96) 20%, rgba(10, 40, 41, 0.94) 74%, rgba(7, 24, 25, 0.96));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.w-burger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(7, 24, 25, 0.85);
  color: var(--ink);
  font-size: 20px;
}

.w-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font: 750 15px/1.15 var(--display);
  text-transform: uppercase;
  white-space: nowrap;
}
.w-brand img { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-gold); }
.w-brand small {
  display: block;
  margin-top: 2px;
  color: var(--accent);
  font-family: var(--body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
}

.w-search {
  position: relative;
  flex: 1 1 320px;
  max-width: 480px;
  margin-left: auto;
}
.w-search input {
  width: 100%;
  height: 40px;
  padding: 0 42px 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(4, 15, 16, 0.92);
  color: var(--ink);
  font-size: 14px;
  transition: border-color .2s, box-shadow .2s;
}
.w-search input:focus {
  border-color: var(--bio);
  box-shadow: 0 0 0 3px rgba(79, 244, 216, 0.14);
  outline: none;
}
.w-search input::placeholder { color: var(--dim); }
.w-search-kbd {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid var(--line);
  color: var(--dim);
  font-size: 11px;
  font-family: var(--mono);
  pointer-events: none;
}

.w-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: 420px;
  overflow-y: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line-gold);
  background: var(--glass-strong);
  box-shadow: var(--shadow);
  padding: 6px;
  z-index: 60;
}
.w-search-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--ink);
}
.w-search-item:hover, .w-search-item.is-active {
  background: rgba(79, 244, 216, 0.12);
  color: var(--accent);
}
.w-search-item strong { font-weight: 600; font-size: 14px; }
.w-search-item span { display: block; font-size: 12px; color: var(--muted); }
.w-search-cat {
  flex: none;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(230, 202, 149, 0.14);
  color: var(--gold);
  font-size: 11px;
  font-weight: 600;
}
.w-search-empty { padding: 14px; text-align: center; color: var(--muted); font-size: 14px; }

.w-header-actions { display: flex; align-items: center; gap: 10px; }
.w-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 15px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(8, 27, 28, 0.88);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: background .18s, border-color .18s, color .18s;
}
.w-btn:hover { border-color: var(--gold); background: rgba(22, 52, 50, 0.92); color: #fff6dc; }
.w-btn--gold {
  border-color: #ddc692;
  background: linear-gradient(168deg, #f7e5b8 0%, #e4ca92 59%, #c3a068 100%);
  color: #161812;
  box-shadow: inset 0 1px rgba(255, 240, 199, 0.72), 0 3px 10px rgba(0, 0, 0, 0.38);
}
.w-btn--gold:hover { background: linear-gradient(168deg, #fff0c8, #efd79b 68%, #d1ac71); color: #161812; }

/* Shell layout */
.w-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  max-width: 1440px;
  margin-inline: auto;
  min-height: calc(100vh - var(--header-h));
}

.w-sidebar {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 20px 14px 32px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(6, 20, 21, 0.72), rgba(5, 16, 17, 0.45));
}

.w-nav-group { margin-bottom: 18px; }
.w-nav-label {
  padding: 0 10px 6px;
  color: var(--gold);
  font: 700 11px/1.2 var(--display);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.w-nav-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 11px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  margin-bottom: 2px;
}
.w-nav-link:hover { background: rgba(79, 244, 216, 0.08); color: var(--ink); }
.w-nav-link.is-active {
  background: linear-gradient(90deg, rgba(79, 244, 216, 0.16), rgba(221, 252, 114, 0.06));
  border-color: rgba(79, 244, 216, 0.35);
  color: var(--ink);
  font-weight: 650;
}
.w-nav-ico { width: 20px; height: 20px; border-radius: 5px; flex: none; object-fit: contain; }

.w-main {
  padding: clamp(22px, 3.2vw, 44px) clamp(18px, 4vw, 56px) 72px;
  min-width: 0;
}
.w-article { max-width: 980px; margin-inline: auto; }

/* Breadcrumbs & Headings */
.w-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--dim);
}
.w-crumbs a { color: var(--muted); }
.w-crumbs a:hover { color: var(--accent); }

.w-article h1 {
  margin: 0 0 16px;
  font: 760 clamp(28px, 3.6vw, 44px)/1.08 var(--display);
  letter-spacing: -0.02em;
  color: var(--ink);
}
.w-article h2 {
  margin: 34px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font: 700 clamp(20px, 2.3vw, 27px)/1.18 var(--display);
  color: var(--gold);
  scroll-margin-top: calc(var(--header-h) + 18px);
}
.w-article h3 {
  margin: 24px 0 10px;
  font: 680 19px/1.25 var(--display);
  color: var(--ink);
  scroll-margin-top: calc(var(--header-h) + 18px);
}
.w-article p { margin: 0 0 14px; color: #dbe9e6; }
.w-article ul, .w-article ol { margin: 0 0 16px; padding-left: 22px; color: #dbe9e6; }
.w-article li { margin-bottom: 6px; }
.w-article li strong { color: var(--ink); }
.w-article hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
.w-article code {
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(79, 244, 216, 0.11);
  border: 1px solid rgba(79, 244, 216, 0.22);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.9em;
}

/* Callouts */
.w-callout {
  margin: 18px 0;
  padding: 14px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  border-left: 4px solid var(--bio);
  background: linear-gradient(135deg, rgba(13, 41, 42, 0.85), rgba(7, 23, 24, 0.92));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.06);
}
.w-callout p:last-child { margin-bottom: 0; }
.w-callout--tip { border-left-color: var(--accent); }
.w-callout--warn { border-left-color: var(--warn); background: linear-gradient(135deg, rgba(46, 33, 14, 0.65), rgba(16, 20, 18, 0.9)); }
.w-callout--important { border-left-color: var(--gold); background: linear-gradient(135deg, rgba(36, 34, 18, 0.62), rgba(8, 24, 25, 0.92)); }
.w-callout-title {
  font: 700 13px/1.2 var(--display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
  color: var(--bio);
}
.w-callout--tip .w-callout-title { color: var(--accent); }
.w-callout--warn .w-callout-title { color: var(--warn); }
.w-callout--important .w-callout-title { color: var(--gold); }

/* Tables */
.w-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 16px 0 22px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(6, 21, 22, 0.84);
}
.w-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.w-table th {
  text-align: left;
  padding: 11px 13px;
  background: rgba(14, 44, 45, 0.88);
  color: var(--gold);
  font: 680 12px/1.25 var(--display);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.w-table td {
  padding: 10px 13px;
  border-bottom: 1px solid rgba(62, 96, 93, 0.25);
  vertical-align: top;
  color: #dcebe8;
}
.w-table tr:last-child td { border-bottom: 0; }
.w-table tr:hover td { background: rgba(79, 244, 216, 0.05); }

/* Hero & Home grid */
.w-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(24px, 3.6vw, 42px);
  border-radius: 16px;
  border: 1px solid var(--line-gold);
  background:
    radial-gradient(600px 300px at 90% 0%, rgba(79, 244, 216, 0.16), transparent 65%),
    linear-gradient(155deg, rgba(12, 42, 43, 0.92), rgba(5, 18, 19, 0.96));
  box-shadow: var(--shadow), inset 0 1px rgba(255, 243, 214, 0.14);
  margin-bottom: 26px;
}
.w-hero h1 { margin-bottom: 10px; }
.w-hero-lead { max-width: 64ch; font-size: 17px; color: #d6e8e4; margin-bottom: 20px; }

.w-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 18px;
}
.w-stat {
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(4, 15, 16, 0.72);
}
.w-stat strong { display: block; font: 760 22px/1.1 var(--display); color: var(--accent); }
.w-stat span { font-size: 12px; color: var(--muted); }

.w-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: 14px;
  margin: 18px 0 28px;
}
.w-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(165deg, rgba(12, 37, 38, 0.85), rgba(6, 20, 21, 0.92));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.06);
  color: var(--ink);
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.w-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.42), inset 0 1px rgba(230, 202, 149, 0.25);
  color: var(--ink);
}
.w-card-head { display: flex; align-items: center; gap: 11px; }
.w-card-ico { width: 34px; height: 34px; border-radius: 8px; object-fit: contain; flex: none; background: rgba(4, 15, 16, 0.65); padding: 4px; border: 1px solid var(--line); }
.w-card h3 { margin: 0; font: 700 17px/1.2 var(--display); color: var(--gold); }
.w-card p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.48; }

/* Pills, Badges, Filter bars */
.w-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 18px;
}
.w-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(7, 25, 26, 0.88);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  transition: all .16s;
}
.w-pill:hover { border-color: var(--bio); color: var(--ink); }
.w-pill.is-active {
  background: rgba(79, 244, 216, 0.18);
  border-color: var(--bio);
  color: var(--accent);
}
.w-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: rgba(12, 39, 40, 0.8);
  color: var(--ink);
  max-width: 100%;
  white-space: normal;
  line-height: 1.3;
}
.w-tag--animal { border-color: rgba(255, 160, 92, 0.45); color: #ffc694; background: rgba(66, 36, 16, 0.55); }
.w-tag--microbe { border-color: rgba(79, 244, 216, 0.45); color: #8afae5; background: rgba(12, 54, 48, 0.55); }
.w-tag--secret { border-color: rgba(210, 148, 255, 0.5); color: #e2b8ff; background: rgba(54, 20, 74, 0.58); }
.w-tag--danger { border-color: rgba(255, 107, 107, 0.5); color: #ff9e9e; background: rgba(68, 18, 22, 0.58); }
.w-tag--safe { border-color: rgba(120, 242, 122, 0.45); color: #9effa0; background: rgba(18, 56, 24, 0.55); }
.w-tag--gold { border-color: var(--line-gold); color: var(--gold); background: rgba(58, 46, 18, 0.55); }

/* Skills & Tissues cards */
.w-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.w-item-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 15px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(170deg, rgba(11, 34, 35, 0.84), rgba(5, 17, 18, 0.92));
}
.w-item-top { display: flex; align-items: center; gap: 11px; }
.w-skill-ico {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  border: 1px solid var(--line-gold);
  background: rgba(4, 14, 15, 0.8);
  object-fit: cover;
  flex: none;
}
.w-item-title { font: 700 16px/1.2 var(--display); color: var(--ink); }
.w-item-sub { font-size: 12px; color: var(--muted); }
.w-item-desc { font-size: 13.5px; color: #cde0dc; line-height: 1.5; margin: 0; }
.w-bonus-list { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.w-bonus {
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(79, 244, 216, 0.12);
  color: var(--bio);
  border: 1px solid rgba(79, 244, 216, 0.25);
}
.w-bonus--neg {
  background: rgba(255, 107, 107, 0.12);
  color: #ff9c9c;
  border-color: rgba(255, 107, 107, 0.26);
}

/* Evolution tree */
.w-evo-list { display: flex; flex-direction: column; gap: 12px; margin: 16px 0 28px; }
.w-evo-row {
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(7, 24, 25, 0.86);
}
.w-evo-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.w-evo-lvl {
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(230, 202, 149, 0.18);
  border: 1px solid var(--line-gold);
  color: var(--gold);
  font: 700 13px/1.2 var(--display);
}
.w-evo-theme { font: 700 15px/1.2 var(--display); color: var(--ink); letter-spacing: 0.04em; }
.w-evo-req { font-size: 12px; color: var(--muted); }
.w-evo-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.w-evo-opt {
  padding: 11px 13px;
  border-radius: 9px;
  border: 1px solid rgba(62, 96, 93, 0.4);
  background: rgba(5, 16, 17, 0.78);
}
.w-evo-opt strong { display: block; color: var(--accent); font: 700 15px/1.25 var(--display); margin-bottom: 4px; }
.w-evo-opt p { margin: 0; font-size: 13px; color: #cfe0dd; line-height: 1.45; }

/* Spoilers (2-level & quests) */
.w-spoiler-card {
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 1px solid rgba(210, 148, 255, 0.32);
  background: linear-gradient(155deg, rgba(22, 18, 36, 0.84), rgba(7, 21, 22, 0.94));
  margin-bottom: 12px;
}
.w-spoiler-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.w-spoiler-title { font: 700 17px/1.2 var(--display); color: #e8c7ff; }
.w-spoiler-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.w-spoiler-btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(210, 148, 255, 0.42);
  background: rgba(52, 24, 72, 0.5);
  color: #f0dcff;
  font-size: 13px;
  font-weight: 600;
}
.w-spoiler-btn:hover { background: rgba(78, 36, 108, 0.72); border-color: #e8c7ff; }
.w-spoiler-btn--exact {
  border-color: rgba(230, 202, 149, 0.45);
  background: rgba(58, 44, 18, 0.5);
  color: var(--gold);
}
.w-spoiler-btn--exact:hover { background: rgba(84, 64, 24, 0.72); border-color: var(--gold); }
.w-spoiler-box {
  margin-top: 10px;
  padding: 11px 13px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(4, 14, 15, 0.85);
  font-size: 14px;
  color: #dcebe8;
}

/* Interactive World Map */
.w-map-shell {
  margin: 18px 0 28px;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--line-gold);
  background: linear-gradient(165deg, rgba(10, 32, 33, 0.92), rgba(5, 16, 17, 0.96));
  box-shadow: var(--shadow);
}
.w-map-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.w-map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.95fr);
  gap: 18px;
  align-items: start;
}
.w-map-grid-wrap {
  overflow-x: auto;
  padding: 10px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(3, 12, 13, 0.9);
}
.w-map-grid {
  display: grid;
  gap: 5px;
  width: fit-content;
  margin-inline: auto;
}
.w-cell-empty { width: 64px; height: 58px; }
.w-cell {
  position: relative;
  width: 64px;
  height: 58px;
  padding: 4px;
  border-radius: 8px;
  border: 1px solid rgba(79, 130, 126, 0.45);
  background: rgba(12, 36, 37, 0.92);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  text-align: left;
  transition: transform .12s, border-color .15s, box-shadow .15s, opacity .15s;
}
.w-cell:hover { transform: scale(1.06); z-index: 3; border-color: var(--accent); }
.w-cell.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(221, 252, 114, 0.45);
  z-index: 4;
}
.w-cell.is-dim { opacity: 0.22; }
.w-cell--safe { background: rgba(15, 52, 34, 0.92); border-color: rgba(120, 242, 122, 0.55); }
.w-cell--portal { background: rgba(18, 42, 68, 0.94); border-color: rgba(79, 216, 255, 0.72); }
.w-cell--danger { background: rgba(58, 22, 22, 0.92); border-color: rgba(255, 107, 107, 0.58); }
.w-cell--gate { box-shadow: inset 0 0 0 1px rgba(255, 190, 92, 0.65); }
.w-cell-xy { font: 700 10px/1 var(--mono); color: var(--muted); }
.w-cell-bot {
  font-size: 10px;
  font-weight: 650;
  line-height: 1.1;
  color: var(--ink);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.w-cell-badges { display: flex; gap: 3px; align-items: center; }
.w-cell-vit {
  padding: 0 4px;
  border-radius: 4px;
  background: rgba(221, 252, 114, 0.2);
  color: var(--accent);
  font: 700 9.5px/1.3 var(--mono);
}
.w-cell-flag { font-size: 10px; line-height: 1; }

.w-cell-inspector {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(5, 17, 18, 0.92);
  overflow: hidden;
}
.w-cell-art {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #030e0f;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.w-cell-art img { width: 100%; height: 100%; object-fit: cover; }
.w-cell-art-badge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(4, 15, 16, 0.86);
  border: 1px solid var(--line-gold);
  font: 700 12px/1.2 var(--display);
  color: var(--gold);
}
.w-cell-body { padding: 14px 16px; }
.w-cell-body h3 { margin: 0 0 6px; font: 700 18px/1.2 var(--display); color: var(--ink); }
.w-cell-env {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0;
}
.w-env-box {
  padding: 7px 9px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(9, 28, 29, 0.85);
  text-align: center;
}
.w-env-box span { display: block; font-size: 11px; color: var(--muted); }
.w-env-box strong { font: 700 15px/1.2 var(--display); color: var(--ink); }
.w-env-box.is-hot strong { color: var(--danger); }
.w-cell-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.w-cell-desc { font-size: 13.5px; color: #cfe0dd; line-height: 1.5; margin: 0; }

/* Calculators (Metabolism & Degradation) */
.w-calc {
  margin: 18px 0 26px;
  padding: 20px;
  border-radius: 16px;
  border: 1px solid var(--line-gold);
  background: linear-gradient(160deg, rgba(12, 38, 39, 0.9), rgba(5, 17, 18, 0.96));
  box-shadow: var(--shadow);
}
.w-calc-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.w-calc-val { font: 760 22px/1 var(--display); color: var(--accent); }
.w-range {
  width: 100%;
  accent-color: var(--accent);
  height: 8px;
  cursor: pointer;
  margin-bottom: 16px;
}
.w-calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
}
.w-calc-card {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(4, 15, 16, 0.86);
}
.w-calc-card h4 { margin: 0 0 6px; font: 700 15px/1.2 var(--display); }
.w-calc-card p { margin: 0; font-size: 13px; color: #d4e6e2; line-height: 1.45; }

/* Bestiary Portraits & Demo Media */
.w-bot-cell { display: flex; align-items: center; gap: 11px; }
.w-bot-portrait {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  border: 1px solid var(--line-gold);
  background: radial-gradient(circle at 50% 45%, rgba(22, 72, 74, 0.9), rgba(4, 14, 15, 0.98));
  object-fit: cover;
  flex: none;
}
.w-vit-inline {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 650;
  color: var(--accent);
}
.w-vit-inline img { width: 22px; height: 22px; object-fit: contain; }

.w-demo {
  margin: 18px 0 22px;
  border-radius: 14px;
  border: 1px solid var(--line-gold);
  background: rgba(4, 14, 15, 0.92);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.w-demo img { width: 100%; max-height: 440px; object-fit: cover; background: #030e0f; }
.w-demo figcaption {
  padding: 10px 15px;
  font-size: 13.5px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: rgba(8, 25, 26, 0.88);
}
.w-demo figcaption strong { color: var(--gold); }

/* SVG diagram wrapper */
.w-svg-box {
  margin: 18px 0 24px;
  padding: 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(4, 15, 16, 0.9);
  overflow-x: auto;
}
.w-svg-box svg { display: block; width: 100%; max-width: 920px; height: auto; margin-inline: auto; }

/* Footer pager */
.w-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 44px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.w-pager a {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 13px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(8, 25, 26, 0.82);
  color: var(--ink);
}
.w-pager a:hover { border-color: var(--gold); background: rgba(15, 42, 43, 0.9); }
.w-pager a span { font-size: 12px; color: var(--dim); }
.w-pager a strong { font: 700 15px/1.2 var(--display); color: var(--gold); }
.w-pager-next { text-align: right; }

.w-footer {
  margin-top: 28px;
  font-size: 13px;
  color: var(--dim);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
}

/* Mobile Responsive */
.w-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 10, 11, 0.72);
  z-index: 45;
  backdrop-filter: blur(3px);
}

@media (max-width: 980px) {
  .w-burger { display: inline-flex; }
  .w-shell { grid-template-columns: 1fr; }
  .w-sidebar {
    position: fixed;
    top: var(--header-h);
    left: 0;
    bottom: 0;
    width: min(86vw, 310px);
    z-index: 50;
    transform: translateX(-105%);
    transition: transform .22s ease;
    background: #061819;
    box-shadow: var(--shadow);
  }
  .w-sidebar.is-open { transform: translateX(0); }
  .w-map-layout { grid-template-columns: 1fr; }
  .w-header-actions .w-btn:not(.w-btn--gold) { display: none; }
}

@media (max-width: 600px) {
  .w-header { gap: 10px; }
  .w-brand span { display: none; }
  .w-search-kbd { display: none; }
  .w-cell { width: 52px; height: 50px; }
  .w-cell-empty { width: 52px; height: 50px; }
  .w-pager { grid-template-columns: 1fr; }
  .w-pager-next { text-align: left; }
}
