/* === GLOBAL === */
html, body {
  margin: 0;
  padding: 0;
  font-family: 'Poppins', sans-serif;
  color: white;
  height: 100%;
  width: 100%;
  overflow: hidden; /* fit everything without scroll */
  background: radial-gradient(circle at center, #0a0010 0%, #050005 100%);
  position: relative;
}


/* Allow scrolling on smaller screens */
@media (max-width: 1024px) {
  html, body {
    overflow-y: auto !important;
    height: auto;
  }

  main {
    padding-bottom: 120px; /* make room for footer */
  }
}

/* === ANIMATED BACKGROUND GRID === */
.grid-bg {
  position: fixed;
  inset: 0;
  display: block;
  background:
    repeating-linear-gradient(0deg, rgba(185, 80, 255, 0.25) 0, rgba(185, 80, 255, 0.25) 1px, transparent 1px, transparent 35px),
    repeating-linear-gradient(90deg, rgba(185, 80, 255, 0.25) 0, rgba(185, 80, 255, 0.25) 1px, transparent 1px, transparent 35px);
  animation: moveGrid 60s linear infinite;
  opacity: 0.5;
  z-index: 0; /* ✅ changed from -3 to 0 so it's above body but below content */
  pointer-events: none; /* allows clicks through it */
}

@keyframes moveGrid {
  from {
    background-position: 0 0, 0 0;
  }
  to {
    background-position: 300px 300px, 300px 300px;
  }
}

/* === CENTER PURPLE GLOW === */
.center-glow {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 950px;
  height: 950px;
  transform: translate(-50%, -50%);
  background: radial-gradient(
    circle,
    rgba(170, 70, 255, 0.45) 0%,
    rgba(100, 0, 160, 0.25) 35%,
    rgba(60, 0, 90, 0.15) 60%,
    transparent 100%
  );
  filter: blur(180px);
  opacity: 0.85;
  pointer-events: none;
  z-index: 1; /* ✅ now above the grid, but below all content */
}


/* === NAVIGATION === */
nav {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 15px;
  background: rgba(50, 0, 70, 0.7);
  border: 1px solid rgba(200, 120, 255, 0.4);
  padding: 10px 25px;
  border-radius: 30px;
  backdrop-filter: blur(15px);
  box-shadow: 0 0 20px rgba(185, 80, 255, 0.4);
  z-index: 999;
  transition: box-shadow 0.4s ease, background 0.4s ease;
}

nav:hover {
  background: rgba(60, 0, 90, 0.8);
  box-shadow: 0 0 35px rgba(200, 120, 255, 0.6);
}

nav button {
  background: none;
  border: none;
  color: #d0aaff;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
}

nav button:hover,
nav button.active {
  color: #fff;
  text-shadow: 0 0 15px #b28fff;
}

/* === MAIN CONTENT === */
main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 120px;
  min-height: calc(100vh - 100px); /* allows perfect fit above footer */
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

main.loaded {
  opacity: 1;
  transform: translateY(0);
}

/* === FOOTER === */
footer {
  position: fixed;
  bottom: 0;
  width: 100%;
  text-align: center;
  color: #aaa;
  font-size: 0.9rem;
  background: transparent;
  padding: 10px 0;
  z-index: 10;
}

footer a {
  color: #b28fff;
  text-decoration: none;
}

footer a:hover {
  text-shadow: 0 0 10px #b28fff;
}

/* === LAST UPDATED (perfectly above footer) === */
#last-updated {
  text-align: center;
  font-size: 0.85rem;
  color: #bbb;
  margin-bottom: 35px; /* perfect spacing above footer */
}

/* === LEADERBOARD === */
.leaderboard-container {
  text-align: center;
  color: white;
  width: 100%;
  max-width: 1200px;
}

.leaderboard-header h1 {
  font-size: 2.8rem;
  text-shadow: 0 0 20px rgba(200, 120, 255, 1);
  animation: fadeGlow 2s ease-in-out 1;
  margin-bottom: 8px;
}

.leaderboard-header p {
  font-size: 1rem;
  color: #b28fff;
  margin-bottom: 20px;
}

@keyframes fadeGlow {
  0% { opacity: 0; text-shadow: 0 0 0 rgba(200,120,255,0); }
  100% { opacity: 1; text-shadow: 0 0 25px rgba(200,120,255,1); }
}

.top-three {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.top-card {
  background: rgba(50, 0, 80, 0.85);
  border: 1px solid rgba(180, 100, 255, 0.5);
  border-radius: 20px;
  width: 210px;
  padding: 25px;
  text-align: center;
  box-shadow: 0 0 25px rgba(180, 100, 255, 0.25);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.top-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 0 40px rgba(200, 120, 255, 0.6);
}

.top-card img {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 2px solid rgba(190, 100, 255, 0.6);
  margin-bottom: 10px;
  object-fit: cover;
}
/* === LEADERBOARD TABLE === */
.leaderboard-table {
  margin: 40px auto;
  border-collapse: separate;
  border-spacing: 0;
  width: 78%;
  max-width: 950px;
  background: rgba(25, 0, 45, 0.8);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 0 25px rgba(180, 100, 255, 0.2);
}

.leaderboard-table th, 
.leaderboard-table td {
  padding: 12px 18px; /* slightly reduced from 18/22 */
  text-align: center;
  color: #ccc;
  font-size: 0.95rem;
}

.leaderboard-table th {
  background: rgba(180, 90, 255, 0.25);
  color: #d2b3ff;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 1px;
}

.leaderboard-table tbody tr {
  transition: all 0.25s ease;
}

.leaderboard-table tbody tr:nth-child(even) {
  background: rgba(50, 0, 80, 0.35);
}

.leaderboard-table tbody tr:nth-child(odd) {
  background: rgba(40, 0, 65, 0.3);
}

.leaderboard-table tbody tr:hover {
  background: rgba(120, 40, 200, 0.35);
  box-shadow: 0 0 16px rgba(180, 100, 255, 0.25),
              inset 0 0 6px rgba(180, 100, 255, 0.15);
  transform: scale(1.008);
  cursor: pointer;
}

/* Avatar alignment inside table */
.avatar-small {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(200, 120, 255, 0.4);
  margin-right: 8px;
  vertical-align: middle;
  box-shadow: 0 0 10px rgba(180, 100, 255, 0.25);
  transition: box-shadow 0.3s ease;
}

.avatar-small:hover {
  box-shadow: 0 0 18px rgba(200, 120, 255, 0.6);
}

/* === BONUSES / VIP / RAFFLES === */
.page-wrap {
  text-align: center;
  color: #fff;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding-top: 100px;
}

.card {
  background: rgba(50, 0, 80, 0.8);
  border: 1px solid rgba(200, 120, 255, 0.4);
  border-radius: 20px;
  padding: 30px;
  width: 280px;
  text-align: center;
  box-shadow: 0 0 25px rgba(200, 120, 255, 0.25);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 0 35px rgba(200, 120, 255, 0.5);
}

.card h2 {
  color: #e0c6ff;
  margin-bottom: 10px;
}

.card p {
  color: #ccc;
}

.card .btn {
  background: rgba(200, 120, 255, 0.3);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.card .btn:hover {
  background: rgba(200, 120, 255, 0.5);
}
