/* Stellar player profiles + players page. Uses the site's tokens and base styles from
   site.css; every class here starts with "pf-" so the two stylesheets never collide.
   No inline styles anywhere (strict CSP): JavaScript only sets CSS custom properties.
   Low-key on purpose: few sections, quiet surfaces, plenty of space. */

:root {
  --pf-bronze: #d58b55;
  --pf-silver: #cdd5e2;
  --pf-gold: #f2c14e;
  --pf-hof: #b9a7ff;
  --pf-win: #19d785;
  --pf-loss: #ff6b86;
  --pf-panel: #10121c;
  --pf-panel-2: #171a26;
  --pf-panel-line: #202333;
  --pf-radius: 16px;
}

.pf-page main { min-height: 70vh; }
[hidden] { display: none !important; }
.pf-status { padding: calc(var(--header-h) + 120px) var(--gutter) 120px; text-align: center; color: var(--muted); font-size: 18px; }
.pf-status h1 { font: 700 clamp(32px, 5vw, 52px)/1 var(--font-display); color: var(--text); margin-bottom: 14px; }
.pf-status .btn { margin-top: 24px; }

.pf-card { position: relative; border-radius: var(--pf-radius); border: 1px solid var(--pf-panel-line); background: var(--pf-panel); }
.pf-win { color: var(--pf-win) !important; }
.pf-loss { color: var(--pf-loss) !important; }
.pf-muted { color: var(--dim); }

/* ---------- Header ---------- */
.pf-head { position: relative; isolation: isolate; padding: calc(var(--header-h) + clamp(140px, 14vw, 210px)) 0 0; }
.pf-head-plain { padding: calc(var(--header-h) + clamp(70px, 9vw, 120px)) 0 clamp(28px, 4vw, 48px); }
/* owner 10-21: the search results sat UNDER the cards below (the head's isolate trapped their z-index): lift the head */
.pf-head-plain { z-index: 5; }
.pf-banner { position: absolute; z-index: -1; top: 0; left: 0; width: 100%; height: clamp(330px, 32vw, 520px); overflow: hidden; }
.pf-head-plain .pf-banner { height: 100%; max-height: 560px; }
.pf-banner img { width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 62%; }
.pf-banner::after {
  content: ""; position: absolute; inset: 0;
  /* owner 10-16: the park art sits behind a dark veil (it's a backdrop, the player is the focus) */
  background:
    radial-gradient(120% 90% at 50% 35%, rgba(9, 12, 19, .35) 0%, rgba(9, 12, 19, .7) 70%, rgba(9, 12, 19, .9) 100%),
    linear-gradient(180deg, rgba(9, 12, 19, .7) 0%, rgba(9, 12, 19, .35) 25%, rgba(9, 12, 19, .5) 55%, rgba(9, 12, 19, .9) 82%, var(--bg) 100%),
    linear-gradient(90deg, var(--bg) 0%, rgba(9, 12, 19, 0) 14%, rgba(9, 12, 19, 0) 86%, var(--bg) 100%);
}
.pf-head-grid { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: clamp(24px, 4vw, 44px); align-items: end; }
.pf-figure { margin: 0; }
.pf-photo {
  position: relative; aspect-ratio: 3 / 4; border-radius: 22px; overflow: hidden;
  background: url("../img/stellar-star-480.webp") 50% 30% / 90% auto no-repeat, radial-gradient(70% 55% at 50% 42%, rgba(172, 52, 255, .3), transparent 72%), linear-gradient(180deg, #1a1630, var(--pf-panel));
  border: 1px solid rgba(199, 151, 255, .25);
  box-shadow: 0 30px 70px -36px rgba(0, 0, 0, .9);
}
.pf-photo img { position: relative; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; transform: scale(1.2) translateY(3%); transform-origin: 50% 0; }
.pf-photo.is-empty img { display: none; }
.pf-id { min-width: 0; }
.pf-crumbs { margin: 0 0 10px; font-size: 14px; }
.pf-crumbs a { color: var(--muted); text-decoration: none; }
.pf-crumbs a:hover { color: var(--text); }
.pf-name {
  font: 700 clamp(40px, 5.4vw, 72px)/1 var(--font-display); margin: 0 0 12px; overflow-wrap: anywhere;
  background: linear-gradient(180deg, #fff 45%, #d9c2ff); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.pf-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 18px; padding: 0; list-style: none; }
.pf-tag { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: rgba(16, 18, 28, .78); color: var(--text); font: 600 13.5px/1 var(--font-ui); }
.pf-tag.is-online::before, .pf-tag.is-seen::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.pf-tag.is-online::before { background: var(--pf-win); box-shadow: 0 0 10px var(--pf-win); }
.pf-head-cards { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-top: 8px; }
.pf-rep { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: center; padding: 16px 18px; }
.pf-rep img { width: 56px; height: 56px; }
.pf-rep-name { margin: 0 0 4px; font: 700 22px/1 var(--font-display); color: var(--text); }
.pf-rep-points { margin: 0 0 10px; font-size: 13px; color: var(--dim); font-variant-numeric: tabular-nums; }
.pf-bar { --p: 0; position: relative; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.pf-bar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: calc(var(--p) * 1%); border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-light)); }
.pf-rep.is-legend .pf-bar::after { background: linear-gradient(90deg, #c99a2e, #ffe08a); }
.pf-record { padding: 16px 18px; display: grid; gap: 12px; }
.pf-record-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pf-record-big { margin: 0; font: 700 28px/1 var(--font-display); color: var(--text); font-variant-numeric: tabular-nums; }
.pf-record-big small { font: 600 13px/1 var(--font-ui); color: var(--dim); margin-left: 8px; }
.pf-streak { margin: 0; font-size: 13px; color: var(--dim); }
.pf-streak b { font-weight: 700; }
.pf-chips { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; margin: 0; padding: 0; list-style: none; }
.pf-chips li { aspect-ratio: 1; min-width: 0; border-radius: 6px; display: grid; place-items: center; font: 700 12px/1 var(--font-display); color: #07130d; background: rgba(255, 255, 255, .06); }
.pf-chips li.w { background: var(--pf-win); }
.pf-chips li.l { background: var(--pf-loss); color: #26070e; }

/* ---------- Sections ---------- */
.pf-section { padding-top: clamp(44px, 5vw, 64px); }
.pf-h2 { margin: 0 0 16px; font: 700 clamp(22px, 2.4vw, 28px)/1 var(--font-display); color: var(--text); }
.pf-row-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.pf-row-head .pf-h2 { margin: 0; }
.pf-own { margin-top: 40px; margin-bottom: 0; font-size: 14px; color: var(--muted); }
.pf-own a { color: var(--accent-light); }
.pf-own + .pf-foot { margin-top: 8px; }
.pf-foot { margin-top: 40px; padding-bottom: clamp(56px, 7vw, 88px); font-size: 13px; color: var(--dim); }
.pf-empty { margin: 0; padding: 20px; border-radius: var(--pf-radius); border: 1px dashed var(--line-strong); color: var(--dim); text-align: center; font-size: 14.5px; }

/* Builds: compact cards */
.pf-builds { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.pf-build { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px 14px; align-items: center; padding: 16px 18px; }
.pf-ovr img { width: 56px; height: 56px; }
.pf-ovr-num { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; font: 700 24px/1 var(--font-display); color: var(--text); background: var(--pf-panel-2); border: 1px solid var(--pf-panel-line); }
.pf-build-name { margin: 0; font: 700 17px/1.15 var(--font-display); color: var(--text); }
.pf-build-sub { margin: 4px 0 0; font-size: 13.5px; color: var(--muted); }
.pf-tiers { grid-column: 1 / -1; display: flex; gap: 14px; margin: 2px 0 0; padding: 0; list-style: none; }
.pf-tier { display: inline-flex; align-items: center; gap: 6px; font: 700 15px/1 var(--font-display); color: var(--text); font-variant-numeric: tabular-nums; }
.pf-tier img { width: 26px; height: 26px; }
.pf-tier .pf-dot { width: 12px; height: 12px; border-radius: 4px; background: var(--tier); }
.pf-tier.bronze { --tier: var(--pf-bronze); }
.pf-tier.silver { --tier: var(--pf-silver); }
.pf-tier.gold { --tier: var(--pf-gold); }
.pf-tier.hof { --tier: var(--pf-hof); }

/* Stats: one small row */
.pf-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0; }
.pf-stats div { padding: 16px 18px; border-radius: var(--pf-radius); border: 1px solid var(--pf-panel-line); background: var(--pf-panel); }
.pf-stats dt { font: 700 11.5px/1 var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.pf-stats dd { margin: 8px 0 0; font: 700 26px/1 var(--font-display); color: var(--text); font-variant-numeric: tabular-nums; }

/* Recent games: compact rows */
.pf-games { margin: 0; padding: 0; list-style: none; border-radius: var(--pf-radius); border: 1px solid var(--pf-panel-line); background: var(--pf-panel); overflow: hidden; }
.pf-game { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--pf-panel-line); font-size: 15px; }
.pf-game:first-child { border-top: 0; }
.pf-result { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font: 700 14px/1 var(--font-display); color: var(--muted); background: rgba(255, 255, 255, .08); }
.pf-result.win { color: #052014; background: var(--pf-win); }
.pf-result.loss { color: #2a0610; background: var(--pf-loss); }
.pf-vs { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.pf-vs a { color: var(--text); text-decoration: none; font-weight: 600; }
.pf-vs a:hover { color: var(--accent-light); }
.pf-score { font: 700 17px/1 var(--font-display); color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pf-date { font-size: 13px; color: var(--dim); white-space: nowrap; text-align: right; min-width: 64px; }
.pf-more { display: block; margin: 12px auto 0; border: 1px solid var(--line-strong); background: var(--pf-panel); color: var(--muted); border-radius: 10px; padding: 9px 16px; cursor: pointer; font: 600 14px/1 var(--font-ui); }
.pf-more:hover { color: var(--text); border-color: rgba(199, 151, 255, .5); }

/* Rivals */
.pf-rivals { margin: 0; padding: 4px 0; list-style: none; max-width: 520px; }
.pf-rivals li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 18px; }
.pf-rivals a { color: var(--text); text-decoration: none; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-rivals a:hover { color: var(--accent-light); }
.pf-rivals b { font: 700 16px/1 var(--font-display); font-variant-numeric: tabular-nums; }

/* ---------- Players page ---------- */
.pf-search { position: relative; max-width: 480px; margin-top: 22px; }
.pf-search svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--dim); pointer-events: none; }
.pf-search input { width: 100%; height: 52px; padding: 0 18px 0 46px; border-radius: 14px; border: 1px solid var(--line-strong); background: rgba(9, 12, 19, .85); color: var(--text); font: 500 16px/1 var(--font-ui); }
.pf-search input::placeholder { color: var(--dim); }
.pf-search input:focus { outline: 2px solid var(--focus); outline-offset: 2px; border-color: transparent; }
/* instant results under the search box */
.pf-suggest {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 8px);
  margin: 0; padding: 6px; list-style: none;
  border: 1px solid var(--line-strong); border-radius: 14px;
  background: rgba(16, 18, 28, .98); box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .9), 0 0 0 1px rgba(150, 51, 255, .08);
  max-height: 440px; overflow-y: auto;
  animation: pf-pop .16s ease-out both;
}
@keyframes pf-pop { from { opacity: 0; transform: translateY(-4px); } }
.pf-suggest li a { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; color: var(--text); text-decoration: none; }
.pf-suggest li[aria-selected="true"] a { background: linear-gradient(90deg, rgba(150, 51, 255, .22), rgba(150, 51, 255, .06)); }
.pf-suggest .pf-face { width: 40px; height: 40px; border-radius: 10px; }
.pf-suggest-text { display: grid; min-width: 0; }
.pf-suggest-text b { font: 650 15px/1.25 var(--font-ui); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-suggest-text small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-suggest li > a > img { width: 30px; height: 30px; object-fit: contain; }
.pf-suggest-empty { padding: 12px 14px; color: var(--muted); font-size: 14px; }
@media (prefers-reduced-motion: reduce) { .pf-suggest { animation: none; } }
.pf-spot { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 12px 20px 12px 12px; max-width: 620px; text-decoration: none; }
.pf-spot:hover { border-color: rgba(199, 151, 255, .45); }
.pf-face { position: relative; width: 96px; height: 96px; border-radius: 14px; overflow: hidden; background: radial-gradient(80% 70% at 50% 40%, rgba(172, 52, 255, .3), transparent 70%), var(--pf-panel-2); }
.pf-face img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; transform: scale(2); transform-origin: 50% 3%; }
.pf-spot h3 { margin: 0 0 6px; font: 700 22px/1.05 var(--font-display); color: var(--text); overflow-wrap: anywhere; }
.pf-spot p { margin: 0; font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.pf-spot p img { width: 22px; height: 22px; }
.pf-spot-value { font: 700 26px/1 var(--font-display); color: var(--text); text-align: right; }
.pf-spot-value small { display: block; margin-top: 4px; font: 600 12px/1 var(--font-ui); color: var(--dim); }
.pf-tabs { display: flex; gap: 6px; }
.pf-tab { border: 1px solid var(--line-strong); background: var(--pf-panel); color: var(--muted); border-radius: 999px; padding: 8px 14px; cursor: pointer; font: 600 13.5px/1 var(--font-ui); }
.pf-tab[aria-selected="true"] { color: #fff; border-color: transparent; background: linear-gradient(115deg, var(--btn-a), var(--btn-b)); }
.pf-board table { width: 100%; border-collapse: collapse; }
.pf-board td { padding: 12px 18px; border-top: 1px solid var(--pf-panel-line); color: var(--muted); font-size: 15px; }
.pf-board tr:first-child td { border-top: 0; }
.pf-board td.num { text-align: right; font: 700 17px/1 var(--font-display); color: var(--text); font-variant-numeric: tabular-nums; }
.pf-board td.num small { display: block; margin-top: 4px; font: 500 12px/1 var(--font-ui); color: var(--dim); }
.pf-board-note { margin: 0; padding: 10px 18px 12px; border-top: 1px solid var(--pf-panel-line); font-size: 13px; color: var(--dim); }
.pf-empty + .pf-board-note { border-top: 0; }
.pf-rank { width: 44px; font: 700 17px/1 var(--font-display); color: var(--dim); }
.pf-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pf-who img { width: 28px; height: 28px; flex: none; }
.pf-who a { color: var(--text); text-decoration: none; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-who a:hover { color: var(--accent-light); }
.pf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.pf-pcard { display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; text-decoration: none; }
.pf-pcard:hover { border-color: rgba(199, 151, 255, .45); }
.pf-pcard .pf-face { width: 56px; height: 56px; border-radius: 12px; flex: none; }
.pf-pcard h3 { margin: 0 0 4px; font: 700 16px/1.1 var(--font-display); color: var(--text); overflow-wrap: anywhere; }
.pf-pcard p { margin: 0; font-size: 13px; color: var(--dim); display: flex; align-items: center; gap: 6px; }
.pf-pcard p img { width: 18px; height: 18px; }
.pf-count { margin: 0; color: var(--dim); font-size: 14px; }
.pf-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 18px; }
.pf-pager[hidden] { display: none; }
.pf-pager-where { color: var(--muted); font-size: 14px; min-width: 96px; text-align: center; }
.pf-pager-btn:disabled { opacity: .4; cursor: default; }
.pf-pager-btn:not(:disabled):hover { color: var(--text); border-color: var(--focus); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .pf-head { padding-top: calc(var(--header-h) + 80px); }
  .pf-head-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .pf-figure { width: min(210px, 56%); margin: 0 auto; }
  .pf-head-cards { grid-template-columns: minmax(0, 1fr); }
  .pf-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  /* touch: names and small controls get at least a 40px tall hit area */
  .pf-who a, .pf-rivals a, .pf-crumbs a { display: inline-flex; align-items: center; min-height: 40px; }
  .pf-vs a { display: inline-block; padding: 10px 0; line-height: 20px; }
  .pf-tab, .pf-more { min-height: 40px; }
  .pf-rivals li { padding-block: 4px; }
}
@media (max-width: 560px) {
  .pf-banner { height: 280px; }
  .pf-game { grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; padding: 11px 12px; }
  .pf-date { grid-column: 2 / -1; text-align: left; margin-top: -6px; }
  .pf-spot { grid-template-columns: 72px minmax(0, 1fr); padding-right: 14px; }
  .pf-face { width: 72px; height: 72px; }
  .pf-spot-value { grid-column: 2; text-align: left; font-size: 20px; }
  .pf-board td { padding: 11px 12px; }
  .pf-rank { width: 30px; }
}

/* ---- The Players page's Basketball 21 / Basketball 22 switch and the 22 empty state (10-25) ---- */
.pf-gameswitch { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.pf-gameswitch .pf-tab { display: inline-flex; align-items: center; text-decoration: none; }
.pf-gameswitch .pf-tab[aria-current="page"] { color: #fff; border-color: transparent; background: linear-gradient(115deg, var(--btn-a), var(--btn-b)); }
.pf-empty-22 p { margin: 0; }
.pf-empty-22 p + p { margin-top: 8px; }
