/* ============================================================
   Xterium — UNIFIED HEADER (единый источник стилей шапки)
   Используется ОБОИМИ проектами: портал (templates/.../header.php)
   и форум (skin_global.php, контейнер #xh_funi_header).
   namespace: xh-

   ВАЖНО: здесь ТОЛЬКО шапка. НЕ переносить сюда body/типографику/контент —
   иначе сломается контент форума. Источник правил — home.css (портал),
   откуда они скопированы 1:1 (2026-06-03). home.css остаётся каноном портала;
   этот файл — единый вид шапки для форума и портала.
   ============================================================ */

/* --- ШРИФТЫ (self-hosted, ТОЧНО как на портале head.php) ---
   Раньше форум тянул шрифты из Google Fonts, а портал — свои woff2 → один и тот же
   «Source Sans 3» рисовался по-разному (ник на форуме выглядел толще). Теперь ОБА грузят
   одни и те же файлы /media/v2/fonts/*.woff2 → ник/логотип совпадают 1:1.
   На портале эти @font-face уже инлайнятся в head.php (perf) — здесь дубль по тем же URL,
   браузер качает каждый woff2 один раз. Форум берёт шрифты отсюда (Google-ссылку убрали). */
@font-face{font-family:'Archivo Black';font-style:normal;font-weight:400;font-display:swap;src:url(/media/v2/fonts/archivo-black-400-latin-ext.woff2) format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:'Archivo Black';font-style:normal;font-weight:400;font-display:swap;src:url(/media/v2/fonts/archivo-black-400-latin.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Rajdhani';font-style:normal;font-weight:600;font-display:swap;src:url(/media/v2/fonts/rajdhani-600-latin-ext.woff2) format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:'Rajdhani';font-style:normal;font-weight:600;font-display:swap;src:url(/media/v2/fonts/rajdhani-600-latin.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Rajdhani';font-style:normal;font-weight:700;font-display:swap;src:url(/media/v2/fonts/rajdhani-700-latin-ext.woff2) format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:'Rajdhani';font-style:normal;font-weight:700;font-display:swap;src:url(/media/v2/fonts/rajdhani-700-latin.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Source Sans 3';font-style:normal;font-weight:400;font-display:swap;src:url(/media/v2/fonts/source-sans-3-400-cyrillic-ext.woff2) format('woff2');unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}
@font-face{font-family:'Source Sans 3';font-style:normal;font-weight:400;font-display:swap;src:url(/media/v2/fonts/source-sans-3-400-cyrillic.woff2) format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:'Source Sans 3';font-style:normal;font-weight:400;font-display:swap;src:url(/media/v2/fonts/source-sans-3-400-latin-ext.woff2) format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:'Source Sans 3';font-style:normal;font-weight:400;font-display:swap;src:url(/media/v2/fonts/source-sans-3-400-latin.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Source Sans 3';font-style:normal;font-weight:600;font-display:swap;src:url(/media/v2/fonts/source-sans-3-600-cyrillic-ext.woff2) format('woff2');unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}
@font-face{font-family:'Source Sans 3';font-style:normal;font-weight:600;font-display:swap;src:url(/media/v2/fonts/source-sans-3-600-cyrillic.woff2) format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:'Source Sans 3';font-style:normal;font-weight:600;font-display:swap;src:url(/media/v2/fonts/source-sans-3-600-latin-ext.woff2) format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:'Source Sans 3';font-style:normal;font-weight:600;font-display:swap;src:url(/media/v2/fonts/source-sans-3-600-latin.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}

/* --- Переменные шапки (подмножество :root портала, что использует header) ---
   Объявлены и на .xh-page (портал), и на .xh-header / #xh_funi_header (форум —
   там нет .xh-page, поэтому дублируем scope, чтобы var() резолвился). */
.xh-page,
.xh-header,
#xh_funi_header,
#ipboard_body {  /* форум: даём переменные всему body, иначе элементы вне шапки
                    (мобильное меню #xhf-mobile-menu) не резолвят var() — было top:-1120px */
  --xh-bg-header: rgba(6, 10, 20, 0.82);
  --xh-border: #162035;
  --xh-border-light: #1e2d4a;
  --xh-text: #e8ecf2;
  --xh-text-secondary: #a4b3c8;
  --xh-text-muted: #9aa6bd;
  --xh-orange: #e88420;
  --xh-orange-hover: #f59a3e;
  --xh-orange-text: #1a0f00;
  --xh-orange-glow: rgba(232, 132, 30, 0.25);
  --xh-yellow: #c8a820;
  --xh-font-display: 'Archivo Black', sans-serif;
  --xh-font-heading: 'Rajdhani', sans-serif;
  --xh-font-body: 'Source Sans 3', sans-serif;
  --xh-font-mono: 'JetBrains Mono', monospace;  /* единый источник моно-шрифта (раньше не объявлялся → var(--xh-font-mono) падал в системный monospace; account.css хардкодил литерал) */
  --xh-radius: 6px;
  --xh-radius-md: 8px;
  /* ACCOUNT/FORUM redesign 2026-06-06: токены под дизайны account.html/forum.html
     (значения выведены из инлайн-цветов самих дизайнов). Общий источник — здесь. */
  --xh-radius-lg: 12px;
  --xh-bg-card: #0c1322;
  --xh-bg-card-hover: #131c30;
  --xh-blue-light: #4a9df5;
  --xh-green: #20a868;
  --xh-teal: #20b0b8;
  --xh-purple: #6a40b8;
  --xh-woa-red: #d05020;
  --xh-max-w: 1200px;
  --xh-container-pad: 32px;
  --xh-header-h: 58px;
  --xh-transition: .3s ease;
}

/* На форуме нет общего reset .xh-page — задаём минимальный box-sizing для шапки. */
#xh_funi_header,
#xh_funi_header *,
#xh_funi_header *::before,
#xh_funi_header *::after { box-sizing: border-box; }
#xh_funi_header a { text-decoration: none; }
/* font-family: inherit — ТОЧНО как на портале (home.css `.xh-page button{font-family:inherit}`).
   Без этого кнопка форума берёт системный шрифт браузера (на Windows жирнее) → ник выглядел
   толще, чем на портале. Восстановлено, чтобы шрифт ника/языка совпал с порталом. */
#xh_funi_header button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
#xh_funi_header ul, #xh_funi_header ol { list-style: none; margin: 0; padding: 0; }

/* ===================== HEADER ===================== */
/* Skip-link (доступность): спрятан за экраном, показывается ТОЛЬКО при фокусе с клавиатуры.
   Был только в home.css (портал) → на форуме (грузит лишь этот файл) ссылка «Перейти к содержимому»
   висела видимой кнопкой под шапкой. !important — чтобы внешний CSS движка форума не показал её. */
.xh-skip-link {
  position: absolute !important; left: -9999px !important; top: auto !important;
  width: 1px !important; height: 1px !important; overflow: hidden !important;
}
.xh-skip-link:focus {
  position: fixed !important; left: 16px !important; top: 16px !important; width: auto !important; height: auto !important;
  z-index: 10000; padding: 12px 18px; background: var(--xh-orange); color: var(--xh-orange-text, #1a0f00);
  font-weight: 700; border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,.5);
}
.xh-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--xh-header-h);
  background: #070c16;  /* СПЛОШНОЙ тёмный — единый вид с форумом (бесшовно портал↔форум) */
  border-bottom: 1px solid var(--xh-border);
  transition: background var(--xh-transition), box-shadow var(--xh-transition);
}
/* Форум: контейнер #xh_funi_header — тот же визуал, но z-index выше движка форума. */
#xh_funi_header {
  position: sticky; top: 0; z-index: 1000;
  height: var(--xh-header-h);
  background: #070c16;  /* тот же сплошной тёмный, что и у портала */
  border-bottom: 1px solid var(--xh-border);
  font-family: var(--xh-font-body);
}
/* Эффект «матового стекла» (blur) убран НАМЕРЕННО (2026-06-05): на форуме фикс-шапка с blur
   при дробном масштабе Windows (125%) заставляла логотип дрожать при прокрутке. Чтобы шапки
   портала и форума были ПОЛНОСТЬЮ одинаковыми и без дрожания — обе сплошные тёмные, без blur.
   На тёмном фоне стекло почти не отличалось от сплошного. (было: @769 background var + blur 16px) */
@media (max-width: 768px) {
  /* ФОРУМ тоже fixed (был sticky → на iOS дёргался на пару пикселей при скролле).
     Портал уже fixed на моб. Под фикс-шапку даём отступ контенту форума. */
  .xh-header,
  #xh_funi_header {
    position: fixed; top: 0; left: 0; right: 0;
  }
  .xh-page {
    padding-top: var(--xh-header-h);
  }
  #ipboard_body { padding-top: var(--xh-header-h); }
}
.xh-header.is-scrolled { background: rgba(6,10,20,0.95); box-shadow: 0 2px 20px rgba(0,0,0,.4); }

.xh-header-inner {
  max-width: 100%;
  padding: 0 var(--xh-container-pad);
  padding-left: max(32px, env(safe-area-inset-left));
  padding-right: max(32px, env(safe-area-inset-right));
  height: 100%; display: flex; align-items: center; gap: 32px;
}
/* Форум: центрируем по max-width (портал делает это контейнером выше). */
#xh_funi_header .xh-header-inner {
  max-width: var(--xh-max-w);
  margin: 0 auto;
}

/* ===================== LOGO ===================== */
.xh-logo { display: flex; align-items: baseline; gap: 0; flex-shrink: 0; margin-right: 16px; }
.xh-logo-x { font-family: var(--xh-font-display); font-size: 22px; color: var(--xh-orange); letter-spacing: .5px; }
.xh-logo-text { font-family: var(--xh-font-heading); font-size: 22px; font-weight: 700; letter-spacing: 2px; color: var(--xh-text); }

/* ===================== NAV ===================== */
.xh-nav { display: flex; gap: 4px; flex: 1; align-items: center; }
.xh-nav a {
  font-family: var(--xh-font-heading); font-size: 14px; font-weight: 600;
  padding: 6px 12px; border-radius: var(--xh-radius);
  /* Портал рендерит навигацию светлым (--xh-text). Базовый цвет делаем таким же, чтобы шапка
     форума (грузит ТОЛЬКО этот файл) совпадала с порталом 1:1. Раньше тут был --xh-text-secondary
     → на форуме навигация была серее, чем на портале. */
  color: var(--xh-text); transition: color var(--xh-transition), background var(--xh-transition);
  letter-spacing: .3px; white-space: nowrap;
}
.xh-nav a:hover, .xh-nav a:focus-visible { color: var(--xh-text); background: rgba(255,255,255,.05); }
/* Активный раздел — оранжевый акцент (портал /universes, форум «Форум»). */
.xh-nav a.is-active,
.xh-nav a[aria-current="page"] {
  color: var(--xh-orange); background: rgba(232,132,30,.12); font-weight: 700;
}

/* ===================== RIGHT CLUSTER ===================== */
.xh-header-right { display: flex; align-items: center; gap: 16px; margin-left: auto; flex-shrink: 0; }

/* ===================== LANG / USER TRIGGER BUTTONS ===================== */
.xh-lang {
  /* font-family --xh-font-body (Source Sans 3): на портале пилюля языка/ника этим шрифтом;
     на форуме раньше наследовался --xh-font-heading → шрифт пилюли отличался от портала. */
  font-family: var(--xh-font-body); font-size: 13px; font-weight: 600;
  color: var(--xh-text-secondary); padding: 6px 10px; border-radius: var(--xh-radius);
  display: flex; align-items: center; gap: 4px; transition: color var(--xh-transition);
  min-height: 24px;
  /* Движок форума (IPB) красит <button> в БЕЛЫЙ фон с рамкой → пилюли языка и ника были белыми
     коробками (на портале они прозрачные). Сбрасываем фон/рамку/тень с !important, чтобы перебить
     стили форума. Это и был «белый на форуме». */
  background: transparent !important; border: 0 !important; box-shadow: none !important;
  -webkit-appearance: none !important; appearance: none !important; text-shadow: none !important;
  cursor: pointer;
}
.xh-lang:hover { color: var(--xh-text); }
/* Бургер — тоже <button>: сбрасываем фон/рамку движка форума (иначе белая коробка на мобильном). */
.xh-burger { background: transparent !important; border: 0 !important; box-shadow: none !important; -webkit-appearance: none !important; appearance: none !important; }
.xh-lang--static { cursor: default; }
.xh-lang--static:hover { color: var(--xh-text-secondary); }
.xh-lang-wrap { position: relative; }

.xh-lang-dropdown__soon {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  font-family: var(--xh-font-heading);
  font-size: 13px;
  color: var(--xh-text-muted);
  cursor: not-allowed;
  opacity: .6;
}
.xh-lang-dropdown__soon .xh-lang-code { font-weight: 700; min-width: 28px; }
.xh-lang-soon-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: #1a1407;
  color: #FFCC00;
  border-radius: 999px;
  vertical-align: middle;
}

/* ===================== LOGIN LINK ===================== */
.xh-login-link { font-family: var(--xh-font-heading); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; line-height: 1.6; color: var(--xh-text); padding: 9px 18px; border: 1px solid var(--xh-border-light); border-radius: var(--xh-radius); transition: color var(--xh-transition), background var(--xh-transition), border-color var(--xh-transition), box-shadow var(--xh-transition), transform var(--xh-transition); }
.xh-login-link:hover { border-color: var(--xh-text-secondary); background: rgba(255,255,255,.04); }

/* ===================== BUTTONS ===================== */
.xh-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--xh-font-heading); font-weight: 700; font-size: 15px;
  padding: 10px 24px; border-radius: var(--xh-radius);
  letter-spacing: .5px; text-transform: uppercase;
  transition: color var(--xh-transition), background var(--xh-transition), border-color var(--xh-transition), box-shadow var(--xh-transition), transform var(--xh-transition); white-space: nowrap;
}
.xh-btn:focus-visible { outline: 2px solid var(--xh-orange); outline-offset: 2px; }
.xh-btn--header {
  font-size: 13px; line-height: 1.1; padding: 9px 18px;
  background: var(--xh-orange); color: var(--xh-orange-text); font-weight: 800; border: 1px solid var(--xh-orange);
  box-shadow: 0 0 18px var(--xh-orange-glow);
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
}
.xh-btn--header svg { width: 12px; height: 12px; flex-shrink: 0; }
.xh-btn--header:hover { background: var(--xh-orange-hover); border-color: var(--xh-orange-hover); color: var(--xh-orange-text); box-shadow: 0 0 26px rgba(232,132,30,.45); transform: translateY(-1px); }
.xh-btn svg { width: 14px; height: 14px; }

/* ===================== BURGER ===================== */
.xh-burger { display: none; width: 44px; height: 44px; align-items: center; justify-content: center; flex-direction: column; gap: 5px; padding: 10px; background: transparent; border: 0; cursor: pointer; }
.xh-burger span { display: block; width: 22px; height: 2px; background: var(--xh-text); border-radius: 1px; transition: color var(--xh-transition), background var(--xh-transition), border-color var(--xh-transition), box-shadow var(--xh-transition), transform var(--xh-transition); }
.xh-burger.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.xh-burger.is-active span:nth-child(2) { opacity: 0; }
.xh-burger.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
/* Форум использует класс is-open для бургера/меню (свой JS) — даём те же стили. */
.xh-burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.xh-burger.is-open span:nth-child(2) { opacity: 0; }
.xh-burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===================== USER DROPDOWN BUTTON ===================== */
/* min-width:0 — чтобы кнопка игрока МОГЛА сжаться (ник внутри отдаёт место), иначе бургер вытесняется за край. */
.xh-user { gap: 8px !important; min-width: 0; padding: 8px 14px !important; position: relative; }
/* Значок уведомлений у аватара: входящие заявки в друзья + непрочитанные ЛС. */
.xh-user-notif {
  position: absolute; top: 2px; left: 24px; min-width: 16px; height: 16px; line-height: 15px;
  padding: 0 4px; font-size: 10px; font-weight: 700; color: #fff; background: #ff4d4d;
  border-radius: 999px; text-align: center; border: 1px solid var(--xh-bg-header, #070c16); pointer-events: none;
}
.xh-user .xh-lang-icon { width: 18px; height: 18px; color: var(--xh-yellow, #FFCC00); }
.xh-user-nick {
  font-family: var(--xh-font-body);  /* Source Sans 3 — ровно как на портале (был системный шрифт → «жирный») */
  font-weight: 700; color: var(--xh-yellow, #FFCC00);
  white-space: nowrap;
  font-size: 15px;
  letter-spacing: .2px;
  /* Ник «отдаёт» место: flex+min-width:0 → на узком экране flexbox сжимает ИМЕННО ник
     (обрезка «…»), а бургер (ключевой элемент) ВСЕГДА остаётся целым и кликабельным.
     clamp ограничивает МАКСИМУМ (на ПК до 140px), нижняя граница — сколько реально осталось места. */
  /* flex-shrink:0 — ник НЕ сжимается ниже своей ширины (её и так ограничивает max-width clamp,
     который сам уменьшается на узких экранах через 20vw). Так ник показывается ОДИНАКОВО на портале
     и форуме (раньше на портале flex сжимал его сильнее → «Schat…», на форуме нет). 2026-06-07. */
  flex: 0 0 auto; min-width: 0;
  max-width: clamp(36px, 20vw, 140px); overflow: hidden; text-overflow: ellipsis;
}
/* Бургер — ключевой элемент: НИКОГДА не сжимается и не обрезается. */
.xh-burger { flex-shrink: 0; }
@media (max-width: 480px) {
  #xh_funi_header .xh-header-inner, .xh-header .xh-header-inner { gap: 8px; }
}
@media (min-width: 880px) {
  .xh-user { padding: 9px 16px !important; gap: 10px !important; }
  .xh-user .xh-lang-icon { width: 22px; height: 22px; }
  .xh-user-nick { font-size: 17px; }
}

/* ===================== DROPDOWNS (lang + user) ===================== */
.xh-lang-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 200;
  background: #0c1426; border: 1px solid var(--xh-border-light); border-radius: var(--xh-radius-md);
  box-shadow: 0 12px 36px rgba(0,0,0,.55);
  list-style: none; margin: 0; padding: 6px; min-width: 220px; max-height: min(70vh, 480px); overflow-y: auto;
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px;
}
.xh-lang-dropdown[hidden] { display: none; }
.xh-lang-dropdown li { margin: 0; }
.xh-lang-dropdown a {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px;
  /* font-family ЯВНО: на форуме внешний CSS движка ставит helvetica на ссылки → пункты меню
     отличались шрифтом от портала. Фиксируем Source Sans 3 как на портале. */
  border-radius: 6px; color: var(--xh-text); font-family: var(--xh-font-body); text-decoration: none; font-size: 13px;
}
.xh-lang-dropdown a:hover { background: rgba(255,255,255,.05); color: var(--xh-orange); }
/* Активный язык: портал ставит aria-current="page"; форум — li.selected (IPB). Оба = оранжевый. */
.xh-lang-dropdown a[aria-current="page"],
.xh-lang-dropdown a[aria-current="true"],
.xh-lang-dropdown li.selected a,
.xh-lang-dropdown a.is-current {
  background: rgba(232,132,30,.12); color: var(--xh-orange); font-weight: 600;
}
.xh-lang-code { font-family: var(--xh-font-heading); font-weight: 700; min-width: 28px; color: var(--xh-text-muted); }
.xh-lang-dropdown a[aria-current="page"] .xh-lang-code,
.xh-lang-dropdown a[aria-current="true"] .xh-lang-code { color: var(--xh-orange); }
.xh-lang-name { color: inherit; }

/* ===== Мобильный выбор языка (в бургер-меню). Был только в home.css → на ФОРУМЕ мобильный
   переключатель языка был без стилей (форум грузит только этот файл). Перенесён сюда — единый источник. */
.xh-mobile-lang-wrap { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--xh-border); }
.xh-mobile-lang-toggle {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.04); border: 1px solid var(--xh-border);
  color: var(--xh-text); padding: 10px 14px; border-radius: var(--xh-radius-md);
  cursor: pointer; font: inherit; width: 100%; justify-content: flex-start;
  font-size: 14px;
}
.xh-mobile-lang-toggle:hover { background: rgba(255,255,255,.07); }
.xh-mobile-lang-toggle .xh-lang-icon,
.xh-mobile-lang-toggle svg { width: 18px !important; height: 18px !important; flex-shrink: 0; color: #FFCC00; }
.xh-lang-dropdown--mobile[hidden] { display: none; }
.xh-lang-dropdown--mobile:not([hidden]) {
  position: static; box-shadow: none; margin-top: 8px;
  min-width: 0; width: 100%;
  display: flex; flex-direction: column; gap: 4px;
  background: transparent; padding: 0; border: 0;
}
.xh-lang-dropdown--mobile li { list-style: none; }
.xh-lang-dropdown--mobile a {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: rgba(255,255,255,.03); border: 1px solid var(--xh-border);
  border-radius: var(--xh-radius-md);
  color: var(--xh-text-secondary); text-decoration: none; font-size: 13px;
}
.xh-lang-dropdown--mobile a[aria-current="true"] {
  background: rgba(255, 204, 0, .12); border-color: rgba(255, 204, 0, .4); color: #FFCC00;
}
.xh-lang-dropdown--mobile .xh-lang-flag { font-size: 20px; }

/* User dropdown — single column (наследует .xh-lang-dropdown, переопределяем grid). */
.xh-user-dropdown {
  min-width: 260px;
  grid-template-columns: 1fr !important;
}
.xh-user-dropdown__heading {
  padding: 10px 14px 6px; font-size: 11px; font-weight: 700;
  color: var(--xh-text-muted, #8a99b0); text-transform: uppercase; letter-spacing: .1em;
}
.xh-user-dropdown a { display: flex !important; align-items: center; justify-content: space-between; gap: 12px; }
.xh-user-dropdown .xh-uni-name { font-weight: 600; }
.xh-user-dropdown .xh-uni-ver { font-size: 11px; color: var(--xh-text-muted, #8a99b0); font-family: var(--xh-font-mono, monospace); }
.xh-user-dropdown__sep { height: 1px; background: var(--xh-border); margin: 6px 8px; }
.xh-user-dropdown__logout { color: var(--xh-orange) !important; font-weight: 600; }
/* Раздел «Друзья» в меню по нику: строка друга (аватар + ник + значок непрочитанных ЛС). */
.xh-user-dropdown a.xh-uf-row { justify-content: flex-start !important; gap: 10px; }
/* «Друзья» как кликабельный пункт со счётчиком справа (заявки + новые сообщения). */
.xh-user-dropdown a.xh-uf-link { display: flex !important; align-items: center; justify-content: space-between; gap: 10px; }
.xh-uf-ava { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; background: rgba(255,255,255,.08); border: 1px solid var(--xh-border-light, #1e2d4a); }
.xh-uf-ava--empty { display: inline-block; }
.xh-uf-nick { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xh-uf-unread { flex: 0 0 auto; min-width: 18px; height: 18px; line-height: 18px; text-align: center; padding: 0 5px; font-size: 11px; font-weight: 700; background: #ff4d4d; color: #fff; border-radius: 999px; }
.xh-user-dropdown__muted { padding: 8px 14px; font-size: 13px; color: var(--xh-text-muted, #8a99b0); }

/* ===================== FLAGS ===================== */
.xh-lang-flag {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; line-height: 1;
  width: 24px; min-width: 24px;
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
}
.xh-lang-dropdown__soon .xh-lang-flag { opacity: 0.55; }
/* Caret стрелка у кнопок-триггеров (используется форумом). */
.xh-caret { font-size: 9px; opacity: .7; }

/* ===================== LANG SEARCH (портал: 30 языков) ===================== */
.xh-lang-dropdown__search {
  grid-column: 1 / -1;
  padding: 0;
  margin: 0 0 4px;
}
.xh-lang-search-input {
  width: 100%;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--xh-border);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--xh-text);
  font-size: 13px;
  font-family: inherit;
  box-sizing: border-box;
  outline: none;
  transition: border-color .15s ease;
}
.xh-lang-search-input::placeholder { color: var(--xh-text-muted); }
.xh-lang-search-input:focus { border-color: var(--xh-orange); }
.xh-lang-dropdown li[data-xh-lang-hidden="true"] { display: none !important; }

/* ===================== АДАПТИВ ШАПКИ ===================== */
@media (max-width: 1024px) {
  .xh-nav { display: none; }
  .xh-burger { display: flex; }
  .xh-login-link { display: none; }
  .xh-btn--header { display: none; }
  /* На мобильном правый блок МОЖЕТ сжиматься (min-width:0) — лишнее место отдаёт ник,
     а бургер справа остаётся целым. Без этого правый блок не сжимался и выталкивал бургер за край. */
  .xh-header-right { gap: 8px; flex-shrink: 1; min-width: 0; }
  .xh-user-wrap { min-width: 0; }
  /* язык: высота кнопки ≥44px — удобно попадать пальцем (WCAG 2.5.8) */
  .xh-lang-wrap .xh-lang { padding: 11px 10px; font-size: 12px; min-height: 44px; box-sizing: border-box; }
  .xh-lang-wrap .xh-lang-icon { width: 14px; height: 14px; }
}
@media (max-width: 768px) {
  .xh-header-inner { gap: 12px; }
  .xh-logo-x, .xh-logo-text { font-size: 20px; letter-spacing: 1.5px; }
  /* На телефоне боковые отступы 32px съедали 64px ширины → бургер не помещался.
     Снижаем до 14px (safe-area сохраняем) — освобождает ~36px. Портал и форум одинаково. */
  .xh-header-inner {
    padding-left: max(14px, env(safe-area-inset-left));
    padding-right: max(14px, env(safe-area-inset-right));
  }
}
@media (max-width: 640px) {
  .xh-lang-dropdown {
    grid-template-columns: 1fr;
    min-width: 180px;
    max-width: calc(100vw - 24px);
    right: 0;
  }
  .xh-lang-dropdown a { padding: 10px 12px; font-size: 14px; }
  .xh-lang-dropdown__search { padding: 0 0 6px; }
  .xh-lang-search-input { font-size: 14px; padding: 10px 12px; }
}
@media (max-width: 380px) {
  .xh-logo-x, .xh-logo-text { font-size: 18px; }
  .xh-lang-dropdown { min-width: 160px; }
}

/* ===================== ФОРУМ-СПЕЦИФИКА (мобильное раскрытие nav/right) =====================
   На форуме nav и right прячутся под бургер и раскрываются по классу is-open.
   На портале для этого отдельное мобильное меню (mobile-menu.php) — это правило
   ограничено scope #xh_funi_header, портал не затрагивает. */
@media (max-width: 1024px) {
  /* как на портале: на мобильном прячем только меню, язык (.xh-header-right) ОСТАВЛЯЕМ видимым;
     кнопки Войти/Играть прячем (они в мобильном меню), переключатель языка остаётся в шапке. */
  #xh_funi_header .xh-nav { display: none; }
  #xh_funi_header .xh-login-link,
  #xh_funi_header .xh-btn--header { display: none; }
  /* залогиненный пользователь ПОКАЗЫВАЕТСЯ в шапке ТОЧНО как на портале — с ником и стрелкой.
     Ник с ellipsis (max-width:140px) не ломает шапку. Тап открывает меню профиль/выход. */
  #xh_funi_header .xh-user-wrap { display: block !important; }
  #xh_funi_header .xh-user { padding: 8px 10px; min-height: 44px; }
  #xh_funi_header .xh-burger { display: flex; }
  /* gap НЕ переопределяем для форума — пусть берёт ту же сетку промежутков, что портал
     (генерик .xh-header-inner: 32px → 12px ≤768 → 8px ≤480). Единое поведение, не «подгонка». */
}

/* ===================== МОБИЛЬНОЕ МЕНЮ-ОВЕРЛЕЙ =====================
   Скопировано 1:1 из home.css (портал, .xh-mobile-menu) 2026-06-03.
   На ПОРТАЛЕ меню рендерит mobile-menu.php (id="xh-mobile-menu"), JS — main.js (initBurger).
   На ФОРУМЕ — id="xhf-mobile-menu", свой vanilla-JS в skin_global.php, те же классы → тот же вид.
   Бургер (.xh-burger) уже стилизован выше (секция BURGER, is-active + is-open). */
.xh-mobile-menu {
  -webkit-backdrop-filter: blur(12px);
  display: none; position: fixed; top: var(--xh-header-h); left: 0; right: 0; bottom: 0;
  background: rgba(6,10,20,.96); backdrop-filter: blur(12px);
  z-index: 99; padding: 24px 32px; flex-direction: column; gap: 4px; overflow-y: auto;
}
.xh-mobile-menu.is-open { display: flex; }
.xh-mobile-menu a:not([class*="xh-btn"]) {
  font-family: var(--xh-font-heading); font-size: 18px; font-weight: 600;
  padding: 14px 0; color: var(--xh-text-secondary);
  border-bottom: 1px solid var(--xh-border); transition: color var(--xh-transition);
}
.xh-mobile-menu a:not([class*="xh-btn"]):hover { color: var(--xh-text); }
.xh-mobile-menu .xh-btn { margin-top: 16px; justify-content: center; border: 0; }
.xh-mobile-menu .xh-btn--primary { background: var(--xh-orange); color: var(--xh-orange-text); border-bottom: 0; }
.xh-mobile-menu .xh-btn--primary:hover { background: var(--xh-orange-hover); }

/* Заголовок группы (язык / вход) внутри мобильного меню. */
.xh-mobile-menu__heading {
  font-size: 11px; font-weight: 700; color: var(--xh-text-muted, #8a99b0);
  text-transform: uppercase; letter-spacing: .1em;
  padding: 16px 4px 8px; margin-top: 8px; border-top: 1px solid var(--xh-border);
}

/* Мобильный выбор вселенной — скопировано 1:1 из home.css (портал), чтобы форум и портал
   на телефоне выглядели одинаково (раньше эти правила были только в home.css → форум их не имел). */
.xh-mobile-universes {
  margin: 16px 0 8px; padding: 14px 0;
  border-top: 1px solid var(--xh-border);
}
.xh-mobile-universes__heading {
  font-size: 11px; font-weight: 700; color: var(--xh-text-muted, #8a99b0);
  text-transform: uppercase; letter-spacing: .1em; padding: 0 4px 8px;
}
.xh-mobile-universe-item {
  display: flex !important; align-items: center; justify-content: space-between;
  padding: 12px 14px !important; margin: 4px 0; border-bottom: 0 !important;
  background: rgba(255,255,255,.03); border: 1px solid var(--xh-border);
  border-radius: 8px; transition: border-color var(--xh-transition), background var(--xh-transition);
  font-size: 16px !important; font-weight: 600 !important;
}
.xh-mobile-universe-item:hover { border-color: rgba(232,132,30,.5); background: rgba(232,132,30,.06); }
.xh-mobile-universe-name { color: var(--xh-text); }
.xh-mobile-universe-ver { font-size: 11px; color: var(--xh-text-muted, #8a99b0); font-weight: 500; font-family: var(--xh-font-mono, monospace); }

/* Блок ника авторизованного игрока — как в портале (.xh-mobile-user). */
.xh-mobile-user {
  margin: 8px 0 4px; padding: 14px 16px;
  background: rgba(255,204,0,.08); border: 1px solid rgba(255,204,0,.25); border-radius: 10px;
  display: flex; flex-direction: column; gap: 4px;
}
.xh-mobile-user-label { font-size: 12px; font-weight: 500; color: var(--xh-text-secondary); text-transform: uppercase; letter-spacing: .08em; }
.xh-mobile-user-name { font-family: var(--xh-font-heading); font-size: 20px; font-weight: 700; color: var(--xh-yellow, #FFCC00); }

/* Сетка пунктов выбора языка в мобильном меню (форум). */
.xh-mobile-langs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 4px 0 8px;
}
.xh-mobile-langs a {
  display: flex !important; align-items: center; gap: 8px;
  padding: 10px 12px !important; border-bottom: 0 !important;
  background: rgba(255,255,255,.03); border: 1px solid var(--xh-border);
  border-radius: 8px; font-size: 14px !important; font-weight: 600 !important;
  color: var(--xh-text-secondary) !important;
}
.xh-mobile-langs a:hover { color: var(--xh-orange) !important; border-color: rgba(232,132,30,.4); }
.xh-mobile-langs a.is-current,
.xh-mobile-langs a[aria-current="page"] {
  color: var(--xh-orange) !important; border-color: rgba(232,132,30,.5); background: rgba(232,132,30,.08);
}

/* Языковой список внутри мобильного меню — 2 колонки, БЕЗ внутреннего скролла.
   СВЁРНУТ по умолчанию ([hidden]→none); раскрывается кнопкой текущего языка
   (как на портале). Раньше [hidden] форсил grid → список был всегда открыт И на
   портале тоже (общий файл). */
.xh-mobile-menu .xh-lang-dropdown--mobile {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  position: static !important;
  box-shadow: none; background: transparent; border: 0;
  padding: 0; margin: 8px 0 8px; min-width: 0; max-width: none;
  max-height: none !important;
  overflow: visible !important;
}
.xh-mobile-menu .xh-lang-dropdown--mobile[hidden] { display: none !important; }
.xh-mobile-menu .xh-lang-dropdown--mobile li { display: block; }
.xh-mobile-menu .xh-lang-dropdown--mobile a {
  background: rgba(255,255,255,.03); border: 1px solid var(--xh-border);
  color: var(--xh-text-secondary);
}
/* ФОРУМ: кнопка «Выбор языка: XX» с флагом — раскрывает список (паритет с порталом).
   Scoped под #xhf-mobile-menu — портал использует свою (home.css), не трогаем. */
#xhf-mobile-menu .xh-mobile-lang-wrap { margin: 4px 0 8px; border-top: 1px solid var(--xh-border); padding-top: 8px; }
#xhf-mobile-menu .xh-mobile-lang-toggle {
  display: flex; align-items: center; gap: 8px; width: 100%;
  font-family: var(--xh-font-heading); font-size: 15px; font-weight: 600;
  color: var(--xh-text-secondary); padding: 12px 0; background: none; border: 0; cursor: pointer;
}
#xhf-mobile-menu .xh-mobile-lang-toggle:hover { color: var(--xh-text); }
#xhf-mobile-menu .xh-mobile-lang-toggle .xh-lang-flag { display: inline-flex; }
#xhf-mobile-menu .xh-mobile-lang-toggle .xh-caret { margin-left: auto; font-size: 11px; transition: transform .2s; }
#xhf-mobile-menu .xh-mobile-lang-toggle[aria-expanded="true"] .xh-caret { transform: rotate(180deg); }

/* ФОРУМ: оверлей выше шапки форума (#xh_funi_header z-index:1000). */
#xhf-mobile-menu { z-index: 1100; }

/* Блокировка скролла фона при открытом меню (как modal-паттерн портала). */
body.xhf-menu-open { overflow: hidden; }

/* На десктопе мобильное меню форума всегда скрыто (бургер виден только <=1024). */
@media (min-width: 1025px) {
  #xhf-mobile-menu { display: none !important; }
}

/* ===================== ЕДИНЫЙ ПОДВАЛ (footer_render.php, портал + форум) =====================
   Вынесено из home.css 2026-06-05, чтобы форум (грузит этот файл) рендерил тот же подвал, что портал.
   Нужные переменные объявлены локально на .xh-footer — чтобы работало и вне .xh-page (на форуме). */
.xh-footer {
  --xh-bg-primary: #0a0f1c; --xh-bg-card: #0c1322;
  position: relative; z-index: 1; border-top: 1px solid var(--xh-border); background: var(--xh-bg-primary);
  padding: 32px 0 16px; padding-bottom: max(16px, env(safe-area-inset-bottom));
  font-family: var(--xh-font-body); color: var(--xh-text-secondary);
}
.xh-footer * { box-sizing: border-box; }
.xh-footer a { text-decoration: none; }
.xh-footer .xh-container {
  max-width: var(--xh-max-w); margin: 0 auto; padding: 0 var(--xh-container-pad);
  padding-left: max(32px, env(safe-area-inset-left)); padding-right: max(32px, env(safe-area-inset-right));
}
.xh-footer-grid { display: grid; gap: 28px 32px; grid-template-columns: 1.6fr 1fr 1fr 1fr 1.2fr 1fr; align-items: start; }
.xh-footer-grid .xh-footer-col ul { list-style: none; padding: 0; margin: 0; }
.xh-footer-brand { flex: 0 0 200px; }
.xh-footer-brand .xh-logo { margin-bottom: 16px; display: flex; align-items: baseline; }
.xh-footer-brand .xh-logo-x { font-family: var(--xh-font-display); font-size: 22px; color: var(--xh-orange); letter-spacing: .5px; }
.xh-footer-brand .xh-logo-text { font-family: var(--xh-font-heading); font-size: 22px; font-weight: 700; letter-spacing: 2px; color: var(--xh-text); }
.xh-footer-socials { display: flex; gap: 12px; }
.xh-footer-col a.xh-footer-social,
.xh-footer-social {
  width: 36px; height: 36px; padding: 0; border-radius: 50%; background: var(--xh-bg-card);
  border: 1px solid var(--xh-border); display: inline-flex; align-items: center; justify-content: center;
  color: var(--xh-text-muted); transition: color var(--xh-transition), background var(--xh-transition), border-color var(--xh-transition); flex-shrink: 0;
}
.xh-footer-col a.xh-footer-social:hover,
.xh-footer-social:hover { border-color: var(--xh-text-secondary); color: var(--xh-text); }
.xh-footer-social svg { width: 18px; height: 18px; display: block; }
.xh-footer-col h3 { font-size: 13px; margin-bottom: 10px; color: var(--xh-text); }
.xh-footer-col a { display: block; font-size: 13px; color: var(--xh-text-secondary); padding: 6px 0; min-height: 24px; transition: color var(--xh-transition); text-wrap: pretty; line-height: 1.6; }
.xh-footer-col a:hover { color: var(--xh-text); }
.xh-footer-col li { line-height: 1.4; }
.xh-footer-desc { font-size: 13px; line-height: 1.5; margin: 8px 0 12px; }
.xh-footer-bottom { border-top: 1px solid var(--xh-border); padding-top: 14px; margin-top: 8px; text-align: center; font-size: 12px; color: var(--xh-text-muted); }
.xh-footer-copy { margin: 0; }
.xh-footer .xh-cookie-settings-link { background: none; border: 0; padding: 0; color: var(--xh-text-muted); text-decoration: underline; cursor: pointer; font-size: 12px; font-family: inherit; }
.xh-footer .xh-cookie-settings-link:hover { color: var(--xh-text); }
@media (max-width: 768px) {
  .xh-footer { padding: 40px 0 24px; }
  .xh-footer-brand { flex: none; }
  .xh-footer-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "brand brand" "game knowledge" "community popular" "docs docs";
    gap: 32px 20px;
  }
  .xh-footer-brand { grid-area: brand; }
  .xh-footer-grid > .xh-footer-col:nth-of-type(2) { grid-area: game; }
  .xh-footer-grid > .xh-footer-col:nth-of-type(3) { grid-area: knowledge; }
  .xh-footer-grid > .xh-footer-col:nth-of-type(4) { grid-area: community; }
  .xh-footer-grid > .xh-footer-col:nth-of-type(5) { grid-area: popular; }
  .xh-footer-grid > .xh-footer-col:nth-of-type(6) { grid-area: docs; padding-top: 20px; border-top: 1px solid var(--xh-border); }
  .xh-footer-grid > .xh-footer-col:nth-of-type(6) ul { display: flex; flex-wrap: wrap; gap: 12px 24px; }
  .xh-footer-grid > .xh-footer-col:nth-of-type(6) ul li { margin: 0; }
  .xh-footer-grid > .xh-footer-col:nth-of-type(6) a { padding: 2px 0; }
  .xh-footer-col a { font-size: 13px; padding: 4px 0; }
}
