/* Player profile page — scoped styles (no Tailwind CDN) */
html.rr-player-profile,
html.rr-player-profile body {
  overflow-x: clip;
}

#player-profile-app {
  font-family: "Chakra Petch", sans-serif;
  background: #fafafa;
  color: #171717;
  text-transform: none;
}

#player-profile-app * {
  text-transform: none;
  box-sizing: border-box;
}

#player-profile-app .pp-hero {
  position: relative;
  padding: 6rem 1rem 4rem;
  background: #171717; /* neutral-900 */
  color: #ffffff;
  overflow: hidden;
}

#player-profile-app .pp-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, #fe5900, #171717 70%);
  opacity: 0.2;
  pointer-events: none;
}

#player-profile-app .pp-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 80rem;
  margin: 0 auto;
  padding-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 768px) {
  #player-profile-app .pp-hero-inner {
    flex-direction: row;
    align-items: flex-start;
    gap: 2rem;
  }
}
#player-profile-app .pp-avatar {
  width: 12rem;
  height: 12rem;
  border-radius: 9999px;
  border: 4px solid #fe5900;
  overflow: hidden;
  flex-shrink: 0;
  background: #262626;
}

@media (min-width: 768px) {
  #player-profile-app .pp-avatar {
    width: 16rem;
    height: 16rem;
  }
}

#player-profile-app .pp-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#player-profile-app .pp-details {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  text-align: center;
  color: #ffffff;
}

@media (min-width: 768px) {
  #player-profile-app .pp-details {
    text-align: left;
  }
}

#player-profile-app .pp-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  #player-profile-app .pp-badges {
    justify-content: flex-start;
  }
}
#player-profile-app .pp-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 1rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase !important;
  border: 1px solid rgba(254, 89, 0, 0.35);
  background: rgba(254, 89, 0, 0.18);
  color: #fe5900;
}

#player-profile-app .pp-badge.muted {
  background: rgba(255, 255, 255, 0.06);
  border-color: #404040;
  color: #d4d4d4;
}

#player-profile-app .pp-badge.edit-btn {
  background: #fff;
  color: #171717;
  border-color: #fff;
  cursor: pointer;
}

#player-profile-app .pp-badge.share-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
  cursor: pointer;
  width: 2.35rem;
  height: 2.35rem;
  min-width: 2.35rem;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

#player-profile-app .pp-badge.share-btn i {
  display: block;
  line-height: 1;
  font-size: 0.95rem;
  margin: 0;
}

#player-profile-app .pp-badge.share-btn:hover {
  background: #fe5900;
  border-color: #fe5900;
  color: #fff;
}

#player-profile-app .pp-name,
#player-profile-app h1.pp-name {
  font-family: "Chakra Petch", sans-serif !important;
  font-size: 2.25rem !important; /* text-4xl */
  font-weight: 700 !important;
  line-height: 1.1 !important;
  letter-spacing: -0.025em;
  margin: 0 0 1rem !important;
  padding: 0 !important;
  color: #ffffff !important; /* white — not site navy --header */
  text-transform: none !important;
  word-break: break-word;
}

@media (min-width: 640px) {
  #player-profile-app .pp-name,
  #player-profile-app h1.pp-name {
    font-size: 3rem !important; /* text-5xl */
  }
}

@media (min-width: 768px) {
  #player-profile-app .pp-name,
  #player-profile-app h1.pp-name {
    font-size: 3.75rem !important; /* text-6xl */
  }
}

#player-profile-app .pp-name .accent,
#player-profile-app .pp-name .text-brand-primary {
  color: #fe5900 !important; /* brand orange last name */
}
#player-profile-app .pp-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.75rem;
  justify-content: center;
  color: #a3a3a3;
  font-weight: 500;
  margin-bottom: 1.25rem;
}

@media (min-width: 768px) {
  #player-profile-app .pp-meta {
    justify-content: flex-start;
  }
}

#player-profile-app .pp-meta span,
#player-profile-app .pp-meta i {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

#player-profile-app .pp-divider {
  height: 1px;
  width: 100%;
  background: #262626;
  margin: 1.25rem 0;
}

#player-profile-app .pp-attrs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  max-width: 28rem;
  margin: 0 auto;
}

@media (min-width: 640px) {
  #player-profile-app .pp-attrs {
    margin: 0;
    display: flex;
    max-width: none;
  }
}

#player-profile-app .pp-attr {
  background: rgba(38, 38, 38, 0.55);
  border: 1px solid rgba(64, 64, 64, 0.55);
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
}

#player-profile-app .pp-attr .label {
  color: #737373;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase !important;
  margin-bottom: 0.35rem;
}

#player-profile-app .pp-attr .value {
  color: #e5e5e5;
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
}

#player-profile-app .pp-summary {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (min-width: 768px) {
  #player-profile-app .pp-summary {
    width: 12rem;
    flex-shrink: 0;
    flex-direction: column;
    display: flex;
    grid-template-columns: none;
    gap: 1.5rem;
  }
}

#player-profile-app .pp-summary-card {
  background: rgba(38, 38, 38, 0.8);
  border: 1px solid #404040;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  text-align: center;
  min-width: 0;
  flex: 1;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15);
}

@media (min-width: 640px) {
  #player-profile-app .pp-summary-card {
    padding: 1rem 1.5rem;
  }
}

#player-profile-app .pp-summary-card .num {
  font-family: "Chakra Petch", sans-serif !important;
  font-size: 1.5rem !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  margin: 0 0 0.25rem !important;
  line-height: 1.2 !important;
  text-transform: none !important;
}

@media (min-width: 640px) {
  #player-profile-app .pp-summary-card .num {
    font-size: 1.875rem !important;
  }
}

#player-profile-app .pp-summary-card .lbl {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase !important;
  color: #a3a3a3 !important;
  margin: 0;
}

#player-profile-app .pp-scope {
  max-width: 80rem;
  margin: 0 auto;
  padding: 1.25rem 1rem 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

#player-profile-app .pp-scope-btn {
  border: 1px solid #e5e5e5;
  background: #fff;
  color: #525252;
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  line-height: 1.2;
}

#player-profile-app .pp-scope-btn span {
  font-weight: 600;
  color: #737373;
  font-size: 0.78em;
}

#player-profile-app .pp-scope-btn.active {
  background: #fe5900;
  border-color: #fe5900;
  color: #fff;
}

#player-profile-app .pp-scope-btn.active span {
  color: rgba(255, 255, 255, 0.88);
}

#player-profile-app .pp-body {
  max-width: 80rem;
  margin: 0 auto;
  padding: 2.5rem 1rem 3.5rem;
}

#player-profile-app .pp-toolbar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border-bottom: 1px solid #e5e5e5;
  margin-bottom: 2rem;
  padding-bottom: 0.25rem;
}

@media (min-width: 640px) {
  #player-profile-app .pp-toolbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

#player-profile-app .pp-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

#player-profile-app .pp-tabs::-webkit-scrollbar {
  display: none;
}

#player-profile-app .pp-tab {
  padding: 1rem 1.25rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #737373;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
}

#player-profile-app .pp-tab.active {
  color: #fe5900;
  border-bottom-color: #fe5900;
}

#player-profile-app .pp-category {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #525252;
  padding-bottom: 0.5rem;
}

#player-profile-app .pp-category select {
  appearance: auto;
  -webkit-appearance: menulist;
  background: #fff;
  color: #171717;
  border: 1px solid #d4d4d4;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-weight: 600;
}

#player-profile-app .pp-subtabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  background: #f5f5f5;
  border: 1px solid #e5e5e5;
  border-radius: 0.75rem;
  padding: 0.5rem;
  margin-bottom: 2rem;
}

@media (min-width: 640px) {
  #player-profile-app .pp-subtabs {
    grid-template-columns: repeat(4, 1fr);
  }
}

#player-profile-app .pp-subtab {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 0.5rem;
  font-weight: 700;
  font-size: 0.9rem;
  color: #525252;
  background: transparent;
  border: 0;
  cursor: pointer;
}

#player-profile-app .pp-subtab.active {
  background: #fff;
  color: #fe5900;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

#player-profile-app .pp-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

@media (min-width: 640px) {
  #player-profile-app .pp-stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  #player-profile-app .pp-stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  #player-profile-app .pp-stat-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

#player-profile-app .stat-card {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 0.75rem;
  padding: 1.25rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-width: 0;
}

#player-profile-app .stat-card .label {
  color: #737373;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase !important;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}

#player-profile-app .stat-card .value {
  font-size: 1.75rem;
  font-weight: 700;
  color: #171717;
  word-break: break-word;
}

#player-profile-app .pp-empty {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 1rem;
  padding: 3rem 1.5rem;
  text-align: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

#player-profile-app .pp-empty h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 1rem 0 0.5rem;
}

#player-profile-app .pp-empty p {
  color: #737373;
  max-width: 28rem;
  margin: 0 auto;
}

#player-profile-app .pp-match {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  #player-profile-app .pp-match {
    flex-direction: row;
    align-items: center;
  }
}

#player-profile-app .pp-match-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

#player-profile-app .pp-hidden {
  display: none !important;
}

/* ——— Edit profile modal (body-level; must beat sticky header z-index 9999) ——— */
#editAttrsModal.pp-hidden,
#editAttrsModal .pp-hidden {
  display: none !important;
}

body.pp-edit-modal-open {
  overflow: hidden !important;
}

html.pp-edit-modal-open #header-sticky,
html.pp-edit-modal-open .header-1,
html.pp-edit-modal-open .sticky,
html.pp-edit-modal-open .mean-container,
html.pp-edit-modal-open .mean-bar,
body.pp-edit-modal-open #header-sticky,
body.pp-edit-modal-open .header-1,
body.pp-edit-modal-open .sticky,
body.pp-edit-modal-open .mean-container,
body.pp-edit-modal-open .mean-bar {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  z-index: 0 !important;
}

#editAttrsModal.pp-modal {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  z-index: 20000000 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  margin: 0;
  box-sizing: border-box;
  font-family: "Chakra Petch", sans-serif;
  text-transform: none;
}

#editAttrsModal.pp-modal.pp-hidden {
  display: none !important;
}

#editAttrsModal .pp-modal-backdrop {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.55);
}

#editAttrsModal .pp-modal-card {
  position: relative;
  z-index: 1;
  background: #ffffff !important;
  border: 1px solid #e5e5e5 !important;
  border-radius: 16px !important;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  width: min(26rem, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: min(85vh, 720px);
  overflow: hidden !important;
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  margin: 0 auto;
  color: #171717 !important;
  text-transform: none !important;
  box-sizing: border-box !important;
}

#editAttrsModal .pp-modal-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 1.5rem 1.5rem 1.25rem;
  box-sizing: border-box;
}

#editAttrsModal .pp-modal-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 1rem;
  color: #171717 !important;
  text-transform: none !important;
}

#editAttrsModal .pp-modal-card label {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  font-size: 0.85rem;
  font-weight: 600;
  color: #404040 !important;
  margin: 0.35rem 0 0.3rem;
  text-transform: none !important;
}

#editAttrsModal .pp-modal-card .pp-input,
#editAttrsModal .pp-modal-card .pp-select,
#editAttrsModal .pp-modal-card input[type="text"],
#editAttrsModal .pp-modal-card select {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  width: 100% !important;
  max-width: 100% !important;
  min-height: 2.75rem !important;
  height: auto !important;
  margin: 0 0 0.85rem !important;
  background: #ffffff !important;
  color: #111111 !important;
  border: 1px solid #c4c4c4 !important;
  border-radius: 0.5rem !important;
  padding: 0.65rem 0.85rem !important;
  font-weight: 600 !important;
  font-family: "Chakra Petch", sans-serif !important;
  font-size: 0.95rem !important;
  line-height: 1.3 !important;
  text-transform: none !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
}

#editAttrsModal .pp-modal-card .pp-input,
#editAttrsModal .pp-modal-card input[type="text"] {
  -webkit-appearance: none !important;
  appearance: none !important;
}

#editAttrsModal .pp-modal-card .pp-select,
#editAttrsModal .pp-modal-card select {
  -webkit-appearance: menulist !important;
  appearance: menulist !important;
  cursor: pointer !important;
}

#editAttrsModal .pp-modal-card .pp-select option,
#editAttrsModal .pp-modal-card select option {
  color: #111111 !important;
  background: #ffffff !important;
}

#editAttrsModal .pp-photo-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

#editAttrsModal .pp-photo-preview {
  width: 4rem;
  height: 4rem;
  border-radius: 9999px;
  object-fit: cover;
  border: 2px solid #fe5900;
  background: #f5f5f5;
  flex-shrink: 0;
}

#editAttrsModal .pp-photo-row input[type="file"] {
  flex: 1;
  min-width: 0;
  font-size: 0.8rem;
  color: #525252;
  text-transform: none !important;
}

#editAttrsModal .pp-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

#editAttrsModal .pp-btn {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 700;
  border: 1px solid #d4d4d4;
  background: #fff;
  color: #171717;
  cursor: pointer;
  text-transform: none !important;
}

#editAttrsModal .pp-btn.primary {
  background: #fe5900;
  border-color: #fe5900;
  color: #fff;
}

#editAttrsModal #editAttrsMessage {
  margin: 0.5rem 0;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: none !important;
}

#player-profile-app .pp-chip {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase !important;
}

#player-profile-app .pp-chip.sub {
  background: #fff7ed;
  color: #fe5900;
  border: 1px solid #ffedd5;
}

#player-profile-app .pp-chip.captain {
  background: #f0f9ff;
  color: #0369a1;
  border: 1px solid #e0f2fe;
}

#player-profile-app .pp-result {
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase !important;
  white-space: nowrap;
}

#player-profile-app .pp-result.win {
  color: #059669;
  background: #ecfdf5;
}

#player-profile-app .pp-result.loss {
  color: #e11d48;
  background: #fff1f2;
}

#player-profile-app .pp-result.draw {
  color: #525252;
  background: #f5f5f5;
}
