/* ========================================
   Leaderboard Page Layout
   ======================================== */

/* --- Leaderboard Hero --- */

.lb-hero {
  position: relative;
  min-height: 50vh;
  padding: var(--space-16) var(--space-6) var(--space-12);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg-primary);
}

.lb-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(212, 160, 32, 0.16) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 80%, rgba(232, 117, 26, 0.06) 0%, transparent 45%);
  z-index: 0;
  pointer-events: none;
}

.lb-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(212, 160, 32, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212, 160, 32, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: 1;
  pointer-events: none;
}

.lb-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.25;
  pointer-events: none;
  z-index: 0;
  animation: float 6s ease-in-out infinite;
}

.lb-orb-1 {
  width: 350px;
  height: 350px;
  background: var(--gold-500);
  top: 10%;
  left: 15%;
  animation-duration: 8s;
}

.lb-orb-2 {
  width: 250px;
  height: 250px;
  background: var(--orange-400);
  bottom: 10%;
  right: 15%;
  animation-duration: 10s;
  animation-delay: -4s;
}

.lb-hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  z-index: 10;
  gap: var(--space-3);
}

.lb-logo {
  width: clamp(200px, 30vw, 340px);
  height: auto;
  margin-bottom: var(--space-4);
  filter: drop-shadow(0 0 20px rgba(212, 160, 32, 0.3));
}

.lb-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: var(--text-5xl);
  text-transform: uppercase;
  letter-spacing: 4px;
  background: linear-gradient(135deg, var(--gold-300), var(--orange-400));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lb-period {
  font-family: var(--font-body);
  color: var(--text-secondary);
  font-size: var(--text-base);
}

.lb-prize {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--accent-gold);
  text-shadow: var(--glow-gold);
}

.lb-meta {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-2);
}

.lb-updated {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

/* Active nav link */
.hero-nav-active {
  color: var(--gold-400) !important;
  border-bottom-color: var(--gold-400) !important;
}

/* --- Data Status --- */

.status-live::before,
.status-delayed::before,
.status-down::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-right: var(--space-2);
}

.status-live::before {
  background: var(--accent-green);
  animation: pulse-dot 1.5s infinite;
}

.status-delayed::before {
  background: var(--accent-gold);
  animation: pulse-dot 1.5s infinite;
}

.status-down::before {
  background: var(--accent-red);
}

/* --- Search Bar --- */

.lb-search-wrap {
  max-width: 600px;
  margin: 0 auto var(--space-8);
  padding: 0 var(--space-6);
}

.lb-search-container {
  display: flex;
}

.lb-search-container input[type="search"] {
  width: 100%;
  background: transparent;
  border: none;
}

.lb-search-container input[type="search"]:focus {
  box-shadow: none;
}

/* =============================================
   TOP 3 PODIUM
   ============================================= */

@keyframes border-rotate {
  0% { --border-angle: 0deg; }
  100% { --border-angle: 360deg; }
}

@keyframes sparkle {
  0%, 100% { opacity: 0; transform: scale(0); }
  50% { opacity: 1; transform: scale(1); }
}

.podium-section {
  padding: var(--space-8) 0 var(--space-16);
}

.podium {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  gap: var(--space-6);
  max-width: 950px;
  margin: 0 auto;
  align-items: end;
}

/* Each podium card */
.podium-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-6) var(--space-4);
  border-radius: var(--radius-xl);
  border: 2px solid var(--border-subtle);
  background: var(--bg-tertiary);
  position: relative;
  transition: all 0.4s var(--ease-out);
  overflow: hidden;
}

.podium-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-xl);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
  z-index: 0;
}

.podium-card:hover::before {
  opacity: 1;
}

.podium-card > * {
  position: relative;
  z-index: 1;
}

.podium-card:hover {
  transform: translateY(-10px) scale(1.02);
}

/* 1st place — gold, tallest, animated border */
.podium-1 {
  border-color: var(--gold-400);
  background: linear-gradient(180deg, rgba(212, 160, 32, 0.12) 0%, rgba(232, 117, 26, 0.04) 40%, var(--bg-tertiary) 70%);
  padding: var(--space-10) var(--space-6) var(--space-6);
  box-shadow:
    0 0 30px rgba(212, 160, 32, 0.2),
    0 0 60px rgba(212, 160, 32, 0.08),
    inset 0 1px 0 rgba(212, 160, 32, 0.15);
  order: 2;
}

.podium-1::before {
  background: radial-gradient(circle at 50% 0%, rgba(212, 160, 32, 0.15) 0%, transparent 60%);
}

.podium-1:hover {
  box-shadow:
    0 0 50px rgba(212, 160, 32, 0.35),
    0 0 100px rgba(212, 160, 32, 0.12),
    0 24px 48px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(212, 160, 32, 0.3);
  border-color: var(--gold-300);
}

/* 2nd place — electric blue accent */
.podium-2 {
  border-color: rgba(100, 160, 255, 0.3);
  background: linear-gradient(180deg, rgba(100, 160, 255, 0.06) 0%, var(--bg-tertiary) 60%);
  order: 1;
}

.podium-2::before {
  background: radial-gradient(circle at 50% 0%, rgba(100, 160, 255, 0.1) 0%, transparent 60%);
}

.podium-2:hover {
  box-shadow: 0 0 30px rgba(100, 160, 255, 0.2), 0 0 60px rgba(100, 160, 255, 0.06), 0 20px 40px rgba(0, 0, 0, 0.3);
  border-color: #64a0ff;
}

/* 3rd place — hot coral/orange accent */
.podium-3 {
  border-color: rgba(255, 120, 70, 0.3);
  background: linear-gradient(180deg, rgba(255, 120, 70, 0.06) 0%, var(--bg-tertiary) 60%);
  order: 3;
}

.podium-3::before {
  background: radial-gradient(circle at 50% 0%, rgba(255, 120, 70, 0.1) 0%, transparent 60%);
}

.podium-3:hover {
  box-shadow: 0 0 30px rgba(255, 120, 70, 0.2), 0 0 60px rgba(255, 120, 70, 0.06), 0 20px 40px rgba(0, 0, 0, 0.3);
  border-color: #ff7846;
}

/* Medal icon */
@keyframes medal-swing {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
}

@keyframes medal-glow-pulse {
  0%, 100% { filter: drop-shadow(0 0 12px rgba(212, 160, 32, 0.4)); }
  50% { filter: drop-shadow(0 0 24px rgba(212, 160, 32, 0.7)) drop-shadow(0 0 48px rgba(212, 160, 32, 0.2)); }
}

.podium-medal {
  margin-bottom: var(--space-4);
  transition: transform 0.4s var(--ease-out);
}

.podium-medal-1 svg {
  filter: drop-shadow(0 0 20px rgba(212, 160, 32, 0.5));
  animation: medal-swing 4s ease-in-out infinite, medal-glow-pulse 3s ease-in-out infinite;
}

.podium-medal-2 svg {
  filter: drop-shadow(0 0 14px rgba(100, 160, 255, 0.4));
  animation: medal-swing 5s ease-in-out infinite;
  animation-delay: -1s;
}

.podium-medal-3 svg {
  filter: drop-shadow(0 0 14px rgba(255, 120, 70, 0.4));
  animation: medal-swing 4.5s ease-in-out infinite;
  animation-delay: -2s;
}

.podium-card:hover .podium-medal {
  transform: scale(1.15);
}

/* Username */
.podium-name {
  font-family: var(--font-body);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
}

.podium-1 .podium-name {
  font-size: var(--text-2xl);
}

/* Labels */
.podium-wager-label,
.podium-prize-label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-tertiary);
  margin-bottom: var(--space-1);
}

/* Wager amount */
.podium-wager {
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
}

.podium-wager-1 {
  font-size: var(--text-3xl);
}

.podium-2 .podium-wager {
  color: #a0c4ff;
}

.podium-3 .podium-wager {
  color: #ffaa8a;
}

/* Prize amount — THE MONEY */
.podium-prize-amount {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 900;
  letter-spacing: 1px;
  margin-bottom: var(--space-4);
}

@keyframes prize-glow {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(212, 160, 32, 0.3)); }
  50% { filter: drop-shadow(0 0 20px rgba(212, 160, 32, 0.6)) drop-shadow(0 0 40px rgba(212, 160, 32, 0.2)); }
}

.podium-prize-1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  background: linear-gradient(135deg, var(--gold-100), var(--gold-300), var(--orange-400));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: prize-glow 2s ease-in-out infinite;
}

.podium-prize-2 {
  font-size: var(--text-3xl);
  color: #88bbff;
  text-shadow: 0 0 12px rgba(100, 160, 255, 0.3);
}

.podium-prize-3 {
  font-size: var(--text-3xl);
  color: #ffaa8a;
  text-shadow: 0 0 12px rgba(255, 120, 70, 0.3);
}

/* Podium bar at bottom — color accent stripe */
.podium-bar {
  width: calc(100% + 2px);
  margin: auto -1px -1px;
  border-radius: 0 0 calc(var(--radius-xl) - 2px) calc(var(--radius-xl) - 2px);
}

.podium-bar-1 {
  height: 6px;
  background: linear-gradient(90deg, var(--gold-600), var(--gold-300), var(--orange-400), var(--gold-300), var(--gold-600));
  background-size: 200% 100%;
  animation: shimmer 3s linear infinite;
}

.podium-bar-2 {
  height: 4px;
  background: linear-gradient(90deg, #4477cc, #64a0ff, #88bbff, #64a0ff, #4477cc);
  background-size: 200% 100%;
  animation: shimmer 4s linear infinite;
}

.podium-bar-3 {
  height: 4px;
  background: linear-gradient(90deg, #cc5533, #ff7846, #ffaa8a, #ff7846, #cc5533);
  background-size: 200% 100%;
  animation: shimmer 4s linear infinite;
}

/* =============================================
   LEADERBOARD TABLE (4th+)
   ============================================= */

.lb-table-section {
  padding: 0 0 var(--space-16);
}

.lb-table-section .container {
  max-width: 900px;
}

.lb-table-header {
  display: grid;
  grid-template-columns: 70px 1fr 140px 120px;
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--border-default);
  margin-bottom: var(--space-2);
}

.lb-table {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lb-row {
  display: grid;
  grid-template-columns: 70px 1fr 140px 120px;
  align-items: center;
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  border: 1px solid transparent;
  transition: all var(--duration-normal) var(--ease-out);
}

.lb-row:hover {
  background: rgba(212, 160, 32, 0.04);
  border-color: var(--border-subtle);
  transform: translateX(4px);
}

.lb-row-top10 {
  border-left: 3px solid rgba(212, 160, 32, 0.25);
  background: linear-gradient(90deg, rgba(212, 160, 32, 0.03) 0%, transparent 30%);
}

.lb-row-top10:hover {
  border-left-color: var(--gold-400);
  background: linear-gradient(90deg, rgba(212, 160, 32, 0.08) 0%, rgba(212, 160, 32, 0.02) 50%, transparent 100%);
}

.lb-row-rank {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--text-tertiary);
}

.lb-row-top10 .lb-row-rank {
  color: var(--gold-400);
}

.lb-row-user {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--text-primary);
}

.lb-row-wager {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--text-primary);
  text-align: right;
}

.lb-row:hover .lb-row-wager {
  color: var(--gold-300);
  text-shadow: 0 0 10px rgba(212, 160, 32, 0.3);
}

.lb-row-reward {
  text-align: right;
}

.lb-row-prize {
  font-family: var(--font-mono);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--gold-300);
}

.lb-row-top10:hover .lb-row-prize {
  text-shadow: 0 0 10px rgba(212, 160, 32, 0.3);
}

.lb-row-no-prize {
  color: var(--text-tertiary);
  opacity: 0.5;
}

/* --- Section alt background --- */
.section-alt {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

/* --- Rewards Breakdown --- */

.lb-rewards {
  padding: var(--space-16) 0;
}

.lb-rewards-grid {
  max-width: 700px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
}

.lb-card-heading {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-3);
}

.lb-card-text {
  color: var(--text-secondary);
}

.lb-payout-entry {
  color: var(--text-secondary);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-body);
  font-size: var(--text-sm);
}

.lb-payout-entry:last-child {
  border-bottom: none;
}

/* --- Quick Rules --- */

.lb-rules {
  padding: var(--space-16) 0;
}

.lb-rules .container {
  max-width: 700px;
}

.lb-rules .card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.lb-rules-list {
  list-style: disc;
  padding-left: var(--space-6);
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.lb-rules-list strong {
  color: var(--gold-300);
}

/* Footer styles are in components.css */

/* --- Cursor Orb --- */
.cursor-orb {
  position: fixed;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 160, 32, 0.08) 0%, rgba(232, 117, 26, 0.04) 40%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s;
  opacity: 0;
}
.cursor-orb.active { opacity: 1; }
@media (max-width: 768px) { .cursor-orb { display: none; } }

/* =============================================
   MOBILE OVERHAUL — LEADERBOARD PAGE
   ============================================= */

@media (max-width: 768px) {
  .lb-hero {
    min-height: auto;
    padding: var(--space-12) var(--space-4) var(--space-8);
  }

  .lb-logo {
    width: clamp(140px, 40vw, 220px);
  }

  .lb-title {
    font-size: var(--text-3xl);
  }

  .lb-prize {
    font-size: var(--text-xl);
  }

  .lb-meta {
    flex-direction: column;
    gap: var(--space-2);
  }

  .lb-orb { opacity: 0.15; }
  .lb-orb-1 { width: 200px; height: 200px; }
  .lb-orb-2 { width: 150px; height: 150px; }

  .podium {
    grid-template-columns: 1fr;
    gap: var(--space-4);
    max-width: 400px;
    margin: 0 auto;
  }

  .podium-1 { order: 1; }
  .podium-2 { order: 2; }
  .podium-3 { order: 3; }

  .lb-table-header {
    display: none;
  }

  .lb-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: var(--space-3);
    gap: var(--space-1) var(--space-3);
  }

  .lb-row-rank {
    width: 40px;
  }

  .lb-row-user {
    flex: 1;
  }

  .lb-row-wager {
    text-align: right;
  }

  .lb-row-reward {
    width: 100%;
    text-align: right;
    padding-left: 43px;
    font-size: var(--text-sm);
  }

  .lb-row-top10 {
    border-left-width: 3px;
  }

  .lb-rewards-grid {
    grid-template-columns: 1fr;
  }

  .lb-rewards, .lb-rules {
    padding: var(--space-12) 0;
  }
}

@media (max-width: 480px) {
  .lb-hero {
    padding: var(--space-8) var(--space-3) var(--space-6);
  }

  .lb-logo { width: 140px; }

  .lb-title {
    font-size: var(--text-2xl);
    letter-spacing: 2px;
  }

  .lb-search-wrap {
    padding: 0 var(--space-3);
  }

  .podium-card {
    padding: var(--space-5) var(--space-3);
  }

  .podium-medal-1 svg { width: 90px; height: 112px; }
  .podium-medal-2 svg,
  .podium-medal-3 svg { width: 70px; height: 88px; }

  .podium-wager-1 { font-size: var(--text-2xl); }
  .podium-prize-1 { font-size: var(--text-2xl); }
  .podium-prize-2,
  .podium-prize-3 { font-size: var(--text-xl); }

  .podium-name { font-size: var(--text-base); }
  .podium-1 .podium-name { font-size: var(--text-lg); }

  .lb-row {
    padding: var(--space-2) var(--space-3);
  }

  .lb-row-rank {
    width: 36px;
    font-size: var(--text-base);
  }

  .lb-row-user { font-size: var(--text-sm); }
  .lb-row-wager { font-size: var(--text-sm); }
  .lb-row-reward { padding-left: 39px; }
}

@media (max-width: 375px) {
  .lb-hero { padding: var(--space-6) var(--space-3); }
  .lb-logo { width: 120px; }
  .lb-title { font-size: var(--text-xl); }
}
