/* FS Leaderboard - Rainbow friendly helpers */

.lb-sort {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 1.25rem !important;
  white-space: nowrap;
}

.lb-sort::after {
  content: "↕";
  position: absolute;
  right: .4rem;
  opacity: .35;
  font-size: .8em;
  transform: translateY(1px);
}

.lb-sorted-asc::after {
  content: "▲";
  opacity: .9;
}

.lb-sorted-desc::after {
  content: "▼";
  opacity: .9;
}

.lb-name-link {
  font-weight: 700;
  text-decoration: none;
}

.lb-name-link:hover {
  text-decoration: underline;
}

.lb-kpi {
  display: inline-flex;
  gap: .5rem;
  flex-wrap: wrap;
  align-items: center;
}

.lb-kpi .badge {
  font-weight: 700;
}

.lb-legend .list-group-item {
  background: transparent;
}

.lb-modal-table th, .lb-modal-table td {
  vertical-align: middle;
}

/* Make the custom list-table fit nicely inside the Rainbow container */
.lb-tablewrap {
  overflow-x: auto;
}

/* Avoid space-between pushing columns off-screen on narrow containers */
.table--custom.lb-table li {
  justify-content: flex-start;
}

.table--custom.lb-table .col {
  min-width: 0;
}

/* Column sizing (works because rows are flex items) */
.table--custom.lb-table .lb-col-rank {
  flex: 0 0 70px;
  max-width: 70px;
}

.table--custom.lb-table .lb-col-name {
  flex: 0 0 170px;
  max-width: 170px;
  min-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table--custom.lb-table .lb-col-status {
  flex: 0 0 120px;
  max-width: 120px;
}

.table--custom.lb-table .lb-col-num {
  flex: 0 0 120px;
  max-width: 120px;
}

.table--custom.lb-table .lb-col-num-sm {
  flex: 0 0 90px;
  max-width: 90px;
}

@media (max-width: 992px) {
  .table--custom.lb-table .lb-col-name { flex-basis: 180px; max-width: 180px; }
  .table--custom.lb-table .lb-col-num { flex-basis: 110px; max-width: 110px; }
}

@media (max-width: 768px) {
  .table--custom.lb-table .lb-col-name { flex-basis: 160px; max-width: 160px; min-width: 120px; }
  .table--custom.lb-table .lb-col-status { flex-basis: 110px; max-width: 110px; }
  .table--custom.lb-table .lb-col-num { flex-basis: 105px; max-width: 105px; }
}


/* Server tabs in one line */
.lb-tabs {
  flex-wrap: nowrap !important;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: .25rem;
}
.lb-tabs::-webkit-scrollbar { height: 6px; }
.lb-tabs::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 10px; }


/* Force full width rows (theme sometimes uses inline sizing) */
.lb-tablewrap { width: 100%; }
.table--custom.lb-table { width: 100%; }
.table--custom.lb-table .table__header,
.table--custom.lb-table .table__row { width: 100%; }
.table--custom.lb-table .col { min-width: 0; }


/* Make rows span full container width (theme table--custom can shrink to content) */
.table--custom.lb-table,
.table--custom.lb-table .table-header,
.table--custom.lb-table li {
  width: 100%;
}

/* v521 overrides */
/* Force full width for Rainbow custom list table */
.table--custom.lb-table {
  width: 100% !important;
  min-width: 100% !important;
}
.table--custom.lb-table li {
  width: 100% !important;
}
.table--custom.lb-table .lb-col-points {
  flex: 1 1 auto !important;
  max-width: none !important;
  min-width: 120px;
}
/* Slightly smaller name column (requested) */
.table--custom.lb-table .lb-col-name {
  flex-basis: 160px;
  max-width: 160px;
}
@media (max-width: 992px) {
  .table--custom.lb-table .lb-col-name { flex-basis: 150px; max-width: 150px; }
}


/* v527: better column widths (name wider, zombies wider, no giant empty points column) */
.table--custom.lb-table .lb-col-name{
  flex: 0 0 240px !important;
  max-width: 240px !important;
  min-width: 180px !important;
}
.table--custom.lb-table .lb-col-num{
  flex: 1 1 135px !important;
  max-width: none !important;
  min-width: 120px !important;
}
.table--custom.lb-table .lb-col-zombies{
  flex-basis: 150px !important;
  min-width: 150px !important;
}
.table--custom.lb-table .lb-col-points{
  flex: 0 0 140px !important;
  max-width: 160px !important;
  min-width: 120px !important;
}

/* v527: legend as clean grid cards */
.lb-legend-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.lb-legend-item{
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  padding: 10px 12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.lb-legend-item .lb-legend-label{opacity:.9}
.lb-legend-item .lb-legend-points{font-weight:800}
.lb-legend-section-title{
  font-weight: 800;
  margin-bottom: 10px;
}
