* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Arial, sans-serif;
}

body {
  background: linear-gradient(135deg, #58077d53, #1a1a2e, #0f0f0f);
  animation: gradientMove 15s ease infinite;
  background-size: 400% 400%;
  color: #eaeaea;
  display: flex;
  justify-content: center;
  padding: 20px;
  min-height: 100vh;
}

.rain {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}

.drop {
  position: absolute;
  width: 4px;
  height: 22px;
  background: rgba(255, 255, 255, 0.2);
  animation: fall linear infinite;
  bottom: 100%;
}

@keyframes fall {
  0% {
    transform: translateY(0) rotate(10deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(10deg);
    opacity: 0;
  }
}

@keyframes gradientMove {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.leaderboard {
  width: 100%;
  max-width: 1000px;
  background: linear-gradient(135deg, #7b00ff47, #1453c857); 
  border-radius: 20px;
  padding: 25px;
  padding-top: 85px;
  box-shadow: 0 0 25px rgba(176, 79, 255, 0.5);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.8s ease-out;
  position: relative;
}
.leaderboard h1 {
  text-align: center;
  font-size: 2rem;
  padding-top: 20px;
  color: #ffffff;
  text-shadow: 0 0 12px #b04fff;
  margin-bottom: 5px; /* reduce gap */
}

.rainbet {
  position: absolute;
  top: 1px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  pointer-events: none;
}

.rainlogo {
  max-width: 300px;
  margin-bottom: 120px;
  height: auto;
  display: block;
}

#timer {
  text-align: center;
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 25px;
  display: inline-block;
  padding: 8px 16px;
  border-radius: 12px;
  background: rgba(123, 0, 255, 0.2);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(176, 79, 255, 0.5);
}

.top-3 {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.top-3 .player {
  flex: 1;
  max-width: 180px;
  text-align: center;
  border-radius: 16px;
  padding: 15px 10px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  color: #fff;
  position: relative;
}

.top-3 .player:hover {
  transform: translateY(-6px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

#first {
  height: 180px;
  background: linear-gradient(30deg,#7b00ff47, #ffd900ad);
  box-shadow: 0 -8px 13px #ffd9009b, -4px -4px 15px #ffd9009b, 4px -4px 7px #ffd9009b;
}

#second {
  height: 160px;
  background: linear-gradient(30deg, #7b00ff47, #e0e0e07e);
  box-shadow: 0 -6px 13px #e0e0e07e, -3px -3px 12px #e0e0e07e, 3px -3px 7px #e0e0e07e;
}

#third {
  height: 140px;
  background: linear-gradient(30deg, #7b00ff47, #cd803292);
  box-shadow: 0 -6px 13px #cd803292, -3px -3px 12px #cd803292, 3px -3px 7px #cd803292;
}

#first .rank {
  font-size: 3rem;
  font-weight: 1000;
  color: #FFD700;      
  -webkit-text-stroke: 4px #ffd90039; 
  border-bottom: solid 3px #ffd90039;
  margin-bottom: 5px;
}

#second .rank {
  font-size: 2rem;
  font-weight: 1000;
  color: #C0C0C0;
  -webkit-text-stroke: 4px #c0c0c03a;
  margin-bottom: 5px;
  border-bottom: solid 3px #c0c0c03a;
}

#third .rank {
  font-size: 1.6rem;
  font-weight: 1000;
  color: #CD7F32;
  -webkit-text-stroke: 3px #cd803245;
  border-bottom: solid 3px #cd803245;
}

.top-3 h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 5px 0;
}

.top-3 .wager {
  font-size: 1.1rem;
  font-weight: 600;
  color: #ffddaa;
  margin: 3px 0;
}

.top-3 .prize {
  font-size: 1.2rem;
  font-weight: 500;
  color: #fff;
  background: rgba(0,0,0,0.2);
  border-radius: 6px;
}

.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 12px;
  overflow: hidden;
}

th, td {
  padding: 14px 12px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

th {
  background: linear-gradient(45deg, #58188d8d, #00aaff82);
  color: #fff;  
  font-weight: bold;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 1px;
}

td {
  font-size: 0.95rem;
  font-weight: 500;
}

tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.05);
}

tbody tr:hover {
  background: rgba(176, 79, 255, 0.15);
  transition: 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
  .top-3 {
    flex-direction: row;
    justify-content: center;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: nowrap;
  }

  .top-3 .player {
    max-width: 30%;
    min-width: 80px;
    margin-bottom: 0;
    padding: 10px 6px;
  }

  #first { height: 140px; }
  #second { height: 130px; }
  #third { height: 115px; }

  #first .rank { font-size: 2rem; -webkit-text-stroke: 3px #ffd90039; border-bottom: solid 2px #ffd90039; }
  #second .rank { font-size: 1.7rem; -webkit-text-stroke: 3px #c0c0c03a; border-bottom: solid 2px #c0c0c03a; }
  #third .rank { font-size: 1.4rem; -webkit-text-stroke: 2px #cd803245; border-bottom: solid 2px #cd803245; }

  .top-3 h2 { font-size: 1rem; }
  .top-3 .wager { font-size: 0.9rem; }
  .top-3 .prize { font-size: 1rem; }

  .rainlogo { max-width: 180px; margin-bottom: 40px; }
  #timer { font-size: 0.85rem; padding: 5px 10px; }

  th, td { font-size: 0.8rem; padding: 8px 6px; }
  .table-wrapper { margin-top: 10px; }
}
