/* RBS Forum R10 - repair two R7-R9 regressions.
   Presentation only. Keeps Bootstrap callbacks, data fields, admin operations and AJAX. */

/* The original UniGame rule `.block .block_head span` forced gray, thin headings.
   Target only the main stats heading, not numbers or other section titles. */
body.rbs-modern .block.rbs-stats-page > .block_head.rbs-stats-page__head > span {
  color: #f5f7ff !important;
  font-size: 21px !important;
  font-weight: 800 !important;
  margin-left: 0 !important;
  letter-spacing: -.015em;
  line-height: 1.32;
  text-shadow: 0 1px 12px rgba(0, 0, 0, .22);
}
body.rbs-modern .block.rbs-stats-page > .block_head.rbs-stats-page__head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 0;
  margin-bottom: 19px;
  color: #f5f7ff;
}
body.rbs-modern .block.rbs-stats-page > .block_head.rbs-stats-page__head > i {
  margin-top: 0;
  color: #d875ff;
  font-size: 20px;
}

/* The R8 blanket rule on direct body children and the R9 modal declaration
   wrongly changed Bootstrap `position:fixed` to `relative`.
   Restore viewport positioning and correct stacking independently of the animation. */
body.rbs-modern .modal,
body.rbs-modern > .modal {
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 1070 !important;
  overflow-x: hidden;
  overflow-y: auto;
}
body.rbs-modern > .modal-backdrop {
  position: fixed !important;
  inset: 0 !important;
  z-index: 1060 !important;
  background: #050711 !important;
}
/* Explicitly restore Bootstrap fade states; R9's all-state opacity:1 caused
   overlays to appear even during transitions. */
body.rbs-modern > .modal-backdrop.fade:not(.show):not(.in) {
  opacity: 0 !important;
}
body.rbs-modern > .modal-backdrop.show,
body.rbs-modern > .modal-backdrop.in {
  opacity: .67 !important;
}
/* jQuery Confirm popups must not be made position:relative by R8's blanket rule. */
body.rbs-modern > .jconfirm { position: fixed !important; z-index: 1080 !important; }

/* Following the portal fix these selectors protect dimensions at desktop and mobile. */
body.rbs-modern .rbs-stats-modal .modal-dialog.modal-lg {
  width: min(1100px, calc(100vw - 36px)) !important;
  max-width: calc(100vw - 36px) !important;
  margin: 22px auto !important;
  box-sizing: border-box;
}
body.rbs-modern .rbs-stats-modal .modal-content {
  width: 100%;
  max-height: calc(100dvh - 44px);
}
body.rbs-modern .rbs-stats-modal .modal-header {
  flex-shrink: 0;
}
body.rbs-modern .rbs-stats-modal .modal-body {
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
}
body.rbs-modern .rbs-stats-modal .modal-body > .row,
body.rbs-modern .rbs-stats-modal .modal-body > .row > [class*="col-"] {
  min-width: 0;
}
body.rbs-modern .rbs-stats-modal .rbs-stat-subtitle {
  overflow-wrap: anywhere;
  max-width: 100%;
}

/* On medium desktop widths retain skill label space, and allow scrolling only
   when truly necessary. Never let the last cell disappear behind a clip. */
@media (min-width: 992px) {
  body.rbs-modern .rbs-stats-main-table { min-width: 0; table-layout: auto; }
  body.rbs-modern .rbs-stats-main-table > thead > tr > td,
  body.rbs-modern .rbs-stats-main-table > tbody > tr.rbs-stat-row > td {
    padding-left: clamp(9px, 1vw, 15px);
    padding-right: clamp(9px, 1vw, 15px);
  }
  body.rbs-modern .rbs-stats-main-table > tbody > tr.rbs-stat-row > td.rbs-stat-cell--nick {
    min-width: 0;
    width: 26%;
    overflow-wrap: anywhere;
  }
  body.rbs-modern #stats .rbs-skill-badge { font-size: 12px; }
}
@media (max-width: 767.98px) {
  body.rbs-modern .block.rbs-stats-page > .block_head.rbs-stats-page__head > span {
    font-size: 18px !important;
  }
  body.rbs-modern .rbs-stats-modal .modal-dialog.modal-lg {
    width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    margin: 10px auto !important;
  }
  body.rbs-modern .rbs-stats-modal .modal-content {
    max-height: calc(100dvh - 20px);
  }
  body.rbs-modern .rbs-stats-modal .modal-body { padding: 12px; }
}

/* Once the dialog is portaled under body it no longer descends from #stats.
   Preserve R4's progress visualization for all four percentage indicators. */
body.rbs-modern .rbs-stats-modal .progress {
  position: relative;
  display: block;
  margin: 4px 0 !important;
  min-width: 90px;
  height: 20px;
  border-radius: 10px;
  overflow: hidden;
  background: #344458;
}
body.rbs-modern .rbs-stats-modal .progress .progress-bar {
  min-width: 0;
  height: 100%;
  border-radius: 10px;
  background: linear-gradient(90deg, #168da2, #22b7ca);
}
body.rbs-modern .rbs-stats-modal .progress > span {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  color: #f1faff;
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  text-shadow: 0 1px 2px rgba(0,0,0,.75);
}
