/* ── FONTS ── */
/* Грузятся с Google Fonts CDN, link в head index.blade.php.
   Локальные копии лежат в /fonts/, с диска не удалены.
   Откат: раскомментировать блок ниже и убрать link из head.
   Внутри закомментированного блока не должно быть вложенных комментариев:
   CSS их не поддерживает, внутренний закрывающий маркер обрывает внешний
   и убивает следующее за ним правило. */
/*
@font-face { font-family:'Inter'; font-style:normal; font-weight:300; font-display:swap; src:url('/fonts/inter-v20-cyrillic_latin-300.woff2') format('woff2'); }
@font-face { font-family:'Inter'; font-style:normal; font-weight:400; font-display:swap; src:url('/fonts/inter-v20-cyrillic_latin-regular.woff2') format('woff2'); }
@font-face { font-family:'Inter'; font-style:normal; font-weight:500; font-display:swap; src:url('/fonts/inter-v20-cyrillic_latin-500.woff2') format('woff2'); }
@font-face { font-family:'Inter'; font-style:normal; font-weight:600; font-display:swap; src:url('/fonts/inter-v20-cyrillic_latin-600.woff2') format('woff2'); }
@font-face { font-family:'Inter'; font-style:normal; font-weight:700; font-display:swap; src:url('/fonts/inter-v20-cyrillic_latin-700.woff2') format('woff2'); }
@font-face { font-family:'Manrope'; font-style:normal; font-weight:300; font-display:swap; src:url('/fonts/manrope-v20-cyrillic_latin-300.woff2') format('woff2'); }
@font-face { font-family:'Manrope'; font-style:normal; font-weight:400; font-display:swap; src:url('/fonts/manrope-v20-cyrillic_latin-regular.woff2') format('woff2'); }
@font-face { font-family:'Manrope'; font-style:normal; font-weight:700; font-display:swap; src:url('/fonts/manrope-v20-cyrillic_latin-700.woff2') format('woff2'); }
*/

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

:root {
  --bg: #0b0c10;
  --bg2: #131519;
  --bg3: #1a1d22;
  --border: #23262b;
  --text: #e8e8e8;
  --muted: #8a8a8a;
  --accent: #55b083;
  --accent2: #74c79b;
  --accent-rgb: 85,176,131;

  /* semantic surfaces */
  --heading: #ffffff;
  --on-accent: #071009;
  --surface: rgba(255,255,255,0.04);
  --surface2: rgba(255,255,255,0.03);
  --ghost: rgba(255,255,255,0.04);
  --nav-bg: rgba(11,12,16,0.72);
  --capsule-bg: rgba(48,52,60,0.5);
  /* сплошная подложка карточки игры и кнопка на ступень темнее */
  --card-solid: #16191e;
  --card-solid-2: #23262b;
  --nav-shadow: 0 6px 24px -10px rgba(0,0,0,0.75);
  --overlay: rgba(0,0,0,0.8);
  --panel: rgba(22,22,22,0.92);
  --panel2: rgba(22,22,22,0.95);
  --shadow: rgba(0,0,0,0.45);
  --scrollbar-track: #0b0c10;
  --scrollbar-thumb: #2a2e33;
  --scrollbar-thumb-hover: #3a3f46;
  --danger: #ff5050;
  --danger-text: #ff8080;
  --danger-soft: #ff6060;
  --avo-skin: #55b083;
  --avo-flesh: #b9e86b;
  --avo-pit: #b9783e;
  --avo-detail: #dfff9a;

  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;

  /* ── НИЖНИЙ БАР ──
     Единственный источник правды по геометрии таббара. На десктопе бара нет,
     поэтому высота = 0 и все calc(), которые её учитывают, схлопываются сами.
     Реальное значение выставляется ниже в @media (max-width: 899.98px). */
  --navbar-h: 0px;
  --tabbar-gap: 10px;
  /* Стекло только там, где под слоем реально движется контент:
     nav при скролле, точки и кнопка паузы поверх карусели. */
  --glass: blur(16px) saturate(120%);

  /* motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 240ms;
  --dur: 420ms;
  --dur-slow: 650ms;
}

html.light {
  --bg: #eef1f5;
  --bg2: #e4e8ee;
  --bg3: #dde2e9;
  --border: rgba(0,0,0,0.12);
  --text: #14171a;
  --muted: #5b6169;
  --accent: #1f7d47;
  --accent2: #17663a;
  --accent-rgb: 31,125,71;

  --heading: #0d1013;
  --on-accent: #ffffff;
  --scrollbar-track: #eef1f5;
  --scrollbar-thumb: #c3cad2;
  --scrollbar-thumb-hover: #aab2bc;
  --surface: rgba(255,255,255,0.78);
  --surface2: rgba(0,0,0,0.04);
  --ghost: rgba(0,0,0,0.06);
  --nav-bg: rgba(240,242,246,0.72);
  --capsule-bg: rgba(255,255,255,0.6);
  --card-solid: #ffffff;
  --card-solid-2: #eef1f5;
  --nav-shadow: 0 6px 20px -8px rgba(0,0,0,0.14);
  --overlay: rgba(18,21,25,0.45);
  --panel: rgba(252,253,255,0.96);
  --panel2: rgba(252,253,255,0.98);
  --shadow: rgba(0,0,0,0.14);
  --danger: #cf3b3b;
  --danger-text: #a92222;
  --danger-soft: #c22f2f;
  --avo-skin: #2f9e5c;
  --avo-flesh: #7fa832;
  --avo-pit: #8a5626;
  --avo-detail: #9bbd45;
}
/* НЕ ставить overflow-x: clip — Firefox режет им position:fixed (шапку) */
html { scroll-behavior: smooth; overflow-x: hidden; }

/* ── GLOBAL SMOOTHNESS ── */a,
button,
.article-card,
.contact-item,
.donate-card,
.amount-btn,
.nav-login,
.article-link,
.article-editicon,
.btn,
.form-submit,
.game-promo-btn {
  transition: color var(--dur-fast) var(--ease-soft),
              background-color var(--dur-fast) var(--ease-soft),
              border-color var(--dur-fast) var(--ease-soft),
              transform var(--dur-fast) var(--ease),
              opacity var(--dur-fast) var(--ease-soft),
              box-shadow var(--dur-fast) var(--ease-soft),
              gap var(--dur-fast) var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  .article-card:hover { transform: translateY(-3px); }
}
.modal-close, .login-close { transition: all var(--dur-fast) var(--ease-soft); }

@media (hover: hover) and (pointer: fine) {
  .modal-close:hover, .login-close:hover { transform: rotate(90deg); }
}

* { -webkit-tap-highlight-color: transparent; }

/* ── SCROLLBAR (theme-driven via variables) ── */
html {
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
  scrollbar-width: thin;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--scrollbar-track); }
::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 5px;
  border: 2px solid var(--scrollbar-track);
}

@media (hover: hover) and (pointer: fine) {
  ::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }
}
/* Firefox Android рисует НАСТОЯЩИЙ скроллбар, занимающий ширину — он лезет
   под шапку (right:5px мерится от ICB) и даёт горизонтальный оверфлоу. */
@media (pointer: coarse) {
  html { scrollbar-width: none; }
}

/* ── KEYBOARD FOCUS (quality floor) ── */
a:focus-visible, button:focus-visible,
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

body {
  background-color: var(--bg);
  color: var(--text);
  transition: background-color var(--dur) var(--ease-soft), color var(--dur) var(--ease-soft);
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  /* overflow-x: hidden здесь НЕ ставить: у body он заставляет overflow-y стать
     auto, body делается своим контейнером прокрутки — и position: sticky внутри
     умирает (прилипать не к чему, body по контенту не скроллится).
     Горизонтальный вылет уже режет html выше: у корневого элемента overflow
     передаётся вьюпорту, и сам html контейнером прокрутки не становится. */
  max-width: 100%;
}

/* ── NOISE TEXTURE ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* ── SCROLL PROGRESS ── */
.scroll-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  z-index: 200;
  pointer-events: none;
  background: transparent;
}

.scroll-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}

/* ── SCROLL REVEAL (slide in from right) ── */

/* Появление без горизонтального сдвига — для карточек в сетке (2 колонки),
   чтобы при любых сбоях таймингов JS они не "зависали" сдвинутыми и не
   вылезали за края контейнера. */

/* ── NAV ──
   Mobile: two rows (logo + user on top, links wrap below).
   Desktop (≥900): single row — logo | links | user. */
nav {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 3px);
  left: 5px; right: 5px;
  z-index: 100;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 10px 16px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--nav-bg);
  backdrop-filter: var(--glass);
  -webkit-backdrop-filter: var(--glass);
  box-shadow: var(--nav-shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 400ms ease, transform 400ms ease;
}
nav.visible { opacity: 1; pointer-events: auto; transform: none; }

/* Мобайл: шапка всегда в одну строку.
   Логотип слева, справа один слот — в нём блок пользователя (вход + тема)
   и навигация лежат друг на друге и перекрёстно гаснут.
   Высота слота постоянная (30px от кнопок), поэтому шапка не прыгает. */
@media (max-width: 899.98px) {
  nav {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: 14px;
  }
  .nav-logo { grid-area: 1 / 1; }
  .nav-links,
  .nav-user  { grid-area: 1 / 2; }

  .nav-links {
    flex-basis: auto;
    min-width: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(4px);
    transition: opacity 300ms var(--ease), transform 300ms var(--ease), visibility 0s linear 300ms;
  }
  nav.compact .nav-links {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    transition: opacity 300ms var(--ease), transform 300ms var(--ease), visibility 0s;
  }

  .nav-user {
    margin-left: auto;
    transition: opacity 300ms var(--ease), transform 300ms var(--ease), visibility 0s;
  }
  nav.compact .nav-user {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-4px);
    transition: opacity 300ms var(--ease), transform 300ms var(--ease), visibility 0s linear 300ms;
  }
}
@media (max-width: 899.98px) and (prefers-reduced-motion: reduce) {
  .nav-links, .nav-user,
  nav.compact .nav-links, nav.compact .nav-user { transition: none; }
}
@media (prefers-reduced-motion: reduce) {
  nav { transition: none; }
}

.nav-user {
  order: 2;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.nav-greeting {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
}
.nav-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  box-sizing: border-box;
  font-size: 0.75rem;
  line-height: 1;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--border);
  padding: 0 14px;
  border-radius: 8px;
  white-space: nowrap;
  transition: all 0.2s;
  background: none;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  vertical-align: middle;
}

@media (hover: hover) and (pointer: fine) {
  .nav-login:hover { color: var(--accent); border-color: var(--accent); }
}

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; box-sizing: border-box; padding: 0;
  border-radius: 50%; border: 1px solid var(--border);
  background: none; color: var(--muted); cursor: pointer; flex-shrink: 0;
}
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }

@media (hover: hover) and (pointer: fine) {
  .theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
}
html.light .theme-toggle .icon-sun { display: block; }
html.light .theme-toggle .icon-moon { display: none; }

/* LOGIN MODAL */
.login-modal {
  position: fixed; inset: 0; z-index: 2000;
  display: none; align-items: center; justify-content: center;
  background: var(--overlay); backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 20px;
}
.login-modal.open { display: flex; }
.login-box {
  position: relative;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 28px 28px;
  width: 100%; max-width: 360px;
}
.login-close {
  position: absolute; top: 14px; right: 14px;
  width: 30px; height: 30px;
  background: none; border: 1px solid var(--border);
  border-radius: 50%; color: var(--muted);
  cursor: pointer; font-size: 0.9rem;
  transition: all 0.2s;
}

@media (hover: hover) and (pointer: fine) {
  .login-close:hover { color: var(--accent); border-color: var(--accent); }
}
.login-title { font-size: 1.6rem; font-weight: 300; text-align: center; }
.login-title .accent { color: var(--accent); }
.login-sub { text-align: center; color: var(--muted); font-size: 0.8rem; margin: 6px 0 24px; }
.login-err {
  background: rgba(207,59,59,0.10); border: 1px solid var(--danger);
  color: var(--danger-text); padding: 10px 14px; border-radius: 8px;
  font-size: 0.8rem; margin-bottom: 16px; text-align: center;
}
.login-box input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 12px 16px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  margin-bottom: 14px;
}
.login-box input:focus { outline: none; border-color: var(--accent); }
.login-submit {
  width: 100%;
  background: var(--accent); color: var(--on-accent);
  border: none; border-radius: 999px;
  padding: 13px; font-size: 0.9rem; font-weight: 700;
  font-family: 'Inter', sans-serif; cursor: pointer;
  transition: background 0.2s;
}

@media (hover: hover) and (pointer: fine) {
  .login-submit:hover { background: var(--accent2); }
}

.nav-logo {
  order: 1;
  font-family: 'Manrope', 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.3px;
  white-space: nowrap;
}
.nav-logo span { color: var(--accent); }

.nav-links {
  order: 3;
  flex-basis: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  list-style: none;
  justify-content: flex-start;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  mask-image: linear-gradient(90deg, #000 calc(100% - 16px), transparent);
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 16px), transparent);
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-links li { flex: 0 0 auto; }

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  transition: color 0.2s;
  white-space: nowrap;
  padding: 2px 0;
  flex: 0 0 auto;
}

@media (hover: hover) and (pointer: fine) {
  .nav-links a:hover { color: var(--accent); }
}
.nav-links a.active { color: var(--accent); font-weight: 600; }

/* Планшет: чуть крупнее, но всё ещё две строки */
@media (min-width: 640px) {
  nav { padding: 10px 28px; }
  .nav-logo { font-size: 1rem; }
  .nav-links { gap: 20px; }
  .nav-links a { font-size: 0.72rem; letter-spacing: 0.4px; }
}

/* Десктоп: один ряд — logo | links | user */
@media (min-width: 900px) {
  nav { flex-wrap: nowrap; }
  .nav-links {
    order: 2;
    flex: 1 1 auto;
    flex-basis: auto;
    margin: 0 8px 0 28px;
    gap: 26px;
    overflow: visible;
    mask-image: none;
    -webkit-mask-image: none;
  }
  .nav-links a { font-size: 0.8rem; letter-spacing: 0.5px; }
  .nav-user { order: 3; }
}

/* ── BUTTONS ── */
.btn {
  display: inline-block;
  padding: 14px 28px;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-decoration: none;
  border-radius: 999px;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  font-family: 'Inter', sans-serif;
}

/* ── КАПСУЛЬНЫЕ КНОПКИ (язык навигации и карусели) ── */
.btn-primary,
.form-submit,
.splash-cta,
.amount-btn,
.donate-pay-btn {
  background: var(--capsule-bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
}

@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover,
  .form-submit:hover,
  .splash-cta:hover,
  .amount-btn:hover,
  .donate-pay-btn:hover {
    border-color: rgba(var(--accent-rgb), 0.55);
    color: var(--accent);
    transform: translateY(-2px);
  }
}
.btn-primary:active,
.form-submit:active,
.splash-cta:active,
.amount-btn:active { transform: translateY(0); }

/* ── SECTIONS ── */
/* overflow-x: clip — страховка от горизонтального распора: элемент, вылезший
   за правый край, не растянет документ и страницу не утащить вбок.
   Именно clip, а НЕ hidden: hidden сделал бы секцию контейнером прокрутки и
   убил бы sticky у капсулы — ровно та же ловушка, что была на body.
   Клип безопасен: position: fixed внутри секций нет (шапка, полоса прогресса
   и модалки лежат прямо в body), значит резать ему нечего. */
section { position: relative; z-index: 1; overflow-x: clip; }

.section-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 40px;
}

.section-title {
  font-family: 'Manrope', 'Inter', sans-serif;
  font-size: clamp(1.8rem, 3.5vw, 3rem);
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--heading);
  margin-bottom: 48px;
  line-height: 1.15;
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
}

/* ── ARTICLES ── */
.articles { background: var(--bg2); }

/* Потолок sticky — это CONTENT-box контейнера, padding в него НЕ входит.
   Поэтому штатный верхний отступ секции переезжает с контейнера на саму
   надпись как margin: расстояние до «Материалов» ровно такое же, как у всех
   секций, но эти пиксели теперь ВНУТРИ content-box — и капсула может встать
   под линией разделителя, над словом.
   Ни -60px, ни flow-root не нужны: секция стоит на месте, <hr> ничем не накрыт. */
#articles .section-inner { padding-top: 16px; }
/* Запас над заголовком = высота капсулы (44px) + воздух: у верхнего края блока
   sticky-навигация карусели встаёт именно сюда и заголовок не накрывает. */
#articles .section-title { margin-top: 54px; }
/* отступ якоря = низ шапки + 3px (--nav-h ставит JS по факту) */
#articles, #feed, #game, #donate, #contact {
  scroll-margin-top: calc(env(safe-area-inset-top) + var(--nav-h, 56px) + 6px);
}

.articles-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.article-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 48px;
  border: 1px solid var(--border);
  transition: border-color 0.3s, transform 0.3s;
  position: relative;
  overflow: hidden;
}

@media (hover: hover) and (pointer: fine) {
  .article-card:hover { border-color: rgba(var(--accent-rgb),0.3); }
}

.article-year {
  font-size: 4rem;
  font-family: 'Manrope', 'Inter', sans-serif;
  font-weight: 700;
  color: var(--ghost);
  position: absolute;
  top: 24px; right: 32px;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

.article-tag {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(var(--accent-rgb),0.25);
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.article-card h3 {
  font-family: 'Manrope', 'Inter', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--heading);
  margin-bottom: 0;
  line-height: 1.2;
  letter-spacing: -0.5px;
}

.article-editicon {
  position: absolute;
  top: 40px; right: 80px;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(var(--accent-rgb),0.35);
  background: var(--surface2);
  color: var(--accent);
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 2;
  text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
  .article-editicon:hover { border-color: var(--accent); background: rgba(var(--accent-rgb),0.1); }
}

.article-body {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  margin-top: 0;
  transition: grid-template-rows var(--dur) var(--ease),
              opacity var(--dur-fast) var(--ease-soft),
              margin-top var(--dur) var(--ease);
}
.article-body > * { overflow: hidden; min-height: 0; }

/* Desktop: articles always expanded, no toggle */
@media (min-width: 900px) {
  .article-body {
    grid-template-rows: 1fr;
    opacity: 1;
    margin-top: 16px;
  }
  .article-body > * { overflow: visible; }
  
  .manifest-carousel { margin: 0 -40px; padding-left: 40px; padding-right: 40px; scroll-padding-left: 40px; }
}

.article-card p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 24px;
}

.article-card p + p { margin-top: -8px; }

/* Markdown full text of DB articles */
.article-image {
  width: 100%;
  border-radius: 12px;
  margin-bottom: 20px;
  display: block;
}
/* Глобальный ресет в начале файла обнуляет margin и padding у всех элементов,
   поэтому отступы внутри готового markdown нужно возвращать вручную. Без
   .article-full p абзацы выходят отдельными <p>, но с нулевым margin — и текст
   склеивается в сплошное полотно. Размеры заголовков должны совпадать с
   предпросмотром в админке, иначе он врёт про результат. */
.article-full {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.8;
  margin-top: 8px;
}
.article-full > *:first-child { margin-top: 0; }
.article-full p { margin: 0 0 16px; }
.article-full h1,
.article-full h2,
.article-full h3,
.article-full h4 {
  color: var(--heading);
  font-family: 'Manrope', 'Inter', sans-serif;
  font-weight: 700;
  line-height: 1.25;
  margin: 26px 0 10px;
}
.article-full h1 { font-size: 1.35rem; }
.article-full h2 { font-size: 1.15rem; }
.article-full h3 { font-size: 1rem; }
.article-full h4 { font-size: 0.95rem; }
.article-full strong { color: var(--heading); font-weight: 700; }
.article-full em { color: var(--accent); font-style: normal; }
.article-full ul,
.article-full ol { margin: 0 0 16px; padding-left: 22px; }
.article-full li { margin-bottom: 6px; }
.article-full li > p { margin: 0; }
.article-full a { color: var(--accent); }
.article-full img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  margin: 4px 0 16px;
}
.article-full code {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  color: var(--accent);
  font-family: monospace;
  font-size: 0.85rem;
}
.article-full pre {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  overflow-x: auto;
  margin: 0 0 16px;
}
.article-full pre code { background: none; border: none; padding: 0; color: var(--text); }
.article-full blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 14px;
  margin: 0 0 16px;
}
.article-full hr { border: none; border-top: 1px solid var(--border); margin: 24px 0; }

/* ── ЛЕНТА НОВОСТЕЙ (#feed) ──
   Не карточки: рамка вокруг одного заголовка обещала большой текст внутри,
   которого нет. Плоские строки с разделителем — то же, что на /news,
   ожидания совпадают с содержимым. */
.news-flat {
  border-top: 1px solid var(--border);
}

.news-flat-row {
  position: relative;
  border-bottom: 1px solid var(--border);
}

/* Ссылка растянута на всю строку — кликается любая точка, кроме карандаша */
.news-flat-link {
  display: block;
  padding: 18px 0;
  padding-right: 44px;
  text-decoration: none;
  color: inherit;
}

.news-flat-title {
  font-family: 'Manrope', 'Inter', sans-serif;
  font-size: 1.12rem;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.2px;
  color: var(--heading);
  margin: 0;
  transition: color 0.2s var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  .news-flat-link:hover .news-flat-title { color: var(--accent); }
}

.news-meta {
  margin-top: 7px;
  font-size: 0.75rem;
  color: var(--muted);
}
.news-meta-dot { margin: 0 6px; }

/* Карандаш админа — поверх ссылки, справа по центру строки */
.news-flat-edit {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 0.85rem;
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s;
}

@media (hover: hover) and (pointer: fine) {
  .news-flat-edit:hover { border-color: var(--accent); }
}

@media (min-width: 900px) {
  .news-flat-title { font-size: 1.22rem; }
  .news-flat-link { padding: 20px 0; }
}

/* Кнопка «Все новости» под лентой */
.news-more {
  margin-top: 32px;
  display: flex;
  justify-content: center;
}
.news-more .btn {
  padding: 16px 44px;
  font-size: 0.95rem;
  letter-spacing: 0.3px;
}

.article-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  text-decoration: none;
}

.article-link::after {
  content: '→';
  transition: transform 0.2s var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  .article-link:hover::after { transform: translateX(4px); }
}

@media (prefers-reduced-motion: reduce) {
  .article-link::after { transition: none; }
}

/* ── MANIFEST CAROUSEL (в стиле Apple gallery: peek + snap + индикатор) ── */
.manifest-carousel {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  /* full-bleed: карточки едут от края до края секции */
  margin: 0 -24px;
  /* нижние 28px = 4px воздуха + 24px, которые раньше были margin-top у капсулы.
     Отступ перенесён сюда, чтобы габарит капсулы стал ровно 44px и она
     помещалась в 56px верхнего зазора секции при рождении. */
  padding: 6px 24px 28px;
  scroll-padding-left: 24px;
}
.manifest-carousel::-webkit-scrollbar { display: none; }

.manifest-card {
  flex: 0 0 clamp(300px, 85vw, 400px);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
}
/* превью всегда видно (без аккордеона), ссылка прижата к низу */
.manifest-card .article-body {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-top: 14px;
  flex: 1;
}
.manifest-card .article-body > * { overflow: visible; }
.manifest-card .article-body-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}
/* заголовок — целиком, место справа под карандаш */
.manifest-card h3 {
  padding-right: 40px;
}
.manifest-card .article-body-inner p {
  margin-bottom: 16px;
}
.manifest-card .article-link { margin-top: auto; align-self: flex-start; }
.manifest-card .article-tag { align-self: flex-start; }
.manifest-card .article-editicon { right: 40px; top: 40px; }

/* ── APPLE-STYLE NAV (капсула с точками + play, прилипает к низу) ── */
/* Прилипание — на нативном sticky: он живёт на композиторе, там же где идёт
   прокрутка, поэтому не дёргается. JS сюда не лезет вообще, он только зажигает
   и гасит .visible. Отлипание в конце блока sticky делает сам. */
.manifest-nav {
  position: sticky;
  /* --navbar-h на десктопе = 0px, поэтому отступ остаётся прежним (24px).
     На мобиле капсула с точками поднимается ровно на высоту таббара. */
  bottom: calc(24px + var(--navbar-h) + env(safe-area-inset-bottom, 0px));
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  max-width: 100%;
  margin: 0 auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur) var(--ease);
}
.manifest-nav.visible { opacity: 1; pointer-events: auto; }

.manifest-dots {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--capsule-bg);
  backdrop-filter: var(--glass);
  -webkit-backdrop-filter: var(--glass);
  border: 1px solid var(--border);
  max-width: 100%;
  overflow: hidden;
}
.manifest-dot[hidden] { display: none; }
.manifest-dot {
  flex: 0 0 auto;
  width: 7px; height: 7px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: var(--muted);
  cursor: pointer;
  transition: width 0.3s var(--ease), background 0.3s var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  .manifest-dot:hover { background: var(--text); }
}
.manifest-dot.active { width: 22px; background: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .manifest-nav { transition: none; }
}

/* ── О ПРОЕКТЕ + ИГРА (две колонки: текст слева, промо игры справа) ── */
.game-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.about-title {
  max-width: 760px;
  font-size: clamp(1.4rem, 2.6vw, 2.1rem);
  font-weight: 500;
  letter-spacing: -0.4px;
  line-height: 1.35;
  color: var(--muted);
  margin-bottom: 32px;
}
.about-lead {
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--heading);
}
.game-about p {
  color: var(--muted);
  max-width: 680px;
  margin: 0 0 18px;
  font-size: 1.05rem;
  line-height: 1.85;
}

/* ── GAME ── */
.game-frame-wrap {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--card-solid);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 36px 30px;
  text-align: center;
}


.game-promo-logo {
  width: 84px; height: auto;
  overflow: visible;
  position: relative;
  z-index: 2;
}
.game-promo-logo .skin { stroke: var(--avo-skin); stroke-width: 2.2; }
.game-promo-logo .flesh { stroke: var(--avo-flesh); stroke-width: 2.2; }
.game-promo-logo .pit { stroke: var(--avo-pit); stroke-width: 2.2; }
.game-promo-logo .detail { stroke: var(--avo-detail); stroke-width: 2; }
.game-promo-logo .emoji-line { fill: none; stroke-linecap: round; stroke-linejoin: round; }

.game-promo-word {
  font-family: 'Manrope', 'Inter', sans-serif;
  font-weight: 300;
  letter-spacing: -0.3px;
  font-size: 1.7rem;
  position: relative;
  z-index: 2;
}
.game-promo-word .accent { color: var(--accent); }

.game-promo-desc {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.7;
  max-width: 30ch;
  position: relative;
  z-index: 2;
}

.game-promo-btn {
  position: relative;
  z-index: 2;
  margin-top: 6px;
  background: var(--card-solid-2);
}

/* ── DONATE ── */
.donate { background: var(--bg2); }

.donate-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.donate-text p {
  color: var(--muted);
  margin-bottom: 20px;
  font-size: 1rem;
}

/* без подложки — контролы лежат прямо на секции, как форма обратной связи */
.donate-card {
  background: none;
  border: 0;
  padding: 0;
  position: relative;
}

.donate-label {
  font-size: 0.75rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 16px;
}

.donate-amounts {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.amount-btn {
  padding: 12px 8px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}

.amount-btn.active {
  border-color: rgba(var(--accent-rgb), 0.7);
  color: var(--accent);
}

.donate-custom {
  display: grid;
  grid-template-columns: 1fr 110px;
  gap: 8px;
}

.donate-custom input,
.donate-custom select {
  background: var(--capsule-bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 16px;
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
  border-radius: 999px;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}
.donate-custom input:focus,
.donate-custom select:focus { border-color: rgba(var(--accent-rgb),0.5); }

.donate-note {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  margin-top: 14px;
}

.donate-pay-options {
  display: none;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}
.donate-pay-options.show { display: flex; }

.donate-pay-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  text-decoration: none;
  border-radius: 999px;
  transition: all 0.2s;
}

/* ── CONTACT ── */
.contact { background: var(--bg2); }

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}

.contact-info p {
  color: var(--muted);
  margin-bottom: 32px;
}

.contact-detail {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 0.3s;
}

@media (hover: hover) and (pointer: fine) {
  .contact-item:hover { border-color: rgba(var(--accent-rgb),0.25); }
}

.contact-item-icon {
  width: 36px;
  height: 36px;
  background: rgba(var(--accent-rgb),0.08);
  border: 1px solid rgba(var(--accent-rgb),0.2);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

a.contact-item { text-decoration: none; color: inherit; }
.contact-item-text { font-size: 0.9rem; color: var(--text); }
.contact-item-text .tg-brand { font-family: 'Manrope', 'Inter', sans-serif; font-weight: 700; letter-spacing: -0.5px; }
.contact-item-text .tg-brand .accent { color: var(--accent); }

@media (hover: hover) and (pointer: fine) {
  a.contact-item:hover .contact-item-text { color: var(--accent); }
}

/* ── FORM ── */
.form { display: flex; flex-direction: column; gap: 16px; }

.form-group { display: flex; flex-direction: column; gap: 8px; }

.form-group label {
  font-size: 0.75rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
  background: var(--capsule-bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 14px 18px;
  font-size: 0.95rem;
  font-family: 'Inter', sans-serif;
  border-radius: 999px;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: rgba(var(--accent-rgb),0.5);
}

.form-group select,
.donate-custom select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' stroke='%23888' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
  padding-right: 42px;
}

/* колонка доната всего 110px — стрелке нужен более скромный отступ */
.donate-custom select {
  background-position: right 12px center;
  padding-right: 30px;
  padding-left: 14px;
}

.form-group textarea {
  resize: none;
  min-height: 120px;
  border-radius: 22px;
}
.form-group textarea::-webkit-resizer { display: none; }

.form-group select option { background: var(--bg3); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.form-submit {
  padding: 16px 32px;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-radius: 999px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s;
  margin-top: 8px;
}

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--border);
  padding: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--muted);
}

/* ── MODAL ── */
.modal-overlay {
  overscroll-behavior: contain;
  display: flex;
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur) var(--ease), visibility var(--dur) var(--ease);
  will-change: opacity;
}

.modal-overlay.open { opacity: 1; visibility: visible; }

.modal {
  overscroll-behavior: contain;   /* докрутил до конца — фон не подхватывает */
  background: var(--panel);
  backdrop-filter: blur(20px) saturate(130%);
  -webkit-backdrop-filter: blur(20px) saturate(130%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 780px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  position: relative;
}

.modal-header {
  padding: 18px 24px 14px;
  border-bottom: 1px solid var(--borer);
  position: sticky;
  top: 0;
  background: var(--panel2);
  backdrop-filter: blur(20px) saturate(130%);
  -webkit-backdrop-filter: blur(20px) saturate(130%);
}

.modal-close {
  position: absolute;
  top: 14px; right: 16px;
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

@media (hover: hover) and (pointer: fine) {
  .modal-close:hover { border-color: var(--accent); color: var(--accent); }
}

/* Ярлык-капсула над заголовком в модалке скрыт (новости и манифест).
   Вернуть = убрать display:none, остальное на месте. */
.modal-tag {
  display: none;
  font-size: 0.65rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(var(--accent-rgb),0.25);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.modal h2 {
  font-family: 'Manrope', 'Inter', sans-serif;
  font-size: clamp(1.2rem, 4vw, 1.8rem);
  font-weight: 700;
  color: var(--heading);
  letter-spacing: -0.5px;
  line-height: 1.2;
  padding-right: 40px;
}

.modal-body {
  padding: 20px 24px 28px;
}

.modal-body p {
  color: var(--muted);
  margin-bottom: 12px;
  line-height: 1.6;
  font-size: 0.85rem;
}

.modal-body h4 {
  font-family: 'Manrope', 'Inter', sans-serif;
  color: var(--heading);
  font-size: 0.9rem;
  margin: 18px 0 8px;
  font-weight: 600;
}

/* ── RESPONSIVE ── */
@media (max-width: 899.98px) {
  .section-inner { padding: 40px 24px; }
  .section-title { margin-bottom: 26px; }

  .articles-grid,
.donate-grid,
.game-grid,
.contact-grid { grid-template-columns: 1fr; }

  
  .donate-grid { gap: 32px; }
  .game-grid { gap: 32px; }
  .contact-grid { gap: 40px; }
  .articles-grid { gap: 20px; }

  .donate-amounts { grid-template-columns: repeat(3, 1fr); }
  .donate-custom { grid-template-columns: 1fr 100px; }

  .game-frame-wrap { max-width: 100%; }

  .article-card { padding: 32px 24px; }

  footer {
    flex-direction: column;
    gap: 12px;
    text-align: center;
    padding: 28px 24px;
  }

  .form-row { grid-template-columns: 1fr; }
}
/* ── SPLASH (intro) ── */
.splash {
  position: relative;
  width: 100%;
  min-height: 100svh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  overflow: hidden;
  z-index: 1;
  padding-top: calc(80px + env(safe-area-inset-top));
  padding-bottom: 90px;
}
.splash-logo { width: min(36vw, 200px); height: auto; overflow: visible; }
.splash-logo .emoji-line {
  fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 450; stroke-dashoffset: 450; opacity: 0;
}
.splash-logo.animate .emoji-line { animation: splashDraw 2200ms ease forwards; }
.splash-logo.instant .emoji-line { opacity: 1; stroke-dashoffset: 0; animation: none; }
.splash-logo.animate .flesh  { animation-delay: 0ms; }
.splash-logo.animate .pit    { animation-delay: 500ms; }
.splash-logo.animate .detail{ animation-delay: 800ms; }
.splash-logo.animate .skin  { animation-delay: 1100ms; }
@keyframes splashDraw {
  0%   { stroke-dashoffset: 450; opacity: 0; }
  15%  { opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 1; }
}

/* Весь текст сплэша живёт внутри одного <h1> (единственный на странице).
   Обёртка повторяет колоночную раскладку .splash, чтобы зазоры не схлопнулись,
   и гасит собственные умолчания h1 — размеры задают внутренние элементы. */
.splash-h1 {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
}
.splash-tagline, .splash-desc { display: block; }

.splash-word {
  display: flex; flex-wrap: wrap; justify-content: center;
  font-family: 'Manrope', 'Inter', sans-serif;
  font-weight: 300;
  letter-spacing: -0.3px;
  font-size: clamp(2.3rem, 7vw, 3.7rem);
}
.splash-word .il {
  opacity: 0; transform: translateY(8px); display: inline-block;
  transition: opacity 400ms ease, transform 400ms ease;
}
.splash-word .il.accent { color: var(--accent); }
.splash-word .il.show { opacity: 1; transform: none; }

.splash-desc {
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 34ch;
  text-align: center;
  margin: 0;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 500ms ease, transform 500ms ease;
}
.splash-desc.show { opacity: 1; transform: none; }

.splash-tagline {
  color: var(--text);
  font-family: 'Manrope', 'Inter', sans-serif;
  font-weight: 500;
  font-size: clamp(1.05rem, 3.4vw, 1.5rem);
  letter-spacing: 0.5px;
  text-align: center;
  margin: 0;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 450ms ease, transform 450ms ease;
}
.splash-tagline.show { opacity: 1; transform: none; }

/* margin-top задаёт зазор до кнопки. Блок отцентрован по флексу, поэтому
   +16px к зазору = логотип и текст уезжают вверх на 8px, кнопка вниз на 8px. */
.splash-cta {
  margin-top: 26px;
  display: inline-block;
  padding: 13px 30px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-decoration: none;
  border-radius: 999px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 450ms ease, transform 450ms ease,
              border-color 0.2s, box-shadow 0.2s, color 0.2s;
}
.splash-cta.show { opacity: 1; transform: translateY(0); }

@media (hover: hover) and (pointer: fine) {
  .splash-cta.show:hover { transform: translateY(-2px); }
}

@media (prefers-reduced-motion: reduce) {
  .splash-tagline, .splash-cta { transition: none; }
}

/* Desktop: scale up splash so it fills big screens nicely */
@media (min-width: 900px) {
  .splash-logo { width: 220px; }
  .splash-word { font-size: 4.6rem; }
  .splash-desc { font-size: 1.4rem; max-width: 46ch; }
  .splash, .splash-h1 { gap: 18px; }
}
@media (min-width: 1400px) {
  .splash-logo { width: 260px; }
  .splash-word { font-size: 5.4rem; }
  .splash-desc { font-size: 1.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  .splash-logo .emoji-line { stroke-dashoffset: 0 !important; opacity: 1 !important; animation: none !important; }
  .splash-desc { transition: none; }
  .splash-word .il { transition: none; }
}
/* ── ПЛАВАЮЩАЯ КНОПКА ТЕМЫ (только сплэш, только мобила) ──
   На десктопе тема живёт в шапке, тут кнопка не нужна вовсе.
   Показывается, пока видно сплэш; при доезде до #feed гаснет (JS снимает .show). */
.splash-theme { display: none; }

@media (max-width: 899.98px) {
  .splash-theme {
    position: fixed;
    right: 18px;
    bottom: calc(var(--tabbar-gap) + var(--navbar-h) + 16px + env(safe-area-inset-bottom, 0px));
    z-index: 149;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--capsule-bg);
    backdrop-filter: var(--glass);
    -webkit-backdrop-filter: var(--glass);
    box-shadow: var(--nav-shadow);
    color: var(--text);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px) scale(0.9);
    transition: opacity 320ms var(--ease), transform 320ms var(--ease),
                visibility 0s linear 320ms;
  }
  .splash-theme.show {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 320ms var(--ease), transform 320ms var(--ease), visibility 0s;
  }
  .splash-theme svg { width: 20px; height: 20px; }
  .splash-theme .icon-sun  { display: none; }
  .splash-theme .icon-moon { display: block; }
  html.light .splash-theme .icon-sun  { display: block; }
  html.light .splash-theme .icon-moon { display: none; }
}

@media (max-width: 899.98px) and (prefers-reduced-motion: reduce) {
  .splash-theme { transition: none; }
}

.splash-logo .skin { stroke: var(--avo-skin); }
.splash-logo .flesh { stroke: var(--avo-flesh); }
.splash-logo .pit { stroke: var(--avo-pit); }
.splash-logo .detail { stroke: var(--avo-detail); }

/* ── GAME MODAL (desktop only) ── */
.game-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--overlay);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.game-modal.open { display: flex; opacity: 1; }
.game-modal-shell {
  position: relative;
  width: min(440px, 92vw);
  height: min(860px, 90vh);
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 30px 90px var(--shadow);
  transform: scale(0.92);
  transition: transform 0.3s cubic-bezier(0.2,0.7,0.3,1);
}
.game-modal.open .game-modal-shell { transform: scale(1); }
.game-modal-frame { width: 100%; height: 100%; border: none; display: block; background: var(--bg); }
.game-modal-close {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 2;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(var(--accent-rgb),0.4);
  background: var(--panel);
  color: var(--accent);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

@media (hover: hover) and (pointer: fine) {
  .game-modal-close:hover { background: rgba(var(--accent-rgb),0.15); border-color: var(--accent); }
}

/* confirm dialog inside modal */
.game-confirm {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--overlay);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.game-confirm.show { display: flex; }
.game-confirm-box {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 24px;
  text-align: center;
  max-width: 300px;
}
.game-confirm-box p {
  color: var(--text);
  font-size: 0.95rem;
  margin-bottom: 20px;
  line-height: 1.5;
}
.game-confirm-actions { display: flex; gap: 12px; justify-content: center; }
.game-confirm-actions button {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  border: 1px solid var(--border);
  transition: all 0.2s;
}
.gc-yes { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

@media (hover: hover) and (pointer: fine) {
  .gc-yes:hover { background: var(--accent2); }
}
.gc-no { background: none; color: var(--muted); }

@media (hover: hover) and (pointer: fine) {
  .gc-no:hover { color: var(--text); border-color: var(--muted); }
}

@media (max-width: 899.98px) {
  .game-modal { display: none !important; }
}
/* Все :hover-правила обёрнуты в @media (hover: hover) and (pointer: fine) —
   на тач-экранах ховер не применяется вовсе и не залипает после тапа. */

.about-number {
  display: inline-block;
  font-size: 1.4em;
  font-weight: 500;
  line-height: 0.8;
  color: var(--heading);
}

/* ═══════════════════════════════════════════════════════════════
   НИЖНИЙ ТАББАР (только мобильные, < 900px)
   Капсула из 4 разделов + кнопка «Ещё», которая поднимает шторку.
   Верхняя шапка на мобиле не показывается — вся навигация здесь,
   в зоне большого пальца.
   Слои: скрим 149 → таббар 150 → шторка 151. Модалки (1000/2000) выше всех.
   ═══════════════════════════════════════════════════════════════ */

.tabbar,
.tabbar-sheet,
.tabbar-scrim { display: none; }

@media (max-width: 899.98px) {

  :root { --navbar-h: 62px; }

  /* верхняя шапка уезжает целиком: логотип, ссылки, вход, тема —
     всё продублировано в баре и шторке */
  #siteNav { display: none !important; }

  /* низ страницы не должен прятаться под капсулой */
  footer {
    padding-bottom: calc(40px + var(--tabbar-gap) + var(--navbar-h) + env(safe-area-inset-bottom, 0px));
  }

  /* ── КАПСУЛА ── */
  .tabbar {
    position: fixed;
    left: 10px; right: 10px;
    bottom: calc(var(--tabbar-gap) + env(safe-area-inset-bottom, 0px));
    z-index: 150;
    display: flex;
    align-items: stretch;
    height: var(--navbar-h);
    padding: 0 6px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--capsule-bg);
    backdrop-filter: var(--glass);
    -webkit-backdrop-filter: var(--glass);
    box-shadow: var(--nav-shadow);
  }

  .tabbar-item {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 0 2px;
    border: none;
    background: none;
    font-family: 'Inter', sans-serif;
    font-size: 0.58rem;
    letter-spacing: 0.2px;
    line-height: 1;
    text-decoration: none;
    color: var(--muted);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: color var(--dur-fast) var(--ease-soft);
  }
  .tabbar-item svg {
    width: 22px; height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .tabbar-label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .tabbar-item.active,
  .tabbar-item[aria-expanded="true"] { color: var(--accent); }

  /* «Ещё» без подписи: три полоски читаются как меню без слов.
     Слот перестаёт быть равнодольным (flex: 1) — иначе пустая подпись
     всё равно съедала бы четверть ширины у остальных разделов. */
  .tabbar-more {
    flex: 0 0 auto;
    padding: 0 10px;
  }
  .tabbar-more .tabbar-label { display: none; }
  .tabbar-more svg { width: 24px; height: 24px; }

  /* разделитель «разделы | действия» */
  .tabbar-sep {
    flex: 0 0 1px;
    align-self: center;
    width: 1px;
    height: 24px;
    margin: 0 4px;
    background: var(--border);
  }

  /* ── ШТОРКА ── */
  .tabbar-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 149;
    background: var(--overlay);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--dur-fast) var(--ease-soft), visibility var(--dur-fast) var(--ease-soft);
  }
  .tabbar-scrim.open { opacity: 1; visibility: visible; }

  .tabbar-sheet {
    display: block;
    position: fixed;
    left: 10px; right: 10px;
    bottom: calc(var(--tabbar-gap) + var(--navbar-h) + 8px + env(safe-area-inset-bottom, 0px));
    z-index: 151;
    max-height: 70svh;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 6px 8px 10px;
    border-radius: 22px;
    border: 1px solid var(--border);
    background: var(--panel);
    backdrop-filter: var(--glass);
    -webkit-backdrop-filter: var(--glass);
    box-shadow: var(--nav-shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(0.98);
    transform-origin: bottom center;
    transition: opacity var(--dur-fast) var(--ease),
                transform var(--dur-fast) var(--ease),
                visibility var(--dur-fast) var(--ease);
  }
  .tabbar-sheet.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
  }

  .tabbar-grab {
    width: 36px; height: 4px;
    margin: 2px auto 8px;
    border-radius: 999px;
    background: var(--border);
  }

  /* строка пользователя */
  .tabbar-user {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 12px 10px;
  }
  .tabbar-greeting {
    font-size: 0.82rem;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .tabbar-auth {
    flex: 0 0 auto;
    height: 32px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--capsule-bg);
    backdrop-filter: var(--glass);
    -webkit-backdrop-filter: var(--glass);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 0.76rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .tabbar-divider {
    height: 1px;
    margin: 4px 8px;
    background: var(--border);
    border: none;
  }

  /* пункты шторки */
  .tabbar-sheet-item {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 13px 12px;
    border: none;
    border-radius: var(--radius-md);
    background: none;
    font-family: 'Inter', sans-serif;
    font-size: 0.92rem;
    text-align: left;
    text-decoration: none;
    color: var(--text);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background-color var(--dur-fast) var(--ease-soft), color var(--dur-fast) var(--ease-soft);
  }
  .tabbar-sheet-item svg {
    flex: 0 0 auto;
    width: 20px; height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
    color: var(--muted);
  }
  .tabbar-sheet-item:active { background: var(--surface); }
  .tabbar-sheet-item.active { color: var(--accent); }
  .tabbar-sheet-item.active svg { color: var(--accent); }
  .tabbar-sheet-item[hidden] { display: none; }

  /* иконка темы: показываем ту, что соответствует текущему режиму —
     логика та же, что у .theme-toggle в шапке */
  .tabbar-theme .icon-sun { display: none; }
  html.light .tabbar-theme .icon-sun { display: block; }
  html.light .tabbar-theme .icon-moon { display: none; }
}

@media (max-width: 899.98px) and (prefers-reduced-motion: reduce) {
  .tabbar-sheet, .tabbar-scrim { transition: none; }
  .tabbar-sheet { transform: none; }
}
