/* Reset & base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: clamp(16px, 4vw, 20px);
}

body {
  font-family: "Outfit", sans-serif;
  background: linear-gradient(to bottom, #0f2027, #203a43, #2c5364);
  background-attachment: fixed;
  background-size: cover;
  color: #fff;
  padding: clamp(1rem, 2vw, 2rem);
  max-width: 700px;
  margin: auto;
  text-align: center;
}

/* Headings */
h1,
h2 {
  margin-bottom: 1rem;
}

h1 {
  font-size: clamp(2rem, 6vw, 2.5rem);
  text-shadow: 1px 1px 4px #000;
}

h2 {
  font-size: clamp(1.25rem, 4vw, 1.5rem);
  border-bottom: 2px solid #fff3;
  display: inline-block;
  padding-bottom: 0.3rem;
}

/* XP Bar */
#xpBar {
  width: 100%;
  height: clamp(24px, 6vw, 30px);
  margin: 1rem 0;
  appearance: none;
}

progress::-webkit-progress-bar {
  background-color: #1c1c1c;
  border-radius: 20px;
  overflow: hidden;
}

progress::-webkit-progress-value {
  background: linear-gradient(90deg, #00c6ff, #0072ff);
  border-radius: 20px;
  transition: width 1s ease-in-out;
}

#xpText {
  margin-bottom: 2rem;
  font-size: clamp(1rem, 3vw, 1.1rem);
  color: #aaddff;
}

/* Leaderboard */
ul#leaderboard {
  margin-bottom: 2rem;
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

ul#leaderboard li {
  background: #ffffff09;
  border: 1px solid #ffffff22;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 1rem;
  animation: fadeInUp 0.5s ease forwards;
  opacity: 0;
}

ul#leaderboard.loaded li {
  animation: none;
  opacity: 1;
}

ul#leaderboard li:nth-child(1) {
  animation-delay: 0.1s;
}
ul#leaderboard li:nth-child(2) {
  animation-delay: 0.2s;
}
ul#leaderboard li:nth-child(3) {
  animation-delay: 0.3s;
}
/* add more as needed */

ul#leaderboard img {
  border-radius: 50%;
  border: 2px solid #00c6ff;
  width: clamp(40px, 8vw, 48px);
  height: clamp(40px, 8vw, 48px);
  transition: transform 0.3s, box-shadow 0.3s;
}

ul#leaderboard li:hover img {
  transform: scale(1.1);
  box-shadow: 0 0 10px #00c6ff;
}

#achievements {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-height: 400px;
  overflow-y: auto;
  padding-top: 0;
}

.achievement {
  width: clamp(80px, 25vw, 128px);
  height: clamp(80px, 25vw, 128px);
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s, box-shadow 0.3s;
}

.achievement:hover,
.achievement.active {
  transform: scale(1.1);
  box-shadow: 0 0 10px #00c6ff;
  z-index: 5;
}

.badge-tooltip {
  position: absolute;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  pointer-events: none;
  transform: translate(-50%, -100%);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
  z-index: 10;
}

.badge-tooltip.show {
  opacity: 1;
}

/* Animations */
@keyframes fadeInUp {
  from {
    transform: translateY(15px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
