body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f0fdf4;
  color: #064e3b;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 10px; /* extra padding for mobile */
}

.leaderboard-container {
  max-width: 600px;
  width: 100%;
  background: white;
  padding: 20px;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
}

.title {
  text-align: center;
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 20px;
  color: #166534;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.leaderboard-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ecfdf5;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 1rem;
  transition: transform 0.2s ease;
  flex-wrap: wrap; /* allows items to wrap on smaller screens */
}

.leaderboard-item:hover {
  transform: translateY(-3px);
}

.first {
  background: #fef3c7;
}
.second {
  background: #e0f2fe;
}
.third {
  background: #ede9fe;
}

.player {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}

.medal {
  font-size: 1.4rem;
}

.badge {
  background: #059669;
  color: white;
  font-size: 0.8rem;
  padding: 4px 8px;
  border-radius: 50%;
}

.score {
  font-weight: bold;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Back to home button */
.back-home {
  display: block;
  text-align: center;
  margin: 30px auto 10px;
  background: #16a34a;
  color: white;
  font-weight: bold;
  padding: 12px 20px;
  border-radius: 12px;
  text-decoration: none;
  transition: background 0.3s ease;
  max-width: 220px;
}

.back-home:hover {
  background: #15803d;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .title {
    font-size: 1.5rem;
  }

  .leaderboard-item {
    padding: 10px 12px;
    font-size: 0.9rem;
  }

  .medal {
    font-size: 1.2rem;
  }

  .badge {
    font-size: 0.7rem;
    padding: 3px 7px;
  }

  .back-home {
    width: 100%;
    padding: 10px 0;
    font-size: 0.9rem;
  }
}
