/* --- BASE --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top, #1e293b, #020617);
  font-family: system-ui, sans-serif;
  color: #e5e7eb;
}

.card {
  position: relative;
  background: rgba(15, 23, 42, 0.95);
  padding: 24px 32px;
  border-radius: 18px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7);
  min-width: 320px;
  max-width: 520px;
  animation: cardIn 0.6s ease forwards;
  opacity: 0;
  transform: translateY(20px);
}

@keyframes cardIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- BOUTONS --- */

button,
.btn {
  cursor: pointer;
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 600;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  color: white;
  box-shadow: 0 0 14px rgba(129,140,248,0.7);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

button:hover,
.btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 0 24px rgba(168,85,247,0.9);
}

/* --- LIENS --- */

a {
  display: inline-block;
  margin-top: 18px;
  color: #93c5fd;
  text-decoration: none;
  font-size: 14px;
}

a:hover {
  text-decoration: underline;
  color: #bfdbfe;
}

/* --- MENU INDEX --- */

.menu-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.menu-list a {
  margin-top: 0;
  padding: 10px 16px;
  border-radius: 999px;
  background: radial-gradient(circle at top left, rgba(56,189,248,0.2), rgba(15,23,42,0.9));
  border: 1px solid rgba(148,163,184,0.4);
  text-decoration: none;
  color: #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* --- LEADERBOARD LATERAL --- */

.side-leaderboard {
  position: absolute;
  right: 550px;
  top: 50%;
  transform: translateY(-50%);
  width: 240px;
}

#leaderboard {
  padding: 15px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(129, 140, 248, 0.5);
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(129, 140, 248, 0.4);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease;
}

#leaderboard.show {
  opacity: 1;
  transform: translateY(0);
}

#leaderboard.hide {
  opacity: 0;
  transform: translateY(30px);
}

#leaderboard ol {
  list-style: none;
  padding: 0;
  margin: 0;
}

#leaderboard li {
  padding: 4px 0;
  font-size: 14px;
  opacity: 0;
  transform: translateX(-10px);
  animation: leaderboardItem 0.4s ease forwards;
}

#leaderboard li:nth-child(1) {
  color: #a855f7;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(168, 85, 247, 0.9);
  animation-delay: 0.1s;
}

@keyframes leaderboardItem {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* --- RESPONSIVE --- */

@media (max-width: 900px) {
  .side-leaderboard {
    position: static;
    transform: none;
    width: 100%;
    margin-top: 20px;
  }
}
/* ============================================================
   LEADERBOARD COMPLEXE — VERSION STABLE AVEC SCROLL
   ============================================================ */

#leaderboard {
  max-height: 340px;          /* Hauteur fixe */
  overflow-y: auto;           /* Scroll interne */
  overflow-x: hidden;
  padding-right: 6px;
  background: rgba(30,41,59,0.6);
  border: 1px solid rgba(148,163,184,0.3);
  border-radius: 12px;
}

/* Scrollbar stylée */
#leaderboard::-webkit-scrollbar {
  width: 6px;
}
#leaderboard::-webkit-scrollbar-track {
  background: rgba(15,23,42,0.4);
  border-radius: 10px;
}
#leaderboard::-webkit-scrollbar-thumb {
  background: rgba(129,140,248,0.7);
  border-radius: 10px;
}
#leaderboard::-webkit-scrollbar-thumb:hover {
  background: rgba(168,85,247,0.9);
}

/* Conteneur interne */
.lb-container {
  width: 100%;
  padding: 6px 0;
}

/* En-tête */
.lb-header {
  display: grid;
  grid-template-columns: 40px 80px 1fr;
  padding: 8px 10px;
  font-weight: 700;
  opacity: 0.9;
  background: rgba(15,23,42,0.5);
  border-radius: 8px;
  margin-bottom: 6px;
}

/* Ligne */
.lb-row {
  display: grid;
  grid-template-columns: 40px 80px 1fr;
  padding: 10px 10px;
  margin-bottom: 4px;
  border-radius: 6px;
  background: rgba(255,255,255,0.03);
  transition: background 0.2s ease;
  opacity: 0;
  transform: translateX(-10px);
  animation: lbRowIn 0.4s ease forwards;
}

.lb-row:hover {
  background: rgba(129,140,248,0.12);
}

/* Colonnes */
.lb-rank {
  font-weight: 600;
  color: #93c5fd;
}

.lb-score {
  font-weight: 700;
  color: #facc15;
}

.lb-info {
  font-size: 13px;
  line-height: 1.4;
  color: #cbd5e1;
}

.lb-info div {
  margin-bottom: 2px;
}

.lb-date {
  font-size: 12px;
  opacity: 0.6;
}

/* Animation */
@keyframes lbRowIn {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Responsive */
@media (max-width: 600px) {
  .lb-header,
  .lb-row {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .lb-rank,
  .lb-score {
    display: inline-block;
    margin-right: 12px;
  }
}
