/* Top Players page (js/leaderboard.js). Colours come from the active theme's CSS variables. */
.lb-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.lb-head h1 { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; }
.lb-head h1 svg { color: var(--green); }
.lb-head p { margin: 2px 0; font-size: 13px; }
.lb-pool { color: var(--green); font-size: 13px; font-weight: 600; }
.lb-pool:empty { display: none; }
.lb-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lb-tabs { display: inline-flex; gap: 2px; padding: 4px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.lb-tabs button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 13px; padding: 7px 14px; border-radius: 8px; cursor: pointer; }
.lb-tabs button:hover { color: var(--text); }
.lb-tabs button.on { background: var(--panel3); color: var(--text); }
.lb-ref { display: inline-flex; align-items: center; gap: 6px; }

/* podium: #2, #1, #3 with the winner raised; each card reserves its right side for the skin */
.lb-podium { display: grid; grid-template-columns: 1fr 1.08fr 1fr; gap: 14px; align-items: end; margin-bottom: 26px; }
.lb-card { position: relative; overflow: hidden; border-radius: 16px; background: linear-gradient(180deg, var(--panel2), var(--panel)); border: 1px solid var(--line);
  min-height: 170px; display: flex; --medal: var(--muted); }
.lb-card.place-1 { min-height: 206px; --medal: var(--gold); border-color: color-mix(in srgb, var(--gold) 55%, var(--line)); background: linear-gradient(180deg, color-mix(in srgb, var(--gold) 14%, var(--panel2)), var(--panel)); }
.lb-card.place-2 { --medal: #c3cbdc; }
.lb-card.place-3 { --medal: #d38b52; }
.lb-card.mine { box-shadow: 0 0 0 2px var(--accent) inset; }
.lb-card-main { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 16px 0 16px 16px; width: 58%; min-width: 0; }
.lb-rank { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 8px; background: rgba(0, 0, 0, .28); color: var(--medal); }
.lb-rank svg { width: 13px; height: 13px; }
.lb-name { font-size: 20px; line-height: 1.2; margin-top: 8px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-label { margin-top: 6px; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.lb-amt { font-size: 22px; font-weight: 700; }
.lb-prize { font-size: 12px; color: var(--green); font-weight: 600; }
.lb-card .lb-prize { margin-top: auto; padding-top: 8px; }
.lb-skin { position: absolute; right: 12px; bottom: 0; height: calc(100% - 22px); width: auto; max-width: 42%; object-fit: contain; object-position: bottom;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .45)); pointer-events: none; user-select: none; opacity: 0; transition: opacity .25s ease; }
.lb-skin.ready { opacity: 1; }
.lb-skin.fb { height: 76px; width: 76px; max-width: none; aspect-ratio: auto; right: 18px; bottom: 18px; border-radius: 14px; image-rendering: pixelated; filter: none; opacity: .9; }
.lb-crown { position: absolute; top: 12px; right: 12px; z-index: 1; color: var(--gold); display: grid; }
.lb-crown svg { width: 18px; height: 18px; }

.lb-sub { display: flex; justify-content: space-between; align-items: center; margin: 0 2px 10px; }
.lb-sub h2 { margin: 0; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); font-weight: 500; }
.lb-table { padding: 0; overflow: hidden; }
.lb-table .player { display: inline-flex; align-items: center; gap: 8px; }
.lb-table .player img { width: 22px; height: 22px; border-radius: 6px; image-rendering: pixelated; }
.lb-r { font-weight: 700; white-space: nowrap; }
.lb-r svg { width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px; }
.lb-r.r1 svg, .lb-r.r1 { color: var(--green); }
.lb-r.r2 svg, .lb-r.r3 svg { color: var(--green); }
.lb-table tr.mine td { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.lb-table tr.lb-gap td { text-align: center; color: var(--dim); padding: 2px; letter-spacing: .3em; }
.lb-empty { text-align: center; padding: 40px 16px; }

@media (max-width: 820px) {
  .lb-podium { grid-template-columns: 1fr; gap: 10px; }
  .lb-card.place-1 { order: 1; min-height: 170px; } .lb-card.place-2 { order: 2; } .lb-card.place-3 { order: 3; }
  .lb-card { min-height: 140px; }
  .lb-name { font-size: 18px; }
  .lb-head { flex-direction: column; }
}
@media (prefers-reduced-motion: no-preference) {
  .lb-card { transition: transform .2s ease; }
  .lb-card:hover { transform: translateY(-2px); }
}

.lb-table table.bets { min-width: 0; width: 100%; }
@media (max-width: 560px) {
  .lb-table th, .lb-table td { padding-left: 8px; padding-right: 8px; }
  .lb-r svg { display: none; }
  .lb-table .player img { display: none; }
  .lb-table td { font-size: 13px; }
}
