/* Zamunda.Games leaderboard page v1.0.0 — page-specific styles */
:root {
  --zg-lb-bg: #0f1729;
  --zg-lb-card: rgba(30, 42, 69, 0.82);
  --zg-lb-card-strong: #1e2a45;
  --zg-lb-card-soft: rgba(15, 23, 41, 0.72);
  --zg-lb-border: rgba(255, 255, 255, 0.10);
  --zg-lb-border-strong: rgba(139, 92, 246, 0.42);
  --zg-lb-text: #f8fafc;
  --zg-lb-muted: #94a3b8;
  --zg-lb-soft: #cbd5e1;
  --zg-lb-accent: #8b5cf6;
  --zg-lb-accent-2: #22d3ee;
  --zg-lb-good: #34d399;
  --zg-lb-gold: #fbbf24;
  --zg-lb-radius: 26px;
  --zg-lb-shadow: 0 24px 70px rgba(0, 0, 0, 0.30);
}

.zg-lb-page {
  min-height: 100vh;
  padding-top: 5rem;
  color: var(--zg-lb-text);
  background:
    radial-gradient(circle at 20% 0%, rgba(124, 58, 237, 0.28), transparent 34rem),
    radial-gradient(circle at 80% 8%, rgba(34, 211, 238, 0.12), transparent 28rem),
    linear-gradient(180deg, #0f1729 0%, #101a30 48%, #0f1729 100%);
}

.zg-lb-page * {
  box-sizing: border-box;
}

.zg-lb-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.zg-lb-hero {
  padding: 48px 0 22px;
}

.zg-lb-hero-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 28px;
  align-items: center;
  min-height: 360px;
  padding: 42px;
  overflow: hidden;
  border: 1px solid var(--zg-lb-border);
  border-radius: calc(var(--zg-lb-radius) + 6px);
  background:
    linear-gradient(135deg, rgba(124, 58, 237, 0.24), rgba(34, 211, 238, 0.08) 42%, rgba(30, 42, 69, 0.88)),
    rgba(30, 42, 69, 0.82);
  box-shadow: var(--zg-lb-shadow);
}

.zg-lb-hero-card::before,
.zg-lb-hero-card::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.zg-lb-hero-card::before {
  width: 420px;
  height: 420px;
  right: -130px;
  top: -150px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.36), transparent 67%);
}

.zg-lb-hero-card::after {
  width: 220px;
  height: 220px;
  left: 42%;
  bottom: -130px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.18), transparent 67%);
}

.zg-lb-hero-copy,
.zg-lb-hero-visual {
  position: relative;
  z-index: 1;
}

.zg-lb-kicker,
.zg-lb-eyebrow,
.zg-lb-period-pill,
.zg-lb-admin-note {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid rgba(139, 92, 246, 0.32);
  background: rgba(139, 92, 246, 0.14);
  color: #ddd6fe;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .02em;
}

.zg-lb-kicker {
  padding: 8px 14px;
  margin-bottom: 22px;
}

.zg-lb-eyebrow {
  padding: 6px 11px;
  margin-bottom: 10px;
  font-size: 11px;
  text-transform: uppercase;
}

.zg-lb-period-pill,
.zg-lb-admin-note {
  padding: 7px 12px;
  white-space: nowrap;
}

.zg-lb-admin-note {
  border-color: rgba(251, 191, 36, 0.30);
  background: rgba(251, 191, 36, 0.12);
  color: #fde68a;
}

.zg-lb-hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(38px, 6vw, 74px);
  line-height: 0.95;
  font-weight: 950;
  letter-spacing: -0.055em;
}

.zg-lb-hero p {
  max-width: 760px;
  margin: 22px 0 0;
  color: var(--zg-lb-soft);
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.7;
}

.zg-lb-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.zg-lb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 14px;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, color .18s ease;
}

.zg-lb-btn:hover {
  transform: translateY(-1px);
}

.zg-lb-btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  box-shadow: 0 14px 34px rgba(124, 58, 237, 0.26);
}

.zg-lb-btn-secondary {
  color: #dbeafe;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(15, 23, 41, 0.40);
}

.zg-lb-hero-visual {
  display: grid;
  place-items: center;
  min-height: 260px;
}

.zg-lb-trophy {
  display: grid;
  place-items: center;
  width: 186px;
  height: 186px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 44px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 24px 70px rgba(0,0,0,.28);
  font-size: 92px;
}

.zg-lb-orbit {
  position: absolute;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(15, 23, 41, .72);
  box-shadow: 0 16px 40px rgba(0,0,0,.24);
  font-size: 24px;
}

.zg-lb-orbit-one { left: 20px; top: 42px; }
.zg-lb-orbit-two { right: 18px; top: 72px; }
.zg-lb-orbit-three { right: 72px; bottom: 24px; }

.zg-lb-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.zg-lb-stat-card {
  position: relative;
  min-height: 132px;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--zg-lb-border);
  border-radius: 22px;
  background: rgba(30, 42, 69, 0.72);
  box-shadow: 0 16px 44px rgba(0,0,0,.18);
}

.zg-lb-stat-card::after {
  content: "";
  position: absolute;
  right: -34px;
  top: -34px;
  width: 100px;
  height: 100px;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.14);
}

.zg-lb-stat-icon,
.zg-lb-stat-value,
.zg-lb-stat-label {
  position: relative;
  z-index: 1;
  display: block;
}

.zg-lb-stat-icon {
  margin-bottom: 12px;
  font-size: 24px;
}

.zg-lb-stat-value {
  font-size: 38px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: -0.04em;
}

.zg-lb-stat-label {
  margin-top: 8px;
  color: var(--zg-lb-muted);
  font-size: 14px;
  font-weight: 700;
}

.zg-lb-section {
  padding: 34px 0;
}

.zg-lb-section-tight {
  padding-top: 20px;
}

.zg-lb-section-bottom {
  padding-bottom: 80px;
}

.zg-lb-section-head,
.zg-lb-panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.zg-lb-section-head h2,
.zg-lb-panel-head h2,
.zg-lb-info-panel h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 950;
  letter-spacing: -0.04em;
}

.zg-lb-section-head p,
.zg-lb-panel-head p,
.zg-lb-info-panel p {
  max-width: 760px;
  margin: 8px 0 0;
  color: var(--zg-lb-muted);
  font-size: 14px;
  line-height: 1.7;
}

.zg-lb-games-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.zg-lb-game-card,
.zg-lb-panel,
.zg-lb-empty {
  border: 1px solid var(--zg-lb-border);
  background: var(--zg-lb-card);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.20);
}

.zg-lb-game-card {
  display: block;
  overflow: hidden;
  border-radius: var(--zg-lb-radius);
  color: var(--zg-lb-text);
  transition: transform .20s ease, border-color .20s ease, box-shadow .20s ease;
}

.zg-lb-game-card:hover {
  transform: translateY(-4px);
  border-color: var(--zg-lb-border-strong);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.30), 0 0 0 1px rgba(139,92,246,.16);
}

.zg-lb-game-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #111827;
}

.zg-lb-game-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .25s ease;
}

.zg-lb-game-card:hover .zg-lb-game-thumb img {
  transform: scale(1.05);
}

.zg-lb-play-badge {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(15,23,41,.82);
  color: white;
  font-size: 12px;
  font-weight: 900;
  backdrop-filter: blur(10px);
}

.zg-lb-game-body {
  padding: 16px;
}

.zg-lb-game-body h3 {
  min-height: 44px;
  margin: 0;
  color: white;
  font-size: 17px;
  line-height: 1.25;
  font-weight: 900;
}

.zg-lb-game-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  color: var(--zg-lb-soft);
  font-size: 12px;
  font-weight: 800;
}

.zg-lb-game-meta span {
  padding: 7px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,.07);
}

.zg-lb-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 22px;
  align-items: start;
}

.zg-lb-panel {
  overflow: hidden;
  border-radius: var(--zg-lb-radius);
}

.zg-lb-panel-head {
  margin: 0;
  padding: 24px;
  border-bottom: 1px solid var(--zg-lb-border);
}

.zg-lb-panel-head.compact {
  padding-bottom: 18px;
}

.zg-lb-score-list,
.zg-lb-player-list {
  display: grid;
}

.zg-lb-score-row {
  display: grid;
  grid-template-columns: 58px minmax(150px, 1fr) minmax(220px, 1.3fr) 100px 112px;
  gap: 14px;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.zg-lb-score-row:last-child,
.zg-lb-player-row:last-child {
  border-bottom: 0;
}

.zg-lb-score-row:hover,
.zg-lb-player-row:hover,
.zg-lb-top-game-row:hover {
  background: rgba(255,255,255,.04);
}

.zg-lb-rank {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 15px;
  background: rgba(255,255,255,.07);
  color: var(--zg-lb-muted);
  font-weight: 950;
}

.zg-lb-rank.is-medal {
  color: #1f2937;
  background: linear-gradient(135deg, #fde68a, #f59e0b);
}

.zg-lb-rank.small {
  width: 38px;
  height: 38px;
  border-radius: 13px;
}

.zg-lb-player-mini,
.zg-lb-score-game,
.zg-lb-player-row,
.zg-lb-top-game-row {
  display: flex;
  align-items: center;
  min-width: 0;
  color: var(--zg-lb-text);
}

.zg-lb-player-mini {
  gap: 10px;
  font-weight: 900;
}

.zg-lb-player-mini img,
.zg-lb-player-row img {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 999px;
  object-fit: cover;
  background: #0f1729;
}

.zg-lb-player-mini span,
.zg-lb-score-game span,
.zg-lb-player-info strong,
.zg-lb-top-game-info strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zg-lb-score-game {
  gap: 12px;
  font-weight: 900;
}

.zg-lb-score-game img,
.zg-lb-top-game-row img {
  width: 74px;
  height: 54px;
  flex: 0 0 auto;
  border-radius: 16px;
  object-fit: cover;
  background: #0f1729;
}

.zg-lb-score-value {
  justify-self: end;
  min-width: 70px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.13);
  color: #86efac;
  text-align: center;
  font-size: 18px;
  font-weight: 950;
}

.zg-lb-score-date {
  color: var(--zg-lb-muted);
  text-align: right;
  font-size: 13px;
  font-weight: 700;
}

.zg-lb-sidebar {
  display: grid;
  gap: 22px;
}

.zg-lb-player-row {
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.zg-lb-player-rank {
  display: grid;
  place-items: center;
  width: 38px;
  flex: 0 0 auto;
  color: var(--zg-lb-muted);
  font-weight: 950;
}

.zg-lb-player-info {
  display: grid;
  min-width: 0;
  flex: 1;
}

.zg-lb-player-info strong {
  font-size: 15px;
}

.zg-lb-player-info small,
.zg-lb-top-game-info small,
.zg-lb-best-score small {
  color: var(--zg-lb-muted);
  font-size: 12px;
  font-weight: 700;
}

.zg-lb-player-score {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.13);
  color: #86efac;
  font-weight: 950;
}

.zg-lb-info-panel {
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(124,58,237,.22), rgba(34,211,238,.08)),
    var(--zg-lb-card);
}

.zg-lb-info-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 16px;
  border-radius: 16px;
  background: rgba(255,255,255,.08);
}

.zg-lb-top-games-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.zg-lb-top-game-row {
  gap: 14px;
  padding: 18px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.zg-lb-top-game-row:nth-child(1),
.zg-lb-top-game-row:nth-child(2) {
  border-top: 0;
}

.zg-lb-top-game-row:nth-child(odd) {
  border-right: 1px solid rgba(255,255,255,.08);
}

.zg-lb-top-game-info {
  display: grid;
  min-width: 0;
  flex: 1;
}

.zg-lb-best-score {
  display: grid;
  gap: 2px;
  justify-items: end;
  color: var(--zg-lb-gold);
  font-size: 18px;
  font-weight: 950;
}

.zg-lb-best-score small {
  color: var(--zg-lb-muted);
  font-size: 11px;
  text-transform: uppercase;
}

.zg-lb-empty {
  padding: 22px;
  border-radius: 20px;
  color: var(--zg-lb-soft);
  line-height: 1.6;
}

.zg-lb-empty.small {
  margin: 18px;
  padding: 18px;
}

@media (max-width: 1100px) {
  .zg-lb-hero-card {
    grid-template-columns: 1fr;
  }
  .zg-lb-hero-visual {
    display: none;
  }
  .zg-lb-stats-grid,
  .zg-lb-games-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .zg-lb-main-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .zg-lb-page {
    padding-top: 5rem;
  }
  .zg-lb-shell {
    width: min(100% - 24px, 1180px);
  }
  .zg-lb-hero {
    padding-top: 28px;
  }
  .zg-lb-hero-card {
    min-height: auto;
    padding: 26px;
    border-radius: 24px;
  }
  .zg-lb-hero h1 {
    font-size: clamp(36px, 12vw, 52px);
  }
  .zg-lb-hero p {
    font-size: 15px;
  }
  .zg-lb-hero-actions,
  .zg-lb-btn {
    width: 100%;
  }
  .zg-lb-stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .zg-lb-stat-card {
    min-height: 112px;
    padding: 16px;
  }
  .zg-lb-stat-value {
    font-size: 30px;
  }
  .zg-lb-section-head,
  .zg-lb-panel-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .zg-lb-games-grid {
    grid-template-columns: 1fr;
  }
  .zg-lb-score-row {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    grid-template-areas:
      "rank player score"
      "rank game date";
    gap: 10px 12px;
    padding: 16px;
  }
  .zg-lb-score-row .zg-lb-rank { grid-area: rank; width: 38px; height: 38px; }
  .zg-lb-player-mini { grid-area: player; }
  .zg-lb-score-game { grid-area: game; }
  .zg-lb-score-value { grid-area: score; font-size: 16px; }
  .zg-lb-score-date { grid-area: date; justify-self: end; }
  .zg-lb-score-game img {
    width: 54px;
    height: 42px;
    border-radius: 12px;
  }
  .zg-lb-top-games-grid {
    grid-template-columns: 1fr;
  }
  .zg-lb-top-game-row:nth-child(odd) {
    border-right: 0;
  }
  .zg-lb-top-game-row:nth-child(2) {
    border-top: 1px solid rgba(255,255,255,.08);
  }
}

@media (max-width: 430px) {
  .zg-lb-stats-grid {
    grid-template-columns: 1fr;
  }
  .zg-lb-score-row {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "player score"
      "game game"
      "date date";
  }
  .zg-lb-score-row .zg-lb-rank {
    display: none;
  }
  .zg-lb-score-date {
    justify-self: start;
    text-align: left;
  }
}

/* Period switch: 30 days / All time */
.zg-lb-period-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 999px;
  background: rgba(15, 23, 41, 0.44);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}

.zg-lb-period-switch a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
  transition: color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
}

.zg-lb-period-switch a:hover {
  color: #fff;
  background: rgba(139, 92, 246, 0.16);
}

.zg-lb-period-switch a.is-active {
  color: #fff;
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  box-shadow: 0 10px 24px rgba(124, 58, 237, 0.24);
}

@media (max-width: 760px) {
  .zg-lb-period-switch,
  .zg-lb-period-switch a {
    width: 100%;
  }
  .zg-lb-period-switch a {
    flex: 1 1 0;
  }
}
