/* ==== Leaderboard Modal Overlay ==== */
#leaderboardModal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: rgba(5, 3, 15, 0.82);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}

/* ==== Leaderboard Container ==== */
.leaderboard-container {
  background: linear-gradient(180deg, rgba(28, 16, 56, 0.98), rgba(14, 8, 30, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  box-shadow: 0 8px 36px rgba(0, 0, 0, 0.5), 0 0 40px rgba(255, 45, 149, 0.18);
  max-width: 780px;
  margin: 32px auto;
  padding: 26px 28px 22px 28px;
  text-align: center;
  position: relative;
  animation: fadeInScale 0.26s cubic-bezier(.22,1,.36,1);
  max-height: 92vh;
  overflow: hidden;
}

@keyframes fadeInScale {
  0% { opacity: 0; transform: scale(0.97);}
  100% { opacity: 1; transform: scale(1);}
}

.leaderboard-container h2 {
  margin: 0 0 8px 0;
  font-size: 2rem;
  font-weight: 800;
  font-family: 'Rajdhani', 'Inter', Arial, sans-serif;
  color: #e8c98a;
  letter-spacing: -1px;
}

.leaderboard-container .subtitle {
  font-size: 1rem;
  color: #b7b0d9;
  margin-bottom: 18px;
}

/* ==== Leaderboard Table ==== */
#leaderboardTable {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 4px;
  background: transparent;
  margin-bottom: 14px;
}

#leaderboardTable th,
#leaderboardTable td {
  padding: 8px 10px;
  text-align: center;
  background: rgba(255, 255, 255, 0.04);
  font-size: 15px;
  border-radius: 8px;
  font-family: 'Inter', Arial, sans-serif;
  color: #ece7fb;
  white-space: nowrap;
}

#leaderboardTable th {
  background: rgba(255, 255, 255, 0.08);
  font-size: 15px;
  font-weight: 700;
  color: #e8c98a;
  letter-spacing: .01em;
  white-space: nowrap;
}

#leaderboardTable tr {
  border-radius: 8px;
  margin-bottom: 4px;
}

#leaderboardTable tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02);
}

/* ==== Close Button ==== */
.close-btn {
  display: inline-block;
  background: rgba(0, 74, 85, 0.9);
  color: #fff;
  border: 1px solid rgba(34, 211, 238, 0.35);
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  padding: 9px 26px;
  margin: 14px auto 0 auto;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.close-btn:hover,
.close-btn:focus {
  background: linear-gradient(135deg, #e8c98a, #C5A059);
  color: #241407;
  outline: none;
  box-shadow: 0 0 24px rgba(197, 160, 89, 0.4);
}


#leaderboardPagination {
  text-align: center;
  margin: 14px 0 8px 0;
}

#leaderboardPagination button {
  display: inline-block;
  position: relative;
  margin: 0 8px;
  padding: 7px 20px;
  border: 1px solid rgba(34, 211, 238, 0.25);
  border-radius: 14px;
  background: rgba(0, 74, 85, 0.85);
  color: #fff;
  font-size: 1rem;
  font-family: 'Inter', Arial, sans-serif;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition:
    background 0.2s,
    box-shadow 0.2s,
    color 0.18s,
    transform 0.12s;
  outline: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

#leaderboardPagination button:after {
  content: '';
  position: absolute;
  left: 0; top: 0; right: 0; bottom: 0;
  border-radius: 20px;
  box-shadow: 0 0 22px 4px rgba(197, 160, 89, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s;
}

#leaderboardPagination button:hover,
#leaderboardPagination button:focus {
  background: rgba(1, 54, 64, 0.95);
  color: #e8c98a;
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 4px 20px rgba(1, 54, 64, 0.4);
}

#leaderboardPagination button:hover:after,
#leaderboardPagination button:focus:after {
  opacity: 1;
}


#leaderboardPagination span {
  display: inline-block;
  vertical-align: middle;
  font-size: 1rem;
  color: #b7b0d9;
  padding: 0 10px;
  font-weight: 500;
}

@media (max-width: 600px) {
  .leaderboard-container {
    max-width: 98vw;
    padding: 18px 4vw 16px 4vw;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    max-height: calc(100dvh - 24px);
  }
  #leaderboardTable th,
  #leaderboardTable td {
    font-size: 13px;
    padding: 6px 2px;
  }
  .close-btn {
    font-size: 1rem;
    padding: 8px 22px;
  }
}
