/* =========================================================================
   PHASE 3: CELESTIAL OPERATIONS & DEEP SPACE LOGISTICS SUITE (ASTRO98.EXE)
   Aesthetic: Cassette Futurism / Alien Nostromo & Sulaco Heavy Industrial
   ========================================================================= */

/* CRT Amber & Phosphor Glow Accents */
:root {
  --cel-bg-deep: #050a06;
  --cel-bg-hull: #09120b;
  --cel-bg-card: #0d1a10;
  --cel-border-hull: #1a3821;
  --cel-border-active: #2b6138;
  --cel-amber-crt: #ffb000;
  --cel-amber-glow: rgba(255, 176, 0, 0.4);
  --cel-green-term: #33ff66;
  --cel-green-glow: rgba(51, 255, 102, 0.35);
  --cel-red-alarm: #ff3344;
  --cel-cyan-cryo: #38bdf8;
}

/* 1. TOP TELEMETRY HUD */
.celestial-telemetry-hud {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.celestial-hud-pill {
  background: var(--cel-bg-hull);
  border: 1px solid var(--cel-border-hull);
  border-top: 2px solid var(--cel-green-term);
  border-radius: 3px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.7), 0 2px 4px rgba(0, 0, 0, 0.5);
  position: relative;
}
.celestial-hud-pill::after {
  content: "";
  position: absolute;
  top: 2px;
  right: 4px;
  width: 4px;
  height: 4px;
  background: var(--cel-green-term);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--cel-green-term);
}
.celestial-hud-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #78a883;
  font-weight: 700;
  font-family: 'Consolas', monospace;
}
.celestial-hud-val {
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 1.15rem;
  font-weight: bold;
  color: var(--cel-green-term);
  text-shadow: 0 0 8px var(--cel-green-glow);
  line-height: 1.2;
}

/* 2. ASTRO-RADAR 3000 Canvas & Vector CRT Scope */
.radar-crt-container {
  position: relative;
  background: #020704;
  border: 2px solid #1c4a25;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: inset 0 0 45px rgba(0, 50, 15, 0.9), 0 0 14px rgba(0, 255, 100, 0.2);
  margin-bottom: 12px;
}
.radar-crt-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 20, 0, 0.2),
    rgba(0, 20, 0, 0.2) 1px,
    transparent 1px,
    transparent 2px
  );
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.95);
}
.radar-top-status {
  position: absolute;
  top: 8px; left: 12px; right: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 0.72rem;
  color: var(--cel-green-term);
  text-shadow: 0 0 6px var(--cel-green-term);
  pointer-events: none;
  z-index: 2;
}
.radar-canvas-view {
  display: block;
  width: 100%;
  height: 330px;
  background: transparent;
}

/* 3. CASSETTE FUTURISM GANTRY BEZELS & CHASSIS */
.gantry-deck-container {
  background: var(--cel-bg-deep);
  border: 2px solid var(--cel-border-hull);
  border-radius: 4px;
  padding: 12px;
  margin-bottom: 12px;
  box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.85);
  position: relative;
}
.gantry-deck-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--cel-border-hull);
  font-family: 'Consolas', monospace;
}
.gantry-deck-title {
  color: var(--cel-amber-crt);
  text-shadow: 0 0 6px var(--cel-amber-glow);
  font-weight: bold;
  font-size: 0.88rem;
  letter-spacing: 0.5px;
}
.gantry-deck-subtitle {
  color: #839d89;
  font-size: 0.68rem;
}

/* Hazard Tape Striping */
.hazard-stripe-bar {
  height: 6px;
  background: repeating-linear-gradient(
    -45deg,
    #111,
    #111 8px,
    #ffb000 8px,
    #ffb000 16px
  );
  border-radius: 1px;
  margin-bottom: 10px;
  opacity: 0.85;
}
.hazard-stripe-bar.danger {
  background: repeating-linear-gradient(
    -45deg,
    #1a0505,
    #1a0505 8px,
    #ff3344 8px,
    #ff3344 16px
  );
}

/* 4. MODULAR HEAVY FREIGHTER MANIFEST BARS */
.freighter-card {
  background: var(--cel-bg-card);
  border: 1px solid var(--cel-border-hull);
  border-left: 4px solid var(--cel-amber-crt);
  border-radius: 3px;
  padding: 12px;
  color: #c9d6cb;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  position: relative;
  box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.6);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.freighter-card:hover {
  border-color: var(--cel-amber-crt);
  box-shadow: inset 0 0 16px rgba(255, 176, 0, 0.1), 0 0 10px rgba(0, 0, 0, 0.6);
}
.freighter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.freighter-name {
  color: var(--cel-amber-crt);
  font-family: 'Consolas', monospace;
  font-weight: bold;
  font-size: 0.82rem;
}
.freighter-flavor {
  font-size: 0.66rem;
  color: #799180;
  line-height: 1.3;
  margin-bottom: 8px;
  font-style: italic;
}

/* Manifest Breakdown Component */
.manifest-box {
  background: #060e08;
  border: 1px solid #142a18;
  border-radius: 3px;
  padding: 8px;
  margin: 8px 0;
}
.manifest-label {
  font-family: 'Consolas', monospace;
  font-size: 0.66rem;
  text-transform: uppercase;
  color: #8dafa0;
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
}
.manifest-segmented-bar {
  display: flex;
  height: 12px;
  border-radius: 2px;
  overflow: hidden;
  background: #0a140c;
  border: 1px solid #17331d;
  margin-bottom: 6px;
}
.manifest-seg {
  height: 100%;
  transition: width 0.3s ease;
  position: relative;
}
.manifest-seg.food {
  background: linear-gradient(90deg, #b45309, #f59e0b);
}
.manifest-seg.steel {
  background: linear-gradient(90deg, #475569, #94a3b8);
}
.manifest-seg.uniforms {
  background: linear-gradient(90deg, #0284c7, #38bdf8);
}
.manifest-seg.cryo {
  background: linear-gradient(90deg, #c2410c, #f97316);
}
.manifest-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  font-family: 'Consolas', monospace;
  font-size: 0.65rem;
}
.manifest-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #a8bba9;
}
.manifest-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  display: inline-block;
}
.manifest-dot.food { background: #f59e0b; }
.manifest-dot.steel { background: #94a3b8; }
.manifest-dot.uniforms { background: #38bdf8; }
.manifest-dot.cryo { background: #f97316; }

/* 5. TACTICAL ESCORT ARMORY CARDS */
.escort-card {
  background: var(--cel-bg-card);
  border: 1px solid var(--cel-border-hull);
  border-left: 4px solid var(--cel-green-term);
  border-radius: 3px;
  padding: 12px;
  color: #c9d6cb;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.6);
}
.escort-card:hover {
  border-color: var(--cel-green-term);
}
.escort-name {
  color: var(--cel-green-term);
  font-family: 'Consolas', monospace;
  font-weight: bold;
  font-size: 0.82rem;
}
.escort-firepower-badge {
  font-family: 'Consolas', monospace;
  font-size: 0.72rem;
  background: #081a0e;
  border: 1px solid #1d4d28;
  color: var(--cel-green-term);
  padding: 2px 6px;
  border-radius: 2px;
  display: inline-block;
  margin-top: 4px;
}

/* 6. INTERPLANETARY ROUTES & TACTICAL CONVOY DEFENSE GAUGE */
.route-card {
  background: #09130c;
  border: 1px solid var(--cel-border-hull);
  border-radius: 4px;
  padding: 12px;
  margin-bottom: 12px;
  position: relative;
  font-family: 'Consolas', monospace;
  box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.75);
}
.route-card.secured {
  border-left: 5px solid var(--cel-green-term);
}
.route-card.vulnerable {
  border-left: 5px solid var(--cel-red-alarm);
}
.route-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.route-title {
  color: #cde4d3;
  font-weight: bold;
  font-size: 0.86rem;
}
.route-specs {
  font-size: 0.68rem;
  color: #799781;
}
.route-defense-meter {
  background: #040905;
  border: 1px solid #162f1b;
  border-radius: 3px;
  height: 14px;
  overflow: hidden;
  display: flex;
  margin: 6px 0;
  position: relative;
}
.route-defense-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #34d399);
  transition: width 0.3s ease;
}
.route-defense-fill.underpowered {
  background: linear-gradient(90deg, #b91c1c, #f87171);
}

/* 7. MEGASTRUCTURE PENAL OUTPOST CAD MATRIX */
.cad-blueprint-board {
  background: #060e14;
  background-image: 
    linear-gradient(rgba(20, 60, 95, 0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 60, 95, 0.35) 1px, transparent 1px);
  background-size: 20px 20px;
  border: 2px solid #163e63;
  border-radius: 4px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: inset 0 0 30px rgba(0, 10, 25, 0.9);
}
.cad-megastructure-card {
  background: rgba(8, 22, 36, 0.95);
  border: 1px solid #1d4f7c;
  border-left: 5px solid #38bdf8;
  border-radius: 3px;
  padding: 12px;
  margin-bottom: 12px;
  color: #d8e8f8;
}
.cad-megastructure-card.completed {
  border-left-color: #10b981;
  background: rgba(6, 28, 18, 0.95);
  border-color: #1a5732;
}
.cad-stage-meter {
  height: 12px;
  background: #040c14;
  border: 1px solid #163654;
  border-radius: 2px;
  overflow: hidden;
  margin: 6px 0;
}
.cad-stage-bar {
  height: 100%;
  background: linear-gradient(90deg, #0284c7, #38bdf8);
  transition: width 0.3s ease;
}
.cad-commit-btn {
  background: #0e243a;
  border: 1px solid #38bdf8;
  color: #38bdf8;
  font-size: 0.70rem;
  font-family: 'Consolas', monospace;
  padding: 3px 8px;
  border-radius: 2px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.15s ease;
}
.cad-commit-btn:hover:not(:disabled) {
  background: #1e4975;
  color: #ffffff;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
}
.cad-commit-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: #203548;
  color: #556c7e;
}

/* Colony Amenities Grid */
.colony-amenity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.colony-amenity-card {
  background: #07121b;
  border: 1px solid #15324d;
  border-radius: 4px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.colony-amenity-card.active {
  border-left: 4px solid #38bdf8;
}

/* 8. FLEET & CONVOY ROSTER TABLES */
.convoys-roster-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 0.72rem;
  color: #b1cab5;
}
.convoys-roster-table th {
  background: #09170d;
  color: var(--cel-green-term);
  padding: 6px 8px;
  text-align: left;
  border-bottom: 2px solid #1b3d22;
  font-weight: bold;
}
.convoys-roster-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #112616;
}
.convoys-roster-table tr:hover {
  background: rgba(51, 255, 102, 0.05);
}

/* Shipyard Cost Badges */
.shipyard-cost-pill {
  background: #060e08;
  border: 1px solid #16331c;
  border-radius: 3px;
  padding: 2px 6px;
  font-size: 0.66rem;
  font-family: 'Consolas', monospace;
  color: #92b89a;
}
