/* SLOP Wiki — токены темы */
:root {
  --bg: #0c0d0b;
  --bg-2: #121410;
  --panel: #171a15;
  --panel-2: #1e221b;
  --line: #2a2f26;
  --line-2: #394034;
  --text: #e8ecdf;
  --text-2: #b3baa6;
  --muted: #7d8672;
  --acid: #b6f23a;
  --acid-ink: #111a00;
  --acid-soft: rgba(182, 242, 58, .12);
  --blood: #ff4d4f;
  --blood-soft: rgba(255, 77, 79, .13);
  --gold: #ffc53d;
  --sky: #5eb1ff;
  --violet: #b690ff;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --radius: 14px;
  --radius-sm: 9px;
  --font: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Unbounded", "Onest", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", monospace;
  --maxw: 1240px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f4f5ef;
  --bg-2: #eceee4;
  --panel: #ffffff;
  --panel-2: #f5f6f0;
  --line: #dde0d2;
  --line-2: #c8ccba;
  --text: #171a12;
  --text-2: #444b3a;
  --muted: #6d7560;
  --acid: #4f8a00;
  --acid-ink: #ffffff;
  --acid-soft: rgba(79, 138, 0, .1);
  --blood: #d92d2f;
  --blood-soft: rgba(217, 45, 47, .09);
  --gold: #a86b00;
  --sky: #1f6fd1;
  --violet: #6e45d6;
  --shadow: 0 8px 24px rgba(40, 50, 20, .12);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 15.5px/1.6 var(--font);
  -webkit-font-smoothing: antialiased; min-height: 100vh;
}
body::before { /* лёгкий токсичный отсвет */
  content: ""; position: fixed; inset: -20vh -10vw auto; height: 60vh; pointer-events: none; z-index: 0;
  background: radial-gradient(60% 60% at 20% 0%, var(--acid-soft), transparent 70%),
              radial-gradient(50% 50% at 90% 10%, var(--blood-soft), transparent 70%);
}
a { color: var(--acid); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--acid); color: var(--acid-ink); }
.hidden { display: none !important; }

/* ---------- шапка */
.top {
  position: sticky; top: 0; z-index: 30; backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 82%, transparent); border-bottom: 1px solid var(--line);
}
.top-in { max-width: var(--maxw); margin: auto; display: flex; align-items: center; gap: 18px; padding: 12px 20px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); font: 800 21px/1 var(--display); letter-spacing: .02em; }
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--acid);
  color: var(--acid-ink); font-size: 17px; transform: rotate(-6deg); box-shadow: 0 0 22px var(--acid-soft);
}
.logo small { display: block; font: 500 11px/1.2 var(--font); color: var(--muted); letter-spacing: 0; margin-top: 3px; }
.nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav a {
  padding: 7px 12px; border-radius: 9px; color: var(--text-2); font-weight: 550; white-space: nowrap; font-size: 14.5px;
}
.nav a:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.nav a.on { background: var(--acid-soft); color: var(--acid); }
.top-actions { display: flex; gap: 8px; align-items: center; }
.search-btn {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px 7px 12px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--panel); color: var(--muted); cursor: pointer; min-width: 170px; font-size: 14px;
}
.search-btn kbd { margin-left: auto; }
kbd { font: 12px var(--mono); padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line-2); color: var(--muted); }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel);
  cursor: pointer; display: grid; place-items: center; color: var(--text-2);
}
.icon-btn:hover, .search-btn:hover { border-color: var(--line-2); color: var(--text); }
.menu-btn { display: none; }

/* ---------- раскладка */
main { position: relative; z-index: 1; max-width: var(--maxw); margin: auto; padding: 28px 20px 80px; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 6px 0 22px; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -.01em; line-height: 1.2; }
.page-head h1 { font-size: clamp(26px, 4vw, 38px); margin: 0; }
.page-head p { margin: 6px 0 0; color: var(--text-2); max-width: 70ch; }
.eyebrow { font: 600 12px/1 var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--acid); margin-bottom: 10px; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 36px 0 14px; }
.section-title h2 { font-size: 19px; margin: 0; }
.section-title a { font-size: 14px; }
.grid { display: grid; gap: 14px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: 1.55fr 1fr; gap: 22px; align-items: start; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.pad { padding: 18px 20px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- главная */
.hero {
  position: relative; overflow: hidden; padding: 38px 36px; border-radius: 20px; border: 1px solid var(--line);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--panel) 92%, var(--acid)) 0%, var(--panel) 55%, color-mix(in srgb, var(--panel) 90%, var(--blood)) 100%);
}
.hero h1 { font-size: clamp(34px, 6vw, 64px); margin: 0; line-height: 1; }
.hero h1 em { font-style: normal; color: var(--acid); text-shadow: 0 0 30px var(--acid-soft); }
.hero p { font-size: 17px; color: var(--text-2); max-width: 62ch; margin: 14px 0 0; }
.hero .chips { margin-top: 18px; }
.hero-deco {
  position: absolute; right: -20px; top: -30px; font: 900 190px/1 var(--display); color: var(--acid); opacity: .06;
  transform: rotate(-8deg); pointer-events: none; user-select: none;
}
.stat { padding: 16px 18px; }
.stat b { display: block; font: 700 30px/1.1 var(--display); }
.stat span { color: var(--muted); font-size: 13.5px; }
.stat.acid b { color: var(--acid); }
.stat.blood b { color: var(--blood); }
.stat.gold b { color: var(--gold); }
.stat.sky b { color: var(--sky); }

/* ---------- чипы, бейджи */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: 13px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text-2); cursor: pointer; white-space: nowrap;
}
.chip:hover { border-color: var(--line-2); color: var(--text); text-decoration: none; }
.chip.on { background: var(--acid); border-color: var(--acid); color: var(--acid-ink); font-weight: 600; }
.chip .dot, .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 6px; font-size: 12px;
  font-weight: 600; background: var(--panel-2); color: var(--text-2); border: 1px solid var(--line); white-space: nowrap;
}
.badge.own { background: var(--acid-soft); color: var(--acid); border-color: transparent; }
.badge.patched { background: color-mix(in srgb, var(--violet) 15%, transparent); color: var(--violet); border-color: transparent; }
.badge.gone { background: var(--blood-soft); color: var(--blood); border-color: transparent; }
.badge.high { background: var(--blood-soft); color: var(--blood); border-color: transparent; }
.badge.low { color: var(--muted); }
.badge.bot { background: color-mix(in srgb, var(--sky) 15%, transparent); color: var(--sky); border-color: transparent; }

/* ---------- карточки модов */
.mod-card {
  display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; color: var(--text); position: relative;
  transition: transform .15s, border-color .15s;
}
.mod-card:hover { transform: translateY(-2px); border-color: var(--line-2); text-decoration: none; }
.mod-card h3 { font-size: 16px; margin: 0; display: flex; align-items: center; gap: 8px; }
.mod-card p { margin: 0; color: var(--text-2); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mod-card .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.mod-card.own { border-top: 3px solid var(--c, var(--acid)); }
.mod-card.gone { opacity: .6; }
.own-tile {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: var(--text);
  border-left: 4px solid var(--c); transition: background .15s;
}
.own-tile:hover { background: var(--panel-2); text-decoration: none; }
.own-tile b { display: block; font-family: var(--display); font-size: 14.5px; }
.own-tile span { font-size: 12.5px; color: var(--muted); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.input {
  padding: 9px 13px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); outline: none; min-width: 0;
}
.input:focus { border-color: var(--acid); box-shadow: 0 0 0 3px var(--acid-soft); }
textarea.input { width: 100%; resize: vertical; min-height: 90px; line-height: 1.5; }
.grow { flex: 1; min-width: 200px; }
.cat-title { font: 600 13px/1 var(--font); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 28px 0 12px; }

/* ---------- лента прогресса */
.timeline { position: relative; }
.month { font: 700 15px/1 var(--display); color: var(--muted); margin: 30px 0 14px; text-transform: capitalize; }
.month:first-child { margin-top: 0; }
.tl-item { position: relative; padding-left: 28px; margin-bottom: 12px; }
.tl-item::before { content: ""; position: absolute; left: 7px; top: 22px; bottom: -14px; width: 2px; background: var(--line); }
.tl-item:last-child::before { display: none; }
.tl-dot { position: absolute; left: 0; top: 14px; width: 16px; height: 16px; border-radius: 50%; border: 3px solid var(--bg); background: var(--c, var(--acid)); }
.tl-card { padding: 12px 16px; cursor: pointer; }
.tl-card:hover { border-color: var(--line-2); }
.tl-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.tl-date { font: 600 12.5px var(--mono); color: var(--muted); white-space: nowrap; }
.tl-title { font-weight: 650; flex: 1; min-width: 200px; }
.tl-body { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.tl-item:not(.open) .tl-body { display: none; }

/* ---------- доска */
.board { display: grid; grid-template-columns: repeat(4, minmax(250px, 1fr)); gap: 14px; align-items: start; }
.col { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; max-height: calc(100vh - 230px); }
.col-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 10px; font-weight: 700; }
.col-head .count { color: var(--muted); font-weight: 500; font-size: 13px; }
.col-head button { margin-left: auto; }
.col-list { padding: 4px 10px 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; min-height: 80px; }
.col.drop .col-list { background: var(--acid-soft); border-radius: 10px; }
.col[data-status="idea"] .col-head .dot { background: var(--violet); }
.col[data-status="todo"] .col-head .dot { background: var(--sky); }
.col[data-status="doing"] .col-head .dot { background: var(--gold); }
.col[data-status="done"] .col-head .dot { background: var(--acid); }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; cursor: pointer;
  transition: border-color .12s, transform .12s; border-left: 3px solid var(--c, var(--line));
}
.card:hover { border-color: var(--line-2); border-left-color: var(--c, var(--line-2)); }
.card.dragging { opacity: .4; transform: rotate(2deg); }
.card.flash { animation: flash 1.4s; }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 3px var(--acid); } 100% { box-shadow: none; } }
.card-title { font-weight: 560; font-size: 14.5px; line-height: 1.4; word-break: break-word; }
.col[data-status="done"] .card-title { color: var(--text-2); text-decoration: line-through; text-decoration-color: var(--muted); }
.card-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.card-meta .sp { margin-left: auto; display: flex; gap: 8px; }
.quick-add { padding: 0 10px 10px; }
.quick-add textarea { min-height: 60px; font-size: 14px; }
.board-tabs { display: none; }
.empty { color: var(--muted); font-size: 13.5px; text-align: center; padding: 16px 8px; }

/* ---------- кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 15px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--panel-2); cursor: pointer; font-weight: 600; font-size: 14px; white-space: nowrap;
}
.btn:hover { border-color: var(--muted); text-decoration: none; }
.btn.primary { background: var(--acid); border-color: var(--acid); color: var(--acid-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--blood); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--panel-2); color: var(--text); }
.btn.sm { padding: 4px 10px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: default; }
.vote { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; border: 0; background: none; color: var(--muted); padding: 0; font-size: 12.5px; }
.vote.on { color: var(--acid); font-weight: 700; }

/* ---------- модалки */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .55); backdrop-filter: blur(3px); display: grid; place-items: start center; padding: 7vh 16px 16px; overflow-y: auto; }
.modal { width: min(720px, 100%); background: var(--panel); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: var(--shadow); }
.modal-head { display: flex; align-items: start; gap: 12px; padding: 18px 20px 0; }
.modal-head h2 { margin: 0; font-size: 20px; flex: 1; word-break: break-word; }
.modal-body { padding: 16px 20px 20px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 140px; }
.comment { padding: 10px 0; border-top: 1px solid var(--line); }
.comment-head { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.comment-head b { color: var(--text); }
.search-modal { width: min(640px, 100%); }
.search-modal input { width: 100%; border: 0; border-bottom: 1px solid var(--line); border-radius: 18px 18px 0 0; padding: 18px 20px; font-size: 17px; background: transparent; outline: none; }
.results { max-height: 60vh; overflow-y: auto; padding: 8px; }
.result { display: block; padding: 10px 12px; border-radius: 10px; color: var(--text); }
.result:hover, .result.sel { background: var(--panel-2); text-decoration: none; }
.result small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 60; padding: 10px 18px; border-radius: 12px; background: var(--text); color: var(--bg); font-weight: 600; box-shadow: var(--shadow); }

/* ---------- документы */
.doc-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 30px; align-items: start; }
.side { position: sticky; top: 84px; max-height: calc(100vh - 110px); overflow-y: auto; font-size: 14px; }
.side h4 { margin: 18px 0 6px; font: 600 12px/1 var(--font); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.side h4:first-child { margin-top: 0; }
.side a { display: block; padding: 5px 10px; border-radius: 8px; color: var(--text-2); line-height: 1.35; }
.side a:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.side a.on { background: var(--acid-soft); color: var(--acid); }
.side a.sub { padding-left: 22px; font-size: 13px; }
.md { max-width: 80ch; overflow-wrap: anywhere; }
.md h1 { font-size: 30px; margin: 0 0 16px; }
.md h2 { font-size: 21px; margin: 34px 0 10px; padding-top: 8px; }
.md h3 { font-size: 17px; margin: 24px 0 8px; }
.md h4 { font-size: 15px; margin: 18px 0 6px; }
.md p, .md ul, .md ol { margin: 0 0 12px; }
.md ul, .md ol { padding-left: 22px; }
.md li { margin: 3px 0; }
.md li::marker { color: var(--muted); }
.md code { font: 13px var(--mono); background: var(--panel-2); border: 1px solid var(--line); padding: 1px 5px; border-radius: 5px; }
.md pre { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; overflow-x: auto; }
.md pre code { border: 0; background: none; padding: 0; }
.md blockquote { margin: 0 0 12px; padding: 4px 16px; border-left: 3px solid var(--acid); color: var(--text-2); background: var(--acid-soft); border-radius: 0 8px 8px 0; }
.md table { border-collapse: collapse; margin: 0 0 14px; display: block; overflow-x: auto; font-size: 14px; }
.md th, .md td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
.md th { background: var(--panel-2); }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
.md strong { color: var(--text); }
.md img { max-width: 100%; }
.md > :first-child { margin-top: 0; }
.mod-hero { padding: 22px 24px; margin-bottom: 24px; border-top: 4px solid var(--c, var(--line-2)); }
.mod-hero h1 { margin: 0 0 8px; font-size: clamp(24px, 4vw, 34px); }
.mod-hero p { margin: 10px 0 0; color: var(--text-2); }
.related { margin-top: 30px; }

/* ---------- квесты */
.chapter { margin-bottom: 30px; }
.chapter-head { display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap; margin-bottom: 12px; }
.chapter-head h2 { margin: 0; font-size: 21px; }
.quest { padding: 14px 16px; }
.quest h3 { font: 650 15px/1.35 var(--font); margin: 0 0 6px; display: flex; gap: 8px; align-items: baseline; }
.quest p { margin: 0 0 6px; font-size: 14px; color: var(--text-2); }
.quest .reward { font-size: 12.5px; color: var(--gold); margin-top: 8px; }
.quest .deps { font-size: 12.5px; color: var(--muted); }
.quest:target { border-color: var(--acid); }

/* ---------- активность */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.feed li:first-child { border-top: 0; }
.feed time { color: var(--muted); font-size: 12.5px; white-space: nowrap; margin-left: auto; }
.avatar { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; color: #111; }

.footer { position: relative; z-index: 1; max-width: var(--maxw); margin: auto; padding: 24px 20px 40px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; }

/* ---------- адаптив */
@media (max-width: 1080px) {
  .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
  .search-btn { min-width: 0; }
  .search-btn .lbl, .search-btn kbd { display: none; }
}
@media (max-width: 860px) {
  .top-in { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  .logo small { display: none; }
  .top-actions { margin-left: auto; }
  .nav { order: 3; flex-basis: 100%; }
  main { padding: 18px 16px 60px; }
  .doc-layout { grid-template-columns: 1fr; }
  .side { position: static; max-height: none; }
  .side.collapsible:not(.open) .side-list { display: none; }
  .board { display: block; }
  .board .col { display: none; max-height: none; }
  .board .col.show { display: flex; }
  .board-tabs { display: flex; margin-bottom: 12px; }
  .hero { padding: 26px 20px; }
  .hero-deco { font-size: 120px; }
}
@media (max-width: 560px) {
  .cols-2, .cols-3, .cols-4 { grid-template-columns: minmax(0, 1fr); }
  .cols-4.stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat b { font-size: 24px; }
  .footer { padding: 20px 16px 30px; }
}
.side > button { display: none; }
@media (max-width: 860px) { .side > button { display: inline-flex; } }
.own-grid { gap: 8px; }
.own-grid .own-tile { padding: 10px 12px; }
.chapter .grid { align-items: start; }
@media (max-width: 1080px) and (min-width: 561px) { .own-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
