* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #050816;
  color: #e5e7eb;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 0;
}

/* Верхнее меню */

.top-nav {
  width: 100%;
  background: #020617;
  border-bottom: 1px solid #111827;
  position: relative;
  z-index: 100;
}

.top-nav-admin {
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
}

.top-nav-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
}

.top-nav-logo {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e5e7eb;
}

.top-nav-logo span {
  color: #f97316;
}

.top-nav-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  position: relative;
  z-index: 101;
}

.top-nav-menu-left {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: 16px;
}

.top-nav-menu-center {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.top-nav-menu-right {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}


.top-nav-link {
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 999px;
  text-decoration: none;
  color: #9ca3af;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-block;
  position: relative;
  z-index: 1;
}

.top-nav-link:hover {
  border-color: #374151;
  color: #e5e7eb;
}

.top-nav-link-active {
  background: #f97316;
  color: #020617;
  border-color: #f97316;
  font-weight: 600;
}

/* Контейнер */

.wrapper {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Карточки */

.card {
  background: #020617;
  border-radius: 16px;
  border: 1px solid #1f2937;
  box-shadow: 0 18px 40px rgba(0,0,0,0.7);
  padding: 18px 20px 16px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.card-title {
  font-size: 18px;
  font-weight: 600;
}

.card-subtitle {
  font-size: 13px;
  color: #9ca3af;
}

.card-tag {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #4b5563;
  color: #9ca3af;
}

/* Профиль */

.profile-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
}

.avatar-shell {
  width: 96px;
  height: 96px;
  border-radius: 999px;
  background: #020617;
  border: 1px solid #4b5563;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 999px;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.avatar-placeholder {
  font-size: 28px;
  font-weight: 600;
  color: #fed7aa;
  letter-spacing: 0.06em;
}

/* Online ring: вставляется как слой между рамкой и контентом аватара */
.avatar-online-ring {
  border-radius: inherit;
  padding: 2px;
  background: #22c55e;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.28);
}

.meta {
  flex: 1;
  min-width: 220px;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 8px;
  font-size: 14px;
}

.meta-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #9ca3af;
  margin-bottom: 2px;
}

.meta-value-main {
  font-size: 16px;
  font-weight: 500;
}

.meta-value-sub {
  font-size: 13px;
  color: #9ca3af;
}

/* Кнопки / действия */

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
  border-top: 1px solid #111827;
  padding-top: 9px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: #f97316;
  border-color: rgba(248,250,252,0.1);
  color: #0b1120;
  font-weight: 600;
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-ghost {
  background: #020617;
  border-color: #1f2937;
  color: #9ca3af;
}

.btn-ghost:hover {
  border-color: #4b5563;
  color: #e5e7eb;
}

.btn-outline {
  background: transparent;
  border-color: #374151;
  color: #9ca3af;
}

.btn-outline:hover {
  border-color: #f97316;
  color: #f97316;
}

/* Текстовые элементы */

.section-subtitle {
  font-size: 12px;
  color: #9ca3af;
  margin-bottom: 10px;
}

/* Таблицы рейтинга / турниров */

.rating-table,
.tournaments-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.rating-table th,
.rating-table td,
.tournaments-table th,
.tournaments-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #111827;
}

.rating-table th,
.tournaments-table th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9ca3af;
}

.rating-row-me {
  background: rgba(249,115,22,0.12);
}

.rating-row-me td {
  border-bottom-color: rgba(249,115,22,0.35);
}

.tournament-row-me {
  background: rgba(34,197,94,0.08);
}

/* Списки правил */

.rules-list {
  font-size: 13px;
  color: #d1d5db;
  padding-left: 18px;
}

.rules-list li {
  margin-bottom: 4px;
}

/* Мини-аватары в рейтинге */

.rating-avatar-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rating-avatar-mini {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid #4b5563;
  flex-shrink: 0;
  background: #020617;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: #fed7aa;
  transition: border-color 0.2s, transform 0.2s;
}

.rating-avatar-mini a {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: inherit;
}

.rating-avatar-cell:hover .rating-avatar-mini {
  border-color: #f97316;
  transform: scale(1.05);
}

.rating-avatar-mini img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.rating-name-main {
  font-size: 13px;
}

.rating-name-main a {
  color: #e5e7eb;
  text-decoration: none;
  transition: color 0.2s;
}

.rating-name-main a:hover {
  color: #f97316;
}

.rating-name-sub {
  font-size: 12px;
  color: #9ca3af;
}

.rating-player-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  display: block;
}

.rating-player-link:hover .rating-name-main {
  color: #f97316;
  text-decoration: underline;
}

.rating-player-link:hover .rating-avatar-mini {
  border-color: #f97316;
  transform: scale(1.05);
  transition: all 0.2s ease-in-out;
}

/* Админское меню (вторая строка) */
.admin-nav {
  margin-top: 0;
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
}

.rating-name-sub a {
  color: #9ca3af;
  text-decoration: none;
  transition: color 0.2s;
}

.rating-name-sub a:hover {
  color: #f97316;
  text-decoration: underline;
}

/* Обёртка для таблицы рейтинга (если захотим скролл) */

.rating-table-wrapper {
  overflow-y: visible;
}

/* Адаптив */

@media (max-width: 640px) {
  .top-nav-inner {
    padding: 10px 12px;
  }
  .wrapper {
    padding: 20px 12px 28px;
  }
}
/* Главная страница: баннеры и сетки */
.main-wrapper {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hero-card {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  background: radial-gradient(circle at top left, #1e293b, #020617);
}

.hero-main {
  flex: 1 1 260px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(15,23,42,0.9);
  border: 1px solid #1f2937;
  opacity: 0.9;
}

.hero-title {
  font-size: 22px;
  font-weight: 700;
}

.hero-subtitle {
  font-size: 14px;
  color: #9ca3af;
}

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

.hero-side {
  flex: 0 0 220px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hero-stat {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #1f2937;
  background: rgba(15,23,42,0.9);
  font-size: 12px;
}

.hero-stat-label {
  font-weight: 600;
  margin-bottom: 4px;
}

.hero-stat-value {
  color: #9ca3af;
  font-size: 12px;
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 18px;
}

.home-grid-small {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

@media (max-width: 800px) {
  .home-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.quick-actions-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.quick-action {
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #1f2937;
  background: #020617;
  text-decoration: none;
  color: #e5e7eb;
  font-size: 13px;
}

.quick-action:hover {
  border-color: #374151;
}

.quick-action-title {
  font-weight: 600;
  margin-bottom: 2px;
}

.quick-action-subtitle {
  font-size: 12px;
  color: #9ca3af;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
}

.badge-live {
  background: rgba(34,197,94,0.15);
  color: #4ade80;
  border: 1px solid rgba(34,197,94,0.4);
}

.tournament-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 4px 14px;
  font-size: 13px;
  margin-top: 6px;
}

.tournament-meta span {
  color: #9ca3af;
}

.card-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-start;
  gap: 8px;
}

.news-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.news-item {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #111827;
  background: #020617;
}

.news-date {
  font-size: 11px;
  color: #9ca3af;
  margin-bottom: 2px;
}

.news-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.news-text {
  font-size: 13px;
  color: #9ca3af;
}

.steps-list {
  margin-top: 8px;
  padding-left: 20px;
  font-size: 13px;
  color: #d1d5db;
}

.steps-list li + li {
  margin-top: 4px;
}
\n

/* ===== Роли администраторов (admin/roles) ===== */
.roles-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.roles-table th,
.roles-table td {
  border-bottom: 1px solid #1f2937;
  padding: 6px 8px;
  text-align: left;
}

.roles-table th {
  font-weight: 600;
  color: #9ca3af;
  font-size: 12px;
  text-transform: uppercase;
}

.chk-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.chk-label input[type="checkbox"] {
  width: 14px;
  height: 14px;
}

.cell-name .name-main {
  font-weight: 500;
}

.cell-name .name-sub {
  font-size: 11px;
  color: #9ca3af;
}

.actions-top {
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}


/* Роли администраторов */
.roles-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed; /* равномерно распределить ширину колонок */
}

.roles-table th,
.roles-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #1f2937;
}

.roles-table th {
  font-weight: 600;
  color: #9ca3af;
  font-size: 12px;
  text-transform: uppercase;
}

/* Имя + username в две строки как в админке */
.roles-table .cell-name .name-main {
  font-weight: 500;
}
.roles-table .cell-name .name-sub {
  font-size: 11px;
  color: #9ca3af;
}

/* Admin roles table width (2025-12-08) */
.roles-table {
  width: 100%;
}

/* Admin roles table layout override 2025-12-08 */
.roles-table {
  width: 100%;
  table-layout: fixed;   /* распределяем ширину по колонкам */
}

/* ID */
.roles-table th:nth-child(1),
.roles-table td:nth-child(1) {
  width: 6%;
}

/* Игрок (ФИО/ник) */
.roles-table th:nth-child(2),
.roles-table td:nth-child(2) {
  width: 38%;
}

/* Телефон */
.roles-table th:nth-child(3),
.roles-table td:nth-child(3) {
  width: 20%;
}

/* Главный админ и Админ зала */
.roles-table th:nth-child(4),
.roles-table td:nth-child(4),
.roles-table th:nth-child(5),
.roles-table td:nth-child(5) {
  width: 18%;
  white-space: nowrap;
}


/* roles-table override v2 */
.roles-table {
  width: 100% !important;
}


/* === /admin/roles: таблица ролей администраторов (растянуть по ширине) === */

.card .admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

/* Ячейки */
.card .admin-table th,
.card .admin-table td {
  border-bottom: 1px solid #1f2937;
  padding: 6px 8px;
  text-align: left;
}

/* Заголовок таблицы */
.card .admin-table th {
  font-weight: 600;
  color: #9ca3af;
  font-size: 12px;
  text-transform: uppercase;
}

/* Имя / ник / телега */
.card .admin-table .cell-name .name-main {
  font-weight: 500;
}

.card .admin-table .cell-name .name-sub {
  font-size: 11px;
  color: #9ca3af;
}

/* Чекбоксы ролей */
.card .admin-table .chk-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.card .admin-table .chk-label input[type="checkbox"] {
  width: 14px;
  height: 14px;
}

