:root {
  --leader-green: #16b86a;
  --leader-ink: #0f172a;
  --leader-muted: #64748b;
  --leader-line: #e5e7eb;
}

body {
  background: #f6f8fb;
}

.leader-page {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 72px;
}

.leader-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: end;
  margin-bottom: 18px;
  padding: 26px;
  border-radius: 22px;
  color: #fff;
  background:
    radial-gradient(circle at 12% 18%, rgba(255,255,255,.18), transparent 24%),
    radial-gradient(circle at 88% 10%, rgba(34,197,94,.34), transparent 26%),
    linear-gradient(135deg, #07111f 0%, #0a3c2f 54%, #16b86a 100%);
  box-shadow: 0 22px 54px rgba(15, 23, 42, .16);
  overflow: hidden;
}

.leader-kicker {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 10px;
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.9);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.leader-copy h1 {
  max-width: 620px;
  margin: 0 0 9px;
  color: #fff;
  font-size: 38px;
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: 0;
}

.leader-copy p {
  max-width: 620px;
  margin: 0;
  color: rgba(255,255,255,.78);
  font-size: 14px;
  line-height: 1.7;
  font-weight: 700;
}

.leader-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 390px;
}

.leader-filter button {
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  background: rgba(255,255,255,.1);
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.leader-filter button.active {
  background: #fff;
  color: var(--leader-ink);
}

.leader-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.leader-summary article {
  min-height: 86px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--leader-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
}

.leader-summary span {
  color: var(--leader-muted);
  font-size: 12px;
  font-weight: 900;
}

.leader-summary strong {
  color: var(--leader-ink);
  font-size: 24px;
  line-height: 1;
  font-weight: 900;
}

.podium {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.18fr) minmax(0, .92fr);
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

.podium-card {
  position: relative;
  min-height: 176px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  padding: 18px 14px 16px;
  border-radius: 18px;
  color: #fff;
  overflow: hidden;
  box-shadow: 0 18px 42px rgba(15, 23, 42, .16);
}

.podium-card::before {
  content: "";
  position: absolute;
  inset: -70px auto auto -70px;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
}

.podium-card.rank-1 {
  min-height: 214px;
  background: linear-gradient(135deg, #03a85e 0%, #0f5132 100%);
}

.podium-card.rank-2 {
  background: linear-gradient(135deg, #475569 0%, #101827 100%);
}

.podium-card.rank-3 {
  background: linear-gradient(135deg, #b7791f 0%, #7c3f00 100%);
}

.podium-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
}

.rank-badge,
.winner-badge {
  width: 42px;
  height: 42px;
  object-fit: contain;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  flex: 0 0 auto;
}

.rank-number {
  width: auto;
  height: auto;
  background: transparent;
  border: none;
  border-radius: 0;
  color: var(--leader-muted);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.podium-avatar {
  position: relative;
  z-index: 1;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border: 3px solid rgba(255,255,255,.35);
  border-radius: 18px;
  background: rgba(255,255,255,.16);
  color: #fff;
  font-size: 24px;
  font-weight: 900;
  object-fit: cover;
}

.podium-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
  text-align: center;
}

.podium-copy strong {
  display: block;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fff;
  font-size: 18px;
  font-weight: 900;
}

.podium-copy span,
.podium-spent {
  color: rgba(255,255,255,.82);
  font-size: 12px;
  font-weight: 900;
}

.podium-spent {
  position: relative;
  z-index: 1;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.13);
}

.leader-board-grid {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.winner-card,
.rank-panel {
  border: 1px solid var(--leader-line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .07);
}

.winner-card {
  position: sticky;
  top: 82px;
  padding: 16px;
}

.winner-top {
  display: grid;
  grid-template-columns: 46px 58px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-radius: 14px;
  background: #f8fafc;
}

.winner-avatar,
.leader-avatar {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #e8f8f0;
  color: var(--leader-green);
  font-size: 18px;
  font-weight: 900;
  object-fit: cover;
}

.winner-avatar {
  width: 58px;
  height: 58px;
}

.winner-top span {
  color: var(--leader-muted);
  font-size: 11px;
  font-weight: 900;
}

.winner-top strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--leader-ink);
  font-size: 17px;
  font-weight: 900;
}

.winner-prize {
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ecfdf5, #eff6ff);
  color: #047857;
  font-size: 12px;
  font-weight: 900;
}

.winner-stats {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 12px;
  align-items: center;
}

.winner-stats span {
  color: var(--leader-muted);
  font-size: 12px;
  font-weight: 800;
}

.winner-stats strong {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--leader-ink);
  font-size: 12px;
  font-weight: 900;
  text-align: right;
}

.rank-panel {
  overflow: hidden;
}

.rank-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--leader-line);
}

.rank-panel-head span {
  color: var(--leader-green);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.rank-panel-head h2 {
  margin: 4px 0 0;
  color: var(--leader-ink);
  font-size: 22px;
  font-weight: 900;
}

.rank-panel-head a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--leader-green);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.rank-list {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.rank-row {
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--leader-line);
  border-radius: 14px;
  background: #fff;
}

.rank-left {
  min-width: 0;
  display: grid;
  grid-template-columns: 28px 48px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.rank-left strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--leader-ink);
  font-size: 14px;
  font-weight: 900;
}

.rank-left span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--leader-muted);
  font-size: 12px;
  font-weight: 800;
}

.rank-total {
  color: var(--leader-ink);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.rank-empty,
.winner-empty {
  padding: 22px;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  background: #f8fafc;
  color: var(--leader-muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.winner-empty strong,
.winner-empty span {
  display: block;
}

.winner-empty strong {
  margin-bottom: 5px;
  color: var(--leader-ink);
  font-size: 16px;
}

@media (max-width: 900px) {
  .leader-hero,
  .leader-board-grid {
    grid-template-columns: 1fr;
  }

  .leader-filter {
    justify-content: flex-start;
    max-width: none;
  }

  .winner-card {
    position: static;
  }
}

@media (max-width: 700px) {
  .leader-page {
    width: min(100% - 24px, 1120px);
    padding-top: 22px;
  }

  .leader-hero {
    padding: 20px;
    border-radius: 18px;
  }

  .leader-copy h1 {
    font-size: 28px;
  }

  .leader-summary {
    grid-template-columns: 1fr;
  }

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

  .podium-card,
  .podium-card.rank-1 {
    min-height: 150px;
  }

  .podium {
    align-items: stretch;
  }

  .rank-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .rank-left {
    grid-template-columns: 28px 44px minmax(0, 1fr);
  }

  .rank-total {
    padding-left: 82px;
  }

  .rank-panel-head {
    align-items: start;
  }
}

@media (max-width: 420px) {
  .leader-filter button {
    flex: 1 1 calc(50% - 8px);
    padding: 0 8px;
  }

  .winner-top {
    grid-template-columns: 42px 52px minmax(0, 1fr);
  }

  .winner-stats {
    grid-template-columns: 1fr;
  }

  .winner-stats strong {
    max-width: 100%;
    text-align: left;
  }
}
