/* Ranking is a data table first. */
.rating-page { width: var(--content); margin: auto; padding: 20px 0 64px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.section-title h1,.section-title h2 { margin: 0; }
.section-title h1 { font-size: clamp(40px,4.5vw,60px); }
.section-title small { max-width: 320px; color: var(--muted); font-size: 12px; }
.release-tag { font-family: var(--font); font-size: 11px; color: var(--dim); font-weight: 400; vertical-align: middle; margin-left: 12px; }
.rating-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); border-top: 1px solid var(--line-bright); border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.rating-metrics article { padding: 16px 24px; border-right: 1px solid var(--line); display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 4px 20px; }
.rating-metrics article:first-child { padding-left: 0; }
.rating-metrics article:last-child { border-right: 0; }
.rating-metrics span { grid-column: 1/-1; color: var(--muted); font-size: 12px; }
.rating-metrics strong { font-family: var(--display); font-size: 40px; line-height: 1.1; font-weight: 500; font-variant-numeric: tabular-nums; }
.rating-metrics small { color: var(--dim); font-size: 11px; }
.rating-metrics .m-danger strong { color: var(--danger); }
.rating-metrics .m-warn strong { color: var(--gold); }
.rating-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 0 0 20px; }
.rating-search { width: min(420px,100%); }
.rating-refresh { border-color: var(--accent); color: var(--accent); }
.rating-refresh:hover { background: var(--accent); color: var(--accent-ink); }
.rating-updated { margin-left: auto; color: var(--dim); font-size: 11px; }
.rating-updated b { font-weight: 400; }
.clans-block { border-top: 1px solid var(--line); margin-bottom: 20px; }
.clans-head { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 12px 0; border: 0; color: var(--muted); font-size: 13px; }
.clans-head i { font-style: normal; }
.clans-head:hover { background: transparent; color: var(--text); }
.clans-body { display: none; }
.clans-block.open .clans-body { display: block; }
.clans-body ol { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); padding: 16px 0; margin: 0; list-style: none; gap: 12px 24px; border-top: 1px solid var(--line); }
.clans-body li { color: var(--muted); font-size: 13px; }
.clans-body b { color: var(--text); font-weight: 400; }
.table-wrap { overflow-x: auto; border-top: 1px solid var(--line-bright); margin-bottom: 48px; }
table.rating { width: 100%; min-width: 720px; border-collapse: collapse; font-variant-numeric: tabular-nums; background: var(--bg-deep); }
table.rating th { padding: 16px 20px; text-align: left; font-size: 12px; font-weight: 400; color: var(--muted); background: var(--panel); border-bottom: 1px solid var(--line-bright); white-space: nowrap; }
table.rating th:first-child { width: 80px; }
table.rating th:last-child { width: 22%; }
.sortable { cursor: pointer; }
.sortable:hover { color: var(--accent); }
.sortable[aria-sort=ascending]::after { content: ' ↑'; color: var(--accent); }
.sortable[aria-sort=descending]::after { content: ' ↓'; color: var(--accent); }
.arrow { display: none; }
table.rating td { border-bottom: 1px solid var(--line); padding: 16px 20px; font-size: 15px; }
table.rating tbody tr[data-pid] { cursor: pointer; }
table.rating tbody tr:hover,table.rating tr.selected { background: var(--panel-raised); }
table.rating tr.risk-medium { background: color-mix(in srgb,var(--gold) 5%,var(--bg-deep)); }
table.rating tr.risk-high { background: color-mix(in srgb,var(--danger) 7%,var(--bg-deep)); }
table.rating tr.risk-high:hover,table.rating tr.risk-medium:hover { background: var(--panel-raised); }
.cell-place { color: var(--dim); font-size: 13px; }
.cell-league,.cell-player { display: flex; align-items: center; gap: 12px; }
.cell-league img { width: 32px; height: 32px; object-fit: contain; }
.cell-player img { width: 36px; height: 36px; object-fit: contain; }
.cell-league b,.cell-rp b { font-weight: 500; }
.cell-league small,.cell-rp small { display: block; margin-top: 4px; font-size: 10px; color: var(--dim); }
.names { min-width: 0; }
.nick { display: block; font-weight: 500; overflow-wrap: anywhere; }
.sub { display: block; font-size: 11px; color: var(--dim); margin-top: 4px; }
.clan-pill { color: var(--muted); }
.cheat-cell { display: flex; align-items: center; gap: 12px; }
.cheat-bar { width: 100%; min-width: 48px; height: 3px; }
.cheat-cell b { width: 44px; flex-shrink: 0; color: var(--risk); font-size: 13px; text-align: right; font-weight: 500; }
.risk-dot { display: none; }
.empty-row td { color: var(--muted); padding: 40px 20px; }
.changes-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-bottom: 32px; }
.change-col { border-top: 1px solid var(--line); padding-top: 20px; }
.change-col h3 { font-size: 24px; margin-bottom: 16px; }
.change-col ul { list-style: none; margin: 0; padding: 0; }
.change-col li { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.change-col .place { color: var(--accent); }
.col-disappeared .place { color: var(--danger); }
.delta,.when,.changes-empty { color: var(--dim); font-size: 12px; }
.when { margin-left: auto; }
.drawer-open { overflow: hidden; }
.player-drawer-overlay { position: fixed; inset: 0; z-index: 400; background: rgb(3 8 12 / 82%); }
.player-drawer { position: fixed; z-index: 410; top: 0; right: 0; bottom: 0; width: min(620px,100%); overflow-y: auto; padding: 40px 32px; background: var(--bg); border-left: 1px solid var(--line-bright); }
.player-drawer .close { position: absolute; top: 16px; right: 16px; width: 44px; padding: 0; }
.pd-head { display: flex; align-items: center; gap: 20px; padding-right: 40px; margin-bottom: 32px; }
.pd-head img { width: 56px; height: 56px; object-fit: contain; }
.pd-head h3 { font-size: 40px; margin: 0 0 8px; overflow-wrap: anywhere; }
.pd-head small { color: var(--muted); font-size: 12px; }
.pd-verdict { display: flex; gap: 24px; align-items: center; justify-content: space-between; padding: 20px 0; border-top: 1px solid var(--line-bright); border-bottom: 1px solid var(--line); }
.pd-verdict b { font-weight: 500; }
.pd-verdict small { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }
.pd-verdict .pct { font-family: var(--display); color: var(--risk); font-size: 52px; line-height: 1; }
.pd-facts { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 20px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.pd-facts span { display: block; color: var(--muted); font-size: 11px; }
.pd-facts b { display: block; margin-top: 8px; font-family: var(--display); font-size: 28px; font-weight: 500; font-variant-numeric: tabular-nums; }
.pd-chart { margin-top: 24px; }
.pd-reason-details { margin: 24px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 14px; }
.pd-reasons { padding: 0; margin: 0 0 20px; list-style: none; }
.pd-reasons li { padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.pd-reasons .neg { color: var(--danger); }
.pd-profile-link { display: inline-flex; align-items: center; min-height: 44px; padding: 12px 16px; border: 1px solid var(--accent); color: var(--accent); text-decoration: none; font-size: 14px; }
.pd-profile-link:hover { background: var(--accent); color: var(--accent-ink); }
.state-box { min-height: 320px; padding: 64px 0; font-family: var(--display); font-size: 32px; }
.state-box small { font-family: var(--font); font-size: 14px; color: var(--muted); }
.state-box.error { color: var(--danger); }
.state-box p { font: 15px/1.55 var(--font); color: var(--muted); }
.state-box > div { margin-top: 24px; }
.spin { display: block; width: 48px; height: 2px; margin-bottom: 20px; background: var(--accent); }
@media(max-width:900px) {
  .section-title { flex-wrap: wrap; gap: 12px; }
  .rating-metrics article { padding-inline: 16px; grid-template-columns: 1fr; }
  .rating-metrics strong { font-size: 36px; }
  .rating-updated { width: 100%; margin: 0; }
  .clans-body ol { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media(max-width:560px) {
  .rating-page { padding-top: 12px; }
  .context-nav { gap: 12px; margin-bottom: 24px; }
  .section-title h1 { font-size: 40px; }
  .rating-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .rating-metrics article { padding: 16px 0; border-bottom: 1px solid var(--line); }
  .rating-metrics article:nth-child(even) { padding-left: 20px; border-right: 0; }
  .rating-metrics span { font-size: 11px; }
  .rating-search { width: calc(100% - 114px); flex: 1; }
  .rating-refresh { padding-inline: 12px; }
  .clans-body ol { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .changes-grid { grid-template-columns: 1fr; gap: 32px; }
  .player-drawer { padding: 32px 20px; }
  .pd-head { gap: 12px; }
  .pd-head h3 { font-size: 32px; }
  .pd-head img { width: 44px; height: 44px; }
  .pd-facts { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

.pd-leaderboard-stats { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 20px 0; gap: 20px 16px; }
.pd-leaderboard-stats b { font-family: var(--body, sans-serif); font-size: 18px; overflow-wrap: anywhere; }
