/* ═══════════════════════════════════════════════════════════
   HEXLAND — Leaderboard  (matches lobby dark theme)
   ═══════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Theme variables (matches lobby.css Dark/Light scheme) ───── */
:root {
  --ink-rgb: 255,255,255;
  --inset-rgb: 0,0,0;
  --page-grad-1: rgba(77,196,245,.18);
  --page-grad-2: rgba(120,80,220,.18);
  --page-base: #12101e;
  --body-bg: #1a1228;
  --panel-bg: #1c1630;
  --card-bg: rgba(20,16,34,.72);
  --text-cream: #f5e8c0;
  --text-strong-2: #e8eefc;
  --text-table: #e8dcc0;
  --text-link: #4dc4f5;
  --text-link-2: #7fd4ff;
  --ok-green: #5fd17a;
  --err-red: #ff8080;
}

:root[data-theme="light"] {
  --ink-rgb: 32,36,50;
  --inset-rgb: 255,255,255;
  --page-grad-1: rgba(77,196,245,.12);
  --page-grad-2: rgba(120,80,220,.10);
  --page-base: #e8ecf4;
  --body-bg: #dde2ec;
  --panel-bg: #fbf9f5;
  --card-bg: rgba(255,255,255,.75);
  --text-cream: #5c4424;
  --text-strong-2: #20243a;
  --text-table: #3a3024;
  --text-link: #1f6fa8;
  --text-link-2: #1f6fa8;
  --ok-green: #1f7a45;
  --err-red: #c23b3b;
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh;
  background: var(--body-bg);
}

/* ── Background ──────────────────────────────────────────── */
.lobby-bg {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 84px 16px 40px;
  background:
    radial-gradient(ellipse at 30% 20%, var(--page-grad-1) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 80%, var(--page-grad-2) 0%, transparent 55%),
    var(--page-base);
}

/* ── Auth bar — lives inside .site-header; keep only content styles ── */
.auth-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}
.auth-bar-name {
  color: #e8eefc;
  font-size: .9rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
:root[data-theme="light"] .auth-bar-name { color: #20243a; }
.auth-bar-link { color: var(--text-link); font-size: .82rem; text-decoration: none; }
.auth-bar-link:hover { text-decoration: underline; }
.auth-bar-btn {
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid rgba(var(--ink-rgb),.2);
  background: rgba(var(--ink-rgb),.08);
  color: rgba(var(--ink-rgb),.8);
  font-size: .8rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background .2s;
}
.auth-bar-btn:hover { background: rgba(var(--ink-rgb),.15); }

/* ── Page column ─────────────────────────────────────────── */
.lb-wrap {
  width: 100%;
  max-width: 660px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Header ──────────────────────────────────────────────── */
.lb-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.lb-logo {
  height: 130px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 12px rgba(255,200,80,.5));
}
.lb-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-cream);
  letter-spacing: 2px;
  text-shadow: 0 2px 12px rgba(0,0,0,.6);
}
.lb-back-btn {
  font-size: .82rem;
  color: rgba(var(--ink-rgb),.45);
  text-decoration: none;
  transition: color .2s;
}
.lb-back-btn:hover { color: #f0a030; }

/* ── Sort tabs ───────────────────────────────────────────── */
.lb-tabs {
  display: flex;
  gap: 8px;
  background: rgba(var(--ink-rgb),.05);
  border: 1px solid rgba(var(--ink-rgb),.1);
  border-radius: 12px;
  padding: 6px;
}
.lb-tab {
  flex: 1;
  padding: 9px 8px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: rgba(var(--ink-rgb),.5);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.lb-tab:hover { color: rgba(var(--ink-rgb),.8); }
.lb-tab.active {
  background: rgba(240,160,48,.2);
  color: #f0c060;
  border: 1px solid rgba(240,160,48,.3);
}

/* ── Time-period filter ──────────────────────────────────── */
.lb-periods {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: -8px;
}
.lb-period {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid rgba(var(--ink-rgb),.12);
  background: rgba(var(--ink-rgb),.04);
  color: rgba(var(--ink-rgb),.5);
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.lb-period:hover { color: rgba(var(--ink-rgb),.85); }
.lb-period.active {
  background: rgba(77,196,245,.15);
  border-color: rgba(77,196,245,.4);
  color: var(--text-link-2);
}

/* ── Name search ─────────────────────────────────────────── */
.lb-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.lb-search-icon {
  position: absolute;
  left: 14px;
  font-size: .9rem;
  opacity: .5;
  pointer-events: none;
}
.lb-search {
  width: 100%;
  padding: 10px 38px 10px 38px;
  border-radius: 10px;
  border: 1px solid rgba(var(--ink-rgb),.12);
  background: rgba(var(--ink-rgb),.05);
  color: var(--text-cream);
  font-size: .9rem;
  font-family: inherit;
  outline: none;
  transition: border-color .2s, background .2s;
}
.lb-search::placeholder { color: rgba(var(--ink-rgb),.35); }
.lb-search:focus { border-color: rgba(240,160,48,.45); background: rgba(var(--ink-rgb),.08); }
.lb-search-clear {
  position: absolute;
  right: 10px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(var(--ink-rgb),.1);
  color: rgba(var(--ink-rgb),.6);
  font-size: .75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}
.lb-search-clear:hover { background: rgba(var(--ink-rgb),.2); color: #fff; }

/* ── Win-rate note ───────────────────────────────────────── */
.lb-rate-note {
  text-align: center;
  font-size: .78rem;
  color: rgba(var(--ink-rgb),.38);
  letter-spacing: .5px;
  margin-top: -6px;
}

/* ── Podium ──────────────────────────────────────────────── */
.lb-podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;
}

.pod-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border-radius: 14px;
  border: 1px solid rgba(var(--ink-rgb),.12);
  background: rgba(var(--ink-rgb),.05);
  backdrop-filter: blur(8px);
  padding: 16px 14px 18px;
  width: 190px;
  cursor: pointer;
  transition: filter .2s;
}
.pod-card:hover { filter: brightness(1.12); }

/* 1st — gold, tallest, center */
.pod-1 {
  order: 2;
  padding-top: 28px;
  background: rgba(240,160,48,.12);
  border-color: rgba(240,160,48,.35);
  box-shadow: 0 4px 24px rgba(240,160,48,.15);
}
/* 2nd — silver, left */
.pod-2 {
  order: 1;
  background: rgba(180,190,210,.08);
  border-color: rgba(180,190,210,.25);
  width: 168px;
}
/* 3rd — bronze, right */
.pod-3 {
  order: 3;
  background: rgba(180,100,40,.08);
  border-color: rgba(180,100,40,.25);
  width: 168px;
}

.pod-self {
  outline: 2px solid #f0a030;
  outline-offset: 2px;
}

.pod-medal { font-size: 2rem; line-height: 1; }
.pod-name {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text-cream);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
}
.pod-name:hover { color: #f0c060; text-decoration: underline; }
.pod-stat {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-cream);
}
.pod-stat-label {
  font-size: .72rem;
  font-weight: 500;
  color: rgba(var(--ink-rgb),.45);
}

/* ── Card wrapper ────────────────────────────────────────── */
.lb-card {
  background: rgba(var(--ink-rgb),.05);
  border: 1px solid rgba(var(--ink-rgb),.1);
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 28px rgba(0,0,0,.3);
}

.lb-table-wrap { overflow-x: auto; }

/* ── State messages ──────────────────────────────────────── */
.lb-state {
  padding: 24px;
  text-align: center;
  color: rgba(var(--ink-rgb),.4);
  font-size: .9rem;
}
.lb-error { color: var(--err-red); }

/* ── Table ───────────────────────────────────────────────── */
.lb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
.lb-table thead tr {
  background: rgba(var(--ink-rgb),.06);
  border-bottom: 1px solid rgba(var(--ink-rgb),.1);
}
.lb-table th {
  padding: 10px 14px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: rgba(var(--ink-rgb),.4);
  text-align: left;
}
.lb-table th.lbt-stat,
.lb-table th.lbt-sub { text-align: right; }

.lb-tr { border-bottom: 1px solid rgba(var(--ink-rgb),.06); transition: background .15s; }
.lb-tr:last-child { border-bottom: none; }
.lb-tr:hover { background: rgba(var(--ink-rgb),.04); }

.lb-tr-self {
  background: rgba(240,160,48,.1);
  border-left: 3px solid rgba(240,160,48,.5);
}
.lb-tr-self:hover { background: rgba(240,160,48,.14); }

.lb-table td {
  padding: 11px 14px;
  color: var(--text-table);
  vertical-align: middle;
}
.lbt-rank {
  color: rgba(var(--ink-rgb),.3);
  font-size: .82rem;
  font-weight: 700;
  width: 36px;
}
.lbt-name { max-width: 200px; }
.lbt-stat, .lbt-sub { text-align: right; }
.lbt-stat { font-weight: 700; color: var(--text-cream); }
.lbt-sub { color: rgba(var(--ink-rgb),.4); font-size: .82rem; }

/* ── Name link button ────────────────────────────────────── */
.lb-link {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--text-link);
  font-size: inherit;
  font-family: inherit;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
}
.lb-link:hover { text-decoration: underline; color: var(--text-link-2); }

/* ── Self section ────────────────────────────────────────── */
.lb-self-section { display: flex; flex-direction: column; gap: 8px; }
.lb-divider {
  text-align: center;
  font-size: .75rem;
  color: rgba(var(--ink-rgb),.3);
  letter-spacing: 1px;
}
.lb-self-card { padding: 14px 18px; }
.self-row {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.self-label { font-weight: 700; color: var(--text-cream); font-size: .95rem; flex: 1; min-width: 80px; }
.self-stat { color: rgba(var(--ink-rgb),.55); font-size: .85rem; }
.self-link { font-size: .82rem; margin-left: auto; }

/* ── Profile backdrop ────────────────────────────────────── */
.profile-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
.profile-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* ── Profile panel ───────────────────────────────────────── */
.profile-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 340px;
  background: var(--panel-bg);
  border-left: 1px solid rgba(var(--ink-rgb),.1);
  box-shadow: -8px 0 32px rgba(0,0,0,.5);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .3s ease;
  overflow-y: auto;
}
.profile-panel.open { transform: translateX(0); }

.profile-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: rgba(var(--ink-rgb),.08);
  border: 1px solid rgba(var(--ink-rgb),.15);
  border-radius: 6px;
  color: rgba(var(--ink-rgb),.6);
  font-size: .9rem;
  width: 28px;
  height: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}
.profile-close:hover { background: rgba(var(--ink-rgb),.15); color: #fff; }

.profile-content { padding: 20px 20px 32px; }

/* ── Profile content ─────────────────────────────────────── */
.prof-hd {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 28px 0 20px;
  border-bottom: 1px solid rgba(var(--ink-rgb),.08);
  margin-bottom: 16px;
}
/* Inline avatar chips (table rows + podium) — tinted by the player's colour,
   or a profile picture when one is set (background-image, cover-cropped) */
.lb-avatar, .pod-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  flex-shrink: 0;
  text-shadow: 0 1px 3px rgba(0,0,0,.4);
  background-size: cover;
  background-position: center;
}
.lb-avatar {
  width: 24px;
  height: 24px;
  font-size: .8rem;
}
.lbt-name-inner { display: inline-flex; align-items: center; gap: 8px; vertical-align: middle; }
.pod-avatar {
  width: 40px;
  height: 40px;
  font-size: 1.1rem;
  margin: 2px auto 4px;
}

.prof-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f0a030, #c06020);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,.4);
}
.prof-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-cream);
}
/* Base direction from content (dir="auto" equivalent) so Persian+emoji usernames
   render the emoji on the correct logical side. */
.pod-name, .lb-link, .prof-name { unicode-bidi: plaintext; }
.prof-joined {
  font-size: .75rem;
  color: rgba(var(--ink-rgb),.35);
}

.prof-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.prof-stat {
  flex: 1 1 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: rgba(var(--ink-rgb),.05);
  border: 1px solid rgba(var(--ink-rgb),.08);
  border-radius: 10px;
  padding: 10px 6px;
}
.pstat-num {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-cream);
}
.pstat-lbl {
  font-size: .7rem;
  color: rgba(var(--ink-rgb),.4);
  text-transform: uppercase;
  letter-spacing: .6px;
}

/* ── Profile streak ──────────────────────────────────────── */
.prof-streak {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}
.prof-streak-item {
  flex: 1;
  text-align: center;
  font-size: .78rem;
  color: rgba(var(--ink-rgb),.55);
  background: rgba(255,140,40,.08);
  border: 1px solid rgba(255,140,40,.18);
  border-radius: 8px;
  padding: 8px 6px;
}
.prof-streak-item b { color: #f5b86a; font-size: .95rem; }

/* ── Profile badges ──────────────────────────────────────── */
.prof-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}
.prof-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-cream);
  background: rgba(240,160,48,.12);
  border: 1px solid rgba(240,160,48,.28);
  border-radius: 16px;
  padding: 5px 11px 5px 8px;
  cursor: default;
}
.prof-badge-ic { font-size: .95rem; line-height: 1; }

.prof-section-hd {
  font-size: .72rem;
  font-weight: 700;
  color: rgba(var(--ink-rgb),.35);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.prof-games { display: flex; flex-direction: column; gap: 6px; }
.prof-game {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(var(--ink-rgb),.04);
  border: 1px solid rgba(var(--ink-rgb),.07);
}
.prof-game-win  { border-color: rgba(80,180,100,.25); background: rgba(80,180,100,.06); }
.prof-game-loss { border-color: rgba(200,80,80,.2);   background: rgba(200,80,80,.04); }

.prof-game-result {
  font-size: .8rem;
  font-weight: 700;
  min-width: 52px;
}
.prof-game-win  .prof-game-result { color: var(--ok-green); }
.prof-game-loss .prof-game-result { color: var(--err-red); }

.prof-game-meta {
  font-size: .78rem;
  color: rgba(var(--ink-rgb),.38);
  flex: 1;
}
.prof-game-players {
  font-size: .75rem;
  color: rgba(var(--ink-rgb),.3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}

/* ── Auth bar avatar ─────────────────────────────────────── */
.auth-bar-av {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 39.2px;
  height: 39.2px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  font-size: .91rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  background-size: cover;
  background-position: center;
}
.auth-bar-av--img   { border: 1px solid rgba(var(--ink-rgb), .35); }
.auth-bar-av--color { border: 1px solid rgba(var(--ink-rgb), .25); }

/* ── Go Pro header CTA ───────────────────────────────────── */
.btn-go-pro {
  background: linear-gradient(135deg, #b8860b 0%, #daa520 60%, #f5c842 100%);
  color: #1a1000;
  border: none;
  border-radius: 999px;
  padding: 5px 14px;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: .03em;
  box-shadow: 0 2px 8px rgba(218,165,32,.45);
  transition: transform .15s, box-shadow .15s;
  flex-shrink: 0;
}
.btn-go-pro:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(218,165,32,.6); }

/* ── Pro upgrade modal ───────────────────────────────────── */
.pu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.pu-backdrop:not([hidden]) { display: flex; }
.pu-modal {
  background: var(--panel-bg);
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  overflow: hidden;
}
.pu-head {
  display: flex;
  align-items: center;
  padding: 16px 20px 12px;
  border-bottom: 1px solid rgba(var(--ink-rgb),.08);
}
.pu-title { font-size: 1.05rem; font-weight: 800; color: #daa520; flex: 1; }
.pu-close { background: none; border: none; color: inherit; opacity: .55; font-size: 1rem; cursor: pointer; padding: 2px 6px; }
.pu-close:hover { opacity: 1; }
.pu-body { padding: 18px 20px 22px; }
.pu-tagline { font-size: .9rem; font-weight: 600; margin: 0 0 14px; opacity: .9; }
.pu-features { list-style: none; padding: 0; margin: 0 0 18px; }
.pu-features li { font-size: .83rem; padding: 5px 0; display: flex; gap: 8px; align-items: flex-start; opacity: .88; }
.pu-check { color: #daa520; font-weight: 800; flex-shrink: 0; margin-top: 1px; }
.pu-plans { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.pu-plan { border: 1px solid rgba(var(--ink-rgb),.14); border-radius: 10px; padding: 12px 10px; text-align: center; position: relative; }
.pu-plan-featured { border-color: #daa520; background: rgba(218,165,32,.07); }
.pu-plan-badge { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); background: #daa520; color: #1a1000; font-size: .62rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.pu-plan-name { font-size: .82rem; font-weight: 700; margin-bottom: 4px; }
.pu-plan-price { font-size: .75rem; opacity: .6; }
.pu-note { font-size: .77rem; opacity: .6; text-align: center; margin: 0 0 14px; }
.pu-contact-btn { display: block; text-align: center; background: linear-gradient(135deg, #b8860b, #daa520); color: #1a1000 !important; font-weight: 800; font-size: .85rem; padding: 10px 16px; border-radius: 10px; text-decoration: none; transition: opacity .15s; }
.pu-contact-btn:hover { opacity: .88; }
[data-theme="light"] .pu-modal { background: #fff; }
[data-theme="light"] .pu-plan { border-color: rgba(0,0,0,.12); }
[data-theme="light"] .pu-plan-featured { background: rgba(184,134,11,.06); }

/* ── Hamburger button ────────────────────────────────────── */
.ham-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  padding: 7px 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  border-radius: 8px;
  transition: background .15s;
  color: inherit;
}
.ham-btn:hover { background: rgba(var(--ink-rgb), .1); }

.ham-line {
  display: block;
  width: 20px;
  height: 2px;
  background: rgba(var(--ink-rgb), .75);
  border-radius: 2px;
}

/* ── Hamburger menu dropdown ──────────────────────────────── */
.ham-menu {
  position: fixed;
  top: 74px;
  right: 10px;
  z-index: 200;
  background: var(--panel-bg);
  border: 1px solid rgba(var(--ink-rgb), .14);
  border-radius: 14px;
  padding: 6px 0;
  min-width: 200px;
  box-shadow: 0 8px 30px rgba(0,0,0,.45);
  backdrop-filter: blur(14px);
  animation: ham-pop .14s ease-out;
}
.ham-menu[hidden] { display: none; }

@keyframes ham-pop {
  from { opacity: 0; transform: translateY(-8px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

.ham-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 11px 18px;
  background: none;
  border: none;
  color: rgba(var(--ink-rgb), .85);
  font: 600 .92rem/1.3 'Segoe UI', system-ui, sans-serif;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  transition: background .12s;
}
.ham-item:hover { background: rgba(var(--ink-rgb), .08); }

.ham-item-signout {
  color: rgba(var(--ink-rgb), .5);
  border-top: 1px solid rgba(var(--ink-rgb), .08);
  margin-top: 4px;
}

/* ════════════════════════════════════════════════════════════
   Mobile  ≤ 540px
   ════════════════════════════════════════════════════════════ */
@media (max-width: 540px) {
  .lobby-bg { padding: 96px 10px 32px; }
  .ham-menu { top: 88px; }

  .auth-bar      { gap: 6px; }
  .auth-bar-name { font-size: .82rem; }
  .auth-bar-link  { font-size: .75rem; }
  .auth-bar-btn   { font-size: .73rem; padding: 4px 9px; }
  .auth-bar-av   { width: 34px; height: 34px; font-size: .86rem; }
  .btn-go-pro    { font-size: .72rem; padding: 4px 10px; }

  .lb-logo { height: 90px; }
  .lb-title { font-size: 1.3rem; }

  .lb-tabs { flex-direction: column; gap: 4px; }
  .lb-tab  { font-size: .82rem; }

  .lb-periods { flex-wrap: wrap; margin-top: 0; }
  .lb-period  { flex: 1; font-size: .75rem; padding: 6px 8px; }
  .lb-search  { font-size: .85rem; }

  /* Podium: stack vertically in rank order on mobile */
  .lb-podium { flex-direction: column; align-items: stretch; gap: 8px; }
  .pod-card  { order: unset !important; width: 100%; flex-direction: row; padding: 12px 16px; }
  .pod-1     { padding-top: 12px; }
  .pod-medal { font-size: 1.5rem; }
  .pod-name  { text-align: left; font-size: .9rem; }
  .pod-stat  { margin-left: auto; font-size: .95rem; }

  .lb-table th, .lb-table td { padding: 9px 10px; }
  .lbt-sub { display: none; }

  .profile-panel { width: 100vw; }

  .self-row { gap: 10px; }
  .self-stat { font-size: .8rem; }
}

/* Link from the leaderboard profile panel to the full profile page. */
.prof-fulllink {
  display: inline-block;
  margin-top: 8px;
  font-size: .82rem;
  color: var(--text-link);
  text-decoration: none;
}
.prof-fulllink:hover { text-decoration: underline; }

/* Pro badge on leaderboard entries */
.lb-pro-badge {
  display: inline-block;
  background: linear-gradient(135deg, #b8860b, #daa520);
  color: #1a1000;
  font-size: .58rem;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 4px;
  vertical-align: middle;
  margin-left: 4px;
  line-height: 1.6;
}
