

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

body.leaderboard-body {
  background: var(--bg-main, #121214);
  color: var(--text-primary, #f9fafb);
  font-family: var(--font-body, 'Inter', sans-serif);
  min-height: 100vh;
}

.lb-wrapper {
  max-width: 760px;
  margin: 0 auto;
  padding: 12px 14px 60px 14px;
}

.lb-wrapper .header-card {
  margin: 0 0 20px 0;
  box-shadow: 0 8px 24px rgba(223, 123, 60, 0.28);
}

.lb-hero {
  border-radius: 24px;
  box-shadow: 0 10px 30px rgba(223, 123, 60, 0.2);
}

.lb-hero {
  position: relative;
  overflow: hidden;
  padding: 40px 20px 36px;
  text-align: center;
  background: linear-gradient(135deg, #E6884C 0%, #DF7B3C 50%, #D86F2E 100%);
  color: #fff;
}

.lb-hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.lb-hero-sparkle {
  position: absolute;
  font-size: 1.4rem;
  animation: lbFloat 3s ease-in-out infinite;
  opacity: 0.7;
}
.lb-sparkle-1 { top: 12%; left: 8%;  animation-delay: 0s;   }
.lb-sparkle-2 { top: 20%; right: 10%; animation-delay: 0.6s; }
.lb-sparkle-3 { bottom: 18%; left: 15%; animation-delay: 1.2s; }
.lb-sparkle-4 { top: 55%; right: 6%;   animation-delay: 1.8s; }
.lb-sparkle-5 { bottom: 10%; right: 20%; animation-delay: 0.9s; }

@keyframes lbFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%       { transform: translateY(-8px) rotate(10deg); }
}

.lb-hero-icon {
  font-size: 3.5rem;
  margin-bottom: 8px;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
  animation: lbTrophy 2s ease-in-out infinite;
}

@keyframes lbTrophy {
  0%, 100% { transform: scale(1) rotate(-3deg); }
  50%       { transform: scale(1.08) rotate(3deg); }
}

.lb-hero-title {
  font-family: var(--font-heading, 'Lora', serif);
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  font-weight: 700;
  margin-bottom: 10px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.lb-hero-subtitle {
  font-size: 0.95rem;
  opacity: 0.9;
  line-height: 1.6;
  margin-bottom: 20px;
}
.lb-hero-subtitle strong { font-weight: 700; }

.lb-score-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  background: rgba(255,255,255,0.15);
  border-radius: 14px;
  padding: 10px 16px;
  backdrop-filter: blur(4px);
}

.lb-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  opacity: 0.95;
}

.lb-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.lb-podium-section {
  padding: 32px 16px 8px;
}

.lb-podium-loading {
  display: flex;
  justify-content: center;
  padding: 32px;
}

.lb-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border-subtle, #e5e7eb);
  border-top-color: var(--primary-orange, #DF7B3C);
  border-radius: 50%;
  animation: lbSpin 0.7s linear infinite;
}
@keyframes lbSpin { to { transform: rotate(360deg); } }

.lb-podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
  padding: 0 8px;
}

.lb-podium-empty {
  text-align: center;
  color: var(--text-muted, #6b7280);
  font-size: 0.9rem;
  width: 100%;
}

.lb-podium-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  max-width: 160px;
  animation: lbFadeUp 0.5s ease both;
}
.lb-podium-item:nth-child(1) { animation-delay: 0.1s; }
.lb-podium-item:nth-child(2) { animation-delay: 0s;   }
.lb-podium-item:nth-child(3) { animation-delay: 0.2s; }

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

.lb-podium-avatar-wrap {
  position: relative;
  margin-bottom: 6px;
}

.lb-podium-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.lb-podium-pos-2 .lb-podium-avatar { width: 58px; height: 58px; }
.lb-podium-pos-3 .lb-podium-avatar { width: 52px; height: 52px; }

.lb-podium-medal {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.2rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.lb-podium-premium {
  position: absolute;
  bottom: -2px;
  right: -2px;
  font-size: 0.9rem;
  background: #fff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.lb-podium-name {
  font-weight: 600;
  font-size: 0.82rem;
  text-align: center;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
  color: var(--text-primary, #1f2937);
}

.lb-podium-score {
  font-size: 0.78rem;
  color: var(--primary-orange, #DF7B3C);
  font-weight: 700;
  margin-bottom: 8px;
}
.lb-podium-score span { font-weight: 400; font-size: 0.72rem; }

.lb-podium-block {
  width: 100%;
  border-radius: 10px 10px 0 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10px;
  font-size: 1.2rem;
  font-weight: 800;
  color: rgba(255,255,255,0.85);
}

.lb-podium-pos-1 .lb-podium-block { background: linear-gradient(180deg, #F6C844 0%, #E6A800 100%); }
.lb-podium-pos-2 .lb-podium-block { background: linear-gradient(180deg, #C0C0C0 0%, #9E9E9E 100%); }
.lb-podium-pos-3 .lb-podium-block { background: linear-gradient(180deg, #CD7F32 0%, #A0632A 100%); }

.lb-table-section {
  padding: 24px 12px 0;
}

.lb-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 4px;
}

.lb-table-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary, #1f2937);
}

.lb-refresh-info {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  color: var(--text-muted, #6b7280);
}

.lb-refresh-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22C55E;
  animation: lbPulse 1.5s ease-in-out infinite;
}
@keyframes lbPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

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

.lb-skeleton-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card, #fff);
  border-radius: 16px;
  animation: lbShimmer 1.4s ease-in-out infinite;
}

@keyframes lbShimmer {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.55; }
}

.lb-skeleton-rank  { width: 28px; height: 28px; border-radius: 50%; background: var(--border-subtle, #e5e7eb); flex-shrink: 0; }
.lb-skeleton-avatar{ width: 44px; height: 44px; border-radius: 50%; background: var(--border-subtle, #e5e7eb); flex-shrink: 0; }
.lb-skeleton-info  { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.lb-skeleton-name  { height: 13px; border-radius: 6px; background: var(--border-subtle, #e5e7eb); width: 55%; }
.lb-skeleton-score { height: 11px; border-radius: 6px; background: var(--border-subtle, #e5e7eb); width: 35%; }

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

.lb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card, #fff);
  border-radius: 16px;
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(0,0,0,0.04));
  transition: transform 0.2s, box-shadow 0.2s;
  animation: lbFadeUp 0.4s ease both;
  position: relative;
}
.lb-row:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}

.lb-row-me {
  border: 2px solid var(--primary-orange, #DF7B3C);
  background: var(--primary-orange-light, #FBEFE7);
}
body.dark-mode .lb-row-me { background: rgba(223,123,60,0.12); }

.lb-row-rank {
  width: 32px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-medal  { font-size: 1.4rem; }
.lb-rank-num {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-muted, #6b7280);
}

.lb-row-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.lb-row-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-subtle, #e5e7eb);
}

.lb-row-premium-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  font-size: 0.75rem;
  background: var(--bg-card, #fff);
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.lb-row-info {
  flex: 1;
  min-width: 0;
}

.lb-row-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-primary, #1f2937);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-you-badge {
  font-size: 0.65rem;
  font-weight: 700;
  background: var(--primary-orange, #DF7B3C);
  color: #fff;
  padding: 1px 6px;
  border-radius: 8px;
  flex-shrink: 0;
}

.lb-row-username {
  font-size: 0.78rem;
  color: var(--text-muted, #6b7280);
  margin-top: 1px;
}

.lb-row-breakdown {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--text-secondary, #6b7280);
}
.lb-row-breakdown span { display: flex; align-items: center; gap: 3px; }

.lb-row-score {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
}

.lb-score-value {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary-orange, #DF7B3C);
  line-height: 1;
}

.lb-score-label {
  font-size: 0.68rem;
  color: var(--text-muted, #6b7280);
  margin-top: 2px;
}

.lb-empty {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
  text-align: center;
  gap: 12px;
}

.lb-empty-icon { font-size: 3rem; }

.lb-empty p {
  color: var(--text-muted, #6b7280);
  font-size: 0.95rem;
  line-height: 1.6;
}

.lb-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-orange-gradient, linear-gradient(135deg, #E6884C, #DF7B3C));
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 22px;
  border-radius: 40px;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(223,123,60,0.3);
}
.lb-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(223,123,60,0.4);
}

.lb-my-rank-banner {
  margin-top: 16px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(223,123,60,0.12), rgba(223,123,60,0.06));
  border: 1.5px solid var(--primary-orange, #DF7B3C);
  border-radius: 16px;
  text-align: center;
}

.lb-my-rank-inner {}

.lb-my-rank-text {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 1rem;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.lb-my-rank-text strong {
  font-weight: 800;
  color: var(--primary-orange, #DF7B3C);
}

.lb-my-rank-hint {
  font-size: 0.82rem;
  color: var(--text-muted, #6b7280);
}

.lb-footer {
  margin-top: 48px;
  padding: 20px 16px;
  text-align: center;
  border-top: 1px solid var(--border-subtle, #e5e7eb);
}

.lb-footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  font-size: 0.85rem;
}

.lb-footer-links a {
  color: var(--text-secondary, #6b7280);
  text-decoration: none;
  transition: color 0.2s;
}
.lb-footer-links a:hover { color: var(--primary-orange, #DF7B3C); }

.lb-footer-links span { color: var(--border-subtle, #e5e7eb); }

.lb-footer-copy {
  font-size: 0.78rem;
  color: var(--text-light, #9ca3af);
}

@media (max-width: 520px) {
  .lb-wrapper { padding-bottom: 105px; }
  .lb-hero    { padding: 32px 16px 28px; }
  .lb-hero-icon { font-size: 2.8rem; }
  .lb-podium-avatar      { width: 56px !important; height: 56px !important; }
  .lb-podium-pos-2 .lb-podium-avatar { width: 50px !important; height: 50px !important; }
  .lb-podium-pos-3 .lb-podium-avatar { width: 44px !important; height: 44px !important; }
  .lb-row { padding: 12px 12px; gap: 10px; }
  .lb-row-avatar { width: 40px; height: 40px; }
  .lb-score-value { font-size: 1rem; }
}

@media (min-width: 768px) {
  .lb-wrapper { padding: 16px 0 105px; }
  .lb-hero    { padding: 52px 32px 44px; }
  .lb-table-section { padding: 28px 0 0; }
}

