/* ==========================================================================
   WARDOGS TACTICAL MONITOR - DESIGN SYSTEM & STYLESHEET
   ========================================================================== */

:root {
  /* Direction 1 : Cyber-Military Tactical HUD Palette */
  --bg-darkest: #070a0e;
  --bg-card: #0a0f16;
  --bg-card-hover: #0e1520;
  --bg-surface: #0b111a;
  --bg-surface-elevated: #111a27;
  --bg-input: #05080c;

  /* Lines & Tactical Radar Borders */
  --border-subtle: rgba(0, 240, 118, 0.12);
  --border-card: #1b2b3d;
  --border-card-hover: rgba(0, 240, 118, 0.45);
  --border-accent: #00f076;

  /* Typography Colors */
  --text-primary: #f0f4fc;
  --text-muted: #8fa0c0;
  --text-faint: #4d5d7e;
  --text-accent: #00f076;
  --text-highlight: #5eead4;

  /* Tactical Status & Factions */
  --color-online: #00f076;
  --color-online-glow: rgba(0, 240, 118, 0.4);
  --color-offline: #f43f5e;
  --color-valkyra: #ef4444;
  --color-manticore: #22c55e;
  --color-lonestar: #3b82f6;

  /* Fonts */
  --font-display: 'Chakra Petch', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Radii & Shadows */
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 6px;
  --radius-pill: 9999px;
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.8);
  --shadow-glow: 0 0 20px rgba(0, 240, 118, 0.15);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  color-scheme: dark;
  scroll-behavior: smooth;
}

body.hud-body {
  min-height: 100vh;
  background-color: var(--bg-darkest);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.5;
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* Atmospheric Tactical Grids & Glows */
.grid-atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: 
    linear-gradient(to right, rgba(56, 189, 248, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(56, 189, 248, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(circle at 50% 30%, black 40%, transparent 85%);
  z-index: 0;
}

.glow-orb {
  position: fixed;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  opacity: 0.15;
  z-index: 0;
}

.glow-top-left {
  top: -100px;
  left: -100px;
  background: radial-gradient(circle, #0284c7, transparent 70%);
}

.glow-bottom-right {
  bottom: -100px;
  right: -100px;
  background: radial-gradient(circle, #e4423b, transparent 70%);
}

.container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   HEADER
   ========================================================================== */

.tactical-header {
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(8, 12, 21, 0.85);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 1rem 0;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.branding {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.badge-radar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: rgba(2, 132, 199, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.3);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--color-online);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--color-online);
  animation: pulse-dot 2s infinite ease-in-out;
}

.radar-sweep {
  position: absolute;
  inset: 0;
  background: conic-gradient(from 0deg, transparent 0deg, rgba(56, 189, 248, 0.3) 60deg, transparent 65deg);
  animation: radar-spin 3s linear infinite;
  border-radius: inherit;
}

@keyframes radar-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
}

.brand-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.25em;
  color: var(--text-accent);
  font-weight: 600;
  text-transform: uppercase;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.1;
  color: #fff;
}

.text-accent {
  color: var(--text-highlight);
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.4);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-icon {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  color: var(--text-muted);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  color: var(--text-primary);
  border-color: var(--text-accent);
  background: var(--bg-surface-elevated);
}

.btn-icon.muted .sound-wave,
.btn-icon.muted .sound-wave-outer {
  opacity: 0.2;
}

/* Refresh Widget */
.refresh-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-surface);
  padding: 0.35rem 0.6rem 0.35rem 0.4rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-card);
}

.refresh-countdown {
  position: relative;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.countdown-svg {
  transform: rotate(-90deg);
  width: 32px;
  height: 32px;
}

.countdown-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 3;
}

.countdown-bar {
  fill: none;
  stroke: var(--text-accent);
  stroke-width: 3;
  stroke-dasharray: 94.25; /* 2 * PI * 15 */
  stroke-dashoffset: 0;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear, stroke 0.3s;
}

.countdown-number {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-primary);
}

.btn-refresh {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s;
  padding: 0.25rem 0.4rem;
}

.btn-refresh:hover {
  color: var(--text-highlight);
}

.btn-refresh.spinning svg {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   METRICS HUD SECTION
   ========================================================================== */

.main-content {
  flex: 1;
  padding-top: 2rem;
  padding-bottom: 3rem;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  backdrop-filter: blur(12px);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-card-hover);
}

.metric-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--text-accent);
  opacity: 0.4;
}

.metric-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.metric-icon-players { background: rgba(56, 189, 248, 0.12); color: #38bdf8; }
.metric-icon-servers { background: rgba(34, 197, 94, 0.12); color: #22c55e; }
.metric-icon-factions { background: rgba(228, 66, 59, 0.12); color: #e4423b; }
.metric-icon-sync { background: rgba(168, 85, 247, 0.12); color: #c084fc; }

.metric-info {
  flex: 1;
  min-width: 0;
}

.metric-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.metric-value-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.metric-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
}

.metric-value-sm {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
}

.metric-sub {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-faint);
}

.metric-detail {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

.flex-sync-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.status-indicator-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.status-indicator-dot.online {
  background-color: var(--color-online);
  box-shadow: 0 0 8px var(--color-online);
}

.hud-progress-bar {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  margin-top: 0.6rem;
  overflow: hidden;
}

.hud-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0284c7, #38bdf8);
  border-radius: inherit;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.factions-mini-bar {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.25rem;
}

.f-pill {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  display: inline-block;
}

.f-valk { background: rgba(239, 68, 68, 0.18); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.4); }
.f-mant { background: rgba(34, 197, 94, 0.18); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.4); }
.f-lone { background: rgba(59, 130, 246, 0.18); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.4); }

/* ==========================================================================
   CONTROLS TOOLBAR (Tabs, Search, Sort)
   ========================================================================== */

.controls-toolbar {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  backdrop-filter: blur(12px);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-bottom: 2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.tabs-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
  background: rgba(2, 132, 199, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: #fff;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.1);
}

.tab-count {
  background: rgba(255, 255, 255, 0.08);
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
}

.tab-btn.active .tab-count {
  background: var(--text-accent);
  color: #000;
  font-weight: 700;
}

.search-sort-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  color: var(--text-faint);
  pointer-events: none;
}

.search-wrapper input {
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  padding: 0.5rem 2rem 0.5rem 2.2rem;
  border-radius: var(--radius-sm);
  width: 240px;
  outline: none;
  transition: all 0.2s;
}

.search-wrapper input:focus {
  border-color: var(--text-accent);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
  width: 280px;
}

.btn-clear {
  position: absolute;
  right: 0.6rem;
  background: transparent;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0.2rem;
}

.btn-clear:hover { color: var(--text-primary); }

.sort-wrapper select {
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

.sort-wrapper select:focus {
  border-color: var(--text-accent);
}

.filter-toggle-wrapper {
  display: flex;
  align-items: center;
}

.toggle-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  user-select: none;
}

.toggle-checkbox input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.toggle-switch {
  width: 34px;
  height: 18px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-pill);
  position: relative;
  transition: background 0.3s;
  border: 1px solid var(--border-card);
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.toggle-checkbox input:checked ~ .toggle-switch {
  background: var(--color-online);
  border-color: var(--color-online);
}

.toggle-checkbox input:checked ~ .toggle-switch::after {
  transform: translateX(16px);
}

/* ==========================================================================
   SERVERS GRID & CARDS
   ========================================================================== */

.servers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.25rem;
}

.server-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
  background-image: repeating-linear-gradient(0deg, rgba(0, 240, 118, 0.015) 0px, rgba(0, 240, 118, 0.015) 1px, transparent 1px, transparent 4px);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.server-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-card-hover);
  box-shadow: 0 14px 34px -10px rgba(0, 0, 0, 0.9), 0 0 16px rgba(0, 240, 118, 0.12);
}

/* Tactical Corner Accent */
.server-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-top: 2px solid var(--border-accent);
  border-right: 2px solid var(--border-accent);
  pointer-events: none;
}

/* Top Accent Line by Source */
.server-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 14px;
  height: 2px;
  background: linear-gradient(90deg, var(--border-accent), transparent);
  opacity: 0.8;
}

.server-card.source-fr::before {
  background: linear-gradient(90deg, #00f076, #00d4ff, transparent);
}

.server-card.source-com::before {
  background: linear-gradient(90deg, #f43f5e, #fbbf24, transparent);
}

.server-card.source-7e::before {
  background: linear-gradient(90deg, #00d4ff, #00f076, transparent);
}

/* Header inside Card */
.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.card-title-group {
  min-width: 0;
}

.card-source-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.4rem;
}

.source-tag-fr {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.source-tag-com {
  background: rgba(228, 66, 59, 0.12);
  color: #ff6b64;
  border: 1px solid rgba(228, 66, 59, 0.25);
}

.source-tag-7e {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.card-server-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-ingame-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.15rem;
}

.card-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.card-status-badge.online {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.card-status-badge.offline {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-dot-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
}

/* Card Body: Players & Segmented LED Gauge */
.card-occupancy {
  background: #05080c;
  border: 1px solid var(--border-card);
  padding: 0.85rem;
  border-radius: var(--radius-sm);
}

.occupancy-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.occupancy-numbers {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}

.occupancy-current {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.occupancy-max {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-faint);
}

.occupancy-status-text {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.occupancy-status-text.empty { color: var(--text-faint); }
.occupancy-status-text.low { color: #00d4ff; }
.occupancy-status-text.medium { color: #fbbf24; }
.occupancy-status-text.full { color: #f43f5e; }

/* 10-Segment Tactical Gauge */
.occupancy-segments {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 3px;
  height: 6px;
}

.occupancy-segment {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 1px;
  transition: background 0.3s ease;
}

.occupancy-segment.active-empty { background: rgba(255, 255, 255, 0.2); }
.occupancy-segment.active-low { background: #00d4ff; box-shadow: 0 0 6px rgba(0, 212, 255, 0.4); }
.occupancy-segment.active-medium { background: #fbbf24; box-shadow: 0 0 6px rgba(251, 191, 36, 0.4); }
.occupancy-segment.active-full { background: #00f076; box-shadow: 0 0 6px rgba(0, 240, 118, 0.4); }
.occupancy-segment.active-critical { background: #f43f5e; box-shadow: 0 0 6px rgba(244, 63, 94, 0.5); }

/* Card Meta (Map & Mode) */
.card-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  font-size: 0.8rem;
}

.meta-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  min-width: 0;
  background: #0e1622;
  padding: 0.5rem 0.65rem;
  border-left: 2px solid var(--border-card);
}

.server-card.source-fr .meta-item:first-child { border-left-color: var(--color-online); }
.server-card.source-com .meta-item:first-child { border-left-color: #f43f5e; }
.server-card.source-7e .meta-item:first-child { border-left-color: #00d4ff; }
.meta-item:last-child { border-left-color: #fbbf24; }

.meta-icon {
  color: var(--text-faint);
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.meta-info {
  min-width: 0;
}

.meta-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.1rem;
}

.meta-value {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Factions Card Breakdown */
.card-factions {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.03);
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.faction-row {
  display: grid;
  grid-template-columns: 70px 1fr 28px;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

.faction-name { font-weight: 600; }
.faction-name.valkyra { color: var(--color-valkyra); }
.faction-name.manticore { color: var(--color-manticore); }
.faction-name.lonestar { color: var(--color-lonestar); }

.faction-bar-track {
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.faction-bar-fill {
  height: 100%;
  border-radius: inherit;
  transition: width 0.4s ease;
}

.faction-bar-fill.valkyra { background: var(--color-valkyra); }
.faction-bar-fill.manticore { background: var(--color-manticore); }
.faction-bar-fill.lonestar { background: var(--color-lonestar); }

.faction-count {
  text-align: right;
  color: var(--text-muted);
}

/* Card Actions (Copy ID, Stats Link) */
.card-actions {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-copy-id {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  background: rgba(0, 240, 118, 0.08);
  border: 1px solid rgba(0, 240, 118, 0.35);
  color: var(--color-online);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: all 0.2s ease;
}

.btn-copy-id:hover {
  background: var(--color-online);
  color: #05080c;
  box-shadow: 0 0 16px rgba(0, 240, 118, 0.45);
}

.btn-copy-id.copied {
  background: var(--color-online);
  border-color: var(--color-online);
  color: #05080c;
  box-shadow: 0 0 16px rgba(0, 240, 118, 0.6);
}

.btn-stats-link {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-card);
  background: var(--bg-surface);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-stats-link:hover {
  color: var(--text-primary);
  border-color: var(--text-accent);
  background: var(--bg-surface-elevated);
}

/* ==========================================================================
   LOADING & EMPTY STATES
   ========================================================================== */

.loading-state,
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.radar-spinner {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid rgba(56, 189, 248, 0.15);
  border-top-color: var(--text-highlight);
  margin: 0 auto 1.25rem;
  animation: spin 0.8s linear infinite;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.2);
}

.loading-state p {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.empty-state h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: #fff;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.btn-action {
  background: rgba(2, 132, 199, 0.2);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: var(--text-highlight);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-action:hover {
  background: var(--text-accent);
  color: #000;
}

/* ==========================================================================
   TOAST NOTIFICATION
   ========================================================================== */

.tactical-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: rgba(14, 21, 38, 0.95);
  border: 1px solid var(--text-accent);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 20px rgba(56, 189, 248, 0.3);
  backdrop-filter: blur(12px);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 100;
  transform: translateY(0);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tactical-toast.hidden {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

.toast-icon {
  width: 28px;
  height: 28px;
  background: var(--color-online);
  color: #000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.toast-title {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
}

.toast-message {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.tactical-footer {
  border-top: 1px solid var(--border-subtle);
  background: rgba(6, 8, 14, 0.9);
  padding: 2rem 0;
  margin-top: auto;
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.footer-left p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-left a {
  color: var(--text-accent);
  text-decoration: none;
}

.footer-left a:hover {
  text-decoration: underline;
}

.footer-left .disclaimer {
  font-size: 0.72rem;
  color: var(--text-faint);
  margin-top: 0.35rem;
}

.badge-live-pulse {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--color-online);
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.25);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
}

.badge-live-pulse .dot {
  width: 7px;
  height: 7px;
  background: currentColor;
  border-radius: 50%;
  box-shadow: 0 0 8px currentColor;
  animation: pulse-dot 1.5s infinite;
}

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

@media (max-width: 900px) {
  .controls-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .tabs-group {
    width: 100%;
    justify-content: flex-start;
  }

  .search-sort-group {
    width: 100%;
    justify-content: space-between;
  }

  .search-wrapper {
    flex: 1;
  }

  .search-wrapper input {
    width: 100%;
  }

  .search-wrapper input:focus {
    width: 100%;
  }
}

@media (max-width: 600px) {
  .header-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .servers-grid {
    grid-template-columns: 1fr;
  }

  .tactical-toast {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
  }
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
