:root {
  --bg: #080c11;
  --bg2: #0b1118;
  --panel: #0e1720;
  --panel2: #111d28;
  --line: rgba(125, 211, 252, 0.13);
  --line-strong: rgba(125, 211, 252, 0.26);
  --text: #dbe7f3;
  --muted: #8fa4b8;
  --dim: #6b8095;
  --green: #7bd88f;
  --green-dim: rgba(123, 216, 143, 0.12);
  --cyan: #66d9ef;
  --amber: #f6c177;
  --red: #ff8f8f;
  --radius: 16px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 92px; }

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(900px 600px at 12% -10%, rgba(44, 160, 120, 0.13), transparent 60%),
    radial-gradient(800px 500px at 95% 8%, rgba(40, 120, 190, 0.12), transparent 60%),
    linear-gradient(180deg, #080c11 0%, #0a1017 50%, #080c11 100%);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  min-height: 100vh;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { color: #b7efff; }

code {
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: 0.9em;
  color: #b8f1c8;
  background: rgba(123, 216, 143, 0.08);
  border: 1px solid rgba(123, 216, 143, 0.18);
  border-radius: 6px;
  padding: 1px 6px;
}

.wiki-shell { min-height: 100vh; }

/* ── top bar ─────────────────────────────────────────────── */
.wiki-top {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 12, 17, 0.86);
  backdrop-filter: blur(16px);
}

.wiki-brand { display: inline-flex; align-items: center; gap: 11px; color: var(--text); }
.wiki-brand:hover { color: var(--text); }
.wiki-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(145deg, #1f9b6c, #0d5c46);
  color: #eafff2;
  font-weight: 800;
  font-size: 18px;
  box-shadow: 0 0 0 1px rgba(123, 216, 143, 0.3), 0 6px 18px rgba(16, 120, 90, 0.3);
}
.wiki-brand b { display: block; font-size: 14px; letter-spacing: 0.22em; line-height: 1.1; }
.wiki-brand small { display: block; color: var(--dim); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; }

.top-actions { display: flex; align-items: center; gap: 18px; font-size: 13px; }
.top-actions a { color: var(--muted); }
.top-actions a:hover { color: var(--text); }
.copy-ip {
  border: 1px solid var(--line-strong);
  background: rgba(102, 217, 239, 0.07);
  color: var(--cyan);
  border-radius: 9px;
  padding: 8px 13px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: 0.16s ease;
}
.copy-ip:hover { background: rgba(102, 217, 239, 0.14); color: #d8f8ff; }
.nav-toggle {
  display: none;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  font-size: 17px;
  cursor: pointer;
}

/* ── layout ──────────────────────────────────────────────── */
.wiki-layout {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  gap: 34px;
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 28px 28px 60px;
}

.sidebar {
  position: sticky;
  top: 78px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  scrollbar-width: thin;
  padding-right: 4px;
}

.side-card {
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(123, 216, 143, 0.08), rgba(14, 23, 32, 0.7));
  border-radius: 14px;
  padding: 14px 16px;
}
.side-card .side-label { display: block; color: var(--dim); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; margin-bottom: 3px; }
.side-card strong { display: block; font-size: 18px; letter-spacing: 0.03em; color: #e9fff0; }
.side-card small { color: var(--muted); font-size: 11px; }

.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a {
  display: block;
  padding: 7px 11px;
  border-left: 2px solid transparent;
  border-radius: 0 8px 8px 0;
  color: var(--muted);
  font-size: 13px;
  transition: 0.14s ease;
}
.side-nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.035); }
.side-nav a.active {
  color: var(--green);
  border-left-color: var(--green);
  background: linear-gradient(90deg, rgba(123, 216, 143, 0.1), transparent);
}

.progress-card {
  border: 1px solid var(--line);
  background: rgba(14, 23, 32, 0.75);
  border-radius: 12px;
  padding: 12px 14px;
}
.progress-head { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.progress-head b { color: var(--green); font-weight: 600; }
.progress-track { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.progress-track i { display: block; height: 100%; width: 0%; border-radius: inherit; background: linear-gradient(90deg, #2f9e6f, var(--green)); transition: width 0.3s ease; }
.progress-reset {
  margin-top: 9px;
  border: 0;
  background: none;
  color: var(--dim);
  font: inherit;
  font-size: 11px;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.progress-reset:hover { color: var(--muted); }

.official {
  font-size: 11px;
  color: var(--dim);
  padding: 2px 4px;
}
.official:hover { color: var(--muted); }

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

.hero {
  border: 1px solid var(--line);
  background:
    radial-gradient(600px 300px at 0% 0%, rgba(123, 216, 143, 0.1), transparent 65%),
    linear-gradient(150deg, #0f1b22, #0b1219 60%);
  border-radius: 20px;
  padding: 34px 38px 30px;
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}
.hero::after {
  content: "";
  position: absolute;
  right: -60px;
  bottom: -90px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  border: 1px solid rgba(123, 216, 143, 0.15);
  box-shadow: 0 0 0 38px rgba(123, 216, 143, 0.025), 0 0 0 80px rgba(102, 217, 239, 0.02);
  pointer-events: none;
}
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--green); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 14px; }
.eyebrow i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px var(--green); }
.hero h1 { margin: 0 0 14px; font-size: clamp(32px, 4.4vw, 50px); line-height: 1.05; letter-spacing: -0.025em; font-weight: 750; }
.hero h1 em { font-style: normal; color: var(--green); }
.lead { max-width: 680px; margin: 0; color: #a9bccd; font-size: 15.5px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 26px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: 0.16s ease;
}
.btn:hover { border-color: rgba(123, 216, 143, 0.45); background: rgba(123, 216, 143, 0.07); color: #eafff2; }
.btn.primary { background: linear-gradient(150deg, #2ba873, #157a55); border-color: rgba(123, 216, 143, 0.4); color: #f0fff6; font-weight: 600; }
.btn.primary:hover { background: linear-gradient(150deg, #35bd84, #1a8c61); }

.quick-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.quick-stats div { border: 1px solid var(--line); border-radius: 11px; background: rgba(8, 12, 17, 0.4); padding: 10px 12px; }
.quick-stats span { display: block; color: var(--dim); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; }
.quick-stats strong { display: block; margin-top: 2px; color: #dff7e6; font-size: 14px; }

.search-row { display: flex; align-items: center; gap: 14px; margin: 22px 0 6px; }
.search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(14, 23, 32, 0.8);
  padding: 10px 14px;
  transition: 0.16s ease;
}
.search:focus-within { border-color: rgba(123, 216, 143, 0.4); box-shadow: 0 0 0 3px rgba(123, 216, 143, 0.06); }
.search span { color: var(--dim); font-size: 18px; line-height: 1; }
.search input { width: 100%; border: 0; outline: 0; background: none; color: var(--text); font: inherit; font-size: 13.5px; }
.search input::placeholder { color: var(--dim); }
.search-count { color: var(--dim); font-size: 11px; white-space: nowrap; }
.no-results { color: var(--muted); font-size: 13px; margin: 4px 0 0; }

.wiki-section { padding: 34px 0 6px; border-bottom: 1px solid rgba(125, 211, 252, 0.07); }
.wiki-section:last-of-type { border-bottom: 0; }
.section-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 17px; }
.section-num { color: rgba(123, 216, 143, 0.55); font-family: "Cascadia Code", monospace; font-size: 12px; padding-top: 5px; }
.section-head h2 { margin: 0 0 3px; font-size: 23px; letter-spacing: -0.015em; }
.section-head p { margin: 0; color: var(--muted); font-size: 13px; }

.cards { display: grid; gap: 12px; }
.cards.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mini-card {
  border: 1px solid var(--line);
  background: linear-gradient(155deg, rgba(17, 29, 40, 0.9), rgba(11, 18, 25, 0.78));
  border-radius: 13px;
  padding: 16px 17px;
}
.mini-card h3 { margin: 0 0 6px; font-size: 15px; color: #e5f2fb; }
.mini-card p { margin: 0; color: var(--muted); font-size: 12.8px; line-height: 1.6; }
.mini-icon { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: rgba(123, 216, 143, 0.09); border: 1px solid rgba(123, 216, 143, 0.14); margin-bottom: 10px; font-family: "Cascadia Code", "Consolas", monospace; font-size: 10px; font-weight: 700; letter-spacing: 0.04em; color: var(--green); }

.callout {
  margin-top: 13px;
  border: 1px solid rgba(102, 217, 239, 0.18);
  border-left: 3px solid var(--cyan);
  background: rgba(102, 217, 239, 0.045);
  border-radius: 0 10px 10px 0;
  padding: 11px 14px;
  color: #b9cedd;
  font-size: 12.8px;
}
.callout b { color: #e6f9ff; }
.callout.green { border-color: rgba(123, 216, 143, 0.2); border-left-color: var(--green); background: rgba(123, 216, 143, 0.045); }
.callout.warn { border-color: rgba(246, 193, 119, 0.22); border-left-color: var(--amber); background: rgba(246, 193, 119, 0.045); }

.steps { display: flex; flex-direction: column; gap: 8px; }
.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(14, 23, 32, 0.58);
  padding: 11px 14px;
  cursor: pointer;
  transition: 0.15s ease;
}
.check:hover { border-color: rgba(123, 216, 143, 0.3); background: rgba(123, 216, 143, 0.035); }
.check input { margin: 4px 0 0; accent-color: #2f9e6f; width: 15px; height: 15px; flex: none; }
.check span { color: #b7c9d7; font-size: 12.9px; }
.check b { color: #e5f2fb; font-weight: 600; }
.check input:checked + span { color: var(--dim); }
.check input:checked + span b { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(123, 216, 143, 0.4); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: rgba(11, 18, 25, 0.65); }
table { width: 100%; border-collapse: collapse; min-width: 540px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid rgba(125, 211, 252, 0.075); font-size: 12.8px; vertical-align: top; }
th { color: var(--dim); font-size: 10.5px; letter-spacing: 0.09em; text-transform: uppercase; font-weight: 600; background: rgba(255, 255, 255, 0.018); }
td { color: #b7c9d7; }
td:first-child { color: #e5f2fb; font-weight: 600; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(123, 216, 143, 0.03); }

/* ── рецепты ─────────────────────────────────────────────── */
.recipe-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}
.recipe-search {
  flex: 1 1 260px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(14, 23, 32, 0.8);
  padding: 8px 12px;
}
.recipe-search:focus-within { border-color: rgba(123, 216, 143, 0.4); box-shadow: 0 0 0 3px rgba(123, 216, 143, 0.06); }
.recipe-search span { color: var(--dim); font-size: 17px; line-height: 1; }
.recipe-search input { width: 100%; border: 0; outline: 0; background: none; color: var(--text); font: inherit; font-size: 13px; }
.recipe-search input::placeholder { color: var(--dim); }
#recipeType {
  min-width: 200px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0e1720;
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  padding: 9px 10px;
  outline: 0;
}
#recipeType:focus { border-color: rgba(123, 216, 143, 0.4); }
.recipe-count { color: var(--dim); font-size: 11px; white-space: nowrap; }
.recipe-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.recipe-card {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: linear-gradient(155deg, rgba(17, 29, 40, 0.86), rgba(11, 18, 25, 0.8));
  padding: 12px 13px;
  min-width: 0;
}
.recipe-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.recipe-name { color: #e8f4fd; font-size: 13.5px; font-weight: 600; line-height: 1.3; min-width: 0; }
.recipe-name small { color: var(--muted); font-size: 10.5px; font-weight: 500; margin-left: 3px; }
.recipe-badge {
  flex: none;
  border: 1px solid rgba(102, 217, 239, 0.18);
  background: rgba(102, 217, 239, 0.06);
  color: #9edff0;
  border-radius: 99px;
  font-size: 9px;
  line-height: 1.3;
  padding: 3px 7px;
  white-space: nowrap;
}
.recipe-research {
  display: inline-grid;
  place-items: center;
  width: 14px;
  height: 14px;
  border: 1px solid rgba(246, 193, 119, 0.35);
  border-radius: 50%;
  background: rgba(246, 193, 119, 0.1);
  color: var(--amber);
  font-size: 8px;
  font-weight: 700;
  vertical-align: middle;
  margin-left: 3px;
}
.recipe-body { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 12px; align-items: start; }
.recipe-grid-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.slot {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.035);
}
.slot b { color: #dcecf7; font-size: 9px; line-height: 1; font-weight: 700; letter-spacing: 0.02em; }
.slot small { color: var(--muted); font-size: 8px; line-height: 1; }
.slot.empty { border-style: dashed; border-color: rgba(255, 255, 255, 0.055); background: transparent; }
.slot.mat-wood { background: rgba(176, 132, 78, 0.18); border-color: rgba(176, 132, 78, 0.25); }
.slot.mat-stone { background: rgba(148, 163, 184, 0.15); border-color: rgba(148, 163, 184, 0.22); }
.slot.mat-metal { background: rgba(120, 180, 210, 0.14); border-color: rgba(120, 180, 210, 0.24); }
.slot.mat-gem { background: rgba(117, 226, 190, 0.13); border-color: rgba(117, 226, 190, 0.24); }
.slot.mat-redstone { background: rgba(239, 108, 108, 0.14); border-color: rgba(239, 108, 108, 0.24); }
.slot.mat-food { background: rgba(214, 184, 92, 0.14); border-color: rgba(214, 184, 92, 0.24); }
.slot.mat-magic { background: rgba(172, 124, 255, 0.14); border-color: rgba(172, 124, 255, 0.24); }
.recipe-ingredients { min-width: 0; }
.recipe-ingredients > span {
  display: block;
  color: var(--dim);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.recipe-ingredients ul { display: flex; flex-wrap: wrap; gap: 4px 6px; margin: 5px 0 0; padding: 0; list-style: none; }
.recipe-ingredients li {
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.025);
  color: #aebfce;
  font-size: 10px;
  line-height: 1.35;
  padding: 1px 5px;
}
.recipe-meta { margin-top: 6px; color: var(--dim); font-size: 9.5px; }
.recipe-loading {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 11px;
  color: var(--muted);
  font-size: 12.5px;
  padding: 18px;
  text-align: center;
}
.recipe-actions { display: flex; justify-content: center; margin-top: 12px; }
.recipe-actions .btn[hidden] { display: none; }

@media (max-width: 760px) {
  .recipe-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .recipe-toolbar { align-items: stretch; }
  .recipe-search { flex-basis: 100%; }
  #recipeType { width: 100%; }
  .recipe-body { grid-template-columns: 86px minmax(0, 1fr); }
  .recipe-count { width: 100%; }
}

.energy-flow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 15px 0; }
.energy-flow div { flex: 1; min-width: 140px; border: 1px solid var(--line); border-radius: 11px; background: rgba(14, 23, 32, 0.7); padding: 11px 13px; }
.energy-flow span { display: inline-grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; background: rgba(123, 216, 143, 0.12); color: var(--green); font-size: 10px; margin-bottom: 5px; }
.energy-flow b { display: block; font-size: 12.5px; color: #e5f2fb; }
.energy-flow small { color: var(--dim); font-size: 10.5px; }
.energy-flow i { color: rgba(123, 216, 143, 0.55); font-style: normal; font-size: 18px; }
.prose { color: #a9bccd; font-size: 13.2px; margin: 0 0 13px; }
.prose b { color: #e5f2fb; }

.server-card { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 15px; }
.server-card div { border: 1px solid var(--line); border-radius: 11px; background: rgba(14, 23, 32, 0.65); padding: 10px 12px; }
.server-card span { display: block; color: var(--dim); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }
.server-card strong { display: block; color: #e5f2fb; font-size: 13px; margin-top: 2px; }
.ticks { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.ticks li { position: relative; padding-left: 22px; color: #b7c9d7; font-size: 12.9px; }
.ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 700; }

details { border: 1px solid var(--line); border-radius: 10px; background: rgba(14, 23, 32, 0.55); padding: 0 14px; margin-bottom: 7px; }
details summary { cursor: pointer; padding: 11px 0; color: #dcecf7; font-size: 13px; font-weight: 600; }
details summary::marker { color: var(--green); }
details[open] { border-color: rgba(123, 216, 143, 0.25); background: rgba(123, 216, 143, 0.025); }
details p { margin: 0 0 12px; color: var(--muted); font-size: 12.8px; }

.wiki-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; color: var(--dim); font-size: 11px; padding: 26px 0 4px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  background: #10231c;
  border: 1px solid rgba(123, 216, 143, 0.35);
  color: #d9ffe6;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 12.5px;
  opacity: 0;
  pointer-events: none;
  transition: 0.22s ease;
  z-index: 100;
  box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── responsive ──────────────────────────────────────────── */
@media (max-width: 980px) {
  .wiki-top { padding: 10px 16px; }
  .top-actions a { display: none; }
  .nav-toggle { display: inline-grid; place-items: center; }
  .wiki-layout { grid-template-columns: 1fr; padding: 18px 16px 48px; gap: 16px; }
  .sidebar {
    position: fixed;
    top: 59px;
    left: 0;
    bottom: 0;
    width: 280px;
    max-height: none;
    z-index: 35;
    background: #0a1219;
    border-right: 1px solid var(--line);
    padding: 16px;
    transform: translateX(-102%);
    transition: transform 0.22s ease;
    overflow-y: auto;
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open::after { content: ""; position: fixed; inset: 59px 0 0; background: rgba(0, 0, 0, 0.5); z-index: 30; }
  .hero { padding: 26px 22px 22px; }
  .cards.three, .cards.two { grid-template-columns: 1fr; }
  .quick-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .server-card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .energy-flow i { display: none; }
  .energy-flow div { min-width: 46%; }
}

@media (max-width: 520px) {
  .wiki-brand small { display: none; }
  .copy-ip { display: none; }
  .hero h1 { font-size: 31px; }
  .quick-stats { grid-template-columns: 1fr; }
  .section-head h2 { font-size: 20px; }
  .search-row { align-items: stretch; flex-direction: column; gap: 6px; }
  .server-card { grid-template-columns: 1fr; }
  .wiki-footer { flex-direction: column; }
}
