/* Player HUB — слой как в clan-forge-pro-main (HubPage / HubNavbar) */

/* Широкая колонка только у основного контента и футера; навигация — обычный .section-container (80rem) */
.section-container.hub-body-wide {
  max-width: 80rem;
}

/* Порядок загрузки Tailwind CDN и др. стилей может перебивать max-width — фиксируем для хаба */
.hub-forge-content > .section-container.hub-body-wide,
.hub-forge-content > main.section-container.hub-body-wide,
.hub-forge-content > footer .section-container.hub-body-wide {
  max-width: 80rem !important;
  width: 100%;
  box-sizing: border-box;
}

/* Только верхняя полоса навбара; в мобильной панели оставляем свои размеры иконок */
nav > div.section-container:first-child .hub-nav-pill i {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  font-size: 0.88em;
  line-height: 1;
  vertical-align: -0.06em;
}

/* «Перейти в клан» в ряду с пунктами меню — заметнее, без имени клана */
.hub-nav-pill.hub-nav-enter-clan {
  border: 1px solid hsl(var(--primary) / 0.5);
  background: hsl(var(--primary) / 0.14);
  color: hsl(var(--primary));
  font-weight: 600;
  box-shadow: 0 0 20px -6px hsl(var(--primary) / 0.45);
}

.hub-nav-pill.hub-nav-enter-clan:hover {
  background: hsl(var(--primary) / 0.22);
  color: hsl(var(--primary));
  border-color: hsl(var(--primary) / 0.65);
}

/* Фон: радиальные пятна + сетка (pointer-events: none) */
.hub-forge-bg {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.hub-forge-blob-1 {
  position: absolute;
  left: 33%;
  top: 0;
  width: min(600px, 90vw);
  height: min(600px, 90vw);
  border-radius: 50%;
  opacity: 0.1;
  transform: translate(-50%, -15%);
  background: radial-gradient(circle, hsl(var(--primary) / 0.2), transparent 70%);
}

.hub-forge-blob-2 {
  position: absolute;
  bottom: 0;
  right: 25%;
  width: min(500px, 80vw);
  height: min(500px, 80vw);
  border-radius: 50%;
  opacity: 0.1;
  transform: translate(25%, 20%);
  background: radial-gradient(circle, hsl(var(--secondary) / 0.15), transparent 70%);
}

.hub-forge-grid {
  position: absolute;
  inset: 0;
  opacity: 0.018;
  background-image:
    linear-gradient(hsl(var(--primary) / 0.3) 1px, transparent 1px),
    linear-gradient(90deg, hsl(var(--primary) / 0.3) 1px, transparent 1px);
  background-size: 80px 80px;
}

html.light .hub-forge-blob-1,
html.light .hub-forge-blob-2 {
  opacity: 0.12;
}

html.light .hub-forge-grid {
  opacity: 0.04;
}

/* Оболочка контента поверх фона */
.hub-forge-content {
  position: relative;
  z-index: 1;
  width: 100%;
  min-width: 0;
}

/* Карточка приветствия (HubWelcome): декоративные круги */
.hub-welcome-deco-1 {
  position: absolute;
  right: -5rem;
  top: -5rem;
  width: 16rem;
  height: 16rem;
  border-radius: 50%;
  opacity: 0.2;
  background: radial-gradient(circle, hsl(var(--primary) / 0.4), transparent 70%);
}

.hub-welcome-deco-2 {
  position: absolute;
  bottom: -4rem;
  left: -4rem;
  width: 12rem;
  height: 12rem;
  border-radius: 50%;
  opacity: 0.15;
  background: radial-gradient(circle, hsl(var(--secondary) / 0.3), transparent 70%);
}

.hub-welcome-grid {
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background-image:
    linear-gradient(hsl(var(--primary) / 0.5) 1px, transparent 1px),
    linear-gradient(90deg, hsl(var(--primary) / 0.5) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* Навигация — активный пункт как в HubNavbar (primary/15, не заливка) */
.hub-nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 0.5rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.2;
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.hub-nav-pill:hover {
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
}

.hub-nav-pill.is-active {
  background: hsl(var(--primary) / 0.15);
  color: hsl(var(--primary));
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.hub-nav-dropdown {
  position: relative;
  display: inline-flex;
}

.hub-nav-dropdown-trigger {
  cursor: pointer;
}

.hub-nav-dropdown-chevron {
  margin-left: 0.1rem;
  font-size: 0.72em !important;
  transition: transform 0.15s ease;
}

.hub-nav-dropdown.is-open .hub-nav-dropdown-chevron {
  transform: rotate(180deg);
}

.hub-nav-dropdown-panel {
  position: absolute;
  left: 0;
  top: calc(100% + 0.45rem);
  z-index: 60;
  display: none;
  min-width: 13.5rem;
  padding: 0.35rem;
  border: 1px solid hsl(var(--border) / 0.7);
  border-radius: 0.85rem;
  background: hsl(var(--background) / 0.96);
  box-shadow: 0 18px 45px -28px hsl(var(--primary) / 0.65);
  backdrop-filter: blur(14px);
}

.hub-nav-dropdown.is-open .hub-nav-dropdown-panel {
  display: grid;
  gap: 0.15rem;
}

.hub-nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 0.65rem;
  padding: 0.58rem 0.7rem;
  color: hsl(var(--muted-foreground));
  font-size: 0.84rem;
  font-weight: 650;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.hub-nav-dropdown-item:hover,
.hub-nav-dropdown-item:focus-visible {
  background: hsl(var(--muted) / 0.8);
  color: hsl(var(--foreground));
  outline: none;
}

.hub-nav-dropdown-item.is-active {
  background: hsl(var(--primary) / 0.15);
  color: hsl(var(--primary));
}

.hub-panel-header {
  background: linear-gradient(135deg, hsl(var(--primary) / 0.45) 0%, hsl(220 28% 12%) 100%);
  border-bottom: 1px solid hsl(var(--border));
}

html.light .hub-panel-header {
  background: linear-gradient(135deg, hsl(var(--primary) / 0.65) 0%, hsl(217 45% 38%) 100%);
}

.hub-panel-header h1,
.hub-panel-header h2,
.hub-panel-header .hub-panel-title {
  color: #fff;
}

.hub-clan-pill {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.65rem;
  border-radius: 0.625rem;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--muted) / 0.4);
  max-width: 15rem;
  min-width: 0;
}

.hub-clan-pill-caption {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: hsl(var(--muted-foreground));
  line-height: 1.15;
}

.hub-clan-pill-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.08rem;
  min-width: 0;
}

.hub-clan-pill-name {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: hsl(var(--secondary));
  line-height: 1.2;
  word-break: break-word;
}

a.btn-primary.hub-nav-cta {
  padding: 0.45rem 0.9rem;
  font-size: 0.65rem;
  border-radius: 0.625rem;
  transform: none;
  white-space: nowrap;
}

a.btn-primary.hub-nav-cta:hover {
  transform: translateY(-1px);
}

/* Тиры: как в HubGamesPage (мягкие заливки) */
.hub-tier-pill {
  border-radius: 0.375rem;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.2;
}

.hub-tier-s {
  background: hsl(var(--stat-yellow) / 0.15);
  color: hsl(var(--stat-yellow));
}

.hub-tier-a {
  background: hsl(var(--secondary) / 0.15);
  color: hsl(var(--secondary));
}

.hub-tier-b {
  background: hsl(var(--primary) / 0.15);
  color: hsl(var(--primary));
}

.hub-tier-c,
.hub-tier-d,
.hub-tier-e {
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
}

/* Старые tier-badge для обратной совместимости */
.tier-badge {
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
  min-width: 24px;
  text-align: center;
  font-size: 11px;
  vertical-align: middle;
  line-height: 1.2;
}

.tier-S { color: #A28D46; border: 1px solid #A28D46; }
.tier-A { color: #A13D46; border: 1px solid #A13D46; }
.tier-B { color: #944E80; border: 1px solid #944E80; }
.tier-C { color: #5D5DA1; border: 1px solid #5D5DA1; }
.tier-D { color: #559854; border: 1px solid #559854; }
.tier-E { color: #979797; border: 1px solid #979797; }
