/* ==========================================================================
   PDIKM Leaderboard — gaming adventure ranking table (shared)
   ========================================================================== */

.lb-panel {
  position: relative;
  background: rgba(8, 12, 22, 0.88);
  border: 1px solid rgba(255, 202, 40, 0.18);
  border-radius: 20px;
  padding: 18px 16px 16px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  box-sizing: border-box;
}

.lb-panel::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
}

.lb-panel__header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
  font-family: var(--pdikm-font-display);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #ffca28;
  position: relative;
}

.lb-panel__title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.lb-panel__toggle {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid rgba(255, 202, 40, 0.35);
  border-radius: 8px;
  background: rgba(255, 202, 40, 0.12);
  color: #ffca28;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.lb-panel__toggle:hover {
  background: rgba(255, 202, 40, 0.22);
}

.lb-panel__header svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.lb-tabs {
  display: flex;
  gap: 6px;
  padding: 5px;
  margin-bottom: 14px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.lb-tab {
  flex: 1;
  padding: 8px 6px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  text-align: center;
}

.lb-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.lb-tab.is-active {
  color: #1a1200;
  background: linear-gradient(135deg, #ffca28, #ffe082);
  box-shadow: 0 4px 14px rgba(255, 202, 40, 0.35);
}

.lb-table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.22);
}

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

.lb-table thead th {
  padding: 10px 10px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 202, 40, 0.08);
  border-bottom: 1px solid rgba(255, 202, 40, 0.15);
  white-space: nowrap;
}

.lb-table tbody tr {
  transition: background 0.18s ease;
}

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

.lb-table td {
  padding: 10px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.88);
  vertical-align: middle;
}

.lb-table tbody tr:last-child td {
  border-bottom: none;
}

.lb-rank {
  width: 42px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.55);
}

.lb-rank--gold {
  color: #ffd54f;
  font-size: 1rem;
}

.lb-player {
  font-weight: 700;
  letter-spacing: 0.01em;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-points,
.lb-time {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  white-space: nowrap;
}

.lb-points {
  color: #5dffb8;
}

.lb-time {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.72rem;
  font-weight: 600;
}

.lb-row--top1 {
  background: linear-gradient(90deg, rgba(255, 202, 40, 0.12), transparent);
}

.lb-row--top2 {
  background: linear-gradient(90deg, rgba(192, 192, 192, 0.08), transparent);
}

.lb-row--top3 {
  background: linear-gradient(90deg, rgba(205, 127, 50, 0.08), transparent);
}

.lb-empty {
  text-align: center;
  padding: 28px 16px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.84rem;
}

.lb-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.lb-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.lb-page-btn:hover:not(.is-disabled):not(.is-active) {
  color: #fff;
  border-color: rgba(255, 202, 40, 0.35);
  background: rgba(255, 202, 40, 0.08);
}

.lb-page-btn.is-active {
  color: #1a1200;
  background: linear-gradient(135deg, #ffca28, #ffe082);
  border-color: transparent;
}

.lb-page-btn.is-disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.lb-page-info {
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.45);
  padding: 0 4px;
}

.lb-actions {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}

.lb-actions .btn-eticket {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(201, 160, 32, 0.45);
  background: linear-gradient(180deg, #ffd54f 0%, #ffca28 100%);
  color: #3e2723;
  font-family: var(--pdikm-font-display);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 6px 0 #c9a020;
  box-sizing: border-box;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.lb-actions .btn-eticket:active {
  transform: scale(0.97);
  box-shadow: 0 3px 0 #c9a020;
}

/* Full page */
.pdikm-page--leaderboard {
  padding-bottom: 40px;
}

.pdikm-page--leaderboard .lb-panel--page {
  animation: lbFadeUp 0.55s 0.08s ease-out both;
}

.pdikm-page--leaderboard .lb-table-wrap {
  max-height: none;
}

/* Landing desktop sidebar — ~25% lebih kecil + minimize */
.leaderboard-wrapper.lb-panel {
  position: fixed;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  width: min(270px, 22.5vw);
  padding: 12px 11px 11px;
  border-radius: 16px;
  z-index: 20;
  animation: lbPanelIn 0.7s 0.2s ease-out both;
}

.leaderboard-wrapper.lb-panel .lb-panel__header {
  margin-bottom: 8px;
  font-size: 0.72rem;
  padding-right: 28px;
}

.leaderboard-wrapper.lb-panel .lb-panel__header svg {
  width: 14px;
  height: 14px;
}

.leaderboard-wrapper.lb-panel .lb-tabs {
  gap: 4px;
  padding: 3px;
  margin-bottom: 8px;
  border-radius: 10px;
}

.leaderboard-wrapper.lb-panel .lb-tab {
  padding: 5px 4px;
  font-size: 0.58rem;
  border-radius: 7px;
}

.leaderboard-wrapper.lb-panel .lb-table {
  font-size: 0.68rem;
}

.leaderboard-wrapper.lb-panel .lb-table thead th,
.leaderboard-wrapper.lb-panel .lb-table td {
  padding: 6px 6px;
}

.leaderboard-wrapper.lb-panel .lb-player {
  max-width: 92px;
}

.leaderboard-wrapper.lb-panel .lb-table-wrap {
  max-height: 240px;
  overflow-y: auto;
}

.leaderboard-wrapper.lb-panel .lb-actions {
  margin-top: 8px;
}

.leaderboard-wrapper.lb-panel .lb-actions .btn-eticket {
  font-size: 0.68rem;
  padding: 6px 10px;
}

.leaderboard-wrapper.lb-panel.is-minimized {
  width: auto;
  min-width: 0;
  padding: 8px 10px;
}

.leaderboard-wrapper.lb-panel.is-minimized .lb-tabs,
.leaderboard-wrapper.lb-panel.is-minimized .lb-table-wrap,
.leaderboard-wrapper.lb-panel.is-minimized .lb-actions,
.leaderboard-wrapper.lb-panel.is-minimized [data-lb-pagination] {
  display: none !important;
}

.leaderboard-wrapper.lb-panel.is-minimized .lb-panel__header {
  margin-bottom: 0;
  padding-right: 30px;
  justify-content: flex-start;
}

.leaderboard-wrapper.lb-panel .lb-table-wrap::-webkit-scrollbar {
  width: 4px;
}

.leaderboard-wrapper.lb-panel .lb-table-wrap::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

/* Swal modal */
.lb-swal-popup {
  border: 1px solid rgba(255, 202, 40, 0.2) !important;
  border-radius: 20px !important;
}

.lb-swal-popup .lb-panel {
  padding: 0;
  border: none;
  box-shadow: none;
  background: transparent;
}

.lb-swal-popup .lb-table-wrap {
  max-height: 360px;
  overflow-y: auto;
}

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

@keyframes lbPanelIn {
  from {
    opacity: 0;
    transform: translateY(-50%) translateX(24px);
  }
  to {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
}

@media (max-width: 991px) {
  .leaderboard-wrapper.lb-panel {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .lb-table {
    font-size: 0.72rem;
  }

  .lb-table thead th,
  .lb-table td {
    padding: 8px 6px;
  }

  .lb-player {
    max-width: 100px;
  }
}
