/* Leaderboard controls bar (category select + rank search). Loaded by leaderboards and weapons_leaderboard only. Split out of styles.css. */
/* =============================================================================
   LEADERBOARD CONTROLS BAR
   Replaces the old standalone .tab-row of 15 pill buttons with a single
   grouped <select> plus the rank search, laid out side by side. Reuses
   .search-wrap/.search-input/.search-btn and .rank-search-result already
   defined above; only the dropdown itself and the row layout are new.
   ============================================================================= */

.lb-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  margin-bottom: 14px;
}

.lb-controls-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
}

.category-select-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 220px;
}

.category-select-label {
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

.category-select {
  height: 44px;
  padding: 0 14px;
  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, box-shadow .15s;
}

.category-select:hover { border-color: rgba(255,255,255,.15); }

.category-select:focus {
  outline: none;
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.category-select optgroup {
  font-family: var(--mono);
  font-style: normal;
  color: var(--muted2);
  background: var(--surface2);
}

.category-select option {
  color: var(--text);
  background: var(--surface2);
}

.lb-controls .rank-search {
  width: 100%;
  max-width: none;
  margin-bottom: 0;
}

.lb-controls .rank-search .search-input { flex: 1; }

/* "Find your rank" result - was plain unstyled textContent dropped onto
   the page (no card, no icon, no color), which read as a debug string
   next to an otherwise fully-designed page. Now a small pill matching the
   card language used elsewhere (accent-tinted on a hit, neutral on a miss),
   with an icon so the state reads at a glance without parsing the sentence. */

.rank-search-result {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  margin: 12px 0 4px;
  border-radius: 0;
  border: 1px solid var(--border2);
  background: var(--surface);
  font-family: 'Inter', sans-serif;
  font-size: .84rem;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.4;
}

.rank-search-result.visible { display: flex; }

.rank-search-result strong { font-weight: 600; color: var(--text); }

.rank-search-result .rsr-icon {
  flex-shrink: 0;
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
}

.rank-search-result .rsr-icon svg { width: 100%; height: 100%; display: block; }

.rank-search-result .rsr-rank {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 20px; padding: 0 6px;
  border-radius: 999px;
  font-family: var(--mono); font-size: .72rem; font-weight: 600;
  background: rgba(255,255,255,.08); color: var(--text);
  margin: 0 1px;
}

.rank-search-result.hit {
  color: var(--text);
  background: var(--accent-dim);
  border-color: var(--accent-border);
}

.rank-search-result.hit .rsr-icon { color: var(--accent); }

.rank-search-result.hit .rsr-rank { background: var(--accent); color: #06171c; }

.rank-search-result.miss .rsr-icon { color: var(--muted2); }

.rank-search-result.loading { color: var(--muted2); font-style: italic; }

@media (max-width: 640px) {
  .lb-controls-top { flex-direction: column; align-items: stretch; }
  .category-select-wrap { min-width: 0; }
}

tr.rank-hit td { animation: rankPulse 1.4s ease 2; }
