/* ============================================================
   MRP Red Dragon — тёмная тема с красным акцентом
   ============================================================ */

:root {
  --bg:          #08080a;
  --bg-soft:     #0c0d10;
  --panel:       #121317;
  --panel-2:     #17181e;
  --panel-3:     #1d1f26;
  --line:        rgba(255,255,255,.08);
  --line-strong: rgba(255,255,255,.14);

  --text:        #e9e9ef;
  --text-dim:    #b9bac4;
  --muted:       #8f909c;

  --accent:      #e5131f;
  --accent-2:    #ff4b3a;
  --accent-soft: rgba(229,19,31,.14);
  --glow:        rgba(229,19,31,.35);

  --keter:       #e5131f;
  --euclid:      #d98a1f;
  --safe:        #23a05a;
  --thaumiel:    #6f5bd6;
  --none:        #6b6d78;

  --radius:      16px;
  --radius-sm:   10px;
  --wrap:        1240px;
  --header-h:    74px;

  --shadow:      0 18px 45px rgba(0,0,0,.55);
  --ease:        cubic-bezier(.22,.61,.36,1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 18px); }

body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

/* фоновое свечение и сетка */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
body::before {
  background:
    radial-gradient(900px 500px at 15% -5%, rgba(229,19,31,.16), transparent 60%),
    radial-gradient(700px 500px at 90% 8%, rgba(120,20,30,.13), transparent 60%),
    radial-gradient(800px 600px at 50% 110%, rgba(229,19,31,.08), transparent 60%);
}
body::after {
  background-image:
    linear-gradient(rgba(255,255,255,.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.028) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 78%);
}

main, .site-header, .site-footer { position: relative; z-index: 1; }

img { max-width: 100%; display: block; }

a { color: var(--accent-2); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: #ff7a6a; }

::selection { background: var(--accent); color: #fff; }

:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; }

/* ---------------- полоса прогресса ---------------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  z-index: 120; box-shadow: 0 0 12px var(--glow);
  transition: width .1s linear;
}

/* ---------------- шапка ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(8,8,10,.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
  transition: background .3s var(--ease), box-shadow .3s var(--ease);
}
.site-header.scrolled { background: rgba(8,8,10,.92); box-shadow: 0 10px 30px rgba(0,0,0,.5); }

.header-inner {
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}

.brand { display: flex; align-items: center; gap: 12px; color: var(--text); flex-shrink: 0; }
.brand img {
  height: 42px; width: 42px; object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(229,19,31,.55));
  transition: transform .35s var(--ease), filter .35s var(--ease);
}
.brand:hover img { transform: scale(1.06) rotate(-3deg); filter: drop-shadow(0 0 16px rgba(229,19,31,.8)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text b {
  font-size: 13px; letter-spacing: .34em; color: var(--muted); font-weight: 700;
}
.brand-text span {
  font-size: 18px; font-weight: 800; letter-spacing: .06em;
  background: linear-gradient(90deg, #fff, #ff6b5e);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.footer-brand .brand-text span { font-size: 20px; }

.nav ul { display: flex; gap: 4px; list-style: none; }
.nav a {
  display: block; padding: 9px 15px; border-radius: 999px;
  font-size: 14.5px; font-weight: 500; color: var(--text-dim);
  position: relative; transition: color .2s var(--ease), background .2s var(--ease);
}
.nav a:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav a.active {
  color: #fff; background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(229,19,31,.4);
}
.nav a.active::after {
  content: ""; position: absolute; left: 50%; bottom: 2px; transform: translateX(-50%);
  width: 16px; height: 2px; border-radius: 2px; background: var(--accent-2);
}

.header-actions { display: flex; align-items: center; gap: 10px; }

/* ---------------- кнопки ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 12px 22px; border-radius: 999px; border: 1px solid transparent;
  font-size: 14.5px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease),
              background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}
.btn svg { width: 18px; height: 18px; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; box-shadow: 0 10px 26px rgba(229,19,31,.32);
}
.btn-primary:hover {
  color: #fff; transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(229,19,31,.45);
}
.btn-outline { border-color: rgba(255,255,255,.22); color: var(--text); background: rgba(255,255,255,.03); }
.btn-outline:hover {
  color: #fff; border-color: var(--accent-2); background: rgba(229,19,31,.12); transform: translateY(-2px);
}
.btn-ghost {
  padding: 8px 16px; font-size: 13.5px;
  border-color: var(--line-strong); color: var(--text-dim); background: transparent;
}
.btn-ghost:hover { color: #fff; border-color: var(--accent-2); background: rgba(229,19,31,.1); }
.btn-discord { background: #5865F2; color: #fff; padding: 10px 18px; }
.btn-discord svg { fill: currentColor; }
.btn-discord:hover { color: #fff; background: #4752c4; transform: translateY(-2px); box-shadow: 0 12px 26px rgba(88,101,242,.4); }

/* ---------------- бургер ---------------- */
.burger {
  display: none; width: 44px; height: 44px; border-radius: 12px;
  background: rgba(255,255,255,.05); border: 1px solid var(--line);
  cursor: pointer; padding: 12px 11px;
}
.burger span { display: block; height: 2px; background: var(--text); border-radius: 2px; transition: .3s var(--ease); }
.burger span + span { margin-top: 5px; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------------- главный экран ---------------- */
.hero { position: relative; padding: 96px 0 72px; text-align: center; overflow: hidden; }
.hero-glow {
  position: absolute; left: 50%; top: -180px; transform: translateX(-50%);
  width: 900px; height: 520px; pointer-events: none;
  background: radial-gradient(closest-side, rgba(229,19,31,.30), transparent 70%);
  filter: blur(10px);
}
.hero-inner { position: relative; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px; letter-spacing: .28em; color: var(--muted);
  text-transform: uppercase; margin-bottom: 20px;
}
.eyebrow .dot { color: var(--accent-2); }
.hero-title {
  font-size: clamp(42px, 8vw, 86px); line-height: 1.02; font-weight: 900;
  letter-spacing: -.02em; margin-bottom: 20px;
}
.hero-title em {
  font-style: normal;
  background: linear-gradient(135deg, #ff5a4a 10%, #e5131f 55%, #97000f 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 60px rgba(229,19,31,.35);
}
.hero-lead {
  max-width: 660px; margin: 0 auto 32px; color: var(--text-dim); font-size: clamp(15px, 1.6vw, 18px);
}
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  max-width: 900px; margin: 56px auto 0;
}
.stat {
  background: linear-gradient(160deg, rgba(255,255,255,.055), rgba(255,255,255,.015));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 14px; backdrop-filter: blur(6px);
  transition: transform .3s var(--ease), border-color .3s var(--ease);
}
.stat:hover { transform: translateY(-4px); border-color: rgba(229,19,31,.45); }
.stat b {
  display: block; font-size: 34px; font-weight: 800; letter-spacing: -.02em;
  background: linear-gradient(135deg, #fff, #ff6b5e);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat span { font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; }

/* ---------------- секции ---------------- */
.section { padding: 80px 0; }
.section.alt { background: linear-gradient(180deg, transparent, rgba(255,255,255,.018), transparent); }
.section-head { text-align: center; margin-bottom: 40px; }
.section-head.left { text-align: left; }
.section-title {
  font-size: clamp(26px, 3.4vw, 38px); font-weight: 800; letter-spacing: -.015em; margin-bottom: 8px;
}
.section-title::after {
  content: ""; display: block; width: 54px; height: 3px; border-radius: 3px; margin-top: 14px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.section-head .section-title::after { margin: 14px auto 0; }
.section-head.left .section-title::after { margin-left: 0; }
.section-sub { color: var(--muted); font-size: 15.5px; }

/* ---------------- карточки разделов ---------------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.card {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  padding: 26px 24px 22px; border-radius: var(--radius);
  background: linear-gradient(165deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); overflow: hidden; color: var(--text);
  transition: transform .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease);
}
.card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(400px 200px at 100% 0%, rgba(229,19,31,.16), transparent 60%);
  opacity: 0; transition: opacity .35s var(--ease);
}
.card:hover {
  transform: translateY(-6px); border-color: rgba(229,19,31,.45);
  box-shadow: 0 22px 45px rgba(0,0,0,.55), 0 0 0 1px rgba(229,19,31,.18);
}
.card:hover::before { opacity: 1; }
.card-icon {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  background: var(--accent-soft); border: 1px solid rgba(229,19,31,.28); margin-bottom: 6px;
}
.card-icon svg { width: 24px; height: 24px; fill: none; stroke: var(--accent-2); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.card h3 { font-size: 19px; font-weight: 700; }
.card p { font-size: 14.5px; color: var(--muted); flex: 1; }
.card-go {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13.5px; font-weight: 600; color: var(--accent-2); margin-top: 6px;
}
.card-go svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .3s var(--ease); }
.card:hover .card-go svg { transform: translateX(4px); }

/* ---------------- блок «О проекте» ---------------- */
.about { display: grid; grid-template-columns: 1.35fr .85fr; gap: 40px; align-items: start; }
.about-text > p { color: var(--text-dim); margin-bottom: 14px; }
.checks { list-style: none; margin-top: 20px; display: grid; gap: 10px; }
.checks li { position: relative; padding-left: 30px; color: var(--text-dim); font-size: 15px; }
.checks li::before {
  content: ""; position: absolute; left: 0; top: 7px; width: 18px; height: 18px; border-radius: 6px;
  background: var(--accent-soft); border: 1px solid rgba(229,19,31,.35);
}
.checks li::after {
  content: ""; position: absolute; left: 6px; top: 12px; width: 5px; height: 9px;
  border: 2px solid var(--accent-2); border-top: 0; border-left: 0; transform: rotate(42deg);
}
.about-side { display: grid; gap: 16px; }

/* ---------------- шапка страницы ---------------- */
.page-hero {
  position: relative; padding: 74px 0 46px; text-align: center;
  border-bottom: 1px solid var(--line);
  background: radial-gradient(700px 320px at 50% -20%, rgba(229,19,31,.20), transparent 70%);
}
.page-hero h1 { font-size: clamp(32px, 5.2vw, 54px); font-weight: 900; letter-spacing: -.02em; }
.page-hero h1 em {
  font-style: normal;
  background: linear-gradient(135deg, #ff5a4a, #e5131f);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.page-hero .lead { color: var(--muted); margin: 12px auto 24px; max-width: 620px; }
.page-hero .hero-actions { justify-content: center; }

/* ---------------- раскладка с сайдбаром ---------------- */
.layout { display: grid; grid-template-columns: 280px 1fr; gap: 36px; padding: 46px 24px 70px; align-items: start; }
.layout.single { grid-template-columns: 1fr; }
.sidebar { position: sticky; top: calc(var(--header-h) + 20px); }
.toc {
  background: linear-gradient(170deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
  max-height: calc(100vh - var(--header-h) - 60px); overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent;
}
.toc::-webkit-scrollbar { width: 6px; }
.toc::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border-radius: 6px; }
.toc-title { font-size: 11.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.toc-search, .block-search {
  width: 100%; margin-bottom: 14px; padding: 10px 14px;
  background: rgba(255,255,255,.04); border: 1px solid var(--line);
  border-radius: var(--radius-sm); color: var(--text); font-size: 14px; font-family: inherit;
}
.toc-search:focus, .block-search:focus { outline: none; border-color: rgba(229,19,31,.55); background: rgba(229,19,31,.06); }
.toc-nav ul { list-style: none; }
.toc-nav li { margin-bottom: 1px; }
.toc-nav a {
  display: block; padding: 8px 12px; border-radius: 8px; font-size: 14px;
  color: var(--text-dim); border-left: 2px solid transparent;
  transition: .2s var(--ease);
}
.toc-nav a:hover { color: #fff; background: rgba(255,255,255,.05); }
.toc-nav a.active { color: #fff; background: var(--accent-soft); border-left-color: var(--accent-2); }
.toc-sub { margin: 2px 0 6px 12px; list-style: none; border-left: 1px solid var(--line); }
.toc-sub a { font-size: 13px; color: var(--muted); padding: 5px 12px; }
.toc-sub a.active { color: #fff; }

/* ---------------- инструменты контента ---------------- */
.content { min-width: 0; }
.content-tools {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 20px;
}
.block-search { flex: 1; min-width: 220px; margin: 0; }
.tools-btns { display: flex; gap: 8px; }

/* ---------------- панели ---------------- */
.panel {
  background: linear-gradient(170deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 28px; margin-bottom: 20px;
}
.panel-title, .group-title {
  font-size: 24px; font-weight: 800; margin-bottom: 18px; padding-bottom: 14px;
  border-bottom: 1px solid var(--line); letter-spacing: -.01em;
}
.panel.alert { border-color: rgba(229,19,31,.35); background: linear-gradient(170deg, rgba(229,19,31,.12), var(--panel)); }
.panel.alert h3, .panel h3 { font-size: 18px; margin-bottom: 10px; }
.panel p, .panel .btn { margin-bottom: 0; }
.panel p + .btn, .panel p + p { margin-top: 14px; }
.panel > ul { margin: 12px 0 12px 22px; }

/* ---------------- аккордеон ---------------- */
.acc {
  background: linear-gradient(170deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--radius);
  margin-bottom: 14px; overflow: hidden;
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
  scroll-margin-top: calc(var(--header-h) + 18px);
}
.acc.open { border-color: rgba(229,19,31,.35); box-shadow: 0 12px 30px rgba(0,0,0,.35); }
.acc.hidden { display: none; }
.acc-head {
  width: 100%; display: flex; align-items: center; gap: 14px;
  padding: 20px 24px; background: none; border: 0; cursor: pointer;
  font-family: inherit; font-size: 17px; font-weight: 700; color: var(--text);
  text-align: left; transition: background .25s var(--ease);
}
.acc-head:hover { background: rgba(255,255,255,.035); }
.acc-title { flex: 1; }
.acc .chev {
  width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: var(--muted);
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  transition: transform .3s var(--ease), stroke .3s var(--ease);
}
.acc.open .chev { transform: rotate(180deg); stroke: var(--accent-2); }
.acc-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s var(--ease); }
.acc.open .acc-body { grid-template-rows: 1fr; }
.acc-inner { overflow: hidden; }
.acc-inner > :first-child { margin-top: 0; }
.acc-inner { padding: 0 24px; }
.acc.open .acc-inner { padding-bottom: 24px; }
.acc-inner h3 {
  font-size: 16px; font-weight: 700; color: var(--accent-2); margin: 22px 0 10px;
  display: flex; align-items: center; gap: 10px;
}
.acc-inner h3::before {
  content: ""; width: 14px; height: 2px; background: var(--accent); border-radius: 2px; flex-shrink: 0;
}
.acc-inner p { color: var(--text-dim); margin-bottom: 12px; }
.acc-inner ul, .acc-inner ol { margin: 10px 0 16px 22px; }
.acc-inner li { margin-bottom: 8px; color: var(--text-dim); }
.acc-inner b, strong { color: #fff; font-weight: 600; }

/* ---------------- правила ---------------- */
.group { padding: 8px 28px 22px; scroll-margin-top: calc(var(--header-h) + 18px); }
.group-title {
  font-size: 22px; padding: 22px 0 14px; margin-bottom: 6px; position: relative;
}
.group-title::before {
  content: ""; position: absolute; left: -28px; top: 22px; bottom: 14px; width: 3px;
  border-radius: 3px; background: linear-gradient(180deg, var(--accent), transparent);
}
.group > p { color: var(--muted); margin-bottom: 18px; }
.rule {
  padding: 18px 0 18px; border-top: 1px solid var(--line);
  scroll-margin-top: calc(var(--header-h) + 18px);
}
.rule h3 {
  font-size: 16.5px; font-weight: 700; color: var(--text); margin-bottom: 10px;
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
}
.rule-num {
  font-family: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
  font-size: 12px; font-weight: 700; color: var(--accent-2);
  background: var(--accent-soft); border: 1px solid rgba(229,19,31,.3);
  padding: 2px 8px; border-radius: 6px; flex-shrink: 0;
}
.rule p, .rule ul { color: var(--text-dim); }
.rule ul { margin: 10px 0 10px 22px; }
.rule li { margin-bottom: 7px; }

.note {
  background: rgba(229,19,31,.07);
  border: 1px solid rgba(229,19,31,.22);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 14px 16px; margin: 14px 0; font-size: 14.5px; color: var(--text-dim);
}
.note-label {
  display: block; font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent-2); margin-bottom: 6px; font-weight: 700;
}

/* ---------------- бейджи классов ---------------- */
.badge {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: .04em; white-space: nowrap;
  border: 1px solid currentColor;
}
.badge.keter    { color: #ff6b6b; background: rgba(229,19,31,.14); }
.badge.euclid   { color: #f0b34a; background: rgba(217,138,31,.14); }
.badge.safe     { color: #58d68d; background: rgba(35,160,90,.14); }
.badge.thaumiel { color: #a99bff; background: rgba(111,91,214,.16); }
.badge.none     { color: #a0a2ad; background: rgba(255,255,255,.06); }

/* ---------------- подвал ---------------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(0,0,0,.4));
  padding: 56px 0 28px; margin-top: 40px;
}
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 40px; }
.footer-col h4 { font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-bottom: 16px; }
.footer-col ul { list-style: none; display: grid; gap: 10px; }
.footer-col a { color: var(--text-dim); font-size: 14.5px; }
.footer-col a:hover { color: var(--accent-2); }
.brand-col p { color: var(--muted); font-size: 14.5px; margin: 16px 0 20px; max-width: 380px; }
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 13.5px;
}
.to-top {
  width: 42px; height: 42px; border-radius: 50%; cursor: pointer;
  background: rgba(255,255,255,.05); border: 1px solid var(--line);
  display: grid; place-items: center; flex-shrink: 0;
  transition: .25s var(--ease);
}
.to-top svg { width: 20px; height: 20px; fill: var(--text-dim); }
.to-top:hover { background: var(--accent); border-color: var(--accent); transform: translateY(-3px); }
.to-top:hover svg { fill: #fff; }

/* ---------------- анимации появления ---------------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------------- адаптив ---------------- */
@media (max-width: 1080px) {
  .about { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; gap: 24px; padding-top: 32px; }
  .sidebar { position: static; }
  .toc { max-height: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .wrap { padding: 0 18px; }
  .header-inner { height: 64px; }
  :root { --header-h: 64px; }
  .burger { display: block; }
  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0;
    background: rgba(10,10,12,.98); backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line); padding: 12px 18px 22px;
    transform: translateY(-12px); opacity: 0; visibility: hidden;
    transition: .28s var(--ease); max-height: calc(100vh - var(--header-h)); overflow-y: auto;
  }
  .nav.open { transform: none; opacity: 1; visibility: visible; }
  .nav ul { flex-direction: column; gap: 4px; }
  .nav a { padding: 12px 14px; font-size: 16px; border-radius: 10px; }
  .header-actions .btn-discord span { display: none; }
  .btn-discord { padding: 10px; }
  .hero { padding: 60px 0 48px; }
  .section { padding: 56px 0; }
  .panel, .group { padding-left: 20px; padding-right: 20px; }
  .acc-head { padding: 16px 18px; font-size: 15.5px; }
  .acc-inner { padding: 0 18px; }
  .acc.open .acc-inner { padding-bottom: 18px; }
  .group-title::before { left: -20px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; text-align: center; }
}

@media (max-width: 420px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat b { font-size: 28px; }
  .hero-actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------------- печать ---------------- */
@media print {
  .site-header, .site-footer, .sidebar, .content-tools, .scroll-progress, .to-top { display: none !important; }
  body { background: #fff; color: #000; }
  .acc-body { grid-template-rows: 1fr !important; }
}

/* ---------------- таймлайн (страница «История») ---------------- */
.timeline { list-style: none; margin: 6px 0 0; padding: 0 0 0 34px; position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 10px; bottom: 10px; width: 2px;
  border-radius: 2px; background: linear-gradient(180deg, var(--accent), rgba(229,19,31,.12));
}
.tl-item { position: relative; padding: 0 0 28px; }
.tl-item:last-child { padding-bottom: 4px; }
.tl-item::before {
  content: ""; position: absolute; left: -34px; top: 6px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--panel); border: 3px solid var(--accent);
  box-shadow: 0 0 0 5px rgba(229,19,31,.12);
}
.timeline .tl-item h3 { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.tl-date {
  display: block; margin-bottom: 4px;
  font-family: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
  font-size: 11.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent-2);
}
.tl-item p { color: var(--text-dim); margin: 8px 0 0; }
.tl-item ul { margin: 10px 0 0 22px; }
.panel .stats { margin: 6px 0 0; }
.panel .stats .stat { padding: 16px 10px; }

/* ============================================================
   АНИМАЦИИ И ФОН (обновление)
   ============================================================ */

/* --- живой фон: дрейф подсветки и движение сетки --- */
body::before { animation: bgDrift 28s ease-in-out infinite alternate; will-change: transform; }
@keyframes bgDrift {
  0%   { transform: translate3d(-2%, -1%, 0) scale(1.05); opacity: .9; }
  50%  { transform: translate3d(1.5%, 1%, 0) scale(1.12); opacity: 1; }
  100% { transform: translate3d(2.5%, -1.5%, 0) scale(1.06); opacity: .92; }
}
body::after { animation: gridMove 26s linear infinite; }
@keyframes gridMove {
  0%   { background-position: 0 0; }
  100% { background-position: 46px 46px; }
}
#bgFx {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 0; opacity: .85;
}

/* --- мягкое свечение заголовка --- */
.hero-title em,
.page-hero h1 em { background-size: 200% 200%; animation: shimmer 7s ease-in-out infinite; }
@keyframes shimmer {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

/* --- пульсация иконок карточек --- */
.card-icon { animation: iconPulse 4.5s ease-in-out infinite; }
@keyframes iconPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(229,19,31,.28); }
  50%      { box-shadow: 0 0 0 9px rgba(229,19,31,0); }
}
.cards .card:nth-child(2) .card-icon { animation-delay: .4s; }
.cards .card:nth-child(3) .card-icon { animation-delay: .8s; }
.cards .card:nth-child(4) .card-icon { animation-delay: 1.2s; }
.cards .card:nth-child(5) .card-icon { animation-delay: 1.6s; }
.cards .card:nth-child(6) .card-icon { animation-delay: 2s; }
.cards .card:nth-child(7) .card-icon { animation-delay: 2.4s; }

/* --- блик на кнопке --- */
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::after {
  content: ""; position: absolute; top: 0; left: -120%; width: 60%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent);
  animation: shine 5.5s ease-in-out infinite;
}
@keyframes shine {
  0%, 65%  { left: -120%; }
  78%, 100% { left: 130%; }
}

/* --- счётчик-бейдж на карточке раздела --- */
.card-count {
  position: absolute; top: 22px; right: 24px;
  font-family: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
  font-size: 12px; font-weight: 700; letter-spacing: .06em;
  color: var(--accent-2); background: var(--accent-soft);
  border: 1px solid rgba(229,19,31,.28); border-radius: 999px; padding: 2px 10px;
}

/* ============================================================
   МЕХАНИКИ СЕРВЕРА
   ============================================================ */
.mini-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.mini-card {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 18px 20px; border-radius: var(--radius-sm);
  background: linear-gradient(160deg, rgba(255,255,255,.05), rgba(255,255,255,.015));
  border: 1px solid var(--line);
  transition: transform .3s var(--ease), border-color .3s var(--ease), background .3s var(--ease);
}
.mini-card:hover {
  transform: translateY(-3px); border-color: rgba(229,19,31,.4);
  background: linear-gradient(160deg, rgba(229,19,31,.10), rgba(255,255,255,.02));
}
.mini-emoji {
  font-size: 22px; line-height: 1; flex-shrink: 0;
  width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid var(--line);
}
.mini-card h4 { font-size: 15px; font-weight: 700; margin-bottom: 3px; }
.mini-card p { font-size: 13.5px; color: var(--muted); }

/* --- список изменений --- */
.changelog { list-style: none; display: grid; gap: 10px; }
.changelog li { display: flex; gap: 12px; align-items: baseline; font-size: 14px; color: var(--text-dim); }
.log-date {
  flex-shrink: 0; font-family: ui-monospace, Consolas, monospace; font-size: 12px; font-weight: 700;
  color: var(--accent-2); background: var(--accent-soft);
  border: 1px solid rgba(229,19,31,.28); border-radius: 6px; padding: 2px 8px;
}

/* ============================================================
   КОНТЕНТ: таблицы, наказания, подзаголовки
   ============================================================ */
.data-table {
  width: 100%; border-collapse: collapse; margin: 16px 0;
  font-size: 14px; display: block; overflow-x: auto; white-space: nowrap;
}
.data-table th, .data-table td {
  border: 1px solid var(--line); padding: 10px 14px; text-align: left; vertical-align: top;
}
.data-table thead th {
  background: rgba(229,19,31,.12); color: #fff; font-size: 12.5px;
  letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
}
.data-table tbody tr:nth-child(even) { background: rgba(255,255,255,.025); }
.data-table tbody tr:hover { background: rgba(229,19,31,.07); }
.data-table td:first-child { color: #fff; font-weight: 600; white-space: nowrap; }
@media (min-width: 900px) { .data-table { display: table; white-space: normal; } }

.punish {
  display: inline-block; margin: 8px 0 2px; padding: 4px 12px; border-radius: 999px;
  font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; font-weight: 700;
  color: #ff8f8f; background: rgba(229,19,31,.12); border: 1px solid rgba(229,19,31,.3);
}

.acc-inner h4, .panel h4 {
  font-size: 15px; font-weight: 700; color: var(--text); margin: 18px 0 8px;
  padding-left: 12px; border-left: 3px solid rgba(229,19,31,.6);
}
.acc-inner ol { margin: 10px 0 16px 22px; }
.acc-inner ol li { margin-bottom: 8px; color: var(--text-dim); }
.acc-inner ul ul, .acc-inner ol ul { margin-top: 8px; }
.rule ul ul { margin-top: 8px; }
.panel > ul, .panel > ol { margin-left: 22px; }
.panel > p { color: var(--text-dim); margin-bottom: 12px; }
.panel > ul li, .panel > ol li { margin-bottom: 8px; color: var(--text-dim); }

/* исключения — отдельный акцент */
.note.exc { background: rgba(255,193,7,.06); border-color: rgba(255,193,7,.25); border-left-color: #f0b34a; }
.note.exc .note-label { color: #f0b34a; }
.note.exc b, .note.exc strong { color: #ffd98a; }

/* ============================================================
   Мобильная навигация (8 пунктов)
   ============================================================ */
@media (max-width: 1180px) {
  .nav a { padding: 9px 11px; font-size: 13.5px; }
  .brand-text span { font-size: 16px; }
}

/* бейджи ролей */
.badge.human  { color: #cfd3e0; background: rgba(255,255,255,.07); }
.badge.cyborg { color: #7fd8ff; background: rgba(58,178,240,.14); }
.badge.scp    { color: #ff9ad1; background: rgba(214,91,183,.14); }

/* ============================================================
   АВТОРИЗАЦИЯ STEAM + АДМИН-ПАНЕЛЬ
   ============================================================ */

/* --- кнопка входа через Steam --- */
.btn-steam {
  background: linear-gradient(135deg, #1b2838, #2a475e);
  color: #fff; border: 1px solid rgba(103,193,245,.35); padding: 9px 18px;
}
.btn-steam svg { fill: currentColor; }
.btn-steam:hover {
  color: #fff; transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(42,71,94,.55);
  border-color: rgba(103,193,245,.7);
}

/* --- слот авторизации в шапке --- */
.auth-slot { position: relative; display: flex; align-items: center; }
.auth-chip {
  display: flex; align-items: center; gap: 9px;
  background: rgba(255,255,255,.05); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 14px 5px 5px; cursor: pointer;
  color: var(--text); font-family: inherit; font-size: 14px;
  transition: .25s var(--ease);
}
.auth-chip:hover { border-color: rgba(229,19,31,.5); background: rgba(229,19,31,.08); }
.auth-avatar {
  width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  border: 1px solid rgba(255,255,255,.2); display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-weight: 800; font-size: 14px;
}
.auth-avatar-fallback { font-size: 13px; }
.auth-name { font-weight: 600; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-role { font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid currentColor; }
.role-owner   { color: #ffd07a; background: rgba(255,190,80,.12); }
.role-admin   { color: #ff8f8f; background: rgba(229,19,31,.12); }
.role-moder   { color: #7fd8ff; background: rgba(58,178,240,.12); }
.role-player  { color: #a0a2ad; background: rgba(255,255,255,.05); }

.auth-menu {
  position: absolute; top: calc(100% + 10px); right: 0; min-width: 240px; z-index: 130;
  background: var(--panel-2); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 8px;
  display: grid; gap: 2px; animation: menuIn .18s var(--ease);
}
@keyframes menuIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.auth-menu a, .auth-menu button {
  display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 8px;
  background: none; border: 0; color: var(--text-dim); font-family: inherit; font-size: 14px; cursor: pointer;
}
.auth-menu a:hover, .auth-menu button:hover { background: rgba(255,255,255,.06); color: #fff; }

.nav-admin {
  font-size: 13.5px; font-weight: 600; color: #ffd07a;
  background: rgba(255,190,80,.10); border: 1px solid rgba(255,190,80,.35);
  padding: 8px 14px; border-radius: 999px; white-space: nowrap;
}
.nav-admin:hover { color: #fff; background: rgba(255,190,80,.2); }

/* --- модалка входа --- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px;
  background: rgba(4,4,6,.78); backdrop-filter: blur(6px); animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 100%; max-width: 460px; position: relative;
  background: linear-gradient(170deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 30px; box-shadow: var(--shadow); animation: modalIn .28s var(--ease);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
.modal-close {
  position: absolute; top: 12px; right: 14px; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,.05); border: 1px solid var(--line); color: var(--text);
  font-size: 20px; line-height: 1; cursor: pointer;
}
.modal-close:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.modal-head { text-align: center; margin-bottom: 22px; }
.modal-head h3 { font-size: 22px; margin-bottom: 8px; }
.modal-sub { color: var(--muted); font-size: 13.5px; }
.steam-badge {
  width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 30% 25%, #3a6d91, #16202d);
  border: 1px solid rgba(103,193,245,.4); box-shadow: 0 0 24px rgba(103,193,245,.25);
}
.steam-badge svg { width: 32px; height: 32px; fill: #c7d5e0; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.field input, .grant-form input, .grant-form select {
  width: 100%; padding: 11px 14px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,.04); border: 1px solid var(--line);
  color: var(--text); font-family: inherit; font-size: 14px;
}
.field input:focus, .grant-form input:focus, .grant-form select:focus {
  outline: none; border-color: rgba(229,19,31,.6); background: rgba(229,19,31,.06);
}
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions .btn { flex: 1; }
.modal-foot { margin-top: 14px; font-size: 12.5px; color: var(--muted); text-align: center; }
.modal-quick {
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12.5px; color: var(--muted);
}
.modal-quick button {
  background: rgba(255,255,255,.05); border: 1px solid var(--line); color: var(--text-dim);
  padding: 6px 12px; border-radius: 999px; font-size: 12.5px; cursor: pointer; font-family: inherit;
}
.modal-quick button:hover { border-color: var(--accent-2); color: #fff; }

/* --- админ-панель --- */
.admin-wrap { padding: 36px 24px 70px; }
.admin-bar {
  display: flex; gap: 16px; align-items: center; justify-content: space-between;
  flex-wrap: wrap; margin-bottom: 22px; padding: 16px 20px;
  background: linear-gradient(170deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--radius);
}
.admin-who { display: flex; align-items: center; gap: 12px; }
.admin-who .table-avatar { width: 44px; height: 44px; }
.tag {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 700; border: 1px solid currentColor;
}
.tag-ok { color: #58d68d; background: rgba(35,160,90,.12); }
.tag-bad { color: #ff8f8f; background: rgba(229,19,31,.12); }
.tag-demo { color: #ffd07a; background: rgba(255,190,80,.1); }
.admin-stats { max-width: none; margin-bottom: 22px; grid-template-columns: repeat(4, 1fr); }
.grant-card .grant-form {
  display: grid; grid-template-columns: 2fr 1fr 160px auto; gap: 10px; margin-top: 16px;
}
.panel.warn { border-color: rgba(255,190,80,.4); background: linear-gradient(170deg, rgba(255,190,80,.1), var(--panel)); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

.tabs { display: flex; gap: 8px; margin: 26px 0 16px; flex-wrap: wrap; }
.tab-btn {
  padding: 10px 18px; border-radius: 999px; cursor: pointer; font-family: inherit; font-size: 14px;
  background: rgba(255,255,255,.04); border: 1px solid var(--line); color: var(--text-dim);
  transition: .25s var(--ease);
}
.tab-btn:hover { color: #fff; border-color: var(--accent-2); }
.tab-btn.active { color: #fff; background: var(--accent-soft); border-color: rgba(229,19,31,.5); }
.tools-row { margin-bottom: 14px; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 760px; }
.admin-table th {
  background: rgba(229,19,31,.12); text-align: left; padding: 12px 16px;
  font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: #fff; white-space: nowrap;
}
.admin-table td { padding: 12px 16px; border-top: 1px solid var(--line); vertical-align: middle; }
.admin-table tr:hover td { background: rgba(255,255,255,.025); }
.admin-table .empty { text-align: center; color: var(--muted); padding: 30px; }
.cell-user { display: flex; gap: 12px; align-items: center; }
.cell-user .table-avatar { width: 40px; height: 40px; font-size: 16px; }
.steam-id {
  font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--muted);
  cursor: pointer; transition: color .2s;
}
.steam-id:hover { color: var(--accent-2); }
.steam-id.copied { color: #58d68d; }
.role-select {
  padding: 7px 10px; border-radius: 8px; background: rgba(255,255,255,.05);
  border: 1px solid var(--line); color: var(--text); font-family: inherit; font-size: 13.5px;
}
.role-tag { font-size: 12px; padding: 3px 10px; border-radius: 999px; border: 1px solid currentColor; }
.cell-actions { display: flex; gap: 6px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 9px; cursor: pointer; font-size: 15px;
  background: rgba(255,255,255,.05); border: 1px solid var(--line);
}
.icon-btn:hover { background: rgba(229,19,31,.15); border-color: rgba(229,19,31,.5); }
.icon-btn.danger:hover { background: rgba(229,19,31,.3); }

.admin-gate { display: grid; place-items: center; padding: 40px 0; }
.gate-card {
  max-width: 460px; text-align: center; padding: 40px 32px;
  background: linear-gradient(170deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--radius);
}
.gate-icon { font-size: 44px; margin-bottom: 12px; }
.gate-card h2 { font-size: 24px; margin-bottom: 10px; }
.gate-card p { color: var(--muted); margin-bottom: 20px; }

@media (max-width: 900px) {
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .grant-card .grant-form { grid-template-columns: 1fr; }
  .auth-name { max-width: 90px; }
}
@media (max-width: 760px) {
  .nav-admin span, .auth-role { display: none; }
  .auth-slot { order: -1; }
}
