/* Public rankings + player profiles */
.rk-page .section-head p { max-width: 60ch; }
.rk-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 10px; }
.rk-period { display: flex; align-items: center; gap: 10px; font-size: .95rem; }
.rk-month select { min-height: 42px; border-radius: 999px; padding: 0 36px 0 16px; font-weight: 700; }
.rk-arrow { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: 1.3rem; line-height: 1; }
.rk-arrow:hover { border-color: var(--line-strong); }
.rk-arrow.off { opacity: .3; }
.rk-status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .88rem; margin: 0 0 12px; }

.rk-table { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.rk-row { display: grid; grid-template-columns: 3.2em minmax(0, 1fr) 4em 3em 3em 4.2em; align-items: center; gap: 8px; padding: 10px 16px; color: var(--text); text-decoration: none; font-variant-numeric: tabular-nums; }
.rk-row + .rk-row, .rk-gap + .rk-row { border-top: 1px solid var(--line); }
.rk-row > span:nth-child(n+3) { text-align: right; }
a.rk-row:hover { background: var(--surface-2); }
.rk-head { font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); background: var(--surface-2); padding-top: 9px; padding-bottom: 9px; }
.rk-rank { font-weight: 900; color: var(--muted); display: grid; place-items: center; width: 2em; height: 2em; border-radius: 50%; }
.rk-rank.r1 { background: #f5b301; color: #2b1d00; }
.rk-rank.r2 { background: #c9d2da; color: #1d2630; }
.rk-rank.r3 { background: #d9814a; color: #2b1200; }
.rk-name { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 700; }
.rk-name > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-name small { color: var(--muted); font-weight: 600; }
.rk-av { flex: none; width: 34px; height: 34px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--court); color: var(--lime); font-size: .76rem; font-weight: 800; }
.rk-av img { width: 100%; height: 100%; object-fit: cover; }
.rk-row.me { background: var(--lime-soft); }
:root[data-theme="dark"] .rk-row.me { background: rgba(215, 255, 24, .1); }
.rk-gap { text-align: center; color: var(--faint); letter-spacing: .3em; padding: 2px 0; border-top: 1px solid var(--line); }
.rk-more { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; font-size: .88rem; }
.rk-tops { display: flex; gap: 6px; }
.rk-tops a { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-weight: 700; text-decoration: none; }
.rk-tops a.on { background: var(--ink); border-color: var(--ink); color: #fff; }
:root[data-theme="dark"] .rk-tops a.on { background: var(--lime); border-color: var(--lime); color: var(--ink); }
.rk-sm { display: none; }
@media (max-width: 560px) {
  .rk-row { grid-template-columns: 2.2em minmax(0, 1fr) 2em 1.7em 1.7em 3.4em; gap: 5px; padding: 9px 10px; font-size: .9rem; }
  .rk-head { font-size: .68rem; letter-spacing: .04em; }
  .rk-lg { display: none; } .rk-sm { display: inline; }
  .rk-rank { width: 1.8em; height: 1.8em; }
  .rk-av { width: 26px; height: 26px; font-size: .64rem; }
  .rk-name { gap: 7px; }
}

/* profile */
.pf-head { display: flex; align-items: center; gap: 18px; margin: 4px 0 24px; }
.pf-av { flex: none; width: 88px; height: 88px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--court); color: var(--lime); font-size: 1.8rem; font-weight: 900; }
.pf-av img { width: 100%; height: 100%; object-fit: cover; }
.pf-id h1 { margin: 0 0 6px; font-size: clamp(1.6rem, 4vw, 2.2rem); letter-spacing: -.02em; }
.pf-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; color: var(--muted); font-size: .92rem; margin: 0; }
.pf-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .pf-stats { grid-template-columns: 1fr; } .pf-av { width: 68px; height: 68px; font-size: 1.4rem; } }
.pf-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px; }
.pf-card h2 { font-size: .9rem; color: var(--muted); font-weight: 700; margin: 0 0 8px; }
.pf-big { display: flex; align-items: baseline; gap: 8px; }
.pf-big b { font-size: 2.6rem; letter-spacing: -.03em; line-height: 1; }
.pf-big span { color: var(--muted); }
.pf-line { color: var(--muted); font-size: .9rem; margin: 8px 0 0; font-variant-numeric: tabular-nums; }
.pf-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pf-grid div { display: flex; flex-direction: column; }
.pf-grid b { font-size: 1.6rem; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pf-grid span { color: var(--muted); font-size: .8rem; }
.pf-h2 { font-size: 1.1rem; margin: 28px 0 12px; }

/* trophy case */
.pf-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.bdg { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 14px 10px 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.bdg b { font-size: .86rem; }
.bdg > span:last-child { font-size: .76rem; color: var(--muted); font-weight: 600; }
.bdg-medal { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 1.05rem; margin-bottom: 4px; }
.bdg-medal svg { width: 30px; height: 30px; fill: currentColor; }
.bdg.premium .bdg-medal { background: var(--court); color: var(--lime); box-shadow: 0 0 0 3px var(--lime); }
.bdg.premium.r1 .bdg-medal { background: #f5b301; color: #2b1d00; box-shadow: 0 0 0 3px #ffe08a; }
.bdg.premium.r2 .bdg-medal { background: #c9d2da; color: #1d2630; box-shadow: 0 0 0 3px #eef2f5; }
.bdg.premium.r3 .bdg-medal { background: #d9814a; color: #2b1200; box-shadow: 0 0 0 3px #f4c7a4; }
.bdg.numbered .bdg-medal { background: var(--court-2); color: #fff; }
.bdg.participation .bdg-medal { background: var(--surface-2); color: var(--court-2); }
.bdg.premium { border-color: var(--lime-deep); }

.pf-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.pf-li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; font-size: .92rem; }
.pf-li + .pf-li { border-top: 1px solid var(--line); }
.pf-li > b { margin-left: auto; }
.pf-res { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: .8rem; }
.pf-res.w { background: var(--ok-bg); color: var(--ok); }
.pf-res.l { background: var(--surface-2); color: var(--muted); }
.pf-mt { flex: 1; min-width: 0; }
.pf-mt i { font-style: normal; color: var(--faint); margin: 0 3px; }
.pf-dt { flex: none; font-size: .82rem; }
/* Profile & stats: quick numbers and props */
.pf-quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; margin: 0 0 10px; }
.pf-quick > div { display: grid; justify-items: center; gap: 2px; padding: 12px 6px; text-align: center; }
.pf-quick > div + div { border-left: 1px solid var(--line); }
.pf-quick b { font-size: 1.35rem; font-weight: 900; letter-spacing: -.02em; }
.pf-quick span { font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.pf-edit { display: inline-block; margin: 2px 0 14px; font-weight: 700; font-size: .9rem; }
.pf-props { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px 16px; margin: 0 0 14px; display: grid; gap: 10px; }
@media (max-width: 520px) { .pf-quick b { font-size: 1.15rem; } .pf-quick span { font-size: .62rem; } }

/* Recent open plays (each session's own ranking) */
.rk-recent { margin-top: 28px; }
.rk-h2 { font-size: 1.25rem; margin: 0 0 4px; }
.rk-sess-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.rk-sess { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; transition: transform .15s ease; }
.rk-sess:hover { transform: translateY(-1px); border-color: var(--line-strong); }
.rk-sess-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.rk-sess-h b { font-weight: 900; line-height: 1.25; }
.rk-sess-top { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 10px 0 6px; }
.rk-sess-p { display: flex; align-items: center; gap: 6px; min-width: 0; position: relative; }
.rk-sess-p .rk-av { flex: none; }
.rk-sess-n { display: flex; flex-direction: column; min-width: 0; font-weight: 800; font-size: .88rem; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-sess-n small { color: var(--muted); font-weight: 700; }
.rk-medal { position: absolute; left: -7px; top: -9px; z-index: 1; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: .65rem; font-weight: 900; background: #f4b400; color: #0b1411; }
.rk-medal.m2 { background: #c8ced8; }
.rk-medal.m3 { background: #e2a35a; }
.rk-sess-go { font-weight: 800; font-size: .85rem; color: var(--court, #0c3a2c); }
:root[data-theme="dark"] .rk-sess-go { color: var(--lime); }

/* DUPR ranking: #, player, DUPR doubles */
.rk-dupr .rk-row { grid-template-columns: 3.2em minmax(0, 1fr) 7.5em; }
.rk-dupr .rk-dr { font-weight: 900; font-size: 1.05rem; }
.rk-status .dupr-badge { vertical-align: middle; margin-right: 4px; }
@media (max-width: 640px) { .rk-dupr .rk-row { grid-template-columns: 2.2em minmax(0, 1fr) 6.5em; } }

/* ---------- Player profile (player card + tabs) ---------- */
.pfx .back-btn { margin-bottom: 14px; }
.pfx-hero { position: relative; overflow: hidden; background: #0b1411; color: #fff; border-radius: 28px; padding: 20px; border: 1px solid rgba(255,255,255,.06); }
.pfx-hero::after { content: ""; position: absolute; right: -70px; top: -70px; width: 240px; height: 240px; border-radius: 50%; background: var(--lime); opacity: .12; pointer-events: none; }
.pfx-id { position: relative; display: flex; align-items: center; gap: 14px; }
.pfx-av { flex: none; width: 78px; height: 78px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: linear-gradient(135deg, #2c6e52, #0f3d2e); color: var(--lime); font-size: 1.6rem; font-weight: 900; border: 3px solid var(--lime); }
.pfx-av img { width: 100%; height: 100%; object-fit: cover; }
.pfx-name { min-width: 0; }
.pfx-eyebrow { font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--lime); margin-bottom: 2px; }
.pfx-name h1 { margin: 0; color: #fff; font-size: clamp(1.45rem, 5.6vw, 2.1rem); line-height: 1.1; letter-spacing: -.02em; overflow-wrap: anywhere; }
.pfx-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pfx-chips span { font-size: .78rem; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: rgba(255,255,255,.12); color: #fff; white-space: nowrap; }
.pfx-chips span.on { background: var(--lime); color: #0b1411; }
.pfx-rank { position: relative; display: flex; align-items: flex-end; gap: 12px; margin: 18px 0 16px; }
.pfx-rank b { font-size: 4.2rem; line-height: .86; font-weight: 900; letter-spacing: -.05em; color: var(--lime); font-variant-numeric: tabular-nums; }
.pfx-rank b.none { color: rgba(255,255,255,.35); }
.pfx-rank span { color: #c8d0ca; font-weight: 700; font-size: .88rem; line-height: 1.35; padding-bottom: 4px; }
.pfx-acts { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pfx-acts.one { grid-template-columns: 1fr; }
.pfx-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; border-radius: 99px; font-weight: 800; padding: 0 14px; text-decoration: none; }
.pfx-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pfx-btn svg { width: 18px; height: 18px; flex: none; }
.pfx-btn.lime { background: var(--lime); color: #0b1411; border: 0; }
.pfx-btn.ghost { background: rgba(255,255,255,.1); color: #fff; border: 1.5px solid rgba(255,255,255,.22); }
.pfx-btn.ghost:hover { background: rgba(255,255,255,.16); }
.pfx-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: 22px; margin-top: 12px; overflow: hidden; }
.pfx-strip > div { display: grid; justify-items: center; gap: 2px; padding: 13px 4px; text-align: center; }
.pfx-strip > div + div { border-left: 1px solid var(--line); }
.pfx-strip b { font-size: 1.35rem; font-weight: 900; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pfx-strip span { font-size: .66rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.pfx-tabs { position: sticky; top: calc(var(--header-h, 64px) + 6px); z-index: 5; display: flex; gap: 4px; margin: 14px 0 2px; padding: 4px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); }
.pfx-tabs button { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 800; font-size: .88rem; padding: 10px 2px; border-radius: 99px; cursor: pointer; }
.pfx-tabs button.on { background: var(--ink); color: #fff; }
[data-theme="dark"] .pfx-tabs button.on { background: var(--lime); color: #0b1411; }
.pfx-panel { padding-top: 10px; }
.pfx-panel[hidden] { display: none; }
.pfx-panel > .pf-h2:first-child { margin-top: 6px; }
.pfx-card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 16px; margin-top: 10px; }
.pfx-panel > .pfx-card:first-child, .pfx-panel > .pf-list:first-child, .pfx-panel > .pf-badges:first-child, .pfx-panel > .pm-top:first-child { margin-top: 0; }
.pfx-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.pfx-h h2 { margin: 0; font-size: 1.05rem; }
.pfx-h > span { color: var(--muted); font-size: .8rem; font-weight: 600; }
.pfx-link { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; font-size: .85rem; color: var(--muted); cursor: pointer; }
.pfx-form { display: flex; gap: 5px; flex-wrap: wrap; }
.pfx-form span { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font-weight: 900; font-size: .78rem; }
.pfx-form span.w { background: #1f9d55; color: #fff; }
.pfx-form span.l { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.pfx-note { margin: 10px 0 0; font-weight: 700; font-size: .88rem; }
.pfx-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pfx-two .pfx-card { margin-top: 10px; }
.pfx-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.pfx-grid div { display: grid; gap: 1px; }
.pfx-grid b { font-size: 1.3rem; font-weight: 900; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pfx-grid span { color: var(--muted); font-size: .74rem; font-weight: 600; }
.pfx-mate { display: flex; align-items: center; gap: 12px; }
.pfx-mate .pm-face { width: 48px; height: 48px; }
.pfx-mate div { display: grid; gap: 2px; min-width: 0; }
.pfx-mate span { color: var(--muted); font-size: .86rem; }
@media (max-width: 640px) { .pfx-two { grid-template-columns: 1fr; gap: 0; } }
@media (max-width: 400px) { .pfx-hero { padding: 16px; border-radius: 24px; } .pfx-av { width: 66px; height: 66px; font-size: 1.35rem; } .pfx-rank b { font-size: 3.6rem; } .pfx-strip b { font-size: 1.15rem; } .pfx-tabs button { font-size: .8rem; } }
