/* ─────────────────────────────────────────────
   HUNGRY CHAMELEONS — Leaderboard Sidebar
   ───────────────────────────────────────────── */

.leaderboard-sidebar {
  width: 280px; flex-shrink: 0;
  background: rgba(10, 12, 40, 0.9);
  border-right: 1px solid rgba(74,176,255,0.2);
  display: flex; flex-direction: column;
  overflow: hidden;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.35s ease;
  position: relative;
}
.leaderboard-sidebar.collapsed {
  width: 0; opacity: 0; pointer-events: none;
}

.lb-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(74,176,255,0.15);
  background: rgba(74,176,255,0.05);
  flex-shrink: 0;
}
.lb-title {
  font-family: 'Orbitron', monospace; font-size: 0.75rem;
  letter-spacing: 2px; color: var(--blue);
  text-shadow: 0 0 6px var(--blue);
}

#lb-collapse-btn, #lb-game-collapse-btn {
  color: var(--text-muted); font-size: 0.8rem;
  transition: color var(--transition), transform var(--transition);
}
#lb-collapse-btn:hover, #lb-game-collapse-btn:hover { color: var(--blue); }

.lb-show-btn {
  position: fixed; left: 0; top: 50%;
  transform: translateY(-50%);
  background: rgba(10,12,40,0.9);
  border: 1px solid rgba(74,176,255,0.3);
  border-left: none; border-radius: 0 8px 8px 0;
  padding: 0.75rem 0.5rem;
  font-family: 'Orbitron', monospace; font-size: 0.65rem;
  color: var(--blue); cursor: pointer; z-index: 200;
  writing-mode: vertical-rl; letter-spacing: 1px;
  transition: background var(--transition), box-shadow var(--transition);
}
.lb-show-btn:hover {
  background: rgba(74,176,255,0.1);
  box-shadow: 4px 0 15px rgba(74,176,255,0.3);
}
.lb-show-btn.hidden { display: none; }

.lb-section {
  flex: 1; overflow-y: auto; padding: 0.75rem;
  min-height: 0;
}
.lb-section + .lb-section {
  border-top: 1px solid rgba(74,176,255,0.1);
}

.lb-group-title {
  font-family: 'Orbitron', monospace; font-size: 0.65rem;
  letter-spacing: 2px; text-transform: uppercase;
  margin-bottom: 0.5rem; padding-bottom: 0.3rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.lb-list {
  list-style: none; display: flex; flex-direction: column; gap: 3px;
}

.lb-row {
  display: grid; grid-template-columns: 28px 1fr auto;
  align-items: center; gap: 0.4rem;
  padding: 0.4rem 0.5rem; border-radius: 6px;
  font-size: 0.8rem;
  transition: background 0.2s ease;
  position: relative; overflow: visible;
}
.lb-row.is-me {
  background: rgba(74,176,255,0.12);
  border: 1px solid rgba(74,176,255,0.3);
  box-shadow: 0 0 8px rgba(74,176,255,0.2);
}
.lb-row:not(.is-me):hover { background: rgba(255,255,255,0.04); }

.lb-rank {
  font-family: 'Orbitron', monospace; font-size: 0.7rem;
  color: var(--text-muted); text-align: center;
}
.lb-rank.gold   { color: #FFD700; text-shadow: 0 0 6px #FFD700; }
.lb-rank.silver { color: #C0C0C0; text-shadow: 0 0 6px #C0C0C0; }
.lb-rank.bronze { color: #CD7F32; text-shadow: 0 0 6px #CD7F32; }

.lb-name {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: 0.82rem;
}
.lb-name.is-me { color: var(--blue); font-weight: 600; }

.lb-meta {
  font-size: 0.7rem; color: var(--text-muted);
  text-align: right; white-space: nowrap;
}

/* Separator between top-9 and pinned user */
.lb-separator {
  height: 1px; background: rgba(255,255,255,0.1);
  margin: 4px 0; position: relative;
}
.lb-separator::after {
  content: '···'; position: absolute; left: 50%; top: -8px;
  transform: translateX(-50%);
  font-size: 10px; color: var(--text-muted);
}

/* Scrollbar */
.lb-section::-webkit-scrollbar { width: 4px; }
.lb-section::-webkit-scrollbar-track { background: transparent; }
.lb-section::-webkit-scrollbar-thumb { background: rgba(74,176,255,0.3); border-radius: 2px; }

/* ── Tablet: collapsible as overlay ── */
@media (max-width: 900px) {
  .leaderboard-sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 300;
    border-right: 1px solid rgba(74,176,255,0.3);
    box-shadow: 4px 0 20px rgba(0,0,0,0.5);
  }
  .leaderboard-sidebar.collapsed { width: 0; }
}
