/* Chaos Overlord Reborn - Style Sheet (UI Polish & Readability) */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&family=Overpass+Mono:wght@300..700&display=swap');

:root {
  --bg-color: #05080c;
  --panel-bg: rgba(10, 16, 26, 0.95);
  --neon-green: #39ff14;
  --neon-green-dim: rgba(57, 255, 20, 0.3);
  --neon-red: #ff3366;
  --neon-red-dim: rgba(255, 51, 102, 0.3);
  --neon-blue: #00f0ff;
  --neon-blue-dim: rgba(0, 240, 255, 0.3);
  --neon-amber: #ffaa00;
  --neon-amber-dim: rgba(255, 170, 0, 0.3);
  --neon-purple: #bd00ff;
  --neon-purple-dim: rgba(189, 0, 255, 0.3);
  --neon-cyan: #00ffcc;
  --neon-cyan-dim: rgba(0, 255, 204, 0.3);
  --border-color: #1a2936;
  --text-color: #a5c6d6;
  --text-bright: #e2f1f8;
  --text-muted: #9ec0d4;
}

/* Enhanced contrast text rules */
.text-muted {
  color: var(--text-muted) !important;
}

.section-subtitle-muted {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  border-bottom: 1px solid #142230;
  margin-bottom: 5px;
}

/* Base resets & styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: #020305;
  color: var(--text-color);
  font-family: 'Overpass Mono', monospace;
  overflow-x: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  font-size: 16px;
}

/* 9:16 Viewport Wrapper */
#game-container {
  width: 100%;
  max-width: 480px;
  height: 100vh;
  max-height: 853px;
  background-color: var(--bg-color);
  border: 3px double #1a2f42;
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.15);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* CRT Scanline Overlay */
#game-container::before {
  content: " ";
  display: block;
  position: absolute;
  top: 0; left: 0; bottom: 0; right: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
  z-index: 999;
  background-size: 100% 4px, 6px 100%;
  pointer-events: none;
}

#game-container::after {
  content: " ";
  display: block;
  position: absolute;
  top: 0; left: 0; bottom: 0; right: 0;
  background: radial-gradient(circle, transparent 70%, rgba(0, 0, 0, 0.4) 100%);
  z-index: 1000;
  pointer-events: none;
}

/* Main Screens */
.screen {
  width: 100%;
  height: 100%;
  display: none;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.screen.active {
  display: flex;
}

/* Main Menu / Splash Screen */
#splash-screen {
  background-size: cover;
  background-position: center;
  justify-content: flex-end;
  padding: 30px;
}

#splash-content {
  background-color: rgba(5, 8, 12, 0.85);
  border: 1px solid var(--neon-green);
  box-shadow: 0 0 15px var(--neon-green-dim);
  padding: 20px;
  border-radius: 4px;
  backdrop-filter: blur(5px);
  text-align: center;
  margin-bottom: 40px;
}

.splash-logo-img {
  width: 90%;
  margin: 0 auto 15px auto;
  display: block;
}

.splash-logo {
  font-family: 'Orbitron', sans-serif;
  font-size: 28px;
  color: var(--neon-green);
  text-shadow: 0 0 8px var(--neon-green-dim);
  margin-bottom: 10px;
  font-weight: 700;
  letter-spacing: 2px;
}

.splash-sub {
  font-size: 15px;
  color: var(--neon-amber);
  margin-bottom: 20px;
  letter-spacing: 1px;
}

.btn-cyber {
  background: #08111a;
  border: 1px solid var(--neon-blue);
  color: var(--neon-blue);
  padding: 10px 20px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 17px;
  text-transform: uppercase;
  transition: all 0.2s ease;
  width: 100%;
  margin-bottom: 10px;
  cursor: pointer;
  box-shadow: 0 0 5px var(--neon-blue-dim);
  position: relative;
}

.btn-cyber:hover {
  background: var(--neon-blue);
  color: #000;
  box-shadow: 0 0 15px var(--neon-blue);
}

.btn-cyber-green {
  border-color: var(--neon-green);
  color: var(--neon-green);
  box-shadow: 0 0 5px var(--neon-green-dim);
}

.btn-cyber-green:hover {
  background: var(--neon-green);
  color: #000;
  box-shadow: 0 0 15px var(--neon-green);
}

.btn-cyber-red {
  border-color: var(--neon-red);
  color: var(--neon-red);
  box-shadow: 0 0 5px var(--neon-red-dim);
}

.btn-cyber-red:hover {
  background: var(--neon-red);
  color: #000;
  box-shadow: 0 0 15px var(--neon-red);
}

.btn-cyber-amber {
  border-color: var(--neon-amber);
  color: var(--neon-amber);
  box-shadow: 0 0 5px var(--neon-amber-dim);
}

.btn-cyber-amber:hover {
  background: var(--neon-amber);
  color: #000;
  box-shadow: 0 0 15px var(--neon-amber);
}

/* Play Screen Layout */
#hud-header {
  height: 45px;
  border-bottom: 1px solid var(--border-color);
  background: #080f16;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 10px;
}

.hud-stat {
  font-size: 13px;
}

.hud-stat span {
  color: var(--neon-green);
}

.hud-turn {
  font-family: 'Orbitron', sans-serif;
  font-size: 15px;
  color: var(--neon-amber);
  font-weight: bold;
}

/* Grid Map Component - Responsive Width to Reduce Empty Space */
#map-wrapper {
  flex: 1;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #030508;
  padding: 10px;
}

#map-grid {
  width: 95%;
  max-width: 410px;
  aspect-ratio: 1 / 1;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  gap: 1px;
  background-color: #121f2d;
  border: 2px solid #1a2f42;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.05);
}

.sector-cell {
  background-color: #060a0f;
  position: relative;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2px;
  user-select: none;
  border: 1px solid transparent;
}

.sector-cell:hover {
  background-color: #0f1822;
}

.sector-cell.selected {
  border: 1px solid var(--neon-blue);
  background-color: #0d1e2e;
}

.sector-label {
  font-size: 10px;
  color: var(--text-muted);
  position: absolute;
  top: 1px;
  left: 2px;
}

/* Syndicate Colors for Sector Owners */
.cell-owner-0 { box-shadow: inset 0 0 0 2px var(--neon-green); }
.cell-owner-1 { box-shadow: inset 0 0 0 2px var(--neon-red); }
.cell-owner-2 { box-shadow: inset 0 0 0 2px var(--neon-blue); }
.cell-owner-3 { box-shadow: inset 0 0 0 2px var(--neon-amber); }
.cell-owner-4 { box-shadow: inset 0 0 0 2px var(--neon-purple); }
.cell-owner-5 { box-shadow: inset 0 0 0 2px var(--neon-cyan); }

/* Gang Dots inside sectors */
.gang-dots-container {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  align-content: flex-end;
  justify-content: flex-end;
  position: absolute;
  bottom: 7px;
  right: 3px;
  max-width: 25px;
}

/* Mini Sites Ownership bar inside cell */
.sector-mini-ownership-bar {
  display: flex;
  width: calc(100% - 4px);
  height: 3px;
  background: #141f2a;
  position: absolute;
  bottom: 2px;
  left: 2px;
  gap: 1px;
  z-index: 10;
}

.mini-bar-segment {
  flex: 1;
  height: 100%;
}

.gang-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  transition: width 0.2s, height 0.2s;
}

/* Dots with an active order pulse to show they're assigned */
.gang-dot.has-order {
  width: 7px;
  height: 7px;
  animation: dotPulse 1.4s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.75); }
}

.dot-owner-0 { background-color: var(--neon-green); box-shadow: 0 0 3px var(--neon-green); }
.dot-owner-1 { background-color: var(--neon-red); box-shadow: 0 0 3px var(--neon-red); }
.dot-owner-2 { background-color: var(--neon-blue); box-shadow: 0 0 3px var(--neon-blue); }
.dot-owner-3 { background-color: var(--neon-amber); box-shadow: 0 0 3px var(--neon-amber); }
.dot-owner-4 { background-color: var(--neon-purple); box-shadow: 0 0 3px var(--neon-purple); }
.dot-owner-5 { background-color: var(--neon-cyan); box-shadow: 0 0 3px var(--neon-cyan); }

/* Retro Modals Styles (Overlay Windows) */
.retro-modal {
  position: absolute;
  top: 15px;
  left: 15px;
  right: 15px;
  bottom: 60px;
  background: rgba(5, 9, 14, 0.98);
  border: 2px solid var(--border-color);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
  z-index: 850;
  display: none;
  flex-direction: column;
  padding: 15px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
  animation: modalFadeIn 0.15s ease-out forwards;
}

.retro-modal.active {
  display: flex;
}

@keyframes modalFadeIn {
  0% { opacity: 0; transform: scale(0.96); }
  100% { opacity: 1; transform: scale(1); }
}

.retro-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 6px;
  margin-bottom: 12px;
}

.retro-modal-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 15px;
  font-weight: bold;
}

.retro-modal-close {
  background: transparent;
  border: none;
  color: var(--neon-red);
  font-family: 'Share Tech Mono', monospace;
  font-size: 15px;
  cursor: pointer;
  font-weight: bold;
}

.retro-modal-close:hover {
  color: #fff;
  text-shadow: 0 0 5px var(--neon-red);
}

/* Gang Navigation Bar (prev/next within same sector) */
#gang-modal-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 240, 255, 0.04);
  border-bottom: 1px solid rgba(0, 240, 255, 0.12);
  padding: 5px 8px;
  margin: 0 -15px 10px -15px;
}

.gang-nav-btn {
  background: transparent;
  border: 1px solid #1c3349;
  color: var(--neon-blue);
  font-size: 13px;
  width: 26px;
  height: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
  border-radius: 2px;
}

.gang-nav-btn:hover {
  background: var(--neon-blue-dim);
  border-color: var(--neon-blue);
  box-shadow: 0 0 5px var(--neon-blue-dim);
}

.gang-nav-counter {
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  color: var(--neon-amber);
  white-space: nowrap;
  flex-shrink: 0;
}

.gang-nav-name {
  flex: 1;
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

/* Sector gangs list */
#sector-gangs-list .sector-gang-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  background: #09131d;
  border: 1px solid #152535;
  padding: 6px 8px;
  margin-bottom: 4px;
  cursor: pointer;
  transition: border-color 0.15s;
  text-align: left;
  font-family: 'Share Tech Mono', monospace;
}

#sector-gangs-list .sector-gang-row:hover {
  border-color: var(--neon-blue);
  background: #0d2133;
}

#sector-gangs-list .sector-gang-row.active-gang {
  border-color: var(--neon-green);
  background: rgba(57, 255, 20, 0.05);
}

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

.sector-gang-name {
  font-size: 12px;
  font-weight: bold;
  color: var(--text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sector-gang-name.player-gang {
  color: var(--neon-green);
}

.sector-gang-sub {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 1px;
}

.retro-modal-body {
  flex: 1;
  overflow-y: auto;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel-title {
  font-family: 'Orbitron', sans-serif;
  color: var(--neon-amber);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 3px;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.text-green { color: var(--neon-green) !important; }
.text-red { color: var(--neon-red) !important; }
.text-blue { color: var(--neon-blue) !important; }
.text-amber { color: var(--neon-amber) !important; }
.text-purple { color: var(--neon-purple) !important; }
.text-cyan { color: var(--neon-cyan) !important; }

/* Grid view items */
.sites-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin-top: 5px;
}

.site-card {
  background: #09131d;
  border: 1px solid var(--border-color);
  padding: 0;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 3px;
}

.site-card:hover {
  border-color: var(--neon-blue);
  background: #0d2133;
}

.site-card.influenced {
  border-color: var(--neon-amber);
}

.site-image-box {
  width: 100%;
  height: 70px;
  overflow: hidden;
  background: #000;
  border-bottom: 1px solid var(--border-color);
  position: relative;
}

.site-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.site-card:hover .site-card-img {
  transform: scale(1.08);
}

.site-card-body {
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  justify-content: center;
  flex: 1;
}

.site-name {
  font-size: 11px;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-progress-bar {
  width: 100%;
  height: 5px;
  background: #141f2a;
  border: 1px solid #1a2936;
  margin: 3px 0 4px 0;
  position: relative;
  overflow: hidden;
  border-radius: 1px;
}

.site-progress-fill {
  height: 100%;
  background: var(--neon-green);
  box-shadow: 0 0 3px var(--neon-green);
  transition: width 0.3s;
}

.site-owner {
  font-size: 10px;
  margin-top: 2px;
}

/* Sites Distribution stacked progress bar and legend */
.sites-distribution-bar {
  display: flex;
  width: 100%;
  height: 12px;
  background: #141f2a;
  border: 1px solid #1a2936;
  border-radius: 2px;
  overflow: hidden;
  margin: 6px 0;
}

.sites-dist-segment {
  height: 100%;
  transition: width 0.3s ease;
}

.sites-distribution-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 10px;
  margin-bottom: 8px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.legend-color-box {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

/* Gang Card Detail */
.gang-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin-top: 5px;
}

.stat-box {
  background: #070e16;
  border: 1px solid #142230;
  padding: 4px;
  text-align: center;
}

.stat-val {
  font-size: 13px;
  font-weight: bold;
  color: var(--text-bright);
}

.stat-lbl {
  font-size: 10.5px;
  color: var(--text-color);
  text-transform: uppercase;
}

/* Force/Health Bar */
.force-bar-container {
  width: 100%;
  height: 10px;
  background: #141f2a;
  border: 1px solid var(--border-color);
  margin-top: 5px;
  position: relative;
  overflow: hidden;
}

.force-bar-fill {
  height: 100%;
  background: var(--neon-green);
  width: 100%;
  box-shadow: 0 0 5px var(--neon-green);
  transition: width 0.3s;
}

/* Bottom Tab Controls */
#control-tabs {
  height: 38px;
  display: flex;
  background: #070d14;
  border-bottom: 1px solid var(--border-color);
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  border-right: 1px solid var(--border-color);
  color: #557592;
  font-family: 'Overpass Mono', monospace;
  font-size: 13px;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.2s;
  display: flex;
  justify-content: center;
  align-items: center;
}

.tab-btn:hover {
  background: #0b1724;
  color: var(--neon-blue);
}

.tab-btn.active {
  background: #0c1a29;
  color: var(--neon-green);
  border-bottom: 2px solid var(--neon-green);
}

#tab-content-panel {
  height: 180px;
  background: #060b11;
  padding: 10px;
  overflow-y: auto;
  font-size: 13px;
}

/* Hiring, Research List styling */
.recruit-item, .research-item, .syndicate-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #142230;
  padding: 8px 0;
}

.item-name {
  font-weight: bold;
  color: var(--text-bright);
}

.item-desc {
  font-size: 11px;
  color: #5d7e9e;
}

/* Action Command Grid */
.actions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-top: 6px;
}

.btn-action {
  background: #09131d;
  border: 1px solid #1c3349;
  color: var(--text-color);
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  padding: 8px 6px;
  cursor: pointer;
  text-transform: uppercase;
  text-align: center;
  transition: all 0.15s;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  line-height: 1.2;
}

.btn-action .action-icon {
  font-size: 16px;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.btn-action .action-label {
  flex: 1;
  text-align: left;
  font-size: 10px;
  line-height: 1.3;
}

.btn-action .action-label strong {
  display: block;
  font-size: 12px;
  color: var(--text-bright);
}

.btn-action:hover:not(:disabled) {
  border-color: var(--neon-blue);
  color: var(--neon-blue);
  background: #0d2133;
  box-shadow: 0 0 6px var(--neon-blue-dim);
}

.btn-action:hover:not(:disabled) .action-label strong {
  color: var(--neon-blue);
}

.btn-action.active {
  background: var(--neon-blue-dim);
  border-color: var(--neon-blue);
  color: var(--neon-blue);
  box-shadow: 0 0 8px var(--neon-blue-dim);
}

.btn-action.active .action-label strong {
  color: var(--neon-blue);
}

.btn-action:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Order Guide hint strip */
.order-guide {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 240, 255, 0.05);
  border: 1px solid rgba(0, 240, 255, 0.15);
  border-radius: 3px;
  padding: 5px 8px;
  font-size: 10px;
  color: #5d96b0;
  margin-bottom: 2px;
}

.order-guide i {
  color: var(--neon-blue);
  font-size: 13px;
  flex-shrink: 0;
}

/* ============================================================
   SYNDICATE TAB — Gang Command Center
   ============================================================ */

.syndicate-gang-card {
  background: #08111a;
  border: 1px solid #152535;
  border-radius: 3px;
  margin-bottom: 6px;
  overflow: hidden;
  transition: border-color 0.15s;
}

.syndicate-gang-card.expanded {
  border-color: var(--neon-blue);
  box-shadow: 0 0 8px var(--neon-blue-dim);
}

.syndicate-gang-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 8px;
  cursor: pointer;
  user-select: none;
}

.syndicate-gang-header:hover {
  background: #0c1824;
}

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

.gang-header-name {
  font-size: 13px;
  font-weight: bold;
  color: var(--neon-green);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gang-header-loc {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Mini force bar in syndicate list */
.force-mini-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
  width: 52px;
}

.force-mini-label {
  font-size: 9px;
  color: var(--text-muted);
}

.force-mini-bar {
  width: 52px;
  height: 5px;
  background: #141f2a;
  border: 1px solid #1c3349;
  border-radius: 2px;
  overflow: hidden;
}

.force-mini-fill {
  height: 100%;
  background: var(--neon-green);
  box-shadow: 0 0 3px var(--neon-green);
  transition: width 0.3s;
}

.force-mini-fill.low {
  background: var(--neon-red);
  box-shadow: 0 0 3px var(--neon-red);
}

/* Order status badge */
.order-badge {
  font-size: 9px;
  padding: 2px 5px;
  border-radius: 2px;
  font-family: 'Overpass Mono', monospace;
  text-transform: uppercase;
  font-weight: bold;
  flex-shrink: 0;
  white-space: nowrap;
}

.order-badge.idle {
  background: rgba(75, 106, 138, 0.2);
  color: var(--text-muted);
  border: 1px solid #1c3349;
}

.order-badge.ordered {
  background: rgba(57, 255, 20, 0.1);
  color: var(--neon-green);
  border: 1px solid var(--neon-green-dim);
}

.order-badge.move    { background: rgba(0, 240, 255, 0.1); color: var(--neon-blue); border: 1px solid var(--neon-blue-dim); }
.order-badge.attack  { background: rgba(255, 51, 102, 0.1); color: var(--neon-red); border: 1px solid var(--neon-red-dim); }
.order-badge.chaos   { background: rgba(255, 170, 0, 0.1); color: var(--neon-amber); border: 1px solid var(--neon-amber-dim); }
.order-badge.equip   { background: rgba(189, 0, 255, 0.1); color: var(--neon-purple); border: 1px solid var(--neon-purple-dim); }
.order-badge.heal    { background: rgba(0, 255, 204, 0.1); color: var(--neon-cyan); border: 1px solid var(--neon-cyan-dim); }
.order-badge.control { background: rgba(57, 255, 20, 0.1); color: var(--neon-green); border: 1px solid var(--neon-green-dim); }
.order-badge.influence { background: rgba(255, 170, 0, 0.1); color: var(--neon-amber); border: 1px solid var(--neon-amber-dim); }
.order-badge.research { background: rgba(0, 240, 255, 0.1); color: var(--neon-blue); border: 1px solid var(--neon-blue-dim); }
.order-badge.bribe    { background: rgba(57, 255, 20, 0.1); color: var(--neon-green); border: 1px solid var(--neon-green-dim); }
.order-badge.snitch   { background: rgba(255, 51, 102, 0.1); color: var(--neon-red); border: 1px solid var(--neon-red-dim); }
.order-badge.hide     { background: rgba(165, 198, 214, 0.1); color: var(--text-color); border: 1px solid rgba(165, 198, 214, 0.3); }

/* Inline action panel (expands inside syndicate card) */
.gang-inline-panel {
  border-top: 1px solid #152535;
  background: #060d14;
  padding: 8px;
  display: none;
}

.gang-inline-panel.visible {
  display: block;
}

.inline-stat-row {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.inline-stat-chip {
  background: #07101a;
  border: 1px solid #142230;
  padding: 2px 5px;
  font-size: 10px;
  color: #5d96b0;
  border-radius: 2px;
}

.inline-stat-chip span {
  color: var(--text-bright);
  font-weight: bold;
}

.inline-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
}

.btn-inline-action {
  background: #09131d;
  border: 1px solid #1c3349;
  color: var(--text-color);
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  padding: 7px 6px;
  cursor: pointer;
  text-transform: uppercase;
  text-align: left;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 2px;
}

.btn-inline-action i {
  font-size: 15px;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
}

.btn-inline-action .act-txt strong {
  display: block;
  font-size: 11px;
  color: var(--text-bright);
  line-height: 1.2;
}

.btn-inline-action .act-txt small {
  font-size: 9px;
  color: var(--text-muted);
  line-height: 1.2;
  display: block;
}

.btn-inline-action:hover:not(:disabled) {
  border-color: var(--neon-blue);
  background: #0d2133;
  box-shadow: 0 0 5px var(--neon-blue-dim);
}

.btn-inline-action:hover:not(:disabled) .act-txt strong { color: var(--neon-blue); }

.btn-inline-action.active {
  border-color: var(--neon-green);
  background: rgba(57, 255, 20, 0.07);
}

.btn-inline-action.active .act-txt strong { color: var(--neon-green); }

.btn-inline-action:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.inline-target-popup {
  margin-top: 6px;
  padding: 6px;
  border: 1px solid var(--neon-blue);
  background: #060f18;
  display: none;
}

.inline-target-popup.visible {
  display: block;
}

/* Log output styling */
.log-line {
  margin-bottom: 5px;
  line-height: 1.4;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
}

.log-combat {
  color: var(--neon-red);
}

.log-system {
  color: var(--neon-amber);
}

.log-success {
  color: var(--neon-green);
}

/* Action Footer Panel - Unified and Spanned 100% */
#footer-panel {
  height: 52px;
  border-top: 1px solid var(--border-color);
  background: #070d14;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: #030508;
}

::-webkit-scrollbar-thumb {
  background: #1b2f44;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--neon-blue);
}

/* Modal and Overlays */
.overlay-menu {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(5, 9, 14, 0.95);
  z-index: 900;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 30px;
}

.overlay-menu.active {
  display: flex;
}

.overlay-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 22px;
  color: var(--neon-amber);
  margin-bottom: 25px;
}

/* floating combat numbers */
.floating-indicator {
  position: absolute;
  pointer-events: none;
  font-family: 'Orbitron', sans-serif;
  font-weight: bold;
  font-size: 15px;
  animation: floatUp 1s ease-out forwards;
  z-index: 1001;
}

@keyframes floatUp {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(-40px); opacity: 0; }
}

/* --- HIRE CONFIRMATION MODAL OVERRIDES (Slim & Centered) --- */
#hire-confirm-modal {
  bottom: auto;
  top: 50%;
  transform: translateY(-50%);
  padding: 12px;
  gap: 8px;
  animation: modalCenterFadeIn 0.15s ease-out forwards;
}

#hire-confirm-modal .retro-modal-body {
  gap: 8px;
  padding-right: 2px;
}

#hire-confirm-modal .confirm-section-title {
  font-size: 11px;
  color: var(--text-color);
  text-transform: uppercase;
  border-bottom: 1px solid #1c3349;
  margin-bottom: 6px;
  font-weight: bold;
  letter-spacing: 0.5px;
}

#hire-confirm-modal .gang-stats-grid {
  gap: 4px;
}

#hire-confirm-modal .stat-box {
  padding: 3px 4px;
  background: #09131d;
  border: 1px solid #1a2f42;
}

#hire-confirm-modal .stat-val {
  font-size: 14px;
  color: var(--text-bright);
}

#hire-confirm-modal .stat-lbl {
  font-size: 10px;
  color: var(--text-color);
  font-weight: bold;
}

@keyframes modalCenterFadeIn {
  0% { opacity: 0; transform: translateY(-52%) scale(0.96); }
  100% { opacity: 1; transform: translateY(-50%) scale(1); }
}

/* Modal Backdrop - Blocks background clicks and adds aesthetic blur */
.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(2, 3, 5, 0.7);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 800;
  display: none;
  border-radius: 4px;
}

.modal-backdrop.active {
  display: block;
}

/* ============================================================
   GOG GANG CARD LAYOUT SYSTEM (v15 - Pure CSS)
   ============================================================ */
.gog-gang-card-css {
  display: flex;
  flex-direction: row;
  gap: 8px;
  width: 100%;
  height: auto;
  min-height: 235px;
  background-color: #040810;
  background-image: 
    linear-gradient(rgba(0, 240, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.04) 1px, transparent 1px);
  background-size: 8px 8px;
  margin: 0 auto;
  border: 1px solid #1a2f42;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.15);
  padding: 8px;
  box-sizing: border-box;
  align-items: stretch;
  flex-shrink: 0;
}

.gog-card-col-left {
  display: flex;
  flex-direction: row;
  gap: 8px;
  width: 90px;
  flex-shrink: 0;
  align-self: stretch;
}

.gog-blue-vertical-bar {
  width: 20px;
  background: #02075d;
  color: #00f0ff;
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  font-weight: bold;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  writing-mode: vertical-lr;
  transform: rotate(180deg);
  border: 1px solid #00f0ff;
  box-shadow: inset 0 0 5px rgba(0, 240, 255, 0.5), 0 0 5px rgba(0, 240, 255, 0.3);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.gog-left-actions {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.gog-left-actions.hire-layout {
  justify-content: center;
  gap: 0;
}

.gog-portrait-box {
  width: 62px;
  height: 62px;
  border: 1px solid var(--neon-green);
  box-shadow: 0 0 5px rgba(57, 255, 20, 0.2);
  background: #000;
  overflow: hidden;
  flex-shrink: 0;
}

.gog-portrait-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gog-left-items-slots {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  width: 100%;
}

.gog-item-slot-css {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(57, 255, 20, 0.25);
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-sizing: border-box;
  cursor: pointer;
  transition: all 0.15s;
}

.gog-item-slot-css:hover {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 5px var(--neon-cyan-dim);
}

.gog-item-slot-css img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  border: 1px solid rgba(0, 240, 255, 0.2);
}

.gog-ok-btn-css {
  width: 60px;
  height: 28px;
  border: 1px solid var(--neon-green);
  background: #000;
  color: var(--neon-green);
  font-family: 'Overpass Mono', monospace;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  outline: none;
  text-transform: uppercase;
  box-shadow: 0 0 4px rgba(57, 255, 20, 0.3);
  transition: all 0.15s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gog-ok-btn-css:hover {
  background: var(--neon-green);
  color: #000;
  box-shadow: 0 0 10px var(--neon-green);
}

.gog-card-col-center {
  flex: 1;
  border: 3px double var(--neon-green);
  background: rgba(4, 8, 16, 0.85);
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-sizing: border-box;
  align-self: stretch;
}

.gog-section {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.gog-section-label {
  font-size: 11px;
  color: var(--neon-green);
  opacity: 0.75;
  font-weight: bold;
  letter-spacing: 0.5px;
}

.gog-section-val-large {
  font-size: 18px;
  color: var(--neon-green);
  text-shadow: 0 0 2px rgba(57, 255, 20, 0.6);
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gog-desc-text {
  font-size: 12px;
  color: #a5c6d6;
  line-height: 1.35;
  max-height: 60px;
  overflow-y: auto;
  font-family: 'Overpass Mono', monospace;
}

.gog-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 12px;
  row-gap: 3px;
}

.gog-stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  line-height: 1.2;
  color: var(--neon-green);
  border-bottom: 1px solid rgba(57, 255, 20, 0.08);
  padding-bottom: 1px;
}

.gog-stat-row span:first-child {
  opacity: 0.75;
}

.gog-stat-row span:last-child {
  font-weight: bold;
  text-shadow: 0 0 2px rgba(57, 255, 20, 0.5);
}

.gog-grid-2col-skills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 2px;
  border-top: 1px dashed rgba(57, 255, 20, 0.25);
  padding-top: 4px;
}

.gog-section-skills {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.gog-stat-row-skill {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  line-height: 1.2;
  color: var(--neon-green);
  border-bottom: 1px solid rgba(57, 255, 20, 0.08);
  padding-bottom: 1px;
}

.gog-stat-row-skill span:first-child {
  opacity: 0.75;
}

.gog-stat-row-skill span:last-child {
  font-weight: bold;
  text-shadow: 0 0 2px rgba(57, 255, 20, 0.5);
}

/* Equip Category Selection Modal Tabs */
#equip-select-modal {
  z-index: 860;
}

.equip-modal-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  background: rgba(5, 8, 12, 0.4);
}

.equip-tab-btn {
  flex: 1;
  padding: 8px;
  font-family: 'Overpass Mono', monospace;
  font-size: 11px;
  font-weight: bold;
  background: none;
  border: none;
  color: var(--text-color);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  text-transform: uppercase;
}

.equip-tab-btn:hover {
  color: var(--text-bright);
  background: rgba(0, 240, 255, 0.04);
}

.equip-tab-btn.active {
  color: var(--neon-blue);
  border-bottom-color: var(--neon-blue);
  background: rgba(0, 240, 255, 0.08);
}

/* --- Turn Report Wizard Styles --- */
.turn-report-wizard-steps {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
  background: rgba(10, 16, 26, 0.8);
  border: 1px solid var(--border-color);
  padding: 6px 10px;
  margin-bottom: 15px;
  border-radius: 3px;
}

.turn-report-step-badge {
  flex: 1;
  text-align: center;
  font-size: 10px;
  font-weight: bold;
  padding: 4px 2px;
  background: rgba(25, 40, 60, 0.3);
  color: var(--text-muted);
  border: 1px solid transparent;
  border-radius: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
}

.turn-report-step-badge.active {
  background: rgba(0, 240, 255, 0.15);
  color: var(--neon-blue);
  border-color: var(--neon-blue);
  box-shadow: 0 0 5px rgba(0, 240, 255, 0.3);
}

.turn-report-step-badge.completed {
  background: rgba(57, 255, 20, 0.08);
  color: var(--neon-green);
  border-color: rgba(57, 255, 20, 0.3);
}

/* Report Card Styling */
.report-card {
  background: rgba(8, 14, 22, 0.9);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 10px;
  margin-bottom: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.report-card.gained {
  border-left: 3px solid var(--neon-green);
}

.report-card.lost {
  border-left: 3px solid var(--neon-red);
}

.report-card.neutralized {
  border-left: 3px solid var(--neon-amber);
}

.report-card.progress {
  border-left: 3px solid var(--neon-blue);
}

/* Combat Report Layout */
.combat-report-arena {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border-color);
}

.combat-fighter {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 0;
}

.fighter-portrait {
  width: 50px;
  height: 50px;
  border: 2px solid var(--border-color);
  background: #000;
  object-fit: cover;
  margin-bottom: 4px;
}

.fighter-name {
  font-size: 11px;
  font-weight: bold;
  color: var(--text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.fighter-force {
  font-size: 10px;
  color: var(--neon-green);
  margin-top: 2px;
}

.fighter-force.destroyed {
  color: var(--neon-red);
  text-decoration: line-through;
}

.combat-versus {
  font-family: 'Orbitron', sans-serif;
  font-size: 14px;
  color: var(--neon-red);
  font-weight: bold;
  text-shadow: 0 0 5px var(--neon-red-dim);
  flex-shrink: 0;
}

.combat-logs-list {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(0, 240, 255, 0.08);
  padding: 6px;
  font-size: 9.5px;
  color: var(--text-muted);
  max-height: 120px;
  overflow-y: auto;
  border-radius: 2px;
}

.combat-log-item {
  margin-bottom: 3px;
  line-height: 1.3;
}

/* Generic Image card layout for site / item */
.report-image-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.report-card-image-box {
  width: 64px;
  height: 64px;
  border: 1px solid var(--border-color);
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 2px;
  overflow: hidden;
}

.report-card-image-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.report-card-image-box.site-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.report-card-details {
  flex-grow: 1;
  min-width: 0;
}

.report-card-title {
  font-size: 12px;
  font-weight: bold;
  color: var(--text-bright);
}

.report-card-status {
  font-size: 10px;
  margin-top: 2px;
  text-transform: uppercase;
}

/* --- Sector Total Stats & Site Effects UI --- */
.total-stat-badge {
  background: rgba(0, 240, 255, 0.05);
  border: 1px solid rgba(0, 240, 255, 0.2);
  color: var(--neon-blue);
  font-family: 'Overpass Mono', monospace;
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 2px;
  text-shadow: 0 0 2px rgba(0, 240, 255, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-bottom: 3px;
}

.total-stat-badge.stat-positive {
  background: rgba(57, 255, 20, 0.05);
  border-color: rgba(57, 255, 20, 0.3);
  color: var(--neon-green);
  text-shadow: 0 0 2px rgba(57, 255, 20, 0.3);
}

.total-stat-badge.stat-negative {
  background: rgba(255, 51, 102, 0.05);
  border-color: rgba(255, 51, 102, 0.3);
  color: var(--neon-red);
  text-shadow: 0 0 2px rgba(255, 51, 102, 0.3);
}

.total-stat-badge.stat-amber {
  background: rgba(255, 170, 0, 0.05);
  border-color: rgba(255, 170, 0, 0.3);
  color: var(--neon-amber);
  text-shadow: 0 0 2px rgba(255, 170, 0, 0.3);
}

.site-effects-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 5px;
  text-align: left;
  border-top: 1px solid rgba(26, 41, 54, 0.5);
  padding-top: 4px;
}

.site-effect-item {
  font-size: 8.5px;
  font-family: 'Overpass Mono', monospace;
  line-height: 1.2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-color);
}

.site-effect-val {
  font-weight: bold;
}

.site-effect-val.positive {
  color: var(--neon-green);
}

.site-effect-val.negative {
  color: var(--neon-red);
}

.site-effect-val.neutral {
  color: var(--neon-blue);
}

/* 3-Column Grid for Hiring & Syndicate Tab */
.gangs-3col-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 4px;
}

.recruit-card {
  display: flex;
  flex-direction: column;
  background: rgba(5, 8, 12, 0.6);
  border-radius: 4px;
  overflow: hidden;
  text-align: center;
  padding: 6px;
  justify-content: space-between;
  height: 100%;
  transition: all 0.2s;
}

.recruit-card:hover {
  background: rgba(0, 240, 255, 0.05);
}

.gangs-3col-grid .syndicate-gang-card {
  display: flex;
  flex-direction: column;
  background: rgba(8, 17, 26, 0.6);
  border: 1px solid var(--neon-green) !important;
  border-radius: 4px;
  overflow: hidden;
  text-align: center;
  padding: 6px;
  cursor: pointer;
  transition: all 0.2s;
  justify-content: space-between;
  height: 100%;
  margin-bottom: 0 !important; /* Override vertical list margin */
}

.gangs-3col-grid .syndicate-gang-card:hover {
  background: rgba(57, 255, 20, 0.05);
  box-shadow: 0 0 8px var(--neon-green-dim);
}

.gangs-3col-grid .sector-gang-card {
  display: flex;
  flex-direction: column;
  background: rgba(8, 17, 26, 0.6);
  border: 1px solid rgba(0, 240, 255, 0.1) !important;
  border-radius: 4px;
  overflow: hidden;
  text-align: center;
  padding: 6px;
  cursor: pointer;
  transition: all 0.2s;
  justify-content: space-between;
  height: 100%;
}

.gangs-3col-grid .sector-gang-card:hover {
  background: rgba(0, 240, 255, 0.05);
  border-color: var(--neon-blue) !important;
  box-shadow: 0 0 8px var(--neon-blue-dim);
}

.gangs-3col-grid .sector-gang-card.active-gang {
  border-color: var(--neon-green) !important;
  background: rgba(57, 255, 20, 0.05);
  box-shadow: 0 0 8px var(--neon-green-dim);
}

