.leaderboard-section {
  position: relative;
  padding: 6rem 0;
  background: var(--bg); /* Assumo sia definita globalmente come #050a10 */
  overflow: hidden;
}

/* Background Spotlight */
.winner-glow {
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, color-mix(in srgb, var(--brand) 15%, transparent) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: 0 auto;
}

/* Podium Layout */
.podium-container {
  display: flex;
  align-items: flex-end; /* Allinea le card in basso per effetto podio */
  justify-content: center;
  gap: 1.5rem;
  margin-top: 3rem;
  margin-bottom: 4rem;
  padding: 0 1rem;
}

.podium-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  max-width: 280px;
}

/* Heights & Ordering */
.rank-1 { order: 2; z-index: 10; margin-bottom: 2rem; } /* Lifted higher */
.rank-2 { order: 1; }
.rank-3 { order: 3; }

/* Podium Cards */
.podium-card {
  width: 100%;
  background: color-mix(in srgb, var(--elev-1) 60%, transparent);
  backdrop-filter: blur(12px);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg, 24px);
  padding: 2rem 1.5rem;
  text-align: center;
  position: relative;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 10px 30px -10px rgba(0,0,0,0.3);

}

.podium-card:hover {
  transform: translateY(-8px);
}

.winner-card {
  background: linear-gradient(180deg, 
    color-mix(in srgb, var(--elev-2) 80%, transparent) 0%, 
    color-mix(in srgb, var(--gold) 5%, transparent) 100%);
  border-color: color-mix(in srgb, var(--gold) 30%, transparent);
  box-shadow: 0 15px 40px -10px var(--gold-glow);
}

/* Crown Icon */
.crown-icon {
  color: var(--gold);
  margin-bottom: 0.5rem;
  animation: float 3s ease-in-out infinite;
}
.crown-icon svg {
  width: 40px;
  height: 40px;
  filter: drop-shadow(0 0 8px var(--gold));
}

/* Avatars */
.avatar-container {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--elev-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  position: relative;
  z-index: 2;
}

.avatar-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  z-index: 1;
  opacity: 0.6;
}

.gold-ring { border: 2px solid var(--gold); box-shadow: 0 0 15px var(--gold-glow); }
.silver-ring { border: 2px solid var(--silver); box-shadow: 0 0 10px var(--silver-glow); }
.bronze-ring { border: 2px solid var(--bronze); box-shadow: 0 0 10px var(--bronze-glow); }

/* Typography */
.user-name {
  color: var(--text);
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-id-chip {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(0,0,0,0.3);
  border-radius: 12px;
  margin-bottom: 1.5rem;
}

.code-font {
  font-family: 'Fira Code', monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 1px;
}

/* Score */
.score-display {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.score-value {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(180deg, var(--text) 0%, var(--text-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.winner-card .score-value {
  background: linear-gradient(180deg, var(--text) 0%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.score-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-top: 5px;
}

/* Badges */
.rank-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.8rem;
  color: var(--text-inverse);
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.badge-gold { background: var(--gold); }
.badge-silver { background: var(--silver); }
.badge-bronze { background: var(--bronze); }

/* Bases (The Pedestal Effect) */
.podium-base {
  width: 80%;
  height: 40px; /* Base height differs by rank */
  background: linear-gradient(180deg, var(--glass-highlight), transparent);
  border: 1px solid var(--glass-highlight);
  border-top: none;
  border-radius: 0 0 12px 12px;
  margin-top: -10px; /* Connect to card */
  z-index: -1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.base-gold { 
  height: 80px; 
  width: 90%;
  background: linear-gradient(180deg, color-mix(in srgb, var(--gold) 10%, transparent), transparent);
  color: var(--gold);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  padding-top: 10px;
}

/* Rules Ticker */
.rules-ticker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  background: var(--glass-bg-light);
  border: 1px solid var(--stroke);
  border-radius: 50px;
  padding: 1rem 2rem;
  backdrop-filter: blur(5px);
}

.ticker-label {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.ticker-items {
  display: flex;
  gap: 2rem;
}

.ticker-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-size: 0.9rem;
}

.ticker-item .icon { font-size: 1.1rem; }
.ticker-item strong { color: var(--brand); }

/* Animations */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.fade-in-up {
  opacity: 0;
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* Responsive */
@media (max-width: 768px) {
  .podium-container {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }
  
  .rank-1, .rank-2, .rank-3 { order: unset; max-width: 100%; margin: 0; }
  
  .podium-card:hover { transform: translateY(-4px); }
  .crown-icon { display: none; }
  .podium-base { display: none; } /* Remove bases on mobile to save space */
  
  .rules-ticker {
    flex-direction: column;
    border-radius: 16px;
    gap: 1rem;
    align-items: flex-start;
  }
  
  .ticker-items {
    flex-direction: column;
    gap: 0.5rem;
  }
}