[data-leaderboard-card] {
  padding: 16px;
  border: 1px solid rgba(214, 231, 251, 0.96);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 10px 24px rgba(22, 55, 112, 0.07);
  color: #14294b;
}

.leaderboard-streak,
.leaderboard-quick {
  animation: leaderboardFadeIn 180ms ease-out;
}

@keyframes leaderboardFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.leaderboard-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.leaderboard-title {
  margin: 0;
  color: #14294b;
  font-size: 1rem;
  font-weight: 800;
}

.leaderboard-login-link {
  flex: 0 0 auto;
  color: #1f62d6;
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
}

.leaderboard-podium {
  display: grid;
  grid-template-columns: 1fr 0.82fr 0.72fr;
  align-items: end;
  gap: 10px;
}

.podium-card {
  display: grid;
  align-content: space-between;
  gap: 10px;
  min-width: 0;
  border: 1px solid rgba(214, 231, 251, 0.92);
  border-radius: 8px;
  background: #ffffff;
}

.podium-rank-1 {
  min-height: 164px;
  padding: 16px;
  background: linear-gradient(180deg, #fff8e8 0%, #ffffff 72%);
  border-color: #f3d58c;
}

.podium-rank-2 {
  min-height: 132px;
  padding: 13px;
  background: linear-gradient(180deg, #f5f8fc 0%, #ffffff 72%);
}

.podium-rank-3 {
  min-height: 112px;
  padding: 12px;
  background: linear-gradient(180deg, #fff0df 0%, #ffffff 72%);
}

.podium-medal {
  position: relative;
  display: inline-grid;
  width: 42px;
  height: 48px;
  place-items: center;
  justify-self: start;
}

.podium-medal::before {
  position: absolute;
  top: 3px;
  width: 34px;
  height: 34px;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 999px;
  box-shadow: 0 8px 16px rgba(26, 52, 93, 0.12);
  content: "";
}

.podium-medal::after {
  position: absolute;
  bottom: 2px;
  width: 18px;
  height: 18px;
  border-radius: 0 0 5px 5px;
  clip-path: polygon(0 0, 100% 0, 78% 100%, 50% 72%, 22% 100%);
  content: "";
}

.podium-medal-glow {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  opacity: 0.5;
  filter: blur(10px);
}

.podium-medal-mark {
  position: relative;
  z-index: 1;
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 950;
}

.podium-rank-1 .podium-medal {
  width: 52px;
  height: 58px;
}

.podium-rank-1 .podium-medal::before {
  top: 4px;
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #ffd15a 0%, #f29f05 100%);
}

.podium-rank-1 .podium-medal::after {
  background: #f29f05;
}

.podium-rank-1 .podium-medal-glow {
  background: #ffcf5c;
}

.podium-rank-1 .podium-medal-mark {
  width: 38px;
  height: 38px;
  color: #3d2500;
  font-size: 1.02rem;
}

.podium-rank-1 .podium-medal-mark::before {
  position: absolute;
  top: -11px;
  left: 50%;
  width: 26px;
  height: 15px;
  background: #ffcf5c;
  clip-path: polygon(0 100%, 16% 28%, 38% 72%, 50% 0, 62% 72%, 84% 28%, 100% 100%);
  content: "";
  transform: translateX(-50%);
}

.podium-rank-2 .podium-medal::before {
  background: linear-gradient(135deg, #dfe9f6 0%, #93a8c2 100%);
}

.podium-rank-2 .podium-medal::after {
  background: #93a8c2;
}

.podium-rank-2 .podium-medal-glow {
  background: #cbd8e7;
}

.podium-rank-3 .podium-medal::before {
  background: linear-gradient(135deg, #f2b27d 0%, #bd7445 100%);
}

.podium-rank-3 .podium-medal::after {
  background: #bd7445;
}

.podium-rank-3 .podium-medal-glow {
  background: #f2b27d;
}

.podium-info {
  min-width: 0;
}

.leaderboard-name,
.winner-name {
  margin: 0;
  overflow: hidden;
  color: #14294b;
  font-size: 0.9rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-score,
.winner-score {
  margin: 2px 0 0;
  color: #536a84;
  font-size: 0.75rem;
  font-weight: 700;
}

.leaderboard-label {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef5ff;
  color: #315b99;
  font-size: 0.68rem;
  font-weight: 900;
  white-space: nowrap;
}

.leaderboard-label.is-seeded {
  background: #fff4d6;
  color: #8a5b00;
}

.leaderboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.leaderboard-category-card {
  display: grid;
  min-height: 118px;
  align-content: space-between;
  gap: 10px;
  padding: 12px 8px;
  border: 1px solid rgba(214, 231, 251, 0.92);
  border-radius: 8px;
  background: #ffffff;
  text-align: center;
}

.category-name {
  margin: 0;
  color: #415875;
  font-size: 0.76rem;
  font-weight: 900;
}

.winner-info {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-width: 0;
}

.winner-info .leaderboard-label {
  max-width: 100%;
  font-size: 0.62rem;
}

.no-data p {
  margin: 0;
  color: #7a8da5;
  font-size: 0.76rem;
  font-weight: 700;
}

.leaderboard-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #cfe0f5;
  cursor: pointer;
}

.dot.active {
  width: 18px;
  background: #2f7df6;
}

.leaderboard-loading,
.leaderboard-empty {
  display: grid;
  min-height: 150px;
  place-items: center;
  text-align: center;
}

.leaderboard-empty span {
  color: #5d728e;
  font-size: 0.78rem;
  font-weight: 800;
}

.leaderboard-empty strong {
  color: #14294b;
  font-size: 1rem;
}

.leaderboard-empty p {
  max-width: 320px;
  margin: 0;
  color: #536a84;
  font-size: 0.84rem;
}

@media (min-width: 640px) {
  [data-leaderboard-card] {
    padding: 22px;
  }

  .leaderboard-title {
    font-size: 1.18rem;
  }

  .leaderboard-podium {
    gap: 14px;
  }

  .podium-rank-1 {
    min-height: 190px;
    padding: 18px;
  }

  .podium-rank-2 {
    min-height: 152px;
    padding: 15px;
  }

  .podium-rank-3 {
    min-height: 132px;
    padding: 14px;
  }
}

@media (max-width: 430px) {
  .leaderboard-podium {
    grid-template-columns: 1fr 1fr;
  }

  .podium-rank-1 {
    grid-column: 1 / -1;
    min-height: 132px;
  }

  .podium-rank-2,
  .podium-rank-3 {
    min-height: 116px;
  }

  .leaderboard-grid {
    grid-template-columns: 1fr;
  }

  .leaderboard-category-card {
    min-height: 92px;
    text-align: left;
  }

  .winner-info {
    justify-items: start;
  }
}
