* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #050505;
  --panel: #0f0f0f;
  --panel-light: #181818;
  --text: #f5f5f5;
  --muted: #c9c9c9;
  --border: #2a2a2a;
  --accent: #ffffff;
  --accent-strong: #f1f1f1;
  --highlight: #f24141;
  --shadow: 0 20px 70px rgba(0, 0, 0, 0.45);
  --radius: 18px;
  --transition: 0.42s cubic-bezier(0.22, 1, 0.36, 1);
  --ranking-open-label: 'Открыть полный рейтинг';
}

/* Themes */
.theme-red {
  --highlight: #f24141;
  --bg: radial-gradient(circle at top, rgba(255,255,255,0.06), transparent 35%), linear-gradient(180deg, #050505 0%, #020202 100%);
  --panel: #0f0f0f;
  --panel-light: #181818;
  --text: #f5f5f5;
  --muted: #c9c9c9;
  --border: #2a2a2a;
  --accent: #ffffff;
  --accent-strong: #f1f1f1;
  --shadow: 0 20px 70px rgba(242, 65, 65, 0.15);
}

.theme-acid {
  --highlight: #00ff00;
  --bg: radial-gradient(circle at top, rgba(0,255,0,0.06), transparent 35%), linear-gradient(180deg, #0a0a0a 0%, #050505 100%);
  --panel: #0f1f0f;
  --panel-light: #1a2a1a;
  --text: #e5ffe5;
  --muted: #b8ffb8;
  --border: #2a4a2a;
  --accent: #ffffff;
  --accent-strong: #f1fff1;
  --shadow: 0 20px 70px rgba(0, 255, 0, 0.15);
}

.theme-purple {
  --highlight: #9c27b0;
  --bg: radial-gradient(circle at top, rgba(156,39,176,0.06), transparent 35%), linear-gradient(180deg, #0a050a 0%, #050205 100%);
  --panel: #1a0f1a;
  --panel-light: #2a1a2a;
  --text: #f5e5f5;
  --muted: #e1b8e1;
  --border: #4a2a4a;
  --accent: #ffffff;
  --accent-strong: #fff1ff;
  --shadow: 0 20px 70px rgba(156, 39, 176, 0.15);
}

.theme-blue {
  --highlight: #2196f3;
  --bg: radial-gradient(circle at top, rgba(33,150,243,0.06), transparent 35%), linear-gradient(180deg, #050a0a 0%, #020505 100%);
  --panel: #0f1a1f;
  --panel-light: #182a3a;
  --text: #e5f5ff;
  --muted: #bcdfff;
  --border: #2a4a5a;
  --accent: #ffffff;
  --accent-strong: #f1f9ff;
  --shadow: 0 20px 70px rgba(33, 150, 243, 0.15);
}

.theme-ember {
  --highlight: #ff7a18;
  --bg: radial-gradient(circle at top, rgba(255,122,24,0.08), transparent 35%), linear-gradient(180deg, #120805 0%, #050202 100%);
  --panel: #1d110d;
  --panel-light: #2b1a14;
  --text: #fff0e7;
  --muted: #f0c5ae;
  --border: #5a3426;
  --accent: #fff8f4;
  --accent-strong: #fff4ee;
  --shadow: 0 24px 72px rgba(255, 122, 24, 0.18);
}

.theme-frost {
  --highlight: #8de7ff;
  --bg: radial-gradient(circle at top, rgba(141,231,255,0.08), transparent 35%), linear-gradient(180deg, #04090d 0%, #010305 100%);
  --panel: #0d171d;
  --panel-light: #14242d;
  --text: #ecfbff;
  --muted: #b9d7df;
  --border: #29434f;
  --accent: #f7fdff;
  --accent-strong: #effbff;
  --shadow: 0 24px 72px rgba(141, 231, 255, 0.16);
}

.theme-sand {
  --highlight: #d9b45f;
  --bg: radial-gradient(circle at top, rgba(217,180,95,0.08), transparent 35%), linear-gradient(180deg, #0f0c07 0%, #040302 100%);
  --panel: #17120d;
  --panel-light: #231d15;
  --text: #faf3df;
  --muted: #d9c8a0;
  --border: #4d4028;
  --accent: #fffdf7;
  --accent-strong: #fff8ea;
  --shadow: 0 24px 72px rgba(217, 180, 95, 0.18);
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Apple Color Emoji', 'Noto Color Emoji', Tahoma, Geneva, Verdana, sans-serif;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.04), transparent 20%);
  pointer-events: none;
}

.chat-button-icon,
.settings-btn,
.item-logo,
.item-stat,
.player-badge,
.empty-icon,
.avatar-option,
.banned-icon,
.achievement-icon,
.avatar-placeholder-large,
.avatar-placeholder-small,
#navAvatarPlaceholder {
  font-family: 'Segoe UI Emoji', 'Segoe UI Symbol', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(14px);
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 0;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.profile-button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  background: var(--panel);
}

.chat-button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: visible;
  background: var(--panel);
  color: var(--text);
  position: relative;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.chat-button:hover,
.chat-button.active {
  border-color: var(--highlight);
  background: var(--panel-light);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  transform: translateY(-2px);
}

.chat-button-icon {
  font-size: 18px;
  line-height: 1;
}

.chat-button-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--highlight);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  border: 2px solid var(--panel);
}

.profile-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.settings-buttons {
  display: flex;
  gap: 10px;
}

.settings-btn {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: transform 0.35s ease, box-shadow 0.35s ease, background 0.35s ease, border-color 0.35s ease;
}

.settings-btn:hover {
  background: var(--panel-light);
  border-color: var(--highlight);
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.dropdown-menu {
  position: fixed;
  top: 70px;
  right: 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 15px;
  min-width: 150px;
  display: block;
  z-index: 1000;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-8px) scale(0.96);
  transform-origin: top right;
  filter: blur(8px);
  transition: opacity 0.34s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.34s cubic-bezier(0.22, 1, 0.36, 1),
              filter 0.34s cubic-bezier(0.22, 1, 0.36, 1),
              visibility 0s linear 0.34s;
  backdrop-filter: blur(22px);
}

.dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  filter: blur(0);
  transition: opacity 0.38s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
              filter 0.38s cubic-bezier(0.22, 1, 0.36, 1),
              visibility 0s linear 0s;
}

.dropdown-header {
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text);
}

.badge-info-trigger {
  border: none;
  background: transparent;
  padding: 0;
  margin-left: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  vertical-align: middle;
}

.badge-info-trigger:hover {
  transform: translateY(-1px);
}

.badge-info-trigger.is-open {
  transform: translateY(-1px) scale(1.03);
}

.badge-label-text {
  font-size: 0.78rem;
  color: var(--muted);
}


.badge-tooltip {
  position: absolute;
  top: 0;
  left: 0;
  width: min(320px, calc(100vw - 24px));
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, rgba(19, 23, 31, 0.98), rgba(10, 13, 18, 0.96));
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.38);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, -8px) scale(0.96);
  transition: opacity 0.26s ease, transform 0.26s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.26s ease;
  z-index: 160;
}

.badge-tooltip.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0) scale(1);
}

.badge-tooltip::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: calc(100% - 1px);
  width: 14px;
  height: 14px;
  background: inherit;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  transform: translateX(-50%) rotate(45deg);
}

.badge-legend-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.badge-legend-copy strong {
  display: block;
  font-size: 0.98rem;
}

.badge-legend-copy p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.badge-legend-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
}

.dropdown-menu button {
  display: block;
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: none;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.28s ease, transform 0.28s ease, opacity 0.28s ease;
  opacity: 0;
  transform: translateY(-6px);
}

.dropdown-menu button:hover {
  background: var(--panel-light);
  transform: translateX(4px);
}

.dropdown-menu.show button {
  opacity: 1;
  transform: translateY(0);
}

.dropdown-menu.show button:nth-of-type(1) {
  transition-delay: 0.04s;
}

.dropdown-menu.show button:nth-of-type(2) {
  transition-delay: 0.07s;
}

.dropdown-menu.show button:nth-of-type(3) {
  transition-delay: 0.1s;
}

.dropdown-menu.show button:nth-of-type(4) {
  transition-delay: 0.13s;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-mark {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 12px 24px rgba(0, 0, 0, 0.22);
}

.logo-mark svg,
.logo-mark img {
  display: block;
}

.brand-mark-image {
  width: 36px;
  height: 36px;
  display: block;
}

.logo-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.logo-subtitle {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.nav-link {
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  transition: transform 0.35s ease, background 0.35s ease, color 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
}

.nav-link:hover {
  color: var(--accent);
  background: var(--panel-light);
  transform: translateY(-1px);
}

.nav-link.active {
  background: linear-gradient(var(--panel), var(--panel)) padding-box,
              linear-gradient(135deg, var(--highlight), rgba(255,255,255,0.55)) border-box;
  border: 1px solid transparent;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(255,255,255,0.04) inset;
}

.nav-button {
  border: 1px solid var(--border);
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--panel);
}

.nav-button.secondary {
  background: var(--highlight);
  color: #fff;
  border-color: transparent;
}

.main-content {
  padding: 0 0 90px;
}

body.maintenance-mode .navbar {
  display: none;
}

body.maintenance-mode .main-content {
  padding-top: 0;
}

body.maintenance-mode .site-access-banner {
  display: none !important;
}

.page {
  display: none;
  opacity: 0;
  transform: translateY(26px) scale(0.992);
  transform-origin: top center;
  will-change: opacity, transform;
}

.page.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
  animation: pageReveal 0.62s cubic-bezier(0.22, 1, 0.36, 1);
}

.page.active:not(.landing-page):not(.auth-page) > .container {
  margin-top: -10px;
}

#home.page.active {
  margin-top: 0;
}

#home.page.active > .container {
  position: relative;
  top: -72px;
  margin-top: 0;
}

.page.active > .container,
.page.active > .container > * {
  animation: pageContentLift 0.72s cubic-bezier(0.22, 1, 0.36, 1);
}

.card,
.admin-card,
.item-card,
.friend-card,
.social-panel,
.social-subpanel,
.chat-message,
.mail-item,
.user-row,
.team-row,
.nav-link,
.settings-btn,
.btn {
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition), background var(--transition), color var(--transition), opacity var(--transition), filter var(--transition);
}

@keyframes pageReveal {
  0% {
    opacity: 0;
    transform: translateY(28px) scale(0.985);
    filter: blur(10px);
  }
  55% {
    opacity: 1;
    transform: translateY(-2px) scale(1);
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes pageContentLift {
  0% {
    opacity: 0;
    transform: translateY(16px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-page {
  min-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
}

.auth-card {
  max-width: 540px;
  width: 100%;
  padding: 32px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.auth-shell {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(420px, 1.08fr);
  gap: 24px;
  align-items: stretch;
}

.auth-intro-card {
  display: grid;
  align-content: start;
  gap: 18px;
}

.auth-card-wide {
  max-width: none;
}

.compact-auth-header {
  margin-bottom: 18px;
}

.auth-feature-list {
  display: grid;
  gap: 14px;
}

.auth-wide-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.auth-wide-form input,
.auth-wide-form textarea,
.auth-wide-form select {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--panel-light);
  color: var(--text);
}

.auth-wide-form button,
.auth-wide-form .form-span-2 {
  grid-column: 1 / -1;
}

.auth-note {
  margin-top: 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.landing-page {
  min-height: calc(100vh - 88px);
  display: block;
}

.landing-inner {
  display: grid;
  place-items: start center;
  min-height: calc(100vh - 88px);
  padding-top: clamp(4px, 1.8vh, 18px);
}

.landing-text {
  text-align: center;
  max-width: 860px;
  backdrop-filter: blur(24px);
  padding: 60px 48px;
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.015));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 28px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.landing-text::before {
  content: '';
  position: absolute;
  top: -120px;
  left: -80px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(242, 65, 65, 0.22) 0%, transparent 72%);
  pointer-events: none;
}

.landing-text::after {
  content: '';
  position: absolute;
  right: -70px;
  bottom: -80px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.09) 0%, transparent 70%);
  pointer-events: none;
}

.landing-tag {
  color: var(--highlight);
  text-transform: uppercase;
  letter-spacing: 0.48em;
  font-size: 12px;
  margin-bottom: 18px;
  display: inline-block;
  position: relative;
  z-index: 1;
}

.hero-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 0 auto 26px;
  padding: 16px 22px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.09);
  background: rgba(0, 0, 0, 0.24);
  position: relative;
  z-index: 1;
}

.hero-brand-mark {
  width: 86px;
  height: 86px;
  border-radius: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(145deg, rgba(255,255,255,0.12), rgba(255,255,255,0.03));
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.28);
}

.hero-brand-image {
  width: 68px;
  height: 68px;
  display: block;
}

.hero-brand-copy {
  text-align: left;
}

.hero-brand-title {
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #fff;
}

.hero-brand-subtitle {
  margin-top: 8px;
  max-width: 460px;
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.72);
}

.landing-text h1 {
  font-size: clamp(3.5rem, 6vw, 6.1rem);
  line-height: 0.92;
  letter-spacing: -0.05em;
  margin-bottom: 22px;
  color: #fff;
  text-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
  position: relative;
  z-index: 1;
}

.landing-text p {
  color: rgba(255,255,255,0.86);
  font-size: 20px;
  line-height: 1.75;
  margin: 0 auto 34px;
  max-width: 700px;
  position: relative;
  z-index: 1;
}

.landing-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-bottom: 22px;
  position: relative;
  z-index: 1;
}

.btn {
  border-radius: 999px;
  transition: transform 0.4s ease, background 0.35s ease, color 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.2);
}

.btn-primary {
  background: var(--accent);
  color: var(--panel);
  border: 1px solid rgba(255,255,255,0.12);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent);
  border: 1px solid rgba(255,255,255,0.16);
}

.btn-ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(255,255,255,0.23);
}

.landing-footer {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.05em;
}

.page-top {
  margin-bottom: 24px;
  padding: 24px 26px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(255,255,255,0.055), rgba(255,255,255,0.018));
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.page-top::before,
.section-header::before {
  content: '';
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  top: -120px;
  right: -70px;
  background: radial-gradient(circle, rgba(242, 65, 65, 0.18) 0%, transparent 72%);
  pointer-events: none;
}

.section-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  margin-bottom: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.015));
  box-shadow: var(--shadow);
}

.section-brand.compact {
  margin-bottom: 12px;
}

.home-brand {
  margin-bottom: 10px;
}

.section-brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(145deg, rgba(255,255,255,0.12), rgba(255,255,255,0.03));
  border: 1px solid rgba(255,255,255,0.1);
}

.section-brand-mark svg {
  width: 30px;
  height: 30px;
}

.section-brand-copy {
  display: grid;
  gap: 2px;
}

.section-brand-title {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
}

.section-brand-subtitle {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
}

.page-top h2 {
  font-size: clamp(2.2rem, 3vw, 3.2rem);
  margin: 10px 0 10px;
  line-height: 1.05;
  color: #fff;
  letter-spacing: -0.04em;
}

.page-top p,
.section-header p {
  color: var(--muted);
  max-width: 720px;
  font-size: 16px;
  line-height: 1.55;
}

.section-label {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 12px;
  color: var(--highlight);
}

.home-grid,
.admin-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

#home > .container {
  display: grid;
  gap: 14px;
  margin-top: 0;
}

.home-top-teams-lead {
  margin-top: 0;
  margin-bottom: 2px;
  position: relative;
  z-index: 4;
  overflow: hidden;
}

.home-top-teams-lead .card-header {
  margin-bottom: 14px;
}

.featured-profiles-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(400px, 0.88fr);
  gap: 24px;
  margin-top: 0;
  margin-bottom: 14px;
  align-items: stretch;
  position: relative;
  z-index: 3;
}

.featured-sponsors-block {
  align-content: start;
  padding: 30px;
  min-height: 100%;
}

.featured-sponsors-grid {
  display: grid;
  gap: 14px;
}

.featured-profile-card {
  display: grid;
  gap: 18px;
  min-height: 100%;
  padding: 26px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(145deg, rgba(255,255,255,0.06), rgba(255,255,255,0.018));
  box-shadow: var(--shadow);
}

.featured-profile-card.interactive {
  cursor: pointer;
}

.featured-profile-card.interactive:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.14);
}

.featured-profile-card.large {
  min-height: 360px;
  padding: 34px;
}

.featured-profile-top {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 22px;
  align-items: start;
}

.featured-profile-avatar {
  width: 94px;
  height: 94px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255,255,255,0.05);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
}

.featured-profile-avatar.large {
  width: 156px;
  height: 156px;
  border-radius: 40px;
  font-size: 3rem;
}

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

.featured-profile-avatar.placeholder {
  background: linear-gradient(135deg, rgba(242, 65, 65, 0.4), rgba(255,255,255,0.08));
}

.featured-profile-main {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.featured-profile-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  min-height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
}

.featured-profile-name {
  margin: 0;
  font-size: 1.55rem;
  line-height: 1.08;
}

.featured-profile-card.large .featured-profile-name {
  font-size: clamp(2.4rem, 3.6vw, 3.4rem);
}

.featured-profile-identity {
  gap: 10px;
}

.featured-profile-description {
  margin: 0;
  color: rgba(255,255,255,0.84);
  line-height: 1.75;
  font-size: 1rem;
}

.featured-profile-card.large .featured-profile-description {
  max-width: 760px;
  font-size: 1.08rem;
}

.featured-profile-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.featured-profile-meta {
  color: var(--muted);
  font-size: 0.98rem;
}

.featured-profile-note {
  color: var(--muted);
  font-size: 0.95rem;
}

.scene-hero-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 0 0 24px;
}

.home-hero-banner {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.8fr);
  gap: 22px;
  margin-bottom: 26px;
}

.home-hero-main {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 22px;
  align-items: start;
  padding: 30px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.018));
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.home-hero-main::before {
  content: '';
  position: absolute;
  top: -110px;
  right: -80px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(242, 65, 65, 0.18), transparent 72%);
  pointer-events: none;
}

.home-hero-logo-wrap {
  width: 168px;
  height: 168px;
  padding: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 42px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(145deg, rgba(255,255,255,0.09), rgba(255,255,255,0.02));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 20px 38px rgba(0,0,0,0.24);
}

.home-hero-logo {
  width: 100%;
  height: 100%;
  display: block;
}

.home-hero-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
}

.home-hero-featured-grid {
  margin: 0 0 6px;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.home-hero-featured-grid .featured-profile-card.large .featured-profile-top {
  grid-template-columns: 1fr;
  justify-items: center;
  text-align: center;
}

.home-hero-featured-grid .featured-profile-card.large .featured-profile-main {
  justify-items: center;
}

.home-hero-featured-grid .featured-sponsors-block {
  padding: 24px;
  min-height: 100%;
}

.home-hero-featured-grid .featured-profile-card {
  padding: 24px;
  min-height: 100%;
}

.home-hero-featured-grid .featured-profile-card.large {
  min-height: 100%;
  padding: 28px;
}

.home-hero-featured-grid .featured-profile-avatar.large {
  width: 132px;
  height: 132px;
}

.home-hero-featured-grid .featured-profile-name {
  font-size: 1.8rem;
}

.home-hero-featured-grid .featured-profile-card.large .featured-profile-name {
  font-size: clamp(1.9rem, 2.6vw, 2.8rem);
}

.home-hero-featured-grid .featured-profile-description {
  font-size: 0.98rem;
}

.home-hero-featured-grid .featured-profile-footer {
  justify-content: center;
}

.home-hero-featured-grid .featured-sponsors-grid {
  gap: 12px;
}

.home-hero-featured-grid .featured-profile-card {
  border-radius: 26px;
}

.home-hero-copy h1 {
  font-size: clamp(2.8rem, 5vw, 4.8rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
  margin: 2px 0 0;
}

.home-hero-copy p {
  max-width: 720px;
  font-size: 17px;
  line-height: 1.72;
  color: rgba(255, 255, 255, 0.84);
}

.home-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.home-kd-card {
  min-height: 100%;
}

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

  .home-hero-featured-grid .featured-sponsors-block,
  .home-hero-featured-grid .featured-profile-card {
    min-width: 0;
  }

  .home-hero-featured-grid .featured-profile-card.large {
    min-height: 0;
  }
}

.scene-hero-card {
  position: relative;
  display: grid;
  gap: 16px;
  padding: 24px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(145deg, rgba(255,255,255,0.06), rgba(255,255,255,0.018));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.scene-hero-card::after {
  content: '';
  position: absolute;
  inset: auto -40px -40px auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.06), transparent 72%);
  pointer-events: none;
}

.scene-hero-card.compact {
  min-height: 100%;
}

.scene-hero-head {
  display: grid;
  gap: 6px;
}

.scene-hero-head h3 {
  margin: 0;
  font-size: 1.55rem;
}

.scene-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.scene-stat-card {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.scene-stat-card strong {
  font-size: 1.25rem;
  color: #fff;
}

.scene-stat-card span {
  color: var(--muted);
  line-height: 1.45;
}

.scene-mini-list {
  display: grid;
  gap: 10px;
}

.scene-mini-item {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  text-align: left;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  cursor: pointer;
}

.scene-mini-item:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.14);
}

.scene-mini-rank {
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
}

.scene-mini-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.scene-mini-main span {
  color: var(--muted);
  line-height: 1.45;
}

.tournament-card {
  cursor: pointer;
}

.tournament-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.2);
}

.tournament-empty-state {
  display: grid;
  gap: 14px;
  justify-items: center;
  text-align: center;
  padding: 42px 30px;
}

@media (max-width: 960px) {
  .featured-profiles-grid,
  .home-grid,
  .admin-grid,
  .items-grid {
    grid-template-columns: 1fr;
  }

  .site-access-banner {
    flex-direction: column;
    align-items: stretch;
    padding: 18px;
  }

  .site-access-banner-actions {
    justify-content: flex-start;
  }

  .maintenance-card {
    padding: 26px 22px;
  }

  .maintenance-status-row {
    align-items: flex-start;
  }

  .main-content {
    padding-top: 8px;
  }
}

.card,
.admin-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.admin-card {
  min-width: 0;
}

.admin-users-card {
  grid-column: 1 / -1;
}

.card-header {
  margin-bottom: 18px;
}

.card-subtitle {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.6;
}

.card-header h3 {
  font-size: 20px;
}

.news-list {
  display: grid;
  gap: 18px;
}

.news-feed-item,
.news-story-card {
  position: relative;
}

.news-feed-item.release,
.news-story-card.release {
  border-color: rgba(255, 208, 72, 0.28);
  background: linear-gradient(180deg, rgba(255, 208, 72, 0.08), rgba(255,255,255,0.03));
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.16);
}

.news-feed-item.release::before,
.news-story-card.release::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(255, 208, 72, 0.12);
  pointer-events: none;
}

.news-story-card.featured {
  border-color: rgba(255, 208, 72, 0.24);
}

.news-story-pin {
  display: inline-flex;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(255, 208, 72, 0.12);
  color: #ffd86c;
}

.news-story-category {
  display: inline-flex;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.84);
}

.news-feed-item.release .news-story-category,
.news-story-card.release .news-story-category {
  background: rgba(255, 208, 72, 0.14);
  color: #ffd86c;
}

.news-card article,
.player-card,
.item-card,
.user-row,
.team-row {
  background: var(--panel-light);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
}

.news-card article {
  display: grid;
  gap: 10px;
}

.news-card h4 {
  margin: 0;
  font-size: 18px;
}

.news-card p {
  color: rgba(255,255,255,0.82);
  line-height: 1.65;
}

.card p,
.auth-note,
.ranking-subtitle,
.item-info p,
.public-profile-meta p,
.compact-card p,
.status-row p,
.info-block p {
  color: rgba(255,255,255,0.82);
}

.table-wrap {
  overflow-x: auto;
}

.top-team-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 320px;
}

.top-team-table th,
.top-team-table td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.top-team-table th {
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.top-team-table tbody tr:hover {
  background: var(--panel-light);
}

.top-team-table tbody tr.clickable-row {
  cursor: pointer;
  transition: background 0.35s ease, transform 0.35s ease;
}

.wide-card {
  grid-column: 1 / -1;
}

.home-status-list,
.home-info-grid,
.ranking-info-grid {
  display: grid;
  gap: 16px;
}

.home-info-grid,
.ranking-info-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.status-row,
.info-block {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel-light);
}

.status-row {
  grid-template-columns: 12px 1fr;
  align-items: start;
}

.status-row p,
.info-block p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  margin-top: 6px;
  background: linear-gradient(135deg, #ff9a3c, #ff5030);
  box-shadow: 0 0 18px rgba(255, 100, 48, 0.45);
}

.history-nav {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  display: grid;
  gap: 10px;
}

.history-btn {
  width: 52px;
  height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(11, 13, 18, 0.88);
  color: var(--text);
  font-size: 30px;
  line-height: 1;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(16px);
  transition: transform 0.25s ease, opacity 0.25s ease, border-color 0.25s ease;
}

.history-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--highlight);
}

.history-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

@media (max-width: 960px) {
  .home-info-grid,
  .ranking-info-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .history-nav {
    right: 12px;
    bottom: 12px;
  }

  .history-btn {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    font-size: 28px;
  }
}

.top-team-table tbody tr.clickable-row:hover {
  transform: translateX(4px);
}

.top-team-table td:first-child {
  width: 40px;
  font-weight: 700;
}

.top-team-table td:nth-child(3) {
  color: var(--highlight);
  font-weight: 700;
}

.top-teams-home-card .card-subtitle {
  margin: 6px 0 0;
}

.rank-team-cell {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.rank-team-flag {
  display: inline-flex;
  width: 24px;
  height: 18px;
}

.rank-team-meta {
  color: var(--muted);
  font-size: 12px;
}

.team-points-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.team-points-value {
  font-weight: 700;
}

.ftp-link-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--highlight);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}

.ftp-link-button:hover {
  color: #ffd280;
}

.rank-move {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.rank-move.compact {
  min-width: 38px;
  padding: 2px 6px;
}

.rank-move.positive {
  color: #9ef0b4;
  background: rgba(52, 168, 83, 0.18);
}

.rank-move.negative {
  color: #ffb0b0;
  background: rgba(242, 65, 65, 0.18);
}

.rank-move.neutral {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.08);
}

.player-identity-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.player-identity-flag {
  display: inline-flex;
  align-items: center;
}

.ftp-info-card {
  padding: 28px;
}

.ftp-info-actions {
  margin-top: 22px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
  padding: 22px 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(255,255,255,0.045), rgba(255,255,255,0.015));
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.section-header h2 {
  margin: 0;
}

.text-center {
  text-align: center;
}

.admin-top {
  align-items: start;
  gap: 22px;
}

.admin-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.admin-table {
  display: grid;
  gap: 14px;
  max-width: 100%;
  overflow-x: auto;
}

#usersList,
#adminPlayersList {
  display: grid;
  gap: 12px;
}

.user-row,
.team-row {
  display: grid;
  grid-template-columns: 1.4fr 1.8fr 1fr 1fr;
  gap: 14px;
  align-items: center;
}

.user-row > div,
.team-row > div {
  line-height: 1.4;
}

.user-row .user-actions,
.team-row .team-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.user-role-select,
.official-checkbox {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel-light);
  color: var(--text);
}

.player-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(242, 65, 65, 0.15);
  color: #fff;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.badge-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.1) inset, 0 6px 16px rgba(0,0,0,0.18);
}

.badge-check::before {
  content: '';
  width: 8px;
  height: 4px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
}

.badge-blue {
  background: linear-gradient(135deg, #48a3ff, #1f6fff);
}

.badge-green {
  background: linear-gradient(135deg, #49df8c, #139e56);
}

.badge-gold {
  background: linear-gradient(135deg, #fff5b7, #ffd45f 38%, #f0a900 72%, #fff3bf);
  background-size: 220% 220%;
  animation: badgeGoldShimmer 3.2s ease-in-out infinite;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.12) inset, 0 10px 24px rgba(255, 194, 61, 0.32), 0 0 24px rgba(255, 208, 72, 0.26);
}

.badge-crimson {
  background: linear-gradient(135deg, #ff9a7a, #f13e57 52%, #a9002d);
}

.badge-violet {
  background: linear-gradient(135deg, #f0a9ff, #9f62ff 48%, #5230d8);
}

.badge-prism {
  background: linear-gradient(120deg, #ff6a6a, #ffd95c, #57f0aa, #57adff, #b772ff, #ff6a6a);
  background-size: 300% 300%;
  animation: badgePrismShift 5.2s linear infinite;
}

.badge-prism::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  background: linear-gradient(120deg, rgba(255, 106, 106, 0.42), rgba(255, 217, 92, 0.4), rgba(87, 240, 170, 0.34), rgba(87, 173, 255, 0.38), rgba(183, 114, 255, 0.42));
  filter: blur(7px);
  opacity: 0.78;
  z-index: -1;
  animation: badgePrismPulse 2.8s ease-in-out infinite;
}

@keyframes badgeGoldShimmer {
  0%,
  100% {
    background-position: 0% 50%;
    transform: translateY(0);
  }
  50% {
    background-position: 100% 50%;
    transform: translateY(-1px);
  }
}

@keyframes badgePrismShift {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 100% 50%;
  }
}

@keyframes badgePrismPulse {
  0%,
  100% {
    opacity: 0.62;
    transform: scale(0.98);
  }
  50% {
    opacity: 0.95;
    transform: scale(1.06);
  }
}

.badge-legend-rarity {
  display: block;
  margin-top: 4px;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.stats-grid {
  display: grid;
  gap: 16px;
}

.stat-card {
  background: var(--panel-light);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  text-align: center;
}

.stat-value {
  font-size: 36px;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 6px;
}

.stat-label {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 120;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.show {
  display: flex;
}

.modal-content {
  width: 100%;
  max-width: 520px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: 32px;
  box-shadow: var(--shadow);
  position: relative;
}

.auth-modal-content {
  max-width: 680px;
}

.close {
  position: absolute;
  top: 18px;
  right: 18px;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
}

.auth-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 28px;
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
}

.auth-form input,
.auth-form textarea,
.auth-form select {
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--panel-light);
  color: var(--text);
}

.auth-form input:focus,
.auth-form textarea:focus,
.auth-form select:focus {
  outline: none;
  border-color: var(--highlight);
}

.auth-form button {
  width: 100%;
}

.footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 768px) {
  .nav-row,
  .section-header,
  .admin-top,
  .footer-inner {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .nav-menu {
    justify-content: center;
  }

  .user-row,
  .team-row {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    gap: 10px;
  }

  .ranking-header,
  .public-profile-head,
  .hltv-team-hero,
  .tournament-detail-head {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .public-profile-avatar-wrap {
    margin: 0 auto;
  }

  .hltv-team-flag,
  .tournament-logo-box {
    margin: 0 auto;
  }

  .public-profile-stats {
    grid-template-columns: 1fr;
  }

  .hltv-team-grid {
    grid-template-columns: 1fr;
  }
}

.item-card {
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  background-color: var(--panel-light);
  transition: transform 0.45s ease, border-color 0.35s ease, box-shadow 0.35s ease, background-color 0.35s ease;
  cursor: pointer;
}

.item-card:hover {
  border-color: var(--highlight);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transform: translateY(-5px);
}

.item-card-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
}

.item-logo {
  width: 60px;
  height: 60px;
  background-color: var(--panel);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  border: 1px solid var(--border);
}

.item-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

.item-info h3 {
  margin: 0;
  font-size: 18px;
}

.item-info p {
  color: var(--muted);
  font-size: 14px;
  margin: 5px 0 0 0;
}

.item-stats {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
  font-size: 14px;
}

.item-stat {
  display: flex;
  align-items: center;
  gap: 5px;
}

.item-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.item-actions button {
  flex: 1;
  padding: 8px;
  border: 1px solid var(--border);
  background-color: var(--panel);
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 12px;
  color: var(--text);
}

.item-actions button:hover {
  background-color: var(--highlight);
  color: var(--accent);
}

.team-detail-actions {
  margin-top: 12px;
}

.item-stat .team-points-wrap {
  gap: 6px;
}

.btn-danger {
  background: rgba(242, 65, 65, 0.16);
  border-color: rgba(242, 65, 65, 0.3);
  color: #fff;
}

.btn-danger:hover {
  background: #f24141;
  border-color: #f24141;
}

.ranking-preview {
  cursor: pointer;
}

.ranking-preview::after {
  content: var(--ranking-open-label);
  display: block;
  margin-top: 10px;
  color: var(--highlight);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.users-list {
  display: grid;
  gap: 10px;
}

.user-item {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel-light);
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.user-item:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
}

.user-rank-wrap,
.rank-user-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.user-rank,
.table-rank-number {
  min-width: 18px;
  font-weight: 800;
  color: #fff;
}

.user-avatar-mini,
.table-rank-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  overflow: visible;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.06);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  position: relative;
}

.user-avatar-mini img,
.table-rank-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}

.user-name {
  min-width: 0;
  font-weight: 700;
  color: #fff;
}

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

.identity-country-flag {
  width: 18px;
  height: 14px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
}

.identity-country-name {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
}

.flag-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 14px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 9px;
  color: var(--muted);
}

.profile-country-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.profile-country-grid > div {
  display: grid;
  gap: 8px;
}

.admin-country-editor {
  display: grid;
  grid-template-columns: 84px 1fr auto;
  gap: 8px;
  align-items: center;
}

.admin-country-editor input,
.admin-country-editor select,
.profile-country-grid select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel-light);
  color: var(--text);
}

.admin-country-editor .btn {
  white-space: nowrap;
}

.user-rating {
  font-weight: 700;
  color: rgba(255,255,255,0.82);
}

.top-team-table th,
.top-team-table td {
  padding: 10px 12px;
}

.ranking-card {
  display: grid;
  gap: 22px;
}

.ranking-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.ranking-subtitle {
  color: var(--muted);
  margin-top: 6px;
}

.public-profile-card {
  display: grid;
  gap: 24px;
}

.public-profile-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 22px;
  align-items: center;
}

.public-profile-avatar-wrap {
  width: 120px;
  height: 120px;
  border-radius: 28px;
  overflow: visible;
  border: 1px solid var(--border);
  background: var(--panel-light);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.online-indicator {
  position: absolute;
  right: -6px;
  bottom: -4px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 3px solid var(--panel);
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.16);
}

.online-indicator.online {
  background: linear-gradient(135deg, #52ff9a, #15bf58);
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.16), 0 0 22px rgba(82, 255, 154, 0.45);
}

.presence-dot {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-flex;
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.presence-dot.online {
  background: linear-gradient(135deg, #52ff9a, #15bf58);
  box-shadow: 0 0 16px rgba(82, 255, 154, 0.42);
}

.home-info-card {
  display: grid;
  gap: 12px;
  min-height: 100%;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.02));
}

.home-info-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.clickable-card {
  cursor: pointer;
  transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}

.clickable-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.22);
}

.public-profile-avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.public-profile-meta {
  display: grid;
  gap: 10px;
}

.public-profile-meta h3 {
  font-size: 34px;
}

.public-profile-meta p {
  color: var(--muted);
  line-height: 1.6;
}

.public-profile-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.public-profile-medals {
  margin-top: 4px;
}

.public-medal-chip-list {
  margin-top: 6px;
}

.public-profile-title-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.public-profile-stats {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hltv-team-card,
.tournament-detail-card {
  display: grid;
  gap: 24px;
}

.hltv-team-hero,
.tournament-detail-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
}

.hltv-team-flag,
.tournament-logo-box {
  width: 110px;
  height: 110px;
  border-radius: 28px;
  background: var(--panel-light);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  overflow: hidden;
}

.team-flag-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tournament-logo-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hltv-team-head,
.tournament-detail-meta {
  display: grid;
  gap: 10px;
}

.hltv-team-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compact-card {
  padding: 22px;
}

.compact-card h3 {
  margin-bottom: 14px;
}

.roster-list {
  display: grid;
  gap: 10px;
}

.roster-item {
  display: grid;
  grid-template-columns: 28px 32px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  background: var(--panel-light);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.roster-index {
  color: var(--muted);
  font-weight: 700;
}

.roster-flag {
  display: inline-flex;
  align-items: center;
}

.roster-flag-image {
  width: 24px;
  height: 18px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.card-flag-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}
}

.roster-name {
  font-weight: 600;
}

.team-coach-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
}

.player-detail-card {
  gap: 20px;
}

.player-detail-hero {
  align-items: start;
}

.player-detail-info,
.player-detail-stats-grid {
  display: grid;
  gap: 14px;
}

.player-detail-stats-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ranking-branch-card {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.ranking-branch-side {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(255, 107, 53, 0.18), rgba(255, 107, 53, 0.05));
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text);
}

.ranking-branch-main {
  display: grid;
  gap: 14px;
  padding: 18px 20px;
}

.mini-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mini-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
}

.mini-chip:hover {
  border-color: rgba(255, 107, 53, 0.35);
  transform: translateY(-1px);
}

.btn-small {
  padding: 8px 12px;
  min-height: auto;
  width: auto;
}

.hltv-bracket {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.bracket-round {
  display: grid;
  gap: 14px;
}

.bracket-round-title {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--highlight);
}

.bracket-round-matches {
  display: grid;
  gap: 14px;
}

.bracket-match {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 16px;
  background: var(--panel-light);
  border: 1px solid var(--border);
}

.bracket-team {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  font-weight: 600;
}

/* Admin Panel */
.admin-dashboard {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
}

.admin-section {
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 25px;
  background-color: var(--panel);
}

.admin-section h3 {
  margin-bottom: 20px;
  font-size: 20px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 10px;
  color: var(--text);
}

.users-table {
  overflow-x: auto;
}

.user-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.3fr) minmax(120px, 0.8fr) minmax(140px, 0.95fr) minmax(260px, 1.35fr) minmax(90px, 0.7fr) minmax(90px, 0.7fr) minmax(70px, 0.5fr) minmax(110px, 0.7fr) minmax(150px, 0.9fr);
  gap: 15px;
  padding: 15px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  background: var(--panel-light);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
}

.user-row:hover {
  background-color: var(--panel);
}

.admin-player-row {
  grid-template-columns: minmax(180px, 1.3fr) minmax(110px, 0.7fr) minmax(180px, 1fr) minmax(90px, 0.6fr);
}

.btn-small {
  padding: 8px 12px;
  font-size: 13px;
}

.banned-page {
  min-height: calc(100vh - 160px);
  display: grid;
  place-items: center;
}

.banned-card {
  max-width: 620px;
  margin: 0 auto;
  padding: 48px 32px;
  text-align: center;
}

.banned-icon {
  font-size: 72px;
  margin-bottom: 18px;
}

.banned-card h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  margin-bottom: 14px;
  color: #fff;
}

.banned-card p {
  margin: 0 auto 26px;
  max-width: 520px;
  font-size: 18px;
  line-height: 1.75;
  color: rgba(255,255,255,0.82);
}

.user-role-select {
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  background: var(--panel-light);
  color: var(--text);
}

.user-badge-select {
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  background: var(--panel-light);
  color: var(--text);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.stat-card {
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  background-color: var(--panel-light);
  transition: var(--transition);
}

.stat-card:hover {
  border-color: var(--highlight);
  transform: scale(1.05);
}

.stat-value {
  font-size: 36px;
  font-weight: bold;
  color: var(--accent);
  margin-bottom: 10px;
}

.stat-label {
  color: var(--muted);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.3s ease;
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: var(--secondary-color);
  padding: 30px;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  position: relative;
  box-shadow: 0 4px 40px rgba(0, 0, 0, 0.3);
}

.close {
  position: absolute;
  right: 15px;
  top: 15px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  color: var(--primary-color);
  transition: var(--transition);
}

.close:hover {
  color: #ff6b6b;
}

.modal-content h3 {
  margin-bottom: 20px;
  font-size: 24px;
}

.modal-content form {
  display: flex;
  flex-direction: column;
}

.modal-content input,
.modal-content textarea,
.modal-content select {
  padding: 12px;
  margin-bottom: 15px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 14px;
  transition: var(--transition);
  background: var(--panel-light);
  color: var(--text);
}

.modal-content input:focus,
.modal-content textarea:focus,
.modal-content select:focus {
  outline: none;
  border-color: var(--highlight);
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}

.modal-content textarea {
  resize: vertical;
  min-height: 100px;
  font-family: inherit;
}
.site-access-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(145deg, rgba(255, 208, 72, 0.15), rgba(255, 255, 255, 0.05));
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.site-access-banner::before {
  content: '';
  position: absolute;
  inset: -80px auto auto -90px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 208, 72, 0.16), transparent 70%);
  pointer-events: none;
}
.site-access-banner-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 6px;
  min-width: 0;
}
.site-access-banner-copy h2 {
  margin: 0;
  font-size: clamp(1.5rem, 2.2vw, 2.1rem);
  line-height: 1.05;
  color: #fff;
}
.site-access-banner-copy p {
  margin: 0;
  max-width: 780px;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.65;
}
.site-access-banner-actions {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.site-access-countdown {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 116px;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.22);
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.maintenance-page {
  min-height: calc(100vh - 88px);
}
.maintenance-shell {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 88px);
  padding: 40px 0 60px;
}
.maintenance-card {
  width: min(760px, 100%);
  display: grid;
  gap: 16px;
  padding: 34px;
  border-radius: 32px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(145deg, rgba(255,255,255,0.07), rgba(255,255,255,0.02));
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.maintenance-card::before {
  content: '';
  position: absolute;
  inset: auto -70px -80px auto;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(242, 65, 65, 0.18), transparent 72%);
  pointer-events: none;
}
.maintenance-card h1 {
  margin: 0;
  font-size: clamp(2.3rem, 4vw, 4rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
  color: #fff;
}
.maintenance-card p {
  margin: 0;
  max-width: 640px;
  color: rgba(255, 255, 255, 0.84);
  line-height: 1.7;
  font-size: 1.02rem;
}
.maintenance-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.maintenance-status-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 208, 72, 0.12);
  color: #ffd86c;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.admin-maintenance-card {
  grid-column: 1 / -1;
}
.site-access-admin-copy {
  display: grid;
  gap: 12px;
}
.site-access-admin-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}
.site-access-admin-countdown {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.site-access-admin-state {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.site-access-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
}

#createNewsModal .modal-content input,
#createNewsModal .modal-content textarea {
  color: var(--text);
  caret-color: var(--accent);
  background: var(--panel-light);
}

#createNewsModal .modal-content input::placeholder,
#createNewsModal .modal-content textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}

#createNewsModal .modal-content input:focus,
#createNewsModal .modal-content textarea:focus {
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06), 0 0 0 3px rgba(242, 65, 65, 0.16);
}

.auth-modal-content {
  max-width: 920px;
  padding: 0;
  overflow: hidden;
}

#createPlayerModal .modal-content {
  max-width: 860px;
}

#playerForm {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

#playerForm button {
  grid-column: 1 / -1;
}

.auth-modal-layout {
  display: grid;
  grid-template-columns: minmax(250px, 320px) minmax(0, 1fr);
}

.auth-modal-side {
  display: grid;
  align-content: center;
  gap: 14px;
  padding: 34px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(160deg, rgba(242, 65, 65, 0.12), rgba(255, 255, 255, 0.03));
}

#authModal .modal-content form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 34px;
}

.tournament-modal-content {
  max-width: 960px;
}

.tournament-form-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.tournament-form-grid .form-span-2 {
  grid-column: 1 / -1;
}

.tournament-form-grid textarea {
  min-height: 120px;
}

.swiss-setting.is-hidden {
  display: none;
}

/* Footer */
.footer {
  background-color: var(--panel);
  color: var(--text);
  text-align: center;
  padding: 20px;
  margin-top: 40px;
  border-top: 2px solid var(--border);
}

/* Mobile overrides for the deployed layout */
@media (max-width: 768px) {
  .main-content {
    padding: 12px 0 56px;
  }

  .items-grid,
  .scene-hero-grid,
  .scene-stat-grid,
  .home-hero-banner,
  .profile-overview {
    grid-template-columns: 1fr;
  }

  .home-hero-main {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    padding: 24px 20px;
  }

  .home-hero-featured-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .home-hero-featured-grid .featured-profile-card.large,
  .home-hero-featured-grid .featured-profile-card,
  .home-hero-featured-grid .featured-sponsors-block {
    padding: 18px;
  }

  .home-hero-featured-grid .featured-profile-avatar.large {
    width: 120px;
    height: 120px;
  }

  .profile-cover-topbar {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 22px 18px 0;
  }

  .profile-cover-meta-strip {
    justify-content: center;
  }

  .home-hero-actions {
    justify-content: center;
  }

  .home-hero-logo-wrap {
    width: 132px;
    height: 132px;
    border-radius: 32px;
  }

  .navbar {
    position: static;
  }

  .nav-row {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 10px 0;
  }

  .logo {
    justify-content: center;
  }

  .nav-menu {
    justify-content: center;
    gap: 8px;
  }

  .nav-menu li {
    display: flex;
  }

  .nav-link {
    width: 100%;
    justify-content: center;
    text-align: center;
    padding: 10px 12px;
  }

  .nav-right {
    justify-content: center;
    gap: 10px;
  }

  .chat-button,
  .profile-button {
    width: 44px;
    height: 44px;
  }

  .landing-page,
  .landing-inner {
    min-height: auto;
  }

  .landing-text {
    padding: 28px 18px;
    border-radius: 20px;
  }

  .section-brand {
    flex-direction: column;
    text-align: center;
  }

  .hero-brand {
    flex-direction: column;
    gap: 14px;
    padding: 16px;
  }

  .hero-brand-copy {
    text-align: center;
  }

  .profile-cover-bg {
    height: auto;
    min-height: 380px;
  }

  .profile-info-large {
    width: 100%;
  }

  .profile-info-large h1 {
    font-size: 1.8rem;
    overflow-wrap: anywhere;
  }

  #profileDescriptionLarge {
    overflow-wrap: anywhere;
  }

  .profile-stats {
    gap: 14px;
  }

  .landing-text h1 {
    font-size: clamp(2.6rem, 11vw, 3.7rem);
    line-height: 1.02;
  }

  .landing-text p {
    font-size: 17px;
  }

  .landing-buttons {
    flex-direction: column;
  }

  .landing-buttons .btn,
  .section-header .btn,
  .admin-buttons .btn {
    width: 100%;
  }

  .profile-cover-bg {
    height: 360px;
  }

  .profile-cover-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .profile-info-section,
  .profile-settings-section {
    padding: 18px;
  }

  .profile-stats,
  .item-stats,
  .public-profile-badges {
    flex-wrap: wrap;
    justify-content: center;
  }

  .profile-country-grid,
  .admin-country-editor {
    grid-template-columns: 1fr;
  }

  .items-grid,
  .home-grid,
  .admin-grid,
  .profile-content {
    grid-template-columns: 1fr;
  }

  .item-card,
  .card,
  .admin-card {
    padding: 18px;
  }

  .item-card-header {
    align-items: flex-start;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .nav-menu {
    gap: 15px;
  }

  .hero h2 {
    font-size: 32px;
  }

  .hero p {
    font-size: 18px;
  }

  .items-grid {
    grid-template-columns: 1fr;
  }

  .user-row {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .hero-buttons {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .auth-container {
    padding: 20px;
  }
}

.avatar-gallery {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 15px;
}

.avatar-gallery button:hover,
.avatar-gallery button.selected {
  border-color: var(--highlight);
  background: var(--panel-light);
}

.avatar-gallery button {
  width: 50px;
  height: 50px;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: var(--panel);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: var(--transition);
  color: var(--text);
}

/* Facebook-like Profile Styles */
.profile-cover {
  margin-bottom: 28px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.profile-overview {
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(0, 1.18fr);
  gap: 20px;
  align-items: start;
}

.profile-info-section,
.profile-settings-section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 22px;
}

.profile-info-display {
  display: grid;
  gap: 0;
}

.info-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.info-row:last-child {
  border-bottom: none;
}

.settings-group {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.settings-group:last-of-type {
  margin-bottom: 0;
}

.settings-group label,
.info-label,
.info-row span {
  letter-spacing: normal;
  word-spacing: normal;
  text-align: left;
}

.settings-group label {
  display: block;
  font-weight: 600;
  color: var(--muted);
}

.info-row > span:last-child {
  overflow-wrap: anywhere;
}

.profile-settings-section form {
  display: grid;
  gap: 0;
}

.profile-cover-bg {
  min-height: 340px;
  background:
    radial-gradient(circle at 18% 20%, rgba(255,255,255,0.12), transparent 28%),
    radial-gradient(circle at 82% 24%, rgba(242, 65, 65, 0.28), transparent 32%),
    linear-gradient(135deg, #181818 0%, #0d0d0f 58%, #1a0909 100%);
  position: relative;
}

.profile-cover-topbar {
  position: absolute;
  top: 22px;
  left: 24px;
  right: 24px;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.profile-cover-kicker {
  display: grid;
  gap: 6px;
}

.profile-cover-kicker .section-label {
  margin: 0;
}

.profile-cover-kicker-text {
  color: rgba(255,255,255,0.72);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.profile-cover-identity-text {
  max-width: 540px;
  color: rgba(255,255,255,0.9);
  font-size: 0.95rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.profile-cover-meta-strip {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.profile-cover-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(10, 10, 12, 0.42);
  backdrop-filter: blur(14px);
  color: #fff;
  font-size: 0.92rem;
}

.profile-cover-chip.online {
  border-color: rgba(82, 255, 154, 0.32);
  box-shadow: 0 0 22px rgba(82, 255, 154, 0.12);
}

.profile-cover-chip-badge {
  min-height: 44px;
  padding: 8px 14px;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.profile-cover-chip-badge .profile-badge-list,
.public-profile-badge-list,
.featured-profile-badges,
.identity-badges,
.medal-chip-list,
.public-medal-chip-list {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.profile-cover-chip-badge .profile-badge-list {
  max-width: min(100%, 420px);
}

.badge-collection {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.badge-collection .badge-info-trigger,
.identity-badges .badge-info-trigger,
.featured-profile-badges .badge-info-trigger,
.profile-badge-list .badge-info-trigger,
.public-profile-badge-list .badge-info-trigger {
  margin-left: 0;
}

.badge-count-pill,
.medal-count-pill,
.medal-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.02em;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
}

.medal-empty {
  width: fit-content;
}

.profile-cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.1), rgba(0,0,0,0.4));
}

.profile-cover-content {
  position: absolute;
  bottom: 26px;
  left: 26px;
  right: 26px;
  display: flex;
  align-items: center;
  gap: 26px;
  color: white;
}

.profile-avatar-large {
  width: 148px;
  height: 148px;
  border-radius: 34px;
  border: 3px solid rgba(255,255,255,0.18);
  overflow: visible;
  background: rgba(11, 11, 14, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 60px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.36);
  position: relative;
}

.profile-avatar-large img,
.public-profile-avatar-wrap img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  padding: 10px;
  border-radius: inherit;
  background: rgba(255,255,255,0.02);
}

.profile-info-large {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.profile-username-line {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.profile-username-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.24);
  transform: translateY(1px);
  cursor: pointer;
}

.profile-cover-chip .profile-username-badge {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  transform: none;
  box-shadow: none;
}

.profile-username-badge.badge-check::before {
  width: 8px;
  height: 4px;
}

.avatar-placeholder-large {
  font-size: 60px;
}

#navAvatarPlaceholder,
.avatar-placeholder-large,
.avatar-placeholder-small {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
}

#navAvatarPlaceholder {
  font-size: 16px;
  background: linear-gradient(135deg, var(--highlight), rgba(255,255,255,0.22));
}

.public-profile-avatar-wrap,
.profile-avatar-large,
.profile-button,
.chat-button {
  background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
}

.profile-button img,
.chat-button img,
.profile-button img {
  background: var(--panel-light);
}

.profile-info-large h1 {
  margin: 0 0 5px 0;
  font-size: 2.2rem;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

#profileDescriptionLarge,
.profile-description-large {
  margin: 0;
  opacity: 0.9;
  font-size: 1.1rem;
  max-width: 760px;
}

.profile-stats {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.stat-item {
  min-width: 112px;
  padding: 14px 16px;
  text-align: center;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(12px);
}

.stat-number {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
}

.stat-label {
  font-size: 0.9rem;
  opacity: 0.8;
}

.profile-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: 20px;
  background: var(--panel);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.profile-nav-btn {
  flex: 1 1 140px;
  padding: 15px 20px;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
  border-right: 1px solid var(--border);
}

.profile-nav-btn:last-child {
  border-right: none;
}

.profile-nav-btn:hover {
  background: var(--panel-light);
  color: var(--text);
}

.profile-nav-btn.active {
  background: var(--highlight);
  color: white;
}

.profile-content {
  display: block;
}

.profile-tab {
  display: none;
}

.profile-tab.active {
  display: block;
}

.profile-tab-static {
  display: block;
}

/* Timeline Styles */
.timeline-post-form {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}

.post-form-header {
  display: flex;
  align-items: center;
  gap: 15px;
}

.post-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--panel-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 25px;
}

.avatar-placeholder-small {
  font-size: 25px;
}

.post-input {
  flex: 1;
}

.post-input input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 50px;
  background: var(--panel-light);
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
}

.post-input input:hover {
  border-color: var(--highlight);
  background: var(--panel);
}

.timeline-posts {
  display: grid;
  gap: 20px;
}

.timeline-post {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.timeline-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.timeline-empty .empty-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  opacity: 0.5;
}

/* About Section */
.about-section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.about-info {
  display: grid;
  gap: 15px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.info-item:last-child {
  border-bottom: none;
}

.info-label {
  font-weight: 500;
  color: var(--muted);
}

/* Friends and Teams Grid */
.friends-grid,
.teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
}

.friend-card,
.team-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px;
  text-align: center;
  transition: var(--transition);
}

.friend-card:hover,
.team-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.friend-avatar,
.team-logo {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  margin: 0 auto 10px;
  background: var(--panel-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
}

.social-panel,
.social-subpanel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.social-panel {
  padding: 20px;
}

.social-subpanel {
  padding: 16px;
}

.tab-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.tab-header-row h3,
.social-subpanel h4 {
  margin: 0 0 6px;
}

.tab-header-row p {
  margin: 0;
  color: var(--muted);
}

.social-search-row,
.chat-form {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.social-search-row input,
.chat-form input,
.mail-compose input,
.mail-compose textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-light);
  color: var(--text);
}

.mail-compose {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.mail-compose textarea {
  min-height: 120px;
  resize: vertical;
}

.social-list,
.mail-list {
  display: grid;
  gap: 12px;
}

.compact-list {
  margin-bottom: 18px;
}

.request-columns,
.mail-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.social-row,
.mail-item,
.chat-message {
  background: var(--panel-light);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.social-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 14px;
}

.social-row-main,
.chat-message-main {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.social-row .friend-avatar,
.chat-message .friend-avatar,
.mail-item .friend-avatar {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  margin: 0;
  font-size: 20px;
}

.social-user-name,
.mail-title,
.chat-author {
  font-weight: 700;
}

.social-user-meta,
.mail-meta,
.chat-time,
.social-user-description {
  color: var(--muted);
  font-size: 0.9rem;
}

.social-user-description,
.mail-body,
.chat-text {
  margin-top: 4px;
  line-height: 1.45;
}

.social-row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.friends-grid {
  margin-top: 4px;
}

.friend-card {
  text-align: left;
}

.friend-card .friend-avatar {
  margin: 0 0 12px;
}

.friend-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.mail-item {
  padding: 14px;
}

.mail-item.unread {
  border-color: rgba(255, 107, 53, 0.45);
  box-shadow: 0 0 0 1px rgba(255, 107, 53, 0.15);
}

.mail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.chat-shell {
  padding: 24px;
  padding-bottom: 16px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(10, 14, 20, 0.92), rgba(18, 22, 30, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.chat-form {
  flex-wrap: wrap;
  gap: 12px;
}

.chat-page-shell {
  margin-top: 20px;
  min-height: calc(100vh - 240px);
}

.chat-messages {
  display: grid;
  gap: 12px;
  min-height: 620px;
  max-height: 72vh;
  overflow-y: auto;
  padding: 8px 8px 8px 0;
  margin-bottom: 16px;
}

.chat-message {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(10px);
}

.chat-message.own {
  border-color: rgba(255, 107, 53, 0.35);
  background: rgba(255, 107, 53, 0.1);
}

.chat-image-wrap {
  margin-top: 10px;
}

.chat-image {
  display: block;
  max-width: min(100%, 360px);
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel);
  object-fit: cover;
}

.chat-message-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.badge-counter {
  display: inline-flex;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  margin-left: 6px;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  font-size: 0.8rem;
}

@media (max-width: 900px) {
  .request-columns,
  .mail-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .auth-shell,
  .auth-modal-layout,
  .auth-wide-form,
  .tournament-form-grid {
    grid-template-columns: 1fr;
  }

  .auth-page {
    align-items: start;
  }

  .auth-modal-side {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 24px;
  }

  #authModal .modal-content form {
    padding: 24px;
  }

  .social-search-row,
  .chat-form,
  .tab-header-row,
  .social-row {
    flex-direction: column;
    align-items: stretch;
  }

  .profile-nav-btn {
    flex: 1 1 100%;
  }

  .social-row-actions,
  .mail-actions {
    justify-content: flex-start;
  }

  .admin-actions {
    grid-template-columns: 1fr;
  }

  .hltv-team-hero,
  .tournament-detail-head,
  .ranking-branch-card,
  .hltv-team-grid,
  .player-detail-stats-grid {
    grid-template-columns: 1fr;
  }

  .ranking-branch-side {
    min-height: 62px;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .chat-messages {
    min-height: 420px;
    max-height: 520px;
  }

  #playerForm {
    grid-template-columns: 1fr;
  }
}

/* Achievements */
.achievements-grid {
  display: grid;
  gap: 15px;
}

.achievement-item {
  display: flex;
  align-items: center;
  gap: 15px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px;
}

.achievement-item.locked {
  opacity: 0.6;
}

.achievement-icon {
  width: 50px;
  height: 50px;
  background: var(--panel-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 25px;
}

.achievement-info h4 {
  margin: 0 0 5px 0;
  font-size: 1.1rem;
}

.achievement-info p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.profile-awards-section {
  margin-top: 8px;
}

.medals-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.medal-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-height: 112px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.1);
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  position: relative;
  overflow: hidden;
}

.medal-card.owned {
  box-shadow: 0 18px 28px rgba(0, 0, 0, 0.22);
}

.medal-card.locked {
  opacity: 0.56;
  filter: saturate(0.75);
}

.medal-card-icon {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: #fff;
  font-size: 28px;
  background: rgba(255,255,255,0.08);
  box-shadow: 0 12px 24px rgba(0,0,0,0.22);
}

.medal-card.medal-gold .medal-card-icon {
  background: linear-gradient(135deg, rgba(255, 243, 168, 0.28), rgba(255, 208, 79, 0.34), rgba(217, 144, 0, 0.42));
}

.medal-card.medal-violet .medal-card-icon {
  background: linear-gradient(135deg, rgba(232, 184, 255, 0.24), rgba(172, 109, 255, 0.32), rgba(106, 59, 212, 0.42));
}

.medal-card.medal-azure .medal-card-icon {
  background: linear-gradient(135deg, rgba(130, 215, 255, 0.24), rgba(45, 135, 255, 0.32), rgba(22, 83, 215, 0.42));
}

.medal-card.medal-crimson .medal-card-icon {
  background: linear-gradient(135deg, rgba(255, 178, 143, 0.22), rgba(255, 92, 122, 0.3), rgba(185, 15, 67, 0.42));
}

.medal-card.medal-emerald .medal-card-icon {
  background: linear-gradient(135deg, rgba(159, 242, 183, 0.22), rgba(53, 201, 111, 0.3), rgba(13, 138, 69, 0.42));
}

.medal-card.medal-green .medal-card-icon {
  background: linear-gradient(135deg, rgba(136, 239, 176, 0.22), rgba(24, 184, 102, 0.3), rgba(10, 122, 67, 0.42));
}

.medal-card.medal-amber .medal-card-icon {
  background: linear-gradient(135deg, rgba(255, 226, 154, 0.22), rgba(255, 180, 78, 0.3), rgba(204, 109, 0, 0.42));
}

.medal-card.medal-sand .medal-card-icon {
  background: linear-gradient(135deg, rgba(255, 232, 189, 0.22), rgba(216, 176, 107, 0.3), rgba(139, 96, 50, 0.42));
}

.medal-card.medal-prism .medal-card-icon {
  background: linear-gradient(120deg, rgba(255, 106, 106, 0.24), rgba(255, 217, 92, 0.24), rgba(87, 240, 170, 0.24), rgba(87, 173, 255, 0.24), rgba(183, 114, 255, 0.28));
}

.medal-card-copy {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 8px;
}

.medal-card-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.medal-card-topline h4 {
  margin: 0;
  font-size: 1rem;
}

.medal-card-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.medal-card-footer {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.medal-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: #fff;
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}

.medal-chip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 12px;
}

.medal-chip-text {
  font-weight: 600;
}

.medal-chip.owned {
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.medal-chip.locked {
  opacity: 0.55;
  filter: grayscale(0.2);
}

.medal-card.medal-gold,
.medal-chip.medal-gold,
.award-toggle-medal-icon.medal-gold {
  background: linear-gradient(135deg, #fff3a8, #ffd04f 45%, #d99000 100%);
}

.medal-card.medal-violet,
.medal-chip.medal-violet,
.award-toggle-medal-icon.medal-violet {
  background: linear-gradient(135deg, #e8b8ff, #ac6dff 48%, #6a3bd4 100%);
}

.medal-card.medal-azure,
.medal-chip.medal-azure,
.award-toggle-medal-icon.medal-azure {
  background: linear-gradient(135deg, #82d7ff, #2d87ff 48%, #1653d7 100%);
}

.medal-card.medal-crimson,
.medal-chip.medal-crimson,
.award-toggle-medal-icon.medal-crimson {
  background: linear-gradient(135deg, #ffb28f, #ff5c7a 50%, #b90f43 100%);
}

.medal-card.medal-emerald,
.medal-chip.medal-emerald,
.award-toggle-medal-icon.medal-emerald {
  background: linear-gradient(135deg, #9ff2b7, #35c96f 50%, #0d8a45 100%);
}

.medal-card.medal-green,
.medal-chip.medal-green,
.award-toggle-medal-icon.medal-green {
  background: linear-gradient(135deg, #88efb0, #18b866 50%, #0a7a43 100%);
}

.medal-card.medal-amber,
.medal-chip.medal-amber,
.award-toggle-medal-icon.medal-amber {
  background: linear-gradient(135deg, #ffe29a, #ffb44e 52%, #cc6d00 100%);
}

.medal-card.medal-sand,
.medal-chip.medal-sand,
.award-toggle-medal-icon.medal-sand {
  background: linear-gradient(135deg, #ffe8bd, #d8b06b 52%, #8b6032 100%);
}

.medal-card.medal-prism,
.medal-chip.medal-prism,
.award-toggle-medal-icon.medal-prism {
  background: linear-gradient(120deg, #ff6a6a, #ffd95c, #57f0aa, #57adff, #b772ff, #ff6a6a);
  background-size: 320% 320%;
  animation: medalPrismShift 5.4s linear infinite;
}

@keyframes medalPrismShift {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 100% 50%;
  }
}

.medal-rarity-pill,
.medal-supply-pill,
.medal-state-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.02em;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: #fff;
}

.medal-state-pill {
  color: var(--muted);
}

.awards-modal-content {
  width: min(980px, calc(100vw - 24px));
}

.awards-form {
  display: grid;
  gap: 18px;
}

.awards-section {
  display: grid;
  gap: 12px;
}

.awards-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.awards-section-head h4 {
  margin: 0;
}

.awards-section-head span {
  color: var(--muted);
  font-size: 0.88rem;
}

.award-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.award-toggle {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--panel-light);
  cursor: pointer;
  position: relative;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.award-toggle:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,0.16);
}

.award-toggle.selected {
  border-color: rgba(255, 208, 72, 0.38);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
}

.award-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.award-toggle-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.award-toggle-copy strong {
  font-size: 0.96rem;
}

.award-toggle-copy span {
  color: var(--muted);
  font-size: 0.82rem;
}

.award-toggle-icon,
.award-toggle-medal-icon {
  flex: 0 0 auto;
}

.award-toggle-medal-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 15px;
  box-shadow: 0 8px 18px rgba(0,0,0,0.18);
}

.badge-collection,
.identity-badges,
.featured-profile-badges,
.profile-badge-list,
.public-profile-badge-list,
.medal-chip-list,
.public-medal-chip-list {
  transform: translateY(0);
}

/* Settings */
.settings-section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.settings-group {
  margin-bottom: 25px;
}

.settings-group label {
  display: block;
  margin-bottom: 10px;
  font-weight: 500;
  color: var(--text);
}

.settings-group textarea {
  width: 100%;
  min-height: 100px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-light);
  color: var(--text);
  resize: vertical;
}

.settings-group select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-light);
  color: var(--text);
}

.avatar-gallery {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 15px;
}

.avatar-option {
  width: 50px;
  height: 50px;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: var(--panel);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: var(--transition);
  color: var(--text);
  font-family: 'Segoe UI Emoji', 'Segoe UI Symbol', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
}

.avatar-option:hover,
.avatar-option.selected {
  border-color: var(--highlight);
  background: var(--panel-light);
}

/* Admin Panel */
.admin-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 20px;
}

.admin-panel h3 {
  margin-bottom: 15px;
  color: var(--highlight);
  font-size: 1.2rem;
}

.admin-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-actions .btn {
  width: 100%;
  min-height: 54px;
  justify-content: flex-start;
  gap: 10px;
  white-space: normal;
  text-align: left;
  align-items: center;
}

.btn-danger:hover {
  background: #c82333;
  border-color: #bd2130;
}

/* User Management */
.user-row.banned {
  background: rgba(220, 53, 69, 0.1);
  border-left: 4px solid #dc3545;
}

.user-header {
  background: var(--panel-light);
  font-weight: 600;
  border-bottom: 2px solid var(--border);
}

.user-header div {
  color: var(--text);
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  margin-bottom: 40px;
}

.empty-icon {
  font-size: 80px;
  margin-bottom: 20px;
  opacity: 0.7;
  font-family: 'Segoe UI Emoji', 'Segoe UI Symbol', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
}

.empty-state h1 {
  font-size: 38px;
  margin-bottom: 10px;
  color: #fff;
}

.empty-state p {
  font-size: 19px;
  color: rgba(255,255,255,0.84);
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.7;
}

.mt-2 {
  margin-top: 15px;
}

.mb-2 {
  margin-bottom: 15px;
}

@media (max-width: 768px) {
  #home.page.active {
    margin-top: 0;
  }

  #home.page.active > .container {
    position: relative;
    top: -92px;
    margin-top: 0;
  }

  #home > .container {
    gap: 8px;
    margin-top: 0;
  }

  .home-top-teams-lead {
    margin-top: 0;
    margin-bottom: 4px;
  }

  .navbar {
    position: sticky;
    top: 0;
  }

  .nav-row {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 0;
    text-align: left;
  }

  .logo {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: flex-start;
    gap: 10px;
  }

  .logo-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }

  .brand-mark-image {
    width: 32px;
    height: 32px;
  }

  .logo-subtitle {
    display: none;
  }

  .nav-menu {
    order: 3;
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    gap: 6px;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

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

  .nav-menu li {
    display: inline-flex;
    flex: 0 0 auto;
  }

  .nav-link {
    width: auto;
    white-space: nowrap;
    padding: 8px 11px;
  }

  .nav-right {
    gap: 8px;
    flex: 0 0 auto;
    justify-content: flex-end;
  }

  .featured-profiles-grid {
    gap: 14px;
    margin-top: 0;
    margin-bottom: 10px;
  }

  .featured-sponsors-block,
  .featured-profile-card,
  .featured-profile-card.large {
    padding: 20px;
    border-radius: 22px;
  }

  .featured-profile-card.large {
    min-height: 0;
  }

  .profile-cover {
    margin-bottom: 18px;
  }

  .profile-cover-bg {
    min-height: 0;
    height: auto;
  }

  .profile-cover-topbar {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    display: grid;
    justify-items: start;
    align-content: start;
    gap: 10px;
    padding: 18px 18px 0;
    text-align: left;
  }

  .profile-cover-kicker,
  .profile-cover-meta-strip {
    width: 100%;
  }

  .profile-cover-meta-strip {
    justify-content: flex-start;
    gap: 8px;
  }

  .profile-cover-chip {
    min-height: 36px;
    padding: 8px 12px;
    font-size: 0.85rem;
  }

  .profile-cover-identity-text {
    font-size: 0.88rem;
  }

  .profile-cover-content {
    position: relative;
    bottom: auto;
    left: auto;
    right: auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    padding: 16px 18px 18px;
    text-align: left;
  }

  .profile-avatar-large {
    width: 118px;
    height: 118px;
    border-radius: 28px;
  }

  .profile-info-large,
  .profile-info-section,
  .profile-settings-section,
  .public-profile-card,
  .public-profile-meta {
    width: 100%;
    min-width: 0;
  }

  .profile-info-large h1,
  .public-profile-meta h3 {
    font-size: clamp(2rem, 10vw, 2.7rem);
    line-height: 0.95;
    overflow-wrap: anywhere;
  }

  .profile-cover-bg.has-cover-identity #profileDescriptionLarge {
    display: none;
  }

  .profile-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
  }

  .profile-stats .stat-item {
    min-width: 0;
    width: 100%;
    padding: 12px 14px;
  }

  .profile-stats .stat-item:last-child {
    grid-column: 1 / -1;
  }

  .profile-overview,
  .public-profile-head,
  .public-profile-stats {
    grid-template-columns: 1fr;
  }

  .public-profile-head {
    gap: 16px;
    text-align: left;
    align-items: start;
  }

  .public-profile-avatar-wrap {
    margin: 0;
    width: 96px;
    height: 96px;
    border-radius: 22px;
  }

  .public-profile-badges {
    justify-content: flex-start;
  }

  .public-profile-head .btn {
    width: 100%;
  }
}
