/* UI-3 — Full Nexus reference frontend layer */

:root {
  --nx-page-bg: #eef1f6;
  --nx-board-bg: #ffffff;
  --nx-board-radius: 24px;
  --nx-card-bg: #ffffff;
  --nx-card-border: rgba(5, 11, 31, 0.08);
  --nx-sidebar-width: 248px;
  --nx-accent: #6338ff;
  --nx-accent-soft: rgba(99, 56, 255, 0.12);
  --nx-muted: #5f6d86;
  --nx-ink: #050b1f;
}

:root[data-theme="night"] {
  --nx-page-bg: #0b0e14;
  --nx-board-bg: #10141c;
  --nx-card-bg: #151a24;
  --nx-card-border: rgba(255, 255, 255, 0.07);
  --nx-muted: #9aa3b5;
  --nx-ink: #f2f4f8;
  --nx-accent: #6320ee;
  --nx-accent-soft: rgba(99, 32, 238, 0.14);
}

body.nx-active {
  background: var(--nx-page-bg) !important;
}

body.nx-active::before,
body.nx-active::after {
  display: none !important;
}

body.nx-active .noise {
  opacity: 0.04 !important;
}

.nx-page {
  width: 100%;
  min-width: 0;
}

.nx-board {
  display: grid;
  grid-template-columns: var(--nx-sidebar-width) minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  width: 100%;
  min-height: calc(100vh - 24px);
  background: var(--nx-board-bg);
  border: 1px solid var(--nx-card-border);
  border-radius: var(--nx-board-radius);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.nx-sidebar {
  padding: 16px 14px;
  border-right: 1px solid var(--nx-card-border);
  background: var(--nx-board-bg);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 100%;
}

.nx-main {
  min-width: 0;
  padding: 16px 18px 20px;
  display: grid;
  gap: 14px;
  align-content: start;
}

.nx-logo-lockup,
.nexus-brand-lockup.nx-logo-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.nx-logo-mark,
.nexus-brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  flex: 0 0 auto;
}

.nx-logo-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.nx-logo-word,
.nexus-wordmark {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1;
  color: var(--nx-ink);
}

.nx-logo-tagline,
.nexus-brand-tagline {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: var(--nexus-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nx-sidebar-nav {
  display: grid;
  gap: 4px;
}

.nx-sidebar-link,
.nexus-sidebar-link {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  color: var(--nx-muted);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 600;
}

.nx-sidebar-link.is-active,
.nexus-sidebar-link.is-active {
  color: var(--nx-ink);
  background: var(--nx-accent-soft);
  border-color: rgba(99, 56, 255, 0.2);
}

.nx-sidebar-link-icon,
.nexus-sidebar-link-icon {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  background: var(--nexus-gradient);
  opacity: 0.85;
}

.nx-sidebar-search input {
  width: 100%;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--nx-card-border);
  background: var(--nx-page-bg);
  font-size: 0.82rem;
}

.nx-sidebar-chrome {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--nx-card-border);
}

.nx-card,
.nexus-ref-panel,
.nx-card-soft {
  border: 1px solid var(--nx-card-border);
  border-radius: 14px;
  background: var(--nx-card-bg);
  overflow: hidden;
}

.nx-card-head,
.nexus-ref-panel-head {
  padding: 12px 14px 0;
  display: grid;
  gap: 4px;
}

.nx-card-title,
.nexus-ref-panel-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--nx-ink);
}

.nx-card-body,
.nexus-ref-panel-body {
  padding: 10px 14px 14px;
  display: grid;
  gap: 10px;
}

.nx-card-note,
.nexus-ref-note,
.nx-empty {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--nx-muted);
}

.nx-metric-grid,
.nexus-ref-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.nx-metric,
.nexus-ref-metric {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--nx-card-border);
  background: var(--nx-page-bg);
  display: grid;
  gap: 4px;
}

.nx-metric-label,
.nexus-ref-metric-label {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--nx-muted);
}

.nx-metric-value,
.nexus-ref-metric-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--nx-ink);
}

.nx-profile {
  display: grid;
  gap: 14px;
}

.nx-profile-header {
  display: grid;
  gap: 12px;
}

.nx-profile-header-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
}

.nx-profile-identity {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.nx-profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  padding: 3px;
  background: var(--nexus-gradient);
  box-shadow: 0 0 0 4px rgba(99, 56, 255, 0.08);
}

.nx-profile-avatar .profile-avatar-image,
.nx-profile-avatar .profile-avatar-fallback {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 3px solid var(--nx-board-bg);
}

.nx-profile-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--nx-ink);
  line-height: 1.1;
}

.nx-profile-subtitle {
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: var(--nx-muted);
}

.nx-profile-meta-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 8px;
}

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

.nx-rank-card,
.nexus-rank-card {
  min-width: 140px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--nx-card-border);
  background: var(--nx-card-bg);
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 4px;
  text-align: center;
}

.nx-rank-label,
.nexus-rank-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--nx-muted);
}

.nx-rank-value,
.nexus-rank-value {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--nx-ink);
}

.nx-profile-tabs,
.nexus-profile-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-bottom: 1px solid var(--nx-card-border);
  margin-top: 4px;
}

.nx-profile-tabs .analytics-section-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px 10px;
  border: none;
  background: transparent;
  color: var(--nx-muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  position: relative;
}

.nx-profile-tabs .analytics-section-link.is-active {
  color: var(--nx-ink);
}

.nx-profile-tabs .analytics-section-link.is-active::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 0;
  height: 3px;
  border-radius: 999px;
  background: var(--nexus-gradient);
}

.nx-profile-grid {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr) minmax(220px, 280px);
  gap: 12px;
  align-items: start;
}

.nx-profile-col {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.nx-feed {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr) minmax(220px, 280px);
  gap: 12px;
  align-items: start;
}

.nx-feed-center {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.nx-feed-search-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--nx-card-border);
  background: var(--nx-card-bg);
}

.nx-feed-search-bar input {
  border: none;
  background: transparent;
  min-height: 36px;
  font-size: 0.9rem;
  width: 100%;
  color: var(--nx-ink);
}

.nx-feed-composer {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--nx-card-border);
  background: var(--nx-card-bg);
  display: grid;
  gap: 10px;
}

.nx-feed-card,
.nexus-feed-post {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--nx-card-border);
  background: var(--nx-card-bg);
  display: grid;
  gap: 12px;
}

.nx-feed-card::before,
.nexus-feed-post::before {
  display: none !important;
}

.nx-rail {
  display: grid;
  gap: 10px;
}

.nx-placeholder,
.ui-placeholder.nx-placeholder {
  opacity: 0.92;
}

.nx-home {
  display: grid;
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto;
}

.nx-home-hero {
  padding: 28px 24px;
  border-radius: var(--nx-board-radius);
  border: 1px solid var(--nx-card-border);
  background: var(--nx-board-bg);
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 16px;
  text-align: center;
}

.nx-home-hero .nx-logo-mark {
  width: 88px;
  height: 88px;
  margin: 0 auto;
}

.nx-home-hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--nx-ink);
}

.nx-home-tagline-row {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--nx-muted);
}

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

.nx-home-preview {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--nx-card-border);
  background: var(--nx-card-bg);
  display: grid;
  gap: 8px;
}

.nx-ecosystem {
  padding: 20px 16px;
  border-radius: var(--nx-board-radius);
  border: 1px solid var(--nx-card-border);
  background: var(--nx-board-bg);
}

.nx-ecosystem-title {
  font-family: var(--font-display);
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-align: center;
  color: var(--nx-accent);
}

.nx-ecosystem-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.nx-ecosystem-item {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 10px;
  align-items: start;
}

.nx-ecosystem-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--nx-card-border);
  background: var(--nx-page-bg);
  box-shadow: var(--shadow-soft);
}

.nx-watchlist-layout {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr) minmax(240px, 300px);
  gap: 12px;
}

.nx-action.solid-button,
.nx-profile-actions .solid-button {
  background: var(--nx-accent);
  border-color: var(--nx-accent);
}

/* Legacy visual neutralization inside Nexus routes */
.nx-page .route-module-card,
.nx-page .panel.stack-panel,
.nx-page .stack-panel,
.nx-board .route-module-card,
.nx-board .panel.stack-panel,
.nx-board .stack-panel,
.nx-main .route-module-card:not(.nx-legacy-hook) {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

.nx-page .route-module-card::before,
.nx-board .route-module-card::before,
.nx-page .panel::before,
.nx-board .panel::before {
  display: none !important;
}

.nx-page .profile-overview-grid,
.nx-page .faceit-stat-grid {
  display: contents;
}

.nx-page .faceit-stat-card .nexus-ref-metric,
.nx-board .nexus-ref-metric {
  background: var(--nx-page-bg);
}

.nx-page .watch-card,
.nx-board .nexus-watch-card {
  border: 1px solid var(--nx-card-border) !important;
  border-radius: 12px !important;
  background: var(--nx-card-bg) !important;
  box-shadow: none !important;
  padding: 12px !important;
}

.nx-page .site-shell.nexus-app-shell-mode {
  width: min(1680px, calc(100vw - 16px));
}

body.nx-active .route-root {
  padding: 8px 0 16px;
}

/* UI-3A — Premium player profile route */
.route-page-player.nx-profile-page {
  --nx-profile-accent: #6320ee;
  --nx-profile-accent-soft: rgba(99, 32, 238, 0.14);
  --nx-profile-ring: linear-gradient(135deg, rgba(99, 32, 238, 0.55), rgba(59, 130, 246, 0.45));
}

.route-page-player.nx-profile-page .nx-main {
  padding: 20px 24px 28px;
  max-width: none;
}

.nx-profile-shell {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.nx-profile-hero {
  display: grid;
  gap: 16px;
}

.nx-profile-hero-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: start;
}

.nx-profile-hero-main {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.nx-profile-page .nx-profile-avatar {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  padding: 3px;
  background: var(--nx-profile-ring);
  box-shadow: none;
}

.nx-profile-page .nx-profile-avatar .profile-avatar-image,
.nx-profile-page .nx-profile-avatar .profile-avatar-fallback {
  border: 3px solid var(--nx-board-bg);
}

.nx-profile-identity-block {
  display: grid;
  gap: 8px;
  min-width: 0;
}

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

.nx-profile-page .nx-profile-name {
  font-size: clamp(1.75rem, 2.4vw, 2.15rem);
  font-weight: 800;
  letter-spacing: 0.01em;
}

.nx-profile-verified {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
  font-size: 0.72rem;
  font-weight: 800;
}

.nx-profile-handle {
  margin: 0;
  font-size: 0.95rem;
  color: var(--nx-muted);
}

.nx-profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
}

.nx-profile-meta .nexus-ref-meta-item {
  font-size: 0.82rem;
}

.nx-profile-bio {
  margin: 0;
  max-width: 56ch;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--nx-muted);
}

.nx-profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 4px;
}

.nx-profile-page .nx-profile-actions .solid-button,
.nx-profile-page .nx-profile-actions .follow-action-button.action-button-positive {
  min-height: 38px;
  padding: 0 18px;
  border-radius: 10px;
  background: var(--nx-profile-accent);
  border-color: var(--nx-profile-accent);
  color: #fff;
  font-weight: 600;
  box-shadow: none;
}

.nx-profile-page .nx-profile-actions .ghost-button,
.nx-profile-page .nx-profile-actions .follow-action-button:not(.action-button-positive):not(.action-button-warning) {
  min-height: 38px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid var(--nx-card-border);
  background: transparent;
  color: var(--nx-ink);
  box-shadow: none;
}

.nx-profile-rank-card {
  min-width: 148px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--nx-card-border);
  background: var(--nx-card-bg);
  display: grid;
  gap: 6px;
  text-align: center;
  align-self: start;
}

.nx-profile-rank-card .nx-rank-label {
  font-size: 0.62rem;
  letter-spacing: 0.12em;
}

.nx-profile-rank-card .nx-rank-value {
  font-size: 1.75rem;
  line-height: 1;
}

.nx-profile-rank-card .nx-rank-meta {
  display: inline-flex;
  justify-content: center;
  margin: 0 auto;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--nx-card-border);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--nx-muted);
}

.nx-profile-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  border-bottom: 1px solid var(--nx-card-border);
  margin: 0;
}

.nx-profile-tabs .analytics-section-link {
  min-height: 40px;
  padding: 0 14px 12px;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.nx-profile-tabs .analytics-section-link.is-active::after {
  left: 12px;
  right: 12px;
  height: 2px;
  background: var(--nx-profile-accent);
  box-shadow: none;
}

.nx-profile-tab-body {
  min-width: 0;
}

.nx-profile-grid {
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr) minmax(240px, 300px);
  gap: 16px;
}

.nx-profile-col {
  gap: 14px;
}

.nx-profile-card {
  border: 1px solid var(--nx-card-border);
  border-radius: 12px;
  background: var(--nx-card-bg);
}

.nx-profile-page .nexus-ref-panel,
.nx-profile-page .nx-card {
  border-radius: 12px;
  box-shadow: none;
}

.nx-profile-page .nexus-ref-panel-head {
  padding: 14px 16px 0;
}

.nx-profile-page .nexus-ref-panel-body {
  padding: 12px 16px 16px;
}

.nx-profile-tab-single {
  display: grid;
  gap: 14px;
  max-width: 1120px;
}

.nx-profile-lock-panel {
  padding: 28px 24px;
  border-radius: 12px;
  border: 1px dashed var(--nx-card-border);
  background: var(--nx-card-bg);
  display: grid;
  gap: 12px;
  justify-items: start;
  max-width: 640px;
}

.nx-profile-stats-layout {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.nx-profile-stats-summary-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

.nx-profile-stats-summary-row > .nexus-ref-panel,
.nx-profile-stats-summary-row > .nx-profile-providers-card {
  height: 100%;
}

.nx-profile-providers-card .nexus-ref-panel-body {
  gap: 12px;
}

.nx-profile-stats-sections {
  display: grid;
  gap: 10px;
}

.nx-profile-fold {
  border: 1px solid var(--nx-card-border);
  border-radius: 12px;
  background: var(--nx-card-bg);
  overflow: hidden;
}

.nx-profile-fold > summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--nx-ink);
  border-bottom: 1px solid transparent;
}

.nx-profile-fold[open] > summary {
  border-bottom-color: var(--nx-card-border);
}

.nx-profile-fold > summary::-webkit-details-marker {
  display: none;
}

.nx-profile-fold-body {
  padding: 12px 16px 16px;
  display: grid;
  gap: 12px;
}

.nx-profile-fold-body .nexus-ref-panel,
.nx-profile-fold-body .player-faceit-stats-panel {
  border: none;
  background: transparent;
}

.nx-profile-fold-body .nexus-ref-panel-head {
  padding-left: 0;
  padding-right: 0;
}

.nx-profile-fold-body .nexus-ref-panel-body {
  padding-left: 0;
  padding-right: 0;
}

.nx-profile-history-card .nexus-about-list {
  margin: 0;
}

.nx-profile-post-card .nx-profile-post-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--nx-muted);
}

.nx-profile-page .profile-chip-row .badge,
.nx-profile-page .preview-chip {
  border-radius: 8px;
  box-shadow: none;
}

.nx-profile-page .route-module-card,
.nx-profile-page .panel.stack-panel {
  border: 1px solid var(--nx-card-border) !important;
  border-radius: 12px !important;
  background: var(--nx-card-bg) !important;
  box-shadow: none !important;
}

.nx-profile-page .route-module-card::before,
.nx-profile-page .panel::before {
  display: none !important;
}

body.nexus-app-layout .route-page-player.nx-profile-page ~ *,
body.nexus-app-layout:has(.route-page-player.nx-profile-page) .site-shell.nexus-app-shell-mode {
  width: min(1760px, calc(100vw - 16px));
}

@media (max-width: 1180px) {
  .nx-board {
    grid-template-columns: 1fr;
    border-radius: 18px;
  }

  .nx-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--nx-card-border);
  }

  .nx-profile-grid,
  .nx-feed,
  .nx-watchlist-layout,
  .nx-home-previews,
  .nx-ecosystem-grid {
    grid-template-columns: 1fr;
  }

  .nx-profile-hero-top {
    grid-template-columns: 1fr;
  }

  .nx-profile-hero-main {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .nx-profile-stats-summary-row {
    grid-template-columns: 1fr;
  }

  .nx-metric-grid,
  .nexus-ref-metric-grid {
    grid-template-columns: 1fr;
  }
}
