/**
 * [RS] Rogue Soldiers - BattleBit Observer
 * Page-specific styling only. Core tokens/primitives live in core.css and components.css.
 */

/* =====================================================
   PAGE / HERO TUNING
===================================================== */

.page-battlebit-observer {
  --hero-min-height: 82vh;
  --hero-image-position: center 38%;
  --hero-image-brightness: .44;
  --hero-image-saturation: .70;
  --hero-image-contrast: 1.10;
  --hero-accent-x: 24%;
  --hero-accent-y: 58%;
  --hero-accent-alpha: .18;
}

.battlebitPage { min-width: 0; }
.battlebit-observer-pulse { animation: observerPulse 2s ease-in-out infinite; }

@keyframes observerPulse {
  0%,100% { opacity: 1; box-shadow: 0 0 12px rgba(224,0,0,.72); }
  50% { opacity: .48; box-shadow: 0 0 5px rgba(224,0,0,.35); }
}

/* =====================================================
   OBSERVER CONTROL STRIP
===================================================== */

.observer-controls {
  position: relative;
  z-index: 5;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border);
  background: #090909;
}

.observer-controls-inner {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.observer-controls .statusText {
  margin: 0;
  color: rgba(255,255,255,.35);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.observerBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 0;
  color: rgba(255,255,255,.67);
  background: transparent;
  font: inherit;
  font-size: .56rem;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, color .2s ease;
}

.observerBtn:hover,
.observerBtn:focus-visible {
  color: #fff;
  border-color: var(--red-border);
  background: var(--red-soft);
}

.observerBtn:disabled { opacity: .45; cursor: wait; }
.observerBtnPrimary { border-color: var(--red); color: #fff; background: var(--red); }
.observerBtnPrimary:hover { border-color: var(--red-bright); background: var(--red-bright); }

/* =====================================================
   SECTIONS
===================================================== */

.observerSection {
  position: relative;
  padding: 110px 0;
}

.observerSectionDark { background: #090909; }

.observerSectionHeader {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(300px,.72fr);
  gap: 65px;
  align-items: end;
  margin-bottom: 48px;
}

.observerSectionHeaderCompact {
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
}

.observerSectionKicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  color: var(--red-bright);
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .24em;
  text-transform: uppercase;
}

.observerSectionKicker::before {
  content: "";
  width: 36px;
  height: 1px;
  flex: 0 0 36px;
  background: linear-gradient(to right,var(--red-bright),transparent);
}

.observerSectionTitle {
  margin: 0;
  color: #fff;
  font-size: clamp(2.5rem,5.4vw,5rem);
  line-height: .94;
  font-weight: 900;
  letter-spacing: -.05em;
  text-transform: uppercase;
}

.observerSectionCopy {
  max-width: 610px;
  margin: 0;
  color: rgba(255,255,255,.40);
  font-size: .82rem;
  line-height: 1.78;
}

/* =====================================================
   LIVE STATISTICS
===================================================== */

.liveStatGrid {
  display: grid;
  grid-template-columns: repeat(5,minmax(0,1fr));
  gap: 1px;
  border: 1px solid var(--border-soft);
  background: var(--border-soft);
}

.liveStatCard {
  min-height: 180px;
  padding: 28px;
  border: 0;
  background: #0d0d0d;
}

.liveStatIcon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 30px;
  border: 1px solid var(--red-border);
  color: var(--red-bright);
  background: var(--red-soft);
}

.liveStatCard strong {
  display: block;
  color: #fff;
  font-size: clamp(1.9rem,3vw,2.7rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.04em;
}

.liveStatCard > span {
  display: block;
  margin-top: 9px;
  color: rgba(255,255,255,.27);
  font-size: .55rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

/* =====================================================
   DETAIL CARDS
===================================================== */

.detailStatsGrid {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 12px;
  margin-bottom: 44px;
}

.isHidden { display: none !important; }

.detailCard {
  min-height: 120px;
  padding: 23px 25px;
  border: 1px solid var(--border);
  background: linear-gradient(145deg,rgba(255,255,255,.014),rgba(255,255,255,.003));
}

.detailCard span {
  display: block;
  color: rgba(255,255,255,.28);
  font-size: .55rem;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.detailCard strong {
  display: block;
  margin-top: 14px;
  color: #fff;
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.35;
}

/* =====================================================
   CHARTS / HISTORY
===================================================== */

.historySection { margin-top: 10px; }

.historyTabs {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 1px;
  margin-bottom: 14px;
  padding: 1px;
  border: 1px solid var(--border);
  background: var(--border);
}

.historyTab,
.historyTabs .nav-link {
  min-height: 48px;
  padding: 0 14px;
  border: 0;
  border-radius: 0;
  color: rgba(255,255,255,.34);
  background: #0d0d0d;
  font-size: .56rem;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.historyTab:hover,
.historyTabs .nav-link:hover { color: #fff; background: rgba(255,255,255,.025); }

.historyTab.isActive,
.historyTabs .nav-link.active {
  color: #fff;
  background: linear-gradient(120deg,rgba(189,0,0,.14),#0d0d0d 62%);
  box-shadow: inset 0 -2px 0 var(--red);
}

.chartGrid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 16px;
}

.chartCard {
  min-width: 0;
  padding: 28px;
  border: 1px solid var(--border);
  background: #0d0d0d;
}

.chartCardFeatured { padding: 32px; }

.chartCardHeader {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-soft);
}

.chartCardLabel {
  display: block;
  margin-bottom: 8px;
  color: var(--red-bright);
  font-size: .52rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.chartCard h3 {
  margin: 0;
  color: #fff;
  font-size: .95rem;
  font-weight: 800;
}

.chartCardHeaderIcon { color: rgba(224,0,0,.72); font-size: 1.05rem; }

.chartCanvasWrap { position: relative; min-height: 300px; }
.chartCanvasWrapLarge { min-height: 360px; }
.chartCanvasWrap canvas { width: 100% !important; max-width: 100%; }

/* =====================================================
   SERVER TOOLBAR
===================================================== */

.serverToolbar {
  display: grid;
  grid-template-columns: minmax(260px,1fr) auto;
  gap: 16px;
  align-items: end;
  margin-bottom: 42px;
  padding: 22px;
  border: 1px solid var(--border);
  background: #0d0d0d;
}

.serverSearchField { position: relative; }
.serverSearchIcon {
  position: absolute;
  left: 16px;
  top: 50%;
  z-index: 2;
  transform: translateY(-50%);
  color: rgba(255,255,255,.25);
  pointer-events: none;
}

.serverSearchField .rsFormControl { padding-left: 44px; }

.serverFilterGrid {
  display: grid;
  grid-template-columns: repeat(4,minmax(125px,1fr));
  gap: 10px;
}

.serverFilter label {
  display: block;
  margin-bottom: 7px;
  color: rgba(255,255,255,.25);
  font-size: .51rem;
  font-weight: 800;
  letter-spacing: .10em;
  text-transform: uppercase;
}

.rsFormControl,
.form-control.rsFormControl,
.form-select.rsFormControl {
  min-height: 45px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 0;
  color: rgba(255,255,255,.78);
  background-color: #0a0a0a;
  box-shadow: none;
  font-size: .70rem;
}

.rsFormControl:focus {
  color: #fff;
  border-color: var(--red-border);
  background-color: #0a0a0a;
  box-shadow: 0 0 0 1px rgba(189,0,0,.10);
}

.rsFormControl::placeholder { color: rgba(255,255,255,.22); }
.form-select.rsFormControl { color-scheme: dark; }

/* =====================================================
   DIRECTORY HEADER / STATUS
===================================================== */

.directoryHeader {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 25px;
  margin-bottom: 18px;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--border);
}

.directoryEyebrow {
  color: var(--red-bright);
  font-size: .52rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.directoryTitle {
  margin: 7px 0 0;
  color: #fff;
  font-size: 1.25rem;
  font-weight: 800;
}

.sectionSubtext {
  display: block;
  margin-top: 5px;
  color: rgba(255,255,255,.27);
  font-size: .61rem;
}

.serverStatusBar {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  margin-bottom: 12px;
  color: rgba(255,255,255,.32);
}

.serverStatusPulse {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: var(--red-bright);
  box-shadow: 0 0 9px rgba(224,0,0,.55);
}

.statusText { margin: 0; font-size: .63rem; }

/* =====================================================
   SERVER DIRECTORY
===================================================== */

.serverList { display: grid; gap: 8px; }

.serverCard {
  display: grid;
  grid-template-columns: minmax(0,1fr) 190px;
  gap: 24px;
  align-items: center;
  min-width: 0;
  padding: 21px 23px;
  border: 1px solid var(--border);
  background: #0d0d0d;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.serverCard:hover {
  transform: translateY(-1px);
  border-color: var(--red-border);
  background: linear-gradient(110deg,rgba(189,0,0,.035),#0d0d0d 36%);
}

.serverInfo { min-width: 0; }
.serverTitle { display: flex; align-items: center; gap: 10px; min-width: 0; }

.serverTitle h3 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: #fff;
  font-size: .84rem;
  font-weight: 800;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.serverTitle .badge {
  flex: 0 0 auto;
  padding: 5px 7px;
  border: 1px solid var(--border);
  border-radius: 0;
  color: rgba(255,255,255,.45);
  background: transparent;
  font-size: .46rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.serverTitle .badge.community { border-color: var(--red-border); color: #ff8585; background: var(--red-soft); }

.serverMeta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }

.metaTag {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 0 8px;
  border: 1px solid var(--border-soft);
  color: rgba(255,255,255,.34);
  background: rgba(255,255,255,.008);
  font-size: .52rem;
  font-weight: 700;
}

.playerBox { text-align: right; }
.playerBox strong { display: block; color: #fff; font-size: 1rem; font-weight: 800; }
.playerBox small { display: block; margin-top: 4px; color: rgba(255,255,255,.26); font-size: .54rem; }

.progressBar {
  height: 3px;
  margin-top: 12px;
  overflow: hidden;
  background: rgba(255,255,255,.07);
}

.progressBar span { display: block; height: 100%; background: var(--red-bright); }

.emptyState,
.errorState {
  padding: 32px;
  border: 1px solid var(--border);
  color: rgba(255,255,255,.37);
  background: #0d0d0d;
  font-size: .74rem;
  line-height: 1.7;
  text-align: center;
}

.errorState { border-color: var(--red-border); color: rgba(255,180,180,.72); }

/* =====================================================
   PHYSICAL GROUPS
===================================================== */

.physicalHeaderMeta { align-self: end; }
.physicalServerList { --bs-gutter-x: 12px; --bs-gutter-y: 12px; }

.physicalCard {
  min-height: 165px;
  padding: 24px;
  border: 1px solid var(--border);
  background: #0d0d0d;
}

.physicalCard h3 { margin: 0 0 18px; color: #fff; font-size: .85rem; font-weight: 800; }
.physicalCard p { margin: 7px 0 0; color: rgba(255,255,255,.32); font-size: .63rem; }
.physicalCard p strong { color: rgba(255,255,255,.72); font-weight: 800; }

.physicalNote {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 20px 0 0;
  color: rgba(255,255,255,.25);
  font-size: .60rem;
  line-height: 1.65;
}

.physicalNote i { margin-top: 2px; color: var(--red-bright); }

/* =====================================================
   FINAL INTEL STRIP
===================================================== */

.observerIntelStrip {
  position: relative;
  overflow: hidden;
  padding: 90px 0;
  border-top: 1px solid var(--border);
  background: radial-gradient(circle at 78% 50%,rgba(189,0,0,.15),transparent 32%),#090909;
}

.observerIntelStripInner {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 55px;
  align-items: center;
}

.observerIntelTitle {
  margin: 0;
  color: #fff;
  font-size: clamp(2.2rem,4vw,4.2rem);
  font-weight: 900;
  line-height: .95;
  letter-spacing: -.045em;
  text-transform: uppercase;
}

.observerIntelCopy {
  max-width: 720px;
  margin: 15px 0 0;
  color: rgba(255,255,255,.39);
  font-size: .79rem;
  line-height: 1.7;
}

.observerIntelActions { display: flex; flex-wrap: wrap; gap: 9px; }


/* =====================================================
   CHARTS
===================================================== */

.chartCard {
    position: relative;
    min-width: 0;
    padding: 26px;
    border: 1px solid var(--border);
    background:
        linear-gradient(
            145deg,
            rgba(255,255,255,.014),
            rgba(255,255,255,.003)
        );
}

.chartCard h2 {
    margin: 0 0 22px;
    color: #fff;
    font-size: .82rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.chartCard canvas {
    display: block;
    width: 100% !important;
    height: 280px !important;
}

.historySection {
    margin-top: 40px;
}

.historySection .chartCard canvas {
    height: 360px !important;
}


/* =====================================================
   HISTORY TABS
===================================================== */

.historyTabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 1px;
    padding: 0 !important;
    border: 1px solid var(--border);
    background: var(--border);
}

.historyTab {
    min-height: 48px;
    border: 0 !important;
    border-radius: 0 !important;
    color: rgba(255,255,255,.35) !important;
    background: #0d0d0d !important;
    font-size: .58rem;
    font-weight: 800;
    letter-spacing: .11em;
    text-transform: uppercase;
    transition:
        color .2s ease,
        background .2s ease;
}

.historyTab:hover {
    color: #fff !important;
    background: rgba(255,255,255,.025) !important;
}

.historyTab.active,
.historyTab.isActive {
    color: var(--red-bright) !important;
    background:
        linear-gradient(
            120deg,
            rgba(189,0,0,.12),
            #0d0d0d 65%
        ) !important;
}


/* =====================================================
   RESPONSIVE
===================================================== */

@media (max-width: 1199.98px) {
  .liveStatGrid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .serverToolbar { grid-template-columns: 1fr; }
  .serverFilterGrid { grid-template-columns: repeat(4,minmax(0,1fr)); }
}

@media (max-width: 991.98px) {
  .observerSectionHeader { grid-template-columns: minmax(0,1fr); gap: 24px; align-items: start; }
  .observerSectionHeaderCompact { grid-template-columns: minmax(0,1fr) auto; }
  .liveStatGrid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .detailStatsGrid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .chartGrid { grid-template-columns: minmax(0,1fr); }
  .serverFilterGrid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .observerIntelStripInner { grid-template-columns: minmax(0,1fr); }
}

@media (max-width: 767.98px) {
  .observerSection { padding: 82px 0; }
  .observerSectionTitle { font-size: clamp(1.75rem,8.75vw,2.7rem); }
  .observerSectionKicker { gap: 9px; font-size: .58rem; letter-spacing: .18em; }
  .observerSectionKicker::before { width: 28px; flex-basis: 28px; }

  .observer-controls-inner { min-height: 64px; align-items: stretch; flex-direction: column; justify-content: center; padding: 12px 0; }
  .observer-controls .observerBtn { width: 100%; }

  .liveStatGrid,
  .detailStatsGrid,
  .serverFilterGrid { grid-template-columns: minmax(0,1fr); }

  .liveStatCard { min-height: 145px; padding: 23px 21px; }
  .liveStatIcon { margin-bottom: 23px; }

  .historyTabs { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .chartCard,
  .chartCardFeatured { padding: 22px 18px; }
  .chartCanvasWrap { min-height: 260px; }
  .chartCanvasWrapLarge { min-height: 300px; }

  .serverToolbar { padding: 18px; }
  .directoryHeader { align-items: stretch; flex-direction: column; }
  .directoryHeader .observerBtn { width: 100%; }

  .serverCard { grid-template-columns: minmax(0,1fr); gap: 18px; padding: 19px 17px; }
  .serverTitle { align-items: flex-start; flex-direction: column; }
  .serverTitle h3 { width: 100%; overflow: visible; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; }
  .playerBox { text-align: left; }

  .observerIntelStrip { padding: 75px 0; }
  .observerIntelActions { flex-direction: column; }
  .observerIntelActions .observerBtn,
  .observerIntelActions .site-btn { width: 100%; }
}

@media (max-width: 374.98px) {
  .historyTabs { grid-template-columns: minmax(0,1fr); }
  .serverToolbar { padding: 15px; }
  .chartCard,
  .chartCardFeatured { padding: 19px 15px; }
  .metaTag { font-size: .49rem; }
}

/* =====================================================
   RESPONSIVE CHARTS
===================================================== */

@media (max-width: 991.98px) {

    .historySection .chartCard canvas {
        height: 300px !important;
    }

    .chartCard canvas {
        height: 260px !important;
    }

}

@media (max-width: 767.98px) {

    .chartCard {
        padding: 22px 18px;
    }

    .historyTabs {
        grid-template-columns: repeat(2, minmax(0,1fr));
    }

    .historySection .chartCard canvas {
        height: 250px !important;
    }

    .chartCard canvas {
        height: 230px !important;
    }

}

@media (max-width: 374.98px) {

    .chartCard {
        padding: 19px 14px;
    }

    .historySection .chartCard canvas,
    .chartCard canvas {
        height: 220px !important;
    }

}

