/*
 * Тема «Архивов Цитадели» в стиле промо-лендинга.
 *
 * Подключается ПОСЛЕ style.css и wiki.css и переопределяет их токены:
 * палитра породы и янтаря из игры, шрифты лендинга (Alumni Sans — заголовки,
 * Golos Text — текст), фон из текстуры Ржавого Эшелона, без CRT-полос.
 * Вёрстку и скрипты вики не трогает: всё держится на переменных wiki.css.
 */

:root {
  --bg-dark: #1b110d;
  --bg-body: #170f0b;
  --bg-panel: #22160f;
  --bg-panel-translucent: rgba(27, 17, 13, 0.9);
  --bg-card: #24170f;
  --bg-card-hover: #2e1d14;
  --bg-card-active: #382418;
  --bg-input: #140c09;

  --border: #3f2c21;
  --border-color: #3f2c21;
  --border-subtle: #2f2118;
  --border-bright: #5a4030;
  --border-focus: #b9d4f5;

  --text-main: #ede3d3;
  --text-muted: #b3a492;
  --text-dim: #8a7a69;
  --text-bright: #fff8ec;

  /* Янтарь — кнопка «БУРИТЬ»; голубой — строки HUD и эфира */
  --amber: #e58a2b;
  --amber-bright: #f2a95c;
  --amber-glow: rgba(229, 138, 43, 0.35);
  --amber-dim: rgba(229, 138, 43, 0.12);
  --cyan: #8fb3dc;
  --cyan-bright: #b9d4f5;
  --cyan-glow: rgba(185, 212, 245, 0.3);
  --cyan-dim: rgba(185, 212, 245, 0.1);
  --green: #6fe0c2;
  --green-bright: #9befd8;
  --green-dim: rgba(111, 224, 194, 0.12);
  --purple: #a893ff;
  --purple-bright: #c4b6ff;
  --purple-dim: rgba(168, 147, 255, 0.12);

  --font-display: "Alumni Sans", "Arial Narrow", sans-serif;
  --font-sans: "Golos Text", "Segoe UI", sans-serif;
  /* Моноширинный остаётся только там, где это данные: формулы и код */
  --font-mono: "Golos Text", "Segoe UI", sans-serif;
  --font-code: "JetBrains Mono", "Consolas", monospace;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;
}

html, body {
  background-color: var(--bg-body);
  font-family: var(--font-sans);
  /* style.css ставил overflow-x: hidden — это делает html прокручиваемым
     контейнером, и липкая шапка с боковыми колонками уезжали вместе
     со страницей. clip запрещает горизонтальную прокрутку, не ломая sticky */
  overflow-x: clip;
}

/* Порода под всей вики — та же текстура, что в первом биоме лендинга */
body {
  background-image:
    linear-gradient(rgba(23, 15, 11, 0.93), rgba(23, 15, 11, 0.97)),
    url(assets/site/rock_rusty.webp);
  background-size: auto, 200px 200px;
  background-attachment: fixed;
}

.crt-overlay, .crt-vignette { display: none !important; }

/* Капс и разрядка терминала — прочь: подписи читаются обычным регистром */
.wiki-header *, .wiki-layout *, .wiki-sidebar * {
  text-transform: none !important;
  letter-spacing: normal !important;
}

code, pre, kbd, .formula, [class*="formula"] { font-family: var(--font-code); }

/* ---------- Шапка ---------- */

.wiki-header {
  background: rgba(23, 15, 11, 0.94);
  border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.wiki-brand .brand-icon, .wiki-brand .brand-badge { display: none; }

.wiki-brand .brand-title {
  font: 800 1.9rem/1 var(--font-display);
  color: var(--text-main);
  text-shadow: none;
}

.wiki-brand .brand-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.btn-back-landing, .btn-ctrl, .btn-shaft-toggle {
  font-family: var(--font-sans);
  border-radius: var(--radius-sm);
}

.wiki-search-input {
  font-family: var(--font-sans);
  border-radius: var(--radius-md);
}

/* Ссылки промо-кампании в шапке: те же кнопки, что на лендинге */
.wiki-promo {
  display: flex;
  gap: 8px;
  align-items: center;
}

.wiki-promo a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border-radius: 6px;
  font: 600 0.9rem/1 var(--font-sans);
  text-decoration: none;
  white-space: nowrap;
}

.wiki-promo .promo-play {
  background: var(--amber);
  color: #2a1406;
  border: 1px solid var(--amber-bright);
}

.wiki-promo .promo-discord {
  color: var(--text-main);
  border: 1px solid var(--border-bright);
}

.wiki-promo .promo-soon {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 2px 5px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.22);
}

.wiki-promo a[data-live] .promo-soon { display: none; }

/* Переключатель языка: список самоназваний, как на лендинге */
.wiki-lang-select {
  height: 36px;
  max-width: 11rem;
  padding: 0 28px 0 10px;
  font: 600 0.8rem/1 var(--font-mono);
  color: var(--amber-bright);
  background: var(--bg-dark) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23d9822b'/%3E%3C/svg%3E") no-repeat right 10px center;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-sm);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.wiki-lang-select:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 1px;
}

.wiki-lang-select option {
  color: var(--text-main);
  background: var(--bg-dark);
}

@media (max-width: 1180px) {
  .wiki-promo .promo-discord { display: none; }
}

@media (max-width: 760px) {
  .wiki-promo { display: none; }
}

/* ---------- Статья ---------- */

.wiki-title {
  font: 800 clamp(2.6rem, 5vw, 4rem)/0.95 var(--font-display);
  color: var(--text-bright);
  text-shadow: none;
  text-wrap: balance;
}

.article-header h2, .wiki-article h2, .article-section h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.1rem;
  line-height: 1;
  color: var(--text-main);
}

.article-header h3, .wiki-article h3 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
}

/* Цвет категории — кромкой, а не свечением неона */
[class*="status-"] { box-shadow: none !important; text-shadow: none !important; }

/* Картинки статей — с чистых игровых ассетов, на тёмной подложке */
.wiki-layout img { image-rendering: auto; }

/* ---------- Подвал вики ---------- */

.wiki-foot {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
  justify-content: space-between;
  padding: 28px clamp(16px, 4vw, 40px) 36px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.95rem;
}

.wiki-foot a { color: var(--text-main); }

/* ---------- Живой ствол под вики ---------- */

.shaft {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  opacity: 0.85;
  pointer-events: none;
}

.wiki-shafted { background-image: none; }

/* Шапка остаётся липкой (её position задаёт wiki.css), просто поверх холста */
.wiki-shafted .wiki-header { z-index: 20; }
.wiki-shafted .wiki-layout,
.wiki-shafted .wiki-foot { position: relative; z-index: 1; }

/* Боковые колонки прозрачные — в них виден ствол; статья — на панели */
.wiki-shafted .wiki-sidebar,
.wiki-shafted aside {
  background: rgba(23, 15, 11, 0.6);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

/* Оглавление — над буром: почти прозрачное, без размытия, текст с тенью */
.wiki-shafted .wiki-toc {
  background: rgba(23, 15, 11, 0.22);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
}

.wiki-shafted main,
.wiki-shafted .wiki-content,
.wiki-shafted .wiki-article {
  background: rgba(23, 15, 11, 0.86);
}

/* Узкий телефон: срез скважины и звук уступают место языку и поиску */
@media (max-width: 560px) {
  .btn-shaft-toggle, #btn-sound-toggle, .btn-back-landing { display: none !important; }
  .wiki-header-inner { gap: 8px; }
}

/* Срез ствола: полосы градиента — границы биомов игры (0–800–1500–3000–5000–6000 м
   на шкале 6500 м), колонка шире под названия, значения мельче длинных имён */
.shaft-modal-body { grid-template-columns: 300px 1fr; }
.shaft-track-bar {
  background: linear-gradient(
    to bottom,
    #78350f 0%, #78350f 12.3%,
    #374151 12.3%, #374151 23.1%,
    #991b1b 23.1%, #991b1b 46.2%,
    #065f46 46.2%, #065f46 76.9%,
    #3b0764 76.9%, #3b0764 92.3%,
    #000000 92.3%, #000000 100%
  );
}
.shaft-hotspot-pin { transform: translateY(-50%); }
.shaft-telemetry-card .card-val { font-size: 1.05rem; line-height: 1.3; }

/* Подпись радиограммы — на языке страницы: текст кладёт wiki.js в data-radio-label */
.wiki-quote[data-radio-label]::before { content: attr(data-radio-label); }
