/* ── Fleet Panel ─────────────────────────────────────────────────────────── */
#fleet-panel {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  pointer-events: none;
}

.fleet-cards {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  pointer-events: all;
}

.fleet-card {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(4, 14, 26, 0.82);
  border: 1px solid rgba(0, 180, 255, 0.22);
  border-radius: 3px;
  padding: 7px 10px 7px 8px;
  cursor: pointer;
  min-width: 110px;
  transition: border-color 0.12s, background 0.12s;
  backdrop-filter: blur(4px);
}

.fleet-card:hover {
  background: rgba(0, 40, 70, 0.90);
  border-color: rgba(0, 210, 255, 0.55);
}

.fleet-card.active {
  background: rgba(0, 50, 90, 0.90);
  border-color: rgba(0, 210, 255, 0.80);
  box-shadow: 0 0 10px rgba(0, 180, 255, 0.25);
}

/* Number badge */
.fleet-num {
  width: 22px;
  height: 22px;
  border-radius: 3px;
  background: rgba(0, 120, 200, 0.30);
  border: 1px solid rgba(0, 180, 255, 0.45);
  color: rgba(0, 220, 255, 0.90);
  font: 700 12px/22px monospace;
  text-align: center;
  flex-shrink: 0;
}

.fleet-card.active .fleet-num {
  background: rgba(0, 160, 255, 0.45);
  border-color: rgba(0, 220, 255, 0.80);
  color: #fff;
}

/* Body */
.fleet-body {
  flex: 1;
  min-width: 0;
}

.fleet-name {
  font: 600 10px/1 monospace;
  color: rgba(180, 220, 255, 0.85);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fleet-count {
  font: 400 9px/1 monospace;
  color: rgba(120, 170, 210, 0.65);
  letter-spacing: 0.04em;
  margin-bottom: 5px;
}

/* Bar tracks */
.fleet-bars {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.fleet-bar-track {
  height: 3px;
  background: rgba(255,255,255,0.07);
  border-radius: 2px;
  overflow: hidden;
  width: 80px;
}

.fleet-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.15s;
}

.fleet-bar-fill.hull      { background: rgba(80, 200, 100, 0.80); }
.fleet-bar-fill.hull.warn { background: rgba(220, 160, 40, 0.85); }
.fleet-bar-fill.hull.crit { background: rgba(220, 60, 40, 0.90); }
.fleet-bar-fill.shield    { background: rgba(60, 140, 255, 0.75); }

/* Hotkey hint */
.fleet-hint {
  font: 400 8px/1 monospace;
  color: rgba(0, 180, 255, 0.30);
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.fleet-card:hover .fleet-hint,
.fleet-card.active .fleet-hint {
  color: rgba(0, 200, 255, 0.55);
}

/* ── Fleet Help Button ───────────────────────────────────────────────────── */
#fleet-help-btn {
  position: fixed;
  bottom: 14px;
  right: 18px;
  z-index: 22;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(4, 14, 26, 0.82);
  border: 1px solid rgba(0, 180, 255, 0.30);
  color: rgba(0, 200, 255, 0.70);
  font: 700 13px/26px monospace;
  text-align: center;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  user-select: none;
}
#fleet-help-btn:hover,
#fleet-help-btn.active {
  background: rgba(0, 50, 90, 0.90);
  border-color: rgba(0, 210, 255, 0.70);
  color: #fff;
}

/* ── Fleet Help Panel ────────────────────────────────────────────────────── */
#fleet-help-panel {
  position: fixed;
  bottom: 48px;
  right: 18px;
  z-index: 22;
  width: 310px;
  background: rgba(4, 14, 26, 0.92);
  border: 1px solid rgba(0, 180, 255, 0.28);
  border-radius: 5px;
  backdrop-filter: blur(6px);
  font-family: monospace;
  display: none;
  pointer-events: all;
}
#fleet-help-panel.open {
  display: block;
}

.fh-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 12px 8px;
  border-bottom: 1px solid rgba(0, 180, 255, 0.14);
}
.fh-header > span {
  font: 700 11px/1 monospace;
  color: rgba(0, 220, 255, 0.90);
  letter-spacing: 0.1em;
}
.fh-close {
  background: none;
  border: none;
  color: rgba(0, 180, 255, 0.50);
  font: 700 13px/1 monospace;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.fh-close:hover { color: rgba(0, 220, 255, 0.90); }

.fh-section {
  padding: 10px 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fh-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.fh-row kbd {
  display: inline-block;
  background: rgba(0, 80, 140, 0.45);
  border: 1px solid rgba(0, 180, 255, 0.35);
  border-radius: 3px;
  padding: 2px 6px;
  font: 700 10px/1.4 monospace;
  color: rgba(0, 220, 255, 0.90);
  white-space: nowrap;
  flex-shrink: 0;
}
.fh-plus {
  font: 700 11px/1.4 monospace;
  color: rgba(0, 180, 255, 0.50);
  flex-shrink: 0;
  align-self: center;
}
.fh-icon {
  font-size: 14px;
  line-height: 1.4;
  flex-shrink: 0;
}
.fh-desc {
  font: 400 10px/1.5 monospace;
  color: rgba(160, 210, 255, 0.80);
}
.fh-desc em {
  color: rgba(100, 170, 220, 0.55);
  font-style: normal;
}

.fh-footer {
  padding: 6px 12px 8px;
  border-top: 1px solid rgba(0, 180, 255, 0.10);
  font: 400 9px/1 monospace;
  color: rgba(0, 180, 255, 0.30);
  letter-spacing: 0.06em;
}

/* ── Reinforce (+) button on each fleet card ─────────────────────────────── */
.fleet-reinforce-btn {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  background: rgba(0, 120, 200, 0.18);
  border: 1px solid rgba(0, 180, 255, 0.32);
  border-radius: 3px;
  color: rgba(0, 210, 255, 0.65);
  font: 700 15px/22px monospace;
  text-align: center;
  cursor: pointer;
  padding: 0;
  pointer-events: all;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.fleet-reinforce-btn:hover,
.fleet-reinforce-btn.open {
  background: rgba(0, 200, 255, 0.28);
  border-color: rgba(0, 220, 255, 0.70);
  color: #fff;
  box-shadow: 0 0 8px rgba(0, 200, 255, 0.30);
}

/* ── Fleet Build / Reinforce Panel ──────────────────────────────────────── */
#fleet-build-panel {
  position: fixed;
  bottom: 88px;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  z-index: 21;
  display: none;
  flex-direction: column;
  background: rgba(4, 14, 26, 0.93);
  border: 1px solid rgba(0, 180, 255, 0.28);
  border-radius: 4px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: monospace;
  pointer-events: all;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.55), 0 0 16px rgba(0, 160, 255, 0.10);
}
#fleet-build-panel.open { display: flex; }

.fb-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 12px 8px;
  border-bottom: 1px solid rgba(0, 180, 255, 0.14);
  flex-shrink: 0;
}
.fb-title {
  font: 700 11px/1 monospace;
  color: rgba(0, 220, 255, 0.90);
  letter-spacing: 0.10em;
}
.fb-x {
  background: none;
  border: none;
  color: rgba(0, 180, 255, 0.50);
  font: 700 13px/1 monospace;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.fb-x:hover { color: rgba(0, 220, 255, 0.90); }

.fb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(0, 180, 255, 0.07);
}
.fb-row:last-of-type { border-bottom: none; }
.fb-row:hover { background: rgba(0, 180, 255, 0.04); }

.fb-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 5px rgba(0, 200, 255, 0.45));
}
.fb-mid {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fb-name {
  font: 700 12px/1 monospace;
  color: rgba(220, 245, 255, 0.90);
  letter-spacing: 0.04em;
}
.fb-chips {
  display: flex;
  gap: 8px;
}
.fb-chip {
  font: 400 10px/1 monospace;
  color: rgba(150, 205, 240, 0.75);
  letter-spacing: 0.03em;
}
.fb-chip.warn {
  color: rgba(255, 90, 70, 0.92);
  text-shadow: 0 0 6px rgba(255, 50, 30, 0.40);
}

.fb-btn {
  flex-shrink: 0;
  padding: 6px 11px;
  font: 700 10px/1 monospace;
  letter-spacing: 0.08em;
  background: rgba(0, 160, 255, 0.12);
  border: 1px solid rgba(0, 200, 255, 0.45);
  color: rgba(0, 220, 255, 0.90);
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.12s, box-shadow 0.12s;
  pointer-events: all;
}
.fb-btn:hover:not([disabled]) {
  background: rgba(0, 200, 255, 0.22);
  box-shadow: 0 0 10px rgba(0, 200, 255, 0.30);
}
.fb-btn.fb-dim,
.fb-btn[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: rgba(255, 80, 60, 0.25);
  color: rgba(255, 120, 100, 0.55);
  background: rgba(40, 0, 0, 0.08);
}

.fb-empty {
  padding: 16px 14px;
  font: 400 10px/1.5 monospace;
  color: rgba(255, 160, 60, 0.82);
  text-align: center;
  letter-spacing: 0.06em;
}
.fb-src {
  padding: 6px 12px 8px;
  border-top: 1px solid rgba(0, 180, 255, 0.10);
  font: 400 9px/1 monospace;
  color: rgba(0, 180, 255, 0.38);
  letter-spacing: 0.06em;
  flex-shrink: 0;
}
