/* ── Ranking Page Styles ── */

/* Hero */
.ranking-hero {
  position: relative;
  text-align: center;
  padding: 140px 24px 60px;
  overflow: hidden;
}

.ranking-hero__glow {
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.15;
  pointer-events: none;
}

.ranking-hero__glow--1 {
  top: -60px;
  left: 10%;
  background: var(--cyan);
  animation: float 8s ease-in-out infinite;
}

.ranking-hero__glow--2 {
  bottom: -40px;
  right: 10%;
  background: var(--gold);
  animation: float 10s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(20px, -30px); }
  66% { transform: translate(-15px, 20px); }
}

.ranking-hero__title {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 900;
  color: var(--text-primary);
  margin: 0 0 12px;
  letter-spacing: 1px;
}

.ranking-hero__subtitle {
  font-family: var(--font-body);
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin: 0;
}

/* Dashboard layout */
.ranking-dashboard {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* Rows */
.ranking-row {
  display: grid;
  gap: 20px;
  margin-top: 20px;
}

.ranking-row--2col {
  grid-template-columns: 1fr 1fr;
}

.ranking-row--3col {
  grid-template-columns: 1fr 1fr 1fr;
}

/* Section card */
.ranking-section {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  margin-top: 20px;
  border-top: 3px solid var(--border-subtle);
  transition: transform 0.2s;
}

.ranking-row .ranking-section {
  margin-top: 0;
}

.ranking-section--jrc { border-top-color: var(--cyan); }
.ranking-section--race { border-top-color: var(--green); }
.ranking-section--hof { border-top-color: var(--pink); }
.ranking-section--champion { border-top-color: var(--gold); }

.ranking-section__title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ranking-section__icon {
  font-size: 1.4rem;
}

/* ── Podium (JRC Pulse top 3) ── */
.podium {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 24px;
  min-height: 200px;
}

.podium__card {
  background: var(--bg-card-hover);
  border-radius: var(--radius);
  padding: 20px 16px 16px;
  text-align: center;
  flex: 0 0 140px;
  position: relative;
  transition: transform 0.2s;
}

.podium__card:hover {
  transform: translateY(-4px);
}

.podium__card--1 {
  border-top: 3px solid var(--gold);
  padding-top: 24px;
  min-height: 200px;
  flex: 0 0 160px;
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.1);
}

.podium__card--2 {
  border-top: 3px solid #C0C0C0;
  min-height: 170px;
}

.podium__card--3 {
  border-top: 3px solid #CD7F32;
  min-height: 150px;
}

.podium__rank {
  font-family: var(--font-display);
  font-weight: 900;
  margin: 0 0 8px;
  line-height: 1;
}

.podium__card--1 .podium__rank { font-size: 2rem; color: var(--gold); }
.podium__card--2 .podium__rank { font-size: 1.6rem; color: #C0C0C0; }
.podium__card--3 .podium__rank { font-size: 1.4rem; color: #CD7F32; }

.podium__flag {
  font-size: 1.8rem;
  display: block;
  margin-bottom: 6px;
}

.podium__name {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin: 0 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.podium__score {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--cyan);
  margin: 0 0 6px;
}

/* ── Leaderboard list (4-10 for JRC) ── */
.leaderboard {
  max-width: 700px;
  margin: 0 auto;
}

.leaderboard__row {
  display: flex;
  align-items: center;
  background: var(--bg-card-hover);
  border-radius: 8px;
  padding: 10px 16px;
  margin-bottom: 6px;
  transition: transform 0.2s;
  gap: 12px;
}

.leaderboard__row:hover {
  transform: translateY(-2px);
}

.leaderboard__rank {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-muted);
  width: 32px;
  text-align: center;
  flex-shrink: 0;
}

.leaderboard__flag {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.leaderboard__name {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leaderboard__score {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--cyan);
  flex-shrink: 0;
}

.leaderboard__tier {
  flex-shrink: 0;
}

/* ── Compact list (Jump Race, HoF) ── */
.compact-list__row {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 4px;
  gap: 10px;
  transition: background 0.2s;
}

.compact-list__row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.compact-list__row--top3 {
  background: rgba(255, 255, 255, 0.02);
}

.compact-list__rank {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.compact-list__row:nth-child(1) .compact-list__rank { color: var(--gold); }
.compact-list__row:nth-child(2) .compact-list__rank { color: #C0C0C0; }
.compact-list__row:nth-child(3) .compact-list__rank { color: #CD7F32; }

.compact-list__flag {
  font-size: 1rem;
  flex-shrink: 0;
}

.compact-list__name {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compact-list__score {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.ranking-section--race .compact-list__score { color: var(--green); }
.ranking-section--hof .compact-list__score { color: var(--pink); }

/* ── Tier badge ── */
.tier-badge {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tier-badge--legend   { background: rgba(255,215,0,0.15); color: var(--gold); border: 1px solid rgba(255,215,0,0.3); }
.tier-badge--diamond  { background: rgba(0,243,255,0.15); color: var(--cyan); border: 1px solid rgba(0,243,255,0.3); }
.tier-badge--gold     { background: rgba(255,215,0,0.12); color: #E6C200; border: 1px solid rgba(255,215,0,0.2); }
.tier-badge--silver   { background: rgba(192,192,192,0.15); color: #C0C0C0; border: 1px solid rgba(192,192,192,0.2); }
.tier-badge--bronze   { background: rgba(205,127,50,0.15); color: #CD7F32; border: 1px solid rgba(205,127,50,0.2); }
.tier-badge--beginner { background: rgba(136,136,170,0.12); color: var(--text-muted); border: 1px solid rgba(136,136,170,0.2); }

/* ── Champion card ── */
.champion-card {
  text-align: center;
  padding: 24px;
}

.champion-card__trophy {
  font-size: 3rem;
  display: block;
  margin-bottom: 12px;
}

.champion-card__year {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text-muted);
  margin: 0 0 8px;
}

.champion-card__flag {
  font-size: 2rem;
  display: block;
  margin-bottom: 8px;
}

.champion-card__name {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--gold);
  margin: 0 0 8px;
}

.champion-card__score {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text-primary);
  margin: 0 0 4px;
}

.champion-card__label {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

.ranking-section--champion {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(255,215,0,0.05) 100%);
  box-shadow: 0 0 40px rgba(255, 215, 0, 0.05);
}

/* ── Empty & Error states ── */
.ranking-empty {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.95rem;
}

.ranking-error {
  text-align: center;
  padding: 60px 24px;
}

.ranking-error p {
  font-family: var(--font-body);
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin: 0 0 16px;
}

.ranking-error__retry {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 10px 24px;
  border: 1.5px solid var(--cyan);
  border-radius: 8px;
  background: transparent;
  color: var(--cyan);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.ranking-error__retry:hover {
  background: var(--cyan);
  color: var(--bg-darkest);
}

/* ── Skeleton loading ── */
.skeleton {
  background: var(--bg-card-hover);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

.skeleton::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.04) 50%, transparent 100%);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.skeleton--podium {
  height: 200px;
  width: 100%;
  margin-bottom: 20px;
}

.skeleton--row {
  height: 44px;
  margin-bottom: 6px;
}

/* ── Nav active state ── */
.nav__links a.active,
.nav__mobile a.active {
  color: var(--cyan);
}

/* ── Responsive ── */
@media (max-width: 899px) {
  .ranking-hero {
    padding: 120px 16px 40px;
  }

  .ranking-hero__title {
    font-size: 2.2rem;
  }

  .ranking-row--3col {
    grid-template-columns: 1fr;
  }

  .ranking-dashboard {
    padding: 0 16px 60px;
  }

  .podium__card {
    flex: 0 0 110px;
    padding: 16px 10px 12px;
  }

  .podium__card--1 {
    flex: 0 0 130px;
  }
}

@media (max-width: 599px) {
  .ranking-hero {
    padding: 100px 16px 32px;
  }

  .ranking-hero__title {
    font-size: 1.8rem;
  }

  .ranking-hero__subtitle {
    font-size: 1rem;
  }

  .ranking-row--2col {
    grid-template-columns: 1fr;
  }

  .ranking-section {
    padding: 20px 16px;
  }

  .podium {
    gap: 8px;
  }

  .podium__card {
    flex: 1;
    min-width: 0;
    padding: 14px 8px 10px;
  }

  .podium__card--1 {
    flex: 1;
    min-height: 160px;
  }

  .podium__card--2 { min-height: 140px; }
  .podium__card--3 { min-height: 130px; }

  .podium__flag { font-size: 1.4rem; }
  .podium__name { font-size: 0.8rem; }
  .podium__score { font-size: 0.9rem; }

  .leaderboard__row {
    padding: 8px 12px;
    gap: 8px;
  }
}
