/* ===== TROPHY ROOM THEME — leaderboard.php ===== */
/* Page-specific visual theme. Extracted from inline <style> (v5.10.0) */

/* Trophy glow overlay */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(251, 191, 36, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(245, 158, 11, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(217, 119, 6, 0.05) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
}

/* Main content */
.leaderboard-container {
  position: relative;
  z-index: 10;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Hero section */
.leaderboard-hero {
  text-align: center;
  padding: 3rem 2rem;
  margin-bottom: 2rem;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(245, 158, 11, 0.05));
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
}

.leaderboard-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(251, 191, 36, 0.1), transparent);
  animation: shine 3s ease-in-out infinite;
}

@keyframes shine {
  0%, 100% { transform: translateX(-100%) rotate(45deg); }
  50% { transform: translateX(100%) rotate(45deg); }
}

.leaderboard-hero h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  color: var(--accent-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.leaderboard-hero h1 i {
  font-size: 2rem;
  animation: trophy-bounce 2s ease-in-out infinite;
}

@keyframes trophy-bounce {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50% { transform: translateY(-10px) rotate(5deg); }
}

.leaderboard-hero p {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* Stats cards */
.leaderboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-secondary);
  box-shadow: 0 8px 24px rgba(251, 191, 36, 0.2);
}

.stat-card i {
  font-size: 2rem;
  color: var(--accent-secondary);
  margin-bottom: 0.5rem;
}

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-card .stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Leaderboard stat shimmer skeleton */
.stat-card .stat-value.is-loading {
  color: transparent !important;
  min-width: 3rem;
  min-height: 1.1em;
  display: inline-block;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  background: rgba(251, 191, 36, 0.08);
  vertical-align: middle;
}
.stat-card .stat-value.is-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(251,191,36,0.28) 40%, rgba(251,191,36,0.45) 50%, rgba(251,191,36,0.28) 60%, transparent 100%);
  background-size: 250% 100%;
  animation: lb-stat-shimmer 1.6s ease-in-out infinite;
}
@keyframes lb-stat-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Top 3 podium */
.podium {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 3rem;
  padding: 2rem 0;
}

.podium-place {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: var(--transition);
}

.podium-place:hover {
  transform: translateY(-8px);
}

.podium-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 4px solid var(--border);
  margin-bottom: 0.5rem;
  object-fit: cover;
  transition: var(--transition);
}

.podium-place:nth-child(2) .podium-avatar { /* 1st place */
  width: 100px;
  height: 100px;
  border-color: #fbbf24;
  box-shadow: 0 0 30px rgba(251, 191, 36, 0.5);
}

.podium-place:nth-child(1) .podium-avatar { /* 2nd place */
  border-color: #94a3b8;
  box-shadow: 0 0 20px rgba(148, 163, 184, 0.3);
}

.podium-place:nth-child(3) .podium-avatar { /* 3rd place */
  border-color: #cd7f32;
  box-shadow: 0 0 20px rgba(205, 127, 50, 0.3);
}

.podium-name {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.podium-points {
  font-size: 0.875rem;
  color: var(--accent-secondary);
  font-weight: 500;
}

.podium-medal {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.podium-place:nth-child(2) .podium-medal { color: #fbbf24; } /* Gold */
.podium-place:nth-child(1) .podium-medal { color: #94a3b8; } /* Silver */
.podium-place:nth-child(3) .podium-medal { color: #cd7f32; } /* Bronze */

.podium-stand {
  width: 100px;
  background: linear-gradient(180deg, var(--bg-card-hover), var(--bg-card));
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-muted);
}

.podium-place:nth-child(2) .podium-stand { height: 120px; background: linear-gradient(180deg, rgba(251, 191, 36, 0.2), var(--bg-card)); }
.podium-place:nth-child(1) .podium-stand { height: 90px; }
.podium-place:nth-child(3) .podium-stand { height: 70px; }

/* Leaderboard table */
.leaderboard-table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
}

.leaderboard-table th {
  background: var(--bg-secondary);
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.leaderboard-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

.leaderboard-table tr:hover td {
  background: var(--bg-card-hover);
}

.leaderboard-table tr:last-child td {
  border-bottom: none;
}

.lb-rank {
  font-weight: 700;
  font-size: 1.1rem;
  width: 60px;
}

.lb-rank-1 { color: #fbbf24; }
.lb-rank-2 { color: #94a3b8; }
.lb-rank-3 { color: #cd7f32; }

.lb-user {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.lb-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

.lb-user-info {
  display: flex;
  flex-direction: column;
}

.lb-name {
  font-weight: 600;
  color: var(--text-primary);
}

.lb-username {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.lb-points {
  font-weight: 700;
  color: var(--accent-secondary);
  font-size: 1.1rem;
}

.lb-wins {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
}

.lb-wins i {
  color: var(--accent-secondary);
}

.lb-actions a {
  color: var(--accent-primary);
  text-decoration: none;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.lb-actions a:hover {
  background: rgba(139, 92, 246, 0.1);
}

/* Pagination */
.leaderboard-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
  padding: 1rem;
}

.leaderboard-pagination button {
  padding: 0.75rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
}

.leaderboard-pagination button:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: var(--accent-secondary);
}

.leaderboard-pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-info {
  color: var(--text-secondary);
}

/* Your rank card */
.your-rank-card {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(236, 72, 153, 0.05));
  border: 1px solid var(--accent-primary);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.your-rank-card h3 {
  color: var(--accent-primary);
  margin: 0;
}

.your-rank-stats {
  display: flex;
  gap: 2rem;
}

.your-rank-stat {
  text-align: center;
}

.your-rank-stat .value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.your-rank-stat .label {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Empty state */
.leaderboard-empty {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
}

.leaderboard-empty i {
  font-size: 4rem;
  color: var(--accent-secondary);
  opacity: 0.5;
  margin-bottom: 1rem;
}

/* Loading skeleton */
.skeleton-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
}

.skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-card-hover);
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-text {
  height: 1rem;
  background: var(--bg-card-hover);
  border-radius: var(--radius-sm);
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Season selector */
.season-selector-wrap { text-align: center; margin-bottom: 1.5rem; }
.season-live-badge { background: rgba(239,68,68,.15); color: #f87171; padding: .2rem .6rem; border-radius: 4px; font-size: .75rem; font-weight: 700; }
.season-ended-badge { background: rgba(100,116,139,.15); color: var(--text-secondary); padding: .2rem .6rem; border-radius: 4px; font-size: .75rem; }

/* Hall of Fame */
.hall-of-fame { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 12px; padding: 2rem; margin-bottom: 2rem; }
.hof-title { text-align: center; font-size: 1.3rem; font-weight: 700; margin-bottom: 1.5rem; }
.hof-podium { display: flex; justify-content: center; gap: 1.5rem; flex-wrap: wrap; }
.hof-card { display: flex; flex-direction: column; align-items: center; gap: .6rem; padding: 1.5rem; border-radius: 10px; min-width: 150px; }
.hof-card--1 { background: rgba(234,179,8,.12); border: 1px solid rgba(234,179,8,.35); }
.hof-card--2 { background: rgba(148,163,184,.1); border: 1px solid rgba(148,163,184,.3); }
.hof-card--3 { background: rgba(180,83,9,.1); border: 1px solid rgba(180,83,9,.3); }
.hof-medal { font-size: 2rem; }
.hof-name { font-weight: 600; font-size: .95rem; }
.hof-score { font-size: .8rem; color: var(--text-secondary); }

/* Light theme adjustments */
[data-theme="light"] .leaderboard-hero {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(245, 158, 11, 0.08));
}

[data-theme="light"] .stat-card:hover {
  box-shadow: 0 8px 24px rgba(251, 191, 36, 0.15);
}

[data-theme="light"] .podium-place:nth-child(2) .podium-avatar {
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
  .leaderboard-hero h1 {
    font-size: 1.75rem;
  }

  .podium {
    flex-wrap: wrap;
  }

  .leaderboard-table th:nth-child(4),
  .leaderboard-table td:nth-child(4),
  .leaderboard-table th:nth-child(5),
  .leaderboard-table td:nth-child(5) {
    display: none;
  }

  .your-rank-card {
    flex-direction: column;
    text-align: center;
  }
}
