/* ============================================================
   Minecraft Guides — дизайн-система v2
   Тёмная тема в стиле Minecraft: глыбы, зелёный акцент, blocky-шрифт
   ============================================================ */
:root {
  --bg: #101418;
  --bg-2: #161c22;
  --bg-3: #1d2429;
  --bg-4: #232c34;
  --border: #2a343d;
  --border-strong: #3a4750;
  --text: #c8d0d4;
  --text-strong: #eef2f5;
  --muted: #8b98a0;
  --accent: #22c55e;
  --accent-strong: #16a34a;
  --accent-soft: rgba(34, 197, 94, .14);
  --mc-green: #58e67f;
  --gold: #e8c15a;
  --danger: #ef4444;
  --warn: #e5a50a;
  --blue: #4facfe;
  --radius: 12px;
  --radius-sm: 8px;
  --font-mono: "Cascadia Code", "JetBrains Mono", Consolas, "Courier New", monospace;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --transition: .22s cubic-bezier(.4,0,.2,1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  font-family: "Segoe UI", Roboto, -apple-system, Arial, sans-serif;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(34,197,94,.08), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(79,172,254,.06), transparent 60%),
    var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4 { color: var(--text-strong); line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); font-weight: 800; }
h2 { font-size: clamp(1.3rem, 3vw, 1.7rem); margin: .2rem 0 1rem; position: relative; }
h3 { font-size: 1.15rem; color: var(--mc-green); font-weight: 700; }
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--mc-green); }

main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 28px 22px 90px; }

/* ---------- Шапка ---------- */
header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(16,20,24,.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1080px; margin: 0 auto; padding: 12px 22px;
  display: flex; align-items: center; gap: 18px;
}
.logo {
  font-weight: 800; font-size: 1.15rem; color: var(--text-strong);
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
}
.logo .logo-ico {
  width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--bg-4), var(--bg-3));
  border: 1px solid var(--border-strong); border-radius: 6px; font-size: 15px;
  filter: drop-shadow(0 2px 6px rgba(34,197,94,.3));
}
.logo .pixel { color: var(--mc-green); }
.nav-links { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.nav-links a {
  padding: 7px 13px; border-radius: var(--radius-sm);
  color: var(--text); font-weight: 500; font-size: .92rem;
  border: 1px solid transparent; transition: all var(--transition);
}
.nav-links a:hover { background: var(--bg-3); color: var(--text-strong); text-decoration: none; border-color: var(--border); }
.nav-links a.active {
  background: var(--accent-soft); color: var(--mc-green);
  border-color: rgba(34,197,94,.35);
}
.nav-toggle { display: none; }

/* ---------- Типографика ---------- */
.lead { font-size: 1.12rem; color: var(--muted); max-width: 760px; }
code {
  background: var(--bg-4); border: 1px solid var(--border);
  border-radius: 5px; padding: .12em .42em;
  font-family: var(--font-mono); font-size: .9em; color: var(--mc-green);
}
pre {
  position: relative;
  background: linear-gradient(180deg, #0d1216, #0a0e12);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 18px 12px; overflow-x: auto; margin: 14px 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}
pre::before {
  content: ""; position: absolute; top: 8px; left: 12px; right: 12px; height: 12px;
  background-image: radial-gradient(circle, #3a4750 1.5px, transparent 2px);
  background-size: 6px 6px; opacity: .6; pointer-events: none;
}
pre code { background: none; border: none; padding: 22px 0 0; color: var(--text); display: block; font-size: .9rem; line-height: 1.55; white-space: pre; }

/* Подсветка синтаксиса (вручную размечается токенами) */
.tok-cmd { color: var(--mc-green); font-weight: 600; }
.tok-sel { color: var(--blue); }
.tok-arg { color: var(--gold); }
.tok-str { color: #a8d5a2; }
.tok-com { color: #5c6670; font-style: italic; }
.tok-num { color: #f0a6c0; }

.copy-btn {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  background: var(--bg-4); color: var(--text); border: 1px solid var(--border-strong);
  border-radius: 6px; padding: 4px 12px; font-size: .78rem; cursor: pointer;
  font-family: inherit; transition: all var(--transition);
}
.copy-btn:hover { background: var(--accent); color: #0a0e12; border-color: var(--accent); }

/* ---------- Таблицы ---------- */
.table-wrap { overflow-x: auto; margin: 14px 0; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: .93rem; min-width: 560px; }
th, td { border-bottom: 1px solid var(--border); padding: 11px 14px; text-align: left; }
th { background: var(--bg-3); color: var(--text-strong); font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background var(--transition); }
tbody tr:hover { background: var(--bg-2); }

/* ---------- Карточки/сетка ---------- */
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  position: relative;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.card h3 { margin-top: 0; }
a.card-link { display: block; color: inherit; }
a.card-link:hover { text-decoration: none; transform: translateY(-4px); border-color: rgba(34,197,94,.4); box-shadow: var(--shadow); }
.card-ico {
  width: 46px; height: 46px; display: flex; align-items: center; justify-content: center;
  font-size: 24px; background: var(--accent-soft); border-radius: 10px; margin-bottom: 14px;
}
.card:hover .card-ico { background: rgba(34,197,94,.22); }

/* ---------- Hero/баннер ---------- */
.page-banner {
  background: linear-gradient(135deg, #0f2e1c, #14532d 50%, #1c3d2a);
  border: 1px solid rgba(34,197,94,.25);
  border-radius: calc(var(--radius) + 4px);
  padding: 40px 34px; margin-bottom: 34px;
  position: relative; overflow: hidden;
  color: #e8f5ec;
}
.page-banner::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(88,230,127,.18), transparent 65%);
}
.page-banner h1 { margin: 0 0 12px; color: #fff; font-size: clamp(1.7rem, 4vw, 2.5rem); }
.page-banner p { margin: 0; max-width: 740px; opacity: .93; }
.banner-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; position: relative; z-index: 2; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(0,0,0,.3); border: 1px solid rgba(88,230,127,.3);
  color: var(--mc-green); font-size: .78rem; font-weight: 600;
  padding: 5px 12px; border-radius: 30px;
}
.badge.gold { border-color: rgba(232,193,90,.35); color: var(--gold); }

/* ---------- Оглавление ---------- */
.toc {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 24px; margin: 0 0 30px;
}
.toc-title { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text-strong); font-size: 1rem; }
.toc ol { margin: 12px 0 0; padding-left: 0; list-style: none; columns: 2; gap: 28px; }
.toc li { margin: .3rem 0; counter-increment: toc; }
.toc li a { display: flex; align-items: center; gap: 10px; color: var(--text); }
.toc li a::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--font-mono); font-size: .78rem; color: var(--accent);
  background: var(--accent-soft); border-radius: 5px; padding: 1px 6px;
}
.toc li a:hover { color: var(--mc-green); text-decoration: none; }

/* ---------- Секции ---------- */
.section { margin: 40px 0; scroll-margin-top: 90px; }
.section > h2 { display: flex; align-items: center; gap: 12px; }
.section > h2 .sec-no {
  font-family: var(--font-mono); font-size: .7em; color: var(--accent);
  background: var(--accent-soft); border: 1px solid rgba(34,197,94,.25);
  padding: 3px 10px; border-radius: 8px;
}
blockquote {
  margin: 16px 0; padding: 14px 18px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  background: var(--bg-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
blockquote.tip { border-left-color: var(--blue); }
blockquote.warn { border-left-color: var(--danger); background: rgba(239,68,68,.06); }
blockquote strong { color: var(--text-strong); }

/* ---------- Колл-аут / шаги ---------- */
.steps { counter-reset: step; list-style: none; padding-left: 0; }
.steps li { position: relative; padding-left: 48px; margin: 14px 0; }
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 2px;
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--accent-soft); color: var(--mc-green);
  border: 1px solid rgba(34,197,94,.3);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .9rem;
}
.steps li strong { color: var(--text-strong); }

/* ---------- FAQ-аккордеон ---------- */
.faq-item {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-2); margin-bottom: 12px; overflow: hidden;
  transition: border-color var(--transition);
}
.faq-item.open { border-color: rgba(34,197,94,.4); }
.faq-q {
  width: 100%; text-align: left; background: none; border: none;
  padding: 18px 20px; cursor: pointer; font-size: 1rem;
  color: var(--text-strong); font-weight: 600; font-family: inherit;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.faq-q .faq-chev { transition: transform var(--transition); color: var(--accent); flex-shrink: 0; }
.faq-item.open .faq-chev { transform: rotate(180deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height var(--transition); }
.faq-a-inner { padding: 0 20px 20px; color: var(--text); }

/* ---------- Поиск команд ---------- */
.search-wrap { position: relative; max-width: 560px; margin: 20px 0 26px; }
.search-wrap svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-input {
  width: 100%; padding: 13px 16px 13px 42px;
  background: var(--bg-2); border: 1px solid var(--border-strong);
  border-radius: var(--radius); color: var(--text-strong);
  font-size: 1rem; font-family: inherit; outline: none; transition: all var(--transition);
}
.search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cmd-list { display: grid; gap: 12px; }
.cmd-row {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 20px; transition: all var(--transition);
}
.cmd-row:hover { border-color: rgba(34,197,94,.35); }
.cmd-row h4 { margin: 0 0 4px; font-family: var(--font-mono); font-size: 1rem; color: var(--mc-green); }
.cmd-row p { margin: 0; color: var(--muted); font-size: .92rem; }
.cmd-row.hidden { display: none; }

/* ---------- Песочница команд ---------- */
.sandbox {
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px;
}
.sandbox textarea {
  width: 100%; min-height: 64px; resize: vertical;
  background: #0d1216; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); color: var(--text-strong);
  font-family: var(--font-mono); font-size: .95rem; padding: 14px;
  outline: none; transition: border-color var(--transition);
}
.sandbox textarea:focus { border-color: var(--accent); }
.sandbox-output {
  margin-top: 12px; background: #0d1216; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px; min-height: 48px;
  font-family: var(--font-mono); font-size: .9rem; color: var(--muted); white-space: pre-wrap;
}
.sandbox-output.ok { color: var(--mc-green); }
.sandbox-output.err { color: var(--danger); }
.presets { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.preset-btn {
  background: var(--bg-3); border: 1px solid var(--border);
  color: var(--text); padding: 6px 14px; border-radius: 8px; cursor: pointer;
  font-size: .85rem; transition: all var(--transition); font-family: inherit;
}
.preset-btn:hover { border-color: var(--accent); color: var(--mc-green); }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: #0a0e12; font-weight: 700;
  border: none; padding: 11px 22px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: .95rem; transition: all var(--transition);
}
.btn:hover { background: var(--mc-green); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(34,197,94,.3); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--border-strong); }
.btn.ghost:hover { border-color: var(--accent); color: var(--mc-green); }

/* ---------- Reveal-анимация ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .5s ease, transform .5s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- Статистика ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 26px 0; }
.stat {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; text-align: center;
}
.stat .num { font-size: 2rem; font-weight: 800; color: var(--mc-green); font-family: var(--font-mono); }
.stat .lbl { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-top: 4px; }

/* ---------- Ссылка вверх ---------- */
.top-link {
  position: fixed; right: 22px; bottom: 22px; z-index: 90;
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--bg-4); border: 1px solid var(--border-strong); color: var(--mc-green);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  opacity: 0; transform: translateY(10px); pointer-events: none;
  transition: all var(--transition); font-size: 20px;
}
.top-link.show { opacity: 1; transform: none; pointer-events: auto; }
.top-link:hover { background: var(--accent); color: #0a0e12; }

/* ---------- Подвал ---------- */
footer {
  border-top: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--muted); text-align: center; padding: 28px 22px; font-size: .88rem;
}
footer .foot-brand { color: var(--text-strong); font-weight: 700; }
footer p { margin: 6px 0; }

/* ---------- Мобильное меню ---------- */
@media (max-width: 860px) {
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--bg-3); border: 1px solid var(--border); color: var(--text);
    width: 40px; height: 40px; border-radius: 8px; cursor: pointer; margin-left: auto; font-size: 18px;
  }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 4px;
    background: var(--bg-2); border-bottom: 1px solid var(--border);
    padding: 10px 16px 16px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: 12px 14px; }
  .toc ol { columns: 1; }
  .page-banner { padding: 28px 22px; }
}
@media (max-width: 640px) {
  main { padding: 20px 14px 70px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  th, td { padding: 9px 10px; }
  .steps li { padding-left: 42px; }
}