﻿/* Last edited: 2026-02-26 | Version: v2026.02.26.2 */
/*
 * Карта ответственности файла style.css:
 * - Базовые токены темы, типографика и глобальная геометрия сайта.
 * - Общие UI-компоненты: header/footer, кнопки, карточки, формы и модальные блоки.
 * - Страничные подсистемы: support/chat, players/profile, tournaments и admin.
 * - Адаптивные режимы, mobile-nav и fallback-правила для нестабильных браузерных кейсов.
 */
/* Базовые переменные темы и контейнеров. */
:root {
  --bg: #26201B;      /* фон */
  --text: #FDD7BB;    /* основной текст */
  --muted: #c9b6a5;   /* приглушённый текст */
  --border: #3a332d;  /* линии и рамки */
  --surface-soft: rgba(255, 224, 201, 0.03);
  --surface-soft-hover: rgba(255, 224, 201, 0.08);
  --focus-ring: rgba(255, 186, 130, 0.56);
  --site-content-max-width: 1120px;
  --site-content-max-width-one-ad: 1120px;
  --site-content-max-width-no-ads: 1120px;
  --site-shell-inline-padding: 20px;
  --site-content-track-width: calc(var(--site-content-max-width) - (var(--site-shell-inline-padding) * 2));
  --header-content-gap: 14px;
  --main-content-top-padding: 4px;
  --tab-link-min-width: 124px;
  --global-ad-rail-top: 200px;
  --global-ad-rail-width: 340px;
  --global-ad-rail-side-gap: 10px;
  --global-ad-rail-bottom-gap: 72px;
  --global-ad-slot-min-height: 420px;
}

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

body {
  margin: 0;
  /* Saved background option:
  background: linear-gradient(180deg, #200606 0%, #271302 50%, #1D1D1D 100%);
  */
  background: linear-gradient(180deg, #1b0808 0%, #1d1005 50%, #1D1D1D 100%);
  color: var(--text);
  font-family: "Golos Text", Arial, sans-serif;
  font-weight: 400;
  line-height: 1.45;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  scrollbar-gutter: stable;
}

html,
body {
  width: 100%;
  max-width: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html {
  background: #1b0808;
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

html.site-loading main {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: none !important;
}

html.site-ready main {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 420ms ease;
}

@media (prefers-reduced-motion: reduce) {
  html.site-ready main {
    transition: none;
  }
}

/* Каркас страницы: header/main/footer и анимации входа/выхода PJAX-контента. */

header {
  max-width: var(--site-content-max-width);
  margin: 0 auto;
  padding: 20px var(--site-shell-inline-padding);
}

main {
  width: 100%;
  max-width: calc(var(--site-content-track-width) + (var(--site-shell-inline-padding) * 2));
  margin: var(--header-content-gap) auto 0;
  padding: var(--main-content-top-padding) var(--site-shell-inline-padding) 20px;
}

main > section + section {
  margin-top: 18px;
}

.global-ad-rails-root {
  position: fixed;
  inset: 0;
  z-index: 35;
  pointer-events: none;
}

.global-ad-rail {
  position: absolute;
  top: var(--global-ad-rail-top);
  width: var(--global-ad-rail-width);
  height: max(var(--global-ad-slot-min-height), calc(100vh - var(--global-ad-rail-top) - var(--global-ad-rail-bottom-gap)));
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.global-ad-rail-left {
  left: var(--global-ad-rail-side-gap);
}

.global-ad-rail-right {
  right: var(--global-ad-rail-side-gap);
}

.global-ad-slot {
  width: 100%;
  height: 100%;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
  pointer-events: auto;
  overflow: hidden;
}

.global-ad-slot.is-filled {
  border-color: rgba(255, 165, 118, 0.55);
  background: linear-gradient(180deg, rgba(34, 13, 10, 0.58) 0%, rgba(24, 15, 12, 0.62) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 214, 186, 0.08);
}

html.has-left-ad .global-ad-rail-left,
html.has-right-ad .global-ad-rail-right {
  opacity: 1;
  visibility: visible;
}

html.one-side-ad main {
  max-width: var(--site-content-max-width-one-ad);
}

html.no-side-ads main {
  max-width: var(--site-content-max-width-no-ads);
}

html.site-ready main.pjax-leave {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 280ms ease, transform 280ms ease;
}

html.site-ready main.pjax-enter {
  opacity: 0;
  transform: translateY(18px);
}

/* Фаза входа PJAX: после подмены контента плавно возвращаем видимость и позицию. */
html.site-ready main.pjax-enter.pjax-enter-active {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 420ms ease, transform 420ms ease;
}

html.site-ready main.route-bump {
  animation: current-route-bump 220ms cubic-bezier(.22, .61, .36, 1);
  will-change: transform;
}

@keyframes current-route-bump {
  0% {
    transform: translateY(0);
  }
  38% {
    transform: translateY(-8px);
  }
  100% {
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  html.site-ready main.pjax-leave,
  html.site-ready main.pjax-enter,
  html.site-ready main.pjax-enter.pjax-enter-active,
  html.site-ready main.route-bump {
    opacity: 1;
    transform: none;
    animation: none;
    transition: none;
  }
}

#header {
  width: 100%;
  max-width: var(--site-content-max-width);
  margin: 36px auto 0;
  padding: 20px var(--site-shell-inline-padding) 0;
  min-height: 168px;
  border-bottom: none;
}

#header:empty {
  min-height: 168px;
}

#header > header {
  margin: 0;
  padding: 0;
  border-bottom: none;
}

/* Подвал: копирайт, служебные ссылки и кнопки соцсетей в едином контейнере. */
footer {
  margin-top: auto;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  background: linear-gradient(180deg, rgba(23, 16, 14, 0.96) 0%, rgba(14, 11, 10, 0.98) 100%);
  border-top: 1px solid #3e312b;
  color: var(--muted);
  text-align: left;
  padding: 12px 20px;
}

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.footer-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 0;
}

footer p,
.footer-copy {
  margin: 0;
  font-size: clamp(13px, 1.1vw, 15px);
  line-height: 1.35;
}

footer .footer-link {
  color: #f0d6be;
  text-decoration: underline;
  text-underline-offset: 3px;
}

footer .footer-link:hover {
  color: #fff2e1;
}

.footer-socials {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.footer-devlog-link,
.footer-table-link {
  font-size: clamp(13px, 1vw, 14px);
  white-space: nowrap;
  margin-left: 8px;
  position: relative;
  top: -3px;
}

.footer-social-link {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 8px;
  background: rgba(34, 16, 14, 0.78);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.footer-social-link:hover {
  background: rgba(62, 27, 21, 0.9);
}

.footer-social-link img {
  width: 24.75px;
  height: 24.75px;
  display: block;
  object-fit: contain;
}

/* Шапка сайта: бренд, табы и desktop/mobile-навигация. */
/* Бренд-зона в header: логотип, заголовок проекта и центрирование строки. */
.brand {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
}

.brand-home-link {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: flex-end;
  gap: 8px;
}

.brand-home-link:focus-visible {
  outline: 2px solid rgba(240, 214, 190, 0.9);
  outline-offset: 4px;
  border-radius: 4px;
}

.site-mode-badge {
  align-self: flex-end;
  margin-bottom: 6px;
  padding: 2px 8px;
  border: 1px solid rgba(240, 214, 190, 0.42);
  border-radius: 999px;
  background: rgba(33, 14, 10, 0.8);
  color: #f6dfc8;
  font-size: 11px;
  line-height: 1.15;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.header-top-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-avatar {
  width: clamp(40px, 2.8vw, 56px);
  height: auto;
  display: block;
  transition: transform 0.12s ease;
  transform-origin: center center;
  cursor: pointer;
}

.brand-avatar.debug-avatar-clicked {
  transform: scale(0.95);
}

.brand-title {
  width: clamp(260px, 22vw, 440px);
  height: auto;
  display: block;
}

.header-nav-row {
  margin: 30px auto 0;
  max-width: min(100%, var(--site-content-track-width));
  width: 100%;
  min-width: 0;
  display: block;
  position: relative;
  overflow: visible;
}

.tabs-nav {
  margin: 0;
  max-width: 100%;
  display: flex;
  justify-content: center;
  gap: 14px;
  padding: 0 0 8px;
  border-bottom: 0;
  width: 100%;
  flex: 0 0 100%;
  min-width: 0;
  box-sizing: border-box;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.header-nav-row::after {
  content: "";
  display: block;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: #f0d6be;
}

/* Основная линия навигации: tabs-nav с fallback горизонтального скролла. */
#header .header-nav-row {
  width: 100%;
  max-width: min(100%, var(--site-content-track-width));
}

#header .tabs-nav {
  width: 100%;
  max-width: 100%;
}

#header .tabs-nav {
  margin-left: 0;
  margin-right: 0;
}

.tabs-nav::-webkit-scrollbar {
  display: none;
}

@media (min-width: 901px) {
  .tabs-nav {
    overflow-x: visible;
  }
}

/* Desktop admin-вход в шапке (скрыт на mobile, где есть mobile-only-admin-link). */
.header-admin-area {
  display: none;
  position: absolute;
  right: 0;
  bottom: 10px;
  padding: 0 0 0 12px;
  border-left: 3px solid #f0d6be;
  justify-content: flex-start;
  align-items: center;
  background: transparent;
  z-index: 1;
}

#header.has-admin-link .header-admin-area {
  display: flex;
}

.header-admin-link {
  min-width: 0;
  padding: 0 4px;
}

.mobile-only-admin-link {
  display: none !important;
}

/* Кнопка-гамбургер и backdrop для off-canvas мобильного меню. */
.mobile-nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid #4f433a;
  border-radius: 10px;
  background: rgba(34, 16, 14, 0.9);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
}

.mobile-nav-toggle::before {
  content: "";
  width: 22px;
  height: 2px;
  background: #fdd7bb;
  border-radius: 2px;
  box-shadow: 0 -6px 0 #fdd7bb, 0 6px 0 #fdd7bb;
  display: block;
}

.mobile-nav-toggle[hidden] {
  display: none !important;
}

.mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  border: 0;
  margin: 0;
  padding: 0;
  background: rgba(9, 7, 6, 0.62);
  z-index: 2700;
  cursor: pointer;
}

.mobile-nav-overlay.open {
  display: block;
}

.mobile-nav-auth {
  display: none;
}

.admin-entry-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #4f433a;
  border-radius: 10px;
  background: rgba(34, 16, 14, 0.88);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2600;
}

.admin-entry-btn[hidden] {
  display: none !important;
}

.admin-entry-btn img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
}

.admin-entry-btn.active {
  border-color: #f0d6be;
  box-shadow: 0 0 0 1px rgba(240, 214, 190, 0.45) inset;
}

/* Плавающие панели в шапке: auth/status/notifications. */
.header-status-stack {
  position: fixed;
  top: 16px;
  left: 16px;
  right: 72px;
  z-index: 2600;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  max-width: none;
  pointer-events: none;
}

.header-status-stack > * {
  pointer-events: auto;
}




/* Контейнер auth-панели: адаптивная карточка с ограничением ширины в статус-стеке. */
.auth-status-panel { /*Я нихрена не понимаю как это можно исправить! Кнопки у панели едут и не имеют нормального выравнивания. @Alex Kik*/
  --auth-avatar-size: 48px;
  --auth-right-col-width: 86px;
  position: relative;
  z-index: 1;
  margin-left: auto;
  max-width: min(50vw, 420px);
  padding: 8px 10px;
  border: 1px solid #4f433a;
  border-radius: 10px;
  background: rgba(34, 16, 14, 0.9);
  backdrop-filter: blur(2px);
}


.server-status-floating-panel {
  width: min(34vw, 320px);
  min-width: 220px;
  margin-right: auto;
  padding: 10px 12px;
  border: 1px solid #4f433a;
  border-radius: 10px;
  background: rgba(34, 16, 14, 0.9);
  backdrop-filter: blur(2px);
}

.server-status-floating-title {
  margin: 0 0 8px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 11px;
  line-height: 1.2;
}

.server-status-floating-panel .home-server-status-list {
  display: grid;
  gap: 6px;
}

.server-status-floating-panel .home-server-card {
  gap: 6px;
  padding: 8px;
  border-radius: 8px;
}

.server-status-floating-panel .home-server-meta {
  gap: 6px;
  font-size: 12px;
}

.server-status-floating-panel .home-server-actions {
  display: block;
}

.server-status-floating-panel .home-server-connect-link {
  display: none;
}

.server-status-floating-panel .home-server-action-buttons {
  justify-content: flex-start;
}

/* Кнопка уведомлений фиксирована в правом верхнем углу и живет вне потока header. */
.notif-bell-btn {
  position: fixed;
  top: 68px;
  right: 16px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #4f433a;
  border-radius: 10px;
  background: rgba(34, 16, 14, 0.9);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2600;
}

.notif-bell-btn img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: block;
}

.notif-bell-btn.has-unread {
  border-color: #f0d6be;
  box-shadow: 0 0 0 1px rgba(240, 214, 190, 0.45) inset;
}

/* Числовой индикатор непрочитанных уведомлений на колоколе. */
.notif-bell-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  border: 1px solid #4f433a;
  background: #7f2018;
  color: #ffe9d6;
  font-size: 11px;
  line-height: 16px;
  text-align: center;
  font-weight: 700;
}

.notif-popover {
  position: fixed;
  top: 116px;
  right: 16px;
  width: min(92vw, 360px);
  max-height: 56vh;
  border: 1px solid #4f433a;
  border-radius: 12px;
  background: rgba(34, 16, 14, 0.96);
  backdrop-filter: blur(2px);
  z-index: 2600;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.runtime-version-notice {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2400;
  width: min(360px, calc(100vw - 32px));
  border: 1px solid rgba(255, 224, 201, 0.22);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(33, 23, 19, 0.96), rgba(19, 14, 12, 0.98));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.34);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.runtime-version-notice.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.runtime-version-notice__body {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.runtime-version-notice__text {
  margin: 0;
  color: var(--text);
  line-height: 1.45;
}

.runtime-version-notice__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.notif-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 224, 201, 0.14);
}

.notif-popover-head h4 {
  margin: 0;
  font-size: 15px;
}

.notif-mark-read {
  padding: 4px 8px;
  font-size: 12px;
}

.notif-popover-list {
  overflow: auto;
  display: grid;
  gap: 6px;
  padding: 8px 10px 10px;
}

.notif-item {
  border: 1px solid #3f3731;
  border-radius: 8px;
  padding: 6px 8px;
  background: rgba(255, 224, 201, 0.03);
  display: grid;
  gap: 2px;
  text-decoration: none;
  color: inherit;
}

.notif-item strong {
  font-size: 13px;
}

.notif-item span {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notif-item time {
  font-size: 11px;
  color: var(--muted);
}

/* Текстовое состояние авторизации ("вошли как ...") внутри auth-панели. */
.auth-status-text {
  margin: 0 0 6px;
  font-size: 13px;
  line-height: 1.15;
}

.auth-status-avatar-link {
  width: var(--auth-avatar-size);
  height: var(--auth-avatar-size);
  aspect-ratio: 1 / 1;
  border: 1px solid #5f4b40;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(32, 9, 6, 0.78);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  text-decoration: none;
  grid-column: 2 / 3;
  grid-row: 1 / 2;
  align-self: start;
  justify-self: center;
  margin-top: 0;
}

.auth-status-avatar-link:hover,
.auth-status-avatar-link:focus-visible {
  border-color: #f0d6be;
  box-shadow: 0 0 0 1px rgba(240, 214, 190, 0.35) inset;
}

.auth-status-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}

.auth-status-actions {
  margin-top: 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Сетка auth-блока: [actions/avatar] + [search input/search button]. */
.auth-status-controls {
  margin-top: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--auth-right-col-width);
  grid-template-rows: var(--auth-avatar-size) 40px;
  column-gap: 8px;
  row-gap: 6px;
  align-items: stretch;
}

.auth-status-actions-authed {
  margin-top: 0;
  grid-column: 1 / 2;
  grid-row: 1 / 2;
  align-self: stretch;
  min-height: var(--auth-avatar-size);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
}

.auth-status-actions-authed .btn {
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: 100%;
  justify-content: center;
}

.auth-status-search {
  margin-top: 0;
  grid-column: 1 / -1;
  grid-row: 2 / 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--auth-right-col-width);
  gap: 6px;
  align-items: stretch;
  position: relative;
  overflow: visible;
}

.auth-status-search-input {
  grid-column: 1 / 2;
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #5f4b40;
  background: rgba(32, 9, 6, 0.78);
  color: #ffe0c9;
}

.auth-status-search .btn {
  grid-column: 2 / 3;
  width: 100%;
  justify-content: center;
  min-height: 40px;
  padding: 8px 10px;
}

/* Хост для абсолютного позиционирования выпадающего списка автокомплита. */
.player-search-autocomplete-host {
  position: relative;
}

/* Выпадающий список подсказок: абсолютный слой над контентом без сдвига layout. */
.player-search-suggest-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  margin: 0;
  border: 1px solid #5f4b40;
  border-radius: 8px;
  background: rgba(24, 8, 8, 0.97);
  max-height: 240px;
  overflow: auto;
  display: grid;
  gap: 0;
  z-index: 40;
}

.player-search-suggest-list:empty,
.player-search-suggest-list[hidden] {
  display: none !important;
  border: 0;
}

.player-search-suggest-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(95, 75, 64, 0.5);
  background: transparent;
}

.player-search-suggest-item:last-child {
  border-bottom: 0;
}

.player-search-suggest-item:hover {
  background: rgba(255, 224, 201, 0.08);
}

.player-search-suggest-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-search-suggest-steamid {
  font-family: "JetBrains Mono", "Consolas", "Courier New", monospace;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.player-search-suggest-empty {
  margin: 0;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 13px;
}

.auth-status-admin {
  display: block;
  margin-top: 8px;
}

.preview-autoreload-toggle-wrap {
  display: block;
  margin-top: 8px;
}

.preview-autoreload-toggle-btn {
  width: 100%;
  justify-content: space-between;
  gap: 10px;
  font-weight: 700;
}

.preview-autoreload-toggle-label {
  opacity: 0.96;
}

.preview-autoreload-toggle-state {
  min-width: 34px;
  text-align: right;
  font-weight: 800;
}

.preview-autoreload-toggle-btn.preview-autoreload-toggle-on {
  border-color: #2f9e55;
  background: rgba(18, 74, 40, 0.72);
  color: #d8f8e2;
}

.preview-autoreload-toggle-btn.preview-autoreload-toggle-on:hover,
.preview-autoreload-toggle-btn.preview-autoreload-toggle-on:focus-visible {
  border-color: #52c878;
  background: rgba(28, 104, 56, 0.78);
}

.preview-autoreload-toggle-btn.preview-autoreload-toggle-off {
  border-color: #c34f4f;
  background: rgba(87, 26, 26, 0.72);
  color: #ffdcdc;
}

.preview-autoreload-toggle-btn.preview-autoreload-toggle-off:hover,
.preview-autoreload-toggle-btn.preview-autoreload-toggle-off:focus-visible {
  border-color: #d66b6b;
  background: rgba(112, 36, 36, 0.78);
}

.auth-status-admin-btn {
  width: 100%;
  justify-content: center;
}

.auth-status-admin-btn.active {
  border-color: #f0d6be;
  box-shadow: 0 0 0 1px rgba(240, 214, 190, 0.35) inset;
}

/* При открытом cookie-баннере не блокируем скролл страницы полностью. */
body.cookie-consent-open {
  overflow: auto;
}

.cookie-consent-overlay {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 18px;
  z-index: 99999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 14px;
  background: transparent;
  pointer-events: none;
}

/* Карточка cookie-consent: слева иконка, справа текст и действия подтверждения. */
.cookie-consent-modal {
  position: relative;
  width: min(560px, 94vw);
  border: 1px solid #5a4a3f;
  border-radius: 12px;
  background: linear-gradient(180deg, #22100e 0%, #1d140f 100%);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.42);
  padding: 12px;
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  pointer-events: auto;
}

.cookie-consent-media {
  display: flex;
  align-items: center;
  justify-content: center;
}

.cookie-consent-media img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  display: block;
}

.cookie-consent-content h3 {
  margin: 0 0 6px;
  font-family: "Russo One", "Golos Text", Arial, sans-serif;
  font-size: clamp(16px, 1.5vw, 24px);
  font-weight: 400;
}

.cookie-consent-content p {
  margin: 0;
  line-height: 1.35;
  color: #e8d0bc;
  font-size: 13px;
}

.cookie-consent-actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.verify-btn-complete {
  opacity: 0.6;
  cursor: not-allowed;
}

.verify-btn-pending {
  opacity: 0.8;
  cursor: not-allowed;
}

body.steam-auth-modal-open {
  overflow: hidden;
}

/* Overlay для Steam auth: перекрывает UI и фокусирует пользователя на подтверждении. */
.steam-auth-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100002;
  background: rgba(7, 3, 2, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.steam-auth-modal {
  width: min(520px, 96vw);
  max-height: 90vh;
  overflow: auto;
  border: 1px solid #5a4a3f;
  border-radius: 12px;
  background: linear-gradient(180deg, #2a120f 0%, #201511 100%);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
  padding: 16px;
}

.steam-auth-modal h3 {
  margin: 0 0 8px;
}

.steam-auth-modal-muted {
  margin: 0 0 10px;
  color: var(--muted);
}

.steam-auth-consent-list {
  margin: 0 0 10px 20px;
  padding: 0;
  color: var(--muted);
  line-height: 1.35;
}

.steam-auth-consent-list li + li {
  margin-top: 4px;
}

.steam-auth-consent-list a {
  color: #f0cfaa;
}

.steam-auth-captcha {
  min-height: 104px;
  height: 104px;
  border: 1px solid #5a4a3f;
  border-radius: 10px;
  background: rgba(32, 9, 6, 0.38);
  display: block;
  padding: 0;
  overflow: hidden;
  margin-bottom: 10px;
}

.steam-auth-captcha iframe {
  display: block;
  width: 100% !important;
  height: 100% !important;
  border: 0;
}

.steam-auth-modal-error {
  margin: 0 0 10px;
  min-height: 1.25em;
  color: #ff9c9c;
  font-size: 0.95em;
}

.steam-auth-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.btn:disabled,
.btn.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

body.verify-modal-open {
  overflow: hidden;
}

/* Блок верификации профиля (verify modal): отдельный overlay поверх основного UI. */
.verify-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100001;
  background: rgba(7, 3, 2, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.verify-modal {
  width: min(520px, 96vw);
  max-height: 90vh;
  overflow: auto;
  border: 1px solid #5a4a3f;
  border-radius: 12px;
  background: linear-gradient(180deg, #2a120f 0%, #201511 100%);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
  padding: 16px;
}

/* Унифицированная сетка полей verify-формы (label/help/control). */
.verify-modal h3 {
  margin: 0 0 10px;
}

.verify-form {
  display: grid;
  gap: 12px;
}

.verify-field {
  display: grid;
  gap: 6px;
}

.verify-field > span {
  font-weight: 700;
}

.verify-field > small {
  color: var(--muted);
  line-height: 1.35;
  font-size: 14px;
}

.verify-field input,
.verify-field select,
.verify-field textarea {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid #5f4b40;
  border-radius: 10px;
  background: rgba(32, 9, 6, 0.75);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
}

.verify-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.4;
}

.verify-checkbox input[type="checkbox"] {
  margin-top: 3px;
}

.verify-checkbox a {
  color: #f0d6be;
}

.verify-checkbox a:hover {
  color: #fff2e1;
}

.verify-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Адаптация cookie-модалки на узких экранах: медиаблок уходит в колонку. */
@media (max-width: 640px) {
  .cookie-consent-modal {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .cookie-consent-media {
    justify-content: flex-start;
  }

  .cookie-consent-actions {
    justify-content: flex-start;
  }
}

.tab-link {
  font-family: "Russo One", "Golos Text", Arial, sans-serif;
  color: #f0d6be;
  text-decoration: none;
  font-weight: 400;
  font-size: clamp(20px, 1.2vw, 24px);
  line-height: 1.15;
  letter-spacing: 0.25px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--tab-link-min-width);
  padding: 0 10px;
  border: none;
  background: transparent;
  transition: color 120ms ease, text-shadow 120ms ease;
  text-align: center;
  white-space: nowrap;
  flex: 0 0 auto;
}

@media (max-width: 980px) {
  .support-columns {
    grid-template-columns: 1fr;
  }
}

.tab-link:hover {
  color: #fff2e1;
  text-shadow: 0 0 10px rgba(255, 220, 189, 0.22);
}

.tab-link.active {
  color: #ffffff;
  text-shadow: 0 0 12px rgba(255, 220, 189, 0.22);
}

.tab-link:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 5px;
  border-radius: 6px;
}

/* Подсистема support/chat: тикеты, сообщения, форма ответа и online-список. */
.chat-host {
  width: 100%;
}

.support-host {
  width: 100%;
}

/* Keep support page aligned with shared content shell even if old inline max-width is cached. */
main.support-host > .card {
  width: 100%;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Сетка страницы support: создание тикета, список обращений и диалог по выбранному тикету. */
.support-layout {
  display: grid;
  gap: 12px;
}

.support-create-card h2 {
  margin: 0;
  font-size: clamp(30px, 2.2vw, 38px);
}

.support-create-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* Форма создания тикета: краткое описание проблемы и первичный текст обращения. */
.support-create-form {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.support-create-form input,
.support-create-form textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  background: rgba(255, 224, 201, 0.03);
  color: var(--text);
  font: inherit;
}

.support-columns {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 12px;
}

.support-list-card,
.support-chat-card {
  min-height: 340px;
}

.support-list-head h3 {
  margin: 0 0 8px;
}

.support-list {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

/* Карточка тикета в списке: заголовок, статус и тайм-метки активности. */
.support-ticket-item {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 224, 201, 0.03);
  color: var(--text);
  text-align: left;
  padding: 8px 10px;
  display: grid;
  gap: 3px;
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
}

.support-ticket-item strong {
  font-size: 14px;
  line-height: 1.25;
}

.support-ticket-item span,
.support-ticket-item small {
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.support-ticket-item:hover {
  border-color: #6b574b;
  background: var(--surface-soft-hover);
}

.support-ticket-item:focus-visible {
  outline: none;
  border-color: #d9a777;
  box-shadow: 0 0 0 2px var(--focus-ring);
}

.support-ticket-item.active {
  border-color: #f0d6be;
  box-shadow: 0 0 0 1px rgba(240, 214, 190, 0.42) inset;
}

/* Сообщения тикета: отдельный scroll-контейнер с компактной типографикой. */
.support-ticket-badge {
  justify-self: start;
  font-style: normal;
  font-size: 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 7px;
}

.support-ticket-badge.closed {
  color: #ffd6b8;
  border-color: #6a4a3e;
}

.support-ticket-badge.open {
  color: #b8f4bf;
  border-color: #3f6a44;
}

/* Шапка активного тикета: метаданные + область заголовка диалога. */
.support-ticket-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.support-ticket-head h3 {
  margin: 0 0 4px;
  font-size: clamp(22px, 1.8vw, 30px);
}

.support-ticket-head p {
  margin: 0 0 2px;
}

.support-messages {
  margin-top: 8px;
  min-height: 180px;
  max-height: 38vh;
  overflow: auto;
  display: grid;
  gap: 6px;
}

.support-msg {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 9px;
  background: rgba(255, 224, 201, 0.03);
}

.support-msg-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.support-msg-head strong {
  font-size: 14px;
}

.support-msg-head time {
  font-size: 11px;
  color: var(--muted);
}

.support-msg p {
  margin: 0;
  white-space: pre-wrap;
}

.support-send-form {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.support-send-form textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  background: rgba(255, 224, 201, 0.03);
  color: var(--text);
  font: inherit;
}

.support-send-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

/* Основная сетка глобального чата: поток сообщений + боковик онлайна. */
.chat-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 12px;
}

.chat-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-head h2 {
  margin: 0 0 4px;
  font-size: clamp(28px, 2.1vw, 40px);
}

.chat-head p {
  margin: 0 0 6px;
  font-size: 16px;
}

.chat-messages {
  min-height: 260px;
  max-height: 50vh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  background: rgba(255, 224, 201, 0.03);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-message {
  border: 1px solid #3f3731;
  border-radius: 8px;
  padding: 6px 8px;
  background: rgba(255, 224, 201, 0.02);
}

.chat-message.own {
  border-color: #7a5b44;
  background: rgba(158, 105, 63, 0.15);
}

.chat-message-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 3px;
}

.chat-message-head strong {
  font-size: 14px;
}

.chat-user-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
}

.chat-user-link:hover,
.chat-user-link:focus-visible {
  text-decoration: underline;
}

.chat-message-head time {
  color: var(--muted);
  font-size: 11px;
}

.chat-message p {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.35;
  font-size: 13px;
}

/* Глобальный чат: область сообщений + форма отправки + online-боковик. */
/* Текстовый инпут чата и строка действий под ним. */
.chat-form textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 74px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 224, 201, 0.03);
  color: var(--text);
  font: inherit;
  padding: 8px;
  font-size: 14px;
}

.chat-form-row {
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.chat-login-required h2,
.chat-login-required p {
  margin-top: 0;
}

/* Сайдбар онлайна: компактный список игроков со статусной точкой. */
.chat-online {
  align-self: start;
}

.chat-online h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.chat-online-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 36vh;
  overflow: auto;
}

.chat-online-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.chat-online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2bd672;
  box-shadow: 0 0 8px rgba(43, 214, 114, 0.75);
  flex: 0 0 auto;
}

/* Плашка онлайна в профиле: статус, мини-аватар и цветовые состояния. */
.profile-online-badge {
  margin-left: 10px;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 70px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 224, 201, 0.08);
  color: var(--muted);
}

.profile-online-badge-avatar {
  position: absolute;
  left: 8px;
  top: 8px;
  margin-left: 0;
  z-index: 2;
  background: rgba(26, 16, 13, 0.52);
  backdrop-filter: blur(1px);
}

.profile-online-badge.online {
  border-color: #2d9455;
  color: #b8ffd2;
  background: rgba(43, 214, 114, 0.2);
}

.profile-online-badge.offline {
  border-color: #64564b;
  color: #d7c3b0;
  background: rgba(120, 96, 77, 0.2);
}

/* Турнирный чат в карточке матча: укороченный заголовок и компактные сообщения. */
.tournament-chat-card h3 {
  margin: 0 0 6px;
  font-size: 22px;
}

.tournament-chat-messages {
  min-height: 124px;
  max-height: 26vh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  background: rgba(255, 224, 201, 0.03);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tournament-chat-form textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 58px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 224, 201, 0.03);
  color: var(--text);
  font: inherit;
  padding: 6px 7px;
  font-size: 13px;
  margin-top: 6px;
}

/* Общий набор scroll-контейнеров с фиксированным местом под scrollbar-gutter. */
.excel-wrap,
.chat-messages,
.support-messages,
.chat-online-list,
.tournament-chat-messages,
.tournament-signup-list-wrap,
.notif-popover-list,
.rules-history-list {
  scrollbar-gutter: stable;
}

@media (max-width: 980px) {
  .chat-layout {
    grid-template-columns: 1fr;
  }

  .chat-online {
    order: -1;
  }

  .chat-online-list {
    max-height: 140px;
  }
}

/* Типографика и базовые контент-блоки (карточки, markdown-контейнер). */
@font-face {
  font-family: "Golos Text";
  src: url("fonts/GolosText-VariableFont_wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Базовая типографика заголовков контентных секций. */
h2 {
  margin: 0 0 10px;
  font-weight: 600;
  line-height: 1.15;
  text-wrap: balance;
}

h3 {
  margin: 0 0 8px;
  font-weight: 500;
  line-height: 1.2;
  text-wrap: balance;
}
.card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-top: 14px;
  background: linear-gradient(180deg, rgba(255, 224, 201, 0.045) 0%, rgba(255, 224, 201, 0.022) 100%);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
}

main > section:first-child > .card:first-child {
  margin-top: 0;
}

main > .card:first-child {
  margin-top: 0;
}

.card > :first-child {
  margin-top: 0;
}

.card > :last-child {
  margin-bottom: 0;
}

main > section > h2 {
  font-family: "Russo One", "Golos Text", sans-serif;
  font-weight: 400;
  font-size: clamp(24px, 1.95vw, 34px);
  color: #ffe2c5;
}

main > section > p {
  margin: 0 0 10px;
  line-height: 1.52;
}

main > section > p:last-child {
  margin-bottom: 0;
}

/* Контейнер markdown-страниц: ограничение ширины и единый ритм чтения. */
#md {
  max-width: 920px;
  margin: 0 auto;
  color: #f2dbc5;
  font-size: 15px;
  line-height: 1.62;
}

#md p {
  line-height: inherit;
  margin: 0 0 12px;
}

#md p:last-child {
  margin-bottom: 0;
}

#md ul,
#md ol {
  margin: 0 0 14px 22px;
  padding: 0;
}

#md li {
  margin: 0 0 6px;
  line-height: 1.56;
}

#md h1,
#md h2,
#md h3 {
  position: relative;
  margin: 20px 0 10px;
  line-height: 1.2;
  font-family: "Russo One", "Golos Text", sans-serif;
  font-weight: 400;
}

#md h1 {
  font-size: clamp(24px, 2.2vw, 32px);
}

#md h2 {
  font-size: clamp(20px, 1.8vw, 26px);
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}

#md h3 {
  font-size: clamp(17px, 1.35vw, 21px);
}

/* Базовый стиль code/pre в md: читаемость inline и блочного кода. */
#md h1:first-child,
#md h2:first-child,
#md h3:first-child {
  margin-top: 0;
}

#md blockquote {
  margin: 0 0 14px;
  border-left: 3px solid rgba(255, 224, 201, 0.32);
  padding: 6px 0 6px 12px;
  color: #dfc7b1;
}

#md code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.93em;
  padding: 1px 4px;
  border: 1px solid rgba(255, 224, 201, 0.2);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.24);
}

#md pre {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 224, 201, 0.2);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
  overflow: auto;
}

#md pre code {
  border: 0;
  background: transparent;
  padding: 0;
}

#md .anchor {
  margin-left: 10px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 400;
  visibility: hidden;
}

#md h1:hover .anchor,
#md h2:hover .anchor,
#md h3:hover .anchor {
  visibility: visible;
}

#md .anchor:hover {
  color: var(--text);
  text-decoration: underline;
}

html { scroll-behavior: smooth; }

#md h1,
#md h2,
#md h3 {
  scroll-margin-top: 100px;
}

/* TODO: при подключении подсветки синтаксиса вынести палитру md-кода в отдельный блок темы. */
/* Unified markdown typography standard for all md pages */
#md.md-standard,
#md.rules-md,
#md.tos-md,
#md.privacy-md,
#md.devlog-md {
  font-size: 15px;
  line-height: 1.62;
}

/* Rules history UI */
.rules-cms-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}

.rules-history-btn {
  position: static;
  margin-left: auto;
  padding: 9px 14px;
  border: 1px solid #5e4a3f;
  border-radius: 10px;
  background: rgba(32, 12, 9, 0.92);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
}

.rules-history-btn:hover {
  background: rgba(49, 26, 20, 0.96);
}

/* Выезжающая панель истории правил с блокировкой взаимодействия в закрытом состоянии. */
.rules-history-drawer {
  position: fixed;
  left: 0;
  top: 0;
  width: min(420px, 92vw);
  height: 100vh;
  z-index: 3200;
  box-sizing: border-box;
  padding: 14px 12px;
  border-right: 1px solid #5e4a3f;
  background: linear-gradient(180deg, rgba(29, 11, 10, 0.97) 0%, rgba(25, 16, 13, 0.97) 100%);
  transform: translateX(-102%);
  transition: transform 180ms ease;
  visibility: hidden;
  pointer-events: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rules-history-drawer.open {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}

.rules-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.rules-history-head h3 {
  margin: 0;
  font-family: "Russo One", "Golos Text", sans-serif;
  font-size: 1.05rem;
}

.rules-history-close {
  width: 32px;
  height: 32px;
  border: 1px solid #5e4a3f;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

/* Список ревизий: отдельные карточки версий и метаданные изменений. */
.rules-history-list {
  overflow: auto;
  min-height: 0;
  display: grid;
  gap: 8px;
  padding-right: 2px;
}

.rules-history-item {
  border: 1px solid #4f4139;
  border-radius: 10px;
  background: rgba(255, 224, 201, 0.04);
  padding: 10px;
}

.rules-history-item p {
  margin: 0 0 6px;
  font-size: 0.92em;
  line-height: 1.35;
}

.rules-history-item p:last-child {
  margin-bottom: 0;
}

/* Глобальный стиль ссылок: underline + единая доступность по фокусу. */
a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 120ms ease, text-decoration-color 120ms ease;
}

a:hover {
  color: #97A6DF; /* чуть светлее фирменного */
}

a:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: 4px;
}

.muted {
  color: var(--muted);
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Базовый компонент кнопки, используемый в support/chat/tournament/admin блоках. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease, transform 90ms ease;
}

button.btn {
  font: inherit;
}

.btn:hover {
  background: rgba(255, 224, 201, 0.08);
}

.btn:focus-visible {
  outline: none;
  border-color: #d9a777;
  box-shadow: 0 0 0 2px var(--focus-ring);
}

.btn:active {
  transform: translateY(1px);
}

:where(input, select, textarea):focus-visible {
  outline: none;
  border-color: #d9a777;
  box-shadow: 0 0 0 2px var(--focus-ring);
}

:where(input, textarea)::placeholder {
  color: #bda998;
  opacity: 1;
}

.auth-steam-btn {
  flex-direction: column;
  gap: 4px;
  align-items: center;
}

.auth-steam-icon {
  width: auto;
  height: 1.4em;
  object-fit: contain;
  display: block;
}

/* Mobile <=600: упрощаем footer и фиксированные управляющие элементы шапки. */
@media (max-width: 600px) {
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .footer-right {
    margin-right: 0;
    width: 100%;
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
  }

  .footer-socials {
    gap: 6px;
  }

  .footer-social-link {
    width: 32px;
    height: 32px;
  }

  .auth-status-panel {
    top: 66px;
    right: 12px;
    left: 12px;
    max-width: none;
  }

  .notif-bell-btn {
    top: 118px;
    right: 12px;
  }

  .notif-popover {
    top: 168px;
    right: 12px;
    left: 12px;
    width: auto;
  }

  #header {
    margin-top: 22px;
    padding-bottom: 2px;
  }

  .brand {
    gap: 10px;
  }

  .brand-avatar {
    width: 34px;
  }

  .brand-title {
    width: 210px;
  }

  .tabs-nav {
    gap: 10px;
    padding-bottom: 12px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .tabs-nav::-webkit-scrollbar {
    display: none;
  }

  .tab-link {
    flex: 0 0 auto;
    font-size: 16px;
  }
}

/* Mobile <=768: укрупнение интерактивных зон и шрифтов ввода. */
@media (max-width: 768px) {
  main {
    padding: var(--main-content-top-padding) var(--site-shell-inline-padding) 18px;
  }

  .card {
    padding: 14px;
  }

  .btn,
  button.btn,
  .support-ticket-item,
  .home-upcoming-tab {
    min-height: 44px;
    font-size: 16px;
  }

  .support-create-form input,
  .support-create-form textarea,
  .support-send-form textarea,
  .chat-form textarea,
  .tournament-chat-form textarea,
  .tournament-editor input,
  .tournament-editor textarea,
  .players-search input,
  .excel-table input {
    font-size: 16px;
  }

  .tabs-nav {
    gap: 12px;
  }

  .tab-link {
    font-size: 17px;
  }
}

/* Акцентные гарнитуры интерфейса для заголовков и ранговых бейджей. */
@font-face {
  font-family: "Russo One";
  src: url("fonts/RussoOne-Regular.woff") format("woff");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Freshid Condensed";
  src: url("fonts/FreshidCondensed-ExtraBold.woff") format("woff");
  font-style: normal;
  font-weight: 800;
  font-display: swap;
}

/* Декоративный condensed-шрифт для крупных акцентных заголовков home/profile. */
/* Главная страница: hero, статус серверов и ближайшие события. */
.site-title {
  margin: 0;
  font-family: "Freshid Condensed", "Russo One", "Golos Text", sans-serif;
  letter-spacing: 0.5px;
  font-size: clamp(30px, 4.8vw, 72px);
  line-height: 1;
  color: #f6dfc8;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}

.home-upcoming-section {
  margin-top: 26px;
}

main.home-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 336px);
  gap: 14px;
  align-items: start;
}

main.home-main > .home-main-content {
  min-width: 0;
}

main.home-main > .home-main-content > section + section {
  margin-top: 18px;
}

/* Правый sticky-блок серверов на desktop; на mobile переводится в обычный поток. */
.home-server-panel {
  margin-top: 0;
  min-width: 0;
  position: sticky;
  top: calc(env(safe-area-inset-top) + 82px);
}

/* Сетка карточек серверов: используется и на home, и в мини-панели статуса. */
.home-server-status-list {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.home-server-card {
  border: 1px solid rgba(255, 224, 201, 0.2);
  border-radius: 10px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.18);
  display: grid;
  gap: 7px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.home-server-card.is-online {
  border-color: rgba(122, 203, 122, 0.46);
}

.home-server-card.is-offline {
  border-color: rgba(203, 122, 122, 0.42);
}

.home-server-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.home-server-name {
  min-width: 0;
  font-size: 16px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.home-server-state {
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(255, 224, 201, 0.24);
  border-radius: 999px;
  padding: 2px 8px;
}

.home-server-card.is-online .home-server-state {
  color: #aff0af;
  border-color: rgba(122, 203, 122, 0.55);
}

.home-server-card.is-offline .home-server-state {
  color: #ffb6b6;
  border-color: rgba(214, 124, 124, 0.6);
}

/* Мета и действия сервера: адрес подключения, копирование и служебные кнопки. */
.home-server-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.home-server-actions {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.home-server-connect-link {
  min-width: 0;
  display: block;
  font-size: 12px;
  color: #ffe2c3;
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid rgba(255, 224, 201, 0.24);
  border-radius: 7px;
  padding: 4px 7px;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
}

a.home-server-connect-link:hover {
  color: #fff0df;
  border-color: rgba(255, 224, 201, 0.38);
}

/* TODO: при росте количества действий перевести блок кнопок в компактный dropdown. */
.home-server-action-buttons {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.home-server-action-buttons .btn {
  white-space: nowrap;
}

.home-server-error {
  color: #ffb2b2;
}

@media (max-width: 980px) {
  main.home-main {
    grid-template-columns: 1fr;
  }

  .home-server-panel {
    position: static;
  }
}

.table-page {
  max-width: calc(var(--site-content-track-width) + (var(--site-shell-inline-padding) * 2));
  width: 100%;
}

/* Табличный режим страницы: фиксируем viewport для управляемого скролла внутри таблицы. */
.table-body {
  height: 100vh;
  overflow: hidden;
}

.table-body .table-page {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
}

.table-body #players-table-app {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
}

/* Плитки ближайших событий на главной; автоперенос по доступной ширине. */
.home-upcoming-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.home-upcoming-tab {
  border: 1px solid #4a3930;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(83, 45, 27, 0.45) 0%, rgba(61, 43, 39, 0.4) 100%);
  color: var(--text);
  text-align: left;
  padding: 10px 12px;
  cursor: pointer;
}

.home-upcoming-title {
  display: block;
  font-weight: 700;
}

.home-upcoming-date {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 14px;
}

.players-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 10px;
}

.players-search input,
.players-sort,
.excel-table input,
.excel-table select {
  box-sizing: border-box;
  border: 1px solid #5f4b40;
  border-radius: 10px;
  background: rgba(32, 9, 6, 0.75);
  color: var(--text);
  font: inherit;
}

select option {
  color: #111;
  background: #fff;
}

/* Скинированный native select (движок): оставляем нативность, но выравниваем внешний вид. */
select.hl-native-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border-color: #5f4b40;
  background-color: rgba(32, 9, 6, 0.75);
  box-shadow: inset 0 0 0 1px rgba(255, 224, 201, 0.06);
  transition: border-color 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}

select.hl-native-select:hover:not(:disabled) {
  border-color: #826257;
  background-color: rgba(41, 14, 11, 0.82);
}

select.hl-native-select:focus-visible,
select.hl-native-select.is-focus-visible {
  outline: 2px solid rgba(255, 186, 130, 0.6);
  outline-offset: 1px;
  border-color: #c58967;
}

select.hl-native-select:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.players-search input {
  width: 100%;
  max-width: none;
  min-width: 260px;
  padding: 8px 11px;
}

.players-search {
  flex: 1 1 360px;
}

.players-sort {
  min-width: 150px;
  padding: 8px 10px;
}

.players-mode,
.players-add {
  border-radius: 10px;
  background: rgba(32, 9, 6, 0.75);
}

/* Панель управления таблицей: поиск/сортировка/действия. */
.players-controls .btn {
  min-height: 38px;
}

/* Страница поиска: форма запроса и список найденных игроков. */
.search-page {
  width: min(980px, 94vw);
  margin: 0 auto;
  padding: 18px 0 12px;
}

.search-shell {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(25, 9, 8, 0.9);
  padding: 16px;
  display: grid;
  gap: 12px;
}

.search-shell h2 {
  margin: 0;
}

.search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.search-form input {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
}

.search-results {
  display: grid;
  gap: 8px;
}

.search-results-empty {
  margin: 0;
  color: var(--muted);
}

/* Элемент результата поиска: кликабельная строка с приоритетом читаемости ника. */
.search-result-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid #4f3b33;
  border-radius: 10px;
  padding: 10px 12px;
  text-decoration: none;
  color: inherit;
  background: rgba(255, 224, 201, 0.03);
}

.search-result-item:hover {
  border-color: #7f6054;
  background: rgba(255, 224, 201, 0.07);
}

.search-result-name {
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-steamid {
  font-family: "JetBrains Mono", "Consolas", "Courier New", monospace;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

@media (max-width: 700px) {
  .search-form {
    grid-template-columns: 1fr;
  }

  .player-search-suggest-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .player-search-suggest-name,
  .player-search-suggest-steamid {
    white-space: normal;
  }

  .search-result-item {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .search-result-name,
  .search-result-steamid {
    white-space: normal;
  }
}

/* Таблица игроков: общий контейнер, sticky-header и интерактивные ячейки. */
.excel-wrap {
  overflow-x: auto;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #240f0e;
  min-height: 0;
  max-height: calc(100vh - 320px);
}

.excel-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1320px;
  font-size: 13px;
}

.excel-table th,
.excel-table td {
  border: 1px solid #4f3b33;
  padding: 1px 5px;
  vertical-align: middle;
}

.excel-table th {
  font-family: "Russo One", "Golos Text", sans-serif;
  font-weight: 400;
  color: #f9d8b8;
  background: #3a2f2a;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 2;
}

.excel-table td input,
.excel-table td select {
  width: 100%;
  padding: 0 4px;
  min-height: 18px;
  line-height: 1.2;
  border-radius: 0;
  border: 0;
  background: transparent;
  outline: 0;
  box-shadow: none;
  white-space: nowrap;
  text-overflow: clip;
}

/* Фиксированная ширина служебного первого столбца (id/индекс) для стабильной сетки. */
.excel-table th:first-child,
.excel-table td:first-child {
  width: 46px;
  min-width: 46px;
  text-align: center;
}

.excel-table th.reputation-cell,
.excel-table td.reputation-cell {
  width: 82px;
  min-width: 82px;
  text-align: center;
}

.excel-table td.reputation-cell select {
  text-align: center;
  text-align-last: center;
}

/* Репутация игрока: pill-лейбл и поведение пустого значения. */
.reputation-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 230, 196, 0.34);
  background: rgba(121, 62, 35, 0.32);
  color: #ffd3ac;
  font-family: "Russo One", "Golos Text", sans-serif;
  font-size: 12px;
  line-height: 1.1;
}

.reputation-pill.is-empty {
  opacity: 0.6;
}

.excel-table td:first-child input {
  text-align: center;
  padding-left: 3px;
  padding-right: 3px;
}

.excel-table.readonly input[readonly],
.excel-table.readonly select:disabled {
  opacity: 1;
  color: #f7d2b3;
}

.excel-table.readonly select:disabled {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: none;
  padding-right: 6px;
}

.fill-cell {
  min-width: 84px;
}

/* Тройной селектор ролей (main/sub/flex) в одной ячейке профиля. */
.fill-triple {
  display: flex;
  gap: 2px;
  min-width: 180px;
  align-items: center;
}

.fill-triple select {
  flex: 1 1 0;
  min-width: 56px;
}

.table-class-cell {
  min-width: 74px;
}

.table-class-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px;
  align-items: center;
}

.table-class-icon-wrap {
  min-height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Базовый бейдж class-icon для таблиц, signup-меты и roster-слотов. */
.class-icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(255, 224, 201, 0.24);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.24);
}

.class-icon-badge.is-table {
  width: 22px;
  height: 22px;
}

.class-icon-badge.is-tournament-inline {
  width: 17px;
  height: 17px;
  border-radius: 5px;
}

.class-icon-badge.is-tournament-inline .class-icon-img {
  width: 12px;
  height: 12px;
}

.class-icon-img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  display: block;
}

.class-icon-fallback {
  font-size: 12px;
  line-height: 1;
  color: #f7d2b3;
}

.fill-triple.fill-triple-icons {
  gap: 4px;
  justify-content: center;
  min-width: 0;
}

.fill-triple-icons-admin {
  margin-top: 2px;
}

/* Табличные элементы профиля: колонка action-кнопок и compact-вариант. */
.rank-cell {
  min-width: 68px;
}

.rank-cell.rank-cell-tournament {
  min-width: 112px;
  text-align: center;
}

.rank-pts-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 100%;
  min-height: 28px;
  line-height: 1.15;
}

.rank-pts-rank {
  font-weight: 700;
}

.rank-pts-pts {
  font-size: 11px;
  letter-spacing: 0.01em;
  opacity: 0.92;
}

.rank-pts-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 24px;
}

.rank-pts-edit-label {
  font-size: 10px;
  line-height: 1;
  opacity: 0.88;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.rank-pts-edit-input {
  width: 76px;
  min-height: 24px;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid rgba(255, 224, 201, 0.32);
  background: rgba(18, 10, 8, 0.82);
  color: #ffd8b5;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
}

.rank-pts-edit-input:focus-visible {
  outline: 2px solid rgba(255, 184, 133, 0.75);
  outline-offset: 1px;
}

.profile-col {
  width: 84px;
}

.profile-action {
  width: 100%;
  min-height: 30px;
  padding: 3px 6px;
  border-radius: 10px;
  background: rgba(32, 9, 6, 0.75);
  font-size: 12px;
}

.profile-action.disabled {
  pointer-events: none;
  opacity: 0.5;
}

.ban-status-cell {
  min-width: 140px;
}

.ban-reason-cell {
  min-width: 170px;
}

.row-delete {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 10px;
  background: rgba(32, 9, 6, 0.75);
}

.rank-cell select {
  text-align: center;
  font-weight: 400;
  font-family: inherit;
  font-size: inherit;
  background: transparent !important;
  color: #111 !important;
  opacity: 1 !important;
  -webkit-text-fill-color: #111;
  filter: none !important;
  appearance: none;
  -webkit-appearance: none;
}

.excel-table.readonly .rank-cell select:disabled {
  color: #111 !important;
  opacity: 1 !important;
  -webkit-text-fill-color: #111;
  filter: none !important;
}

/* Unified rank palette for table cells and rank badges. */
.excel-table td.rank-11,
.rank-outline-badge.rank-11 { --rank-bg-color: #833C0C; --rank-text-color: #111; }
.excel-table td.rank-10,
.rank-outline-badge.rank-10 { --rank-bg-color: #C00000; --rank-text-color: #111; }
.excel-table td.rank-9,
.rank-outline-badge.rank-9 { --rank-bg-color: #FF0000; --rank-text-color: #111; }
.excel-table td.rank-8,
.rank-outline-badge.rank-8 { --rank-bg-color: #FFC000; --rank-text-color: #111; }
.excel-table td.rank-7,
.rank-outline-badge.rank-7 { --rank-bg-color: #FFFF00; --rank-text-color: #111; }
.excel-table td.rank-6,
.rank-outline-badge.rank-6 { --rank-bg-color: #92D050; --rank-text-color: #111; }
.excel-table td.rank-5,
.rank-outline-badge.rank-5 { --rank-bg-color: #00B050; --rank-text-color: #111; }
.excel-table td.rank-4,
.rank-outline-badge.rank-4 { --rank-bg-color: #00B0F0; --rank-text-color: #111; }
.excel-table td.rank-3,
.rank-outline-badge.rank-3 { --rank-bg-color: #0070C0; --rank-text-color: #111; }
.excel-table td.rank-2,
.rank-outline-badge.rank-2 { --rank-bg-color: #002060; --rank-text-color: #FFF; }
.excel-table td.rank-1,
.rank-outline-badge.rank-1 { --rank-bg-color: #7030A0; --rank-text-color: #FFF; }

/* Rank glow intensity scale: higher skill rank => stronger glow. */
.rank-outline-badge.rank-11,
.profile-rank-logo-badge.rank-11,
.signup-rank-badge.is-rank-logo.rank-11 { --rank-glow-rgb: 131, 60, 12; --rank-glow-strength: 0.16; --rank-glow-size: 4px; }
.rank-outline-badge.rank-10,
.profile-rank-logo-badge.rank-10,
.signup-rank-badge.is-rank-logo.rank-10 { --rank-glow-rgb: 192, 0, 0; --rank-glow-strength: 0.18; --rank-glow-size: 5px; }
.rank-outline-badge.rank-9,
.profile-rank-logo-badge.rank-9,
.signup-rank-badge.is-rank-logo.rank-9 { --rank-glow-rgb: 255, 0, 0; --rank-glow-strength: 0.21; --rank-glow-size: 6px; }
.rank-outline-badge.rank-8,
.profile-rank-logo-badge.rank-8,
.signup-rank-badge.is-rank-logo.rank-8 { --rank-glow-rgb: 255, 192, 0; --rank-glow-strength: 0.24; --rank-glow-size: 7px; }
.rank-outline-badge.rank-7,
.profile-rank-logo-badge.rank-7,
.signup-rank-badge.is-rank-logo.rank-7 { --rank-glow-rgb: 255, 255, 0; --rank-glow-strength: 0.27; --rank-glow-size: 8px; }
.rank-outline-badge.rank-6,
.profile-rank-logo-badge.rank-6,
.signup-rank-badge.is-rank-logo.rank-6 { --rank-glow-rgb: 146, 208, 80; --rank-glow-strength: 0.3; --rank-glow-size: 9px; }
.rank-outline-badge.rank-5,
.profile-rank-logo-badge.rank-5,
.signup-rank-badge.is-rank-logo.rank-5 { --rank-glow-rgb: 0, 176, 80; --rank-glow-strength: 0.34; --rank-glow-size: 10px; }
.rank-outline-badge.rank-4,
.profile-rank-logo-badge.rank-4,
.signup-rank-badge.is-rank-logo.rank-4 { --rank-glow-rgb: 0, 176, 240; --rank-glow-strength: 0.38; --rank-glow-size: 11px; }
.rank-outline-badge.rank-3,
.profile-rank-logo-badge.rank-3,
.signup-rank-badge.is-rank-logo.rank-3 { --rank-glow-rgb: 0, 112, 192; --rank-glow-strength: 0.42; --rank-glow-size: 12px; }
.rank-outline-badge.rank-2,
.profile-rank-logo-badge.rank-2,
.signup-rank-badge.is-rank-logo.rank-2 { --rank-glow-rgb: 0, 32, 96; --rank-glow-strength: 0.47; --rank-glow-size: 13px; }
.rank-outline-badge.rank-1,
.profile-rank-logo-badge.rank-1,
.signup-rank-badge.is-rank-logo.rank-1 { --rank-glow-rgb: 112, 48, 160; --rank-glow-strength: 0.54; --rank-glow-size: 15px; }

/* Применение rank-палитры: ячейки таблицы и цвет текста в readonly select. */
.excel-table td[class^="rank-"],
.excel-table td[class*=" rank-"] {
  background: var(--rank-bg-color, transparent) !important;
  color: var(--rank-text-color, #111) !important;
}

.excel-table td[class^="rank-"] select,
.excel-table td[class*=" rank-"] select {
  color: var(--rank-text-color, #111) !important;
  -webkit-text-fill-color: var(--rank-text-color, #111) !important;
}

/* Compact-режим таблицы для плотного отображения на небольших экранах. */
.excel-table.compact {
  min-width: 1180px;
  font-size: 12px;
}

.excel-table.compact th,
.excel-table.compact td {
  padding: 0 4px;
}

.excel-table.compact td input,
.excel-table.compact td select {
  min-height: 16px;
  padding: 0 3px;
}

.excel-table.compact .fill-cell {
  min-width: 76px;
}

.excel-table.compact .fill-triple {
  min-width: 156px;
  gap: 1px;
}

.excel-table.compact .fill-triple select {
  min-width: 48px;
}

.excel-table.compact .table-class-cell {
  min-width: 64px;
}

.excel-table.compact .table-class-editor {
  gap: 2px;
}

.excel-table.compact .class-icon-badge.is-table {
  width: 20px;
  height: 20px;
}

.excel-table.compact .class-icon-img {
  width: 14px;
  height: 14px;
}

.excel-table.compact .rank-cell {
  min-width: 58px;
}

.excel-table.compact .rank-cell.rank-cell-tournament {
  min-width: 94px;
}

.excel-table.compact .rank-pts-rank {
  font-size: 11px;
}

.excel-table.compact .rank-pts-pts {
  font-size: 10px;
}

.excel-table.compact .rank-pts-edit-label {
  font-size: 9px;
}

.excel-table.compact .rank-pts-edit-input {
  width: 66px;
  min-height: 22px;
  padding: 1px 6px;
  font-size: 11px;
}

.excel-table.compact th.reputation-cell,
.excel-table.compact td.reputation-cell {
  width: 72px;
  min-width: 72px;
}

.excel-table.compact .reputation-pill {
  min-width: 30px;
  padding: 1px 6px;
  font-size: 11px;
}

.excel-table.compact .profile-col {
  width: 74px;
}

.excel-table.compact .profile-action {
  min-height: 26px;
  padding: 2px 5px;
  font-size: 11px;
}

.excel-table.compact .ban-status-cell {
  min-width: 124px;
}

.excel-table.compact .ban-reason-cell {
  min-width: 145px;
}

/* Отрисовка ника и служебных маркеров верификации в таблице игроков. */
.nick-link {
  display: inline-block;
  max-width: none;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.nick-admin-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nick-view-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nick-verified-marker {
  color: #ffd364;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  cursor: default;
  text-shadow: 0 0 6px rgba(255, 211, 100, 0.45);
}

/* Модалка ручной привязки/проверки profile-link для игрока. */
.profile-link-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.profile-link-modal {
  width: min(560px, 100%);
  background: #1a0f09;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  padding: 16px;
}

.profile-link-modal h3 {
  margin: 0 0 12px;
  color: #ffe3c8;
}

.profile-link-modal-label {
  display: grid;
  gap: 8px;
}

.profile-link-modal-label span {
  color: #e3c2a3;
  font-size: 13px;
}

.profile-link-modal-input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: #ffe3c8;
  padding: 10px 12px;
  font: inherit;
  box-sizing: border-box;
}

.profile-link-modal-error {
  margin: 10px 0 0;
  min-height: 1.2em;
  color: #ff8f8f;
}

.profile-link-modal-actions,
.profile-link-modal-checking {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-link-modal-checking[hidden],
.profile-link-modal-actions[hidden] {
  display: none !important;
}

/* Модалка profile-link: validate/checking состояния кнопок и ошибки. */
.profile-link-checking-btn {
  opacity: 0.6;
  cursor: not-allowed !important;
}

/* Универсальный tooltip движок (координаты задаются JS, CSS управляет видом/анимацией). */
/* Используется в разных страницах и не должен влиять на layout документа. */
.hatlander-tooltip {
  position: fixed;
  left: -10000px;
  top: -10000px;
  z-index: 4200;
  pointer-events: none;
  max-width: min(320px, calc(100vw - 20px));
  padding: 7px 10px;
  border: 1px solid #5f4b40;
  border-radius: 9px;
  background: linear-gradient(100deg, rgba(58, 35, 28, 0.97), rgba(36, 24, 20, 0.97));
  color: #ffe4cb;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.44);
  font-size: 12px;
  line-height: 1.35;
  letter-spacing: 0.01em;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.08s linear, transform 0.08s linear;
}

.hatlander-tooltip.show {
  opacity: 1;
  transform: translateY(0);
}

.nick-ban-underline {
  text-decoration: underline;
}

.nick-ban-red {
  color: #ff4b4b !important;
}

.nick-ban-bold {
  font-weight: 800;
}

.player-ban-lvl-1 td { background: rgba(160, 26, 26, 0.08); }
.player-ban-lvl-2 td { background: rgba(170, 24, 24, 0.13); }
.player-ban-lvl-3 td { background: rgba(178, 22, 22, 0.18); }
.player-ban-lvl-4 td { background: rgba(186, 20, 20, 0.24); }
.player-ban-lvl-5 td { background: rgba(194, 18, 18, 0.31); }
.player-ban-lvl-6 td { background: rgba(202, 16, 16, 0.39); }
.player-ban-lvl-7 td { background: rgba(210, 14, 14, 0.48); }
.player-ban-lvl-8 td { background: rgba(220, 12, 12, 0.58); }
.player-ban-blacklist td {
  background: #000000 !important;
  color: #ff8d8d !important;
  border-color: #000000 !important;
}

.player-ban-blacklist td[class*="rank-"] {
  background: #000000 !important;
  color: #ff8d8d !important;
}

.player-ban-blacklist .nick-link,
.player-ban-blacklist input[data-k="nickname"] {
  color: #ff4b4b !important;
  font-weight: 800 !important;
}

/* Профиль игрока: preview, редактор, статистика, медали, санкции и матчи. */
.profile-host {
  padding: var(--main-content-top-padding) var(--site-shell-inline-padding) 20px;
  max-width: calc(var(--site-content-track-width) + (var(--site-shell-inline-padding) * 2));
  box-sizing: border-box;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

#player-profile-root {
  width: 100%;
}

#player-profile-root.profile-page {
  width: 100%;
  min-height: 320px;
}

#player-profile-root.profile-page-loading {
  min-height: 320px;
}

#player-profile-root.profile-page-ready {
  min-height: 0;
}

/* Плавный reveal профиля после загрузки данных и построения карточки. */
.profile-page-content {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 240ms ease, transform 240ms ease;
}

.profile-page-content.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .profile-page-content,
  .profile-page-content.is-visible {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.profile-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
  width: 100%;
}

.profile-preview {
  --profile-avatar-offset: 52px;
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  width: 100%;
  border: 1px solid #5a4a40;
  border-radius: 14px;
  background:
    radial-gradient(120% 220% at 0% 0%, rgba(106, 56, 28, 0.22) 0%, rgba(106, 56, 28, 0) 58%),
    linear-gradient(98deg, rgba(57, 34, 27, 0.62), rgba(45, 32, 28, 0.5));
  padding: 12px 14px;
  box-sizing: border-box;
}

.profile-bottom {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: start;
}

.profile-bottom.has-editor-side {
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
}

/* TODO(layout): стабилизировать sidebar-редактор профиля, чтобы открытие не вызывало сдвиг контента и прыжок скролла. */
/*Разумеется оно ломает страницу. Нет бы сделать это вбок как у страниц турнира*/

/* Боковая панель редактора профиля: sticky на desktop, inline на мобильных брейкпоинтах. */
.profile-editor-side {
  border: 1px solid #4c4039;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(59, 42, 32, 0.45) 0%, rgba(47, 34, 30, 0.38) 100%);
  padding: 8px;
  display: grid;
  gap: 8px;
  position: sticky;
  top: 8px;
  align-self: start;
}

.profile-editor-title {
  margin: 0;
  font-size: 16px;
}

.profile-editor-section {
  border-top: 1px solid rgba(255, 224, 201, 0.16);
  padding-top: 8px;
}

.profile-editor-section:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.profile-editor-side .profile-avatar-tools {
  margin-top: 0;
}

.profile-editor-side .profile-avatar-editor,
.profile-editor-side .profile-medals-editor,
.profile-editor-side .profile-chat-mute-editor,
.profile-editor-side .profile-tournament-ban-editor {
  margin-top: 0;
}

/* Верх профиля: аватар, SteamID-копирование и avatar-tools. */
.profile-avatar-box {
  width: 176px;
  max-width: 100%;
  position: relative;
  align-self: start;
  margin-top: var(--profile-avatar-offset);
}

.profile-avatar-media {
  border-radius: 24px;
  overflow: hidden;
  background: #7d6753;
  aspect-ratio: 1 / 1;
  width: 100%;
  border: 1px solid rgba(255, 220, 191, 0.2);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.34);
}

.profile-avatar-fallback img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-steamid64-row {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Копируемый SteamID64: отдельная зелёная палитра и визуальный state "copied". */
.profile-steamid64-code {
  display: block;
  width: 100%;
  padding: 4px 7px;
  border: 1px solid rgba(140, 223, 176, 0.35);
  border-radius: 6px;
  background: rgba(13, 20, 16, 0.78);
  color: #bdf3cd;
  font-family: "Cascadia Mono", "Consolas", "Courier New", monospace;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
  cursor: pointer;
  user-select: all;
  transition: border-color 0.14s ease, background-color 0.14s ease, color 0.14s ease;
}

.profile-steamid64-code:hover,
.profile-steamid64-code:focus-visible {
  border-color: rgba(153, 237, 189, 0.78);
  background: rgba(20, 34, 27, 0.9);
  color: #d5ffe3;
}

.profile-steamid64-code.is-copied {
  border-color: rgba(125, 244, 178, 0.85);
  background: rgba(24, 62, 43, 0.92);
  color: #e8fff0;
}

.profile-avatar-tools {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

/* Редактор аватара: ручной URL + управляющие кнопки. */
.profile-avatar-editor {
  margin-top: 8px;
  display: grid;
  gap: 6px;
}

.profile-avatar-editor label {
  color: #e3c2a3;
  font-size: 13px;
}

.profile-avatar-editor input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: #ffe3c8;
  padding: 10px 12px;
  font: inherit;
  box-sizing: border-box;
}

.profile-avatar-editor-actions {
  display: flex;
  gap: 8px;
}

/* Инфо-колонка профиля: имя, внешние ссылки, ранги, медали и служебные строки. */
.profile-info {
  min-width: 0;
  width: 100%;
  display: grid;
  align-content: start;
  gap: 8px;
}

.profile-name {
  margin: 0;
  color: #ffdfc2;
  font-family: "Russo One", "Golos Text", sans-serif;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  font-size: clamp(28px, 2.7vw, 44px);
  line-height: 1.05;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.profile-name-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}

.profile-name-banned {
  color: #ff5858;
}

/* Блок статистики профиля: три колонки ролей/рангов с унифицированной высотой. */
.profile-stats-bar {
  border: 1px solid #5f4b40;
  border-radius: 12px;
  background:
    linear-gradient(90deg, rgba(66, 32, 17, 0.62) 0%, rgba(60, 44, 40, 0.54) 100%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 10px;
  row-gap: 8px;
  justify-content: stretch;
  padding: 10px 10px;
  margin-bottom: 2px;
  width: 100%;
  box-shadow: inset 0 1px 0 rgba(255, 229, 198, 0.08);
  box-sizing: border-box;
  overflow: visible;
}

.profile-stats-bar-rank-medals {
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
}

.profile-stat {
  display: grid;
  grid-template-rows: auto minmax(86px, auto);
  justify-items: center;
  align-content: start;
  border: 1px solid rgba(255, 223, 199, 0.14);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(33, 19, 15, 0.38), rgba(39, 28, 24, 0.16));
  padding: 6px 6px 7px;
}

.profile-stat .k {
  font-size: clamp(11px, 0.92vw, 15px);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  opacity: 0.9;
}

.profile-stat .v {
  margin-top: 2px;
  font-size: clamp(11px, 0.95vw, 16px);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 86px;
}

/* Статистика профиля: role + rank бейдж/логотип внутри карточки статов. */
.profile-role-with-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  width: 100%;
}

.profile-rank-pts-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  min-width: 0;
}

.profile-rank-pts-stack .profile-rank-logo-badge {
  margin-bottom: 4px;
}

.profile-tournament-pts-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 223, 199, 0.28);
  background: rgba(15, 9, 8, 0.45);
  font-family: "Freshid Condensed", "Russo One", "Golos Text", sans-serif;
  font-size: clamp(14px, 1.25vw, 17px);
  line-height: 1;
  letter-spacing: 0.02em;
  font-weight: 700;
}

.profile-tournament-pts-value.is-under-rank {
  min-height: 24px;
  padding: 2px 9px;
  font-size: clamp(13px, 1.05vw, 15px);
  letter-spacing: 0.015em;
  transform: translateY(7px);
  align-self: center;
}

.profile-stat-rank-main .v {
  justify-content: center;
}

.profile-stat-medals-future .v {
  justify-content: center;
}

.profile-medals-future-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 4px 12px;
  border: 1px dashed rgba(255, 224, 201, 0.28);
  border-radius: 999px;
  color: #e6d4c3;
  font-size: clamp(11px, 0.9vw, 14px);
  font-weight: 700;
  line-height: 1.1;
  opacity: 0.85;
}

.profile-stats-bar-unverified .profile-stat {
  grid-template-rows: auto minmax(44px, auto);
}

.profile-stats-bar-unverified .profile-stat .v {
  min-height: 44px;
}

.profile-unverified-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 4px 12px;
  border: 1px solid rgba(255, 224, 201, 0.24);
  border-radius: 999px;
  background: rgba(20, 12, 10, 0.36);
  color: #e6d4c3;
  font-size: clamp(11px, 0.9vw, 14px);
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
}

.profile-unverified-rank-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.profile-unverified-cta-row {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding-top: 2px;
}

.profile-unverified-verify-btn {
  min-width: 228px;
  justify-content: center;
  font-weight: 700;
}

.profile-unverified-note {
  margin: 0;
  color: #e7c9a7;
  font-size: 14px;
  line-height: 1.45;
}

.profile-role-class {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Интерактивный rank badge (hover/press/tilt/bounce), управляется CSS-переменными. */
.profile-rank-logo-badge {
  --rank-hover-scale: 1;
  --rank-press-factor: 1;
  --rank-tilt-x: 0deg;
  --rank-tilt-y: 0deg;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 124px;
  height: 110px;
  flex: 0 0 auto;
  pointer-events: none;
  transform-origin: 50% 50%;
  transform: perspective(760px) translateZ(0) rotateX(var(--rank-tilt-x)) rotateY(var(--rank-tilt-y)) scale(calc(var(--rank-size-scale) * var(--rank-hover-scale) * var(--rank-press-factor)));
  transition: transform 130ms ease-out, box-shadow 180ms ease-out;
  will-change: transform;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.profile-rank-logo-badge.is-pressed {
  --rank-press-factor: 0.92;
  transition-duration: 70ms;
}

.profile-rank-logo-badge.is-returning {
  transition-duration: 220ms;
  transition-timing-function: cubic-bezier(.2, .78, .2, 1);
}

.profile-rank-logo-badge.is-tilting {
  z-index: 2;
  box-shadow: none;
}

.profile-rank-logo-badge.is-bounce {
  animation: profile-rank-bounce 280ms cubic-bezier(.2, .9, .22, 1);
}

/* Анимация bounce для интерактивного rank-logo при клике/возврате. */
@keyframes profile-rank-bounce {
  0% {
    transform: perspective(760px) translateZ(0) translateY(0) rotateX(var(--rank-tilt-x)) rotateY(var(--rank-tilt-y)) scale(calc(var(--rank-size-scale) * var(--rank-hover-scale) * 0.92));
  }
  36% {
    transform: perspective(760px) translateZ(0) translateY(-8px) rotateX(var(--rank-tilt-x)) rotateY(var(--rank-tilt-y)) scale(calc(var(--rank-size-scale) * var(--rank-hover-scale) * 1.04));
  }
  68% {
    transform: perspective(760px) translateZ(0) translateY(-3px) rotateX(var(--rank-tilt-x)) rotateY(var(--rank-tilt-y)) scale(calc(var(--rank-size-scale) * var(--rank-hover-scale) * 1.01));
  }
  100% {
    transform: perspective(760px) translateZ(0) translateY(0) rotateX(var(--rank-tilt-x)) rotateY(var(--rank-tilt-y)) scale(calc(var(--rank-size-scale) * var(--rank-hover-scale)));
  }
}

.profile-rank-logo-hit {
  position: absolute;
  inset: 0;
  pointer-events: auto;
  background: transparent;
  cursor: pointer;
}

.profile-rank-logo-base {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
  transform: translateZ(0.01px);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  filter:
    drop-shadow(0 0 calc(1px + var(--rank-glow-size, 0px) * 0.34) rgba(var(--rank-glow-rgb, 255, 240, 220), calc(var(--rank-glow-strength, 0) + 0.02)))
    drop-shadow(0 0 calc(2px + var(--rank-glow-size, 0px) * 0.7) rgba(var(--rank-glow-rgb, 255, 240, 220), calc(var(--rank-glow-strength, 0) * 0.68)));
}

.profile-rank-logo-class {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 26px;
  height: 26px;
  transform: translate(-50%, -50%);
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.45));
}

.profile-rank-logo-roman {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  text-align: center;
  font-family: "Freshid Condensed", "Russo One", "Golos Text", sans-serif;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  color: var(--rank-roman-color, #fdd7bb);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.profile-rank-logo-roman,
.signup-rank-logo-roman {
  display: none !important;
}

.profile-rank-logo-roman.len-3 {
  font-size: 16px;
}

.profile-rank-logo-roman.len-4 {
  font-size: 14px;
}

.profile-rank-logo-badge.rank-11 { --rank-size-scale: 1; }
.profile-rank-logo-badge.rank-10 { --rank-size-scale: 1.02; }
.profile-rank-logo-badge.rank-9 { --rank-size-scale: 1.04; }
.profile-rank-logo-badge.rank-8 { --rank-size-scale: 1.06; }
.profile-rank-logo-badge.rank-7 { --rank-size-scale: 1.08; }
.profile-rank-logo-badge.rank-6 { --rank-size-scale: 1.10; }
.profile-rank-logo-badge.rank-5 { --rank-size-scale: 1.12; }
.profile-rank-logo-badge.rank-4 { --rank-size-scale: 1.14; }
.profile-rank-logo-badge.rank-3 { --rank-size-scale: 1.16; }
.profile-rank-logo-badge.rank-2 { --rank-size-scale: 1.18; }
.profile-rank-logo-badge.rank-1 { --rank-size-scale: 1.20; }
.profile-rank-logo-badge.rank-7 { --rank-roman-color: #1d1d1d; }
.profile-rank-logo-badge.rank-8 { --rank-roman-color: #1d1d1d; }
.profile-rank-logo-badge.rank-11 .profile-rank-logo-roman { display: none; }

/* Иконки классов/ролей в профиле (fill-секция). */
.profile-fill-icons {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  min-height: 32px;
}

.class-icon-badge.is-profile-fill {
  width: 26px;
  height: 26px;
  border-radius: 8px;
}

.class-icon-badge.is-profile-fill .class-icon-img {
  width: 18px;
  height: 18px;
}

.rank-outline-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 26px;
  padding: 0 10px;
  border: 1px solid rgba(255, 224, 201, 0.34);
  border-radius: 999px;
  background: rgba(24, 15, 13, 0.52);
  color: #f6dfcb;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  box-sizing: border-box;
}

.rank-outline-badge.rank-empty {
  border-color: rgba(137, 125, 114, 0.82);
  background: rgba(24, 15, 13, 0.52);
  color: #f6dfcb;
}

.rank-outline-badge[class*="rank-"]:not(.rank-empty) {
  border-color: var(--rank-bg-color, rgba(255, 224, 201, 0.34));
  background: var(--rank-bg-color, rgba(24, 15, 13, 0.52));
  color: var(--rank-text-color, #111);
  box-shadow:
    0 0 calc(2px + var(--rank-glow-size, 0px) * 0.25) rgba(var(--rank-glow-rgb, 255, 240, 220), calc(var(--rank-glow-strength, 0) * 0.6));
}

/* Внешние ссылки профиля (Steam/Discord/etc.) и их on/off-состояния. */
.profile-links-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.profile-ext-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 222, 197, 0.22);
  background: rgba(48, 28, 22, 0.52);
  box-shadow: inset 0 1px 0 rgba(255, 239, 216, 0.06);
  font-family: "Russo One", "Golos Text", sans-serif;
  font-size: clamp(14px, 1.03vw, 18px);
  line-height: 1;
  color: #9f856e;
  text-decoration: none;
  transition: border-color 0.14s ease, background-color 0.14s ease, color 0.14s ease, transform 0.14s ease;
}

.profile-ext-link:not(.off) {
  color: #f4c99d;
  border-color: rgba(255, 209, 172, 0.4);
}

.profile-ext-link:not(.off):hover,
.profile-ext-link:not(.off):focus-visible {
  color: #ffe5cb;
  background: rgba(78, 46, 35, 0.72);
  border-color: rgba(255, 221, 192, 0.75);
  transform: translateY(-1px);
}

.profile-ext-link.off {
  opacity: 0.55;
  color: #8b7362;
}

.profile-medals-row {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-medals-title {
  color: #ffe3c7;
}

.profile-medals-list {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

/* Редактор медалей: ввод данных наград и управление списком в админ-режиме. */
.profile-medals-editor {
  display: grid;
  gap: 4px;
}

.profile-medals-editor label {
  font-size: 12px;
  color: var(--muted);
}

.profile-medals-editor-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.profile-medals-editor-row input {
  min-width: 130px;
  max-width: 210px;
  border: 1px solid #4f433a;
  border-radius: 8px;
  padding: 6px 8px;
  background: rgba(26, 12, 10, 0.6);
  color: #fdd7bb;
}

.profile-medal-item {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  overflow: visible;
  transition: transform 0.1s ease, filter 0.1s ease;
}

.profile-medal-item.has-description {
  cursor: pointer;
}

.profile-medal-item.medal-tooltip-open {
  transform: translateY(-1px);
  filter: drop-shadow(0 0 8px rgba(255, 199, 146, 0.55));
}

.profile-medal-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform 0.1s ease, filter 0.1s ease;
}

@media (hover: hover) and (pointer: fine) {
  .profile-medal-item.has-description:hover,
  .profile-medal-item.has-description:focus-within {
    transform: translateY(-1px);
    filter: drop-shadow(0 0 8px rgba(255, 199, 146, 0.55));
  }

  .profile-medal-item.has-description:hover img,
  .profile-medal-item.has-description:focus-within img {
    transform: scale(1.04);
    filter: saturate(1.08);
  }
}

/* Мобильный tooltip медалей: фиксирован поверх UI, позиция вычисляется скриптом. */
.profile-medal-mobile-tooltip {
  position: fixed;
  left: -10000px;
  top: -10000px;
  z-index: 4205;
  pointer-events: none;
  max-width: min(300px, calc(100vw - 20px));
  padding: 7px 10px;
  border: 1px solid #5f4b40;
  border-radius: 9px;
  background: linear-gradient(100deg, rgba(58, 35, 28, 0.98), rgba(36, 24, 20, 0.98));
  color: #ffe4cb;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.44);
  font-size: 12px;
  line-height: 1.35;
  letter-spacing: 0.01em;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.09s linear, transform 0.09s linear;
}

.profile-medal-mobile-tooltip[hidden] {
  display: none !important;
}

.profile-medal-mobile-tooltip.show {
  opacity: 1;
  transform: translateY(0);
}

/* Медали и санкции профиля: row-блоки и editor-контролы модератора. */
.profile-medal-del {
  position: absolute;
  right: -5px;
  top: -8px;
  border: 0;
  background: transparent;
  color: #ffb3b3;
  cursor: pointer;
}

.profile-medal-empty {
  color: var(--muted);
}

.profile-ban-row {
  display: none;
  border: 1px solid rgba(227, 50, 41, 0.8);
  border-radius: 12px;
  background: rgba(72, 8, 8, 0.42);
  padding: 6px;
  color: #ffdec4;
}

.profile-ban-row.active {
  display: grid;
  gap: 3px;
}

.profile-chat-mute-row {
  display: none;
  border: 1px solid rgba(255, 160, 58, 0.8);
  border-radius: 12px;
  background: rgba(86, 43, 8, 0.46);
  padding: 6px;
  color: #ffd9b0;
}

.profile-chat-mute-row.active {
  display: grid;
  gap: 3px;
}

.profile-tournament-ban-row {
  display: none;
  border: 1px solid rgba(255, 160, 58, 0.8);
  border-radius: 12px;
  background: rgba(96, 52, 12, 0.46);
  padding: 6px;
  color: #ffd9b0;
}

.profile-tournament-ban-row.active {
  display: grid;
  gap: 3px;
}

.profile-chat-mute-editor {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

.profile-chat-mute-editor label {
  color: var(--muted);
}

.profile-chat-mute-feedback {
  margin: 0;
  min-height: 18px;
}

/* Ряд editor-контролов chat mute: длительность, причина и action-кнопки. */
.profile-chat-mute-editor-row {
  display: grid;
  grid-template-columns: 110px minmax(160px, 1fr) auto auto;
  gap: 8px;
}

.profile-chat-mute-editor-row input {
  width: 100%;
  border: 1px solid #5f4b40;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
  padding: 6px 8px;
  font: inherit;
  box-sizing: border-box;
}

.profile-tournament-ban-editor {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

.profile-tournament-ban-editor label {
  color: var(--muted);
}

.profile-tournament-ban-feedback {
  margin: 0;
  min-height: 18px;
}

.profile-tournament-ban-editor-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.profile-tournament-ban-editor-row select,
.profile-tournament-ban-editor-row input {
  grid-column: 1 / -1;
  width: 100%;
  border: 1px solid #5f4b40;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
  padding: 6px 8px;
  font: inherit;
  box-sizing: border-box;
}

.profile-tournament-ban-editor-row select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 34px;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(255, 215, 182, 0.9) 50%),
    linear-gradient(135deg, rgba(255, 215, 182, 0.9) 50%, transparent 50%);
  background-position:
    calc(100% - 17px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.profile-tournament-ban-editor-row select:focus-visible,
.profile-tournament-ban-editor-row input:focus-visible {
  outline: 2px solid rgba(255, 186, 130, 0.58);
  outline-offset: 1px;
}

.profile-tournament-ban-count-btn {
  grid-column: 1 / -1;
}

.profile-tournament-ban-count-btn.is-hidden {
  display: none;
}

.profile-tournament-ban-editor-row .btn {
  width: 100%;
  justify-content: center;
}

/* История матчей: карточка с multi-column layout и результатом win/lose. */
.profile-matches-box {
  width: 100%;
  max-width: 100%;
  justify-self: center;
  border: 1px solid #54453d;
  border-radius: 14px;
  background:
    radial-gradient(130% 220% at 0% 0%, rgba(104, 55, 27, 0.18) 0%, rgba(104, 55, 27, 0) 56%),
    linear-gradient(95deg, rgba(59, 42, 32, 0.42), rgba(61, 57, 56, 0.36));
  padding: 12px 12px;
  box-shadow: inset 0 1px 0 rgba(255, 229, 198, 0.05);
}

.profile-matches-box h3 {
  margin: 0 0 10px;
  text-align: center;
  font-family: "Russo One", sans-serif;
  font-size: clamp(17px, 1.5vw, 28px);
  font-weight: 400;
  letter-spacing: 0.01em;
}

.profile-matches-list {
  display: grid;
  gap: 6px;
}

/* Карточка матча в истории профиля: multi-column на desktop, stack на mobile. */
.profile-match-item {
  display: grid;
  grid-template-columns: minmax(130px, 1.1fr) minmax(180px, 1fr) minmax(120px, 0.72fr) minmax(160px, 0.95fr);
  align-items: center;
  gap: 8px 12px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 224, 201, 0.14);
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(255, 224, 201, 0.045), rgba(255, 224, 201, 0.022));
  text-decoration: none;
  color: inherit;
  text-align: left;
  white-space: normal;
}

.profile-match-item:hover {
  background: linear-gradient(90deg, rgba(255, 224, 201, 0.09), rgba(255, 224, 201, 0.045));
  border-color: rgba(255, 224, 201, 0.3);
}

.profile-match-title {
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
  justify-self: start;
}

.profile-match-date {
  display: inline-block;
  color: var(--muted);
  font-size: 0.9em;
  line-height: 1.25;
  justify-self: start;
}

.profile-match-meta {
  display: inline-block;
  color: var(--muted);
  line-height: 1.25;
  justify-self: start;
}

.profile-match-meta.win {
  color: #9ee29e;
}

.profile-match-meta.lose {
  color: #f39f9f;
}

/* Страница турнира: хедер, BO3-карты, составы, signup/replacement, чат и подтверждения. */
.tournament-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.tournament-page-host {
  max-width: calc(var(--site-content-track-width) + (var(--site-shell-inline-padding) * 2));
  width: 100%;
  padding-top: var(--main-content-top-padding);
}

/* Наградная лента: иконки классов + изображение reward-strip для турнира. */
.tournament-reward-strip {
  margin: 0 auto 12px;
  padding: 6px;
  border: 1px solid #4c4039;
  border-radius: 12px;
  background: rgba(49, 30, 24, 0.35);
  width: 100%;
  box-sizing: border-box;
  overflow: visible;
}

.tournament-reward-strip.is-hidden {
  display: none;
}

.tournament-reward-strip-track {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tournament-reward-classicons {
  --reward-slot-min: 58px;
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  justify-items: center;
  align-items: center;
  gap: 4px;
  margin: 0 0 8px;
  width: 100%;
  overflow: visible;
  padding: 1px 0 3px;
}

.tournament-reward-classicon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
}

.class-icon-badge.is-reward-strip {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.class-icon-badge.is-reward-strip .class-icon-img {
  width: 24px;
  height: 24px;
}

.tournament-reward-slot-summary {
  margin: 0 0 8px;
  padding: 8px 10px;
  border: 1px dashed rgba(255, 224, 201, 0.26);
  border-radius: 10px;
  background: rgba(31, 23, 19, 0.65);
  display: grid;
  gap: 4px;
}

.tournament-reward-slot-title {
  margin: 0;
  font-size: 32px;
  line-height: 1.05;
  font-family: "Freshid Condensed", "Russo One", "Golos Text", sans-serif;
  color: #ffe1c6;
}

.tournament-reward-slot-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.tournament-reward-slot-value {
  margin: 0;
  color: #ffe0c4;
  font-weight: 700;
  font-size: 14px;
}

.tournament-reward-slot-breakdown {
  color: var(--muted);
  font-weight: 500;
}

.tournament-reward-slots-grid {
  --reward-slot-min: 58px;
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
  overflow: visible;
  padding: 1px 0 3px;
}

.tournament-reward-slot-card {
  min-width: 0;
  min-height: 86px;
  border: 1px solid rgba(255, 224, 201, 0.24);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(43, 30, 25, 0.8), rgba(29, 21, 18, 0.92));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  position: relative;
  overflow: visible;
}

details.tournament-reward-slot-card {
  padding: 0;
  display: block;
}

details.tournament-reward-slot-card > summary {
  list-style: none;
}

details.tournament-reward-slot-card > summary::-webkit-details-marker {
  display: none;
}

.tournament-reward-slot-trigger {
  width: 100%;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border: none;
  background: transparent;
  border-radius: 8px;
  padding: 6px;
  cursor: default;
}

details.tournament-reward-slot-card > .tournament-reward-slot-trigger {
  cursor: pointer;
}

.tournament-reward-slot-card img {
  width: 100%;
  height: 100%;
  max-height: 72px;
  object-fit: contain;
  display: block;
}

.tournament-reward-slot-card.is-empty {
  opacity: 0.55;
}

.tournament-reward-slot-card.is-editable {
  cursor: pointer;
  opacity: 0.75;
}

.tournament-reward-slot-inline-edit {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 20px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 224, 201, 0.28);
  background: rgba(15, 12, 11, 0.82);
  color: #ffdfbf;
  font-size: 12px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 22;
}

.tournament-reward-slot-inline-edit:hover,
.tournament-reward-slot-inline-edit:focus-visible {
  border-color: rgba(255, 186, 130, 0.58);
  background: rgba(44, 29, 23, 0.92);
}

.tournament-reward-slot-empty {
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
}

.tournament-reward-slot-click-hint {
  position: absolute;
  left: 50%;
  bottom: 2px;
  transform: translateX(-50%);
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid rgba(255, 224, 201, 0.24);
  background: rgba(19, 14, 12, 0.9);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}

details.tournament-reward-slot-card:hover .tournament-reward-slot-click-hint,
details.tournament-reward-slot-card[open] .tournament-reward-slot-click-hint,
.tournament-reward-slot-card.is-editable:hover .tournament-reward-slot-click-hint {
  opacity: 1;
}

.tournament-reward-slot-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translate(-50%, 4px);
  min-width: 180px;
  max-width: 240px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 224, 201, 0.3);
  background: rgba(20, 15, 12, 0.96);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.42);
  display: grid;
  gap: 4px;
  opacity: 0;
  pointer-events: none;
  z-index: 20;
  transition: opacity 130ms ease, transform 130ms ease;
}

div.tournament-reward-slot-card:hover .tournament-reward-slot-tooltip,
div.tournament-reward-slot-card:focus-within .tournament-reward-slot-tooltip,
details.tournament-reward-slot-card:not([open]):hover .tournament-reward-slot-tooltip,
details.tournament-reward-slot-card:not([open]):focus-within .tournament-reward-slot-tooltip {
  opacity: 1;
  transform: translate(-50%, 0);
}

.tournament-reward-slot-tooltip-name {
  margin: 0;
  color: #ffe3c8;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  word-break: break-word;
}

.tournament-reward-slot-tooltip-line {
  margin: 0;
  color: #e6c7a4;
  font-size: 12px;
  line-height: 1.25;
}

.tournament-reward-slot-tooltip-money {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: #ffd6ae;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 600;
}

.tournament-reward-slot-actions {
  position: absolute;
  left: 50%;
  top: calc(100% + 6px);
  transform: translateX(-50%);
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid rgba(255, 224, 201, 0.28);
  background: rgba(22, 16, 13, 0.95);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.38);
  z-index: 25;
}

details.tournament-reward-slot-card[open] > .tournament-reward-slot-actions {
  display: flex;
}

.tournament-reward-slot-actions .btn.tournament-reward-item-link {
  padding: 7px 10px;
  line-height: 1;
  white-space: nowrap;
}

@media (max-width: 860px) {
  .tournament-reward-slot-tooltip {
    min-width: 160px;
    max-width: 210px;
  }

  .tournament-reward-slot-actions {
    flex-direction: column;
    min-width: 130px;
  }
}
.tournament-reward-strip img {
  display: block;
  height: auto;
  width: 100%;
  max-width: 100%;
  border-radius: 8px;
  object-fit: contain;
  margin: 0 auto;
}

.tournament-reward-items-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

.tournament-reward-pool-summary {
  margin: 0 0 10px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 224, 201, 0.22);
  border-radius: 10px;
  background: rgba(28, 21, 18, 0.7);
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
}

.tournament-reward-pool-label {
  color: var(--muted);
  font-size: 13px;
}

.tournament-reward-pool-value {
  color: #ffe0c4;
  font-weight: 700;
  font-size: 14px;
}

.tournament-reward-pool-breakdown {
  color: var(--muted);
  font-size: 12px;
}

.tournament-reward-pool-note {
  color: var(--muted);
  font-size: 12px;
}

.tournament-reward-pool-updated {
  color: var(--muted);
  font-size: 11px;
  width: 100%;
}

.tournament-reward-item-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 224, 201, 0.24);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(43, 30, 25, 0.8), rgba(29, 21, 18, 0.92));
  overflow: visible;
}

.tournament-reward-item-media {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: rgba(17, 13, 11, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tournament-reward-item-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.tournament-reward-item-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  min-width: 0;
}

.tournament-reward-item-name {
  margin: 0;
  font-size: 14px;
  line-height: 1.3;
  word-break: break-word;
}

.tournament-reward-item-price {
  margin: 0;
  font-size: 13px;
  line-height: 1.2;
  color: #e8ccab;
}

.tournament-reward-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tournament-reward-item-place {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.tournament-reward-item-qty {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.1;
  color: #ffe0c4;
  white-space: nowrap;
}

.tournament-reward-item-actions {
  margin-top: auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tournament-reward-item-actions .btn.tournament-reward-item-link {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
}

@media (max-width: 1160px) {
  .tournament-reward-items-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .tournament-reward-items-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .tournament-reward-items-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.tournament-connect-panel {
  margin: 0 auto 10px;
  border: 1px solid rgba(255, 224, 201, 0.2);
  border-radius: 12px;
  padding: 10px;
  background: linear-gradient(180deg, rgba(31, 23, 20, 0.64), rgba(45, 31, 26, 0.44));
}

.tournament-connect-panel.is-hidden {
  display: none;
}

.tournament-connect-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tournament-connect-panel.is-timer-only .tournament-connect-head {
  justify-content: center;
}

.tournament-connect-head h3 {
  margin: 0;
}

.tournament-connect-toggle {
  min-width: 190px;
}

.tournament-connect-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

.tournament-start-timer {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: #ffe0c4;
  text-align: center;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.tournament-start-timer.near {
  color: #ffd08a;
}

.tournament-connect-panel.is-timer-only .tournament-connect-head h3,
.tournament-connect-panel.is-timer-only .tournament-connect-actions,
.tournament-connect-panel.is-timer-only .tournament-connect-status,
.tournament-connect-panel.is-timer-only .tournament-connect-details {
  display: none;
}

.tournament-connect-status {
  margin: 8px 0 0;
}

.tournament-connect-status.ok {
  color: #9fe09a;
}

.tournament-connect-status.warn {
  color: #f1be8f;
}

.tournament-connect-details {
  margin: 8px 0 0;
  border: 1px dashed #6b5a4c;
  border-radius: 9px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.2);
}

.tournament-connect-row {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin: 0 0 8px;
}

.tournament-connect-row:last-child {
  margin-bottom: 0;
}

.tournament-connect-label {
  color: #f2c18d;
  font-weight: 700;
}

.tournament-connect-value {
  display: inline-block;
  min-width: 0;
  border: 1px solid #4f4139;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.32);
  padding: 5px 8px;
  overflow: visible;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 12px/1.4 Consolas, "Courier New", monospace;
}

.tournament-connect-copy {
  min-width: 96px;
}

.tournament-connect-warning {
  margin: 0;
  padding-top: 4px;
  color: #f1be8f;
  font-size: 13px;
  line-height: 1.35;
}

@media (max-width: 760px) {
  .tournament-connect-row {
    grid-template-columns: 1fr;
  }

  .tournament-connect-copy {
    width: 100%;
  }
}

@media (max-width: 1820px) {
  :root {
    --global-ad-rail-width: 300px;
  }
}

@media (max-width: 1680px) {
  .global-ad-rails-root {
    display: none;
  }
}

.tournament-debug-panel {
  margin: 0 auto 10px;
  border: 1px solid rgba(255, 224, 201, 0.2);
  border-radius: 12px;
  padding: 10px;
  background: linear-gradient(180deg, rgba(23, 28, 22, 0.74), rgba(28, 36, 26, 0.52));
}

.tournament-debug-panel.is-hidden {
  display: none;
}

.tournament-debug-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tournament-debug-head h3 {
  margin: 0;
}

.tournament-debug-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tournament-debug-refresh-btn,
.tournament-debug-stop-btn {
  min-width: 110px;
}

.tournament-debug-status {
  margin: 8px 0 0;
}

.tournament-debug-status.ok {
  color: #9fe09a;
}

.tournament-debug-status.warn {
  color: #f1be8f;
}

.tournament-debug-summary {
  margin-top: 8px;
}

.tournament-debug-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.tournament-debug-chip {
  border: 1px solid rgba(168, 196, 146, 0.3);
  border-radius: 9px;
  background: rgba(17, 23, 16, 0.54);
  padding: 6px 8px;
  display: grid;
  gap: 2px;
}

.tournament-debug-chip span {
  color: #b9cead;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tournament-debug-chip strong {
  color: #e5f4db;
  font-size: 13px;
  font-weight: 700;
}

.tournament-debug-meta {
  margin: 8px 0 0;
  color: #d8ebcc;
  font-size: 12px;
  line-height: 1.4;
}

.tournament-debug-meta code {
  font: 12px/1.4 Consolas, "Courier New", monospace;
}

.tournament-debug-details {
  margin-top: 8px;
}

.tournament-debug-log-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.tournament-debug-log-block {
  margin: 0;
  min-height: 160px;
  max-height: 260px;
  overflow: auto;
  border: 1px dashed rgba(149, 171, 132, 0.34);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.28);
  padding: 8px;
  color: #e6f0de;
  font: 11px/1.4 Consolas, "Courier New", monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

.tournament-debug-footnote {
  margin: 8px 0 0;
  color: #bcd4af;
  font-size: 12px;
  line-height: 1.35;
}

.tournament-debug-footnote code {
  font: 11px/1.3 Consolas, "Courier New", monospace;
}

@media (max-width: 1040px) {
  .tournament-debug-summary-grid,
  .tournament-debug-log-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .tournament-debug-actions .btn {
    width: 100%;
  }
}

/* Турнирный header: title/date/description со скроллом длинного текста. */
.tournament-head {
  margin: 0 auto 12px;
  border: 1px solid rgba(255, 224, 201, 0.22);
  border-radius: 12px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(22, 18, 16, 0.7), rgba(40, 27, 23, 0.55));
}

.tournament-head-title {
  margin: 0;
  font-size: clamp(30px, 4.2vw, 42px);
  line-height: 1.05;
}

.tournament-head-date {
  margin: 8px 0 0;
  font-size: clamp(19px, 2.8vw, 27px);
  font-weight: 700;
  color: #f2cba4;
}

.tournament-head-date-alt {
  margin: 4px 0 0;
  font-size: clamp(12px, 1.55vw, 15px);
  line-height: 1.35;
  color: #e3c8af;
}

.tournament-head-description-wrap {
  margin-top: 9px;
  border: 1px solid rgba(255, 224, 201, 0.15);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.2);
  max-height: 88px;
  overflow: auto;
}

.tournament-head-description {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #e9d7c8;
}

.tournament-summary-card {
  margin: 0 auto 10px;
  border: 1px solid rgba(255, 224, 201, 0.2);
  border-radius: 12px;
  padding: 10px;
  background: linear-gradient(180deg, rgba(31, 23, 20, 0.64), rgba(45, 31, 26, 0.44));
}

.tournament-summary-card h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.tournament-facts-list {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin: 0;
}

.tournament-facts-item {
  border: 1px solid rgba(255, 224, 201, 0.16);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.18);
  padding: 7px 9px;
}

.tournament-facts-item dt {
  margin: 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #d6b18b;
}

.tournament-facts-item dd {
  margin: 3px 0 0;
  font-size: 14px;
  color: #f4ddc7;
}

.tournament-summary-actions {
  margin: 10px 0 8px;
}

/* BO3-панель карт: порядок карт, победитель каждой карты и ссылки на материалы. */
.tournament-maps-panel {
  margin: 0 auto 10px;
  border: 1px solid rgba(255, 224, 201, 0.2);
  border-radius: 12px;
  padding: 10px;
  background: linear-gradient(180deg, rgba(31, 23, 20, 0.64), rgba(45, 31, 26, 0.44));
}

.tournament-maps-head {
  display: grid;
  gap: 3px;
  margin-bottom: 8px;
}

.tournament-maps-head h3 {
  margin: 0;
  font-size: 18px;
}

.tournament-maps-head p {
  margin: 0;
  font-size: 12px;
}

.tournament-maps-track {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 6px;
  flex-wrap: nowrap;
  overflow: visible;
  padding-bottom: 2px;
}

.tournament-map-order-arrow {
  align-self: center;
  font-size: 22px;
  line-height: 1;
  color: #c9b29f;
  opacity: 0.92;
}

/* Карточка конкретной карты BO3 и её состояния (decider / winner-blue / winner-red). */
.tournament-map-card {
  flex: 0 0 170px;
  border: 1px solid rgba(255, 224, 201, 0.26);
  border-radius: 10px;
  background: rgba(15, 11, 10, 0.36);
  padding: 8px;
  display: grid;
  gap: 5px;
  align-content: start;
}

.tournament-map-card.decider {
  border-color: #f29a3d;
  box-shadow: 0 0 0 1px rgba(242, 154, 61, 0.36) inset;
}

.tournament-map-card.winner-blue {
  border: 3px solid #6ea6d0;
  box-shadow: 0 0 0 1px rgba(110, 166, 208, 0.42) inset, 0 0 14px rgba(47, 86, 118, 0.42);
  background: linear-gradient(180deg, rgba(49, 78, 102, 0.34), rgba(21, 33, 43, 0.5));
}

.tournament-map-card.winner-red {
  border: 3px solid #cf7570;
  box-shadow: 0 0 0 1px rgba(207, 117, 112, 0.42) inset, 0 0 14px rgba(110, 42, 42, 0.42);
  background: linear-gradient(180deg, rgba(103, 43, 41, 0.34), rgba(43, 21, 20, 0.5));
}

.tournament-map-game {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  color: #e8d8c9;
  letter-spacing: 0.01em;
  text-align: center;
}

.tournament-map-card.decider .tournament-map-game {
  color: #ffbe6b;
}

.tournament-map-card.winner-blue .tournament-map-game {
  color: #9bd1ff;
}

.tournament-map-card.winner-red .tournament-map-game {
  color: #ffb4ab;
}

/* Превью карты: изображение, название и маркер победившей стороны. */
.tournament-map-preview {
  border: 1px solid rgba(255, 224, 201, 0.16);
  border-radius: 8px;
  overflow: visible;
  background: rgba(0, 0, 0, 0.26);
}

.tournament-map-preview img {
  width: 100%;
  height: 86px;
  object-fit: cover;
  display: block;
}

.tournament-map-name {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  color: #f4e4d4;
}

.tournament-map-winner {
  min-height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tournament-map-winner.is-empty {
  display: none;
}

.tournament-map-winner-logo {
  width: 56px;
  height: 22px;
  max-width: 100%;
  object-fit: contain;
  display: block;
}

.tournament-map-winner.is-blue .tournament-map-winner-logo {
  filter: drop-shadow(0 0 6px rgba(93, 153, 202, 0.6));
}

.tournament-map-winner.is-red .tournament-map-winner-logo {
  filter: drop-shadow(0 0 6px rgba(214, 103, 97, 0.56));
}

/* Кнопки материалов карты: ссылки на артефакты матча (логи, демо, пр.). */
.tournament-map-materials {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 1px;
}

.tournament-map-material-btn {
  min-width: 0;
  width: 100%;
  justify-content: center;
  padding: 5px 6px;
  font-size: 11px;
}

/* Карта BO3: базовая карточка + модификаторы decider/winner-blue/winner-red. */
.tournament-left,
.tournament-right {
  border: 1px solid #4c4039;
  border-radius: 14px;
  background: rgba(49, 30, 24, 0.35);
  padding: 10px;
}

.tournament-right {
  padding: 10px;
  overflow: visible;
  display: grid;
  gap: 10px;
}

.tournament-layout.has-admin-side {
  grid-template-columns: 1fr;
  align-items: stretch;
}

.tournament-admin-side {
  display: none;
}

.tournament-left h2 {
  margin: 0 0 6px;
}

.tournament-date-time {
  margin: 0 0 10px;
  color: var(--muted);
}

.tournament-image-box {
  border: 1px solid #5e4a3f;
  border-radius: 12px;
  min-height: 140px;
  display: grid;
  place-items: center;
  overflow: visible;
  margin-bottom: 10px;
}

.tournament-page-image {
  max-width: 100%;
  display: block;
  cursor: zoom-in;
}

.tournament-priority-panel {
  border: 1px solid rgba(255, 224, 201, 0.22);
  border-radius: 12px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(22, 18, 16, 0.68), rgba(40, 27, 23, 0.5));
}

.tournament-priority-panel.is-hidden {
  display: none;
}

.tournament-priority-panel h3 {
  margin: 0 0 6px;
  font-size: 18px;
  line-height: 1.2;
}

/* Плавающий admin-side: фиксируем панель управления турниром на desktop. */
.tournament-team-admin-toolbar {
  padding: 0;
}

.tournament-team-admin-toolbar:not(:empty) {
  padding: 2px 0 0;
}

.tournament-layout.has-admin-side .tournament-admin-side:not(:empty) {
  display: block;
  position: fixed;
  top: calc(env(safe-area-inset-top) + 76px);
  left: 12px;
  right: auto;
  width: min(336px, calc(100vw - 24px));
  max-height: calc(100vh - 90px);
  overflow: auto;
  overscroll-behavior: contain;
  z-index: 2705;
  border: 1px solid rgba(255, 224, 201, 0.26);
  border-radius: 12px;
  padding: 10px;
  background: linear-gradient(180deg, rgba(22, 18, 16, 0.96), rgba(33, 24, 20, 0.94));
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
}

/* Редактор слотов состава: select игрока + ручной override ника в slot-editor. */
.slot-player,
.slot-player-sub {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #5f4b40;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
  padding: 7px 8px;
  font: inherit;
}

.tournament-roster {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  gap: 0;
}

.tournament-roster.has-winner .team-col {
  padding-top: 44px;
}

/* Две колонки команд и список слотов roster для BLU/RED. */
.team-col {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding-top: 8px;
}

.team-divider {
  width: 100%;
  background: rgba(255, 224, 201, 0.16);
}

.team {
  border: 0;
  border-radius: 0;
  padding: 9px 10px;
  position: relative;
  min-height: 292px;
  display: flex;
  flex-direction: column;
}

.team-blue {
  background: linear-gradient(180deg, rgba(57, 92, 120, 0.34) 0%, rgba(39, 53, 66, 0.55) 100%);
}

.team-red {
  background: linear-gradient(180deg, rgba(157, 49, 47, 0.34) 0%, rgba(69, 34, 31, 0.58) 100%);
}

.team h3 {
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 56px;
}

.team-head {
  gap: 10px;
}

.team-discord-access {
  min-height: 28px;
  margin: 4px 0 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.team-discord-btn {
  min-width: 104px;
  justify-content: center;
  padding: 4px 10px;
  font-size: 12px;
}

.discord-auth-fallback {
  display: inline;
}

.discord-auth-fallback[hidden] {
  display: none !important;
}

.support-ds-discord-btn {
  width: min(100%, 360px);
  min-width: 280px;
  min-height: 76px;
  padding: 10px 16px;
}

.team-discord-muted {
  font-size: 11px;
}

.team-logo {
  max-width: 78px;
  max-height: 40px;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* Текущий счёт команд и подсветка лидирующей стороны. */
.team-score-pill {
  min-width: 34px;
  padding: 4px 10px 3px;
  border-radius: 999px;
  border: 1px solid rgba(255, 224, 201, 0.34);
  background: rgba(0, 0, 0, 0.26);
  color: #f4e4d4;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
}

.team-score-blue {
  border-color: rgba(115, 172, 216, 0.64);
  color: #d4ecff;
}

.team-score-red {
  border-color: rgba(213, 113, 106, 0.64);
  color: #ffd2ca;
}

.team-score-pill.is-leading {
  box-shadow: 0 0 0 1px rgba(255, 224, 201, 0.28) inset, 0 0 12px rgba(255, 190, 140, 0.2);
}

/* Список слотов состава: класс, ник, replacement-state и ссылки профиля. */
.team ul {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: grid;
  gap: 6px;
  flex: 1 1 auto;
  grid-auto-rows: minmax(30px, auto);
}

/* Конкретный slot ростера: класс, ник, ссылка профиля и replacement-состояния. */
.roster-slot {
  position: relative;
  overflow: visible;
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(255, 224, 201, 0.18);
  border-radius: 8px;
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.18);
}

.slot-class {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid rgba(255, 224, 201, 0.22);
  padding-right: 6px;
  min-height: 24px;
}

.slot-class-indicators {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-width: 0;
}

.roster-online-dot {
  position: absolute;
  right: 1px;
  top: 50%;
  transform: translateY(-50%);
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #d8ffe6 0%, #53de8f 58%, #1f8f4f 100%);
  box-shadow: 0 0 0 1px rgba(26, 94, 55, 0.45), 0 0 6px rgba(83, 222, 143, 0.45);
}

.roster-signup-dot {
  display: inline-block;
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #fff7c1 0%, #ffd54f 60%, #f2a900 100%);
  box-shadow: 0 0 0 1px rgba(122, 88, 14, 0.35), 0 0 5px rgba(255, 213, 79, 0.45);
}

.roster-signup-dot[hidden] {
  display: none;
}

.roster-signup-dot-inline {
  margin-left: 6px;
  vertical-align: middle;
  transform: translateY(-1px);
}

.slot-name {
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding-left: 0;
  font-size: 12px;
  line-height: 1.2;
}

.slot-name-text {
  /* TODO(mobile-roster): Long nicknames still overflow roster rows on narrow viewports.
     Add a dedicated mobile rule to wrap/clamp text safely for /tournament.html and /tournaments/*.html. */
  min-width: 0;
  overflow: visible;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slot-name-stack {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.slot-name-stack .slot-name {
  justify-content: flex-start;
  padding-left: 0;
  min-height: 18px;
}

.slot-class-emblem {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.slot-class-emblem.class-icon-badge {
  min-width: 24px;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 6px;
}

.slot-class-emblem.class-icon-badge .class-icon-img {
  width: 15.6px;
  height: 15.6px;
}

.slot-class-emblem.signup-rank-badge.is-rank-logo.is-rank-mini {
  min-width: 24px;
  width: 24px;
  height: 24px;
}

.slot-class-emblem .signup-rank-logo-class {
  width: 13px;
  height: 13px;
  transform: translate(-50%, -52%);
}

.slot-class-emblem.rank-outline-badge,
.rank-outline-badge.slot-class-emblem {
  min-width: 24px;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 999px;
  position: relative;
  overflow: visible;
}

.slot-class-emblem .signup-rank-badge-text {
  font-size: 10px;
  line-height: 1;
  font-weight: 800;
}

.slot-class-emblem.rank-empty .signup-rank-badge-text {
  display: none;
}

.slot-class-emblem .signup-rank-logo-class-fallback {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 13px;
  height: 13px;
  transform: translate(-50%, -50%);
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.45));
}

.slot-name-original.is-replaced {
  opacity: 0.45;
}

.slot-name-sub {
  color: #ffe2c2;
}

.slot-name-original.is-empty {
  opacity: 0.34;
}

.slot-name-link {
  color: inherit;
  text-decoration: none;
}

.slot-name-link:hover,
.slot-name-link:focus-visible {
  text-decoration: underline;
}

/* TODO: вынести цвета replaced/empty в отдельные CSS-переменные темы. */
/* Inline-редактор слота: подписи полей и группировка select/input. */
.slot-editor {
  display: grid;
  gap: 6px;
  min-width: 0;
  margin-left: 2px;
}

.slot-editor-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 28px;
  align-items: start;
  gap: 6px;
}

.slot-editor-row-sub {
  grid-template-columns: 56px minmax(0, 1fr) 28px;
}

.slot-editor-row-sub[hidden] {
  display: none !important;
}

.slot-editor-label {
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  font-size: 11px;
  line-height: 1;
  color: rgba(255, 224, 201, 0.68);
}

.slot-editor-fields {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.slot-player,
.slot-player-sub {
  min-height: 24px;
  padding: 2px 7px;
  border-radius: 6px;
  border-color: rgba(255, 224, 201, 0.24);
  background: rgba(0, 0, 0, 0.2);
  margin-left: 0;
}

.slot-player-manual,
.slot-player-sub-manual {
  width: 100%;
  min-height: 24px;
  box-sizing: border-box;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid rgba(255, 224, 201, 0.24);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
  font: inherit;
  font-size: 12px;
}

.slot-player-manual::placeholder,
.slot-player-sub-manual::placeholder {
  color: rgba(255, 224, 201, 0.55);
}

/* Двухколоночный layout signup-виджета: слева действия, справа список/очередь. */
.tournament-signup-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.94fr) minmax(0, 1.06fr);
  gap: 10px;
  align-items: start;
}

.tournament-signup-left {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 8px;
}

.tournament-signup-right {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 6px;
  border: 1px solid rgba(255, 224, 201, 0.18);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.14);
  padding: 8px;
}

.tournament-signup-right.is-replacements-mode {
  gap: 4px;
  padding: 6px 7px;
}

.tournament-signup-list-wrap {
  min-height: 0;
  max-height: 296px;
  overflow: auto;
  padding-right: 2px;
}

.tournament-signup-list-wrap.is-replacements-mode {
  max-height: 228px;
  padding-right: 0;
}

.tournament-signup-list-wrap > .muted {
  margin: 0;
}

.tournament-signup-actions {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.tournament-signup-actions .btn,
.tournament-link-editor-actions .btn {
  min-width: 168px;
  justify-content: center;
}

/* Опасное админ-действие: принудительное завершение signup-пула. */
.tournament-signup-admin-finish-btn {
  border-color: rgba(214, 92, 84, 0.65);
  background: linear-gradient(180deg, rgba(104, 34, 30, 0.46), rgba(74, 26, 24, 0.52));
}

.tournament-signup-admin-finish-btn:hover,
.tournament-signup-admin-finish-btn:focus-visible {
  border-color: rgba(241, 129, 118, 0.85);
}

.tournament-signup-priority {
  display: grid;
  gap: 4px;
}

.tournament-finished-links {
  margin-top: 2px;
}

.tournament-finished-link-btn {
  min-width: 120px;
  justify-content: center;
}

.tournament-finished-link-btn.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Редактор ссылок материалов/карт (логи, демки, победители) для админов турнира. */
.tournament-link-editor {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.tournament-link-editor-field {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}

.tournament-link-editor-field input {
  width: 100%;
  min-height: 34px;
  border: 1px solid rgba(255, 224, 201, 0.26);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.24);
  color: var(--text);
  padding: 7px 10px;
  font-size: 13px;
}

.tournament-link-editor-field textarea {
  width: 100%;
  min-height: 72px;
  border: 1px solid rgba(255, 224, 201, 0.26);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.24);
  color: var(--text);
  padding: 7px 10px;
  font-size: 13px;
  font: inherit;
  line-height: 1.4;
  resize: vertical;
}

.tournament-link-editor-field select {
  width: 100%;
  min-height: 34px;
  border: 1px solid rgba(255, 224, 201, 0.26);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.24);
  color: var(--text);
  padding: 7px 10px;
  font-size: 13px;
}

.tournament-link-editor-field input:focus-visible {
  outline: 2px solid rgba(255, 186, 130, 0.6);
  outline-offset: 1px;
}

.tournament-link-editor-field textarea:focus-visible {
  outline: 2px solid rgba(255, 186, 130, 0.6);
  outline-offset: 1px;
}

.tournament-link-editor-field select:focus-visible {
  outline: 2px solid rgba(255, 186, 130, 0.6);
  outline-offset: 1px;
}

/* Редактор ссылок/карт: fields + map-material cards + save-actions. */
.tournament-rank-range-editor {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

/* Админ-редактор BO3: выбор карт, победителей и материалов матча. */
.tournament-map-editor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.tournament-map-winner-editor-grid {
  margin-top: 4px;
}

.tournament-map-material-editor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.tournament-map-material-editor-card {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(255, 224, 201, 0.16);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.16);
  padding: 8px;
  align-content: start;
}

.tournament-map-material-editor-title {
  margin: 0;
  font-size: 12px;
  color: var(--text);
}

.tournament-link-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.tournament-links-save-btn {
  min-width: 168px;
}

.tournament-admin-reward-slots-field {
  gap: 8px;
}

.tournament-admin-reward-slots-field summary {
  cursor: pointer;
  list-style: none;
  color: #ccb9aa;
  font-size: 12px;
}

.tournament-admin-reward-slots-field summary::-webkit-details-marker {
  display: none;
}

.tournament-admin-reward-slots-field[open] summary {
  color: #f4ddca;
}

.tournament-admin-reward-slots-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tournament-admin-reward-open-manager-btn {
  min-width: 0;
  padding: 4px 8px;
  font-size: 12px;
  white-space: nowrap;
}

.tournament-admin-reward-slots-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.tournament-admin-reward-slot-card {
  position: relative;
  display: grid;
  gap: 4px;
  justify-items: center;
  border: 1px solid rgba(255, 224, 201, 0.2);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  padding: 6px 5px 8px;
  min-height: 108px;
  cursor: pointer;
}

.tournament-admin-reward-slot-card:hover,
.tournament-admin-reward-slot-card:focus-visible {
  border-color: rgba(255, 186, 130, 0.5);
  background: rgba(54, 36, 29, 0.65);
}

.tournament-admin-reward-slot-card img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border: 1px solid rgba(255, 224, 201, 0.18);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
}

.tournament-admin-reward-slot-class {
  font-size: 11px;
  color: #ccb9aa;
}

.tournament-admin-reward-slot-name {
  width: 100%;
  font-size: 11px;
  line-height: 1.25;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tournament-admin-reward-slot-plus {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed rgba(255, 224, 201, 0.28);
  background: rgba(255, 255, 255, 0.03);
  font-size: 24px;
  line-height: 1;
  color: #f1d8c7;
}

.tournament-admin-reward-slot-card.is-empty .tournament-admin-reward-slot-name {
  color: #ccb9aa;
}

.tournament-admin-reward-slot-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 20px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  border: 1px solid rgba(255, 224, 201, 0.28);
  background: rgba(12, 11, 11, 0.76);
  font-size: 11px;
  line-height: 16px;
}

.tournament-admin-reward-slots-msg {
  margin: 0;
  font-size: 12px;
  color: #ccb9aa;
}

.tournament-admin-reward-slots-msg.is-error {
  color: #ffaeae;
}

.tournament-admin-reward-picker {
  position: fixed;
  inset: 0;
  z-index: 2810;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 72px 12px 12px;
  background: rgba(6, 6, 6, 0.66);
}

.tournament-admin-reward-picker.is-open {
  display: flex;
}

.tournament-admin-reward-picker-dialog {
  width: min(560px, calc(100vw - 24px));
  border: 1px solid rgba(255, 224, 201, 0.24);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(33, 20, 15, 0.98), rgba(23, 16, 13, 0.98));
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.tournament-admin-reward-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tournament-admin-reward-picker-head p {
  margin: 0;
  font-size: 14px;
  color: #ccb9aa;
}

.tournament-admin-reward-picker-search {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: #ccb9aa;
}

.tournament-admin-reward-picker-search input {
  width: 100%;
  min-height: 34px;
  border: 1px solid rgba(255, 224, 201, 0.26);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.24);
  color: var(--text);
  padding: 7px 10px;
  font-size: 13px;
}

.tournament-admin-reward-picker-results {
  border: 1px solid rgba(255, 224, 201, 0.18);
  border-radius: 10px;
  background: rgba(255, 224, 201, 0.03);
  max-height: min(50vh, 320px);
  overflow-y: auto;
  display: none;
}

.tournament-admin-reward-picker-results.is-open {
  display: block;
}

.tournament-admin-reward-picker-row {
  width: 100%;
  border: none;
  border-bottom: 1px solid rgba(255, 224, 201, 0.12);
  background: transparent;
  color: var(--text);
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  grid-template-areas:
    "img main"
    "img sub";
  gap: 2px 9px;
  align-items: center;
  text-align: left;
  padding: 8px 10px;
  cursor: pointer;
}

.tournament-admin-reward-picker-row:last-child {
  border-bottom: none;
}

.tournament-admin-reward-picker-row:hover,
.tournament-admin-reward-picker-row:focus-visible {
  background: rgba(255, 224, 201, 0.08);
}

.tournament-admin-reward-picker-row img,
.tournament-admin-reward-picker-noimg {
  grid-area: img;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  border: 1px solid rgba(255, 224, 201, 0.18);
  background: rgba(0, 0, 0, 0.3);
  object-fit: contain;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ccb9aa;
  font-size: 12px;
}

.tournament-admin-reward-picker-main {
  grid-area: main;
  font-size: 14px;
  line-height: 1.28;
}

.tournament-admin-reward-picker-sub {
  grid-area: sub;
  font-size: 12px;
  color: #ccb9aa;
}

.tournament-admin-reward-picker-empty {
  margin: 0;
  padding: 10px;
  font-size: 12px;
  color: #ccb9aa;
}

@media (max-width: 540px) {
  .tournament-admin-reward-slots-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tournament-admin-reward-slots-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .tournament-admin-reward-open-manager-btn {
    width: 100%;
    justify-content: center;
  }
}

.slot-sub-toggle-btn {
  min-width: 28px;
  width: 28px;
  min-height: 24px;
  height: 24px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px solid rgba(255, 224, 201, 0.22);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 16px;
  line-height: 1;
}

.slot-sub-toggle-btn.is-expanded {
  background: rgba(255, 224, 201, 0.1);
}

.tournament-balance-preview-card {
  margin-top: 12px;
  display: grid;
  gap: 10px;
  border: 1px solid rgba(255, 224, 201, 0.18);
  border-radius: 10px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.16);
}

.tournament-balance-preview-card.is-active {
  border-color: rgba(255, 186, 130, 0.34);
  background: linear-gradient(180deg, rgba(40, 28, 21, 0.5), rgba(0, 0, 0, 0.16));
}

.tournament-balance-preview-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}

.tournament-balance-preview-head h3 {
  margin: 0;
  font-size: 17px;
}

.tournament-balance-preview-subtitle,
.tournament-balance-preview-summary,
.tournament-balance-preview-title,
.tournament-balance-preview-dirty,
.tournament-balance-preview-error {
  margin: 0;
}

.tournament-balance-preview-subtitle {
  color: var(--muted);
  font-size: 12px;
}

.tournament-balance-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.tournament-balance-preview-actions .btn {
  min-width: 0;
}

.tournament-balance-preview-actions .btn.is-loading {
  opacity: 0.9;
  cursor: wait;
}

.tournament-balance-preview-progress {
  display: grid;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 224, 201, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.tournament-balance-preview-progress.is-loading {
  border-color: rgba(255, 186, 130, 0.34);
}

.tournament-balance-preview-progress.is-complete {
  border-color: rgba(156, 255, 186, 0.2);
}

.tournament-balance-preview-progress.is-error {
  border-color: rgba(255, 120, 120, 0.26);
  background: rgba(120, 24, 24, 0.16);
}

.tournament-balance-preview-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.tournament-balance-preview-progress-bar {
  position: relative;
  overflow: visible;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.tournament-balance-preview-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(255, 186, 130, 0.85), rgba(255, 224, 201, 0.95));
  transition: width 0.2s ease;
}

.tournament-balance-preview-progress.is-complete .tournament-balance-preview-progress-bar span {
  background: linear-gradient(90deg, rgba(134, 223, 159, 0.86), rgba(195, 255, 209, 0.96));
}

.tournament-balance-preview-progress.is-error .tournament-balance-preview-progress-bar span {
  background: linear-gradient(90deg, rgba(255, 120, 120, 0.85), rgba(255, 176, 176, 0.95));
}

.tournament-balance-preview-progress-note {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: #ffbdbd;
}

.tournament-balance-preview-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tournament-balance-preview-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 224, 201, 0.18);
  border-radius: 999px;
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
}

.tournament-balance-preview-summary {
  color: var(--text);
  line-height: 1.45;
}

.tournament-balance-preview-section {
  display: grid;
  gap: 6px;
}

.tournament-balance-preview-title {
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-transform: uppercase;
}

.tournament-balance-preview-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 5px;
}

.tournament-balance-preview-list.is-compact {
  gap: 4px;
}

.tournament-balance-preview-dirty {
  color: #ffcc8f;
  font-size: 12px;
}

.tournament-balance-preview-error {
  color: #ffb3b3;
  font-size: 12px;
  line-height: 1.45;
}

/* Список игроков в signup: карточки с метой, рангами и assign-controls. */
.tournament-signup-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  font-size: 13px;
}

.tournament-signup-list li {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(255, 224, 201, 0.16);
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(62, 40, 33, 0.42) 0%, rgba(54, 39, 35, 0.34) 100%);
  padding: 8px 10px;
}

.tournament-signup-list li:hover {
  border-color: rgba(255, 224, 201, 0.28);
  background: linear-gradient(90deg, rgba(70, 46, 38, 0.46) 0%, rgba(60, 43, 39, 0.4) 100%);
}

.tournament-signup-cell-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.tournament-signup-cell-index {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(255, 224, 201, 0.3);
  background: rgba(255, 224, 201, 0.08);
  color: #f3ddc7;
  font-weight: 700;
  font-size: 11px;
}

/* Ссылка на игрока в signup-очереди с поддержкой длинных никнеймов. */
.tournament-signup-player-link {
  min-width: 0;
  font-size: 14px;
  font-weight: 700;
  color: #ffe0c4;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.tournament-signup-player-main {
  min-width: 0;
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tournament-signup-player-head-rank.signup-rank-badge.is-rank-logo.is-rank-mini {
  min-width: 28px;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
}

.tournament-signup-player-link:hover,
.tournament-signup-player-link:focus-visible {
  color: #ffd8aa;
  text-decoration: underline;
}

.tournament-signup-assign-controls {
  margin-top: 6px;
  display: grid;
  gap: 5px;
}

.tournament-signup-assign-state {
  font-size: 11px;
  color: #d6c7bb;
}

.tournament-signup-assign-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.tournament-signup-assign-class {
  flex: 1 1 132px;
  min-width: 0;
  min-height: 30px;
  border: 1px solid rgba(255, 224, 201, 0.26);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.24);
  color: var(--text);
  padding: 5px 8px;
  font-size: 12px;
}

.tournament-signup-assign-btn {
  min-width: 92px;
  padding: 5px 10px;
  font-size: 12px;
  justify-content: center;
}

.tournament-signup-player-meta,
.tournament-signup-player-time {
  font-size: 11px;
  line-height: 1.3;
  color: var(--muted);
}

.tournament-signup-player-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: center;
}

.tournament-signup-player-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  align-items: center;
}

/* Группы метаданных signup-строки: время, роль, ранг и иконки. */
.signup-meta-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.signup-meta-group-role {
  gap: 6px;
}

/* Мини-рендер рангов в signup-метаданных: компактные logo-бейджи. */
/* Compact rank style for dense player meta blocks (signup list). */
.signup-meta-group-role .signup-rank-badge.is-rank-logo.is-rank-mini {
  min-width: 30px;
  width: 30px;
  height: 30px;
}

.signup-rank-pair {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.signup-rank-separator {
  color: #c8b7a8;
  line-height: 1;
}

/* Полноразмерный signup-rank: base-logo, class-overlay и римский индекс. */
.signup-rank-badge {
  min-width: 30px;
  height: 24px;
  padding: 0 8px;
  font-size: 12px;
}

.signup-rank-badge.is-rank-logo {
  min-width: 52px;
  width: 52px;
  height: 46px;
  padding: 0;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

.signup-rank-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transform: scale(var(--signup-rank-size-scale, 1));
  transform-origin: center;
  filter:
    drop-shadow(0 0 calc(1px + var(--rank-glow-size, 0px) * 0.2) rgba(var(--rank-glow-rgb, 255, 240, 220), calc(var(--rank-glow-strength, 0) + 0.01)))
    drop-shadow(0 0 calc(2px + var(--rank-glow-size, 0px) * 0.5) rgba(var(--rank-glow-rgb, 255, 240, 220), calc(var(--rank-glow-strength, 0) * 0.62)));
}

.signup-rank-logo-class {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  transform: translate(-50%, -58%);
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.45));
}

.signup-rank-badge.is-rank-logo.is-rank-mini .signup-rank-logo-class {
  width: 13px;
  height: 13px;
  transform: translate(-50%, -50%);
}

.signup-rank-logo-roman {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4px;
  text-align: center;
  font-family: "Freshid Condensed", "Russo One", "Golos Text", sans-serif;
  font-size: 14px;
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.01em;
  color: var(--rank-roman-color, #fdd7bb);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.signup-rank-logo-roman.len-2 {
  font-size: 13px;
}

.signup-rank-logo-roman.len-3 {
  font-size: 12px;
}

.signup-rank-logo-roman.len-4 {
  font-size: 11px;
}

.signup-rank-badge.is-rank-logo.rank-11 { --signup-rank-size-scale: 1; }
.signup-rank-badge.is-rank-logo.rank-10 { --signup-rank-size-scale: 1.02; }
.signup-rank-badge.is-rank-logo.rank-9 { --signup-rank-size-scale: 1.04; }
.signup-rank-badge.is-rank-logo.rank-8 { --signup-rank-size-scale: 1.06; }
.signup-rank-badge.is-rank-logo.rank-7 { --signup-rank-size-scale: 1.08; }
.signup-rank-badge.is-rank-logo.rank-6 { --signup-rank-size-scale: 1.10; }
.signup-rank-badge.is-rank-logo.rank-5 { --signup-rank-size-scale: 1.12; }
.signup-rank-badge.is-rank-logo.rank-4 { --signup-rank-size-scale: 1.14; }
.signup-rank-badge.is-rank-logo.rank-3 { --signup-rank-size-scale: 1.16; }
.signup-rank-badge.is-rank-logo.rank-2 { --signup-rank-size-scale: 1.18; }
.signup-rank-badge.is-rank-logo.rank-1 { --signup-rank-size-scale: 1.20; }

.signup-rank-badge.is-rank-logo.rank-7 { --rank-roman-color: #1d1d1d; }
.signup-rank-badge.is-rank-logo.rank-8 { --rank-roman-color: #1d1d1d; }
.signup-rank-badge.is-rank-logo.rank-11 .signup-rank-logo-roman { display: none; }

/* Signup rank badges: mini/full варианты и слой class-icon поверх base-logo. */
.signup-meta-label {
  color: #c8b7a8;
}

.signup-meta-icons {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

/* Базовая CTA-кнопка signup; модификаторы ниже задают leave/locked/closed состояния. */
.tournament-signup-btn {
  padding: 9px 20px;
  font-size: 15px;
  font-weight: 700;
  color: #2d1407;
  border-color: #f09a3f;
  background: linear-gradient(180deg, #ffbc61, #ef8d2f);
  box-shadow: 0 2px 0 rgba(111, 46, 9, 0.35);
}

.tournament-signup-btn:hover,
.tournament-signup-btn:focus-visible {
  color: #2d1407;
  border-color: #ffcb7d;
  background: linear-gradient(180deg, #ffd08d, #f09b3a);
}

.tournament-signup-btn.tournament-signup-leave {
  color: #f6d8d6;
  border-color: #8f3a34;
  background: linear-gradient(180deg, #5e1f1c, #3f1412);
  box-shadow: 0 2px 0 rgba(24, 7, 7, 0.45);
}

.tournament-signup-btn.tournament-signup-leave:hover,
.tournament-signup-btn.tournament-signup-leave:focus-visible {
  color: #ffe8e5;
  border-color: #a84a43;
  background: linear-gradient(180deg, #722724, #4f1917);
}

.tournament-signup-btn.tournament-signup-rank-locked {
  color: #e7d9ca;
  border-color: rgba(137, 125, 114, 0.9);
  background: linear-gradient(180deg, #3a3530, #2a2622);
  box-shadow: none;
}

.tournament-signup-btn.tournament-signup-closed {
  color: #e7d9ca;
  border-color: rgba(137, 125, 114, 0.9);
  background: linear-gradient(180deg, #3a3530, #2a2622);
  box-shadow: none;
}

.tournament-signup-btn.tournament-signup-rank-locked:disabled {
  opacity: 1;
}

.tournament-signup-btn.tournament-signup-closed:disabled {
  opacity: 1;
}

#tournament-signup-widget .muted {
  font-size: 13px;
  line-height: 1.35;
}

#tournament-signup-widget h4 {
  margin: 0;
  font-size: 15px;
}

/* Служебные статусы signup: мест осталось, open/closed, feedback и ban-сообщение. */
.tournament-slots-left {
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 700;
}

.tournament-slots-left.open {
  color: #9de7bb;
}

.tournament-slots-left.full {
  color: #ff8585;
}

.tournament-signup-state {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.tournament-signup-state.open {
  color: #9de7bb;
}

.tournament-signup-state.closed {
  color: #ff8585;
}

.tournament-start-info {
  margin: 0;
  font-size: 13px;
  color: #d8cdc0;
}

.tournament-start-info.near {
  color: #ffd28a;
}

.tournament-signup-feedback {
  margin: 2px 0 0;
  font-size: 12px;
  line-height: 1.35;
  color: #d7cfc3;
}

.tournament-signup-feedback.ok {
  color: #9de7bb;
}

.tournament-signup-feedback.warn {
  color: #ffb58f;
}

.tournament-signup-feedback:empty {
  display: none;
}

.tournament-signup-ban-msg {
  display: none;
  margin: 6px 0 0;
  color: #ffd6a8;
}

.tournament-signup-ban-msg.active {
  display: block;
}

/* Поповер точечной замены слота (main/sub) рядом с конкретной позицией состава. */
.slot-replacement-popover-wrap {
  position: absolute;
  top: 50%;
  z-index: 8;
  transform: translateY(-50%);
}

.slot-replacement-popover-wrap.team-blue {
  left: 52px;
}

.slot-replacement-popover-wrap.team-red {
  right: 6px;
}

.slot-replacement-popover-wrap.is-hidden {
  display: none;
}

/* Кнопка открытия/закрытия popover точечной замены слота. */
.slot-replacement-popover-toggle.btn {
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  color: #f6dfc3;
  border-color: rgba(163, 124, 85, 0.68);
  background: linear-gradient(180deg, rgba(65, 44, 33, 0.96), rgba(46, 31, 24, 0.96));
  box-shadow: 0 1px 0 rgba(12, 8, 6, 0.34);
}

.slot-replacement-popover-toggle.btn:hover,
.slot-replacement-popover-toggle.btn:focus-visible {
  color: #ffebd2;
  border-color: rgba(216, 167, 118, 0.95);
}

.slot-replacement-popover-toggle.btn.is-disabled,
.slot-replacement-popover-toggle.btn:disabled {
  color: rgba(213, 193, 168, 0.72);
  border-color: rgba(117, 98, 80, 0.72);
  background: linear-gradient(180deg, rgba(56, 49, 43, 0.95), rgba(42, 36, 32, 0.95));
  box-shadow: none;
  cursor: not-allowed;
  opacity: 1;
}

.slot-replacement-popover {
  position: absolute;
  top: 50%;
  min-width: 130px;
  display: none;
  gap: 4px;
  padding: 6px;
  border: 1px solid rgba(255, 224, 201, 0.28);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(30, 19, 15, 0.98), rgba(24, 16, 13, 0.98));
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.45);
}

.slot-replacement-popover-wrap.team-blue .slot-replacement-popover {
  right: calc(100% + 8px);
  transform: translateY(-50%);
}

.slot-replacement-popover-wrap.team-red .slot-replacement-popover {
  left: calc(100% + 8px);
  transform: translateY(-50%);
}

.slot-replacement-popover-wrap.is-open .slot-replacement-popover {
  display: grid;
}

/* Кнопки отправки replacement-запросов из popover-панели слота. */
.slot-replacement-request-btn.btn {
  min-height: 24px;
  padding: 4px 8px;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #f2dcc2;
  border-color: rgba(162, 127, 94, 0.72);
  background: linear-gradient(180deg, rgba(67, 46, 35, 0.96), rgba(47, 33, 25, 0.96));
}

.slot-replacement-request-btn.btn:hover,
.slot-replacement-request-btn.btn:focus-visible {
  color: #ffebd0;
  border-color: rgba(214, 166, 113, 0.96);
}

.slot-replacement-request-btn.btn.is-disabled,
.slot-replacement-request-btn.btn:disabled {
  color: rgba(214, 194, 170, 0.78);
  border-color: rgba(116, 96, 80, 0.75);
  background: linear-gradient(180deg, rgba(56, 48, 42, 0.95), rgba(41, 35, 31, 0.95));
  box-shadow: none;
  cursor: not-allowed;
  opacity: 1;
}

.slot-replacement-request-btn.btn.is-hidden {
  display: none;
}

/* В админ-режиме поповеры замен смещаются наружу, чтобы не перекрывать слот. */
.slot-replacement-popover-wrap.is-admin {
  top: 50%;
  transform: translateY(-50%);
}

.slot-replacement-popover-wrap.is-admin.team-blue {
  left: 0;
  transform: translate(-108%, -50%);
}

.slot-replacement-popover-wrap.is-admin.team-red {
  right: 0;
  transform: translate(108%, -50%);
}

.slot-replacement-popover-wrap.is-admin.team-blue .slot-replacement-popover {
  left: calc(100% + 8px);
  right: auto;
}

.slot-replacement-popover-wrap.is-admin.team-red .slot-replacement-popover {
  right: calc(100% + 8px);
  left: auto;
}

/* Лента replacement-заявок: открытые карточки с кандидатами и action-кнопками. */
.tournament-replacements-list {
  display: grid;
  gap: 5px;
}

.tournament-replacement-card {
  border: 1px solid rgba(126, 108, 93, 0.8);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(52, 37, 29, 0.96), rgba(37, 27, 22, 0.96));
  padding: 6px 7px;
}

.tournament-replacement-card.team-blue {
  border-color: rgba(94, 155, 219, 0.82);
  box-shadow: inset 0 0 0 1px rgba(48, 89, 136, 0.35);
}

.tournament-replacement-card.team-red {
  border-color: rgba(211, 112, 104, 0.82);
  box-shadow: inset 0 0 0 1px rgba(132, 55, 49, 0.35);
}

/* Карточка replacement-запроса: header, meta, кандидаты и action-кнопки. */
.tournament-replacement-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
}

.tournament-replacement-class {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 700;
}

.tournament-replacement-team {
  font-size: 11px;
  color: #d4c2af;
}

.tournament-replacement-meta {
  margin: 0 0 6px;
  font-size: 11px;
  color: #c7b8aa;
}

/* Action-ряд replacement-карточки: join/close + действия по кандидатам. */
.tournament-replacement-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 5px;
}

.tournament-replacement-candidates {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 4px;
}

.tournament-replacement-candidate {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  border: 1px solid rgba(121, 103, 88, 0.62);
  border-radius: 6px;
  padding: 4px 6px;
  background: rgba(29, 20, 16, 0.52);
}

.tournament-replacement-candidate-name {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #f0dfca;
}

.tournament-replacement-candidate-time {
  font-size: 10px;
  color: #bcae9f;
}

/* Встроенная версия чата турнира внутри signup/replacement карточек. */
.tournament-replacement-card p {
  margin: 0;
}

.tournament-replacement-card .muted {
  margin: 0;
  line-height: 1.25;
}

.tournament-replacement-join-btn.btn {
  min-height: 28px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 700;
  color: #2d1407;
  border-color: #f09a3f;
  background: linear-gradient(180deg, #ffbc61, #ef8d2f);
  box-shadow: 0 2px 0 rgba(111, 46, 9, 0.35);
}

.tournament-replacement-join-btn.btn:hover,
.tournament-replacement-join-btn.btn:focus-visible {
  color: #2d1407;
  border-color: #ffcb7d;
  background: linear-gradient(180deg, #ffd08d, #f09b3a);
}

.tournament-replacement-close-btn.btn {
  min-height: 28px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  border-color: rgba(214, 92, 84, 0.65);
  background: linear-gradient(180deg, rgba(104, 34, 30, 0.46), rgba(74, 26, 24, 0.52));
  color: #ffd7cf;
}

.tournament-replacement-close-btn.btn:hover,
.tournament-replacement-close-btn.btn:focus-visible {
  border-color: rgba(241, 129, 118, 0.85);
  color: #ffe5df;
}

.tournament-chat-card .chat-message {
  padding: 4px 6px;
}

.tournament-chat-card .chat-message-head {
  margin-bottom: 2px;
}

.tournament-chat-card .chat-message-head strong,
.tournament-chat-card .chat-user-link {
  font-size: 13px;
}

.tournament-chat-card .chat-message-head time {
  font-size: 10px;
}

.tournament-chat-card .chat-message p {
  font-size: 12px;
  line-height: 1.3;
}

.tournament-chat-card .chat-form-row {
  margin-top: 4px;
  font-size: 12px;
  gap: 8px;
}

/* Модалка подтверждения signup с обязательным чекбоксом пользовательского согласия. */
.tournament-signup-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.58);
  display: grid;
  place-items: center;
  z-index: 2900;
  padding: 14px;
}

.tournament-signup-confirm-modal {
  width: min(96vw, 520px);
  border: 1px solid #5c4639;
  border-radius: 12px;
  background: linear-gradient(100deg, rgba(58, 35, 28, 0.96), rgba(36, 24, 20, 0.96));
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  padding: 14px;
}

.tournament-signup-confirm-modal h4 {
  margin: 0 0 8px;
  font-size: 21px;
}

.tournament-signup-confirm-modal p {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.45;
}

.tournament-signup-confirm-check {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.4;
  margin: 0 0 12px;
}

.tournament-signup-confirm-check input {
  margin-top: 3px;
}

.tournament-signup-confirm-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* Нижний layout турнира: крупный signup-блок + вторичные панели. */
.tournament-bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: 12px;
  margin-top: 12px;
}

.tournament-secondary-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 12px;
}

/* Турнирные layout-grids нижней части: primary/secondary колонки. */
.team.winner {
  box-shadow: inset 0 0 0 3px #36e343;
}

.team-win-badge {
  position: absolute;
  left: 50%;
  top: 8px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 18px;
  line-height: 1;
  background: rgba(54, 227, 67, 0.14);
  border: 2px solid #36e343;
  color: #36e343;
  font-weight: 800;
  z-index: 3;
}

@media (max-width: 640px) {
  .tournament-replacement-candidate {
    align-items: flex-start;
    flex-direction: column;
  }

  .slot-replacement-popover-wrap.team-blue,
  .slot-replacement-popover-wrap.team-red {
    left: auto;
    right: 6px;
  }

  .slot-replacement-popover-wrap.team-blue .slot-replacement-popover,
  .slot-replacement-popover-wrap.team-red .slot-replacement-popover {
    left: auto;
    right: 0;
    top: calc(100% + 6px);
    transform: none;
  }
}

.image-viewer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.86);
  display: grid;
  place-items: center;
  z-index: 3000;
  padding: 16px;
  cursor: zoom-out;
}

.image-viewer-img {
  max-width: 95vw;
  max-height: 95vh;
}

/* Список турниров/CMS: карточки upcoming/past, коллапсы и редактор карточки турнира. */
main.tournaments-host {
  max-width: calc(var(--site-content-track-width) + (var(--site-shell-inline-padding) * 2));
}

.tournaments-cms {
  display: grid;
  gap: 14px;
}

.tournaments-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  padding: 10px;
  border: 1px solid #4c4039;
  border-radius: 12px;
  background: rgba(50, 33, 27, 0.35);
}

.tournaments-tz {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.tournaments-tz select {
  border: 1px solid #5f4b40;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
  padding: 6px 8px;
  font: inherit;
}

.tournaments-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}

.tournaments-list > * {
  grid-column: 1 / -1;
}

.tournaments-list > .tournament-card.tournament-card-upcoming-sat {
  grid-column: 1;
}

.tournaments-list > .tournament-card.tournament-card-upcoming-sun {
  grid-column: 2;
}

.tournaments-list.tournaments-list-single-upcoming > .tournament-card.upcoming {
  grid-column: 1 / -1;
  justify-self: center;
  width: min(560px, 100%);
}

.tournaments-section-title {
  margin: 8px 0 4px;
  font-family: "Russo One", "Golos Text", sans-serif;
  font-size: clamp(18px, 1.8vw, 30px);
}

.tournaments-section-title.upcoming {
  color: #ffe6cf;
  text-shadow: 0 0 10px rgba(255, 205, 154, 0.12);
}

.tournaments-section-title.past {
  color: #c9b6a5;
}

.tournaments-divider {
  border: 0;
  border-top: 1px solid #4c4039;
  margin: 8px 0;
}

/* Сворачиваемые группы в CMS-списке турниров (разделение upcoming/past). */
.tournaments-collapsible-group {
  border: 1px solid rgba(113, 88, 70, 0.55);
  border-radius: 12px;
  background: rgba(33, 24, 20, 0.3);
  padding: 2px 8px 10px;
}

.tournaments-collapsible-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 7px 2px 6px;
  cursor: pointer;
  color: #dfc5ae;
  font-family: "Russo One", "Golos Text", sans-serif;
  font-size: clamp(14px, 1.2vw, 18px);
  list-style: none;
}

.tournaments-collapsible-summary::-webkit-details-marker {
  display: none;
}

.tournaments-collapsible-summary::before {
  content: "▸";
  color: #cfb08f;
  font-size: 0.9em;
  line-height: 1;
  transform-origin: center;
  transition: transform 0.18s ease;
}

/* CMS-collapsible: раскрытие секций турниров через details/summary. */
.tournaments-collapsible-group[open] > .tournaments-collapsible-summary::before {
  transform: rotate(90deg);
}

.tournaments-collapsible-body {
  display: grid;
  gap: 10px;
}

.tournaments-past-group {
  border-color: rgba(98, 84, 74, 0.72);
  background: rgba(31, 24, 22, 0.36);
}

.tournaments-past-summary {
  color: #d6bfaa;
}

/* Карточки в CMS-списке: разделение upcoming/past с отдельной визуальной семантикой. */
.tournament-card {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  border: 1px solid #4c4039;
  border-radius: 12px;
  padding: 9px;
  background: linear-gradient(90deg, rgba(59, 42, 32, 0.3) 0%, rgba(61, 57, 56, 0.28) 100%);
}

.tournament-card.upcoming {
  border-color: rgba(241, 185, 132, 0.48);
  background: linear-gradient(90deg, rgba(76, 51, 38, 0.42) 0%, rgba(73, 63, 57, 0.38) 100%);
  box-shadow: 0 0 0 1px rgba(255, 202, 150, 0.12) inset;
}

.tournament-card.past {
  border-color: rgba(88, 76, 67, 0.75);
  background: linear-gradient(90deg, rgba(43, 35, 30, 0.44) 0%, rgba(40, 38, 36, 0.42) 100%);
}

.tournament-card.upcoming .tournament-info h3 {
  color: #ffe8d4;
}

.tournament-card.upcoming .muted {
  color: #e2cbb7;
}

.tournament-card.past .tournament-info h3 {
  color: #dfc5ae;
}

.tournament-card.past .muted {
  color: #b8a899;
}

.tournament-card.past .tournament-description {
  color: #cab7a7;
}

.tournament-card .tournament-info {
  grid-column: 1;
  align-self: start;
}

.tournaments-cms .tournament-card,
.tournaments-cms .tournament-card p,
.tournaments-cms .tournament-card .muted {
  font-size: 0.99em;
}

.tournament-card .tournament-info h3 {
  margin: 0 0 4px;
  font-size: 0.99em;
}

.tournament-description {
  margin: 6px 0 0;
}

.tournament-side-panel {
  grid-column: 2;
  display: grid;
  gap: 6px;
  align-self: start;
}

.tournament-card-maps-row {
  grid-column: 1 / -1;
  margin-top: 2px;
}

.tournament-card-prize-row {
  grid-column: 1 / -1;
  margin-top: 2px;
}

/* Метаданные карточки турнира: дата, формат, режимы и сопутствующие атрибуты. */
.tournament-meta-item {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(113, 88, 70, 0.55);
  border-radius: 10px;
  background: rgba(32, 24, 20, 0.34);
}

.tournament-meta-label {
  font-size: 0.72em;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #cfb08f;
}

.tournament-meta-value {
  font-size: 0.94em;
  font-weight: 600;
  color: #ffe8d0;
}

/* Превью-набор карточки: class rewards, prize strip и мини-карты BO3. */
.tournament-list-reward-icons {
  --tournament-reward-badge-size: 40px;
  --tournament-reward-icon-size: 24px;
  --tournament-prize-strip-height: 44px;
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 4px;
  align-items: center;
  justify-items: center;
  grid-auto-rows: var(--tournament-reward-badge-size);
  min-height: var(--tournament-reward-badge-size);
  padding-inline: 1px;
  padding-bottom: 2px;
}

.tournament-list-reward-icon {
  width: 100%;
  height: var(--tournament-reward-badge-size);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tournament-reward-badge-size);
}

.tournament-list-reward-icon .class-icon-badge.is-reward-strip {
  width: var(--tournament-reward-badge-size);
  height: var(--tournament-reward-badge-size);
  border-radius: 10px;
}

.tournament-list-reward-icon .class-icon-badge.is-reward-strip .class-icon-img {
  width: var(--tournament-reward-icon-size);
  height: var(--tournament-reward-icon-size);
}

/* Лента призов: кликабельный контейнер изображения призового набора. */
.tournament-prize-image-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: var(--tournament-prize-strip-height);
  height: var(--tournament-prize-strip-height);
  border-radius: 10px;
  overflow: visible;
  background: rgba(18, 13, 11, 0.45);
  padding: 2px 0;
  box-sizing: border-box;
}

.tournament-prize-image {
  display: block;
  width: 100%;
  min-width: 0;
  height: 100%;
  object-fit: contain;
  border: 1px solid #5e4a3f;
  border-radius: 10px;
  box-sizing: border-box;
  margin: 0;
}

/* Мини-превью пула карт BO3 в CMS-карточке турнира. */
.tournament-list-map-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.tournament-list-map-preview {
  margin: 0;
  display: grid;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid rgba(117, 93, 74, 0.6);
  background: rgba(36, 27, 23, 0.35);
}

.tournament-list-map-preview-image {
  width: 100%;
  aspect-ratio: 16 / 8.5;
  object-fit: cover;
  border: 1px solid rgba(117, 93, 74, 0.72);
  border-radius: 8px;
}

.tournament-list-map-preview-name {
  font-size: 0.82em;
  font-weight: 600;
  color: #efd8c2;
}

/* Компактный chip карты для preview-блоков и архивных карточек. */
.tournament-map-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(213, 168, 126, 0.58);
  background: rgba(91, 63, 42, 0.3);
  color: #f5dfc7;
  font-size: 0.78em;
  line-height: 1.15;
  white-space: nowrap;
}

.tournament-card.past .tournament-meta-label {
  color: #bfa58d;
}

.tournament-card.past .tournament-meta-item {
  border-color: rgba(94, 78, 67, 0.6);
  background: rgba(34, 28, 25, 0.34);
}

.tournament-card.past .tournament-list-map-preview {
  border-color: rgba(103, 84, 69, 0.6);
  background: rgba(45, 37, 32, 0.34);
}

.tournament-card.past .tournament-list-map-preview-image {
  border-color: rgba(121, 104, 89, 0.66);
  filter: saturate(0.88) brightness(0.92);
}

.tournament-card.past .tournament-list-map-preview-name {
  color: #d7c1aa;
}

.tournament-prize-image-link::-webkit-scrollbar {
  height: 8px;
}

.tournament-prize-image-link::-webkit-scrollbar-thumb {
  background: rgba(201, 158, 117, 0.38);
  border-radius: 999px;
}

.tournament-card.past .tournament-map-chip {
  border-color: rgba(160, 136, 114, 0.5);
  color: #d7c1aa;
  background: rgba(58, 47, 40, 0.35);
}

/* Варианты карточек CMS: upcoming/past + мета-блоки и map preview. */
.tournament-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  grid-column: 1 / -1;
}

.tournament-actions.tournament-actions-inline {
  margin-top: 8px;
  grid-column: auto;
}

.tournament-actions.tournament-actions-inline .btn {
  min-width: 106px;
  padding: 6px 12px;
  font-size: 0.84em;
}

.tournaments-cms .tournament-actions.tournament-actions-inline .tournament-open-page-btn,
.tournaments-cms .tournament-actions.tournament-actions-inline .tournament-quick-signup-btn {
  min-width: 164px;
  padding: 9px 18px;
  font-size: 0.95em;
}

.tournaments-cms .btn {
  font-size: 0.9em;
  padding: 8px 16px;
  min-width: 132px;
  white-space: nowrap;
}

/* Оверлей редактора турнира (CMS): модалка поверх страницы с прокручиваемой формой. */
.tournament-editor-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.74);
  display: grid;
  place-items: center;
  z-index: 3100;
  padding: 16px;
}

.tournament-editor {
  width: min(760px, 96vw);
  max-height: 92vh;
  overflow: auto;
  border: 1px solid #5e4a3f;
  border-radius: 12px;
  background: #1f1713;
  color: var(--text);
  padding: 14px;
  display: grid;
  gap: 10px;
}

.tournament-editor h3 {
  margin: 0;
}

.tournament-editor label {
  display: grid;
  gap: 6px;
}

.tournament-editor input,
.tournament-editor textarea,
.tournament-editor select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #5f4b40;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
  padding: 8px 9px;
  font: inherit;
}

.te-date-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 8px;
}

.te-preview-wrap {
  min-height: 0;
}

.te-preview {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border: 1px solid #5e4a3f;
  border-radius: 10px;
}

.te-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* На широких, но не ultra-wide экранах убираем fixed admin-side у турнира. */
@media (max-width: 1500px) {
  .tournament-layout.has-admin-side .tournament-admin-side:not(:empty) {
    position: static;
    top: auto;
    right: auto;
    width: auto;
    max-height: none;
    overflow: visible;
    box-shadow: none;
    margin-top: 10px;
  }
}

/* На <=960px упрощаем сетки profile/tournament/cms и встраиваем боковые панели в поток. */
@media (max-width: 960px) {
  .tournaments-list {
    grid-template-columns: 1fr;
  }

  .tournaments-list > .tournament-card.tournament-card-upcoming-sat,
  .tournaments-list > .tournament-card.tournament-card-upcoming-sun {
    grid-column: 1 / -1;
  }

  .profile-preview {
    --profile-avatar-offset: 0px;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 10px 11px;
  }

  .profile-bottom.has-editor-side {
    grid-template-columns: 1fr;
  }

  .profile-editor-side {
    position: static;
    top: auto;
  }

  .profile-avatar-box {
    max-width: 184px;
    justify-self: center;
  }

  .profile-chat-mute-editor-row {
    grid-template-columns: 1fr;
  }

  .profile-tournament-ban-editor-row {
    grid-template-columns: 1fr;
  }

  .tournament-layout {
    grid-template-columns: 1fr;
  }

  .tournament-layout.has-admin-side {
    grid-template-columns: 1fr;
  }

  .tournament-layout.has-admin-side .tournament-admin-side {
    position: static;
    top: auto;
  }

  .tournament-layout.has-admin-side .tournament-admin-side:not(:empty) {
    position: static;
    top: auto;
    right: auto;
    width: auto;
    max-height: none;
    overflow: visible;
    box-shadow: none;
  }

  .tournament-map-material-editor-grid {
    grid-template-columns: 1fr;
  }

  .tournament-card.has-side-panel {
    grid-template-columns: 1fr;
  }

  .tournament-card.has-side-panel .tournament-side-panel {
    grid-column: 1;
    grid-row: 2;
  }

  /* На mobile уменьшаем grid превью карт до 2 колонок для читаемости. */
  .tournament-list-map-preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tournament-bottom-grid {
    grid-template-columns: 1fr;
  }

  .te-date-grid {
    grid-template-columns: 1fr;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }
}

/* TODO: вынести брейкпоинты <=960/<=768 в таблицу решений для единообразной адаптивности. */
/* Админ-раздел: управление правами, терминал и отладочная консоль. */
.admin-host {
  max-width: calc(var(--site-content-track-width) + (var(--site-shell-inline-padding) * 2));
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

/* Базовые карточки админ-модуля: списки, формы назначения и терминал. */
.admin-card {
  min-height: 240px;
}

.admin-admins-card {
  min-height: 0;
}

.admin-quick-actions-card {
  min-height: 0;
}

.admin-card-wide {
  grid-column: 1 / -1;
}

/* Admin cards: wide/regular блоки для списков, назначения и терминала. */
.admin-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.admin-card-head h2 {
  margin: 0;
}

.admin-collapsible {
  display: grid;
  gap: 10px;
}

.admin-collapsible-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
}

.admin-collapsible-toggle::-webkit-details-marker {
  display: none;
}

.admin-collapsible-title {
  margin: 0;
}

.admin-collapsible-hint {
  white-space: nowrap;
}

.admin-collapsible-note {
  margin: 0;
}

.admin-collapsible-body {
  display: grid;
  gap: 10px;
}

.admin-motd-btn {
  padding: 4px 10px;
  font-size: 0.93rem;
  line-height: 1.15;
}

.admin-list {
  display: grid;
  gap: 8px;
}

.admin-rewards-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
}

.admin-rewards-topbar label {
  display: grid;
  gap: 4px;
}

.admin-rewards-topbar select {
  width: 100%;
  min-width: 0;
  border: 1px solid #5b4a3e;
  border-radius: 8px;
  background: rgba(255, 224, 201, 0.03);
  color: var(--text);
  padding: 6px 8px;
  font: inherit;
}

.admin-rewards-top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-rewards-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 8px;
}

.admin-rewards-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-bottom: 10px;
}

#admin-rewards-msg {
  min-height: 20px;
  margin: 0 0 10px;
}

#admin-rewards-msg.is-error {
  color: #ff9e9e;
}

.admin-rewards-items {
  display: grid;
  gap: 10px;
}

.admin-reward-item {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px;
  border: 1px solid #4f4139;
  border-radius: 10px;
  background: rgba(255, 224, 201, 0.03);
  padding: 10px;
}

.admin-reward-preview {
  width: 100%;
  min-height: 120px;
  border: 1px solid #4f4139;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.admin-reward-preview img {
  display: block;
  width: 100%;
  max-width: 120px;
  height: auto;
  object-fit: contain;
  aspect-ratio: 1 / 1;
}

.admin-reward-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.admin-reward-form label {
  display: grid;
  gap: 4px;
}

.admin-reward-form input {
  width: 100%;
  min-width: 0;
  border: 1px solid #5b4a3e;
  border-radius: 8px;
  background: rgba(255, 224, 201, 0.03);
  color: var(--text);
  padding: 6px 8px;
  font: inherit;
}

.admin-reward-price {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 13px;
}

.admin-reward-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-reward-slot {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-start;
}

.admin-reward-picker {
  position: fixed;
  inset: 0;
  background: rgba(7, 7, 7, 0.65);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 16px 16px;
  z-index: 1200;
}

.admin-reward-picker.is-open {
  display: flex;
}

.admin-reward-picker-dialog {
  width: min(720px, 100%);
  border: 1px solid #5b4a3e;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(36, 20, 15, 0.98) 0%, rgba(22, 14, 12, 0.98) 100%);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  padding: 12px;
}

.admin-reward-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.admin-reward-picker-search {
  display: grid;
  gap: 4px;
  margin-bottom: 8px;
}

.admin-reward-picker-search input {
  width: 100%;
  min-width: 0;
  border: 1px solid #5b4a3e;
  border-radius: 8px;
  background: rgba(255, 224, 201, 0.03);
  color: var(--text);
  padding: 7px 9px;
  font: inherit;
}

.admin-reward-picker-results {
  border: 1px solid #4f4139;
  border-radius: 10px;
  background: rgba(255, 224, 201, 0.03);
  overflow: visible;
  max-height: min(50vh, 320px);
  overflow-y: auto;
  display: none;
}

.admin-reward-picker-results.is-open {
  display: block;
}

.admin-reward-picker-row {
  width: 100%;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  grid-template-areas:
    "img main"
    "img sub";
  align-items: center;
  gap: 2px 10px;
  border: none;
  border-bottom: 1px solid #45392f;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 8px 10px;
  cursor: pointer;
}

.admin-reward-picker-row:last-child {
  border-bottom: none;
}

.admin-reward-picker-row:hover,
.admin-reward-picker-row:focus-visible {
  background: rgba(255, 224, 201, 0.08);
}

.admin-reward-picker-row img,
.admin-reward-picker-noimg {
  grid-area: img;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  object-fit: contain;
  border: 1px solid #4f4139;
  background: rgba(0, 0, 0, 0.3);
  font-size: 11px;
  color: #ccb9aa;
}

.admin-reward-picker-main {
  grid-area: main;
  font-size: 14px;
  line-height: 1.3;
}

.admin-reward-picker-sub {
  grid-area: sub;
  font-size: 12px;
  color: #ccb9aa;
}

.admin-reward-picker-empty {
  padding: 10px;
  font-size: 13px;
  color: #ccb9aa;
}

@media (max-width: 960px) {
  .admin-reward-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .admin-rewards-topbar {
    grid-template-columns: 1fr;
  }

  .admin-reward-item {
    grid-template-columns: 1fr;
  }

  .admin-reward-preview {
    max-width: 180px;
  }
}

.admin-item {
  border: 1px solid #4f4139;
  border-radius: 10px;
  background: rgba(255, 224, 201, 0.04);
  padding: 10px;
}

.admin-item p {
  margin: 0 0 6px;
  line-height: 1.35;
}

.admin-item p:last-child {
  margin-bottom: 0;
}

.admin-level-input {
  width: 92px;
  padding: 6px 8px;
  border: 1px solid #5b4a3e;
  border-radius: 8px;
  background: rgba(255, 224, 201, 0.03);
  color: var(--text);
  font: inherit;
}

.admin-level-row {
  flex-wrap: wrap;
  gap: 8px;
}

.admin-add-from-table {
  border: 1px solid #4f4139;
  border-radius: 10px;
  background: rgba(255, 224, 201, 0.03);
  padding: 10px;
  margin: 0 0 10px;
}

.admin-add-from-table h3 {
  margin: 0 0 8px;
}

/* Блок быстрого назначения админа из таблицы игроков (select + уровень + права). */
.admin-add-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 8px;
}

.admin-add-grid label {
  display: grid;
  gap: 4px;
}

.admin-add-grid select,
.admin-add-grid input {
  width: 100%;
  min-width: 0;
  border: 1px solid #5b4a3e;
  border-radius: 8px;
  background: rgba(255, 224, 201, 0.03);
  color: var(--text);
  padding: 6px 8px;
  font: inherit;
}

/* Матрица granular-прав админа (A..Z) с адаптивным переносом карточек. */
.admin-permissions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 6px;
  margin: 6px 0 8px;
}

.admin-permission-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid #4f4139;
  border-radius: 8px;
  background: rgba(255, 224, 201, 0.03);
  font-size: 13px;
  line-height: 1.3;
}

.admin-permission-chip input {
  margin: 0;
}

.admin-tf2-launch {
  border: 1px solid #4f4139;
  border-radius: 10px;
  background: rgba(255, 224, 201, 0.03);
  padding: 10px;
  margin: 0 0 10px;
}

.admin-tf2-launch-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 8px;
}

.admin-tf2-launch-field {
  display: grid;
  gap: 4px;
}

.admin-tf2-launch-field-wide {
  grid-column: 1 / -1;
}

.admin-tf2-launch-field select,
.admin-tf2-launch-field input[type="text"] {
  width: 100%;
  min-width: 0;
  border: 1px solid #5b4a3e;
  border-radius: 8px;
  background: rgba(255, 224, 201, 0.03);
  color: var(--text);
  padding: 6px 8px;
  font: inherit;
}

.admin-tf2-launch-password-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.admin-tf2-launch-field input[type="range"] {
  width: 100%;
  margin: 6px 0 0;
  accent-color: #f2c18d;
}

.admin-tf2-ip-panel {
  margin: 8px 0 0;
  border: 1px dashed #6b5a4c;
  border-radius: 9px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.18);
}

.admin-tf2-ip-title {
  margin: 0 0 6px;
}

.admin-tf2-ip-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin: 0 0 6px;
}

.admin-tf2-ip-row:last-child {
  margin-bottom: 0;
}

.admin-tf2-ip-label {
  color: #f2c18d;
  font-weight: 700;
}

.admin-tf2-ip-value {
  display: inline-block;
  min-width: 0;
  border: 1px solid #4f4139;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.32);
  padding: 5px 8px;
  overflow: visible;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 12px/1.4 Consolas, "Courier New", monospace;
}

.admin-tf2-ip-copy {
  min-width: 72px;
}

.admin-tf2-health-panel {
  margin: 8px 0 0;
  border: 1px solid #7a5945;
  border-radius: 9px;
  padding: 8px;
  background: rgba(255, 187, 116, 0.08);
}

.admin-tf2-health-title {
  margin: 0 0 6px;
  color: #ffd29a;
}

.admin-tf2-health-list {
  margin: 0;
  padding-left: 18px;
}

.admin-tf2-health-item {
  margin: 0 0 4px;
  line-height: 1.35;
}

.admin-tf2-health-item:last-child {
  margin-bottom: 0;
}

.admin-tf2-health-item.warn {
  color: #ffd29a;
}

.admin-tf2-health-item.error {
  color: #ffb0b0;
}

.admin-tf2-health-meta {
  margin-top: 6px;
}

/* Набор granular-прав: чипы разрешений и блок terminal-быстрых команд. */
.admin-terminal-card {
  min-height: 300px;
}

.admin-terminal-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 8px;
}

/* Вывод админ-терминала: моноширинный лог со строгой цветовой семантикой строк. */
.admin-terminal-log {
  min-height: 210px;
  max-height: 380px;
  overflow: auto;
  border: 1px solid #4f4139;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
  padding: 8px 10px;
  margin: 0 0 8px;
  font: 13px/1.4 Consolas, "Courier New", monospace;
}

.admin-terminal-line {
  margin: 0 0 5px;
  white-space: pre-wrap;
  word-break: break-word;
}

.admin-terminal-line.cmd {
  color: #f2c18d;
}

.admin-terminal-line.ok {
  color: #bde9a4;
}

.admin-terminal-line.warn {
  color: #ffd29a;
}

.admin-terminal-line.error {
  color: #ffadad;
}

.admin-terminal-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.admin-terminal-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #5b4a3e;
  border-radius: 10px;
  background: rgba(255, 224, 201, 0.04);
  padding: 8px 10px;
}

.admin-terminal-prompt {
  color: #f2c18d;
  font-weight: 700;
  font-family: Consolas, "Courier New", monospace;
}

.admin-terminal-input-wrap input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font: 13px/1.4 Consolas, "Courier New", monospace;
}

.admin-terminal-input-wrap input::placeholder {
  color: rgba(255, 224, 201, 0.45);
}

.admin-tf2-console-card {
  display: none;
  min-height: 360px;
}

.admin-tf2-console-card.is-visible {
  display: block;
}

.admin-tf2-console-output {
  min-height: 360px;
  max-height: 70vh;
  overflow: auto;
  border: 1px solid #4f4139;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.38);
  padding: 10px 12px;
  margin: 0;
  color: #e9d9c9;
  white-space: pre-wrap;
  word-break: break-word;
  font: 13px/1.4 Consolas, "Courier New", monospace;
}

.admin-tf2-console-tools {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.admin-tf2-console-autorefresh {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #5b4a3e;
  border-radius: 999px;
  background: rgba(255, 224, 201, 0.04);
  padding: 6px 10px;
  color: var(--text);
  font-size: 13px;
  user-select: none;
  cursor: pointer;
}

.admin-tf2-console-autorefresh input {
  margin: 0;
  accent-color: #6bc17f;
}

.admin-tf2-console-autorefresh-state {
  min-width: 34px;
  text-align: right;
}

.admin-tf2-console-autorefresh-state.is-on {
  color: #8de8a2;
}

.admin-tf2-console-autorefresh-state.is-off {
  color: #e8a38d;
}

.admin-tf2-console-command-form {
  margin-top: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: stretch;
}

.admin-tf2-console-command-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #5b4a3e;
  border-radius: 10px;
  background: rgba(255, 224, 201, 0.04);
  padding: 8px 10px;
}

.admin-tf2-console-command-prompt {
  color: #f2c18d;
  font-weight: 700;
  font-family: Consolas, "Courier New", monospace;
}

.admin-tf2-console-command-wrap input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font: 13px/1.4 Consolas, "Courier New", monospace;
}

.admin-tf2-console-command-wrap input::placeholder {
  color: rgba(255, 224, 201, 0.45);
}

.admin-tf2-online-players {
  margin-top: 12px;
  border: 1px solid #4f4139;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  padding: 10px;
}

.admin-tf2-online-players-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.admin-tf2-online-players-list {
  max-height: 260px;
  overflow: auto;
}

.admin-tf2-online-player-table {
  display: grid;
  gap: 6px;
}

.admin-tf2-online-player-row {
  display: grid;
  grid-template-columns: minmax(140px, 2fr) auto minmax(120px, 1.2fr) minmax(180px, 1.7fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(120, 95, 78, 0.5);
  border-radius: 8px;
  background: rgba(255, 224, 201, 0.04);
  padding: 6px 8px;
}

.admin-tf2-online-player-name {
  font-weight: 600;
  color: #f4d5b4;
}

.admin-tf2-online-player-team {
  color: #d4b38f;
  font-size: 12px;
}

.admin-tf2-online-player-ip,
.admin-tf2-online-player-steam {
  color: #ecd8c0;
  font-size: 12px;
  font-family: Consolas, "Courier New", monospace;
}

.admin-tf2-online-player-profile a,
.admin-tf2-online-player-link {
  color: #9fd9ff;
  text-decoration: none;
}

.admin-tf2-online-player-profile a:hover,
.admin-tf2-online-player-link:hover {
  text-decoration: underline;
}

body.admin-tf2-console-window .admin-card {
  display: none;
}

body.admin-tf2-console-window .admin-tf2-card,
body.admin-tf2-console-window .admin-tf2-console-card {
  display: block;
}

/* Локальный адаптив админ-секции: упрощаем форму ввода и сетку контролов. */
@media (max-width: 900px) {
  .admin-add-grid {
    grid-template-columns: 1fr;
  }

  .admin-tf2-launch-grid {
    grid-template-columns: 1fr;
  }

  .admin-tf2-ip-row {
    grid-template-columns: 1fr;
  }

  .admin-terminal-form {
    grid-template-columns: 1fr;
  }

  .admin-tf2-console-command-form {
    grid-template-columns: 1fr;
  }

  .admin-tf2-console-autorefresh {
    width: 100%;
    justify-content: space-between;
  }

  .admin-tf2-online-player-row {
    grid-template-columns: 1fr;
  }
}

/* Плавающий debug-console для runtime-диагностики на клиенте. */
.debug-console-wrap {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 3100;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.debug-console-toggle {
  min-width: 72px;
  height: 34px;
  border: 1px solid #5b4a3e;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(41, 25, 20, 0.95), rgba(28, 18, 15, 0.95));
  color: #f4d6ba;
  font: 700 14px/1 "Golos Text", sans-serif;
  cursor: pointer;
}

.debug-console-panel {
  width: min(92vw, 460px);
  border: 1px solid #5b4a3e;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(30, 20, 16, 0.97), rgba(23, 16, 14, 0.97));
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.45);
  padding: 10px;
}

.debug-console-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.debug-console-log {
  height: 210px;
  overflow: auto;
  border: 1px solid #4a3e35;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1.35;
  margin-bottom: 8px;
}

.debug-console-row {
  margin: 0 0 4px;
  white-space: pre-wrap;
  word-break: break-word;
}

.debug-console-row.warn {
  color: #ffd29a;
}

.debug-console-row.error {
  color: #ff9f9f;
}

.debug-console-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 6px;
}

/* Debug-console panel: head/log/input-row для локальной отладки UI. */
.debug-console-input-row input {
  min-width: 0;
  border: 1px solid #5b4a3e;
  border-radius: 8px;
  background: rgba(255, 224, 201, 0.03);
  color: var(--text);
  padding: 7px 8px;
  font: inherit;
}


/* Явный визуальный индикатор admin-mode по периметру viewport. */
body.admin-mode::before {
  content: "";
  position: fixed;
  inset: 0;
  border: 4px solid #ffd84d;
  pointer-events: none;
  box-sizing: border-box;
  z-index: 2800;
}

/* Глобальный адаптив <900px: mobile-nav, touch-UX и перестройка основных сеток. */
@media (max-width: 900px) {
  :root {
    --site-shell-inline-padding: 14px;
  }

  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body {
    overflow-x: hidden;
  }

  body.mobile-nav-opened {
    overflow: visible;
    touch-action: none;
  }

  header,
  main,
  #header {
    max-width: none;
  }

  header {
    padding: 14px 14px 10px;
  }

  #header {
    margin-top: 18px;
    padding: 14px var(--site-shell-inline-padding) 0;
    min-height: 72px;
  }

  #header:empty {
    min-height: 72px;
  }

  main {
    padding: var(--main-content-top-padding) var(--site-shell-inline-padding) 18px;
  }

  .card {
    padding: 14px;
    margin-top: 12px;
  }

  .tournament-reward-strip {
    width: 100%;
    overflow: visible;
  }

  .tournament-reward-strip-track {
    width: 100%;
    min-width: 0;
  }

  .header-top-row {
    min-height: 52px;
  }

  .brand {
    padding-inline: 0;
    justify-content: center;
    width: 100%;
  }

  .site-mode-badge {
    margin-bottom: 3px;
    padding: 1px 6px;
    font-size: 10px;
  }

  .mobile-nav-toggle {
    display: inline-flex;
    position: fixed;
    top: calc(env(safe-area-inset-top) + 8px);
    left: 10px;
    right: auto;
    z-index: 2720;
  }

  /* Мобильное боковое меню: off-canvas панель навигации с управлением через класс mobile-nav-open. */
  #header.mobile-nav-enhanced .tabs-nav {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(84vw, 330px);
    min-width: 0;
    margin: 0;
    padding: calc(env(safe-area-inset-top) + 66px) 12px calc(env(safe-area-inset-bottom) + 16px);
    display: block;
    border: 0;
    border-right: 1px solid #5a4a3f;
    border-radius: 0;
    background: rgba(28, 14, 12, 0.98);
    box-shadow: none;
    overflow-y: auto;
    overflow-x: hidden;
    transform: translateX(calc(-100% - 24px));
    opacity: 1;
    pointer-events: none;
    transition: transform 180ms ease;
    z-index: 2710;
  }

  #header.mobile-nav-enhanced.mobile-nav-open .tabs-nav {
    transform: translateX(0);
    box-shadow: 16px 0 32px rgba(0, 0, 0, 0.36);
    pointer-events: auto;
  }

  #header.mobile-nav-enhanced .tab-link {
    display: flex;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    margin: 0 0 6px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: clamp(15px, 4.2vw, 18px);
    line-height: 1.2;
    text-align: left;
    background: rgba(255, 224, 201, 0.04);
    border: 1px solid rgba(255, 224, 201, 0.14);
  }

  #header.mobile-nav-enhanced .tab-link.active {
    background: rgba(255, 224, 201, 0.12);
  }

  #header.mobile-nav-enhanced .mobile-nav-auth {
    display: grid;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 224, 201, 0.16);
  }

  #header.mobile-nav-enhanced .mobile-nav-auth-text {
    margin: 0;
    font-size: 13px;
    color: #e8d0bc;
    line-height: 1.35;
  }

  #header.mobile-nav-enhanced .mobile-nav-auth-actions {
    display: grid;
    gap: 8px;
  }

  #header.mobile-nav-enhanced .mobile-nav-auth-actions .btn {
    width: 100%;
    justify-content: center;
  }

  /* Mobile nav auth-блок: auth-текст и actions живут внутри off-canvas меню. */
  .header-nav-row {
    margin-top: 10px;
  }

  .header-nav-row::after {
    display: none;
  }

  #header.has-admin-link .header-admin-area {
    display: none;
  }

  #header.mobile-nav-enhanced .mobile-only-admin-link {
    display: flex !important;
  }

  .auth-status-panel {
    display: none !important;
  }

  .header-status-stack {
    display: none !important;
  }

  /* Плавающие quick-actions в мобильной шапке: admin-entry и notification bell. */
  .admin-entry-btn {
    top: calc(env(safe-area-inset-top) + 8px);
    right: 56px;
    width: 40px;
    height: 40px;
    z-index: 2720;
  }

  .admin-entry-btn img {
    width: 24px;
    height: 24px;
  }

  .notif-bell-btn {
    top: calc(env(safe-area-inset-top) + 8px);
    right: 10px;
    width: 40px;
    height: 40px;
  }

  .notif-popover {
    top: calc(env(safe-area-inset-top) + 56px);
    right: 10px;
    left: 10px;
    width: auto;
    max-height: 48vh;
  }

  .runtime-version-notice {
    right: 10px;
    left: 10px;
    bottom: 10px;
    width: auto;
  }

  .btn,
  button.btn {
    min-height: 44px;
    padding: 10px 14px;
  }

  .support-create-form input,
  .support-create-form textarea,
  .support-send-form textarea,
  .chat-form textarea,
  .tournament-chat-form textarea,
  .tournament-editor input,
  .tournament-editor textarea,
  .players-search input,
  .excel-table input,
  .excel-table select,
  .profile-link-modal-input,
  .verify-field input,
  .verify-field textarea {
    font-size: 16px;
  }

  /* Унификация мобильного макета: все сложные двухколоночные секции сворачиваем в одну колонку. */
  .support-columns,
  .chat-layout,
  .tournament-layout,
  .tournament-bottom-grid,
  .admin-grid,
  .profile-layout,
  .profile-preview,
  .profile-bottom,
  .profile-bottom.has-editor-side {
    grid-template-columns: 1fr;
  }

  .tournament-signup-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .tournament-signup-right {
    min-height: 0;
    padding: 7px;
    gap: 5px;
  }

  .tournament-signup-list-wrap {
    max-height: 360px;
  }

  .chat-online {
    order: -1;
  }

  .support-list-card,
  .support-chat-card,
  .admin-card {
    min-height: 0;
  }

  .tournament-card.has-side-panel {
    grid-template-columns: 1fr;
  }

  .tournament-card.has-side-panel .tournament-side-panel {
    grid-column: 1;
    grid-row: 2;
  }

  .tournament-head,
  .tournament-connect-panel,
  .tournament-debug-panel,
  .tournament-maps-panel,
  .tournament-priority-panel,
  .tournament-right {
    margin-bottom: 8px;
    padding: 9px;
  }

  .tournament-head-title {
    font-size: clamp(24px, 7vw, 30px);
    line-height: 1.08;
  }

  .tournament-head-date {
    margin-top: 6px;
    font-size: clamp(16px, 4.8vw, 22px);
  }

  .tournament-head-date-alt {
    margin-top: 3px;
    font-size: 12px;
  }

  .tournament-head-description-wrap {
    margin-top: 8px;
    max-height: 112px;
    padding: 7px 8px;
  }

  .tournament-start-timer {
    font-size: clamp(24px, 7.4vw, 32px);
    line-height: 1.08;
    letter-spacing: 0.01em;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .tournament-priority-panel h3,
  .tournament-maps-head h3 {
    font-size: 16px;
  }

  #tournament-page-root {
    display: flex;
    flex-direction: column;
  }

  .tournament-head {
    order: 1;
  }

  #tournament-reward-strip {
    order: 2;
  }

  .tournament-connect-panel {
    order: 3;
  }

  #tournament-debug-panel {
    order: 4;
  }

  #tournament-signup-panel {
    order: 5;
  }

  #tournament-maps-panel {
    order: 6;
  }

  .tournament-layout {
    order: 7;
  }

  .tournament-maps-track {
    display: block;
    overflow-x: clip;
    overflow-y: visible;
    padding: 0;
    scroll-snap-type: none;
  }

  .tournament-map-order-arrow {
    display: none;
  }

  .tournament-map-card {
    flex: 1 1 auto;
    width: 100%;
    max-width: none;
    padding: 7px;
    gap: 4px;
  }

  .tournament-map-card.winner-blue,
  .tournament-map-card.winner-red {
    box-shadow: none;
    border-width: 2px;
  }

  .tournament-map-card + .tournament-map-card {
    margin-top: 8px;
  }

  .tournament-map-materials .tournament-finished-link-btn {
    min-width: 0;
    width: 100%;
  }

  .tournament-map-preview {
    aspect-ratio: 16 / 9;
  }

  .tournament-map-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: rgba(0, 0, 0, 0.34);
  }

  .tournament-signup-list {
    gap: 6px;
  }

  .tournament-signup-list li {
    padding: 7px 8px;
    gap: 3px;
  }

  .tournament-signup-cell-head {
    gap: 6px;
    align-items: flex-start;
  }

  .tournament-signup-cell-index {
    min-width: 22px;
    height: 20px;
    font-size: 10px;
  }

  .tournament-signup-player-link {
    font-size: 13px;
    line-height: 1.25;
  }

  .tournament-signup-player-head-rank.signup-rank-badge.is-rank-logo.is-rank-mini {
    min-width: 24px;
    width: 24px;
    height: 24px;
  }

  .tournament-signup-player-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .tournament-signup-player-meta {
    gap: 4px 8px;
  }

  .signup-meta-group-role .signup-rank-badge.is-rank-logo.is-rank-mini {
    min-width: 26px;
    width: 26px;
    height: 26px;
  }

  .tournament-roster {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .team-divider {
    height: 1px;
    width: 100%;
  }

  .tournament-roster.has-winner .team-col {
    padding-top: 0;
  }

  .team-col {
    padding-top: 0;
  }

  .team {
    min-height: 0;
    padding: 8px;
  }

  .team h3 {
    min-height: 42px;
  }

  .team-win-badge {
    position: static;
    transform: none;
    margin: 0 auto 6px;
    font-size: 14px;
    padding: 3px 10px;
  }

  .roster-slot {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 6px;
    padding: 2px 5px;
  }

  .slot-class {
    min-height: 22px;
    padding-right: 5px;
  }

  .slot-class-emblem.signup-rank-badge.is-rank-logo.is-rank-mini,
  .slot-class-emblem.rank-outline-badge,
  .rank-outline-badge.slot-class-emblem {
    min-width: 22px;
    width: 22px;
    height: 22px;
  }

  .slot-class-emblem.class-icon-badge {
    min-width: 22px;
    width: 22px;
    height: 22px;
  }

  .slot-class-emblem.class-icon-badge .class-icon-img {
    width: 14.4px;
    height: 14.4px;
  }

  .slot-class-emblem .signup-rank-logo-class,
  .slot-class-emblem .signup-rank-logo-class-fallback {
    width: 12px;
    height: 12px;
  }

  .slot-name {
    font-size: 11.5px;
    min-height: 22px;
  }

  footer {
    padding: 14px var(--site-shell-inline-padding) calc(12px + env(safe-area-inset-bottom));
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .footer-right {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 10px;
  }

  footer p,
  .footer-copy {
    font-size: 13px;
    line-height: 1.42;
  }

  .tournament-head,
  .tournament-connect-panel,
  .tournament-debug-panel,
  .tournament-maps-panel,
  .tournament-priority-panel,
  .tournament-right,
  .tournament-layout,
  .tournament-roster,
  .tournament-signup-grid,
  .tournament-signup-list,
  .tournament-signup-list li,
  .tournament-map-card,
  .roster-slot {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  .tournament-map-name,
  .tournament-signup-player-link,
  .tournament-signup-player-time,
  .tournament-signup-player-meta {
    overflow-wrap: anywhere;
  }

  .slot-class {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  /* Mobile BO3 track: вертикальный стек карточек без горизонтального scroll. */
  /* На мобильных возвращаем page-scroll вместо фиксированного table-body-вьюпорта. */
  .table-body {
    height: auto;
    overflow: auto;
  }

  .table-body .table-page,
  .table-body #players-table-app {
    min-height: auto;
    height: auto;
  }

  /* Мобильный профиль: стекируем инфо/статы и увеличиваем читаемость текста. */
  .table-page {
    max-width: none;
  }

  .players-controls {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 8px;
  }

  .players-search,
  .players-sort {
    flex: 0 0 auto;
    width: 100%;
  }

  .players-search input {
    min-width: 0;
  }

  .players-controls .btn {
    width: 100%;
  }

  .excel-wrap {
    max-height: none;
  }

  .excel-table {
    min-width: 1160px;
    font-size: 14px;
  }

  .profile-avatar-box {
    max-width: 220px;
    justify-self: center;
  }

  /* Mobile-версия stats-bar: перевод в одну колонку с левым выравниванием. */
  .profile-stats-bar {
    grid-template-columns: 1fr;
    justify-items: start;
    gap: 6px;
    padding: 10px 12px;
  }

  .profile-stat {
    justify-items: start;
    grid-template-rows: auto auto;
    width: 100%;
  }

  .profile-info {
    font-size: clamp(15px, 3.9vw, 17px);
    line-height: 1.35;
  }

  .profile-stat .k {
    font-size: 14px;
  }

  .profile-stat .v {
    font-size: 15px;
    line-height: 1.3;
    min-height: 0;
    justify-content: flex-start;
  }

  .profile-links-row {
    gap: 8px;
  }

  .profile-ban-row,
  .profile-chat-mute-row,
  .profile-tournament-ban-row {
    font-size: 14px;
    line-height: 1.4;
    padding: 8px;
  }

  /* Карточка матча в профиле: перенос полей в вертикальный стек. */
  .profile-match-item {
    grid-template-columns: 1fr;
    justify-items: start;
    text-align: left;
    gap: 6px 10px;
    padding: 10px 12px;
  }

  .profile-match-title {
    width: 100%;
    text-align: left;
    font-size: 16px;
  }

  .profile-match-date,
  .profile-match-meta {
    font-size: 14px;
  }

  /* Общая мобильная перестройка editor-grid блоков в одну колонку. */
  .profile-chat-mute-editor-row,
  .profile-tournament-ban-editor-row,
  .te-date-grid {
    grid-template-columns: 1fr;
  }

  /* Device-template поправки: тонкая коррекция top-offset и читаемости текста. */
  /* Device templates: Apple / Samsung / Android */
  body.mobile-template-apple .mobile-nav-toggle,
  body.mobile-template-apple .admin-entry-btn,
  body.mobile-template-apple .notif-bell-btn {
    top: calc(env(safe-area-inset-top) + 10px);
  }

  body.mobile-template-apple .notif-popover {
    top: calc(env(safe-area-inset-top) + 60px);
  }

  body.mobile-template-samsung .mobile-nav-toggle,
  body.mobile-template-samsung .admin-entry-btn,
  body.mobile-template-samsung .notif-bell-btn {
    top: max(8px, calc(env(safe-area-inset-top) + 6px));
  }

  body.mobile-template-android .profile-stat .k,
  body.mobile-template-android .profile-stat .v,
  body.mobile-template-samsung .profile-stat .k,
  body.mobile-template-samsung .profile-stat .v {
    letter-spacing: 0.01em;
  }

  .steam-auth-modal,
  .verify-modal,
  .tournament-editor,
  .profile-link-modal,
  .debug-console-panel {
    width: min(96vw, 560px);
  }
}

/* Узкие экраны <560px: дополнительное упрощение компоновки и размеров элементов. */
@media (max-width: 560px) {
  .brand-avatar {
    width: 32px;
  }

  .brand-title {
    width: 190px;
  }

  .tab-link {
    font-size: 15px;
  }

  .home-upcoming-list {
    grid-template-columns: 1fr;
  }

  .home-upcoming-tab {
    padding: 12px;
  }

  .home-server-meta {
    grid-template-columns: 1fr;
  }

  .home-server-action-buttons .btn {
    width: 100%;
    justify-content: center;
  }

  .chat-form-row,
  .support-send-row,
  .support-ticket-head .row,
  .tournament-signup-actions,
  .tournament-link-editor-actions,
  .tournament-signup-assign-row,
  .tournament-signup-confirm-actions {
    flex-direction: column;
    align-items: stretch;
  }

  /* Для самых узких экранов схлопываем BO3-редакторы и track-карты в одну колонку. */
  .tournament-rank-range-editor {
    grid-template-columns: 1fr;
  }

  .tournament-reward-classicons {
    --reward-slot-min: 44px;
    gap: 3px;
  }

  .class-icon-badge.is-reward-strip {
    width: 32px;
    height: 32px;
  }

  .class-icon-badge.is-reward-strip .class-icon-img {
    width: 21px;
    height: 21px;
  }

  .tournament-map-editor-grid {
    grid-template-columns: 1fr;
  }

  .tournament-map-material-editor-grid {
    grid-template-columns: 1fr;
  }

  .tournament-maps-track {
    display: block;
    padding-bottom: 2px;
  }

  .tournament-map-card {
    flex: 1 1 auto;
    width: 100%;
    padding: 6px;
  }

  .tournament-map-card + .tournament-map-card {
    margin-top: 7px;
  }

  .tournament-start-timer {
    font-size: clamp(21px, 8.6vw, 26px);
  }

  .team-score-pill {
    font-size: 16px;
    min-width: 30px;
    padding: 3px 8px;
  }

  .profile-info {
    font-size: clamp(16px, 4.2vw, 18px);
  }

  .profile-stat .k {
    font-size: 15px;
  }

  .profile-stat .v {
    font-size: 16px;
  }

  .profile-name {
    font-size: clamp(24px, 8vw, 34px);
  }

  .profile-ext-link {
    font-size: clamp(15px, 4.8vw, 20px);
  }

  /* Small-screen типографика профиля: увеличенные размеры для touch-читаемости. */
  .debug-console-wrap {
    right: 10px;
    left: 10px;
    align-items: stretch;
  }

  .debug-console-toggle {
    align-self: flex-end;
  }
}

/* Keep a visible dropdown indicator for all engine-skinned native selects. */

/* Hatlander viewport tiers: tablet 768-820, mobile-lg 390-414, mobile 360-389, xs-mobile 320-359. */
@media (min-width: 768px) and (max-width: 820px) {
  .tournament-head,
  .tournament-connect-panel,
  .tournament-debug-panel,
  .tournament-priority-panel,
  .tournament-maps-panel,
  .tournament-right {
    padding: 11px;
  }

  .tournament-start-timer {
    font-size: clamp(28px, 4vw, 34px);
  }

  .tournament-map-card {
    padding: 8px;
  }
}

@media (max-width: 414px) {
  main > #md,
  #md,
  #md > section,
  #md > section > div {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .tournaments-cms,
  .tournaments-cms .tournaments-toolbar,
  .tournaments-cms .tournaments-list,
  .tournaments-cms .tournaments-list > *,
  .tournaments-cms .tournament-card,
  .tournaments-cms .tournament-card .tournament-info,
  .tournaments-cms .tournament-meta-item,
  .tournaments-cms .tournaments-collapsible-group,
  .tournaments-cms .tournaments-collapsible-body {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
    box-sizing: border-box;
  }

  .tournaments-cms .tournament-prize-image-link,
  .tournaments-cms .tournament-list-reward-icons {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .tournaments-cms .tournament-list-reward-icons {
    --tournament-reward-badge-size: 30px;
    --tournament-reward-icon-size: 18px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-items: stretch;
    gap: 5px;
    padding-inline: 0;
  }

  .tournaments-cms .tournaments-toolbar > * {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  .tournaments-cms .tournaments-tz {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-items: stretch;
    gap: 6px;
    width: 100%;
    white-space: normal;
  }

  .tournaments-cms .tournaments-tz select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .tournaments-cms .btn,
  .tournaments-cms .tournament-actions.tournament-actions-inline .tournament-open-page-btn,
  .tournaments-cms .tournament-actions.tournament-actions-inline .tournament-quick-signup-btn {
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }

  .tournaments-cms .tournament-actions.tournament-actions-inline {
    grid-column: 1 / -1;
    width: 100%;
  }

  .tournament-start-timer {
    font-size: clamp(22px, 8vw, 28px);
  }

  .tournament-head-title {
    font-size: clamp(23px, 7.2vw, 29px);
  }

  .tournament-map-card {
    gap: 4px;
    padding: 6px;
  }

  .tournament-signup-list li {
    padding: 7px;
  }

  .roster-slot {
    grid-template-columns: 40px minmax(0, 1fr);
  }
}

@media (max-width: 389px) {
  .tournament-head,
  .tournament-connect-panel,
  .tournament-debug-panel,
  .tournament-priority-panel,
  .tournament-maps-panel,
  .tournament-right {
    padding: 8px;
  }

  .tournament-start-timer {
    font-size: clamp(21px, 8.8vw, 25px);
    letter-spacing: 0;
  }

  .tournament-head-title {
    font-size: clamp(21px, 7.6vw, 26px);
  }

  .tournament-head-date {
    font-size: clamp(15px, 5.2vw, 19px);
  }

  .tournament-signup-player-meta {
    gap: 3px 6px;
  }

  .signup-meta-group-role .signup-rank-badge.is-rank-logo.is-rank-mini {
    min-width: 24px;
    width: 24px;
    height: 24px;
  }
}

@media (max-width: 359px) {
  .header-top-row,
  .brand {
    min-width: 0;
    width: 100%;
    overflow-x: hidden;
  }

  .brand {
    gap: 6px;
    flex-wrap: wrap;
  }

  .site-mode-badge {
    margin-bottom: 0;
  }

  .tournament-head,
  .tournament-connect-panel,
  .tournament-debug-panel,
  .tournament-priority-panel,
  .tournament-maps-panel,
  .tournament-right,
  .tournament-layout {
    padding: 7px;
    margin-bottom: 7px;
  }

  .tournament-layout {
    overflow-x: clip;
  }

  .tournament-left h2,
  .tournament-date-time,
  .tournament-description-text {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .tournament-start-timer {
    font-size: clamp(19px, 9.2vw, 23px);
  }

  .tournament-head-title {
    font-size: clamp(19px, 8vw, 24px);
    line-height: 1.12;
  }

  .tournament-signup-cell-index {
    min-width: 20px;
    height: 18px;
    font-size: 9px;
  }

  .tournament-signup-player-link {
    font-size: 12px;
  }

  .tournament-signup-player-head-rank.signup-rank-badge.is-rank-logo.is-rank-mini {
    min-width: 21px;
    width: 21px;
    height: 21px;
  }

  .roster-slot {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 5px;
    padding: 2px 4px;
  }

  .slot-class {
    padding-right: 4px;
  }

  .slot-class-emblem.signup-rank-badge.is-rank-logo.is-rank-mini,
  .slot-class-emblem.rank-outline-badge,
  .rank-outline-badge.slot-class-emblem {
    min-width: 20px;
    width: 20px;
    height: 20px;
  }

  .slot-class-emblem.class-icon-badge {
    min-width: 20px;
    width: 20px;
    height: 20px;
  }

  .slot-class-emblem.class-icon-badge .class-icon-img {
    width: 13.2px;
    height: 13.2px;
  }

  .slot-class-emblem .signup-rank-logo-class,
  .slot-class-emblem .signup-rank-logo-class-fallback {
    width: 11px;
    height: 11px;
  }

  footer {
    padding-left: 10px;
    padding-right: 10px;
  }
}

select.hl-native-select:not(:disabled) {
  padding-right: 28px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.2 6.2 8 10l3.8-3.8' fill='none' stroke='%23ffd9bc' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: calc(100% - 8px) 50% !important;
  background-size: 14px 14px !important;
}

.excel-table td select.hl-native-select:not(:disabled),
.excel-table.compact td select.hl-native-select:not(:disabled) {
  padding-right: 18px !important;
  background-position: calc(100% - 6px) 50% !important;
  background-size: 12px 12px !important;
}


.profile-rank-logo-base[src*="/png/ranksnew/"],
.profile-rank-logo-base[src*="/svg/ranksnew/"] {
  filter: none !important;
  image-rendering: auto;
  mix-blend-mode: normal;
}

.signup-rank-logo-img[src*="/png/ranksnew/"],
.signup-rank-logo-img[src*="/svg/ranksnew/"] {
  filter: none !important;
  image-rendering: auto;
  mix-blend-mode: normal;
}

