  /* ── Stat column alignment ──────────────────────────────────────────────
     Centering (rather than right-aligning) the numeric columns keeps each
     value visually locked under its header instead of hugging the far
     right edge of a variable-width column. */
  .lb-wrap th.num, .lb-wrap td.num {
    text-align: center;
    padding-left: 20px;
    padding-right: 20px;
  }

  /* ── Time range selector ────────────────────────────────────────────────
     Identical markup/behavior to the main leaderboards page - see
     leaderboards/index.html for the rationale on the stacked
     label-above-chips layout. */
  .window-select-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-left: auto;
  }
  .window-select-label {
    font-family: var(--mono);
    font-size: .68rem;
    font-weight: 500;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
  }
  .window-pills {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
  }
  .window-pill {
    font: inherit;
    font-family: 'Inter', sans-serif;
    font-size: .82rem;
    font-weight: 500;
    padding: 0 18px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: none;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: background .15s, color .15s;
  }
  .window-pill:hover { color: var(--text); background: rgba(255,255,255,.05); }
  .window-pill.active {
    color: var(--text);
    background: var(--accent-dim);
    box-shadow: 0 0 0 1px var(--accent-border) inset;
    font-weight: 600;
  }
  @media (max-width: 640px) {
    .window-select-wrap { align-items: stretch; margin-left: 0; }
    .window-pills { justify-content: stretch; }
    .window-pill { flex: 1 1 auto; justify-content: center; }
  }

  /* ── Category dropdown (replaces native <select>) ───────────────────────
     Custom button + floating menu, matching the site's existing
     .nav-dropdown / .nav-dd-menu pattern instead of an unstyled native
     select with its default browser arrow. Used here for both the weapon
     picker and the stat picker. */
  .category-dd { position: relative; }
  .category-dd-btn {
    height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: .84rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    min-width: 200px;
    justify-content: space-between;
  }
  .category-dd-btn:hover { border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.03); }
  .category-dd-btn:focus-visible, .category-dd.open .category-dd-btn {
    outline: none;
    border-color: var(--accent-border);
    box-shadow: 0 0 0 3px var(--accent-dim);
  }
  .category-dd-caret {
    width: 11px; height: 11px; flex-shrink: 0; color: var(--muted);
    transition: transform .15s;
  }
  .category-dd.open .category-dd-caret { transform: rotate(180deg); }
  .category-dd-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 240px;
    max-height: 360px;
    overflow-y: auto;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0,0,0,.35);
    padding: 6px;
    z-index: 40;
  }
  .category-dd.open .category-dd-menu { display: block; }
  .category-dd-group + .category-dd-group { margin-top: 4px; }
  .category-dd-group-label {
    font-family: var(--mono);
    font-size: .62rem;
    font-weight: 500;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted2);
    padding: 8px 10px 4px;
  }
  .category-dd-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    border-radius: 7px;
    border: none;
    background: transparent;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: .82rem;
    cursor: pointer;
    transition: background .12s, color .12s;
  }
  .category-dd-item:hover { background: rgba(255,255,255,.06); }
  .category-dd-item.active { color: var(--accent); background: var(--accent-dim); font-weight: 500; }

  /* Weapon dropdown menu can run long (every tracked weapon) - cap it a
     touch taller than the stat dropdown and let it scroll. */
  #weapon-dd .category-dd-menu { min-width: 260px; }

  /* ── Pagination controls ─────────────────────────────────────────────── */
  .lb-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
  }
  .lb-page-btn {
    font: inherit;
    font-family: 'Inter', sans-serif;
    font-size: .82rem;
    font-weight: 600;
    padding: 0 18px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: background .15s, border-color .15s, opacity .15s;
  }
  .lb-page-btn:hover:not(:disabled) { border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.05); }
  .lb-page-btn:disabled { opacity: .35; cursor: default; }
  .lb-page-info {
    font-family: var(--mono);
    font-size: .74rem;
    font-weight: 500;
    letter-spacing: .04em;
    color: var(--muted);
    min-width: 64px;
    text-align: center;
  }

  /* ── Top-3 medal icons ───────────────────────────────────────────────── */
  .rank-medal-icon { width: 26px; height: 26px; object-fit: contain; display: inline-block; }

  /* ── Slimmer, fully-clickable/highlightable player cell ─────────────────
     Highlight is the same full-row tint used on the profiles page
     (tr:hover td) rather than a boxed cell. */
  .lb-wrap .player-cell { gap: 12px; }
  /* A little more space before the platform icon than the shared default
     (.player-sub gap: 5px) - scoped to .lb-wrap only, matching the main
     leaderboards page so the Steam icon sits the same distance from the
     player ID on both pages. */
  .lb-wrap .player-sub { gap: 12px; }
  /* No rounded corners on avatars anywhere in the product — keep this square. */
  .lb-wrap .list-av { width: 44px; height: 44px; border-radius: 0; }
  .lb-wrap .player-id-block { gap: 1px; min-height: 44px; justify-content: center; }
  .lb-wrap .player-name { font-size: .92rem; }
  .lb-wrap tr:hover td { background: rgba(255,204,0,.05); }
  .player-cell-link {
    display: flex;
    align-items: center;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
  }
  .player-cell-link:focus-visible {
    outline: 2px solid var(--accent-border);
    outline-offset: 2px;
    border-radius: 6px;
  }

  /* ── Rank-search bar merged into the results card ────────────────────────
     Same flattening technique as the profiles search page's .mh-card: the
     "find your rank" bar now lives inside .lb-wrap as its header row instead
     of floating above it as a separate box, with a hairline seam instead of
     two stacked panels. */
  .lb-wrap.mh-card { padding: 0; overflow: hidden; }
  .lb-wrap.mh-card .lb-controls-search {
    margin: 0; padding: 0; flex: 1 1 auto; min-width: 200px;
  }
  .lb-wrap.mh-card .lb-controls-search .mh-search-wrap {
    height: 42px; margin-bottom: 0;
  }
  .lb-wrap.mh-card .table-scroll thead tr { border-top: none; }

  /* ── Controls split across two rows ──────────────────────────────────────
     Weapon dd, Category dd, and Time range share the card's first row
     (dropdowns left, time range pushed right via .window-select-wrap's
     margin-left:auto) - matching the main leaderboards page's single-row
     layout. The rank-search bar gets its OWN full-width row below instead
     of squeezing into that same row: with an extra dropdown here (weapon +
     category, vs. just one category picker on the main leaderboards page)
     there isn't room left for a sensibly-wide search box without wrapping
     unpredictably, so it gets a dedicated row instead. */
  .lb-wrap.mh-card .lb-controls-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 16px;
    padding: 16px 18px;
  }
  .lb-wrap.mh-card .lb-search-row {
    display: flex;
    padding: 0 18px 16px;
    border-bottom: 1px solid var(--border2);
  }
  @media (max-width: 640px) {
    .lb-wrap.mh-card .lb-controls-row { flex-direction: column; align-items: stretch; }
    .lb-wrap.mh-card .lb-controls-search { flex: 1 1 auto; }
  }

  /* Center the Weapon/Category labels above their pills instead of
     left-aligning them - scoped to this page only. */
  body[data-page="weapons_leaderboard"] .category-select-wrap {
    align-items: center;
  }
  body[data-page="weapons_leaderboard"] .category-select-label {
    text-align: center;
  }

  /* ── Graffiti decal ──────────────────────────────────────────────────────
     Absolutely positioned against body (see body's position:relative in
     styles.css) rather than .page, and appended to body - so left/right
     offsets still measure from the full page width (keeping it out in
     the margin beside the content, not overlapping it), while top sits
     just below the sticky topbar (50px) so it stays near the top of the
     page instead of trailing down to the footer. */
  .graff-decal {
    position: absolute;
    top: 400px;
    z-index: 4;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
  }
  .graff-decal--ancient { left: -20px; width: 380px; }
  @media (max-width: 899px) {
    .graff-decal--ancient { display: none; }
  }
