/* ==========================================================================
   WARFORGE 2026 - TACTICAL DARK DESIGN SYSTEM
   Palette: Obsidian (#0B0F17), Slate Cards (#131B2A), Border (#1E293B), Blue (#2563EB)
   ========================================================================== */

/* ==========================================================================
   WARFORGE 2026 - TACTICAL 5-THEME ENGINE (CRIMSON FURY DEFAULT)
   ========================================================================== */

:root, [data-theme="crimson"] {
  --wf-theme-name: 'crimson';
  --theme-accent: #9B1B30;
  --theme-accent-hover: #B3243C;
  --theme-accent-light: rgba(155, 27, 48, 0.18);
  --theme-accent-border: rgba(180, 35, 60, 0.50);
  --theme-accent-glow: rgba(155, 27, 48, 0.40);
  --theme-btn-start: #9B1B30;
  --theme-btn-end: #5A0E18;
  --theme-btn-border: #C8334E;
  --theme-btn-hover-start: #B3243C;
  --theme-btn-hover-end: #751220;
  --theme-radial-glow: rgba(138, 16, 32, 0.28);
  --theme-card-border: #421018;
  --primary: #9B1B30;
  --primary-hover: #B3243C;
  --primary-light: rgba(155, 27, 48, 0.18);
  --border-focus: #C8334E;

  --bg: #0B0F17;
  --bg-elevated: #0F172A;
  --surface: #131B2A;
  --surface-raised: #1A2438;
  --surface-focal: #1E293B;
  --border: #1E293B;
  --border-strong: rgba(255, 255, 255, 0.15);
  
  --text: #F8FAFC;
  --text-muted: #CBD5E1;
  --text-dim: #94A3B8;
}

[data-theme="cobalt"] {
  --wf-theme-name: 'cobalt';
  --theme-accent: #0284C7;
  --theme-accent-hover: #0EA5E9;
  --theme-accent-light: rgba(14, 165, 233, 0.15);
  --theme-accent-border: rgba(14, 165, 233, 0.45);
  --theme-accent-glow: rgba(14, 165, 233, 0.35);
  --theme-btn-start: #0284C7;
  --theme-btn-end: #0369A1;
  --theme-btn-border: #38BDF8;
  --theme-btn-hover-start: #0EA5E9;
  --theme-btn-hover-end: #0284C7;
  --theme-radial-glow: rgba(14, 165, 233, 0.20);
  --theme-card-border: #1A2840;
  --primary: #0284C7;
  --primary-hover: #0EA5E9;
  --primary-light: rgba(14, 165, 233, 0.15);
  --border-focus: #38BDF8;
}

[data-theme="emerald"] {
  --wf-theme-name: 'emerald';
  --theme-accent: #059669;
  --theme-accent-hover: #10B981;
  --theme-accent-light: rgba(16, 185, 129, 0.15);
  --theme-accent-border: rgba(16, 185, 129, 0.45);
  --theme-accent-glow: rgba(16, 185, 129, 0.35);
  --theme-btn-start: #059669;
  --theme-btn-end: #047857;
  --theme-btn-border: #34D399;
  --theme-btn-hover-start: #10B981;
  --theme-btn-hover-end: #059669;
  --theme-radial-glow: rgba(16, 185, 129, 0.22);
  --theme-card-border: #132E22;
  --primary: #059669;
  --primary-hover: #10B981;
  --primary-light: rgba(16, 185, 129, 0.15);
  --border-focus: #10B981;
}

[data-theme="amber"] {
  --wf-theme-name: 'amber';
  --theme-accent: #D97706;
  --theme-accent-hover: #F59E0B;
  --theme-accent-light: rgba(245, 158, 11, 0.15);
  --theme-accent-border: rgba(245, 158, 11, 0.45);
  --theme-accent-glow: rgba(245, 158, 11, 0.35);
  --theme-btn-start: #D97706;
  --theme-btn-end: #B45309;
  --theme-btn-border: #FCD34D;
  --theme-btn-hover-start: #F59E0B;
  --theme-btn-hover-end: #D97706;
  --theme-radial-glow: rgba(245, 158, 11, 0.22);
  --theme-card-border: #3D2808;
  --primary: #D97706;
  --primary-hover: #F59E0B;
  --primary-light: rgba(245, 158, 11, 0.15);
  --border-focus: #F59E0B;
}

[data-theme="amethyst"] {
  --wf-theme-name: 'amethyst';
  --theme-accent: #7C3AED;
  --theme-accent-hover: #8B5CF6;
  --theme-accent-light: rgba(139, 92, 246, 0.15);
  --theme-accent-border: rgba(139, 92, 246, 0.45);
  --theme-accent-glow: rgba(139, 92, 246, 0.35);
  --theme-btn-start: #7C3AED;
  --theme-btn-end: #6D28D9;
  --theme-btn-border: #C4B5FD;
  --theme-btn-hover-start: #8B5CF6;
  --theme-btn-hover-end: #7C3AED;
  --theme-radial-glow: rgba(139, 92, 246, 0.22);
  --theme-card-border: #2B1842;
  --primary: #7C3AED;
  --primary-hover: #8B5CF6;
  --primary-light: rgba(139, 92, 246, 0.15);
  --border-focus: #7C3AED;
}
  
  --danger: #EF4444;
  --danger-hover: #DC2626;
  --danger-light: rgba(239, 68, 68, 0.15);
  
  --success: #38BDF8;
  --warning: #F59E0B;
  --warning-light: rgba(245, 158, 11, 0.15);
  --purple: #A855F7;
  --cyan: #38BDF8;

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-cp: 'JetBrains Mono', 'Inter', monospace;
  --font-hud: 'Inter', system-ui, sans-serif;
  --font-badge: 'Inter', system-ui, sans-serif;

  /* ==========================================================================
     OFFICIAL LAST WAR: SURVIVAL COLOR PALETTE (SINGLE SOURCE OF TRUTH)
     ========================================================================== */
  /* Troop Factions (Counters: Tank > Missile > Aircraft > Tank) */
  --wf-tank: #2563EB;
  --wf-tank-bg: rgba(37, 99, 235, 0.15);
  --wf-tank-border: rgba(37, 99, 235, 0.35);

  --wf-air: #06B6D4;
  --wf-air-bg: rgba(6, 182, 212, 0.15);
  --wf-air-border: rgba(6, 182, 212, 0.35);

  --wf-missile: #F97316;
  --wf-missile-bg: rgba(249, 115, 22, 0.15);
  --wf-missile-border: rgba(249, 115, 22, 0.35);

  /* Hero Rarities */
  --wf-ur: #F59E0B;
  --wf-ur-bg: rgba(245, 158, 11, 0.15);
  --wf-ur-border: rgba(245, 158, 11, 0.35);

  --wf-ssr: #A855F7;
  --wf-ssr-bg: rgba(168, 85, 247, 0.15);
  --wf-ssr-border: rgba(168, 85, 247, 0.35);

  --wf-sr: #3B82F6;
  --wf-sr-bg: rgba(59, 130, 246, 0.15);
  --wf-sr-border: rgba(59, 130, 246, 0.35);

  /* Combat & Telemetry */
  --wf-cp: #FBBF24;
  --wf-t10: #38BDF8;
  --wf-electric-cyan: #00F5FF;

  /* ==========================================================================
     ANTIGRAVITY 2.0 AUTHORITATIVE TYPOGRAPHY SCALE (SINGLE SOURCE OF TRUTH)
     ========================================================================== */
  --text-2xs: 0.75rem;    /* 12px - Hard Floor for micro-tags/badges */
  --text-xs: 0.8125rem;   /* 13px - Compact labels, tags, subtext */
  --text-sm: 0.875rem;    /* 14px - Navigation tabs, buttons, channel list */
  --text-base: 0.9375rem; /* 15px - Core Reading Body (Antigravity 2.0 standard) */
  --text-md: 1rem;        /* 16px - Emphasized body, card titles, subheadings */
  --text-lg: 1.125rem;    /* 18px - Section headers */
  --text-xl: 1.25rem;     /* 20px - Feature headers, major KPIs */
  --text-2xl: 1.5rem;     /* 24px - Page titles */
  --text-3xl: 1.75rem;    /* 28px - High-impact display */

  /* High-Contrast Readability Colors */
  --text-bright: #FFFFFF;
  --text-high: #F8FAFC;
  --text-readable: #CBD5E1; /* Slate 300 (High-contrast alternative to dim slate-500) */
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--text-high);
  font-family: var(--font-sans);
  font-size: 15px; /* Antigravity 2.0 baseline */
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

/* ==========================================================================
   GLOBAL ANTIGRAVITY 2.0 READABILITY FLOORS (PURGE SUB-12PX MICRO-FONTS)
   ========================================================================== */
.text-\[8px\],
.text-\[9px\],
.text-\[10px\],
.text-\[11px\] {
  font-size: 0.75rem !important; /* 12px absolute minimum */
  line-height: 1.4 !important;
}

.text-xs {
  font-size: 0.8125rem !important; /* 13px standard */
  line-height: 1.5 !important;
}

.text-sm {
  font-size: 0.875rem !important; /* 14px standard */
  line-height: 1.5 !important;
}

.text-base {
  font-size: 0.9375rem !important; /* 15px core body */
  line-height: 1.65 !important;
}

.text-muted {
  color: #94A3B8; /* High-contrast slate-400 */
}


/* Typography - Precision Geometric Space Grotesk Display & Inter Body */
h1, h2, h3, h4, .font-display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.btn, .tab-pill, .badge {
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: -0.005em;
}

h1, h2, h3, h4 {
  color: var(--text-bright);
  margin: 0;
}

.font-mono { font-family: var(--font-mono); }
a { color: inherit; text-decoration: none; }

/* Global Navigation Header */
.wf-navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 15, 23, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
}

.wf-nav-left {
  display: flex;
  align-items: center;
  min-width: 220px;
  flex-shrink: 0;
}

.wf-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  color: #FFFFFF;
  text-decoration: none;
  flex-shrink: 0;
}

.wf-brand-badge {
  font-size: var(--text-2xs); /* 12px */
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 9999px;
  background: var(--theme-accent-light, rgba(225, 29, 72, 0.15));
  color: var(--theme-btn-border, #FB7185);
  border: 1px solid var(--theme-accent-border, rgba(225, 29, 72, 0.35));
  transition: all 0.2s ease;
}

.wf-nav-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  flex: 1;
}

.wf-nav-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 220px;
  flex-shrink: 0;
}

/* Mobile vs Desktop Header Navigation Controls */
.wf-mobile-toggle {
  display: none;
}

@media (max-width: 1023px) {
  .wf-nav-left { min-width: auto; }
  .wf-nav-tabs { display: none !important; }
  .wf-nav-right { display: none !important; }
  
  .wf-mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-height: 44px;
    min-width: 44px;
    background: rgba(19, 27, 42, 0.7);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    margin-left: auto;
    transition: all 0.2s ease;
  }
  .wf-mobile-toggle:hover, .wf-mobile-toggle:active {
    background: var(--surface);
    border-color: rgba(255, 255, 255, 0.25);
  }
}

/* Tactical Hamburger Icon */
.wf-hamburger-icon {
  width: 20px;
  height: 14px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.wf-bar {
  display: block;
  height: 2px;
  width: 100%;
  background-color: #F8FAFC;
  border-radius: 2px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.wf-mobile-toggle.open .wf-bar-1 {
  transform: translateY(6px) rotate(45deg);
}
.wf-mobile-toggle.open .wf-bar-2 {
  opacity: 0;
  transform: scaleX(0);
}
.wf-mobile-toggle.open .wf-bar-3 {
  transform: translateY(-6px) rotate(-45deg);
}

/* Mobile Backdrop & Slide-Down Drawer */
.wf-mobile-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.wf-mobile-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.wf-mobile-drawer {
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  max-height: calc(100vh - 60px);
  background: rgba(11, 15, 23, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
  z-index: 95;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 1rem 1.25rem 1.5rem;
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
}
.wf-mobile-drawer.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.wf-mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
}

.wf-mobile-nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.wf-mobile-nav-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-height: 48px;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  color: #CBD5E1;
  font-size: 0.9375rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(19, 27, 42, 0.7);
  transition: all 0.15s ease;
}
.wf-mobile-nav-item:hover, .wf-mobile-nav-item:active {
  background: rgba(37, 99, 235, 0.15);
  color: #FFFFFF;
  border-color: rgba(37, 99, 235, 0.4);
}
.wf-mobile-nav-item.active {
  background: var(--theme-accent-light, rgba(225, 29, 72, 0.15));
  color: #FFFFFF;
  border-color: var(--theme-accent, #E11D48);
  box-shadow: 0 0 15px var(--theme-accent-glow, rgba(225, 29, 72, 0.25));
}

.wf-mobile-nav-icon {
  font-size: 1.2rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}
.wf-mobile-nav-arrow {
  font-size: 0.85rem;
  color: #64748B;
  transition: transform 0.15s ease;
}
.wf-mobile-nav-item:hover .wf-mobile-nav-arrow {
  color: #38BDF8;
  transform: translateX(3px);
}

.wf-mobile-drawer-footer {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.wf-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 38px;
  padding: 0 0.9rem;
  border-radius: 8px;
  color: #CBD5E1;
  font-size: 0.875rem; /* 14px Antigravity 2.0 standard */
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.wf-nav-link:hover {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.wf-nav-link.active {
  background: var(--surface);
  color: #FFFFFF;
  font-weight: 700;
  border-color: var(--theme-accent, var(--primary));
  box-shadow: 0 0 12px var(--theme-accent-light, rgba(225, 29, 72, 0.18));
}

/* Responsive Table Container with Horizontal Scroll Hint */
.table-responsive-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}
.table-responsive-wrapper::-webkit-scrollbar {
  height: 6px;
}
.table-responsive-wrapper::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
}

/* Layout Containers & Cards */
.container-main {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.card {
  background-color: #0B1220;
  border: 1px solid #1A2840;
  border-radius: 14px;
  padding: 1.25rem;
  position: relative;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.card-inner {
  background-color: #070D18;
  border: 1px solid #162236;
  border-radius: 10px;
  padding: 1rem;
}

/* Button Components */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 40px;
  padding: 0 1.15rem;
  font-family: var(--font-sans);
  font-size: 0.875rem; /* 14px Antigravity 2.0 standard */
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease-out;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: linear-gradient(180deg, var(--theme-btn-start, #E11D48) 0%, var(--theme-btn-end, #9F1239) 100%) !important;
  color: #FFFFFF !important;
  border: 1px solid var(--theme-btn-border, #FB7185) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 2px 6px rgba(0, 0, 0, 0.35), 0 0 12px var(--theme-accent-glow, rgba(225, 29, 72, 0.3)) !important;
}
.btn-primary:hover {
  background: linear-gradient(180deg, var(--theme-btn-hover-start, #F43F5E) 0%, var(--theme-btn-hover-end, #BE123C) 100%) !important;
  border-color: #FFFFFF !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 4px 12px var(--theme-accent-glow, rgba(225, 29, 72, 0.45)) !important;
}

.btn-secondary {
  background: linear-gradient(180deg, #162236 0%, #111B2C 100%) !important;
  color: #E2E8F0 !important;
  border: 1px solid #2B3E60 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 2px 4px rgba(0, 0, 0, 0.25) !important;
}
.btn-secondary:hover {
  background: linear-gradient(180deg, #1C2B44 0%, #152238 100%) !important;
  color: #FFFFFF !important;
  border-color: #3E5685 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 3px 8px rgba(0, 0, 0, 0.35) !important;
}

.btn-danger {
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.25) 0%, rgba(185, 28, 28, 0.3) 100%);
  color: #FCA5A5 !important;
  border: 1px solid rgba(239, 68, 68, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 2px 4px rgba(0, 0, 0, 0.2);
}
.btn-danger:hover {
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.4) 0%, rgba(185, 28, 28, 0.45) 100%);
  color: #FFFFFF !important;
  border-color: rgba(239, 68, 68, 0.65);
}

.btn-sm {
  min-height: 32px;
  padding: 0 0.75rem;
  font-size: 0.8125rem; /* 13px */
}


.btn-tab {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-tab:hover {
  color: var(--text);
  background: var(--surface-raised);
}
.btn-tab.active {
  background-color: var(--primary) !important;
  color: #FFFFFF !important;
}

/* Forms */
.input-text, .input-select {
  width: 100%;
  background-color: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.825rem;
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  outline: none;
  transition: border-color 0.15s ease;
}
.input-text:focus, .input-select:focus { border-color: var(--primary); }
.input-text::placeholder { color: var(--text-dim); }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: var(--text-2xs); /* 12px */
  font-weight: 700;
  font-family: var(--font-mono);
  text-transform: uppercase;
}
.badge-blue,
.badge-tank {
  background: var(--wf-tank-bg);
  color: #60A5FA;
  border: 1px solid var(--wf-tank-border);
}
.badge-air {
  background: var(--wf-air-bg);
  color: #22D3EE;
  border: 1px solid var(--wf-air-border);
}
.badge-missile {
  background: var(--wf-missile-bg);
  color: #FB923C;
  border: 1px solid var(--wf-missile-border);
}
.badge-ur {
  background: var(--wf-ur-bg);
  color: #FBBF24;
  border: 1px solid var(--wf-ur-border);
}
.badge-ssr {
  background: var(--wf-ssr-bg);
  color: #C084FC;
  border: 1px solid var(--wf-ssr-border);
}
.badge-sr {
  background: var(--wf-sr-bg);
  color: #60A5FA;
  border: 1px solid var(--wf-sr-border);
}
.badge-emerald,
.badge-t10 {
  background: rgba(56, 189, 248, 0.15);
  color: #38BDF8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}
.badge-amber {
  background: rgba(245, 158, 11, 0.15);
  color: #FBBF24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.badge-rose {
  background: rgba(239, 68, 68, 0.15);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Formation Slot Cards */
.slot-card {
  background: linear-gradient(180deg, #131B2A 0%, #0E1524 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 0.85rem 0.75rem;
  width: 215px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}
.slot-card:hover {
  border-color: #38BDF8;
  transform: translateY(-3px);
  background: linear-gradient(180deg, #172236 0%, #101827 100%);
  box-shadow: 0 10px 25px rgba(56, 189, 248, 0.2);
}

.hero-avatar-box {
  width: 76px;
  height: 76px;
  border-radius: 12px;
  overflow: hidden;
  background-color: #000;
  border: 2px solid rgba(255, 255, 255, 0.18);
  margin: 6px 0;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}
.hero-avatar-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

/* Layout Utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.w-full { width: 100%; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-8 > * + * { margin-top: 2rem; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.85rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.15rem; }
.text-xl { font-size: 1.35rem; }
.text-2xl { font-size: 1.65rem; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.text-muted { color: var(--text-muted); }
.text-white { color: #FFFFFF; }
.text-blue { color: var(--primary); }
.text-amber { color: var(--warning); }
.text-emerald { color: var(--success); }
.text-rose { color: var(--danger); }
.hidden { display: none !important; }

/* Responsive adjustments */
@media (max-width: 640px) {
  .slot-card {
    width: 100%;
    min-width: 150px;
    max-width: 175px;
    padding: 0.65rem 0.5rem;
  }
  .hero-avatar-box { width: 58px; height: 58px; }
  .grid-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ==========================================================================
   WIKI & CODEX DOCUMENTATION STYLES (Notion/Wikipedia Calm Architecture)
   ========================================================================== */
/* ==========================================================================
   TACTICAL FIELD MANUAL & CODEX BOOK STYLES (Book / Field Dossier UX)
   ========================================================================== */
.book-layout,
.wiki-layout {
  display: flex;
  gap: 1.75rem;
  align-items: flex-start;
  width: 100%;
  position: relative;
}

/* Sticky Desktop Field Manual Table of Contents */
.book-sidebar,
.wiki-sidebar {
  width: 270px;
  flex-shrink: 0;
  position: sticky;
  top: 76px;
  background: rgba(11, 15, 23, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 25;
}

.book-sidebar-header,
.wiki-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.65rem;
  margin-bottom: 0.4rem;
}

.book-sidebar-title {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #94A3B8;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.book-sidebar-badge {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.15);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Chapter TOC Navigation Item */
.book-toc-item,
.wiki-nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  font-size: 0.825rem;
  font-weight: 600;
  color: #94A3B8;
  text-decoration: none;
  transition: all 0.15s ease;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  width: 100%;
  text-align: left;
  user-select: none;
}

.book-toc-item:hover,
.wiki-nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #F8FAFC;
  border-color: rgba(255, 255, 255, 0.08);
}

.book-toc-item.active,
.wiki-nav-item.active {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.15) 0%, rgba(14, 165, 233, 0.08) 100%);
  color: #FFFFFF;
  font-weight: 700;
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.15);
}

.book-ch-num {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #64748B;
  flex-shrink: 0;
}

.book-toc-item.active .book-ch-num {
  color: #34D399;
}

.book-ch-readtime {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: #64748B;
  margin-left: auto;
  flex-shrink: 0;
}

/* Main Book Content Pane */
.book-main,
.wiki-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Book Chapter Card */
.book-chapter-card {
  background: linear-gradient(180deg, #111827 0%, #0B0F17 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
}

@media (max-width: 640px) {
  .book-chapter-card {
    padding: 1.15rem;
    border-radius: 14px;
  }
}

.book-chapter-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
}

.book-chapter-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.book-chapter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 3px 10px;
  border-radius: 9999px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.book-chapter-pill-emerald {
  background: rgba(16, 185, 129, 0.12);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.book-chapter-pill-sky {
  background: rgba(14, 165, 233, 0.12);
  color: #38BDF8;
  border: 1px solid rgba(14, 165, 233, 0.3);
}

.book-chapter-pill-amber {
  background: rgba(245, 158, 11, 0.12);
  color: #FBBF24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Chapter Sequential Pagination Footer */
.book-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
}

.book-page-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  background: rgba(19, 27, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #E2E8F0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 44px;
}

.book-page-btn:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(255, 255, 255, 0.3);
  color: #FFFFFF;
  transform: translateY(-1px);
}

.book-page-btn:active {
  transform: scale(0.98);
}

/* Tactical Intel Directive Callout */
.book-callout {
  padding: 0.85rem 1.15rem;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left-width: 4px;
  margin: 1rem 0;
  font-size: 0.825rem;
  line-height: 1.6;
}

.book-callout-sky { border-left-color: #0EA5E9; background: rgba(14, 165, 233, 0.06); }
.book-callout-amber { border-left-color: #F59E0B; background: rgba(245, 158, 11, 0.06); }
.book-callout-emerald { border-left-color: #10B981; background: rgba(16, 185, 129, 0.06); }
.book-callout-rose { border-left-color: #EF4444; background: rgba(239, 68, 68, 0.06); }

/* Mobile Sticky Book Navigation Trigger */
.book-mobile-bar {
  display: none;
  position: sticky;
  top: 60px;
  z-index: 40;
  background: rgba(11, 15, 23, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.5rem 0.85rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.book-mobile-progress {
  height: 2px;
  background: #10B981;
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  transition: width 0.15s ease;
}

/* Mobile Book Chapter Drawer */
.book-mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.book-mobile-drawer.open {
  opacity: 1;
  pointer-events: auto;
}

.book-mobile-drawer-sheet {
  background: #0B0F17;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px 20px 0 0;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.8);
  transform: translateY(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.book-mobile-drawer.open .book-mobile-drawer-sheet {
  transform: translateY(0);
}

.book-mobile-drawer-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  overflow-y: auto;
  margin-top: 0.75rem;
}

@media (max-width: 1024px) {
  .book-sidebar,
  .wiki-sidebar {
    display: none;
  }
  .book-mobile-bar {
    display: flex;
  }
}

.wiki-search-box {
  position: relative;
  width: 100%;
}

.wiki-search-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 1rem 0.75rem 2.85rem !important;
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s;
}

.wiki-search-input:focus {
  border-color: var(--primary);
}

.wiki-search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 0.95rem;
  pointer-events: none;
}

.wiki-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  text-align: left;
}

.wiki-table th {
  padding: 0.75rem 1rem;
  background: rgba(11, 15, 23, 0.75);
  border-bottom: 1px solid var(--border);
  color: #CBD5E1;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.wiki-table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: #F8FAFC;
  font-size: 0.875rem;
  vertical-align: middle;
}

.wiki-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.wiki-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: var(--font-mono);
}

.wiki-badge-ur { background: var(--wf-ur-bg); color: var(--wf-ur); border: 1px solid var(--wf-ur-border); }
.wiki-badge-ssr { background: var(--wf-ssr-bg); color: #C084FC; border: 1px solid var(--wf-ssr-border); }
.wiki-badge-sr { background: var(--wf-sr-bg); color: #60A5FA; border: 1px solid var(--wf-sr-border); }

.wiki-badge-tank { background: var(--wf-tank-bg); color: #60A5FA; border: 1px solid var(--wf-tank-border); }
.wiki-badge-air { background: var(--wf-air-bg); color: #22D3EE; border: 1px solid var(--wf-air-border); }
.wiki-badge-missile { background: var(--wf-missile-bg); color: #FB923C; border: 1px solid var(--wf-missile-border); }

.wiki-hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.wiki-hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.wiki-hero-card:hover {
  border-color: var(--primary);
  background: var(--surface-raised);
  transform: translateY(-2px);
}

/* Mobile Hardcore Utilities (iOS Safari Zoom Prevention & Touch Targets) */
@media (max-width: 640px) {
  input[type="text"],
  input[type="number"],
  input[type="email"],
  input[type="search"],
  select,
  textarea {
    font-size: 16px !important; /* Prevents auto-zoom on focus */
  }
  
  .touch-target,
  .btn,
  .btn-primary,
  .btn-secondary,
  .btn-ops-primary,
  .btn-ops-secondary {
    min-height: 44px;
  }
}

/* ==========================================================================
   ROSTER & LEADERBOARD STYLES
   ========================================================================== */
.roster-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.roster-table th {
  padding: 0.75rem 1rem;
  background: #0B0F17;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: sticky;
  top: 0;
  z-index: 10;
}

.roster-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text);
  vertical-align: middle;
}

.roster-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.input-field {
  width: 100%;
  background: #0B0F17;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  color: var(--text);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.15s;
}

.input-field:focus {
  border-color: var(--primary);
}

.select-field {
  background: #0B0F17;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  color: var(--text);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
}

.select-field:focus {
  border-color: var(--primary);
}

.tab-pill {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab-pill:hover {
  background: var(--surface-raised);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
}

.tab-pill.active {
  background: var(--primary) !important;
  color: #FFFFFF !important;
  border-color: var(--primary) !important;
}

/* ==========================================================================
   AUTHENTIC LAST WAR DESIGN SYSTEM EXTENSIONS
   ========================================================================== */
.wf-font-cp {
  font-family: var(--font-cp);
  letter-spacing: 0.03em;
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1;
  color: var(--wf-cp);
}

.wf-font-hud {
  font-family: var(--font-hud);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.wf-font-badge {
  font-family: var(--font-badge);
  font-weight: 900;
}

/* Authentic In-Game Gear Tile */
.wf-gear-tile {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(11, 15, 23, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 4px 6px;
  height: 44px;
  width: 100%;
  transition: all 0.15s ease;
  position: relative;
  overflow: hidden;
}

.wf-gear-tile:hover {
  background: rgba(19, 27, 42, 0.95);
  border-color: rgba(255, 255, 255, 0.3);
}

.wf-gear-img-wrap {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  background: #D97706;
  border: 1px solid rgba(0, 0, 0, 0.4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.wf-gear-img {
  width: 180%;
  height: 180%;
  max-width: none;
  object-fit: cover;
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  pointer-events: none;
}

.wf-gear-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  flex: 1;
  text-align: left;
}

.wf-gear-lvl {
  font-family: var(--font-mono);
  font-size: 0.75rem; /* 12px */
  font-weight: 800;
  color: #F8FAFC;
  line-height: 1.1;
}

.wf-gear-dots {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: 3px;
}

.wf-gear-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}

.wf-gear-dot.active {
  background: #FACC15;
  box-shadow: 0 0 4px #FACC15;
}

/* Official lastwar.com Icon Helpers */
.wf-icon-troop {
  display: inline-block;
  vertical-align: middle;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.wf-icon-role {
  display: inline-block;
  vertical-align: middle;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

/* ==========================================================================
   STANDARD CHAT ROOM ARCHITECTURE (DISCORD / SLACK STYLE)
   ========================================================================== */

.container-chat-full {
  width: 100%;
  height: calc(100vh - 60px);
  max-height: calc(100vh - 60px);
  margin: 0;
  padding: 0;
  display: flex;
  overflow: hidden;
  background-color: var(--bg);
}

.chat-room-layout {
  display: flex;
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
}

/* Left Sidebar - Channels & Directives */
.chat-sidebar {
  width: 280px;
  min-width: 280px;
  background: #0D131F;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  transition: transform 0.25s ease;
  z-index: 40;
}

@media (max-width: 768px) {
  .chat-sidebar {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    transform: translateX(-100%);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.7);
  }
  .chat-sidebar.open {
    transform: translateX(0);
  }
}

.chat-channel-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.9rem;
  border-radius: 8px;
  color: #CBD5E1;
  font-family: var(--font-sans);
  font-size: 0.875rem; /* 14px */
  font-weight: 600;
  transition: all 0.15s ease;
  cursor: pointer;
  border: 1px solid transparent;
}

.chat-channel-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.chat-channel-item.active {
  color: #FFFFFF;
  background: rgba(37, 99, 235, 0.18);
  border-color: rgba(37, 99, 235, 0.4);
}

/* Chat Main Feed */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  background: #0B0F17;
  position: relative;
}

.chat-header-bar {
  height: 52px;
  min-height: 52px;
  background: rgba(13, 19, 31, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  z-index: 20;
}

.chat-stream-container {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  scroll-behavior: smooth;
}

.chat-msg-row {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  transition: background 0.15s ease;
}

.chat-msg-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

.chat-msg-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.75rem;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.chat-msg-content {
  flex: 1;
  min-width: 0;
}

.chat-msg-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.chat-msg-body {
  color: #F1F5F9;
  font-size: 0.9375rem; /* 15px Antigravity 2.0 reading standard */
  line-height: 1.68;
  word-break: break-word;
}

.chat-msg-body p {
  margin-bottom: 0.75rem;
}

.chat-msg-body p:last-child {
  margin-bottom: 0;
}

.chat-msg-body h1,
.chat-msg-body h2 {
  font-size: 1.15rem; /* 18px */
  font-weight: 800;
  color: #FFFFFF;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.chat-msg-body h3 {
  font-size: 1.0rem; /* 16px */
  font-weight: 700;
  color: #FFFFFF;
  margin-top: 0.85rem;
  margin-bottom: 0.4rem;
}

.chat-msg-body h4 {
  font-size: 0.9375rem; /* 15px */
  font-weight: 700;
  color: #60A5FA;
  margin-top: 0.75rem;
  margin-bottom: 0.35rem;
}

.chat-msg-body ul,
.chat-msg-body ol {
  margin: 0.5rem 0 0.85rem 1.25rem;
  padding: 0;
}

.chat-msg-body li {
  margin-bottom: 0.4rem;
  line-height: 1.6;
}

.chat-msg-body strong {
  font-weight: 700;
  color: #FFFFFF;
}

.chat-msg-body blockquote {
  font-size: 0.875rem; /* 14px */
  border-left: 3px solid #3B82F6;
  background: rgba(59, 130, 246, 0.08);
  padding: 0.6rem 0.85rem;
  border-radius: 0 8px 8px 0;
  margin: 0.75rem 0;
  color: #CBD5E1;
}

.chat-msg-body code {
  font-family: var(--font-mono);
  font-size: 0.85rem; /* 13.5px */
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: #38BDF8;
}

/* Chat Input Dock */
.chat-dock {
  background: #0D131F;
  border-top: 1px solid var(--border);
  padding: 0.75rem 1.25rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 20;
}

.chat-input-wrapper {
  background: #080C13;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  display: flex;
  align-items: center;
  padding: 0.35rem 0.5rem 0.35rem 0.75rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.chat-input-wrapper:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25), 0 0 16px rgba(59, 130, 246, 0.15);
}

.chat-input-field,
.chat-input-field:focus,
.chat-input-field:active {
  flex: 1;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
  color: #FFFFFF !important;
  font-family: var(--font-sans);
  font-size: 0.9375rem; /* 15px */
  line-height: 1.5;
  padding: 0.45rem 0.35rem;
}


/* Centered Conversational Flow */
.chat-stream-inner {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.chat-dock-inner {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* User Message Card (Right Anchored) */
.chat-msg-row.user-msg {
  display: flex;
  flex-direction: row-reverse;
  align-items: flex-start;
  gap: 0.75rem;
  margin-left: auto;
  max-width: 85%;
  padding: 0.25rem 0;
}

.chat-msg-row.user-msg .chat-msg-content {
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  border-top-right-radius: 4px;
  padding: 0.75rem 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.chat-msg-row.user-msg .chat-msg-header {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

/* AI Officer Message Card (Left Anchored Tactical Briefing) */
.chat-msg-row.ai-msg {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  max-width: 100%;
  padding: 0.25rem 0;
}

.chat-msg-row.ai-msg .chat-msg-content {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  border-top-left-radius: 4px;
  padding: 0.85rem 1.15rem;
  backdrop-filter: blur(8px);
}

/* Chat Attachment Preview Tray */
.chat-attachment-preview-tray {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  background: rgba(15, 23, 42, 0.85);
  border: 1px dashed rgba(59, 130, 246, 0.4);
  border-radius: 8px;
}

.chat-attachment-thumb {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: #000;
}

.chat-msg-image {
  margin-top: 0.5rem;
  max-width: 320px;
  max-height: 240px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.chat-msg-image:hover {
  border-color: var(--primary);
  transform: scale(1.02);
}

.chat-dock.drag-over {
  border-color: var(--primary);
  background: rgba(30, 58, 138, 0.2);
}

/* Cropper Modal Handles & Workspace */
.crop-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  background-color: #3b82f6;
  border: 2px solid #ffffff;
  border-radius: 3px;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.6);
  z-index: 10;
}
.handle-tl { top: -7px; left: -7px; cursor: nwse-resize; }
.handle-tr { top: -7px; right: -7px; cursor: nesw-resize; }
.handle-bl { bottom: -7px; left: -7px; cursor: nesw-resize; }
.handle-br { bottom: -7px; right: -7px; cursor: nwse-resize; }

/* Interactive Lineup Confirmation HUD Card */
.lineup-hud-card {
  margin: 0.75rem 0;
  padding: 0.85rem;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
}

.lineup-hud-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.5rem;
  margin-bottom: 0.65rem;
}

.lineup-hud-slots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.lineup-slot-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.lineup-slot-chip:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.4);
  transform: translateY(-1px);
}

.lineup-slot-chip.active {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.2);
}

.lineup-slot-avatar {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: #000;
  flex-shrink: 0;
}

.lineup-slot-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.lineup-slot-title {
  font-size: var(--text-xs); /* 13px */
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lineup-slot-meta {
  font-size: var(--text-2xs); /* 12px */
  font-family: monospace;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* ==========================================================================
   ZERO-GREEN PURGE ENFORCEMENT (ALL GREEN REMAPPED TO TACTICAL CYAN / AMBER)
   ========================================================================== */
.text-emerald, .text-emerald-300, .text-emerald-400, .text-emerald-500,
.text-green-400, .text-green-500 {
  color: #38BDF8 !important;
}
.bg-emerald, .bg-emerald-400, .bg-emerald-500, .bg-green-500 {
  background-color: #38BDF8 !important;
  color: #0B0F17 !important;
}
.bg-emerald\/10, .bg-emerald-500\/10, .bg-emerald-500\/15, .bg-emerald-500\/20, .bg-emerald-500\/25, .bg-emerald-500\/30,
.bg-green-500\/15, .bg-green-500\/20 {
  background-color: rgba(56, 189, 248, 0.15) !important;
}
.border-emerald, .border-emerald-300, .border-emerald-400, .border-emerald-500,
.border-emerald-500\/30, .border-emerald-500\/40, .border-emerald-500\/50,
.border-l-emerald-500, .border-green-500 {
  border-color: rgba(56, 189, 248, 0.45) !important;
}
.badge-emerald, .badge-green {
  background: rgba(56, 189, 248, 0.15) !important;
  color: #38BDF8 !important;
  border: 1px solid rgba(56, 189, 248, 0.35) !important;
}

/* ==========================================================================
   PRODUCTION-GRADE OPS BUTTON PRIMITIVES
   ========================================================================== */
.btn-ops-primary {
  height: 2.25rem; /* h-9 */
  padding-left: 1rem;
  padding-right: 1rem;
  border-radius: 0.375rem; /* rounded-md */
  font-size: 0.75rem; /* text-xs */
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(180deg, #334155 0%, #1E293B 100%);
  color: #FFFFFF;
  border: 1px solid #475569;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 2px 4px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: all 0.15s ease-out;
}
.btn-ops-primary:hover {
  background: linear-gradient(180deg, #475569 0%, #334155 100%);
  border-color: #94A3B8;
  color: #FFFFFF;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 3px 8px rgba(0, 0, 0, 0.4);
}
.btn-ops-primary:active {
  transform: scale(0.98);
}

.btn-ops-secondary {
  height: 2.25rem; /* h-9 */
  padding-left: 1rem;
  padding-right: 1rem;
  border-radius: 0.375rem; /* rounded-md */
  font-size: 0.75rem; /* text-xs */
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(180deg, #162438 0%, #101B2C 100%);
  color: #E2E8F0;
  border: 1px solid #2D4166;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 2px 4px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: all 0.15s ease-out;
}
.btn-ops-secondary:hover {
  background: linear-gradient(180deg, #1C2D47 0%, #142137 100%);
  color: #FFFFFF;
  border-color: #435E8C;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 3px 6px rgba(0, 0, 0, 0.4);
}
.btn-ops-secondary:active {
  transform: scale(0.98);
}

.btn-ops-danger {
  height: 2.25rem; /* h-9 */
  padding-left: 0.85rem;
  padding-right: 0.85rem;
  border-radius: 0.375rem; /* rounded-md */
  font-size: 0.75rem; /* text-xs */
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.18) 0%, rgba(185, 28, 28, 0.22) 100%);
  color: #FCA5A5;
  border: 1px solid rgba(239, 68, 68, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 2px 4px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: all 0.15s ease-out;
}
.btn-ops-danger:hover {
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.32) 0%, rgba(185, 28, 28, 0.38) 100%);
  color: #FFFFFF;
  border-color: rgba(239, 68, 68, 0.7);
}
.btn-ops-danger:active {
  transform: scale(0.98);
}

.btn-ops-accent {
  height: 2.25rem; /* h-9 */
  padding-left: 1rem;
  padding-right: 1rem;
  border-radius: 0.375rem; /* rounded-md */
  font-size: 0.75rem; /* text-xs */
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(180deg, #D97706 0%, #B45309 100%);
  color: #FFFFFF;
  border: 1px solid #F59E0B;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 2px 5px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: all 0.15s ease-out;
}
.btn-ops-accent:hover {
  background: linear-gradient(180deg, #F59E0B 0%, #D97706 100%);
  border-color: #FCD34D;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 3px 8px rgba(245, 158, 11, 0.4);
}
.btn-ops-accent:active {
  transform: scale(0.98);
}

/* ==========================================================================
   DESERT STORM IN-GAME MAP RADAR & SECTOR BEACONS
   ========================================================================== */
.storm-radar-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.25rem 0;
}

.storm-radar-wrapper {
  position: relative;
  width: 100%;
  max-width: 64rem;
  aspect-ratio: 4 / 3;
  margin: 0 auto;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid rgba(51, 65, 85, 0.6);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 25px rgba(14, 165, 233, 0.12);
  background-color: #070B14;
}

.storm-radar-map-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  pointer-events: none;
  opacity: 0.94;
}

.storm-radar-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(0,0,0,0.02) 0%, rgba(0,0,0,0.45) 100%);
  pointer-events: none;
}

/* Tactical Corridors & Grid System */
.storm-radar-svg-grid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

.storm-corridor-line {
  stroke: rgba(14, 165, 233, 0.45);
  stroke-width: 1.5;
  stroke-dasharray: 6 4;
  filter: drop-shadow(0 0 4px rgba(14, 165, 233, 0.6));
}

.storm-corridor-line-glow {
  stroke: rgba(14, 165, 233, 0.2);
  stroke-width: 6;
}

.storm-corridor-axis {
  stroke: rgba(245, 158, 11, 0.55);
  stroke-width: 1.5;
  stroke-dasharray: 8 4;
  filter: drop-shadow(0 0 5px rgba(245, 158, 11, 0.7));
}

.storm-corridor-marker {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  fill: rgba(245, 158, 11, 0.85);
  text-anchor: middle;
  dominant-baseline: central;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.9));
}

/* Desert Storm War Room Responsive Enhancements */
.storm-radar-wrapper {
  position: relative;
  width: 100%;
  max-width: 64rem;
  aspect-ratio: 16 / 10;
  margin: 0 auto;
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid rgba(51, 65, 85, 0.6);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6), 0 0 30px rgba(14, 165, 233, 0.15);
  background-color: #070B14;
}

/* Clean subtle custom scrollbar for commander lists */
.custom-scrollbar::-webkit-scrollbar {
  width: 4px;
}
.custom-scrollbar::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.5);
  border-radius: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgba(14, 165, 233, 0.7);
}

/* Minimal Tactical Building Icon Pips (Zero text labels on map canvas) */
.storm-bld-pip {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  background: rgba(11, 15, 23, 0.85);
  backdrop-filter: blur(6px);
  border: 1.5px solid rgba(148, 163, 184, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  z-index: 15;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}
.storm-bld-pip:hover {
  transform: translate(-50%, -50%) scale(1.25);
  border-color: #38bdf8;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.6);
  z-index: 25;
}
.storm-bld-pip.pip-center {
  width: 36px;
  height: 36px;
  font-size: 17px;
  border-color: rgba(245, 158, 11, 0.85);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.4);
}
.storm-bld-pip.pip-center:hover {
  transform: translate(-50%, -50%) scale(1.2);
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.7);
}
.storm-bld-pip.pip-refinery {
  border-color: rgba(56, 189, 248, 0.6);
}
.storm-bld-pip.pip-hospital {
  border-color: rgba(52, 211, 153, 0.6);
}
.storm-bld-pip.pip-buff {
  border-color: rgba(192, 132, 252, 0.6);
}
.storm-bld-pip.pip-tech {
  border-color: rgba(96, 165, 250, 0.6);
}

@media (max-width: 640px) {
  .storm-bld-pip {
    width: 24px;
    height: 24px;
    font-size: 11px;
  }
  .storm-bld-pip.pip-center {
    width: 30px;
    height: 30px;
    font-size: 14px;
  }
}

/* ==========================================================================
   THEME PICKER UI COMPONENT
   ========================================================================== */
.wf-theme-picker {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 3px 6px;
  background: rgba(14, 21, 35, 0.9);
  border: 1px solid var(--border);
  border-radius: 9999px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}
.wf-theme-dot {
  width: 14px;
  height: 14px;
  border-radius: 9999px;
  border: 1.5px solid transparent;
  cursor: pointer;
  padding: 0;
  margin: 0;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  outline: none;
}
.wf-theme-dot:hover {
  transform: scale(1.3);
}
.theme-dot-crimson { background: #800020; }
.theme-dot-cobalt { background: #0284C7; }
.theme-dot-emerald { background: #10B981; }
.theme-dot-amber { background: #F59E0B; }
.theme-dot-amethyst { background: #8B5CF6; }

[data-theme="crimson"] .theme-dot-crimson,
[data-theme="cobalt"] .theme-dot-cobalt,
[data-theme="emerald"] .theme-dot-emerald,
[data-theme="amber"] .theme-dot-amber,
[data-theme="amethyst"] .theme-dot-amethyst {
  border-color: #FFFFFF !important;
  box-shadow: 0 0 8px currentColor;
  transform: scale(1.25);
}

.wf-theme-indicator-dot {
  color: var(--theme-accent, #E11D48);
  transition: color 0.2s ease;
}

/* Ambient Radial Top Glow */
.wf-ambient-glow {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 7rem;
  background: radial-gradient(ellipse at top, var(--theme-radial-glow, rgba(225, 29, 72, 0.22)) 0%, transparent 70%);
  pointer-events: none;
  border-radius: 9999px;
  z-index: 0;
}

.wf-theme-eyebrow {
  background: var(--theme-accent-light, rgba(225, 29, 72, 0.15)) !important;
  color: var(--theme-btn-border, #FB7185) !important;
  border: 1px solid var(--theme-accent-border, rgba(225, 29, 72, 0.35)) !important;
}



