/* GoalClash public leaderboard — matches app Fan Rankings (dark) */

:root {
  --red: #E8333A;
  --blue: #1A6FC4;
  --blue-soft: #5499D8;
  --dark-page: #06090F;
  --dark-card: #111B2B;
  --dark-card-hover: #162236;
  --text: #F1F5F9;
  --text-muted: #94A3B8;
  --border: rgba(255, 255, 255, 0.08);
  --gold: #FFD700;
  --silver: #C0C0C0;
  --bronze: #CD7F32;
  --radius: 16px;
  --radius-pill: 999px;
  --max-width: 640px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--dark-page);
  color: var(--text);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
}

.page-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.28;
}

.orb-blue {
  width: 360px;
  height: 360px;
  background: var(--blue);
  top: -80px;
  right: -60px;
}

.orb-red {
  width: 280px;
  height: 280px;
  background: var(--red);
  bottom: 15%;
  left: -80px;
}

.lb-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(6, 9, 15, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.lb-back,
.lb-play {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lb-back:hover,
.lb-play:hover {
  color: var(--text);
}

.lb-play {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: rgba(26, 111, 196, 0.2);
  color: var(--blue-soft);
}

.lb-title {
  margin: 0;
  text-align: center;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.lb-main {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 16px 24px;
}

.lb-segments {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--dark-card);
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  margin-bottom: 12px;
}

.lb-segment {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: default;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.lb-segment-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.lb-segment.is-active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  font-weight: 600;
}

.lb-segment-link {
  cursor: pointer;
}

.lb-segment-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.lb-meta {
  margin: 0 0 12px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: center;
}

.lb-state {
  text-align: center;
  padding: 48px 16px;
  color: var(--text-muted);
}

.lb-spinner {
  width: 36px;
  height: 36px;
  margin: 0 auto 12px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.lb-retry {
  margin-top: 12px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--blue);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.lb-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lb-row {
  display: grid;
  grid-template-columns: 44px 40px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--dark-card);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.lb-rank {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-muted);
  text-align: left;
}

.lb-rank--1 { color: var(--gold); }
.lb-rank--2 { color: var(--silver); }
.lb-rank--3 { color: var(--bronze); }

.lb-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  overflow: hidden;
  position: relative;
}

.lb-avatar--photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lb-avatar-initial {
  position: relative;
  z-index: 0;
}

.lb-user {
  min-width: 0;
}

.lb-username {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-country {
  margin: 2px 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-points {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--blue-soft);
  white-space: nowrap;
}

.lb-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 20px 16px 28px;
  border-top: 1px solid var(--border);
  background: rgba(6, 9, 15, 0.85);
}

.lb-footer p {
  margin: 0 0 12px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.lb-cta {
  display: inline-block;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  background: var(--blue);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
}

.lb-cta:hover {
  background: #155a9e;
}

@media (min-width: 480px) {
  .lb-segment {
    font-size: 0.875rem;
    padding: 10px 12px;
  }

  .lb-row {
    padding: 14px 16px;
  }
}
