/* ============================================================
   Sudoku Masters — Leaderboard Page Styles
   ============================================================ */

/* ── Hero ──────────────────────────────────────────────── */
.lb-hero {
  padding-top: 120px;
  padding-bottom: 40px;
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(244, 183, 64, 0.08) 0%, transparent 60%),
    linear-gradient(180deg, #141210, #0F0E0C);
}

.lb-hero h1 {
  color: var(--dark-text);
  margin-bottom: 12px;
}

.lb-subtitle {
  font-size: 1.1rem;
  color: var(--dark-text-secondary);
  max-width: 500px;
  margin: 0 auto;
}

/* ── CTA Banner ────────────────────────────────────────── */
.lb-cta-banner {
  padding: 24px 0;
  text-align: center;
}

.lb-cta-banner .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.lb-cta-headline {
  color: var(--dark-text);
  font-size: 1.15rem;
  font-weight: 700;
}

.lb-cta-sub {
  color: var(--dark-text-secondary);
  font-size: 0.95rem;
  font-weight: 400;
  max-width: 480px;
  line-height: 1.5;
}

.lb-cta-flags {
  font-size: 1.4rem;
  letter-spacing: 6px;
  animation: flagScroll 12s linear infinite;
  white-space: nowrap;
  overflow: hidden;
  max-width: 320px;
  margin-bottom: 4px;
}

@keyframes flagScroll {
  0%   { transform: translateX(0); }
  50%  { transform: translateX(-10px); }
  100% { transform: translateX(0); }
}

.lb-cta-banner .store-btn {
  margin-top: 6px;
}

.store-btn-sm {
  padding: 8px 20px;
  font-size: 0.85rem;
}

.lb-cta-bottom {
  margin-top: 40px;
}

/* ── Leaderboard Content ───────────────────────────────── */
.lb-content {
  padding: 40px 0 60px;
}

/* ── Tabs ──────────────────────────────────────────────── */
.lb-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  justify-content: center;
}

.lb-tab {
  padding: 10px 24px;
  border: 1px solid rgba(244, 183, 64, 0.15);
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--dark-text-secondary);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.lb-tab:hover {
  border-color: rgba(244, 183, 64, 0.3);
  color: var(--dark-text);
}

.lb-tab.active {
  background: var(--gold);
  color: var(--dark-canvas);
  border-color: var(--gold);
  font-weight: 600;
}

/* ── Filters ───────────────────────────────────────────── */
.lb-filters {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
  gap: 12px;
}

.lb-select {
  padding: 10px 16px;
  border: 1px solid rgba(244, 183, 64, 0.2);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: var(--dark-text);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  min-width: 220px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23F4B740' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.lb-select:focus {
  outline: none;
  border-color: var(--gold);
}

.lb-select option {
  background: #1A1815;
  color: var(--dark-text);
}

/* ── Loading ───────────────────────────────────────────── */
.lb-loading {
  text-align: center;
  padding: 60px 0;
}

.lb-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(244, 183, 64, 0.15);
  border-top-color: var(--gold);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 0.8s linear infinite;
}

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

.lb-loading p {
  font-size: 0.9rem;
}

/* ── Empty / Error ─────────────────────────────────────── */
.lb-empty,
.lb-error {
  text-align: center;
  padding: 60px 0;
}

.lb-empty p,
.lb-error p {
  font-size: 1rem;
}

/* ── Rank Notice ───────────────────────────────────────── */
.lb-rank-notice {
  padding: 16px 24px;
  text-align: center;
  margin-bottom: 24px;
  font-size: 0.95rem;
  color: var(--dark-text);
}

.lb-rank-notice strong {
  color: var(--gold);
}

.lb-rank-notice a {
  color: var(--gold);
  font-weight: 600;
}

/* ── Table ─────────────────────────────────────────────── */
.lb-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.lb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.lb-table thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--dark-text-secondary);
  border-bottom: 1px solid rgba(244, 183, 64, 0.15);
}

.lb-table tbody tr {
  transition: background 0.2s;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.lb-table tbody tr:hover {
  background: rgba(244, 183, 64, 0.04);
}

.lb-table td {
  padding: 14px 16px;
  vertical-align: middle;
}

.col-rank {
  width: 60px;
  text-align: center;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  color: var(--dark-text-secondary);
}

.col-flag {
  width: 40px;
  text-align: center;
  font-size: 1.2rem;
}

.col-name {
  color: var(--dark-text);
  font-weight: 500;
}

.col-time {
  width: 120px;
}

.time-mono {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  color: var(--gold);
}

.col-share {
  width: 50px;
  text-align: center;
}

.medal {
  font-size: 1.3rem;
}

/* ── Share Button ──────────────────────────────────────── */
.share-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.2s;
  opacity: 0.5;
}

.share-btn:hover {
  background: rgba(244, 183, 64, 0.1);
  opacity: 1;
}

/* ── Highlighted Row ───────────────────────────────────── */
.lb-table tbody tr.highlighted {
  background: rgba(244, 183, 64, 0.08);
  box-shadow: inset 0 0 0 1px var(--gold), 0 0 20px rgba(244, 183, 64, 0.15);
  animation: goldPulse 2s ease-in-out 2;
  position: relative;
}

.lb-table tbody tr.highlighted td {
  position: relative;
}

.lb-table tbody tr.highlighted .col-rank {
  color: var(--gold);
}

@keyframes goldPulse {
  0%, 100% { box-shadow: inset 0 0 0 1px var(--gold), 0 0 20px rgba(244, 183, 64, 0.1); }
  50% { box-shadow: inset 0 0 0 1px var(--gold-glow), 0 0 30px rgba(244, 183, 64, 0.25); }
}

/* ── Toast ─────────────────────────────────────────────── */
.lb-toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 12px 24px;
  background: var(--gold);
  color: var(--dark-canvas);
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 100px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 200;
}

.lb-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Nav Active State ──────────────────────────────────── */
.nav-links a.active {
  color: var(--gold);
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
  .lb-hero {
    padding-top: 100px;
    padding-bottom: 24px;
  }

  .lb-tabs {
    gap: 6px;
  }

  .lb-tab {
    padding: 8px 16px;
    font-size: 0.85rem;
  }

  .lb-select {
    min-width: 180px;
    font-size: 0.85rem;
  }

  .lb-table {
    font-size: 0.85rem;
  }

  .lb-table td {
    padding: 10px 8px;
  }

  .lb-table thead th {
    padding: 10px 8px;
    font-size: 0.75rem;
  }

  .col-rank { width: 44px; }
  .col-flag { width: 32px; }
  .col-time { width: 90px; }
  .col-share { width: 40px; }

  .lb-cta-headline {
    font-size: 1rem;
  }

  .lb-cta-sub {
    font-size: 0.85rem;
  }

  .lb-cta-flags {
    font-size: 1.1rem;
    letter-spacing: 4px;
    max-width: 260px;
  }
}

@media (max-width: 480px) {
  .col-share {
    display: none;
  }
}
