/* =====================================================================
   NEVER — исправления и чат (как в standart)
   Подключается последним (tpl/head.tpl), поэтому перекрывает старые правила.
   ===================================================================== */

/* ---------- Код и таблицы в сообщениях чата и форума: не рвать слова посередине ---------- */
.with_code table tr td {
  word-break: normal;
}

/* ---------- Общие заголовки блоков ---------- */
.block_card_header_left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

/* =====================================================================
   ЧАТ
   ===================================================================== */
.never_chat {
  padding: 16px 14px 14px;
}

#chat #drop_zone {
  position: relative;
  width: 100%;
  font-family: inherit;
}

#chat #drop_zone > #drop_mask {
  position: absolute;
  inset: 0;
  z-index: 7;
  display: none;
  margin: 0;
}

#chat #drop_zone.loader {
  background: none;
  opacity: .5;
}

#chat #drop_zone.hover,
#chat #drop_zone.error {
  display: block;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

#chat #drop_zone.hover #chat_messages,
#chat #drop_zone.error #chat_messages {
  height: 60vh;
}

#chat #drop_zone.hover:after,
#chat #drop_zone.error:after {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  border-radius: 14px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  outline: 2px dashed currentColor;
  outline-offset: -8px;
}

#chat #drop_zone.hover:after {
  content: "Отпустите изображение, чтобы отправить его в чат";
  background: rgba(23, 5, 31, .92);
  color: #ff4fb8;
}

#chat #drop_zone.error:after {
  content: "Не удалось загрузить файл";
  background: rgba(40, 6, 14, .92);
  color: #ff5c7a;
}

/* ---------- Лента сообщений ---------- */
#chat #chat_messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  height: 60vh;
  min-height: 320px;
  max-height: 640px;
  margin-top: 14px;
  padding-right: 4px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 79, 184, .45) transparent;
}

#chat #chat_messages::-webkit-scrollbar {
  width: 4px;
  height: 0;
  background: transparent;
}

#chat #chat_messages::-webkit-scrollbar-thumb {
  background: rgba(255, 79, 184, .45);
  border-radius: 4px;
}

#chat #chat_messages > .loader {
  margin: auto;
}

#chat #chat_messages .chat_message,
#chat #chat_messages .pin_chat_message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-shrink: 0;
  padding: 0;
  border: 0;
  overflow: visible;
}

#chat #chat_messages .pin_chat_message {
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 79, 184, .1);
  border: 1px solid rgba(255, 79, 184, .35);
}

/* аватар + рамка */
#chat #chat_messages .chat_message > a.chat_avatar,
#chat #chat_messages .pin_chat_message > a.chat_avatar {
  position: relative;
  display: block;
  float: none;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  margin: 0;
}

#chat #chat_messages .chat_avatar > img:first-child,
#chat #chat_messages .pin_chat_message .user_img {
  display: block;
  float: none;
  width: 38px;
  height: 38px;
  padding: 0;
  margin: 0;
  border-radius: 50%;
  object-fit: cover;
  background: #2a0b33;
}

#chat #chat_messages .chat_avatar .usersframechat {
  position: absolute;
  top: -5px;
  left: -4px !important;
  width: 46px !important;
  height: 47px !important;
  max-width: none;
  margin: 0 !important;
  border-radius: 0 !important;
  pointer-events: none;
}

/* тело сообщения */
#chat #chat_messages .chat_message .message,
#chat #chat_messages .pin_chat_message .message {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  float: none;
  margin: 0;
  overflow: visible;
  font-size: 13px;
  line-height: 1.4;
}

#chat #chat_messages .chat_message .message .info,
#chat #chat_messages .pin_chat_message .message .info {
  display: flex;
  align-items: center;
  gap: 6px;
  height: auto;
  min-height: 20px;
  margin: 0 0 4px;
  padding: 0 !important;
  line-height: 18px;
}

#chat #chat_messages .message .info .author {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
  float: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

#chat #chat_messages .message .info .author .author_login {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

#chat #chat_messages .message .info .author .chat_badges {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  margin: 0;
}

#chat #chat_messages .message .info .author .chat_badges img {
  width: 16px;
  height: 16px;
}

#chat #chat_messages .message .info .date {
  position: static;
  flex: 0 0 auto;
  float: none;
  width: auto;
  height: auto;
  font-size: 11px;
  font-weight: 400;
  line-height: 18px;
  color: #c9a9cc;
  background: none;
  right: auto;
}

#chat #chat_messages .message .info .pin_badge {
  color: #ff4fb8;
  font-size: 15px;
}

/* кнопки модерации */
#chat #chat_messages .chat_message_actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  opacity: .55;
  transition: opacity .15s ease;
}

#chat #chat_messages .chat_message:hover .chat_message_actions,
#chat #chat_messages .pin_chat_message:hover .chat_message_actions {
  opacity: 1;
}

@media (hover: none) {
  #chat #chat_messages .chat_message_actions {
    opacity: 1;
  }
}

#chat #chat_messages .chat_message_actions .edit_message,
#chat #chat_messages .chat_message_actions .dell_message,
#chat #chat_messages .chat_message_actions .pin_message {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  font-size: 13px;
  color: #ffffff;
  background: rgba(255, 79, 184, .2);
  cursor: pointer;
  transition: background .15s ease;
}

#chat #chat_messages .chat_message_actions .edit_message:hover,
#chat #chat_messages .chat_message_actions .pin_message:hover {
  background: #8c5cff;
}

#chat #chat_messages .chat_message_actions .dell_message:hover {
  background: #ff3b6b;
}

/* пузырь с текстом */
#chat #chat_messages .chat_message .message .with_code,
#chat #chat_messages .pin_chat_message .message .with_code {
  display: block;
  width: fit-content;
  max-width: 100%;
  padding: 8px 12px;
  border-radius: 4px 14px 14px 14px;
  border: 1px solid transparent;
  font-size: 13px;
  line-height: 1.45;
  color: #ffffff;
  word-break: normal;
  overflow-wrap: anywhere;
}

#chat #chat_messages .message .with_code img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

#chat #chat_messages .message .with_code img.g_smile {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 0;
  vertical-align: middle;
}

#chat #chat_messages .message .with_code a {
  color: #ff8fd0;
  text-decoration: underline;
}

#chat #chat_messages .message textarea {
  width: 100%;
  margin: 6px 0 0;
  min-height: 70px;
  border-radius: 10px;
  resize: vertical;
}

/* ---------- Поле ввода ---------- */
#chat .chat_input_group {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  top: 0;
  margin: 12px 0 0;
  position: relative;
}

#chat .chat_input_group .smile_input {
  position: relative;
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}

#chat .chat_input_group .smile_input input {
  width: 100%;
  height: 44px;
  margin: 0;
  padding: 0 38px 0 14px;
  line-height: normal;
  border-radius: 12px;
  font-size: 13px;
}

#chat .chat_input_group .smile_input #smile_btn {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 20px;
  height: 20px;
  font-size: 18px;
  line-height: 20px;
  text-align: center;
  transform: translateY(-50%);
}

#chat .chat_input_group .chat_message_button {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  font-size: 19px;
  line-height: 1;
  color: #ffffff;
  cursor: pointer;
  outline: none;
}

#chat .chat_input_group button::before {
  content: none !important;
}

#chat .chat_auth_to_write {
  margin: 14px 0 0;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 79, 184, .08);
  border: 1px dashed rgba(255, 79, 184, .35);
  text-align: center;
  font-size: 13px;
  color: #d9b8dc;
}

#chat .chat_auth_to_write a {
  color: #ff4fb8;
  font-weight: 700;
  cursor: pointer;
}

#passive {
  padding: 24px 0 8px;
  text-align: center;
}

#passive img {
  max-width: 110px;
  margin-bottom: 10px;
}

/* поповер смайлов */
.popover .popover-body > .smiles_box {
  width: 253px;
  max-width: 80vw;
}

/* =====================================================================
   ВЫРАВНИВАНИЕ БЛОКОВ
   ===================================================================== */

/* мониторинг: счётчик онлайна (0/0 показывается только пока нет данных) */
.info-line:empty::before {
  content: "0/0";
}

.servers_heading {
  align-items: stretch;
}

/* отступы между блоками центральной колонки одинаковые */
.center_block > .block + .block,
.center_block > .block.mt-2 {
  margin-top: 15px !important;
}

/* правая колонка: равные промежутки между баннером, кейсами и чатом */
.right_block_sticky > * + * {
  margin-top: 15px;
}

.right_block_sticky > #activity-rewards-banner:empty {
  display: none;
}

.right_block_sticky > #activity-rewards-banner:empty + * {
  margin-top: 0;
}

/* выпадающий список «Онлайн» в шапке не должен обрезаться
   (RGB-рамка ниже в mystyles.css ставит overflow: hidden всем блокам) */
.flex_online_block,
.flex_online_block_later {
  overflow: visible !important;
}

.header_right_menu {
  min-width: 0;
}

/* Закрытое меню профиля в шапке невидимо, но его RGB-рамка (mystyles.css) крутилась всё время. Вместе с переливом
   надписи логотипа это заставляло браузер пересчитывать страницу в каждом кадре: на главной в покое основной поток
   был занят на 22%, при прокрутке на 37%. Рамка крутится только у открытого меню (06.11.2026) */
.mini_profile_dropdown::after,
.dropdown_content_miniprofile::after {
  animation-play-state: paused !important;
}

.miniprofile_menu.show-drd .mini_profile_dropdown::after,
.miniprofile_menu.show-drd .dropdown_content_miniprofile::after {
  animation-play-state: var(--rgb-play) !important;
}

/* =====================================================================
   ОБЩИЕ ЭЛЕМЕНТЫ (страницы сайта и модулей modules_extra)
   Базовые стили GameCMS (primary/endeltrap/bootstray) синие —
   приводим их к палитре never.
   ===================================================================== */
:root {
  --never-accent: #ff4fb8;
  --never-accent-2: #ec29df;
  --never-violet: #7b2cff;
  --never-gradient: linear-gradient(135deg, #7b2cff 0%, #ec29df 55%, #ff72a8 100%);
  --never-panel: #220829;
  --never-inner: #2a0b33;
  --never-inner-2: rgba(97, 33, 89, .55);
  --never-border: rgba(236, 41, 223, .38);
  --never-border-strong: rgba(236, 41, 223, .72);
  --never-muted: #d9b8dc;
}

/* баннеры «Кейсы» / «Бонусы» в правой колонке: картинка передаётся через
   style="--card-img: url(...)", иначе её перекрывал фон темы с !important */
.block_open_cases {
  background:
    var(--card-img, none) right center / auto 100% no-repeat,
    linear-gradient(180deg, rgba(44, 13, 53, .96), rgba(23, 5, 31, .98)) !important;
}

/* иконка в заголовке страницы (toolbar) — у модулей была синей через style="" */
.toolbar__icon i,
.toolbar__icon .fa,
.toolbar__icon .bx {
  color: var(--never-accent) !important;
  font-size: 40px;
  line-height: 40px;
  text-shadow: 0 0 14px rgba(255, 79, 184, .55);
}

/* кнопки */
.btn-primary,
.btn-primary:not(:disabled):not(.disabled):active,
.btn-primary:not(:disabled):not(.disabled).active {
  background: var(--never-gradient) !important;
  border-color: rgba(236, 41, 223, .76) !important;
  color: #ffffff !important;
  box-shadow: 0 0 14px rgba(236, 41, 223, .35);
}

.btn-primary:hover,
.btn-primary:focus {
  filter: brightness(1.1);
  box-shadow: 0 0 18px rgba(236, 41, 223, .5) !important;
}

.btn-default,
.btn-light,
.btn-outline-primary {
  background: var(--never-inner) !important;
  border: 1px solid var(--never-border) !important;
  color: #ffffff !important;
}

.btn-default:hover,
.btn-light:hover,
.btn-outline-primary:hover,
.btn-outline-primary:not(:disabled):not(.disabled).active {
  background: rgba(255, 79, 184, .18) !important;
  border-color: var(--never-accent) !important;
  color: #ffffff !important;
}

.btn-danger {
  background: linear-gradient(135deg, #b0124a 0%, #ff3b6b 100%) !important;
  border-color: rgba(255, 59, 107, .7) !important;
  color: #ffffff !important;
}

.btn:disabled,
.btn.disabled {
  opacity: .55;
}

/* боковое меню категорий/серверов (магазины, демо, правила, кейсы) */
.vertical-navigation {
  background: linear-gradient(180deg, rgba(44, 13, 53, .96), rgba(23, 5, 31, .98)) !important;
  border: 1px solid var(--never-border) !important;
  border-radius: 15px;
  overflow: hidden;
}

.vertical-navigation li {
  border-top-color: rgba(236, 41, 223, .16) !important;
}

.vertical-navigation li:first-child {
  border-top: 0;
}

.vertical-navigation li a {
  color: #ffffff;
}

.vertical-navigation li a:hover,
.vertical-navigation li.active a,
.vertical-navigation li a.active {
  background: linear-gradient(90deg, rgba(236, 41, 223, .35), rgba(123, 44, 255, .2)) !important;
  color: #ffffff !important;
}

/* служебные плашки */
.empty-element {
  padding: 18px;
  border-radius: 12px;
  background: rgba(255, 79, 184, .08);
  border: 1px dashed var(--never-border);
  color: var(--never-muted);
  text-align: center;
}

.block a:not(.btn):not(.header_btn):not([class*="never"]):not([class*="card"]):not(.chat_avatar):hover {
  color: var(--never-accent);
}

.text-primary {
  color: var(--never-accent) !important;
}

.bg-primary,
.badge-primary {
  background: var(--never-gradient) !important;
}

.progress {
  background: var(--never-inner);
}

.progress-bar {
  background: var(--never-gradient);
}

/* =====================================================================
   ВЕРХНЕЕ МЕНЮ (шапка)
   Раньше шапка оставалась серо-синей (#0c101a / #171b26) и не совпадала
   с фиолетово-розовыми блоками. Теперь она в той же палитре, что и левое меню.
   ===================================================================== */
.header_new {
  background:
    linear-gradient(180deg, rgba(44, 13, 53, .98) 0%, rgba(23, 5, 31, .97) 100%) !important;
  border-bottom: 1px solid rgba(236, 41, 223, .45) !important;
  box-shadow: 0 6px 26px rgba(236, 41, 223, .18), inset 0 -1px 0 rgba(255, 79, 184, .25) !important;
}

/* кнопки разделов */
.header_btn,
.header_btn_balance,
.avatar_miniprofile,
.dropdown_language .select > i {
  background: rgba(97, 33, 89, .3) !important;
  border: 1px solid rgba(236, 41, 223, .24) !important;
  border-radius: 10px !important;
  color: #ffffff !important;
  box-shadow: none !important;
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease, color .2s ease !important;
}

.header_btn i,
.header_btn_balance i {
  color: #ff4fb8 !important;
  fill: #ff4fb8 !important;
  text-shadow: 0 0 8px rgba(255, 79, 184, .45);
  transition: color .2s ease;
}

.header_btn:hover,
.header_btn:focus-visible,
.header_btn_balance:hover,
.avatar_miniprofile:hover,
.miniprofile_menu.show-drd .avatar_miniprofile,
.dropdown_language .select > i:hover,
.dropdown_language.active .select > i {
  background: linear-gradient(135deg, rgba(123, 44, 255, .42) 0%, rgba(236, 41, 223, .42) 100%) !important;
  border-color: rgba(255, 79, 184, .85) !important;
  color: #ffffff !important;
  box-shadow: 0 0 16px rgba(236, 41, 223, .4) !important;
  opacity: 1 !important;
}

.header_btn:hover i,
.header_btn:focus-visible i,
.header_btn_balance:hover i {
  color: #ffffff !important;
  fill: #ffffff !important;
}

/* подсветка текущей страницы ставится при загрузке без плавного перехода цвета (tpl/parts/header_fit.tpl) */
.kf-notr,
.kf-notr * {
  transition: none !important;
}

/* текущая страница (класс ставит kfMarkActive в tpl/parts/header_fit.tpl и home/leftmenu.tpl) */
.header_btn.active,
.header_new .header_btn.active {
  background: linear-gradient(135deg, #7b2cff 0%, #ec29df 55%, #ff72a8 100%) !important;
  border-color: rgba(255, 114, 168, .9) !important;
  box-shadow: 0 0 18px rgba(236, 41, 223, .5) !important;
}

.header_btn.active i {
  color: #ffffff !important;
  fill: #ffffff !important;
}

/* кнопка «Пополнить» — главная кнопка шапки */
.header_btn_balance {
  background: linear-gradient(135deg, #7b2cff 0%, #ec29df 55%, #ff72a8 100%) !important;
  border-color: rgba(255, 114, 168, .8) !important;
  font-weight: 600 !important;
}

.header_btn_balance:hover {
  filter: brightness(1.1);
}

/* баланс, онлайн, язык — плашки в цвет блоков */
.header_balance_new,
.flex_online_block {
  background: linear-gradient(180deg, rgba(44, 13, 53, .96), rgba(23, 5, 31, .98)) !important;
  border: 1px solid rgba(236, 41, 223, .38) !important;
  border-radius: 12px !important;
  box-shadow: 0 0 14px rgba(236, 41, 223, .18) !important;
}

.header_balance_new_icon,
.arrow_users_top {
  background: linear-gradient(135deg, #7b2cff 0%, #ec29df 55%, #ff72a8 100%) !important;
  border: 0 !important;
  color: #ffffff !important;
  box-shadow: 0 0 12px rgba(236, 41, 223, .4) !important;
}

.dropdown_language .select > i {
  display: flex !important;
  align-items: center;
  justify-content: center;
  color: #ff4fb8 !important;
}

.dropdown_language .dropdown-menu_language {
  background: linear-gradient(180deg, #2c0d35, #17051f) !important;
  border: 1px solid rgba(236, 41, 223, .45) !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .5), 0 0 16px rgba(236, 41, 223, .25) !important;
}

.dropdown_language .dropdown-menu_language li {
  color: #ffffff;
  border-radius: 8px;
}

.dropdown_language .dropdown-menu_language li:hover {
  background: rgba(255, 79, 184, .18) !important;
  color: #ffffff !important;
}

.avatar_miniprofile img {
  border: 2px solid rgba(255, 79, 184, .75) !important;
  box-shadow: 0 0 10px rgba(236, 41, 223, .45) !important;
}

.avatar_miniprofile svg path {
  stroke: #ff8fd0;
}

/* выбор языка (как в шаблоне Standart): кнопка «глобус + флаг + код», список с флагами.
   Список и флаги рисует js/lang-switch.js, основной язык — украинский */
.bsq-lang {
  position: relative;
  flex-shrink: 0;
  min-width: 46px;
  min-height: 42px;
}

.bsq-lang__btn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  background: rgba(97, 33, 89, .3);
  border: 1px solid rgba(236, 41, 223, .24);
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.bsq-lang__btn:focus {
  outline: none;
}

.bsq-lang__btn:hover,
.bsq-lang__btn:focus-visible,
.bsq-lang.is-open .bsq-lang__btn {
  background: linear-gradient(135deg, rgba(123, 44, 255, .42) 0%, rgba(236, 41, 223, .42) 100%);
  border-color: rgba(255, 79, 184, .85);
  box-shadow: 0 0 16px rgba(236, 41, 223, .4);
}

.bsq-lang__globe {
  font-size: 18px;
  color: #ff4fb8;
}

.bsq-lang__flag {
  width: 26px;
  height: 18px;
  border-radius: 3px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .15);
}

.bsq-lang__chev {
  font-size: 18px;
  transition: transform .2s ease;
}

.bsq-lang.is-open .bsq-lang__chev {
  transform: rotate(180deg);
}

.bsq-lang__menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 10600;
  width: 290px;
  max-height: 360px;
  overflow-y: auto;
  padding: 6px;
  border-radius: 14px;
  background: linear-gradient(180deg, #2c0d35, #17051f);
  border: 1px solid rgba(236, 41, 223, .45);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .6), 0 0 18px rgba(236, 41, 223, .25);
  scrollbar-width: thin;
  scrollbar-color: #ff4fb8 transparent;
}

.bsq-lang__menu::-webkit-scrollbar { width: 5px; }
.bsq-lang__menu::-webkit-scrollbar-thumb { background: #ff4fb8; border-radius: 4px; }

.bsq-lang.is-open .bsq-lang__menu {
  display: block;
}

.bsq-lang__item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #f3e6f5;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background .15s ease;
}

.bsq-lang__item:focus {
  outline: none;
}

.bsq-lang__item img {
  flex-shrink: 0;
  width: 28px;
  height: 19px;
  border-radius: 3px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .12);
}

.bsq-lang__item span {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.bsq-lang__item:hover,
.bsq-lang__item:focus-visible {
  background: rgba(255, 79, 184, .16);
}

.bsq-lang__item.is-active {
  background: linear-gradient(90deg, rgba(123, 44, 255, .5), rgba(236, 41, 223, .45));
  color: #ffffff;
}

.bsq-lang__main {
  flex-shrink: 0;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(255, 79, 184, .2);
  font-size: 10px;
  font-weight: 700;
  color: #ff8fd0;
}

/* служебные элементы Google Переводчика */
#google_translate_element {
  display: none !important;
}

html[data-site-lang] body {
  top: 0 !important;
}

@media (max-width: 1250px) {
  .bsq-lang__btn > .bsq-lang__globe,
  .bsq-lang__btn > .bsq-lang__code {
    display: none;
  }
}

/* телефон: у кнопки только флаг, список — на всю ширину под шапкой */
@media (max-width: 991.98px) {
  .bsq-lang__btn {
    height: 42px;
    padding: 0 9px;
    gap: 4px;
  }

  .bsq-lang__btn > .bsq-lang__chev {
    display: none;
  }

  .bsq-lang__menu {
    position: fixed;
    top: 66px;
    left: 12px;
    right: 12px;
    width: auto;
    max-height: 60vh;
  }
}
/* выпадающий список «Онлайн».
   Раньше открывался только наведением мыши — по нажатию и на телефоне не показывался.
   Теперь открывается и по нажатию на кнопку (класс .show-online ставит скрипт в bottom.tpl) */
.online_prcr {
  background: linear-gradient(180deg, #2c0d35, #17051f) !important;
  border: 1px solid rgba(236, 41, 223, .45) !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .5), 0 0 16px rgba(236, 41, 223, .25) !important;
  padding: 12px;
}

.online_pro .arrow_users_top {
  cursor: pointer;
}

.online_pro.show-online .online_prcr {
  display: block;
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
  z-index: 100;
}

.online_pro.show-online .arrow_users_top {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .85), 0 0 16px rgba(236, 41, 223, .6) !important;
}

.online_prcr .right_now_online {
  background: rgba(255, 79, 184, .16);
  color: #ff8fd0;
}

.online_prcr .online_scroll {
  gap: 6px;
  max-height: 260px;
}

/* логотип — без «тусклости» при наведении, лёгкое свечение */
.header_logo:hover {
  opacity: 1 !important;
  filter: drop-shadow(0 0 8px rgba(255, 79, 184, .55));
}

/* логотип как на black-squad.net: тёмная плашка, круглая аватарка, светящаяся надпись и сердечко
   (картинка и надпись — в config.tpl, header_logo) */
.header_logo.kf-logo {
  flex-shrink: 0;
  gap: 10px;
  height: 46px;
  padding: 0 14px 0 4px;
  border: 1px solid rgba(236, 41, 223, .3);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(44, 13, 53, .9), rgba(23, 5, 31, .92));
  box-shadow: 0 0 14px rgba(236, 41, 223, .22), inset 0 0 12px rgba(236, 41, 223, .08);
  text-decoration: none !important;
}

.header_logo .kf-logo__avatar {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  max-width: none;
  border: 2px solid #ff4fb8;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 10px rgba(255, 79, 184, .6);
}

/* надпись переливается: цвета плавно перетекают по буквам (розовый — фиолетовый — голубой — розовый).
   Фон втрое шире надписи и повторяется, сдвиг ровно на его ширину — круг без рывка.
   Сердечко и обводка аватарки меняют цвет в такт. Их крутит видеокарта (hue-rotate) без перерисовки страницы.
   Надпись сдвигает таймер 15 раз в секунду (tpl/parts/header_fit.tpl). Раньше это делала CSS-анимация, и браузер
   из-за неё пересчитывал страницу в каждом кадре: на мониторе 144 Гц в покое 14% основного потока, на слабом
   компьютере 66%. С таймером — 4% и 18%, вид тот же (06.11.2026) */
.kf-logo__text {
  background: linear-gradient(90deg, #ff4fb8 0%, #e690ff 17%, #8a7dff 33%, #5fd2ff 50%, #8a7dff 67%, #e690ff 83%, #ff4fb8 100%);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: .01em;
  line-height: 1.1;
  white-space: nowrap;
  filter: drop-shadow(0 0 6px rgba(236, 41, 223, .75));
}

.kf-logo__heart {
  color: #ff4fb8;
  font-size: 19px;
  text-shadow: 0 0 8px rgba(255, 79, 184, .95);
  animation: kf-logo-hue 6s linear infinite;
}

/* обводка отдельным слоем: иначе вместе с ней менялись бы цвета самой аватарки */
.header_logo.kf-logo {
  position: relative;
}

.header_logo .kf-logo__avatar {
  border-color: transparent;
  box-shadow: none;
}

.header_logo.kf-logo::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 4px;
  width: 38px;
  height: 38px;
  margin-top: -19px;
  box-sizing: border-box;
  border: 2px solid #ff4fb8;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(255, 79, 184, .6);
  pointer-events: none;
  animation: kf-logo-hue 6s linear infinite;
}

/* розовый — фиолетовый — голубой */
@keyframes kf-logo-hue {
  0%, 100% { filter: hue-rotate(0deg); }
  33% { filter: hue-rotate(-80deg); }
  66% { filter: hue-rotate(-128deg); }
}

/* у кого в системе включено «уменьшить движение» — без анимации */
@media (prefers-reduced-motion: reduce) {
  .kf-logo__text,
  .kf-logo__heart,
  .header_logo.kf-logo::before {
    animation: none;
  }
}

/* в шапке тесно (кнопки меню, онлайн, баланс) — надпись логотипа в две строки, плашка как прежний логотип.
   Класс ставит tpl/parts/header_fit.tpl, когда иначе кнопки меню не помещаются (раньше — всегда до 1600px) */
@media (min-width: 992px) {
  .header_new_content.kf-hdr-logo2 .kf-logo__text {
    max-width: 96px;
    font-size: 14px;
    white-space: normal;
  }
}

/* Кнопки меню в шапке: с подписями, плотнее (kf-hdr-compact), только подписи (kf-hdr-text), только иконки
   (kf-hdr-icons), а на планшете ещё и без надписи логотипа, аватарок «Онлайн» и значка кошелька (kf-hdr-tight).
   Класс ставит tpl/parts/header_fit.tpl по месту, которое в шапке есть на самом деле: шапка never не шире 1770px,
   а блок справа удлиняют баланс, аватарки «Онлайн» и язык. Раньше это решала ширина окна, и при реальном
   балансе «Мут-лист» наезжал на выбор языка даже на широком мониторе (06.11.2026) */
.header_new_content.kf-hdr-compact .header_btns,
.header_new_content.kf-hdr-text .header_btns,
.header_new_content.kf-hdr-icons .header_btns {
  margin-left: 15px;
  gap: 5px;
}

.header_new_content.kf-hdr-compact .header_btns .header_btn {
  padding-right: 11px;
  padding-left: 11px;
}

.header_new_content.kf-hdr-text .header_btns .header_btn {
  padding-right: 10px;
  padding-left: 10px;
}

.header_new_content.kf-hdr-text .header_btns .header_btn i {
  display: none;
}

.header_new_content.kf-hdr-tight .kf-logo__text,
.header_new_content.kf-hdr-tight .user_online_block,
.header_new_content.kf-hdr-tight .header_balance_new_icon {
  display: none;
}

.header_new_content.kf-hdr-icons .header_btns .header_btn {
  padding: 10px 12px;
}

.header_new_content.kf-hdr-icons .header_btns .header_btn i {
  font-size: 16px;
}

.header_new_content.kf-hdr-icons .header_btns .header_btn span {
  display: none;
}

/* =====================================================================
   НОУТБУКИ И ПЛАНШЕТЫ В АЛЬБОМЕ (992–1399px)
   Колонки 18% / 64% / 18% на этих ширинах слишком узкие: чат сжимался
   до ~140px, а кнопки шапки наезжали на блок онлайна и баланс.
   ===================================================================== */
@media (min-width: 992px) {
  .right_block {
    min-width: 270px;
  }

  .center_block {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
  }

  /* «Сервера» тянется, «На серверах: N/M» занимает ровно сколько нужно */
  .servers_heading .w-80 {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
  }

  .servers_heading .w-20 {
    flex: 0 0 auto;
    width: auto;
    min-width: 170px;
  }
}

.header_balance_new_text,
.header_btn {
  white-space: nowrap;
}

@media (min-width: 992px) and (max-width: 1299.98px) {
  .left_block {
    flex: 0 0 200px;
    width: 200px;
  }
}

/* =====================================================================
   ПРАВАЯ КОЛОНКА НА ПК: кейсы + чат всегда помещаются в экран,
   поле ввода и кнопка отправки всегда видны (колонка «липкая»).
   ===================================================================== */
@media (min-width: 992px) {
  .right_block_sticky {
    display: flex;
    flex-direction: column;
    /* 196px = шапка + бегущая строка + отступ: поле ввода видно сразу при открытии страницы */
    max-height: calc(100vh - 196px);
    min-height: 520px;
  }

  .right_block_sticky > * {
    flex-shrink: 0;
  }

  .right_block_sticky > .never_chat {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
  }

  .never_chat #chat,
  .never_chat #chat > form,
  .never_chat #chat #drop_zone {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
  }

  .never_chat #chat .chat_input_group,
  .never_chat #chat .chat_auth_to_write {
    flex-shrink: 0;
  }

  #chat #chat_messages {
    flex: 1 1 auto;
    height: auto;
    min-height: 220px;
    max-height: none;
  }

  #chat #drop_zone.hover #chat_messages,
  #chat #drop_zone.error #chat_messages {
    height: auto;
  }
}

/* =====================================================================
   МОБИЛЬНАЯ ВЕРСИЯ
   ===================================================================== */
@media (max-width: 991.98px) {
  .header_logo {
    min-width: 0;
    flex-shrink: 1;
  }

  .header_logo img {
    height: 44px;
    max-width: 160px;
    object-fit: contain;
  }

  /* надпись логотипа — в две строки, чтобы рядом поместились язык и кнопки */
  .header_logo.kf-logo {
    flex-shrink: 1;
    gap: 7px;
    height: 44px;
    padding: 0 10px 0 3px;
  }

  .header_logo .kf-logo__avatar {
    width: 34px;
    height: 34px;
    max-width: none;
  }

  .header_logo.kf-logo::before {
    left: 3px;
    width: 34px;
    height: 34px;
    margin-top: -17px;
  }

  /* на телефоне надпись не перерисовывается: цвета стоят */
  .kf-logo__text {
    min-width: 0;
    font-size: 13px;
    white-space: normal;
    background-size: 100% 100%;
    animation: none;
  }

  .kf-logo__heart {
    font-size: 15px;
  }

  .header_right_menu {
    gap: 8px;
    flex-shrink: 0;
  }
  #chat #chat_messages {
    height: 55vh;
    min-height: 300px;
  }

  .mobile-menu-bottom-item {
    flex: 1 1 0;
    min-width: 0;
    padding: 10px 2px;
  }

  /* нижнее меню телефона — в цвет шапки */
  .mobile-menu-bottom {
    background: linear-gradient(0deg, rgba(23, 5, 31, .99), rgba(44, 13, 53, .97)) !important;
    border-top: 1px solid rgba(236, 41, 223, .45) !important;
    box-shadow: 0 -6px 22px rgba(236, 41, 223, .18);
  }

  .mobile-menu-bottom-item {
    color: #d9b8dc !important;
  }

  .mobile-menu-bottom-item i,
  .mobile-menu-bottom-item span {
    color: inherit !important;
  }

  .mobile-menu-bottom-item.active,
  .mobile-menu-bottom-item:hover {
    color: #ff4fb8 !important;
  }

  .mobile-menu-bottom-item span {
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  /* на узких экранах в шапке оставляем только кнопку списка онлайна */
  .flex_online_block .user_online_block {
    display: none;
  }
}

/* =====================================================================
   ВХОД ЧЕРЕЗ TELEGRAM (модуль tg_auth)
   Кнопки «Войти через Telegram» и «Регистрация через Telegram» в окнах
   входа и регистрации (tpl/index/top.tpl) — под кнопкой Steam.
   ===================================================================== */

/* пока сайт не ответил, что бот подключён, кнопки нет. Стили модуля грузятся только при открытии окна,
   а .login_social_register_social a задаёт display: flex — без этого правила кнопка была бы видна сразу */
[data-tg-auth][hidden] {
  display: none !important;
}

.login_social_register_social .tga-never-btn {
  margin-top: 10px;
  text-align: center;
}

.login_social_register_social .tga-never-btn i {
  color: #2aabee;
  transition: color .3s;
}

.login_social_register_social .tga-never-btn:hover {
  background: #229ed9;
  border-color: #2aabee;
}

.login_social_register_social .tga-never-btn:hover i {
  color: #fff;
}

/* окно регистрации: регистрация только через Telegram */
.kf-reg-note {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
}

/* =====================================================================
   ЭКРАН ВХОДА НА ГЛАВНОЙ (гость, tpl/index/body.tpl) — как на cs-impulse.ru:
   слева регистрация и вход, справа сервера (карточки .kf-srv из
   tpl/elements/server.tpl), сбоку кнопки техподдержки и Telegram-канала.
   Класс kf-gate-on ставит сам экран. Без z-index у блоков экрана: иначе
   окно со списком игроков сервера оказалось бы под затемнением Bootstrap.
   ===================================================================== */
html.kf-gate-on .header_new,
html.kf-gate-on .left_block,
html.kf-gate-on .footer_new_container {
  display: none !important;
}

.kf-gate {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100vh;
  padding: 72px 16px 40px;
}

/* свой фон экрана входа (img/gate_bg.jpg, 2560x1440: девушки по краям, в центре место под форму;
   заменили картинку — увеличьте ?v=, иначе браузеры сутки показывают старую).
   Картинка на неподвижном слое, а не background-attachment: fixed — тот на iPhone не работает.
   Поверх неё затемнение только в центре, под формой; фон остальных страниц здесь не нужен */
html.kf-gate-on body {
  background: #0c0410;
}

html.kf-gate-on body::before {
  display: none;
}

.kf-gate::before {
  content: '';
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, rgba(8, 2, 12, .5) 0%, rgba(8, 2, 12, .22) 45%, rgba(8, 2, 12, 0) 75%),
    #0c0410 url("../img/gate_bg.jpg?v=2") center / cover no-repeat;
}

.kf-gate__lang {
  position: absolute;
  top: 16px;
  right: 16px;
}

.kf-gate__inner {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 20px;
  width: 100%;
  max-width: 800px;
}

.kf-gate__auth {
  flex: 0 0 330px;
  max-width: 100%;
}

.kf-gate__servers {
  flex: 1 1 440px;
  min-width: 0;
}

.kf-gate__reg,
.kf-gate__card {
  background: linear-gradient(180deg, rgba(44, 13, 53, .94), rgba(23, 5, 31, .96));
  border: 1px solid rgba(236, 41, 223, .28);
  border-radius: 15px;
  box-shadow: 0 0 22px rgba(236, 41, 223, .25);
}

.kf-gate__reg {
  display: block;
  width: 100%;
  height: 46px;
  margin-bottom: 10px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.kf-gate__reg:hover,
.kf-gate__reg:focus-visible {
  background: linear-gradient(135deg, #7b2cff 0%, #ec29df 55%, #ff72a8 100%);
  border-color: transparent;
  box-shadow: 0 0 22px rgba(236, 41, 223, .55);
  outline: none;
}

.kf-gate__card {
  padding: 22px 20px 16px;
}

.kf-gate__card .input_new_login input {
  width: 100%;
  min-width: 0;
}

.kf-gate__login {
  display: block;
  width: 100%;
  height: 46px;
  margin-top: 6px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #7b2cff 0%, #ec29df 55%, #ff72a8 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(236, 41, 223, .35);
  transition: filter .2s ease, box-shadow .2s ease;
}

.kf-gate__login:hover,
.kf-gate__login:focus-visible {
  filter: brightness(1.1);
  box-shadow: 0 6px 24px rgba(236, 41, 223, .55);
  outline: none;
}

.kf-gate__social {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.kf-gate__soc {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 12px;
  color: #fff !important;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none !important;
  transition: filter .2s ease, transform .2s ease;
}

.kf-gate__soc i {
  flex-shrink: 0;
  font-size: 20px;
}

.kf-gate__soc--tg {
  background: linear-gradient(135deg, #2aabee, #1e88d1);
}

.kf-gate__soc--steam {
  background: linear-gradient(135deg, #1b2838, #2a475e);
  border: 1px solid rgba(255, 255, 255, .1);
}

.kf-gate__soc:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
}

.kf-gate #result {
  margin-top: 10px;
  font-size: 13px;
  text-align: center;
}

.kf-gate #result p {
  margin: 0;
}

.kf-gate__forgot {
  display: block;
  margin-top: 14px;
  font-size: 12px;
  text-align: center;
  color: #c9a7cf !important;
}

.kf-gate__forgot:hover {
  color: #ff4fb8 !important;
}

.kf-gate__links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(236, 41, 223, .18);
}

.kf-gate__links a {
  color: rgba(243, 230, 245, .62) !important;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-align: center;
  text-transform: uppercase;
}

.kf-gate__links a:hover {
  color: #ff4fb8 !important;
}

.kf-gate__title {
  margin: 4px 0 14px;
  color: #fff;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: .02em;
  line-height: 1.2;
  text-align: center;
  text-shadow: 0 0 18px rgba(236, 41, 223, .45);
}

.kf-gate__title b {
  font-weight: inherit;
  color: #ff4fb8;
}

/* список серверов: больше четырёх — с прокруткой */
.kf-gate__list {
  max-height: 382px;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: #ff4fb8 transparent;
}

.kf-gate__list::-webkit-scrollbar { width: 5px; }
.kf-gate__list::-webkit-scrollbar-thumb { background: #ff4fb8; border-radius: 4px; }

.kf-gate__list > .loader {
  margin: 30px auto;
}

.kf-gate #servers .item {
  width: auto;
  margin: 0 0 10px;
  padding: 0;
}

.kf-gate #servers .server-category-card {
  display: none !important;
}

/* карточка сервера для экрана входа; на других страницах её нет */
.kf-srv {
  display: none;
}

.kf-gate .kf-srv {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 84px;
  padding: 10px 12px;
  overflow: hidden;
  border: 1px solid rgba(236, 41, 223, .28);
  border-radius: 15px;
  background: #1b0622;
  box-shadow: 0 0 16px rgba(236, 41, 223, .18);
}

.kf-srv__bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .6;
  pointer-events: none;
}

.kf-gate .kf-srv::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(23, 5, 31, .9) 0%, rgba(23, 5, 31, .5) 55%, rgba(23, 5, 31, .85) 100%);
}

.kf-srv__online,
.kf-srv__info,
.kf-srv__play {
  position: relative;
  z-index: 1;
}

.kf-srv__online {
  flex: 0 0 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 64px;
  border: 1px solid rgba(236, 41, 223, .3);
  border-radius: 12px;
  background: rgba(12, 4, 18, .85);
  color: #fff !important;
  text-decoration: none !important;
  cursor: pointer;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.kf-srv__online:hover {
  border-color: #ff4fb8;
  box-shadow: 0 0 12px rgba(236, 41, 223, .45);
}

.kf-srv__now {
  font-size: 13px;
  font-weight: 800;
}

.kf-srv__bar {
  display: block;
  width: 40px;
  height: 4px;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(255, 255, 255, .14);
}

.kf-srv__bar span {
  display: block;
  max-width: 100%;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #7b2cff, #ff4fb8);
}

.kf-srv__info {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  color: rgba(255, 255, 255, .85);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

.kf-srv__info > * {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.kf-srv__name {
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

/* PLAY — вертикальная кнопка, читается снизу вверх */
.kf-srv__play {
  flex: 0 0 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 64px;
  border: 1.5px solid #ff4fb8;
  border-radius: 18px;
  color: #fff !important;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-decoration: none !important;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.kf-srv__play:hover {
  background: linear-gradient(135deg, #7b2cff, #ec29df);
  border-color: transparent;
  box-shadow: 0 0 14px rgba(236, 41, 223, .6);
}

/* страница ошибки для гостя (tpl/error.tpl): карточка с причиной на фоне экрана входа */
.kf-gate__error {
  position: relative;
  width: 100%;
  max-width: 760px;
  padding: 50px 32px 34px;
  border: 1px solid rgba(236, 41, 223, .28);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(44, 13, 53, .94), rgba(23, 5, 31, .96));
  box-shadow: 0 0 22px rgba(236, 41, 223, .25);
  text-align: center;
}

.kf-gate__error-icon {
  position: absolute;
  top: -36px;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7b2cff, #ec29df 60%, #ff72a8);
  box-shadow: 0 0 26px rgba(236, 41, 223, .6);
  color: #fff;
  font-size: 36px;
  transform: translateX(-50%);
}

.kf-gate__error-title {
  margin-bottom: 8px;
  color: #fff;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.25;
  text-shadow: 0 0 18px rgba(236, 41, 223, .45);
}

.kf-gate__error-text {
  margin: 0 0 24px;
  color: rgba(243, 230, 245, .85);
  font-size: 15px;
  line-height: 1.5;
}

.kf-gate__error-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 12px;
  background: linear-gradient(135deg, #7b2cff 0%, #ec29df 55%, #ff72a8 100%);
  box-shadow: 0 6px 20px rgba(236, 41, 223, .35);
  color: #fff !important;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none !important;
  transition: filter .2s ease, box-shadow .2s ease;
}

.kf-gate__error-btn i {
  font-size: 18px;
}

.kf-gate__error-btn:hover,
.kf-gate__error-btn:focus-visible {
  filter: brightness(1.1);
  box-shadow: 0 6px 24px rgba(236, 41, 223, .55);
  outline: none;
}

/* кнопки сбоку: техподдержка и Telegram-канал */
.kf-gate__side {
  position: fixed;
  top: 50%;
  right: 16px;
  z-index: 1030;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px;
  border: 1px solid rgba(236, 41, 223, .3);
  border-radius: 30px;
  background: rgba(23, 5, 31, .88);
  box-shadow: 0 0 18px rgba(236, 41, 223, .25);
  transform: translateY(-50%);
}

.kf-gate__side-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #fff !important;
  font-size: 21px;
  text-decoration: none !important;
  transition: transform .2s ease, box-shadow .2s ease;
}

.kf-gate__side-btn--help {
  background: linear-gradient(135deg, #7b2cff, #ec29df 60%, #ff72a8);
}

.kf-gate__side-btn--tg {
  background: #2aabee;
}

.kf-gate__side-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 0 14px rgba(236, 41, 223, .6);
}

/* планшет: кнопки сбоку — внизу справа, чтобы не наезжали на сервера */
@media (max-width: 991.98px) {
  .kf-gate {
    padding-bottom: 96px;
  }

  .kf-gate__side {
    top: auto;
    bottom: 16px;
    flex-direction: row;
    transform: none;
  }
}

/* телефон: вход сверху, сервера под ним; на фоне — девушка со снайперской винтовкой, фон темнее */
@media (max-width: 767.98px) {
  .kf-gate {
    align-items: flex-start;
    padding: 72px 4px 96px;
  }

  .kf-gate::before {
    background:
      linear-gradient(rgba(8, 2, 12, .35), rgba(8, 2, 12, .35)),
      #0c0410 url("../img/gate_bg.jpg?v=2") 8% center / cover no-repeat;
  }

  .kf-gate__inner {
    flex-direction: column;
    align-items: stretch;
    gap: 22px;
    max-width: 420px;
  }

  .kf-gate__auth,
  .kf-gate__servers {
    flex: 0 0 auto;
  }

  .kf-gate__list {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  /* на странице ошибки одна карточка — по центру экрана */
  .kf-gate--error {
    align-items: center;
    padding: 90px 12px 96px;
  }

  .kf-gate__error {
    padding: 48px 20px 28px;
  }

  .kf-gate__error-title {
    font-size: 22px;
  }
}

/* =====================================================================
   КАРТОЧКИ РАЗДЕЛОВ НА ГЛАВНОЙ (tpl/parts/slider.tpl) — вместо слайдера,
   как в шаблоне standart: BALANCE / MODELS / ANEW / SHOP. Неоновая рамка
   бежит по краю, карточка «парит», при наведении — блик, свет за курсором
   и 3D-наклон (скрипт в slider.tpl). Подпись — текстом поверх картинки
   (размер от ширины карточки, cqw), чтобы переводилась.
   ===================================================================== */
.kf-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 6px 0;
  margin-bottom: 12px;
  perspective: 900px;
}

.kf-card {
  --glow: #2ff0e8;
  --mx: 50%;
  --my: 50%;
  position: relative;
  display: block;
  aspect-ratio: 720 / 1216;
  overflow: hidden;
  isolation: isolate;
  container-type: inline-size;
  border: 2px solid color-mix(in srgb, var(--glow) 55%, #000);
  border-radius: 16px;
  background: #0b0b10;
  box-shadow: 0 0 10px color-mix(in srgb, var(--glow) 25%, transparent), inset 0 0 0 1px rgb(0 0 0 / 60%);
  transform-style: preserve-3d;
  transition: transform .35s cubic-bezier(.2, .8, .2, 1), box-shadow .3s ease, border-color .3s ease;
  will-change: transform;
}


/* картинка и подпись — один слой: при наведении увеличиваются вместе */
.kf-card__art {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: block;
  transition: transform .6s cubic-bezier(.2, .8, .2, 1), filter .3s ease;
}

.kf-card picture,
.kf-card img {
  display: block;
  width: 100%;
  height: 100%;
}

.kf-card img {
  object-fit: cover;
}

.kf-card__sub {
  position: absolute;
  top: 87.6%;
  right: 0;
  left: 0;
  padding: 0 6%;
  color: #eef4ff;
  font-size: 11px;
  font-size: max(8px, 3.9cqw);
  font-weight: 800;
  letter-spacing: .04em;
  line-height: 1.15;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 0 0 8px color-mix(in srgb, var(--glow) 70%, transparent), 0 1px 2px rgb(0 0 0 / 80%);
  transform: translateY(-50%);
  pointer-events: none;
}

/* бегущая неоновая рамка по краю карточки: вращается большой квадрат с градиентом, виден только край 2px.
   Раньше менялся сам угол градиента, и браузер заново рисовал рамку в каждом кадре */
.kf-card__ring {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 3;
  overflow: hidden;
  padding: 2px;
  border-radius: inherit;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: .75;
  pointer-events: none;
}

.kf-card__ring::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 260%;
  aspect-ratio: 1;
  background: conic-gradient(transparent 0 55%, color-mix(in srgb, var(--glow) 70%, transparent) 70%, #fff 76%, var(--glow) 82%, transparent 95%);
  transform: translate(-50%, -50%);
  animation: kfCardSpin 5s linear infinite;
}

/* блик-полоса при наведении */
.kf-card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  background: linear-gradient(115deg, transparent 35%, rgb(255 255 255 / 20%) 50%, transparent 65%);
  transform: translateX(-120%);
  transition: transform .8s ease;
  pointer-events: none;
}

/* мягкий свет за курсором */
.kf-card__glare {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  background: radial-gradient(circle at var(--mx) var(--my), rgb(255 255 255 / 22%), color-mix(in srgb, var(--glow) 18%, transparent) 30%, transparent 60%);
  opacity: 0;
  mix-blend-mode: screen;
  transition: opacity .3s ease;
  pointer-events: none;
}

.kf-card:hover {
  border-color: var(--glow);
  box-shadow: 0 0 22px color-mix(in srgb, var(--glow) 65%, transparent), 0 14px 34px rgb(0 0 0 / 65%);
}

.kf-card:hover .kf-card__art { transform: scale(1.06); filter: brightness(112%) saturate(110%); }
.kf-card:hover::after { transform: translateX(120%); }
.kf-card:hover .kf-card__ring { opacity: 1; }
.kf-card:hover .kf-card__ring::before { animation-duration: 2.2s; }
.kf-card:hover .kf-card__glare { opacity: 1; }
.kf-card:not(.is-tilting):hover { transform: translateY(-6px); }

.kf-card--cyan   { --glow: #2ff0e8; }
.kf-card--red    { --glow: #ff3a4c; }
.kf-card--green  { --glow: #a8ff36; }
.kf-card--purple { --glow: #a866ff; }

@keyframes kfCardSpin { to { transform: translate(-50%, -50%) rotate(360deg); } }

@media (max-width: 1199.98px) {
  .kf-cards { gap: 12px; }
}

/* телефон: две карточки в ряд */
@media (max-width: 768.98px) {
  .kf-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .kf-card__ring::before { animation: none; }
  .kf-card,
  .kf-card__art,
  .kf-card::after { transition: none; }
}

/* напоминание «Привяжите Telegram» на главной (рисует модуль tg_auth, tpl/home/index.tpl) — в оформлении never:
   тёмная плашка с голубым свечением Telegram */
.center_block .tga-banner {
  margin-bottom: 12px;
  border-color: rgba(42, 171, 238, .55);
  border-radius: 15px;
  background: linear-gradient(135deg, rgba(42, 171, 238, .22) 0%, rgba(44, 13, 53, .94) 45%, rgba(23, 5, 31, .96) 100%);
  box-shadow: 0 0 18px rgba(42, 171, 238, .25);
}

.center_block .tga-banner__icon {
  box-shadow: 0 0 14px rgba(42, 171, 238, .7);
}

.center_block .tga-banner__btn {
  box-shadow: 0 4px 16px rgba(42, 171, 238, .35);
}


/* =====================================================================
   27.11 МАСШТАБ САЙТА И КАРТИНКА ФОНА
   - Фон — img/kaifariki.jpg: ваша картинка kaifariki.png, сжатая в JPG (0,5 МБ вместо 2,6 МБ, на вид та же).
     Телефон, планшет и экран «стоя» — img/kaifariki_m.jpg: левая девушка с этой картинки
     (раньше там оставался старый фон bg_kaif_m.jpg).
   - Компьютер: сайт уменьшен, как будто в браузере выбран масштаб 80 % (экран от 1600 px) или 90 % (1200–1599 px).
     Масштаб — числа --kf-z ниже (1 = как было, .8 = 80 %). Уменьшается .wapper — весь сайт, кроме фона;
     всплывающие окошки (смайлы, календарь, меню редактора) движок кладёт прямо в <body>, они встают на место.
   - Главная на компьютере: сверху «окно» — картинка фона видна целиком, до строки «Стабільні сервери / Чесна гра /
     Українська спільнота»; блоки начинаются под ней и при прокрутке наезжают на картинку.
     Главную узнаём по карточкам .kf-cards (tpl/parts/slider.tpl) — шаблоны не меняются.
   - Все страницы на компьютере: под блоками по центру тёмная полоса шириной с надпись картинки — обрывки
     надписи больше не торчат между блоками, девушки по краям видны.
   - Телефон, планшет, экран «стоя»: на главной картинка — баннером над карточками.
   Экран входа для гостей не меняется.
   ===================================================================== */
:root {
  --kf-z: 1;
  /* во сколько раз картинка фона 1672x941 растянута на этом экране (background-size: cover) */
  --kf-S: max(calc(100vw / 1672), calc(100vh / 941));
  /* высота «окна» над блоками главной. Картинка прижата к верху экрана, строка «Стабільні сервери…»
     кончается на 675-й строке картинки из 941 — низ окна чуть ниже. 176 = шапка + бегущая строка + отступ блоков.
     Считается в пикселях сайта до уменьшения, поэтому делится на --kf-z. Окно не ниже, чем «высота экрана − 90 px»,
     чтобы верх карточек был виден сразу; на очень широком и низком экране (21:9) строка «Стабільні сервери…» целиком
     не помещается — там окно кончается под «Ігровий проект CS 1.6» (604-я строка картинки) */
  --kf-cut: 694;
  --kf-win: max(200px, min(calc(var(--kf-cut) * var(--kf-S) / var(--kf-z) - 176px), calc((100vh - 90px) / var(--kf-z) - 176px)));
}

@media (min-aspect-ratio: 11/5) {
  :root { --kf-cut: 604; }
}

@media (min-width: 1200px) and (min-aspect-ratio: 5/4) {
  :root { --kf-z: .9; }
}

@media (min-width: 1600px) and (min-aspect-ratio: 5/4) {
  :root { --kf-z: .8; }
}

/* браузер без zoom (старый Firefox) — масштаб как был, расчёты без деления */
@supports not (zoom: 1) {
  :root { --kf-z: 1; }
}

html:not(.kf-gate-on) .wapper {
  zoom: var(--kf-z);
}

html:not(.kf-gate-on) body::before {
  background-image: url("../img/kaifariki.jpg?v=1");
}

@media (min-width: 992px) and (min-aspect-ratio: 5/4) {
  html:not(.kf-gate-on) .wapper > .container {
    position: relative;
  }

  /* тёмная полоса под блоками: по центру экрана, шириной с надпись картинки, края мягкие */
  html:not(.kf-gate-on) .wapper > .container::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    z-index: -1;
    width: calc((784 * var(--kf-S) + 260px) / var(--kf-z));
    transform: translateX(-50%);
    pointer-events: none;
    background: linear-gradient(90deg,
      rgba(12, 5, 21, 0) 0,
      #0c0515 calc(130px / var(--kf-z)),
      #0c0515 calc(100% - 130px / var(--kf-z)),
      rgba(12, 5, 21, 0) 100%);
  }

  /* главная: «окно» сверху; полоса начинается под ним и проявляется плавно */
  html:not(.kf-gate-on) .wapper > .container:has(.kf-cards) {
    padding-top: var(--kf-win);
  }

  html:not(.kf-gate-on) .wapper > .container:has(.kf-cards)::before {
    top: calc(var(--kf-win) + 24px);
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 calc(160px / var(--kf-z)));
    mask-image: linear-gradient(180deg, transparent 0, #000 calc(160px / var(--kf-z)));
  }
}

/* телефон, планшет и экран «стоя»: фон — девушка с картинки, на главной картинка целиком — баннером над карточками */
@media (max-width: 991.98px), (max-aspect-ratio: 1249/1000) {
  html:not(.kf-gate-on) body::before {
    background-image: url("../img/kaifariki_m.jpg?v=1");
    background-position: center top;
  }

  html:not(.kf-gate-on) .center_block:has(.kf-cards)::before {
    content: "";
    display: block;
    aspect-ratio: 1672 / 941;
    margin: 0 0 14px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 16px;
    background: #0c0515 url("../img/kaifariki.jpg?v=1") center / cover no-repeat;
    box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .9), 0 0 32px -8px rgba(255, 79, 184, .45);
  }
}

/* при уменьшенном масштабе самые мелкие подписи шаблона (8–11 px) стали бы 6–9 px — делаем их чуть крупнее:
   подписи пунктов левого меню и сервера на главной, «За сьогодні», значки бегущей строки, «Просто зараз» в шапке,
   подписи под карточками BALANCE / MODELS / ANEW / SHOP */
@media (min-width: 1200px) and (min-aspect-ratio: 5/4) {
  @supports (zoom: 1) {
    html:not(.kf-gate-on) .left_menu_item_btns > p.subtitle,
    html:not(.kf-gate-on) .server-category-card__infos .info-item__title {
      font-size: 12.5px;
    }

    html:not(.kf-gate-on) .right_now_online_index {
      font-size: 12px;
    }

    html:not(.kf-gate-on) .live_lenta_wrapper .lenta-badge {
      font-size: 10.5px;
    }

    html:not(.kf-gate-on) .live_lenta_wrapper .live-badge {
      font-size: 11px;
    }

    html:not(.kf-gate-on) .head_online_users .right_now_online {
      font-size: 10px;
    }

    html:not(.kf-gate-on) .kf-card__sub {
      font-size: max(9px, 4.4cqw);
    }
  }
}