/* Rusty Kings Stats Mobile V15
   Frontend-only polish for the embedded stats UI. No API/database changes. */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.rust-stats {
  isolation: isolate;
}

.kpis,
.tabs,
.toolbar,
.tab-panel,
.dataTables_wrapper,
.rk-dialog,
.rk-body,
.rk-grid {
  min-width: 0;
  max-width: 100%;
}

.tab-panel {
  position: relative;
  border: 1px solid rgba(255,255,255,.05);
  background: rgba(0,0,0,.08);
}

.tab-panel.active {
  display: block;
}

.tab-panel::before {
  content: "Swipe sideways to see more columns";
  display: none;
  position: sticky;
  left: 0;
  top: 0;
  z-index: 3;
  width: max-content;
  margin: 8px 8px 0;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(239,27,34,.16);
  border: 1px solid rgba(239,27,34,.28);
  color: var(--muted, #c8cad1);
  font-size: 11px;
  font-weight: 700;
  pointer-events: none;
}

.rust-stats-table th,
.rust-stats-table td {
  white-space: nowrap;
}

.dataTables_wrapper .dataTables_processing {
  position: fixed !important;
  left: 50% !important;
  top: 50% !important;
  width: min(320px, calc(100vw - 40px)) !important;
  margin: 0 !important;
  transform: translate(-50%, -50%);
  padding: 16px !important;
  border-radius: 16px;
  border: 1px solid var(--border-color, rgba(255,255,255,.12));
  background: var(--panel-bg, #111217) !important;
  color: var(--input-color, #fff) !important;
  box-shadow: 0 18px 60px rgba(0,0,0,.45);
  z-index: 50;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
  clear: both;
  width: 100%;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  min-height: 36px;
  border-radius: 999px !important;
}

.player-link {
  text-decoration: none;
}

.player-link:hover {
  text-decoration: underline;
}

.rust-stats-avatar {
  background: rgba(255,255,255,.06);
}

.rk-modal.open {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.rk-head,
.rk-actions,
.rk-row {
  min-width: 0;
}

.rk-title,
.rk-row .v,
.rk-row .l {
  overflow-wrap: anywhere;
}

@media (max-width: 720px) {
  .tab-panel::before {
    display: inline-block;
  }

  .tabs {
    margin-inline: -2px;
    padding-inline: 2px;
  }

  .tab {
    min-height: 38px;
  }

  .searchbox input {
    border-radius: 14px !important;
  }

  .dataTables_wrapper .dataTables_paginate {
    justify-content: center;
  }

  .dataTables_wrapper .dataTables_paginate span {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
  }

  .dataTables_wrapper .dataTables_paginate .paginate_button {
    min-width: 38px;
    text-align: center;
  }

  .rk-dialog {
    box-shadow: 0 -18px 70px rgba(0,0,0,.48);
  }
}

@media (max-width: 420px) {
  .kpis {
    grid-template-columns: 1fr 1fr !important;
  }

  .kpi-value {
    line-height: 1.18;
  }

  .player-link {
    max-width: 175px;
  }

  .dataTables_wrapper .dataTables_paginate {
    font-size: 12px;
  }
}
