/* Leaderboards – NexGames */

.lb-page {
  max-width: 920px;
  margin: 0 auto;
  padding: 2rem 1rem 3.5rem;
}

.lb-hero {
  text-align: center;
  margin-bottom: 1.75rem;
}

.lb-back {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: #93c5fd;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 0.85rem;
  transition: color 0.15s ease;
}

.lb-back:hover {
  color: #bfdbfe;
}

.lb-hero h1 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.85rem, 4vw, 2.55rem);
  font-weight: 800;
  line-height: 1.15;
}

.lb-hero h1 span {
  background: linear-gradient(120deg, #fbbf24, #f59e0b, #38bdf8, #e2e8f0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lb-hero p {
  margin: 0 auto;
  max-width: 32rem;
  color: #94a3b8;
  font-size: 0.98rem;
  line-height: 1.55;
}

/* Tabs – scroll on small screens */
.lb-tabs-wrap {
  margin: 0 auto 1.25rem;
  max-width: 100%;
  padding: 0.2rem 0;
  -webkit-overflow-scrolling: touch;
  mask-image: linear-gradient(to right, transparent, #000 12px, #000 calc(100% - 12px), transparent);
}

.lb-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  justify-content: center;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  scrollbar-width: thin;
}

.lb-tab {
  flex: 0 0 auto;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(15, 23, 42, 0.88);
  color: #cbd5e1;
  border-radius: 12px;
  padding: 0.55rem 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, color 0.15s;
}

.lb-tab:hover {
  border-color: rgba(125, 211, 252, 0.55);
  background: rgba(30, 41, 59, 0.95);
}

.lb-tab:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

.lb-tab.active {
  color: #0c4a6e;
  background: linear-gradient(135deg, #7dd3fc, #38bdf8);
  border-color: transparent;
  box-shadow: 0 6px 24px rgba(56, 189, 248, 0.35);
}

.lb-shell {
  border-radius: 20px;
  border: 1px solid rgba(139, 92, 246, 0.28);
  background: linear-gradient(165deg, rgba(15, 23, 42, 0.97) 0%, rgba(15, 23, 42, 0.92) 50%, rgba(15, 23, 42, 0.88) 100%);
  box-shadow:
    0 4px 6px rgba(2, 6, 23, 0.4),
    0 24px 48px rgba(2, 6, 23, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  padding: 1.25rem 1.35rem 1.4rem;
}

.lb-shell[aria-busy="true"] {
  opacity: 0.92;
  pointer-events: none;
}

.lb-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.lb-card-head h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  color: #f1f5f9;
  letter-spacing: -0.02em;
}

.lb-card-head-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

.lb-play-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #a5b4fc;
  text-decoration: none;
  transition: color 0.15s;
}

.lb-play-link:hover {
  color: #c4b5fd;
}

.lb-refresh {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(2, 6, 23, 0.55);
  color: #e2e8f0;
  border-radius: 12px;
  padding: 0.5rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.lb-refresh:hover:not(:disabled) {
  border-color: rgba(125, 211, 252, 0.6);
  background: rgba(30, 41, 59, 0.8);
}

.lb-refresh:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.lb-refresh.lb-spinning i {
  animation: lb-spin 0.7s linear infinite;
}

@keyframes lb-spin {
  to { transform: rotate(360deg); }
}

.lb-status {
  min-height: 1.35em;
  margin: 0 0 1rem;
  font-size: 0.84rem;
  color: #7dd3fc;
}

.lb-status.lb-status-error {
  color: #fca5a5;
}

/* Podium */
.lb-podium {
  display: none;
  justify-content: center;
  align-items: flex-end;
  gap: 0.65rem;
  margin-bottom: 1.35rem;
  padding: 0.5rem 0;
}

.lb-podium.lb-podium--visible {
  display: flex;
  flex-wrap: wrap;
}

.lb-podium-slot {
  flex: 1 1 140px;
  max-width: 200px;
  min-width: 120px;
  border-radius: 16px;
  padding: 1rem 0.85rem 1.1rem;
  text-align: center;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(2, 6, 23, 0.65);
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.lb-podium-slot:hover {
  transform: translateY(-2px);
}

.lb-podium-slot--1 {
  order: 2;
  padding-top: 1.35rem;
  padding-bottom: 1.35rem;
  border-color: rgba(251, 191, 36, 0.45);
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.12), rgba(2, 6, 23, 0.75));
  box-shadow: 0 12px 40px rgba(251, 191, 36, 0.12);
}

.lb-podium-slot--2 {
  order: 1;
  align-self: flex-end;
  border-color: rgba(203, 213, 225, 0.4);
  background: linear-gradient(180deg, rgba(226, 232, 240, 0.1), rgba(2, 6, 23, 0.7));
}

.lb-podium-slot--3 {
  order: 3;
  align-self: flex-end;
  border-color: rgba(180, 83, 9, 0.35);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.1), rgba(2, 6, 23, 0.7));
}

.lb-podium-medal {
  font-size: 1.75rem;
  line-height: 1;
  margin-bottom: 0.35rem;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}

.lb-podium-rank {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #94a3b8;
  margin-bottom: 0.25rem;
}

.lb-podium-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: #f8fafc;
  word-break: break-word;
  margin-bottom: 0.35rem;
}

.lb-podium-score {
  font-size: 1.15rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #38bdf8;
}

.lb-podium-slot.lb-is-you {
  outline: 2px solid rgba(56, 189, 248, 0.65);
  outline-offset: 2px;
}

.lb-podium-slot--1 .lb-podium-score {
  color: #fbbf24;
}

/* Single / dual winner layout */
.lb-podium--count-1 .lb-podium-slot--1 {
  order: 1;
  max-width: 280px;
  margin: 0 auto;
}

.lb-podium--count-2 .lb-podium-slot--2 {
  order: 1;
}

.lb-podium--count-2 .lb-podium-slot--1 {
  order: 2;
}

.lb-podium--count-2 .lb-podium-slot--3 {
  display: none;
}

/* List section */
.lb-list-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #64748b;
  margin: 0 0 0.5rem;
}

.lb-table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(2, 6, 23, 0.35);
}

.lb-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.lb-table th,
.lb-table td {
  padding: 0.72rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.lb-table tbody tr:last-child td {
  border-bottom: 0;
}

.lb-table th {
  color: #64748b;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  background: rgba(15, 23, 42, 0.6);
}

.lb-table tbody tr {
  transition: background 0.12s ease;
}

.lb-table tbody tr:hover {
  background: rgba(56, 189, 248, 0.06);
}

.lb-rank-cell {
  width: 4.5rem;
}

.lb-rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1rem;
  height: 1.85rem;
  padding: 0 0.45rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 800;
  background: rgba(51, 65, 85, 0.65);
  color: #e2e8f0;
}

.lb-table tr.lb-row-top1 .lb-rank-badge {
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
}

.lb-table tr.lb-row-top2 .lb-rank-badge {
  background: rgba(226, 232, 240, 0.12);
  color: #e2e8f0;
}

.lb-table tr.lb-row-top3 .lb-rank-badge {
  background: rgba(245, 158, 11, 0.15);
  color: #fdba74;
}

.lb-name-cell {
  font-weight: 600;
  color: #e2e8f0;
}

.lb-score-cell {
  font-weight: 800;
  color: #7dd3fc;
}

.lb-time-cell {
  color: #94a3b8;
  font-size: 0.88rem;
}

.lb-table tr.lb-is-you {
  background: rgba(56, 189, 248, 0.1);
  box-shadow: inset 3px 0 0 #38bdf8;
}

.lb-empty-state {
  text-align: center;
  padding: 2.5rem 1.25rem;
  color: #94a3b8;
}

.lb-empty-state i {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.45;
  display: block;
}

.lb-empty-state p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

.lb-empty-state .lb-play-link {
  margin-top: 1rem;
  justify-content: center;
}

@media (max-width: 640px) {
  .lb-podium.lb-podium--visible {
    flex-direction: column;
    align-items: stretch;
  }

  .lb-podium--count-3 .lb-podium-slot--1 {
    order: 1;
  }

  .lb-podium--count-3 .lb-podium-slot--2 {
    order: 2;
  }

  .lb-podium--count-3 .lb-podium-slot--3 {
    order: 3;
  }

  .lb-podium-slot--1,
  .lb-podium-slot--2,
  .lb-podium-slot--3 {
    max-width: none;
    align-self: stretch;
  }

  .lb-podium--count-2 .lb-podium-slot--3 {
    display: none;
  }

  .lb-podium--count-2 .lb-podium-slot--1 {
    order: 1;
  }

  .lb-podium--count-2 .lb-podium-slot--2 {
    order: 2;
  }

  .lb-card-head {
    flex-direction: column;
    align-items: stretch;
  }

  .lb-card-head-meta {
    align-items: stretch;
  }

  .lb-refresh {
    justify-content: center;
  }

  .lb-time-cell {
    font-size: 0.78rem;
  }
}
