/* ─── KC7 Leaderboard (matches Profile v5) ─── */
:root {
  --p-bg: #f7f8fa;
  --p-card: #ffffff;
  --p-border: #e5e7eb;
  --p-text: #111827;
  --p-muted: #6b7280;
  --p-faint: #9ca3af;
  --p-green: #10b981;
  --p-amber: #f59e0b;
  --p-red: #ef4444;
  --p-blue: #3b82f6;
  --p-purple: #8b5cf6;
  --p-indigo: #6366f1;
}

.lb-wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 16px 80px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--p-text);
}

/* ─── HERO ─── */
.lb-hero {
  text-align: center;
  margin: 8px 0 32px;
}
.lb-hero-title {
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  font-weight: 800;
  margin: 0 0 10px;
  letter-spacing: -0.03em;
  line-height: 1.05;
  background: linear-gradient(95deg, #111827 0%, #4f46e5 45%, #f59e0b 95%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: lb-title-shift 8s ease-in-out infinite;
}
@keyframes lb-title-shift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
.lb-hero-meta {
  font-size: 0.85rem;
  color: var(--p-muted);
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.lb-hero-meta-num {
  font-weight: 700;
  color: var(--p-text);
}
.lb-hero-dot {
  margin: 0 6px;
  color: var(--p-faint);
}
.lb-hero-blurb {
  font-size: 0.85rem;
  color: var(--p-muted);
  margin: 8px 0 0;
}

/* ─── SECTION TITLES (mirrors profile) ─── */
.lb-sec { margin-bottom: 32px; }
.lb-sec-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--p-faint);
  margin-bottom: 12px;
}

/* ─── YOUR TIER PROGRESS CARD ─── */
.lb-yt {
  display: flex;
  gap: 22px;
  align-items: center;
  padding: 22px 26px;
  border-radius: 16px;
  background: var(--p-card);
  border: 2px solid var(--p-border);
  position: relative;
  isolation: isolate;
}
.lb-yt.lb-tier-gold { border: none; }
.lb-yt.lb-tier-gold::before {
  content: ''; position: absolute; inset: -2px; border-radius: 18px;
  background: conic-gradient(from var(--gold-angle, 0deg), #d4a017, #fbbf24, #fef3c7, #f59e0b, #d4a017);
  z-index: -2;
  animation: lbGoldSpin 4s linear infinite;
}
.lb-yt.lb-tier-gold::after {
  content: ''; position: absolute; inset: 2px; border-radius: 14px;
  background: linear-gradient(135deg, #fef9e7 0%, #fdf2d0 30%, #fefcf6 100%);
  z-index: -1;
}
@property --gold-angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
@keyframes lbGoldSpin { to { --gold-angle: 360deg; } }
.lb-yt.lb-tier-silver {
  border-color: #a8b2bd;
  background: linear-gradient(135deg, #f1f5f9 0%, #e8edf2 30%, #f9fafb 100%);
}
.lb-yt.lb-tier-bronze {
  border-color: #c8956c;
  background: linear-gradient(135deg, #fdf6f0 0%, #f9ede2 30%, #fefcfa 100%);
}

.lb-yt-av { position: relative; flex-shrink: 0; }
.lb-yt-av img {
  width: 88px; height: 88px; border-radius: 50%;
  border: 4px solid var(--p-border); object-fit: cover;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.lb-yt.lb-tier-gold .lb-yt-av img {
  border-color: #d4a017;
  box-shadow: 0 0 0 3px rgba(212,160,23,0.25), 0 0 20px rgba(251,191,36,0.30);
}
.lb-yt.lb-tier-silver .lb-yt-av img {
  border-color: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148,163,184,0.20), 0 0 16px rgba(148,163,184,0.20);
}
.lb-yt.lb-tier-bronze .lb-yt-av img {
  border-color: #c8956c;
  box-shadow: 0 0 0 3px rgba(200,149,108,0.18), 0 0 14px rgba(180,130,90,0.15);
}
.lb-yt-mid { flex: 1; min-width: 0; }
.lb-yt-eyebrow {
  font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--p-muted); font-weight: 600; margin-bottom: 4px;
}
.lb-yt-headline {
  font-size: 1.1rem; font-weight: 700; color: var(--p-text); margin-bottom: 8px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.lb-yt-pill {
  font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  padding: 3px 10px; border-radius: 6px;
}
.lb-pill-gold   { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #78350f; }
.lb-pill-silver { background: linear-gradient(135deg, #cbd5e1, #94a3b8); color: #334155; }
.lb-pill-bronze { background: linear-gradient(135deg, #d4a574, #c8956c); color: #5c3a1e; }
.lb-pill-blue   { background: #dbeafe; color: #1e3a8a; }
.lb-yt-progress { margin-top: 4px; }
.lb-yt-progress-text {
  font-size: 0.85rem; color: var(--p-muted); margin-bottom: 6px;
}
.lb-yt-progress-text strong { color: var(--p-text); font-weight: 700; }
.lb-yt-bar {
  width: 100%; height: 6px; background: #e5e7eb; border-radius: 3px; overflow: hidden;
}
.lb-yt-fill {
  height: 100%; background: linear-gradient(90deg, var(--p-indigo), var(--p-purple));
  border-radius: 3px; transition: width 0.6s ease;
}
.lb-yt-rank {
  flex-shrink: 0; padding-left: 22px; border-left: 1px solid var(--p-border);
  text-align: center; min-width: 96px;
}
.lb-yt-rank-num {
  font-size: 1.85rem; font-weight: 800; line-height: 1; color: var(--p-purple);
  font-variant-numeric: tabular-nums;
}
.lb-yt.lb-tier-gold   .lb-yt-rank-num { color: #b8860b; }
.lb-yt.lb-tier-silver .lb-yt-rank-num { color: var(--color-text-secondary); }
.lb-yt.lb-tier-bronze .lb-yt-rank-num { color: #a0724e; }
.lb-yt-rank-lbl {
  font-size: 0.62rem; color: var(--p-muted); text-transform: uppercase;
  letter-spacing: 0.5px; margin-top: 4px; font-weight: 500;
}
.lb-yt-cta {
  display: flex; align-items: center; gap: 16px;
  background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);
  border: 1px solid #c7d2fe;
}
.lb-yt-cta-icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--p-indigo), var(--p-purple));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; flex-shrink: 0;
}
.lb-yt-cta-body { flex: 1; }
.lb-yt-cta-body h3 {
  margin: 0 0 4px; font-size: 1rem; font-weight: 700; color: var(--p-text);
}
.lb-yt-cta-body p { margin: 0; font-size: 0.85rem; color: var(--p-muted); }
.lb-yt-cta-btn {
  background: var(--p-indigo); color: #fff; padding: 8px 18px;
  border-radius: 8px; font-weight: 600; font-size: 0.85rem;
  text-decoration: none; transition: background 0.15s;
  white-space: nowrap;
}
.lb-yt-cta-btn:hover { background: #4f46e5; color: #fff; text-decoration: none; }

/* ─── PODIUM ─── */
.lb-podium {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  align-items: end;
}
.lb-pod {
  background: var(--p-card);
  border: 2px solid var(--p-border);
  border-radius: 16px;
  padding: 22px 16px 18px;
  text-align: center;
  position: relative;
  isolation: isolate;
  transition: transform 0.15s ease;
}
.lb-pod:hover { transform: translateY(-3px); }
.lb-pod-1 {
  order: 2; padding-top: 30px;
  border: none;
}
.lb-pod-1::before {
  content: ''; position: absolute; inset: -2px; border-radius: 18px;
  background: conic-gradient(from var(--gold-angle, 0deg), #d4a017, #fbbf24, #fef3c7, #f59e0b, #d4a017);
  z-index: -2;
  animation: lbGoldSpin 4s linear infinite;
}
.lb-pod-1::after {
  content: ''; position: absolute; inset: 2px; border-radius: 14px;
  background: linear-gradient(135deg, #fef9e7 0%, #fdf2d0 30%, #fefcf6 100%);
  z-index: -1;
}
.lb-pod-2 {
  order: 1;
  border-color: #a8b2bd;
  background: linear-gradient(135deg, #f1f5f9 0%, #e8edf2 30%, #f9fafb 100%);
}
.lb-pod-3 {
  order: 3;
  border-color: #c8956c;
  background: linear-gradient(135deg, #fdf6f0 0%, #f9ede2 30%, #fefcfa 100%);
}
.lb-pod-medal {
  font-size: 1.5rem; line-height: 1;
  margin-bottom: 8px;
}
.lb-pod-1 .lb-pod-medal { font-size: 2rem; }
.lb-pod-av {
  width: 96px; height: 96px; border-radius: 50%; object-fit: cover;
  border: 4px solid var(--p-border); margin-bottom: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.lb-pod-1 .lb-pod-av {
  width: 116px; height: 116px;
  border-color: #d4a017;
  box-shadow: 0 0 0 3px rgba(212,160,23,0.25), 0 0 22px rgba(251,191,36,0.35);
  animation: lbGoldPulse 3s ease-in-out infinite;
}
@keyframes lbGoldPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(212,160,23,0.25), 0 0 22px rgba(251,191,36,0.35); }
  50%      { box-shadow: 0 0 0 5px rgba(212,160,23,0.35), 0 0 30px rgba(251,191,36,0.50); }
}
.lb-pod-2 .lb-pod-av {
  border-color: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148,163,184,0.20), 0 0 16px rgba(148,163,184,0.20);
}
.lb-pod-3 .lb-pod-av {
  border-color: #c8956c;
  box-shadow: 0 0 0 3px rgba(200,149,108,0.18), 0 0 14px rgba(180,130,90,0.15);
}
.lb-pod-name {
  font-size: 1rem; font-weight: 700; color: var(--p-text);
  text-decoration: none; display: block; margin-bottom: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lb-pod-name:hover { color: var(--p-indigo); text-decoration: none; }
.lb-pod-pts {
  font-size: 0.95rem; font-weight: 700; color: var(--p-text);
  font-variant-numeric: tabular-nums;
}
.lb-pod-1 .lb-pod-pts { color: #b8860b; }
.lb-pod-2 .lb-pod-pts { color: var(--color-text-secondary); }
.lb-pod-3 .lb-pod-pts { color: #a0724e; }
.lb-pod-rank-lbl {
  font-size: 0.62rem; color: var(--p-muted); text-transform: uppercase;
  letter-spacing: 0.5px; margin-top: 4px; font-weight: 500;
}
.lb-pod-crown {
  position: absolute; top: -16px; left: 50%; transform: translateX(-50%);
  font-size: 1.6rem; z-index: 3;
}

/* ─── TIER BANDS ─── */
.lb-bands {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.lb-band {
  background: var(--p-card); border: 1px solid var(--p-border);
  border-radius: 12px; padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  transition: transform 0.12s, box-shadow 0.12s;
}
.lb-band:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}
.lb-band-dot {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
}
.lb-band-dot-gold   { background: #fef3c7; color: #92400e; }
.lb-band-dot-silver { background: var(--color-bg); color: var(--color-text-secondary); }
.lb-band-dot-bronze { background: #fdf6f0; color: #92400e; }
.lb-band-dot-blue   { background: #dbeafe; color: #1e3a8a; }
.lb-band-dot-purple { background: #ede9fe; color: #5b21b6; }
.lb-band-name {
  font-size: 0.72rem; color: var(--p-muted);
  text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600;
}
.lb-band-val {
  font-size: 1.05rem; font-weight: 700; color: var(--p-text);
  font-variant-numeric: tabular-nums;
}

/* ─── TABS ─── */
.lb-tabs {
  display: flex; flex-wrap: wrap; gap: 4px;
  border-bottom: 1px solid var(--p-border);
  margin-bottom: 16px;
  overflow-x: auto;
}
.lb-tab {
  background: transparent; border: none; cursor: pointer;
  padding: 10px 16px; font-size: 0.85rem; font-weight: 600;
  color: var(--p-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
  font-family: inherit;
}
.lb-tab:hover { color: var(--p-text); }
.lb-tab.is-active {
  color: var(--p-indigo);
  border-bottom-color: var(--p-indigo);
}
.lb-tab-panel { display: none; }
.lb-tab-panel.is-active { display: block; }

/* ─── RANKINGS LIST ─── */
.lb-list {
  background: var(--p-card);
  border: 1px solid var(--p-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04), 0 8px 24px -16px rgba(17, 24, 39, 0.08);
}
.lb-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 14px 22px;
  border-bottom: 1px solid #f1f2f5;
  text-decoration: none;
  color: inherit;
  transition: background 0.18s ease, transform 0.18s ease;
  position: relative;
}
.lb-row:last-child { border-bottom: none; }
.lb-row:hover {
  background: var(--color-surface-raised);
  text-decoration: none;
  color: inherit;
}
.lb-row.is-you {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.08) 0%, rgba(99, 102, 241, 0.03) 100%);
  box-shadow: inset 3px 0 0 var(--p-indigo);
}
.lb-row.is-you:hover {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.13) 0%, rgba(99, 102, 241, 0.05) 100%);
}
/* Subtle podium glow for top 3 */
.lb-row.lb-row-top1 {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.06) 0%, transparent 60%);
}
.lb-row.lb-row-top2 {
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.07) 0%, transparent 60%);
}
.lb-row.lb-row-top3 {
  background: linear-gradient(90deg, rgba(200, 149, 108, 0.07) 0%, transparent 60%);
}
.lb-rank {
  font-size: 1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--p-faint);
  text-align: center;
  letter-spacing: -0.01em;
}
.lb-rank-1, .lb-rank-2, .lb-rank-3 {
  font-size: 1.35rem;
  font-weight: 700;
}
.lb-rank-1 { color: #d4a017; }
.lb-rank-2 { color: var(--color-text-muted); }
.lb-rank-3 { color: #c8956c; }
.lb-rank-medal { display: none; }
.lb-player {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.lb-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--p-border);
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.06);
}
.lb-row.is-you .lb-avatar { border-color: var(--p-indigo); }
.lb-row .lb-avatar.lb-av-gold   { border-color: #d4a017; box-shadow: 0 0 0 2px rgba(212, 160, 23, 0.12); }
.lb-row .lb-avatar.lb-av-silver { border-color: #94a3b8; box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.14); }
.lb-row .lb-avatar.lb-av-bronze { border-color: #c8956c; box-shadow: 0 0 0 2px rgba(200, 149, 108, 0.14); }
.lb-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--p-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  letter-spacing: -0.005em;
}
.lb-you-tag {
  font-size: 0.6rem;
  color: var(--p-indigo);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-left: 8px;
  padding: 2px 6px;
  background: rgba(99, 102, 241, 0.12);
  border-radius: 4px;
  vertical-align: 1px;
}
.lb-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--p-text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding-right: 18px;
  letter-spacing: -0.01em;
}
.lb-value-suffix {
  font-size: 0.72rem;
  color: var(--p-faint);
  font-weight: 500;
  margin-left: 4px;
  text-transform: lowercase;
  letter-spacing: 0.2px;
}

.lb-empty {
  padding: 48px 20px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--p-muted);
}
.lb-empty-emoji { font-size: 1.6rem; margin-bottom: 8px; }

.lb-view-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--p-indigo);
  text-decoration: none;
  border-top: 1px solid var(--p-border);
  background: #fcfcfd;
  transition: background 0.15s, gap 0.15s;
}
.lb-view-more:hover {
  background: #f5f3ff;
  color: var(--p-indigo);
  text-decoration: none;
  gap: 10px;
}
.lb-view-more::after {
  content: '→';
  transition: transform 0.15s;
}
.lb-view-more:hover::after { transform: translateX(2px); }

/* ─── PLAYERS AROUND YOU ─── */
.lb-around .lb-row { padding: 13px 22px; }
.lb-delta {
  display: inline-block;
  margin-left: 8px;
  font-size: 0.68rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.1px;
}
.lb-delta-up   { background: #fef3c7; color: #92400e; }
.lb-delta-down { background: #d1fae5; color: #065f46; }

/* ─── SUGGEST OTHER LEADERBOARDS ─── */
.lb-suggest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
}
.lb-suggest {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--p-card);
  border: 1px solid var(--p-border);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.lb-suggest:hover {
  text-decoration: none;
  color: inherit;
  border-color: var(--p-indigo);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px -8px rgba(99, 102, 241, 0.35);
}
.lb-suggest-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  width: 40px; height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f5f3ff;
  border-radius: 10px;
}
.lb-suggest-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.lb-suggest-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--p-text);
  letter-spacing: -0.005em;
}
.lb-suggest-sub {
  font-size: 0.78rem;
  color: var(--p-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lb-suggest-arrow {
  color: var(--p-faint);
  font-size: 1rem;
  transition: transform 0.18s ease, color 0.18s ease;
}
.lb-suggest:hover .lb-suggest-arrow {
  color: var(--p-indigo);
  transform: translateX(3px);
}

/* ─── EXPANDED PAGE BACK LINK ─── */
.lb-back {
  font-size: 0.82rem; color: var(--p-indigo);
  text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
  margin-bottom: 14px;
}
.lb-back:hover { text-decoration: underline; color: var(--p-indigo); }

/* ─── FOOTER CTAs ─── */
.lb-cta-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.lb-cta {
  display: flex; align-items: center; gap: 14px;
  background: var(--p-card); border: 1px solid var(--p-border);
  border-radius: 14px; padding: 18px;
  text-decoration: none; color: inherit;
  transition: transform 0.12s, box-shadow 0.12s;
}
.lb-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.07);
  text-decoration: none; color: inherit;
}
.lb-cta-ic {
  width: 42px; height: 42px; border-radius: 12px;
  background: #eef2ff; color: var(--p-indigo);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}
.lb-cta-name {
  font-size: 0.92rem; font-weight: 700; color: var(--p-text);
}
.lb-cta-sub { font-size: 0.78rem; color: var(--p-muted); margin-top: 2px; }

/* ─── BREADCRUMB (expanded page) ─── */
.lb-breadcrumb {
  font-size: 0.78rem; color: var(--p-muted); margin-bottom: 16px;
}
.lb-breadcrumb a { color: var(--p-indigo); text-decoration: none; }
.lb-breadcrumb a:hover { text-decoration: underline; }
.lb-bc-sep { margin: 0 6px; color: var(--p-faint); }

/* ─── RESPONSIVE ─── */
@media (max-width: 720px) {
  .lb-hero-title { font-size: 2rem; }

  .lb-yt {
    flex-direction: column; text-align: center; gap: 14px;
  }
  .lb-yt-rank {
    border-left: none; border-top: 1px solid var(--p-border);
    padding-left: 0; padding-top: 14px; width: 100%;
  }
  .lb-yt-headline { justify-content: center; }
  .lb-yt-cta { flex-direction: column; text-align: center; }

  .lb-podium {
    grid-template-columns: 1fr;
  }
  .lb-pod-1, .lb-pod-2, .lb-pod-3 { order: initial; }

  .lb-row {
    grid-template-columns: 48px 1fr auto;
    padding: 10px 14px;
    gap: 10px;
  }
  .lb-row.is-you { padding-left: 11px; }
}
