/* Player Rankings page (2026-08-24). Rides on league.css for the body,
   palette, and spinner; this file adds the top-nav pills (copied from
   index.html's monolith so this standalone page matches the trade board),
   the tab row, and the ranking rows. Mobile-first like league.css. */

/* (Navigation is the bottom tab bar: templates/_tabbar.html + tabbar.css.) */

/* ── Controls ── */
.rk-controls { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.9rem; }
.rk-tabs { display: flex; gap: 0.3rem; overflow-x: auto; }
.rk-tab {
  flex: none; padding: 0.4rem 0.7rem; min-height: 44px; min-width: 44px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg-card); color: var(--ink-muted);
  font: 700 0.75rem inherit; font-family: inherit;
  width: auto; margin: 0; cursor: pointer;
}
.rk-tab.active { background: var(--accent-dark); border-color: var(--accent); color: var(--accent-bright); }
#rk-search, #rkw-search {
  width: 100%; box-sizing: border-box; padding: 0.55rem 0.75rem; min-height: 44px;
  /* 16px floor: anything smaller triggers iOS Safari's focus auto-zoom. */
  font-size: 16px; font-family: inherit;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 8px;
  color: var(--ink);
}
#rk-search:focus, #rkw-search:focus { outline: none; border-color: var(--accent); }
.rk-sub { color: var(--ink-muted); font-size: var(--fs-small); margin: 0.5rem 0 0.35rem; }

/* ── Trade value / This week toggle (2026-09-18) ──
   Two numbers per player (design/WEEKLY_VALUE_PLAN.md Sec 6a): a top-level
   pair of tabs above the existing position tabs, same pill look so it
   reads as one family of controls, not a second unrelated nav. */
.rk-view-tabs { display: flex; gap: 0.4rem; margin-top: 0.9rem; }
.rk-view-tab {
  flex: 1; padding: 0.6rem 0.7rem; min-height: 44px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg-card); color: var(--ink-muted);
  font: 700 var(--fs-body) inherit; font-family: inherit;
  width: auto; margin: 0; cursor: pointer; text-align: center;
}
.rk-view-tab.active { background: var(--accent-dark); border-color: var(--accent); color: var(--accent-bright); }

/* ── Position badges (draft.html's shared palette) ── */
.pos-badge {
  flex: none; font-size: var(--fs-caption); font-weight: 800; padding: 2px 5px;
  border-radius: 5px; letter-spacing: 0.03em; color: var(--bg-page);
  min-width: 2.1em; text-align: center;
}
.pos-QB { background: #f472b6; } .pos-RB { background: var(--good); }
.pos-WR { background: var(--accent); } .pos-TE { background: #fb923c; }
.pos-K  { background: var(--violet); } .pos-DST{ background: var(--ink-muted); }

/* ── Rows ── */
.rk-list { list-style: none; margin: 0; padding: 0; }
/* "Show 50 more" under the list (design-review step 7): the Lineups
   page's .lu-all look, full width, 44pt. */
.rk-more {
  display: flex; align-items: center; justify-content: center;
  width: 100%; margin: 0.6rem 0 0; min-height: 44px; padding: 0 0.75rem;
  background: var(--bg-raised); color: var(--ink-2);
  border: 1px solid var(--line-mid); border-radius: 999px;
  font: 600 var(--fs-small) -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  cursor: pointer;
}
.rk-more:hover { border-color: var(--accent); color: var(--ink); }
.rk-row {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.45rem 0.35rem; min-height: 44px;
  border-bottom: 1px solid var(--bg-card);
  cursor: pointer;
}
.rk-row:active { background: #1a2740; }
/* The row's display:flex would beat the UA's [hidden] rule and a paged-out
   row would still take its 66px (caught at 38,053px tall with 50 rows
   'showing', design-review step 7). */
.rk-row[hidden] { display: none; }
.rk-avatar { overflow: hidden; }
.rk-avatar img { width: 100%; height: 100%; object-fit: cover; }
.rk-rank {
  flex: none; width: 2.2em; text-align: right;
  color: var(--ink-muted); font-size: 0.72rem; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.rk-avatar {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  background: var(--line-soft); color: var(--ink-muted);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: var(--fs-caption); font-weight: 800;
}
.rk-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rk-name {
  color: var(--ink); font-size: 0.82rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rk-inj { color: var(--bad); font-size: var(--fs-caption); font-weight: 800; }
/* Owner tag: "(Eli)" after a rostered player's name (Eli's ask 2026-08-24,
   replacing the old "board" provenance chip — provenance lives in the
   page-level preseason note now). */
.rk-own { color: var(--accent-bright); font-size: var(--fs-caption); font-weight: 600; }
.rk-meta {
  color: var(--ink-muted); font-size: var(--fs-caption);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rk-fa .rk-meta { color: var(--ink-muted); }
.rk-nums {
  flex: none; display: flex; flex-direction: column; align-items: flex-end;
  font-variant-numeric: tabular-nums;
}
.rk-proj { color: var(--ink); font-size: 0.82rem; font-weight: 700; }
.rk-range { color: var(--ink-muted); font-size: var(--fs-caption); }
.rk-empty { color: var(--ink-muted); font-size: 0.8rem; padding: 1rem 0.35rem; list-style: none; }

@media (min-width: 640px) {
  .rk-controls { flex-direction: row; align-items: center; }
  .rk-tabs { flex: 1; }
  #rk-search { width: 220px; }
}

/* ── Value-over-wire ramp (design/README.md step 2, 2026-08-28) ──────────
   Shows how far a player beats the best available free agent — eff_vor,
   which the app already computed and never displayed. The bar is a FILL
   (validated >=2:1 against the card at its darkest step); the number and
   the tier word sit beside it, so the colour is reinforcement rather than
   the message. Strip the colour and the row still reads. */
.rk-tier {
  display: flex; align-items: center; gap: 0.32rem; margin-top: 0.22rem;
}
.rk-tier-track {
  flex: 0 0 54px; height: 5px; border-radius: 3px;
  /* --bg-page, not --bg-raised: measured against the raised surface the
     marginal tier sat at 2.53:1, under the 3:1 floor for a graphical
     object. On the page colour every tier clears it (3.01 to 10.71), and
     an inset well reading darker than its card is right anyway. */
  background: var(--bg-page); overflow: hidden;
}
.rk-tier-track i { display: block; height: 100%; border-radius: 3px; }
.rk-tier-val {
  font-size: var(--fs-caption); font-weight: 800; color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.rk-tier-label {
  font-style: normal; font-size: var(--fs-caption); color: var(--ink-muted);
  white-space: nowrap;
}
.tier-replaceable { background: var(--tier-replaceable); }
.tier-marginal    { background: var(--tier-marginal); }
.tier-solid       { background: var(--tier-solid); }
.tier-strong      { background: var(--tier-strong); }
.tier-elite       { background: var(--tier-elite); }
