@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;500;700;900&display=swap');

:root {
  --neon: #00fff2;
  --pink: #ff3ea9;
  --bg: #09082a;
  --panel: #18153a;

  --normal: #00fff2;
  --hard: #ff3ea9;
  --reverse: #8f61ff;
  --timerush: #ff9d00;
  --hardcore: #ff2727;
  --custom: #7bff00;

  --card-bg: rgba(5, 8, 28, 0.87);
}

* {
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 10% 0%, rgba(255,62,169,0.14), transparent 55%),
    radial-gradient(circle at 90% 100%, rgba(0,255,242,0.14), transparent 50%),
    linear-gradient(180deg, #09082a, #050414);
  color: #eaf7ff;
  overflow-x: hidden;
  padding-bottom: 40px;
}

/* HEADER */
.lb-header {
  text-align: center;
  padding: 24px 12px 10px;
  color: var(--neon);
  margin-bottom: 8px;
}

.neon-title {
  font-size: 2.4rem;
  font-weight: 900;
  letter-spacing: 2px;
  text-shadow: 0 0 16px var(--neon), 0 0 28px var(--neon);
  margin: 0 0 14px 0;
}

.neon-title span {
  color: var(--pink);
  text-shadow: 0 0 14px var(--pink), 0 0 24px var(--pink);
}

.header-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.back-btn {
  padding: 8px 20px;
  border-radius: 999px;
  border: 1px solid var(--neon);
  background: rgba(0,0,0,0.5);
  color: var(--neon);
  cursor: pointer;
  box-shadow: 0 0 12px rgba(0,255,242,0.5);
  transition: 0.2s;
}

.back-btn:hover {
  background: var(--neon);
  color: #050515;
  transform: translateY(-2px);
  box-shadow: 0 0 24px var(--neon);
}

.search-input {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(0,255,242,0.6);
  background: rgba(0,0,0,0.5);
  color: #eaf7ff;
  min-width: 220px;
  max-width: 320px;
  outline: none;
  box-shadow: 0 0 16px rgba(0,255,242,0.25);
}

/* MAIN CONTAINER */
.lb-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 18px 32px;
  position: relative;
}

/* BACK GRID */
.lb-container::before {
  content: "";
  position: absolute;
  inset: 50px 10px 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: 0.22;
  pointer-events: none;
  z-index: 0;
}

/* YOUR CARD */
.your-card {
  background: rgba(0,0,0,0.45);
  padding: 20px;
  border: 1px solid var(--neon);
  border-radius: 18px;
  box-shadow: 0 0 22px var(--neon);
  margin: 20px 0;
  position: relative;
  z-index: 3;
}

.your-card h2 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.your-card .xp-bar-wrap {
  margin-top: 8px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(0,255,242,0.4);
}

.xp-bar {
  height: 10px;
  width: 0;
  background: linear-gradient(90deg, var(--pink), #ff9d4a, var(--neon));
  transition: width 0.6s;
}

/* TABS */
.tabs {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.tab {
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid var(--neon);
  background: rgba(0,0,0,0.55);
  color: #eaf7ff;
  cursor: pointer;
  transition: 0.18s;
}

.tab.active {
  background: var(--neon);
  color: #050515;
  box-shadow: 0 0 14px var(--neon);
  transform: translateY(-2px);
}

/* MODE COLORS */
.mode-tab[data-mode="normal"].active { background: var(--normal); }
.mode-tab[data-mode="hard"].active { background: var(--hard); }
.mode-tab[data-mode="reverse"].active { background: var(--reverse); }
.mode-tab[data-mode="timerush"].active { background: var(--timerush); }
.mode-tab[data-mode="hardcore"].active { background: var(--hardcore); }
.mode-tab[data-mode="custom"].active { background: var(--custom); }

/* LEADERBOARD GRID */
.grid {
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px,1fr));
  gap: 18px;
  position: relative;
  z-index: 5;
}

/* PLAYER CARD */
.card {
  background: var(--card-bg);
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(0,255,242,0.45);
  box-shadow: 0 0 14px rgba(0,255,242,0.25);
  transition: 0.18s;
  position: relative;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 26px rgba(0,255,242,0.7);
}

/* TOP 3 */
.card.rank-1 { border-color: gold; box-shadow: 0 0 22px gold; }
.card.rank-2 { border-color: silver; box-shadow: 0 0 22px silver; }
.card.rank-3 { border-color: #cd7f32; box-shadow: 0 0 22px #cd7f32; }

/* HIGHLIGHT YOURSELF */
.highlight {
  border: 2px solid var(--pink) !important;
  box-shadow: 0 0 25px var(--pink) !important;
}

/* NAME LINE */
.name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--neon);
  color: #050515;
  font-weight: 900;
  font-size: 1.1rem;
  box-shadow: 0 0 18px var(--neon);
}

.name-flag { display: flex; flex-direction: column; }

.flag { opacity: 0.85; font-size: 0.9rem; margin-top: -3px; }

/* MODE BADGE */
.mode-badge {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  margin-top: 8px;
  display: inline-block;
}

/* MODE COLORS */
.mode-badge.normal { background: var(--normal); color: #041314; }
.mode-badge.hard { background: var(--hard); color: #2b0020; }
.mode-badge.reverse { background: var(--reverse); color: #12002c; }
.mode-badge.timerush { background: var(--timerush); color: #3d1e00; }
.mode-badge.hardcore { background: var(--hardcore); color: #330000; }
.mode-badge.custom { background: var(--custom); color: #0a2b00; }

.score { margin-top: 8px; font-size: 1rem; }

.time {
  margin-top: 6px;
  font-size: 0.82rem;
  opacity: 0.75;
}

/* LOADING */
.loading {
  margin-top: 30px;
  text-align: center;
  opacity: 0.8;
}

.hidden { display: none !important; }

@media (max-width: 600px) {
  .neon-title { font-size: 1.9rem; }
}
