/* leaderboard.html — Leaderboard page
   Depends on: base.css, nav.css, components.css
   ─────────────────────────────────────────────────────────────────────────── */

/* Leaderboard community strip sits directly below header; needs more spacer */
.logo-spacer { height: 82px }

/* ── Community strip ─────────────────────────────────────────────────────── */
.community-strip {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: .65rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  overflow-x: auto;
}
.cs-item { display: flex; align-items: center; gap: .5rem; white-space: nowrap; flex-shrink: 0 }
.cs-num  { font-size: 1.1rem; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums }
.cs-lbl  { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em }
.cs-div  { width: 1px; height: 20px; background: var(--border); flex-shrink: 0 }

/* ── Leaderboard table ───────────────────────────────────────────────────── */
.lb-wrap       { max-width: 1100px; margin: 0 auto; padding: 2.5rem 1.5rem }
.lb-header     { margin-bottom: 2rem }
.lb-header h1  { font-family: 'Playfair Display', serif; font-size: 2rem; color: var(--accent); margin-bottom: .3rem }
.lb-header p   { color: var(--muted); font-size: .9rem }

/* ── Most Crowned Caps ────────────────────────────────────────────────────
   Community-endorsement leaderboard. Renders above the main rankings as
   a horizontal-scroll list of cards; tapping a card opens that cap profile. */
.crowned-section { margin-bottom: 2.5rem }
.crowned-header { display: flex; align-items: center; gap: .55rem; margin-bottom: .9rem }
.crowned-header h2 { font-family: 'Playfair Display', serif; font-size: 1.25rem; color: var(--accent2, var(--accent)); margin: 0 }
.crowned-tooltip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--surface2); color: var(--muted);
  font-size: .72rem; font-weight: 700; cursor: help;
  border: 1px solid var(--border);
}
.crowned-tooltip:hover { color: var(--accent); border-color: var(--accent) }
.crowned-list  { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .65rem }
.crowned-card  {
  display: flex; align-items: center; gap: .65rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: .55rem .7rem; text-decoration: none;
  color: inherit; transition: border-color .15s, transform .15s;
}
.crowned-card:hover { border-color: var(--accent); transform: translateY(-1px) }
.crowned-rank  { font-size: .9rem; font-weight: 700; min-width: 30px; text-align: center; color: var(--muted) }
.crowned-photo {
  width: 44px; height: 44px; flex-shrink: 0;
  border-radius: 6px; overflow: hidden; background: var(--surface2);
  border: 1px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
}
.crowned-photo img { width: 100%; height: 100%; object-fit: cover }
.crowned-img-fallback { font-size: 1.4rem }
.crowned-meta  { flex: 1; min-width: 0 }
.crowned-name  { font-size: .85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.crowned-sub   { font-size: .7rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: .1rem }
.crowned-count { font-size: .82rem; font-weight: 700; color: var(--accent); flex-shrink: 0 }
.crowned-empty,
.crowned-loading {
  grid-column: 1 / -1; padding: 1.5rem 1rem;
  text-align: center; color: var(--muted); font-size: .85rem;
  border: 1px dashed var(--border2); border-radius: 10px;
}

.lb-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px }
.lb-table      { width: 100%; border-collapse: collapse; font-size: .9rem }
.lb-table th   {
  background: var(--surface2); color: var(--accent);
  padding: .75rem 1rem; text-align: left;
  font-size: .72rem; text-transform: uppercase; letter-spacing: .07em;
  border-bottom: 2px solid var(--border); white-space: nowrap;
}
.lb-table td            { padding: .85rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle }
.lb-table tr:last-child td { border-bottom: none }
.lb-table tr:hover td   { background: rgba(200,169,110,.04) }
.lb-table tr.me td      { background: rgba(200,169,110,.07) }

.rank-cell { font-size: 1.3rem; width: 50px; text-align: center }
.rank-1    { color: #FFD700 }
.rank-2    { color: #C0C0C0 }
.rank-3    { color: #CD7F32 }

.player-name { font-weight: 700 }
.player-you  {
  font-size: .7rem; background: rgba(200,169,110,.15); color: var(--accent);
  padding: .1rem .45rem; border-radius: 10px; margin-left: .5rem;
  border: 1px solid rgba(200,169,110,.3);
}

.cap-total { font-size: 1.1rem; font-weight: 700; color: var(--accent) }

.bar-wrap { position: relative; width: 120px; height: 22px; background: var(--surface3); border-radius: 11px; overflow: hidden }
.bar-fill { height: 100%; background: linear-gradient(90deg, #2a6b5a, #3d9b7a); border-radius: 11px; transition: width .6s ease; min-width: 2px }
.bar-pts { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: .68rem; font-weight: 700; color: #fff; letter-spacing: .03em }

.season-pills { display: flex; gap: .35rem; flex-wrap: wrap }
.spill        { font-size: .68rem; padding: .15rem .5rem; border-radius: 10px; white-space: nowrap }
.sp-spring    { background: rgba(39,174,96,.2);  color: #5dba7d }
.sp-summer    { background: rgba(241,196,15,.2); color: #d4a017 }
.sp-fall      { background: rgba(211,84,0,.2);   color: #e07040 }
.sp-winter    { background: rgba(52,152,219,.2); color: #5ba4d4 }
.sp-all       { background: rgba(155,89,182,.2); color: #b07dd4 }

.lb-loading { text-align: center; padding: 3rem; color: var(--muted) }

/* ── Points / Milestones section ─────────────────────────────────────────── */
.points-section { padding: 6rem 0; border-top: 1px solid var(--border) }
.section-inner  { max-width: 1100px; margin: 0 auto; padding: 0 2rem }

.section-label {
  font-size: .7rem; font-weight: 600; letter-spacing: .18em;
  text-transform: uppercase; color: var(--teal);
  margin-bottom: .9rem; display: flex; align-items: center; gap: .6rem;
}
.section-label::before { content: ''; display: block; width: 18px; height: 1px; background: var(--teal) }

h2         { font-family: 'Playfair Display', serif; font-size: clamp(1.8rem,3vw,2.5rem); font-weight: 700; color: var(--text); line-height: 1.15; margin-bottom: .75rem }
h2 em      { font-style: italic; color: var(--accent) }
.section-body { font-size: .95rem; line-height: 1.7; color: var(--text2); max-width: 580px; margin-bottom: 2.5rem }

.points-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: start }

.milestone-list { display: flex; flex-direction: column; gap: .75rem }
.milestone-item {
  display: flex; align-items: center; gap: 1rem;
  padding: .9rem 1.1rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  opacity: .7; transition: opacity .2s;
}
.milestone-item:hover { opacity: 1 }
.milestone-icon { font-size: 1.4rem; flex-shrink: 0 }
.milestone-info { flex: 1 }
.milestone-name { font-size: .85rem; font-weight: 600; color: var(--text) }
.milestone-desc { font-size: .75rem; color: var(--muted) }
.milestone-pts  { font-family: 'Playfair Display', serif; font-size: 1rem; font-weight: 700; color: var(--accent) }

.point-table       { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden }
.point-table-row   { display: flex; align-items: center; justify-content: space-between; padding: .9rem 1.3rem; border-bottom: 1px solid var(--border) }
.point-table-row:last-child { border-bottom: none }
.point-action      { font-size: .88rem; color: var(--text2) }
.point-val         { font-weight: 700; color: var(--accent); background: rgba(200,169,110,.1); border: 1px solid rgba(200,169,110,.2); padding: .2rem .65rem; border-radius: 20px; font-size: .82rem }

/* ── Footer ──────────────────────────────────────────────────────────────── */
footer        { border-top: 1px solid var(--border); padding: 2rem 1.5rem; text-align: center; color: var(--muted); font-size: .82rem; line-height: 1.8 }
footer strong { color: var(--text) }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .points-two-col { grid-template-columns: 1fr; gap: 2rem }
  .lb-table th:nth-child(n+5),
  .lb-table td:nth-child(n+5) { display: none }
  .bar-wrap { width: 80px; height: 20px }
  .bar-pts { font-size: .6rem }
}
@media (max-width: 640px) {
  .community-strip { gap: 1rem }
  .cs-num          { font-size: .9rem }
  .lb-wrap         { padding: 1.5rem 1rem }
}
@media (max-width: 520px) {
  .bar-wrap { width: 65px; height: 18px }
  .bar-pts { font-size: .55rem }
}
