/* leaderboard-main.css — Premium Minimalist Tier (Vercel/Linear Style) */

:root {
  /* Core Colors */
  --bg-base:       #000000;
  --bg-surface:    #0a0a0c;
  --bg-panel:      rgba(25, 25, 30, 0.4);
  --bg-panel-hover:rgba(35, 35, 45, 0.6);
  
  /* Glass and Borders */
  --glass-border:  rgba(255, 255, 255, 0.06);
  --glass-highlight: inset 0 1px 1px rgba(255, 255, 255, 0.05);
  
  /* Text */
  --text-primary:  #ffffff;
  --text-secondary:#a1a1aa;
  --text-tertiary: #737376;
  
  /* Accents */
  --accent-primary:#60a5fa; /* Modern Blue */
  --accent-glow:   rgba(96, 165, 250, 0.2);
  
  /* Ranks */
  --rank-1:        #fbbf24; /* Amber Gold */
  --rank-2:        #e4e4e7; /* Platinum Silver */
  --rank-3:        #f43f5e; /* Rose Bronze */

  /* Timing */
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
}

body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  overflow-x: hidden;
}

/* Typography Overrides */
h1, h2, h3, .rank-number, .stat-value, .champion-name {
  font-family: 'Outfit', sans-serif;
}

a { text-decoration: none; color: inherit; }

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 2;
}

/* ── Animated Background Mesh ── */
.bg-mesh {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 0%, rgba(20,20,25,1) 0%, var(--bg-base) 70%);
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.4;
  animation: float 20s infinite alternate ease-in-out;
}

.blob-1 {
  top: -10%; left: -10%;
  width: 50vw; height: 50vw;
  background: var(--accent-glow);
}

.blob-2 {
  bottom: -20%; right: -10%;
  width: 60vw; height: 60vw;
  background: rgba(251, 191, 36, 0.08); /* Faint gold */
  animation-delay: -5s;
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(5%, 10%) scale(1.1); }
}

/* ── Layout & Core Animations ── */
.leaderboard-main {
  padding: 120px 0 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.fade-in {
  opacity: 0;
  animation: revealUp 0.8s var(--ease-out) forwards;
}

@keyframes revealUp {
  0% { opacity: 0; transform: translateY(20px); filter: blur(4px); }
  100% { opacity: 1; transform: translateY(0); filter: blur(0); }
}
/* ── Sleek Dropdown Switcher ── */
.site-dropdown-wrapper {
  position: relative;
  margin-bottom: 60px;
  z-index: 100;
  display: flex;
  justify-content: center;
}

.dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  background: rgba(20, 20, 25, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 100px;
  cursor: pointer;
  color: var(--text-primary);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.2s ease;
  outline: none;
  font-family: inherit;
}

.dropdown-trigger:hover {
  background: rgba(30, 30, 38, 0.8);
  border-color: rgba(255, 255, 255, 0.15);
}

.trigger-icon {
  width: 24px; 
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.trigger-text {
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.dropdown-chevron {
  color: var(--text-secondary);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  margin-left: 2px;
}

.site-dropdown-wrapper:hover .dropdown-chevron {
  transform: rotate(180deg);
}

/* Dropdown Menu Positioning & Glass */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(8px) scale(0.96);
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  
  /* Darker background to prevent text bleed-through */
  background: rgba(12, 12, 16, 0.9);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: 
    0 4px 24px rgba(0, 0, 0, 0.4),
    0 16px 48px rgba(0, 0, 0, 0.6),
    inset 0 1px 1px rgba(255, 255, 255, 0.05);
  
  min-width: 200px;
  padding: 6px;
}

.site-dropdown-wrapper:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0) scale(1);
}

.dropdown-menu-inner {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Individual Items */
.dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--text-secondary);
  transition: all 0.15s ease;
  text-decoration: none;
}

.item-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dropdown-item img {
  width: 20px; 
  height: 20px; 
  border-radius: 50%;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.dropdown-item span {
  font-size: 0.85rem; 
  font-weight: 500;
}

/* Hover State */
.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.dropdown-item:hover img {
  opacity: 1;
}

/* Active State */
.dropdown-item.active {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.dropdown-item.active img {
  opacity: 1;
}

.active-check {
  color: var(--text-primary);
  opacity: 0.9;
}
/* ── Hero / Header ── */
.site-header {
  text-align: center;
  margin-bottom: 60px;
}

.leaderboard-subtitle {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-bottom: 16px;
}

.leaderboard-title {
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.04em;
  margin-bottom: 24px;
  color: transparent;
  background: linear-gradient(180deg, #ffffff 0%, rgba(255,255,255,0.7) 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.leaderboard-title .currency {
  font-size: 0.6em;
  vertical-align: super;
  color: var(--text-secondary);
  margin-right: 4px;
}

.sync-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-tertiary);
}

.status-indicator {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.6);
  animation: pulseSync 2s infinite;
}

@keyframes pulseSync {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ── Minimal Countdown & Buttons ── */
.countdown-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  margin-bottom: 80px;
}

.glass-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.03);
  padding: 10px 20px;
  border-radius: 100px;
  border: 1px solid var(--glass-border);
}

.pulse-dot {
  width: 6px; height: 6px;
  background: var(--text-primary);
  border-radius: 50%;
  animation: blink 1.5s infinite;
}

@keyframes blink { 50% { opacity: 0.3; } }

.time-text {
  font-family: 'Outfit', sans-serif;
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--text-primary);
  color: var(--bg-base);
  padding: 14px 28px;
  border-radius: 100px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.3s var(--ease-spring);
}

.btn-primary:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 30px rgba(255,255,255,0.2);
}

/* ── PODIUM: Champion Cards ── */
.podium-section {
  width: 100%;
  margin-bottom: 80px;
}

.podium-stage {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
}

.podium-card-wrapper {
  position: relative;
  flex: 1;
  max-width: 280px;
  opacity: 0;
  animation: revealUp 0.8s var(--ease-out) forwards;
  animation-delay: var(--delay);
}

.podium-card-wrapper.empty {
  visibility: hidden;
}

/* Crown Animation */
.floating-crown {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px; height: 40px;
  color: var(--rank-1);
  filter: drop-shadow(0 4px 12px rgba(251, 191, 36, 0.4));
  animation: floatCrown 3s ease-in-out infinite;
  z-index: 10;
}

@keyframes floatCrown {
  0%, 100% { transform: translate(-50%, 0) scale(1); }
  50% { transform: translate(-50%, -8px) scale(1.05); }
}

.champion-card {
  position: relative;
  background: rgba(15, 15, 20, 0.4);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 40px 20px 24px;
  text-align: center;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: transform 0.3s ease;
  overflow: hidden;
}

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

.card-glow {
  position: absolute;
  top: 0; left: 0; right: 0; height: 100px;
  opacity: 0.15;
  mask-image: linear-gradient(to bottom, black, transparent);
  -webkit-mask-image: linear-gradient(to bottom, black, transparent);
}

/* Rank specific styling */
.podium-card-wrapper.rank-1 .champion-card {
  border-color: rgba(251, 191, 36, 0.3);
  padding-top: 50px;
  padding-bottom: 30px;
  background: rgba(20, 18, 10, 0.6);
}
.podium-card-wrapper.rank-1 .card-glow { background: var(--rank-1); }
.podium-card-wrapper.rank-1 .rank-badge { background: var(--rank-1); color: #000; }

.podium-card-wrapper.rank-2 .champion-card {
  border-color: rgba(228, 228, 231, 0.2);
}
.podium-card-wrapper.rank-2 .card-glow { background: var(--rank-2); }
.podium-card-wrapper.rank-2 .rank-badge { background: var(--rank-2); color: #000; }

.podium-card-wrapper.rank-3 .champion-card {
  border-color: rgba(244, 63, 94, 0.2);
}
.podium-card-wrapper.rank-3 .card-glow { background: var(--rank-3); }
.podium-card-wrapper.rank-3 .rank-badge { background: var(--rank-3); color: #fff; }

.avatar-ring {
  position: relative;
  width: 80px; height: 80px;
  margin: 0 auto 20px;
}

.podium-card-wrapper.rank-1 .avatar-ring {
  width: 100px; height: 100px;
}

.podium-avatar {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--bg-surface);
}

.rank-badge {
  position: absolute;
  bottom: -4px; right: -4px;
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}
.podium-card-wrapper.rank-1 .rank-badge { width: 32px; height: 32px; font-size: 1rem; }

.champion-name {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.podium-card-wrapper.rank-1 .champion-name { font-size: 1.4rem; }

.champion-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0,0,0,0.4);
  padding: 10px 14px;
  border-radius: 12px;
}

.stat-group.highlight {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-val {
  font-size: 0.95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.podium-card-wrapper.rank-1 .stat-group.highlight .stat-val { color: var(--rank-1); }
.podium-card-wrapper.rank-2 .stat-group.highlight .stat-val { color: var(--rank-2); }
.podium-card-wrapper.rank-3 .stat-group.highlight .stat-val { color: var(--rank-3); }

/* ── Seamless List ── */
.list-container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto 60px;
}

.list-header-row {
  display: grid;
  grid-template-columns: 60px 1fr 140px 140px;
  gap: 20px;
  padding: 0 24px 16px;
  border-bottom: 1px solid var(--glass-border);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.align-right { text-align: right; }

.list-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.list-row {
  display: grid;
  grid-template-columns: 60px 1fr 140px 140px;
  gap: 20px;
  align-items: center;
  background: transparent;
  padding: 16px 24px;
  border-radius: 16px;
  transition: all 0.3s ease;
  border: 1px solid transparent;
  
  /* Stagger animation */
  opacity: 0;
  animation: revealUp 0.6s var(--ease-out) forwards;
  animation-delay: var(--delay);
}

.list-row:hover {
  background: var(--bg-panel);
  border-color: var(--glass-border);
  transform: translateX(4px);
}

.row-rank {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--text-tertiary);
}

.row-user {
  display: flex;
  align-items: center;
  gap: 16px;
}

.row-user img {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.1);
}

.user-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
}

.row-stat {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.row-stat.wagered .stat-value {
  color: var(--text-secondary);
}

.row-stat.prize .stat-value {
  color: var(--text-primary);
  text-shadow: 0 0 10px rgba(255,255,255,0.2);
}

.mobile-label { display: none; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
  border: 1px dashed var(--glass-border);
  border-radius: 16px;
  font-size: 0.9rem;
}

/* ── Info Alert ── */
.info-alert {
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.alert-icon {
  width: 24px; height: 24px;
  color: var(--text-secondary);
  flex-shrink: 0;
  margin-top: 2px;
}

.alert-content p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.6;
}
.alert-content p:last-child { margin-bottom: 0; }
.alert-content strong { color: var(--text-primary); font-weight: 600; }

/* ── Ghost Archive Button ── */
.archive-action {
  margin-top: 60px;
  text-align: center;
  width: 100%;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 100px;
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
  background: transparent;
}

.btn-ghost:hover {
  background: var(--text-primary);
  color: var(--bg-base);
  border-color: var(--text-primary);
}

/* ── Responsive Reflows ── */
@media (max-width: 900px) {
  .list-header-row { display: none; }
  
  .list-row {
    grid-template-columns: 1fr;
    gap: 16px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--glass-border);
    padding: 20px;
    margin-bottom: 12px;
  }
  
  .list-row:hover { transform: translateY(-2px); }

  .row-rank {
    position: absolute;
    top: 20px; right: 24px;
    font-size: 1.5rem;
    opacity: 0.4;
  }

  .row-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    padding-top: 12px;
    border-top: 1px solid var(--glass-border);
  }

  .mobile-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
  }
}

@media (max-width: 768px) {
  .leaderboard-title { font-size: clamp(2.5rem, 12vw, 3.5rem); }
  
  .podium-stage {
    flex-direction: column;
    align-items: center;
    gap: 24px;
  }
  
  .podium-card-wrapper {
    max-width: 100%;
    width: 100%;
  }

  /* Force 1st place to top on mobile */
  .podium-card-wrapper.rank-1 { order: -1; }
  
  .floating-crown { top: -30px; width: 32px; height: 32px; }
  
  .info-alert {
    flex-direction: column;
    gap: 16px;
    padding: 20px;
  }
}