/*
 * leadership/static/leadership/css/leaderboard.css
 * ──────────────────────────────────────────────────
 * Full leaderboard styles for the leadership app.
 * Three tiers: Elite (gold) · Contenders (orange) · Field (standard)
 * Mobile-first. All classes namespaced lb-*.
 */

/* ── Keyframes ─────────────────────────────────────────────────── */

@keyframes lbPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212,175,55,0.4); }
  50%       { box-shadow: 0 0 0 8px rgba(212,175,55,0); }
}

@keyframes lbHighlight {
  0%   { background: rgba(212,175,55,0.2); }
  100% { background: transparent; }
}

@keyframes lbDotBlink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.25; }
}


/* ══ HERO ═══════════════════════════════════════════════════════ */

.lb-hero {
  position: relative;
  background: var(--c-midnight);
  padding: 52px 0 44px;
  overflow: hidden;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.lb-hero__bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }

.lb-hero__bg-glow {
  position: absolute; border-radius: 50%; filter: blur(80px);
}
.lb-hero__bg-glow--gold {
  width: 60%; height: 80%; left: -10%; top: -10%;
  background: radial-gradient(ellipse at center, rgba(212,175,55,0.11) 0%, transparent 65%);
}
.lb-hero__bg-glow--red {
  width: 40%; height: 70%; right: -5%; bottom: -10%;
  background: radial-gradient(ellipse at center, rgba(192,57,43,0.08) 0%, transparent 65%);
}

.lb-hero__inner {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; gap: 28px;
}

@media (min-width: 768px) {
  .lb-hero__inner { flex-direction: row; align-items: center; justify-content: space-between; }
}

/* Hero copy */
.lb-hero__kicker {
  display: flex; align-items: center; gap: 8px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.26em;
  text-transform: uppercase; color: var(--c-gold);
  margin-bottom: 12px; opacity: 0.9;
}

.lb-hero__kicker-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--c-gold);
  flex-shrink: 0; animation: lbDotBlink 2s ease-in-out infinite;
}

.lb-hero__title {
  font-family: var(--font-display);
  font-size: clamp(30px, 5vw, 54px); font-weight: 900;
  color: var(--c-text-100); letter-spacing: -0.02em; margin: 0 0 10px;
}

.lb-hero__sub {
  font-size: 15px; line-height: 1.7; color: var(--c-text-55); max-width: 520px;
}

.lb-hero__fox-record { color: var(--c-gold); font-style: normal; }

/* Hero stats */
.lb-hero__stats {
  display: flex; align-items: center; flex-shrink: 0;
  gap: 0; flex-wrap: wrap; row-gap: 12px;
  padding: 18px 24px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
}

.lb-hero__stat       { text-align: center; padding: 0 20px; }
.lb-hero__stat-num   { display: block; font-family: var(--font-display); font-size: 28px; font-weight: 900; color: var(--c-gold); line-height: 1; margin-bottom: 4px; }
.lb-hero__stat-num--sm { font-size: 14px; color: var(--c-text-75); letter-spacing: -0.01em; }
.lb-hero__stat-lbl   { display: block; font-size: 10px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--c-text-35); }
.lb-hero__stat-div   { width: 1px; height: 32px; background: rgba(255,255,255,0.07); flex-shrink: 0; align-self: center; }


/* ══ YOU BANNER ═════════════════════════════════════════════════ */

.lb-you-banner {
  background: rgba(212,175,55,0.06);
  border-bottom: 1px solid rgba(212,175,55,0.2);
  padding: 12px 0;
}

.lb-you-banner__inner {
  max-width: var(--max-w); margin: 0 auto; padding: 0 var(--space-7);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}

.lb-you-banner__label  { font-size: 10px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--c-text-35); }
.lb-you-banner__rank   { font-family: var(--font-display); font-size: 22px; font-weight: 900; color: var(--c-gold); }
.lb-you-banner__name   { font-weight: 700; color: var(--c-text-100); }
.lb-you-banner__record { font-size: 12px; color: var(--c-text-55); }
.lb-you-banner__rate   { font-family: var(--font-display); font-size: 16px; font-weight: 900; color: var(--c-gold); }

.lb-you-banner__tension {
  font-size: 12px; font-style: italic; color: var(--c-orange);
  padding: 3px 10px;
  background: rgba(212,100,42,0.1);
  border: 1px solid rgba(212,100,42,0.2);
  border-radius: var(--r-pill);
}

.lb-you-banner__scroll {
  margin-left: auto; background: none; border: 1px solid rgba(212,175,55,0.3);
  color: var(--c-gold); border-radius: var(--r-pill); padding: 5px 14px;
  font-size: 12px; font-weight: 700; cursor: pointer; font-family: var(--font-body);
  transition: background 0.2s;
}
.lb-you-banner__scroll:hover { background: rgba(212,175,55,0.1); }


/* ══ BODY ═══════════════════════════════════════════════════════ */

.lb-body { padding: 40px 0 80px; display: flex; flex-direction: column; gap: 0; }


/* ══ TIER HEADERS ═══════════════════════════════════════════════ */

.lb-tier-header {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 0 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 0;
}

.lb-tier-header + .lb-podium,
.lb-tier-header + .lb-table { margin-top: 0; }

/* Spacing between tiers */
.lb-table + .lb-tier-header,
.lb-podium ~ .lb-table + .lb-tier-header { margin-top: 40px; }

.lb-tier-header__icon  { font-size: 22px; flex-shrink: 0; }

.lb-tier-header__copy  { flex: 1; }
.lb-tier-header__label { display: block; font-family: var(--font-display); font-size: 20px; font-weight: 900; color: var(--c-text-100); }
.lb-tier-header__desc  { display: block; font-size: 11px; color: var(--c-text-35); margin-top: 2px; font-weight: 600; letter-spacing: 0.08em; }

.lb-tier-header__count {
  font-family: var(--font-display); font-size: 13px; font-weight: 700;
  color: var(--c-text-35); background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07); border-radius: var(--r-pill);
  padding: 2px 10px;
}

.lb-tier-header--elite .lb-tier-header__label  { color: var(--c-gold); }
.lb-tier-header--contenders .lb-tier-header__label { color: var(--c-orange); }


/* ══ PODIUM ═════════════════════════════════════════════════════ */

.lb-podium {
  display: flex; align-items: flex-end; justify-content: center;
  gap: 0; padding: 32px 0 0; margin-bottom: 0;
}

.lb-podium__place {
  display: flex; flex-direction: column; align-items: center;
  flex: 0 0 auto; min-width: 140px;
}

.lb-podium__place--1 { z-index: 3; }
.lb-podium__place--2 { margin-right: -8px; z-index: 2; }
.lb-podium__place--3 { margin-left: -8px; z-index: 2; }

.lb-podium__crown { font-size: 24px; margin-bottom: 4px; }

.lb-podium__link {
  display: flex; flex-direction: column; align-items: center;
  gap: 7px; text-decoration: none; padding-bottom: 14px;
}

/* Avatar */
.lb-podium__av-wrap { position: relative; }

.lb-podium__avatar {
  width: 80px; height: 80px; border-radius: 50%; object-fit: cover;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 900; color: white;
  font-size: 24px;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.08), 0 8px 24px rgba(0,0,0,0.5);
  background: var(--cub-colour, #1a3a6b);
}

.lb-podium__place--1 .lb-podium__avatar { width: 100px; height: 100px; font-size: 30px; }

.lb-podium__avatar--gold   { box-shadow: 0 0 0 3px rgba(212,175,55,0.55), 0 8px 32px rgba(212,175,55,0.25); }
.lb-podium__avatar--silver { box-shadow: 0 0 0 3px rgba(200,200,220,0.4), 0 8px 24px rgba(0,0,0,0.4); }
.lb-podium__avatar--bronze { box-shadow: 0 0 0 3px rgba(180,120,50,0.4), 0 8px 24px rgba(0,0,0,0.4); }

.lb-podium__movement {
  position: absolute; bottom: 0; right: -4px;
  font-size: 9px; font-weight: 800;
  padding: 2px 5px; border-radius: var(--r-pill);
  line-height: 1;
}

.lb-movement--up   { background: rgba(45,189,122,0.2); color: var(--c-emerald-lt); border: 1px solid rgba(45,189,122,0.35); }
.lb-movement--down { background: rgba(192,57,43,0.15); color: var(--c-red-lt); border: 1px solid rgba(192,57,43,0.3); }
.lb-movement--same { color: var(--c-text-35); }
.lb-movement--new  { background: rgba(14,165,233,0.12); color: var(--c-cyan); border: 1px solid rgba(14,165,233,0.25); font-size: 8px; }

.lb-podium__medal  { font-size: 20px; }

.lb-podium__name   { font-family: var(--font-display); font-size: 16px; font-weight: 900; color: var(--c-text-100); text-align: center; }
.lb-podium__name--gold { color: var(--c-gold); font-size: 18px; }

.lb-podium__rate   { font-family: var(--font-display); font-size: 20px; font-weight: 900; color: var(--c-text-75); }
.lb-podium__rate--gold { color: var(--c-gold); font-size: 26px; }

.lb-podium__record { font-size: 11px; color: var(--c-text-35); letter-spacing: 0.05em; }

.lb-podium__badges { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }

.lb-podium__streak { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: var(--r-pill); }
.lb-streak--hot    { background: rgba(212,100,42,0.12); color: #ff8c42; border: 1px solid rgba(212,100,42,0.25); }
.lb-streak--warm   { background: rgba(212,100,42,0.08); color: rgba(212,100,42,0.8); border: 1px solid rgba(212,100,42,0.15); }
.lb-streak--cold   { background: rgba(14,165,233,0.1); color: var(--c-cyan); border: 1px solid rgba(14,165,233,0.2); }

/* Podium base blocks */
.lb-podium__block {
  width: 100%; min-height: 48px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 22px; font-weight: 900;
  color: rgba(255,255,255,0.35); border-radius: 8px 8px 0 0; margin-top: 4px;
}
.lb-podium__block--1 {
  min-height: 80px;
  background: linear-gradient(180deg, rgba(212,175,55,0.22), rgba(212,175,55,0.06));
  border: 1px solid rgba(212,175,55,0.28); border-bottom: none;
}
.lb-podium__block--2 {
  min-height: 56px;
  background: rgba(200,200,220,0.06); border: 1px solid rgba(255,255,255,0.09); border-bottom: none;
}
.lb-podium__block--3 {
  min-height: 40px;
  background: rgba(180,120,50,0.08); border: 1px solid rgba(180,120,50,0.15); border-bottom: none;
}


/* ══ TABLE ══════════════════════════════════════════════════════ */

.lb-table {
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--r-md); overflow: hidden;
  margin-top: 12px;
}

/* Table header */
.lb-table__header {
  display: grid;
  grid-template-columns: 48px 44px 1fr 64px minmax(0,180px) 100px 110px 70px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.lb-th {
  font-size: 9px; font-weight: 800; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--c-text-35);
}
.lb-th--rank   { text-align: center; }
.lb-th--move   { text-align: center; }
.lb-th--rate   { text-align: right; padding-right: 8px; }
.lb-th--streak { text-align: center; }
.lb-th--badges { text-align: center; }


/* ── Row (each is an <a> for full-row click) ── */
.lb-row {
  display: grid;
  grid-template-columns: 48px 44px 1fr 64px minmax(0,180px) 100px 110px 70px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  text-decoration: none; color: inherit;
  transition: background 0.15s;
  min-height: 52px;
}
.lb-row:last-child { border-bottom: none; }
.lb-row:hover { background: rgba(255,255,255,0.03); }

/* Tier colour treatments */
.lb-row--elite:hover      { background: rgba(212,175,55,0.04); }
.lb-row--contenders:hover { background: rgba(212,100,42,0.04); }

/* User's own row */
.lb-row--mine {
  background: rgba(212,175,55,0.05);
  box-shadow: inset 3px 0 0 var(--c-gold);
}
.lb-row--mine:hover { background: rgba(212,175,55,0.09); }

/* Unplayed — lighter */
.lb-row--unplayed { opacity: 0.65; }
.lb-row--unplayed:hover { opacity: 1; }

/* Pulse animation when scrolled to */
.lb-row--highlight-pulse { animation: lbHighlight 1.8s ease forwards; }


/* ── Cells ── */
.lb-td { font-size: 13px; color: var(--c-text-75); }

.lb-td--rank {
  text-align: center; font-family: var(--font-display);
  font-size: 15px; font-weight: 900; color: var(--c-text-35);
}
.lb-td--rank-elite      { color: var(--c-gold); }
.lb-td--rank-contenders { color: rgba(212,100,42,0.8); }

.lb-td--move { text-align: center; }

/* Movement indicators */
.lb-movement { font-size: 10px; font-weight: 800; letter-spacing: 0.04em; white-space: nowrap; }

/* Cub cell */
.lb-cub-inner { display: flex; align-items: center; gap: 10px; min-width: 0; }

.lb-avatar {
  width: 34px; height: 34px; border-radius: 50%; object-fit: cover;
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 11px; font-weight: 900; color: white;
  background: var(--cub-colour, #1a3a6b);
}

.lb-cub-name { font-weight: 700; color: var(--c-text-100); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.lb-you-tag {
  display: inline-block; font-size: 9px; font-weight: 800;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--c-gold); background: rgba(212,175,55,0.12);
  border: 1px solid rgba(212,175,55,0.25); border-radius: var(--r-pill);
  padding: 1px 6px; margin-left: 6px; vertical-align: middle;
}

/* Badges cell */
.lb-td--badges { text-align: center; }

.lb-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 13px; line-height: 1; padding: 2px 1px;
  border-radius: 3px; cursor: help;
}

/* Pick cell */
.lb-pick-silk {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  font-size: 9px; font-weight: 900; color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  margin-right: 5px; vertical-align: middle; flex-shrink: 0;
}
.lb-pick-name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-no-pick   { color: var(--c-text-35); font-size: 13px; }

/* Win rate cell */
.lb-td--rate   { text-align: right; padding-right: 8px; }
.lb-rate-wrap  { display: flex; align-items: center; gap: 7px; justify-content: flex-end; }
.lb-rate-bar-track { width: 48px; height: 5px; border-radius: 3px; background: rgba(255,255,255,0.07); flex-shrink: 0; }
.lb-rate-bar   { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--c-gold), #ffe87c); min-width: 2px; }
.lb-rate-num   { font-weight: 700; color: var(--c-gold); font-size: 13px; white-space: nowrap; }

/* Record cell */
.lb-record     { display: flex; align-items: center; gap: 4px; font-size: 12px; }
.lb-record__w  { color: var(--c-emerald-lt); font-weight: 700; }
.lb-record__l  { color: var(--c-text-35); }
.lb-record__d  { color: rgba(150,150,255,0.75); }
.lb-record__sep { color: var(--c-text-35); }

/* Streak cell */
.lb-td--streak { text-align: center; }
.lb-streak     { font-size: 11px; font-weight: 700; white-space: nowrap; }
.lb-streak--none { color: var(--c-text-35); }


/* ══ PROXIMITY TENSION ══════════════════════════════════════════ */

.lb-proximity {
  grid-column: 1 / -1;
  padding: 8px 14px 8px 106px;   /* indented past rank + move + avatar */
  background: rgba(212,100,42,0.05);
  border-bottom: 1px solid rgba(212,100,42,0.1);
  border-top: none;
}

.lb-proximity__text {
  font-size: 12px; font-style: italic; color: var(--c-orange);
  font-weight: 600;
}


/* ══ EMPTY STATE ════════════════════════════════════════════════ */

.lb-empty { text-align: center; padding: 80px 0; }
.lb-empty__icon  { font-size: 48px; margin-bottom: 16px; line-height: 1; }
.lb-empty__title { font-family: var(--font-display); font-size: 28px; font-weight: 900; color: var(--c-text-100); margin: 0 0 10px; }
.lb-empty__sub   { font-size: 15px; color: var(--c-text-55); max-width: 440px; margin: 0 auto 24px; line-height: 1.7; }


/* ══ RESPONSIVE ═════════════════════════════════════════════════ */

@media (max-width: 900px) {
  /* Hide pick and streak on tablet */
  .lb-th--pick,   .lb-td--pick   { display: none; }
  .lb-th--streak, .lb-td--streak { display: none; }

  .lb-table__header,
  .lb-row { grid-template-columns: 44px 40px 1fr 56px 100px 110px; }
}

@media (max-width: 640px) {
  /* Mobile: rank, cub, rate, record only */
  .lb-th--move,   .lb-td--move   { display: none; }
  .lb-th--badges, .lb-td--badges { display: none; }

  .lb-table__header,
  .lb-row { grid-template-columns: 40px 1fr 80px 90px; }

  .lb-podium__place { min-width: 100px; }
  .lb-podium__place--1 .lb-podium__avatar { width: 80px; height: 80px; font-size: 24px; }

  .lb-hero__stats { padding: 14px 16px; }
  .lb-hero__stat  { padding: 0 12px; }
}

/* ── Pick result badge in leaderboard (inherits from cubs.css) ──
   Also load cubs.css or duplicate these rules if leaderboard.css
   is used standalone without cubs.css.
   The pick-result-badge classes are defined in cubs.css.           */

/* Tighten badge size in compact leaderboard rows */
.lb-table .pick-result-badge {
  font-size: 9px;
  padding: 1px 6px;
}
