/* ==========================================================================
   USER PROFILE — Fandom-aligned fan identity page
   ========================================================================== */

body.profile-page {
  overflow-x: hidden;
}

.up-page {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  background: var(--fa-bg, var(--navy));
  padding: 12px 0 72px;
}

.up-root.up-dash.sf-feed-layout {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 clamp(16px, 3vw, 28px);
  padding-bottom: 80px;
  padding-top: clamp(12px, 2vw, 24px);
  grid-template-columns: 260px minmax(0, 1fr) 280px;
  gap: 24px;
  align-items: start;
}

/* ---------- Rails ---------- */

.up-rail {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.up-rail-card {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px 16px;
}

.up-rail-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin: 0 0 10px;
  position: relative;
  padding-left: 10px;
}

.up-rail-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 1px;
  bottom: 1px;
  width: 3px;
  border-radius: 2px;
  background: var(--teal, #00C2CB);
}

.up-rail-facts {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.up-rail-fact {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 13px;
  line-height: 1.35;
}

.up-rail-fact-label {
  color: rgba(255, 255, 255, 0.5);
  flex-shrink: 0;
}

.up-rail-fact-value {
  color: rgba(255, 255, 255, 0.88);
  text-align: right;
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 600;
}

.up-rail-empty {
  font-size: 13px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.5);
  margin: 0;
}

.up-rail-link {
  color: var(--teal, #00C2CB);
  text-decoration: none;
  font-weight: 600;
}

.up-rail-link:hover,
.up-rail-link:focus-visible {
  color: var(--teal, #00C2CB);
  opacity: 0.88;
  text-decoration: none;
}

.up-fan-level {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.up-fan-level-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0, 194, 203, 0.28);
  background: rgba(0, 194, 203, 0.08);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--teal, #00C2CB);
}

.up-fan-level-pts {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.65);
}

/* ---------- Center column ---------- */

.up-center {
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
}

.up-hero-card {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 42%, rgba(0, 0, 0, 0.18) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
}

.up-page .up-hero {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px 12px;
  margin: 0;
  border: none;
}

.up-page .up-avatar,
.up-page .up-avatar-btn {
  flex-shrink: 0;
}

.up-hero-main {
  flex: 1;
  min-width: 0;
}

.up-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.up-hero-id {
  min-width: 0;
}

.up-page .up-name {
  font-size: clamp(20px, 3vw, 28px);
  margin: 0;
  line-height: 1.15;
}

.up-hero-meta {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  margin: 4px 0 0;
  line-height: 1.4;
}

.up-hero-flair {
  margin-top: 8px;
}

.up-page .up-bio {
  margin: 8px 0 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.5;
}

.up-hero-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.up-hero-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.up-hero-actions .btn--sm {
  min-height: 44px;
  padding: 8px 14px;
}

/* ---------- Stats row (desktop, inside hero card) ---------- */

.up-page .up-stats {
  display: flex;
  gap: 0;
  padding: 0;
  margin: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.up-page .up-stat,
.up-page button.up-stat {
  flex: 1;
  text-align: center;
  padding: 12px 6px;
  min-height: 44px;
  border: none;
  background: none;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  cursor: default;
}

.up-page button.up-stat.up-stat--click {
  cursor: pointer;
}

.up-page button.up-stat.up-stat--click:hover {
  background: rgba(255, 255, 255, 0.03);
}

.up-page .up-stat:last-child {
  border-right: none;
}

.up-page .up-stat-num {
  display: block;
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
}

.up-page .up-stat-lab {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 2px;
}

/* ---------- Mobile identity + stats ---------- */

.up-mobile-only {
  display: none;
}

.up-mobile-identity {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  font-size: 13px;
}

.up-mobile-id-tier {
  font-weight: 700;
  color: var(--teal, #00C2CB);
}

.up-mobile-id-support {
  color: rgba(255, 255, 255, 0.72);
}

.up-mobile-id-dot {
  color: rgba(255, 255, 255, 0.35);
}

.up-mobile-stats {
  margin-bottom: 12px;
  overflow: hidden;
}

.up-mobile-stats-track {
  display: flex;
  gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.up-mobile-stats-track::-webkit-scrollbar {
  display: none;
}

.up-mstat,
button.up-mstat {
  flex: 0 0 auto;
  min-width: 72px;
  padding: 10px 14px;
  min-height: 44px;
  text-align: center;
  border: none;
  background: none;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

button.up-mstat--click {
  cursor: pointer;
}

button.up-mstat--click:hover {
  background: rgba(255, 255, 255, 0.03);
}

.up-mstat:last-child {
  border-right: none;
}

.up-mstat-num {
  display: block;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
}

.up-mstat-lab {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 2px;
}

.up-mobile-block {
  margin-bottom: 12px;
}

.up-mobile-block .up-rail-card {
  padding: 12px 14px;
}

.up-fan-dna--compact .up-rail-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
}

.up-fan-dna--compact .up-rail-fact {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.up-fan-dna--compact .up-rail-fact-value {
  text-align: left;
}

.up-fan-dna--compact .up-fan-level {
  margin-top: 8px;
  padding-top: 8px;
}

/* ---------- Tabs (Fandom style) ---------- */

.up-page .up-tabs {
  position: sticky;
  top: var(--fa-sticky-top, calc(var(--nav-h, 64px) + 16px));
  z-index: 10;
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin: 0 0 16px;
  padding: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--fa-bg, var(--navy));
}

.up-page .up-tabs::-webkit-scrollbar {
  display: none;
}

.up-page .up-tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  min-height: 44px;
  margin: 0 0 -1px;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.up-page .up-tab:hover,
.up-page .up-tab:focus-visible {
  color: rgba(255, 255, 255, 0.88);
}

.up-page .up-tab.is-active {
  color: var(--teal, #00C2CB);
  border-bottom-color: var(--teal, #00C2CB);
}

/* ---------- Feed panels ---------- */

.up-page .up-panels {
  min-height: 200px;
}

.up-page .up-panels > .up-panel {
  border: none;
  border-radius: 0;
  background: none;
  padding: 0;
}

.up-page .up-panels > .up-panel[hidden] {
  display: none;
}

.up-page .up-panels .sf-feed-list {
  margin: 0;
}

/* ---------- Pick performance (right rail) ---------- */

.up-perf-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.up-perf-cell {
  text-align: center;
  padding: 10px 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.up-perf-num {
  display: block;
  font-size: 18px;
  font-weight: 800;
  color: var(--teal, #00C2CB);
  line-height: 1;
}

.up-perf-lab {
  display: block;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 4px;
}

/* ---------- Quick links ---------- */

.up-links {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: -4px 0;
}

.up-link {
  display: block;
  padding: 10px 0;
  min-height: 44px;
  font-size: 13px;
  font-weight: 600;
  color: var(--teal, #00C2CB);
  text-decoration: none;
  transition: opacity 0.12s;
}

.up-link:hover,
.up-link:focus-visible {
  color: var(--teal, #00C2CB);
  opacity: 0.88;
  text-decoration: none;
}

.up-link + .up-link {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ---------- My Players ---------- */

.up-page .up-player-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.up-page .up-player-grid--carousel {
  flex-direction: row;
  gap: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.up-page .up-player-grid--carousel::-webkit-scrollbar {
  display: none;
}

.up-page .up-player-card {
  display: flex;
  align-items: center;
  padding: 8px 0;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.up-page .up-player-grid--carousel .up-player-card {
  flex: 0 0 auto;
  min-width: 148px;
  max-width: 168px;
  flex-direction: column;
  align-items: stretch;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.up-page .up-player-card:last-child {
  border-bottom: none;
}

.up-page .up-player-grid--carousel .up-player-card:last-child {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.up-page .up-player-card-link {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.up-page .up-player-grid--carousel .up-player-card-link {
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

.up-page .up-player-card-body {
  flex: 1;
  min-width: 0;
}

.up-page .up-player-card-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.up-page .up-player-card-team {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  margin: 2px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.up-page .up-player-card-visual {
  flex-shrink: 0;
}

.up-page .up-player-photo--card {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.up-page .up-player-grid--carousel .up-player-photo--card,
.up-page .up-player-grid--carousel .up-player-photo--fallback {
  width: 48px;
  height: 48px;
}

.up-page .up-player-photo--fallback {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.4);
}

.up-page .up-player-card--add {
  justify-content: center;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  padding: 10px;
  background: none;
  cursor: pointer;
  color: var(--teal, #00C2CB);
  font-size: 12px;
  font-weight: 600;
  gap: 4px;
  min-height: 44px;
}

.up-page .up-player-grid--carousel .up-player-card--add {
  min-width: 120px;
}

.up-page .up-player-card-remove {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.35);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  min-width: 44px;
  min-height: 44px;
  line-height: 1;
}

.up-page .up-player-grid--carousel .up-player-card-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
}

.up-page .up-player-grid--carousel .up-player-card {
  position: relative;
}

.up-page .up-player-card-remove:hover {
  color: #ff4d4f;
}

/* ---------- I Rep / teams ---------- */

.up-page .up-team-pride {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  text-decoration: none;
  color: inherit;
}

.up-page .up-team-pride-mark img,
.up-page .up-team-pride-mark .up-team-flag {
  width: 40px !important;
  height: 30px !important;
  border-radius: 3px;
  object-fit: cover;
}

.up-page .up-team-pride-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.up-page .up-showcase-eyebrow {
  font-size: 10px;
  margin: 0 0 2px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.45);
}

/* ---------- FanPicks tab ---------- */

.up-page .up-fanpick-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.up-page .up-fanpick-row {
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.up-page .up-fanpick-row:last-child {
  border-bottom: none;
}

/* ---------- Settings ---------- */

.up-settings-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 18px;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}

.up-settings-link:hover,
.up-settings-link:focus-visible {
  color: var(--teal, #00C2CB);
  background: rgba(255, 255, 255, 0.05);
  text-decoration: none;
}

/* ---------- Edit profile ---------- */

.up-edit-panel {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 20px 24px;
  margin: 12px 0;
}

.up-edit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.up-edit-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.up-edit-close {
  background: none;
  border: none;
  font-size: 22px;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  min-width: 44px;
  min-height: 44px;
}

.up-edit-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.up-edit-form .sf-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.up-edit-form label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.65);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.up-edit-avatar-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.up-edit-avatar-preview {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
}

.up-edit-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

/* ---------- Tablet ---------- */

@media (min-width: 768px) and (max-width: 1079px) {
  .up-root.up-dash.sf-feed-layout {
    grid-template-columns: minmax(0, 1fr) 240px;
  }

  .up-rail--left.up-rail--desktop {
    display: none;
  }
}

/* ---------- Mobile ---------- */

@media (max-width: 767px) {
  .up-page {
    padding-bottom: 56px;
  }

  .up-root.up-dash.sf-feed-layout {
    grid-template-columns: 1fr;
    gap: 0;
    padding-top: 4px;
  }

  .up-rail--desktop {
    display: none !important;
  }

  .up-desktop-only {
    display: none !important;
  }

  .up-mobile-only {
    display: block;
  }

  .up-page .up-hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 18px 16px 14px;
    gap: 12px;
  }

  .up-hero-top {
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 10px;
  }

  .up-hero-actions {
    width: 100%;
    justify-content: center;
  }

  .up-page .up-avatar,
  .up-page .up-avatar-btn,
  .up-page .up-avatar-btn .up-avatar--img {
    width: 96px;
    height: 96px;
    max-width: 96px;
    max-height: 96px;
    font-size: 36px;
  }

  .up-page .up-name {
    justify-content: center;
    font-size: 22px;
  }

  .up-hero-flair {
    display: flex;
    justify-content: center;
  }

  .up-page .up-tabs {
    top: var(--nav-h, 56px);
    margin-left: -4px;
    margin-right: -4px;
    padding-left: 4px;
  }

  .up-page .up-tab {
    padding: 10px 12px;
    font-size: 11px;
  }

  .up-edit-panel {
    padding: 16px;
  }

  .up-edit-avatar-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (min-width: 1080px) {
  .up-rail--left,
  .up-rail--right {
    position: sticky;
    top: calc(var(--fa-sticky-top, calc(var(--nav-h, 64px) + 16px)));
  }
}
