/* Leaderboard page; builds on lobby.css */

/* ---------- Top navigation (shared with the lobby) ---------- */
.lb-nav { display: flex; align-items: center; gap: 4px; margin: 0 auto 0 24px; }
.lb-nav a {
  height: 44px; padding: 0 16px; display: inline-flex; align-items: center; gap: 8px;
  border-radius: 999px; color: #E4EFE8; font-size: 15px; font-weight: 600; text-decoration: none;
}
.lb-nav a:hover { background: rgba(255,255,255,0.08); }
.lb-nav a[aria-current="page"] { background: rgba(0,0,0,0.25); color: #fff; }

/* ---------- Podium ---------- */
.pd { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: end; }
.pd-card {
  box-sizing: border-box; padding: 22px 20px 20px; border-radius: 18px; background: #F8F3E6;
  box-shadow: 0 12px 30px rgba(0,0,0,0.28); display: flex; flex-direction: column;
  align-items: center; gap: 10px; text-align: center;
}
.pd-card.first { padding: 32px 20px 28px; }
.pd-medal {
  width: 52px; height: 54px; border-radius: 9px; color: #24190C; display: inline-flex;
  align-items: center; justify-content: center; font: 700 26px "Space Grotesk", Inter, sans-serif;
  box-shadow: inset 0 -5px 0 rgba(0,0,0,0.18), 0 3px 6px rgba(0,0,0,0.2);
}
.pd-name { font-weight: 700; font-size: 18px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-wins { font: 700 34px/1 "Space Grotesk", Inter, sans-serif; }
.pd-wins small { font: 600 14px Inter, sans-serif; color: #5B5F59; }
.pd-meta { font-size: 13px; color: #4C504A; }

/* ---------- Table and side cards ---------- */
.lbd-cols { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.lbd-card, .lbd-table { background: #F8F3E6; border-radius: 18px; box-shadow: 0 12px 30px rgba(0,0,0,0.25); color: #1B1F1C; }
.lbd-table { flex: 999 1 560px; min-width: 0; overflow: hidden; }
.lbd-card h2, .lbd-table h2, .lbd-robot h2 { margin: 0; font: 700 18px "Space Grotesk", Inter, sans-serif; }
.lbd-table h2 { padding: 18px 20px 6px; }
.lbd-scroll { overflow-x: auto; }
.lbd-table table { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 14px; }
.lbd-table th { padding: 12px 8px; text-align: left; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #4C504A; }
.lbd-table th:first-child, .lbd-table td:first-child { padding-left: 20px; }
.lbd-table th:last-child, .lbd-table td:last-child { padding-right: 20px; }
.lbd-table td { padding: 12px 8px; border-top: 1px solid #E6DECB; }
.lbd-table .r { text-align: right; }
.lbd-table .b { font-weight: 700; }
.lbd-table .nw { white-space: nowrap; }
.lbd-table tr.me td, .lbd-list li.me { background: #FDEBC8; }
.rk { font: 700 16px "Space Grotesk", Inter, sans-serif; white-space: nowrap; }
.mv { font: 700 12px Inter, sans-serif; }
.mv.up { color: #1E6B4F; } .mv.down { color: #A3321F; }
.lbd-who { display: inline-flex; align-items: center; gap: 10px; }
.lbd-who b { font-weight: 600; }
.lbd-av {
  width: 32px; height: 32px; flex: none; border-radius: 50%; color: #fff; display: inline-flex;
  align-items: center; justify-content: center; font-size: 13px; font-weight: 700;
}
.bar { display: inline-block; width: 56px; height: 6px; margin-right: 8px; vertical-align: middle; border-radius: 999px; background: #E6DECB; overflow: hidden; }
.bar span { display: block; height: 100%; background: #1E6B4F; }
.word { font-family: "Space Grotesk", Inter, sans-serif; letter-spacing: 0.04em; }
.pts { color: #5B5F59; }

.lbd-side { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.lbd-side .lbd-card { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.rec { display: flex; flex-direction: column; gap: 4px; padding-top: 12px; border-top: 1px solid #E6DECB; }
.rec:first-child { padding-top: 0; border-top: 0; }
.rec-t { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #4C504A; }
.rec-w { font-size: 13px; color: #5B5F59; margin: 0; }
.big { font-size: 20px; } .big2 { font-size: 18px; }
.lbd-robot { padding: 20px; border-radius: 18px; background: rgba(0,0,0,0.25); display: flex; flex-direction: column; gap: 10px; color: #fff; }
.lbd-robot h2 { font-size: 16px; }
.lbd-robot .big { font: 700 30px "Space Grotesk", Inter, sans-serif; }
.lbd-robot .small { font-size: 13px; color: #CFE3D6; }

.lbd-list { display: none; margin: 0; padding: 0; list-style: none; }
.me-bar { display: none; }

/* ---------- Mobile ---------- */
@media screen and (max-width: 720px) {
  .lb-header { height: auto; min-height: 64px; flex-wrap: wrap; row-gap: 0; padding-bottom: 0; }
  .lb-nav {
    order: 3; flex: 1 0 100%; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    border-bottom: 1px solid rgba(255,255,255,0.15);
  }
  .lb-nav a { height: 44px; justify-content: center; border-radius: 0; color: #CFE3D6; }
  .lb-nav a[aria-current="page"] { background: none; color: #fff; font-weight: 700; box-shadow: inset 0 -3px 0 #F2A23A; }
  .lb-nav svg { width: 16px; height: 16px; }

  .lb-chip { background: none; padding: 0 5px; }
  .lb-chip #meName { display: none; }
  .lb-main { padding: 16px 16px 110px; gap: 16px; }
  .lb-title-row { display: block; }
  .lb-title h1 { font-size: 30px; }
  .lb-title p { display: none; }
  .lb-title-row .lb-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; margin-top: 16px; }
  .lb-tabs button { padding: 0; font-size: 13px; }

  .pd { gap: 8px; }
  .pd-card, .pd-card.first { padding: 12px 6px; border-radius: 14px; gap: 6px; }
  .pd-card.first { padding: 20px 6px 18px; }
  .pd-medal { width: 36px; height: 38px; font-size: 18px; border-radius: 7px; }
  .pd-name { font-size: 13px; }
  .pd-wins { font-size: 22px; } .pd-wins small { display: none; }
  .pd-meta { font-size: 11px; }

  .lbd-table h2, .lbd-scroll { display: none; }
  .lbd-table { flex-basis: 100%; }
  .lbd-list { display: block; }
  .lbd-list li { display: grid; grid-template-columns: 28px 32px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid #E6DECB; }
  .lbd-list li:first-child { border-top: 0; }
  .lbd-list .info, .lbd-list .right { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
  .lbd-list .right { align-items: flex-end; }
  .lbd-list .info b { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .lbd-list small { font-size: 12px; color: #5B5F59; }

  .lbd-side .lbd-card { display: none; }
  .lbd-robot { padding: 14px 16px; flex-direction: row; align-items: center; justify-content: space-between; }
  .lbd-robot .small { display: none; }
  .lbd-robot .big { font-size: 22px; }

  .me-bar {
    position: fixed; left: 8px; right: 8px; bottom: 12px; z-index: 50; box-sizing: border-box;
    padding: 12px 14px; border-radius: 16px; background: #F2A23A; color: #2A1A05;
    display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 10px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.25);
  }
  .me-bar[hidden] { display: none; }
  .me-bar .rk { font-size: 18px; }
  .me-bar .who { display: flex; flex-direction: column; gap: 1px; }
  .me-bar small { font-size: 12px; }
}
