/* AnarchyRofl: общий стиль. Тёмная тема, один акцентный цвет (латунь), системные шрифты. */

:root {
  color-scheme: dark;
  --bg: #111215;
  --bg-2: #16181c;
  --panel: #1c1f24;
  --panel-2: #23272d;
  --line: #333840;
  --text: #ece9e2;
  --muted: #a9a69d;
  --accent: #e0a93c;
  --accent-ink: #17120a;
  --red: #c92b30;          /* второй акцент (цвет логотипа): главные кнопки */
  --red-hover: #a82024;
  --red-text: #ff8a84;
  --on-red: #ffffff;
  --good: #8fd694;
  --bad: #f08a7a;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --wrap: 1080px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.65 var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }

img { max-width: 100%; height: auto; }
.pix { image-rendering: pixelated; image-rendering: crisp-edges; }

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: #f3c466; }

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

.skip {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: 10px 16px; font-weight: 700;
}
.skip:focus { left: 8px; top: 8px; }

[hidden] { display: none !important; }

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

/* ----- Шапка ----- */
.site-header { background: var(--bg-2); border-bottom: 2px solid var(--line); position: relative; }
.site-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  background: repeating-linear-gradient(135deg, var(--red) 0 8px, transparent 8px 16px);
  opacity: .8;
}
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 24px; padding-top: 6px; padding-bottom: 6px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand img { width: 44px; height: 44px; flex: none; }
.brand span { font: 700 1.15rem/1 var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.brand:hover { color: var(--accent); }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 4px; }
.site-nav a {
  display: block; padding: 6px 10px; text-decoration: none; color: var(--muted);
  font-size: .95rem; border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }

/* ----- Герой ----- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  background:
    radial-gradient(700px 420px at 78% 40%, rgba(201,43,48,.22), transparent 65%),
    radial-gradient(520px 360px at 95% 100%, rgba(140,70,220,.16), transparent 70%),
    linear-gradient(180deg, var(--bg-2), var(--bg));
  border-bottom: 2px solid var(--line);
}
.hero::before, .hero::after {
  content: ""; position: absolute; z-index: -1; background: url("gear.svg") center / contain no-repeat;
  animation: spin 120s linear infinite;
}
.hero::before { width: 420px; height: 420px; left: -150px; bottom: -190px; opacity: .55; }
.hero::after { width: 200px; height: 200px; right: 40px; top: -80px; animation-direction: reverse; opacity: .45; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .hero::before, .hero::after { animation: none; } }

.hero .wrap { padding-top: 44px; padding-bottom: 44px; }
.hero-grid { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); align-items: center; }
@media (min-width: 820px) { .hero-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); } }
.hero-logo { justify-self: center; width: 100%; text-align: center; }
.hero-logo img { width: min(100%, 380px); height: auto; filter: drop-shadow(0 0 30px rgba(201,43,48,.35)); }
.eyebrow { font: 600 .8rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--red-text); margin: 0 0 14px; }
.hero h1 { font-size: clamp(2.4rem, 7vw, 4.2rem); line-height: 1.05; margin: 0 0 12px; letter-spacing: -.01em; }
.hero .lead { font-size: clamp(1.1rem, 2.6vw, 1.4rem); color: var(--text); margin: 0 0 8px; max-width: 34ch; }
.hero .sub { color: var(--muted); margin: 0 0 24px; max-width: 56ch; }

.page-head { background: var(--bg-2); border-bottom: 2px solid var(--line); }
.page-head .wrap { padding-top: 32px; padding-bottom: 28px; }
.page-head h1 { margin: 0 0 6px; font-size: clamp(1.8rem, 5vw, 2.6rem); line-height: 1.15; }
.page-head p { margin: 0; color: var(--muted); max-width: 70ch; }

/* ----- Кнопки ----- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; min-height: 44px; font: 700 .95rem/1.2 var(--sans); text-decoration: none; cursor: pointer;
  background: var(--red); color: var(--on-red); border: 2px solid var(--red); border-radius: 2px;
  box-shadow: 3px 3px 0 rgba(0,0,0,.55);
}
.btn:hover { background: var(--red-hover); border-color: var(--red-hover); color: var(--on-red); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 rgba(0,0,0,.55); }
.btn.ghost { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn.ghost:hover { background: rgba(224,169,60,.14); border-color: #f3c466; color: #f3c466; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0 0; }

/* ----- Секции ----- */
.section { padding: 44px 0; }
.section + .section { border-top: 1px solid var(--line); }
.section.alt { background: var(--bg-2); }
h2 { font-size: clamp(1.4rem, 3.4vw, 1.9rem); line-height: 1.25; margin: 0 0 14px; }
h3 { font-size: 1.15rem; line-height: 1.3; margin: 22px 0 8px; }
h2 + .sec-lead, .sec-lead { color: var(--muted); margin: -4px 0 22px; max-width: 70ch; }
p { margin: 0 0 12px; }
ul, ol { padding-left: 1.3em; margin: 0 0 14px; }
li { margin: 4px 0; }
.prose { max-width: 72ch; }
.muted { color: var(--muted); }
code, kbd, .cmd {
  font-family: var(--mono); font-size: .92em; background: var(--panel-2); color: #f3d79a;
  padding: 1px 5px; border: 1px solid var(--line); border-radius: 2px; white-space: nowrap;
}
.long { white-space: normal; }

/* ----- Карточки ----- */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); }
.card {
  background: var(--panel); border: 2px solid var(--line); padding: 18px 18px 14px;
  clip-path: polygon(0 4px, 4px 4px, 4px 0, calc(100% - 4px) 0, calc(100% - 4px) 4px, 100% 4px, 100% calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 4px calc(100% - 4px), 0 calc(100% - 4px));
}
.card h3 { margin: 0 0 6px; font-size: 1.1rem; }
.card p:last-child, .card ul:last-child { margin-bottom: 4px; }
.icons { display: flex; gap: 8px; margin: 0 0 10px; }
.icons img { width: 32px; height: 32px; }
a.card.link { display: block; color: inherit; text-decoration: none; }
a.card.link:hover { border-color: var(--accent); }
a.card.link:focus-visible { outline-offset: -6px; }
.card .ico { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.card .ico img { width: 48px; height: 48px; flex: none; }
.card .ico h3 { margin: 0; }

.panel { background: var(--panel); border: 2px solid var(--line); padding: 18px 20px; }
.note {
  border-left: 4px solid var(--accent); background: var(--panel); padding: 12px 16px; margin: 16px 0; max-width: 78ch;
}
.note.warn { border-left-color: var(--bad); }
.note p:last-child { margin-bottom: 0; }
.note strong:first-child { color: var(--accent); }

.badge {
  display: inline-block; font: 600 .75rem/1 var(--mono); letter-spacing: .04em; text-transform: uppercase;
  padding: 4px 8px; border: 1px solid var(--line); border-radius: 2px; color: var(--muted); vertical-align: middle;
}
.badge.ok { color: var(--good); border-color: #3c5e41; }
.badge.soon { color: var(--accent); border-color: #6b5320; }

/* ----- Как зайти ----- */
.join { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 820px) { .join { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.ip-box { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 8px 0 6px; }
.ip-box .ip {
  font: 700 clamp(1.05rem, 3.6vw, 1.4rem)/1.2 var(--mono); background: var(--bg); color: var(--text);
  border: 2px solid var(--red); padding: 10px 14px; user-select: all; word-break: break-all;
}
.copy-note { font-size: .9rem; color: var(--good); min-height: 1.4em; }
.meta-line { color: var(--muted); font-size: .95rem; margin: 6px 0 0; }

ol.steps { list-style: none; counter-reset: st; padding: 0; margin: 0; }
ol.steps > li { counter-increment: st; position: relative; padding: 0 0 16px 52px; margin: 0; min-height: 40px; }
ol.steps > li::before {
  content: counter(st); position: absolute; left: 0; top: 0; width: 38px; height: 38px;
  display: grid; place-items: center; background: var(--red); color: var(--on-red);
  font: 700 1.1rem/1 var(--mono); box-shadow: 3px 3px 0 rgba(0,0,0,.55);
}
ol.steps h3 { margin: 0 0 2px; font-size: 1.05rem; }
ol.steps p { margin: 0; color: var(--muted); }
ol.steps p + p { margin-top: 6px; }

.status {
  display: inline-flex; align-items: center; gap: 10px; background: var(--panel); border: 2px solid var(--line);
  padding: 8px 14px; font-size: .95rem; margin-top: 18px;
}
.status .dot { width: 10px; height: 10px; background: var(--muted); display: inline-block; }
.status.on .dot { background: var(--good); }
.status.off .dot { background: var(--bad); }

/* ----- Таблицы ----- */
.table-wrap { overflow-x: auto; margin: 12px 0 20px; border: 2px solid var(--line); background: var(--panel); }
.table-wrap:focus-visible { outline-offset: 0; }
table.data { border-collapse: collapse; width: 100%; min-width: 560px; font-size: .95rem; }
table.data caption { text-align: left; padding: 10px 14px; font-weight: 700; color: var(--accent); caption-side: top; }
table.data th, table.data td { text-align: left; padding: 9px 14px; border-top: 1px solid var(--line); vertical-align: top; }
table.data thead th { background: var(--panel-2); color: var(--text); font-weight: 700; border-top: 0; }
table.data tbody th { font-weight: 600; }
table.data td.num, table.data th.num { text-align: right; white-space: nowrap; }
table.data tr.sep th { background: var(--bg-2); color: var(--accent); font: 700 .8rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.plus { color: var(--good); font-weight: 600; }
.minus { color: var(--bad); font-weight: 600; }
.rank-name { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; white-space: nowrap; }
.rank-name img { width: 27px; height: 27px; }

/* ----- Расы ----- */
.race { scroll-margin-top: 16px; }
.race-head { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.race-head img { width: 64px; height: 64px; flex: none; }
.race-head h2 { margin: 0; }
.race-head p { margin: 0; color: var(--muted); }
.lore { font-style: italic; color: var(--muted); border-left: 3px solid var(--line); padding-left: 14px; max-width: 64ch; }

/* ----- FAQ / раскрывашки ----- */
details.faq { background: var(--panel); border: 2px solid var(--line); margin: 0 0 10px; }
details.faq summary {
  cursor: pointer; padding: 14px 16px; font-weight: 700; list-style: none; display: flex; gap: 12px; align-items: baseline;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::before { content: "+"; font: 700 1.2rem/1 var(--mono); color: var(--accent); width: 1ch; flex: none; }
details.faq[open] summary::before { content: "\2212"; }
details.faq summary:hover { background: var(--panel-2); }
details.faq .ans { padding: 2px 16px 14px 44px; max-width: 76ch; }
details.faq .ans p:last-child { margin-bottom: 0; }

/* ----- Оглавление и разделы мира ----- */
.layout { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); padding: 32px 0 44px; }
@media (min-width: 900px) { .layout { grid-template-columns: 230px minmax(0, 1fr); align-items: start; } }
.content { min-width: 0; }
.toc { background: var(--panel); border: 2px solid var(--line); padding: 14px 16px; }
@media (min-width: 900px) { .toc { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; } }
.toc h2 { font: 700 .8rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin: 0 0 10px; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0; }
.toc a { display: block; padding: 5px 0; color: var(--muted); text-decoration: none; font-size: .95rem; }
.toc a:hover { color: var(--text); }
.chap { padding-bottom: 30px; margin-bottom: 30px; border-bottom: 1px solid var(--line); scroll-margin-top: 14px; }
.chap:last-child { border-bottom: 0; }
.chap h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.chap h3 { margin-top: 18px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 10px 0 16px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
@media (max-width: 520px) { .kv { grid-template-columns: 1fr; gap: 0; } .kv dd { margin-bottom: 8px; } }

/* ----- Контакты ----- */
.contact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.contact-list li { margin: 0; }
.contact-list a.btn { width: 100%; }

.logo-kit { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); align-items: center; }
@media (min-width: 640px) { .logo-kit { grid-template-columns: 256px minmax(0, 1fr); } }
.logo-kit img { width: 256px; max-width: 100%; height: auto; background: var(--panel); border: 2px solid var(--line); padding: 8px; }

/* ----- Подвал ----- */
.site-footer { background: var(--bg-2); border-top: 2px solid var(--line); margin-top: 24px; padding: 28px 0 32px; font-size: .92rem; color: var(--muted); }
.site-footer .cols { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .site-footer .cols { grid-template-columns: 1.6fr 1fr; } }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.site-footer a { color: var(--text); }
.site-footer .legal { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }

/* ----- 404 ----- */
.nf { text-align: center; padding: 72px 0 56px; }
.nf .big { font: 700 clamp(4rem, 18vw, 8rem)/1 var(--mono); color: var(--accent); margin: 0; }

/* ----- Узкие экраны ----- */
@media (max-width: 560px) {
  .hero .wrap { padding-top: 36px; padding-bottom: 36px; }
  .hero::before { right: -170px; opacity: .6; }
  .hero::after { display: none; }
  .hero-logo img { width: min(100%, 260px); }
  .section { padding: 32px 0; }
  .bar { gap: 4px 12px; }
  .site-nav a { padding: 6px 8px; font-size: .9rem; }
  .btn { width: 100%; }
  .ip-box .btn { width: auto; }
  .btn-row { gap: 10px; }
  code, kbd, .cmd { white-space: normal; overflow-wrap: anywhere; }
}

@media print {
  body { background: #fff; color: #000; }
  .site-header, .site-footer .legal ~ *, .hero::before, .hero::after { display: none; }
  a { color: #000; }
}
