/* blob-designer/blob-designer.css */
/* Pokemon Card-Style Blob Fleet Designer */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  min-height: 100vh;
  background: linear-gradient(160deg, #05101e 0%, #0a1e3d 30%, #0c2d52 55%, #062540 100%);
  color: #e2e8f0;
  overflow-y: auto;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1.5px 1.5px at 15% 25%, rgba(255,255,255,0.15) 50%, transparent 100%),
    radial-gradient(1px 1px at 45% 65%, rgba(255,255,255,0.08) 50%, transparent 100%),
    radial-gradient(2px 2px at 75% 15%, rgba(255,255,255,0.12) 50%, transparent 100%),
    radial-gradient(1px 1px at 85% 80%, rgba(255,255,255,0.06) 50%, transparent 100%),
    radial-gradient(1.5px 1.5px at 30% 90%, rgba(255,255,255,0.1) 50%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

/* ── Layout ── */
.page-wrapper {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 16px 48px;
}

.back-link {
  display: inline-block;
  margin-bottom: 10px;
  color: #6ee7b7;
  text-decoration: none;
  font-size: 0.82rem;
  transition: color 0.2s;
}
.back-link:hover { color: #a7f3d0; text-decoration: underline; }

/* ── Fleet Hero Header ── */
.fleet-hero {
  text-align: center;
  margin-bottom: 16px;
}

.fleet-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 4px;
  text-transform: uppercase;
  background: linear-gradient(135deg, #6ee7b7, #38bdf8, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  outline: none;
  cursor: text;
  border-bottom: 2px solid transparent;
  transition: border-color 0.3s;
  min-width: 60px;
  display: inline-block;
}
.fleet-title:hover {
  border-bottom-color: rgba(110, 231, 183, 0.3);
}
.fleet-title:focus {
  border-bottom-color: #6ee7b7;
}

.hero-badges {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 8px;
}

.level-badge {
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.level-badge {
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: #fbbf24;
}

.citizen-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 3px 12px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 16px;
  color: #a5b4fc;
  font-size: 0.7rem;
  letter-spacing: 0.5px;
}

.rank-badge {
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
  transition: all 0.3s;
}

/* ── Progression Section ── */
.progression-section {
  background: linear-gradient(135deg, rgba(15,25,50,0.85), rgba(8,18,38,0.95));
  border: 1px solid rgba(110, 231, 183, 0.12);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
}
.progression-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}
.progression-current {
  display: flex;
  gap: 8px;
  align-items: center;
}
.milestone-text {
  font-size: 0.75rem;
  color: #94a3b8;
  margin: 0;
  font-style: italic;
}

/* slider row inside progression */
.progression-slider {
  margin-bottom: 14px;
}
.progression-slider .slider-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #64748b;
  margin-bottom: 6px;
  display: block;
}

/* preview groups */
.preview-group { margin-bottom: 10px; }
.preview-group-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #475569;
  margin-bottom: 8px;
}
.preview-fork-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.preview-type-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.type-preview-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  transition: border-color 0.3s;
}
.type-preview-card:hover {
  border-color: rgba(110, 231, 183, 0.2);
}
.type-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
}
.type-icon { font-size: 1.1rem; }
.type-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: #e2e8f0;
}
.type-scale-tag {
  margin-left: auto;
  font-size: 0.6rem;
  color: #64748b;
  background: rgba(255,255,255,0.04);
  padding: 1px 6px;
  border-radius: 8px;
}
.type-desc {
  font-size: 0.62rem;
  color: #64748b;
}

/* ── Economy Bar ── */
.economy-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(15,25,50,0.8), rgba(8,18,38,0.9));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
}
.econ-stat {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}
.econ-icon { font-size: 1.2rem; }
.econ-info { display: flex; flex-direction: column; }
.econ-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: #e2e8f0;
  letter-spacing: 0.3px;
}
.econ-label {
  font-size: 0.62rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* ── 3D Viewport Hero ── */
.viewport-hero {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  background:
    radial-gradient(ellipse at 30% 80%, rgba(0,90,120,0.25) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 60%, rgba(0,160,180,0.15) 0%, transparent 50%),
    linear-gradient(180deg,
      #87ceeb 0%,
      #5fb8d9 15%,
      #2a9db8 30%,
      #1a7a8a 45%,
      #0e5f6e 60%,
      #094a58 75%,
      #073a46 100%);
  margin-bottom: 16px;
}

#blob-viewport {
  width: 100%;
  aspect-ratio: 16 / 7;
  max-height: 320px;
  cursor: grab;
}
#blob-viewport:active { cursor: grabbing; }

.viewport-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 12px 16px;
  background: linear-gradient(transparent, rgba(0,0,0,0.4));
}

/* ── XP Bar ── */
.xp-bar-container { margin: 0; }
.xp-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
}
.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #6ee7b7, #38bdf8);
  border-radius: 3px;
  transition: width 0.6s ease;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}
.xp-bar-text {
  font-size: 0.7rem;
  color: #94a3b8;
  margin-top: 3px;
  text-align: right;
}

/* ── Fleet Stats Bar ── */
.fleet-stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}

.fleet-stat {
  text-align: center;
  padding: 12px 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
}

.fs-value {
  display: block;
  font-size: 1.3rem;
  font-weight: 800;
  color: #f1f5f9;
  font-variant-numeric: tabular-nums;
}

.fs-label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #64748b;
  margin-top: 2px;
}

/* ── Section Header ── */
.section-header {
  text-align: center;
  margin-bottom: 20px;
}

.section-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #94a3b8;
}

.section-header p {
  font-size: 0.78rem;
  color: #475569;
  margin-top: 4px;
}

/* ═══════════════════════════════════════════
   POKEMON-STYLE BLOB CARDS
   ═══════════════════════════════════════════ */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

/* ── Single Card ── */
.blob-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(170deg, rgba(15,25,50,0.95), rgba(8,18,38,0.98));
  border: 2px solid rgba(148, 163, 184, 0.2);
  cursor: pointer;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  transform-style: preserve-3d;
  animation: cardEntrance 0.5s ease backwards;
}

.blob-card:hover {
  transform: translateY(-6px) scale(1.015);
}

@keyframes cardEntrance {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Rarity borders & glow */
.blob-card.common    { border-color: rgba(148,163,184,0.3); }
.blob-card.uncommon  { border-color: rgba(16,185,129,0.5); }
.blob-card.rare      { border-color: rgba(59,130,246,0.5); }
.blob-card.epic      { border-color: rgba(168,85,247,0.5); }
.blob-card.legendary { border-color: rgba(245,158,11,0.6); }

.blob-card.common:hover    { box-shadow: 0 8px 30px rgba(148,163,184,0.15); }
.blob-card.uncommon:hover  { box-shadow: 0 8px 30px rgba(16,185,129,0.25), 0 0 60px rgba(16,185,129,0.08); }
.blob-card.rare:hover      { box-shadow: 0 8px 35px rgba(59,130,246,0.3), 0 0 60px rgba(59,130,246,0.1); }
.blob-card.epic:hover      { box-shadow: 0 8px 40px rgba(168,85,247,0.35), 0 0 80px rgba(168,85,247,0.12); }
.blob-card.legendary:hover { box-shadow: 0 8px 50px rgba(245,158,11,0.45), 0 0 100px rgba(245,158,11,0.15); }

/* Legendary pulsing border */
.blob-card.legendary {
  animation: cardEntrance 0.5s ease backwards, legendaryPulse 3s ease-in-out infinite;
}
@keyframes legendaryPulse {
  0%, 100% { border-color: rgba(245,158,11,0.4); }
  50%      { border-color: rgba(245,158,11,0.8); }
}

/* Holographic shimmer overlay */
.blob-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 20%,
    rgba(255, 230, 120, 0.06) 30%,
    rgba(120, 220, 255, 0.08) 45%,
    rgba(200, 130, 255, 0.06) 55%,
    rgba(120, 255, 200, 0.08) 65%,
    transparent 80%
  );
  background-size: 300% 300%;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s;
}
.blob-card:hover::before {
  opacity: 1;
  animation: holoShimmer 3s linear infinite;
}
@keyframes holoShimmer {
  0%   { background-position: 300% 50%; }
  100% { background-position: -300% 50%; }
}

/* ── Card Content ── */
.card-content {
  position: relative;
  z-index: 1;
  padding: 16px;
}

/* Card Header — module identity */
.card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.module-icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
}

.module-title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #f1f5f9;
  flex: 1;
}

.blob-name {
  display: none;
}

.power-badge {
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1px;
}
.power-badge.common    { background: rgba(148,163,184,0.15); color: #94a3b8; }
.power-badge.uncommon  { background: rgba(16,185,129,0.15); color: #6ee7b7; }
.power-badge.rare      { background: rgba(59,130,246,0.15); color: #93c5fd; }
.power-badge.epic      { background: rgba(168,85,247,0.15); color: #c4b5fd; }
.power-badge.legendary { background: rgba(245,158,11,0.2); color: #fcd34d; }

/* Card Avatar */
.card-avatar {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 8px 0 12px;
  position: relative;
}

.blob-render {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  overflow: hidden;
  filter: drop-shadow(0 0 18px hsla(var(--card-hue, 150), 70%, 50%, 0.35));
  animation: glowPulse 3s ease-in-out infinite;
  animation-delay: var(--anim-delay, 0s);
}

.blob-canvas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
}

@keyframes glowPulse {
  0%, 100% { filter: drop-shadow(0 0 18px hsla(150, 70%, 50%, 0.35)); }
  50%      { filter: drop-shadow(0 0 28px hsla(150, 70%, 50%, 0.55)); }
}

.rarity-label {
  margin-top: 8px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 2.5px;
  text-transform: uppercase;
}
.rarity-label.common    { color: #94a3b8; }
.rarity-label.uncommon  { color: #6ee7b7; }
.rarity-label.rare      { color: #60a5fa; }
.rarity-label.epic      { color: #c084fc; }
.rarity-label.legendary { color: #fbbf24; text-shadow: 0 0 8px rgba(251,191,36,0.4); }

/* Starter badge */
.starter-badge {
  position: absolute;
  top: -4px;
  right: calc(50% - 64px);
  background: rgba(251, 191, 36, 0.2);
  border: 1px solid rgba(251, 191, 36, 0.5);
  color: #fbbf24;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 8px;
  letter-spacing: 0.5px;
}

/* Type Bar */
.card-type-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid rgba(255,255,255,0.06);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 10px;
}

.training-profile {
  font-size: 0.72rem;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.5px;
}

.secondary-module {
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
}

/* ── Stat Bars ── */
.stat-bars {
  display: grid;
  gap: 5px;
  margin-bottom: 10px;
}

.stat-bar-row {
  display: grid;
  grid-template-columns: 32px 1fr 28px;
  align-items: center;
  gap: 6px;
}

.stat-bar-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #64748b;
}

.stat-bar-track {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
}

.stat-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.8s ease;
}
.stat-bar-fill.detection  { background: linear-gradient(90deg, #06b6d4, #22d3ee); }
.stat-bar-fill.navigation { background: linear-gradient(90deg, #ca8a04, #eab308); }
.stat-bar-fill.mapping    { background: linear-gradient(90deg, #2563eb, #3b82f6); }
.stat-bar-fill.synergy    { background: linear-gradient(90deg, #7c3aed, #a855f7); }

.stat-bar-value {
  font-size: 0.65rem;
  font-weight: 700;
  color: #94a3b8;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ── Module Details ── */
.card-modules {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 8px;
  margin-bottom: 8px;
}

.module-detail {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
  padding: 5px 8px;
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
}

.module-detail.primary {
  border-left: 2px solid rgba(110, 231, 183, 0.5);
}

.module-detail.secondary {
  border-left: 2px solid rgba(100, 116, 139, 0.4);
}

.module-detail-icon {
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}

.module-detail-desc {
  font-size: 0.65rem;
  color: #94a3b8;
  line-height: 1.35;
}

/* ── Card Footer ── */
.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.training-bar-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.training-label {
  font-size: 0.68rem;
  color: #38bdf8;
  font-weight: 700;
  white-space: nowrap;
}

.training-bar {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
  max-width: 60px;
}

.training-fill {
  height: 100%;
  background: linear-gradient(90deg, #0ea5e9, #38bdf8);
  border-radius: 2px;
  transition: width 0.8s ease;
}

.card-stage {
  font-size: 0.65rem;
  color: #6ee7b7;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* ── Controls Section ── */
.controls-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.control-card {
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 16px;
}

.control-card h3 {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 10px;
}

/* Level Slider */
.level-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
#level-slider {
  flex: 1;
  accent-color: #10b981;
}
#level-display {
  min-width: 36px;
  text-align: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: #fbbf24;
}
.stage-info {
  margin-top: 6px;
  font-size: 0.78rem;
}
.stage-name { color: #6ee7b7; font-weight: 600; }
.stage-desc { color: #94a3b8; margin-left: 6px; }

/* Colour Picker */
.colour-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
#colour-picker {
  width: 44px;
  height: 32px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: none;
}
#colour-hex {
  font-family: monospace;
  font-size: 0.85rem;
  color: #e2e8f0;
}
.colour-reset {
  margin-left: auto;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.1);
  background: transparent;
  color: #94a3b8;
  font-size: 0.72rem;
  cursor: pointer;
}
.colour-reset:hover { color: #e2e8f0; border-color: rgba(255,255,255,0.2); }

/* ── Bottom Row ── */
.bottom-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
}

.dl-btn {
  padding: 10px 20px;
  border-radius: 10px;
  border: 1px solid rgba(16,185,129,0.3);
  background: rgba(16,185,129,0.1);
  color: #6ee7b7;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.dl-btn:hover {
  background: rgba(16,185,129,0.2);
  border-color: #10b981;
  box-shadow: 0 4px 15px rgba(16,185,129,0.2);
}

.milestone-text {
  font-size: 0.82rem;
  color: #94a3b8;
  line-height: 1.5;
}
.milestone-text strong { color: #6ee7b7; }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: rgba(16,185,129,0.92);
  color: #fff;
  padding: 10px 24px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: transform 0.3s ease;
  z-index: 9999;
  box-shadow: 0 4px 20px rgba(16,185,129,0.3);
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ═══════════════════════════════════════════
   MODE TOGGLE & NAVIGATION
   ═══════════════════════════════════════════ */

.mode-toggle {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-bottom: 16px;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 4px;
}

.toggle-btn {
  flex: 1;
  padding: 10px 18px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #64748b;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.toggle-btn:hover {
  color: #94a3b8;
  background: rgba(255,255,255,0.04);
}

.toggle-btn.active {
  background: rgba(16,185,129,0.15);
  color: #6ee7b7;
  box-shadow: 0 2px 10px rgba(16,185,129,0.15);
}

.blob-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.05);
  color: #94a3b8;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-btn:hover {
  background: rgba(16,185,129,0.15);
  border-color: rgba(16,185,129,0.4);
  color: #6ee7b7;
}

.nav-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.5px;
}

/* ═══════════════════════════════════════════
   FLEET SUMMARY (Fleet View)
   ═══════════════════════════════════════════ */

/* ═══════════════════════════════════════════
   BATTLE COMMAND CENTER (Standout Feature)
   ═══════════════════════════════════════════ */

.battle-command-center {
  position: relative;
  background: linear-gradient(165deg, rgba(20,15,40,0.98), rgba(10,5,25,0.99));
  border: 2px solid transparent;
  border-radius: 20px;
  padding: 0;
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 60px rgba(139,92,246,0.1), inset 0 1px 0 rgba(255,255,255,0.05);
}

.battle-command-center::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 22px;
  background: linear-gradient(135deg, #f87171, #fb923c, #fbbf24, #8b5cf6, #f87171);
  background-size: 300% 300%;
  animation: battleGlow 3s linear infinite;
  z-index: -1;
}

@keyframes battleGlow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Header */
.bcc-header {
  padding: 20px 24px 14px;
  text-align: center;
  background: linear-gradient(180deg, rgba(248,113,113,0.1), transparent);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.bcc-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 6px;
}

.bcc-icon {
  font-size: 1.6rem;
  filter: drop-shadow(0 0 12px rgba(248,113,113,0.6));
  animation: swordPulse 2s ease-in-out infinite;
}

@keyframes swordPulse {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.1) rotate(5deg); }
}

.bcc-title {
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: 4px;
  text-transform: uppercase;
  background: linear-gradient(90deg, #f87171, #fbbf24, #f87171);
  background-size: 200% 100%;
  animation: titleShimmer 3s linear infinite;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
}

@keyframes titleShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.bcc-rank {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--rank-color) 15%, transparent);
  color: var(--rank-color);
  border: 1px solid color-mix(in srgb, var(--rank-color) 40%, transparent);
}

.bcc-subtitle {
  font-size: 0.72rem;
  color: #94a3b8;
  letter-spacing: 1px;
}

/* Main Layout */
.bcc-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 20px 24px;
}

/* Radar Section */
.bcc-radar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.radar-wrapper {
  position: relative;
  width: 200px;
  height: 200px;
}

.battle-radar-canvas {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 20px rgba(139,92,246,0.3));
}

.radar-legend {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.radar-stat {
  padding: 6px 12px;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  font-size: 0.75rem;
  color: #e2e8f0;
}

.radar-stat b {
  font-weight: 700;
  margin-right: 4px;
  color: #a78bfa;
}

.radar-stat.det b { color: #06b6d4; }
.radar-stat.nav b { color: #10b981; }
.radar-stat.map b { color: #8b5cf6; }
.radar-stat.syn b { color: #f472b6; }

/* Battle Stats Ring */
.bcc-battle-ring {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.battle-stat-large {
  display: grid;
  grid-template-columns: 40px 1fr 50px auto;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.battle-stat-large:hover {
  transform: translateX(4px);
  background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04));
  border-color: rgba(255,255,255,0.15);
}

.bsl-icon {
  font-size: 1.4rem;
  text-align: center;
}

.bsl-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: #64748b;
  text-transform: uppercase;
}

.bsl-value {
  font-size: 1.3rem;
  font-weight: 800;
  text-align: right;
}

.battle-stat-large.hp .bsl-value { color: #f87171; text-shadow: 0 0 10px rgba(248,113,113,0.4); }
.battle-stat-large.atk .bsl-value { color: #fb923c; text-shadow: 0 0 10px rgba(251,146,60,0.4); }
.battle-stat-large.def .bsl-value { color: #60a5fa; text-shadow: 0 0 10px rgba(96,165,250,0.4); }
.battle-stat-large.spd .bsl-value { color: #a78bfa; text-shadow: 0 0 10px rgba(167,139,250,0.4); }
.battle-stat-large.crt .bsl-value { color: #fbbf24; text-shadow: 0 0 10px rgba(251,191,36,0.4); }

.bsl-bar {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
}

.bsl-fill {
  height: 100%;
  width: var(--pct);
  background: var(--color);
  border-radius: 3px;
  box-shadow: 0 0 8px var(--color);
  transition: width 0.6s ease;
}

/* Top Contributors */
.bcc-contributors {
  padding: 16px 24px;
  background: rgba(0,0,0,0.2);
  border-top: 1px solid rgba(255,255,255,0.06);
}

.contrib-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.contrib-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #e2e8f0;
}

.contrib-avg {
  font-size: 0.75rem;
  color: #64748b;
}

.contrib-avg strong {
  color: #a78bfa;
  font-weight: 800;
}

.contrib-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contributor-row {
  display: grid;
  grid-template-columns: 30px 1fr auto 50px;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(255,255,255,0.03), transparent);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  transition: all 0.2s ease;
}

.contributor-row:hover {
  background: linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  transform: translateX(2px);
}

.contrib-rank {
  font-size: 0.7rem;
  font-weight: 800;
  color: #fbbf24;
}

.contributor-row:nth-child(1) .contrib-rank { color: #fbbf24; }
.contributor-row:nth-child(2) .contrib-rank { color: #94a3b8; }
.contributor-row:nth-child(3) .contrib-rank { color: #cd7f32; }

.contrib-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: #e2e8f0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contrib-rarity {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.contrib-power {
  font-size: 0.9rem;
  font-weight: 800;
  color: #a78bfa;
  text-align: right;
}

/* Footer */
.bcc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: rgba(0,0,0,0.3);
  border-top: 1px solid rgba(255,255,255,0.06);
}

.bcc-types {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.type-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #e2e8f0;
}

.bcc-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.72rem;
  color: #64748b;
}

.bcc-meta strong {
  color: #e2e8f0;
  font-weight: 700;
}

.bcc-meta .esg-val {
  color: #10b981;
  text-shadow: 0 0 8px rgba(16,185,129,0.4);
}

.deploy-status {
  padding: 4px 10px;
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  color: #64748b;
}

.deploy-status.active {
  color: #10b981;
  background: rgba(16,185,129,0.1);
  animation: deployGlow 2s ease-in-out infinite;
}

@keyframes deployGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0.3); }
  50% { box-shadow: 0 0 0 4px rgba(16,185,129,0); }
}

/* Responsive */
@media (max-width: 700px) {
  .bcc-main {
    grid-template-columns: 1fr;
  }
  .radar-wrapper {
    width: 180px;
    height: 180px;
  }
  .bcc-footer {
    flex-direction: column;
    gap: 12px;
  }
}

/* Legacy support */
.fleet-summary, .fleet-command-center { display: none; }

/* ── Centered Viewport (narrower) ── */
.viewport-hero.viewport-centered {
  max-width: 400px;
  margin: 0 auto 16px auto;
}

.viewport-centered #blob-viewport {
  aspect-ratio: 1 / 1;
  max-height: 300px;
}

/* Radar Chart for Fleet Averages */
.fleet-radar-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 16px 0;
}

.fleet-radar-canvas {
  width: 220px;
  height: 220px;
}

/* Hide old horizontal stats bar */
.fleet-stats-bar,
.fleet-stats-side {
  display: none;
}

.fleet-composition {
  margin-bottom: 12px;
}

.empty-msg {
  color: #475569;
  text-align: center;
  padding: 32px;
}

/* ═══════════════════════════════════════════
   DETAIL PANEL (Individual View)
   ═══════════════════════════════════════════ */

.detail-panel {
  background: linear-gradient(170deg, rgba(15,25,50,0.95), rgba(8,18,38,0.98));
  border: 2px solid rgba(148,163,184,0.2);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
  animation: panelSlideIn 0.35s ease;
}

@keyframes panelSlideIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.detail-panel.uncommon  { border-color: rgba(16,185,129,0.5); }
.detail-panel.rare      { border-color: rgba(59,130,246,0.5); }
.detail-panel.epic      { border-color: rgba(168,85,247,0.5); }
.detail-panel.legendary { border-color: rgba(245,158,11,0.6); }

.detail-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.detail-header .module-icon { font-size: 1.6rem; }
.detail-header .module-title { font-size: 1.1rem; font-weight: 700; color: #f1f5f9; flex: 1; }

.detail-rarity {
  text-align: center;
  margin-bottom: 14px;
}

.detail-fork {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 14px;
}

.detail-fork .fork-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.fork-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 2px;
}

.fork-desc {
  font-size: 0.72rem;
  color: #94a3b8;
  line-height: 1.3;
}

.detail-type-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid rgba(255,255,255,0.06);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 14px;
}

.detail-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #475569;
  margin-bottom: 8px;
  margin-top: 14px;
}

.detail-modules {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.mining-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.mining-stat {
  text-align: center;
  padding: 10px 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
}

.mining-value {
  display: block;
  font-size: 1rem;
  font-weight: 800;
  color: #f1f5f9;
  font-variant-numeric: tabular-nums;
}

.mining-label {
  display: block;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #64748b;
  margin-top: 3px;
}

/* Fork Progress */
.fork-progress-section {
  margin-top: 14px;
}

.fork-progress-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 6px;
}

.fork-progress-track {
  height: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
}

.fork-progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

.fork-progress-fill.fork-analyst {
  background: linear-gradient(90deg, #3b82f6, #93c5fd);
  box-shadow: 0 0 8px rgba(59,130,246,0.4);
}

.fork-progress-fill.fork-hunter {
  background: linear-gradient(90deg, #f59e0b, #fcd34d);
  box-shadow: 0 0 8px rgba(245,158,11,0.4);
}

.fork-progress-fill.fork-sentinel {
  background: linear-gradient(90deg, #10b981, #6ee7b7);
  box-shadow: 0 0 8px rgba(16,185,129,0.4);
}

/* ── Spec Card (Futuristic Trading Card) ── */
.spec-card {
  position: relative;
  padding: 18px;
  background: linear-gradient(145deg, rgba(15,23,42,0.95), rgba(30,41,59,0.85));
  border: 1.5px solid var(--type-color, #06b6d4);
  border-radius: 16px;
  box-shadow: 0 0 24px color-mix(in srgb, var(--type-color, #06b6d4) 25%, transparent),
              inset 0 1px 0 rgba(255,255,255,0.06);
  overflow: hidden;
  margin-bottom: 12px;
}
.sc-corner-tl, .sc-corner-tr, .sc-corner-bl, .sc-corner-br {
  position: absolute; width: 16px; height: 16px;
  border-color: var(--type-color, #06b6d4); border-style: solid; border-width: 0;
  opacity: 0.5;
}
.sc-corner-tl { top: 6px; left: 6px; border-top-width: 2px; border-left-width: 2px; border-radius: 4px 0 0 0; }
.sc-corner-tr { top: 6px; right: 6px; border-top-width: 2px; border-right-width: 2px; border-radius: 0 4px 0 0; }
.sc-corner-bl { bottom: 6px; left: 6px; border-bottom-width: 2px; border-left-width: 2px; border-radius: 0 0 0 4px; }
.sc-corner-br { bottom: 6px; right: 6px; border-bottom-width: 2px; border-right-width: 2px; border-radius: 0 0 4px 0; }

.sc-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.sc-type { display: flex; align-items: center; gap: 10px; }
.sc-type-icon { font-size: 2rem; }
.sc-type-name {
  font-size: 1.4rem; font-weight: 800; letter-spacing: 1.5px;
  color: #e2e8f0;
  text-transform: uppercase;
}
.sc-badges { display: flex; gap: 6px; align-items: center; }
.sc-power {
  padding: 3px 10px; border-radius: 10px;
  font-size: 0.72rem; font-weight: 700;
  background: rgba(251,191,36,0.15); color: #fbbf24;
  border: 1px solid rgba(251,191,36,0.3);
}
.sc-rarity {
  padding: 3px 10px; border-radius: 10px;
  font-size: 0.68rem; font-weight: 700;
}

.sc-desc { font-size: 0.76rem; color: #94a3b8; margin-bottom: 4px; font-style: italic; }
.sc-bonus { font-size: 0.7rem; color: #6ee7b7; font-weight: 600; margin-bottom: 2px; }
.sc-scale {
  font-size: 0.68rem; color: #cbd5e1; margin-bottom: 10px;
  padding: 2px 8px; display: inline-block;
  background: rgba(255,255,255,0.05); border-radius: 6px;
}

/* ── Spec Stats Grid (on the card) ── */
.sc-stats {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 4px 8px;
  padding: 10px 0;
  border-top: 1px solid rgba(255,255,255,0.06);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.spec-stat {
  display: flex; align-items: center; gap: 4px;
  font-size: 0.68rem; color: #cbd5e1;
  padding: 3px 0;
}
.spec-icon { font-size: 0.72rem; width: 18px; text-align: center; flex-shrink: 0; }
.spec-label { flex: 1; color: #94a3b8; font-size: 0.62rem; }
.spec-val { font-weight: 700; min-width: 28px; text-align: right; }
.spec-arrow { font-size: 0.58rem; width: 14px; text-align: center; margin: 0 1px; }
.spec-stat.stat-up .spec-arrow,
.spec-stat.stat-up .spec-val.new { color: #6ee7b7; }
.spec-stat.stat-down .spec-arrow,
.spec-stat.stat-down .spec-val.new { color: #f87171; }
.spec-stat.neutral { opacity: 0.6; }

.sc-footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 8px; font-size: 0.72rem;
}
.sc-deploy { color: #64748b; }
.sc-deploy.deployed { color: #6ee7b7; }

/* ── Shape Tier Badge ── */
.shape-tier-badge {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: linear-gradient(145deg, rgba(15,23,42,0.8), rgba(30,41,59,0.6));
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  margin-bottom: 8px;
}
.stb-icon { font-size: 1.4rem; }
.stb-name { font-size: 0.85rem; font-weight: 700; color: #e2e8f0; letter-spacing: 0.5px; }
.stb-desc { width: 100%; font-size: 0.7rem; color: #94a3b8; margin-top: -2px; }
.stb-next { width: 100%; font-size: 0.68rem; color: #64748b; }
.stb-next strong { color: #fbbf24; }
.stb-next.stb-max { color: #fbbf24; font-weight: 600; }

/* ── Type Selector Tabs ── */
.type-selector {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
}
.type-tabs {
  display: flex; gap: 6px; flex: 1;
}
.type-tab {
  display: flex; align-items: center; gap: 5px;
  padding: 7px 12px;
  background: rgba(255,255,255,0.04);
  border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  color: #94a3b8;
  font-size: 0.75rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
}
.type-tab:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.15); }
.type-tab.active {
  background: color-mix(in srgb, var(--type-color) 12%, transparent);
  border-color: var(--type-color);
  color: #e2e8f0;
  box-shadow: 0 0 10px color-mix(in srgb, var(--type-color) 20%, transparent);
}
.tt-icon { font-size: 0.9rem; }
.tt-name { font-size: 0.72rem; }
.balance-tag {
  font-size: 0.7rem; color: #fbbf24; font-weight: 600;
  white-space: nowrap;
}

/* ── Change Panel (appears when selecting a non-current type) ── */
.change-card {
  padding: 14px;
  background: linear-gradient(145deg, rgba(15,23,42,0.9), rgba(30,41,59,0.8));
  border: 1.5px solid var(--type-color, #a855f7);
  border-radius: 14px;
  margin-bottom: 10px;
  box-shadow: 0 0 16px color-mix(in srgb, var(--type-color, #a855f7) 18%, transparent);
}
.cc-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 6px;
}
.cc-icon { font-size: 1.6rem; }
.cc-info { flex: 1; }
.cc-name {
  font-size: 1rem; font-weight: 800; color: #e2e8f0;
  display: block; letter-spacing: 1px; text-transform: uppercase;
}
.cc-desc { font-size: 0.68rem; color: #94a3b8; font-style: italic; }
.cc-bonus { font-size: 0.65rem; color: #6ee7b7; font-weight: 600; }
.cc-cost {
  padding: 4px 12px; border-radius: 10px;
  font-size: 0.78rem; font-weight: 800;
  background: rgba(251,191,36,0.15); color: #fbbf24;
  border: 1px solid rgba(251,191,36,0.35);
  white-space: nowrap;
}
.cc-cost.no-funds {
  background: rgba(239,68,68,0.12); color: #f87171;
  border-color: rgba(239,68,68,0.3);
}
.cc-scale {
  font-size: 0.68rem; color: #cbd5e1; margin-bottom: 8px;
  padding: 2px 8px; display: inline-block;
  background: rgba(255,255,255,0.05); border-radius: 6px;
}
.cc-stats {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 4px 8px;
  padding: 8px 0;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.cc-change-btn {
  display: block; width: 100%;
  padding: 9px 0; margin-top: 8px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--type-color) 18%, transparent), rgba(251,191,36,0.12));
  border: 1px solid color-mix(in srgb, var(--type-color) 45%, transparent);
  border-radius: 10px;
  color: #e2e8f0; font-size: 0.78rem; font-weight: 700;
  cursor: pointer; transition: all 0.2s;
  letter-spacing: 0.8px; text-transform: uppercase;
}
.cc-change-btn:hover:not([disabled]) {
  background: linear-gradient(90deg, color-mix(in srgb, var(--type-color) 28%, transparent), rgba(251,191,36,0.2));
  transform: translateY(-1px);
  box-shadow: 0 4px 16px color-mix(in srgb, var(--type-color) 25%, transparent);
}
.cc-change-btn[disabled] {
  opacity: 0.4; cursor: not-allowed;
  color: #f87171; border-color: rgba(239,68,68,0.25);
  background: rgba(239,68,68,0.08);
}

/* ── Drill-Down Sections (collapsible) ── */
.drill-section {
  margin-top: 8px;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
  overflow: hidden;
}
.drill-title {
  padding: 10px 14px;
  font-size: 0.78rem; font-weight: 700;
  color: #94a3b8; cursor: pointer;
  list-style: none;
  display: flex; align-items: center; gap: 6px;
}
.drill-title::before {
  content: '▶'; font-size: 0.55rem;
  transition: transform 0.2s;
}
.drill-section[open] .drill-title::before {
  transform: rotate(90deg);
}
.drill-title::-webkit-details-marker { display: none; }
.drill-body {
  padding: 0 14px 12px;
}

.starter-tag {
  margin-top: 12px;
  padding: 6px 14px;
  background: rgba(251,191,36,0.1);
  border: 1px solid rgba(251,191,36,0.3);
  border-radius: 10px;
  color: #fbbf24;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.5px;
}

/* ── Impact Section ── */
.impact-section {
  margin-top: 24px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(16,185,129,0.06), rgba(6,182,212,0.04));
  border: 1px solid rgba(16,185,129,0.15);
  border-radius: 16px;
}
.impact-section h3 {
  font-size: 0.85rem;
  color: #6ee7b7;
  margin: 0 0 12px 0;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.impact-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.impact-card {
  text-align: center;
  padding: 14px 8px;
  background: rgba(0,0,0,0.2);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.04);
}
.impact-value {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  color: #e2e8f0;
}
.impact-label {
  font-size: 0.62rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Ecosystem Actions ── */
.ecosystem-actions {
  margin-top: 20px;
}
.ecosystem-actions h3 {
  font-size: 0.85rem;
  color: #94a3b8;
  margin: 0 0 12px 0;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.action-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.2s;
}
.action-card:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(99,102,241,0.3);
  transform: translateY(-2px);
}
.action-icon { font-size: 1.4rem; }
.action-title {
  font-size: 0.75rem;
  color: #e2e8f0;
  font-weight: 600;
}
.action-desc {
  font-size: 0.6rem;
  color: #64748b;
  text-align: center;
}

/* ── Fleet Composition Enhancements ── */
.comp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.comp-header h3 { margin: 0; }
.rank-chip {
  font-size: 0.72rem;
  font-weight: 700;
}
.comp-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 12px;
}
.comp-col {}
.comp-section-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #64748b;
  margin-bottom: 6px;
  margin-top: 10px;
}
.comp-section-label:first-child { margin-top: 0; }
.type-distribution {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.type-chip {
  padding: 2px 8px;
  border: 1px solid;
  border-radius: 10px;
  font-size: 0.68rem;
  font-weight: 600;
}
.combat-stats-mini {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.combat-stat {
  font-size: 0.68rem;
  padding: 2px 6px;
  background: rgba(255,255,255,0.04);
  border-radius: 6px;
  color: #cbd5e1;
}
.deployment-status {
  margin-top: 8px;
}
.deploy-indicator {
  font-size: 0.72rem;
  color: #64748b;
}
.deploy-indicator.active {
  color: #10b981;
}
.comp-footer {
  display: flex;
  gap: 16px;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 0.72rem;
  color: #94a3b8;
}

/* ── Detail Panel Enhancements ── */
.detail-meta-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.blob-type-label {
  padding: 2px 10px;
  border: 1px solid;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
}
.deploy-status {
  font-size: 0.68rem;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}
.deploy-status.deployed {
  background: rgba(16,185,129,0.12);
  color: #6ee7b7;
}
.deploy-status.home {
  background: rgba(148,163,184,0.1);
  color: #94a3b8;
}

/* ── Combat Grid ── */
.combat-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}
.combat-cell {
  text-align: center;
  padding: 8px 2px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
}
.combat-val {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: #e2e8f0;
}
.combat-lbl {
  display: block;
  font-size: 0.55rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .fleet-hero h1 { font-size: 1.5rem; letter-spacing: 2px; }
  .fleet-stats-bar { grid-template-columns: repeat(2, 1fr); }
  .economy-bar { grid-template-columns: repeat(2, 1fr); }
  .controls-section { grid-template-columns: 1fr; }
  .bottom-row { grid-template-columns: 1fr; }
  #blob-viewport { aspect-ratio: 4/3; }
  .mining-stats { grid-template-columns: 1fr; }
  .impact-grid { grid-template-columns: repeat(2, 1fr); }
  .action-grid { grid-template-columns: repeat(2, 1fr); }
  .comp-columns { grid-template-columns: 1fr; }
  .combat-grid { grid-template-columns: repeat(3, 1fr); }
}

/* -------------------------------------------
   COMMAND DECK (unified Battle Command hub)
   ------------------------------------------- */

.command-deck {
  display: block;
  margin: 8px 0 14px;
  padding: 10px;
  border-radius: 18px;
  background: linear-gradient(170deg, rgba(6,14,28,0.65), rgba(10,22,44,0.55));
  border: 1px solid rgba(56,189,248,0.22);
  box-shadow: 0 8px 28px rgba(0,0,0,0.35), inset 0 0 24px rgba(56,189,248,0.05);
}
.command-deck > * { margin-bottom: 10px; }
.command-deck > *:last-child { margin-bottom: 0; }

/* Make the in-card single-blob nav row sit under the BCC title */
.bcc-nav-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 6px;
  padding: 4px 8px;
  background: rgba(8,16,32,0.45);
  border-radius: 10px;
  border: 1px solid rgba(56,189,248,0.14);
}
.bcc-nav-row .nav-label { font-weight: 600; color: #cbd5e1; font-size: 13px; }
.bcc-nav-btn {
  background: rgba(14,165,233,0.15);
  border: 1px solid rgba(56,189,248,0.35);
  color: #e0f2fe;
  padding: 4px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}
.bcc-nav-btn:hover:not([disabled]) { background: rgba(14,165,233,0.28); }
.bcc-nav-btn[disabled] { opacity: 0.35; cursor: not-allowed; }

/* Loadout strip � single-view only */
.bcc-loadout {
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(8,16,32,0.5);
  border: 1px solid rgba(56,189,248,0.18);
  border-radius: 12px;
}
.bcc-loadout-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  color: #e2e8f0;
  font-size: 13px;
}
.bcc-loadout-head .bccl-icon { font-size: 18px; }
.bcc-loadout-head .bccl-kind { color: #94a3b8; font-size: 12px; }
.bcc-loadout-head .bccl-style {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  background: rgba(56,189,248,0.15);
  color: #7dd3fc;
  border: 1px solid rgba(56,189,248,0.3);
}
.bcc-loadout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 6px;
}
.bccl-cell {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 8px;
  background: rgba(15,25,50,0.55);
  border-radius: 8px;
  color: #f1f5f9;
  font-size: 13px;
  font-weight: 600;
}
.bccl-cell i {
  font-style: normal;
  font-size: 10px;
  color: #94a3b8;
  font-weight: 500;
  letter-spacing: 0.4px;
  margin-left: auto;
}

/* Type Preview tabs � 4 per-type cards with mini delta stats */
.bcc-type-previews {
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(8,16,32,0.5);
  border: 1px solid rgba(168,85,247,0.2);
  border-radius: 12px;
}
.bcctp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  color: #e9d5ff;
  font-size: 13px;
  font-weight: 600;
}
.bcctp-head .balance-tag {
  padding: 2px 10px;
  border-radius: 10px;
  background: rgba(251,191,36,0.15);
  color: #fcd34d;
  font-size: 12px;
  border: 1px solid rgba(251,191,36,0.35);
}
.bcctp-head .bcctp-buy-blob {
  background: linear-gradient(180deg, #10b981, #059669);
  border: 1px solid rgba(16,185,129,0.55);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: filter .15s, transform .15s;
}
.bcctp-head .bcctp-buy-blob:hover:not([disabled]) {
  filter: brightness(1.15);
  transform: translateY(-1px);
}
.bcctp-head .bcctp-buy-blob[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}
/* The two-button row inside each type-preview card. */
.type-preview .tp-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 6px;
}
.tp-evolve-btn.preview {
  background: linear-gradient(145deg, rgba(99,102,241,0.35), rgba(139,92,246,0.30));
  border: 1px solid rgba(139,92,246,0.45);
}
.tp-evolve-btn.preview:hover:not([disabled]) {
  background: linear-gradient(145deg, rgba(99,102,241,0.55), rgba(139,92,246,0.45));
}
.tp-evolve-btn.buy {
  background: linear-gradient(145deg, rgba(16,185,129,0.45), rgba(5,150,105,0.40));
  border: 1px solid rgba(16,185,129,0.55);
  color: #ecfdf5;
  font-weight: 700;
}
.tp-evolve-btn.buy:hover:not([disabled]) {
  background: linear-gradient(145deg, rgba(16,185,129,0.65), rgba(5,150,105,0.55));
}
.bcctp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 8px;
}
.type-preview {
  padding: 10px;
  background: rgba(15,25,50,0.65);
  border: 1px solid rgba(148,163,184,0.18);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.2s, transform 0.2s;
}
.type-preview:hover { border-color: rgba(56,189,248,0.45); transform: translateY(-1px); }
.type-preview.current {
  border-color: var(--type-color, #06b6d4);
  background: linear-gradient(165deg, rgba(6,182,212,0.12), rgba(15,25,50,0.7));
}
.tp-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #f1f5f9;
  font-weight: 600;
}
.tp-type-icon { font-size: 18px; }
.tp-type-name { flex: 1; }
.tp-badge.current {
  padding: 2px 8px;
  border-radius: 8px;
  background: rgba(6,182,212,0.25);
  color: #67e8f9;
  font-size: 10px;
  letter-spacing: 0.6px;
  border: 1px solid rgba(6,182,212,0.5);
}
.tp-cost {
  padding: 2px 8px;
  border-radius: 8px;
  background: rgba(251,191,36,0.18);
  color: #fde68a;
  font-size: 11px;
  border: 1px solid rgba(251,191,36,0.4);
}
.tp-cost.no-funds { background: rgba(239,68,68,0.18); color: #fca5a5; border-color: rgba(239,68,68,0.4); }
.tp-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.tp-stat {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 11px;
  background: rgba(8,16,32,0.6);
  color: #cbd5e1;
  border: 1px solid rgba(148,163,184,0.15);
  font-weight: 600;
}
.tp-stat .tp-icon { font-size: 11px; }
.tp-stat.up    { color: #86efac; border-color: rgba(34,197,94,0.4); background: rgba(34,197,94,0.12); }
.tp-stat.down  { color: #fca5a5; border-color: rgba(239,68,68,0.4); background: rgba(239,68,68,0.12); }
.tp-stat.neutral { color: #94a3b8; }
.tp-special {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  background: rgba(139,92,246,0.12);
  border: 1px solid rgba(139,92,246,0.3);
  border-radius: 8px;
  font-size: 11px;
  color: #ddd6fe;
}
.tp-special-label {
  padding: 1px 6px;
  background: rgba(139,92,246,0.35);
  border-radius: 4px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
}
.tp-evolve-btn {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(56,189,248,0.45);
  background: linear-gradient(145deg, rgba(14,165,233,0.35), rgba(6,182,212,0.25));
  color: #f0f9ff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: background 0.15s;
}
.tp-evolve-btn:hover:not([disabled]) { background: linear-gradient(145deg, rgba(14,165,233,0.55), rgba(6,182,212,0.45)); }
.tp-evolve-btn[disabled] { opacity: 0.4; cursor: not-allowed; filter: grayscale(0.4); }

/* -------------------------------------------
   BCC embedded 3D viewport slot
   ------------------------------------------- */
.bcc-viewport-slot {
  display: block;
  width: 100%;
  margin: 10px 0 12px;
}
/* When the viewport-hero is adopted into the BCC, strip its outer margin
   and constrain its height so it reads as part of the card. */
.bcc-viewport-slot > .viewport-hero,
.bcc-viewport-slot > .viewport-hero.viewport-centered {
  margin: 0;
  max-width: none;
  width: 100%;
  border-radius: 14px;
}
.bcc-viewport-slot > .viewport-hero #blob-viewport {
  aspect-ratio: 16 / 9;
  max-height: 260px;
  width: 100%;
}

/* -------------------------------------------
   BCC type-preview: two-click Preview ? Evolve
   ------------------------------------------- */
/* Previewing state � highlighted like current, but in amber/purple */
.type-preview.previewing {
  border-color: #a855f7;
  background: linear-gradient(165deg, rgba(168,85,247,0.14), rgba(15,25,50,0.75));
  box-shadow: 0 0 0 1px rgba(168,85,247,0.25) inset, 0 4px 14px rgba(168,85,247,0.2);
}
.tp-badge.preview {
  padding: 2px 8px;
  border-radius: 8px;
  background: rgba(168,85,247,0.25);
  color: #e9d5ff;
  font-size: 10px;
  letter-spacing: 0.6px;
  border: 1px solid rgba(168,85,247,0.5);
  animation: tp-pulse 1.6s ease-in-out infinite;
}
@keyframes tp-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}
/* Evolve action button (post-preview click-to-confirm) */
.tp-evolve-btn.evolve {
  background: linear-gradient(145deg, rgba(34,197,94,0.45), rgba(16,185,129,0.35));
  border-color: rgba(34,197,94,0.6);
  color: #f0fdf4;
}
.tp-evolve-btn.evolve:hover:not([disabled]) {
  background: linear-gradient(145deg, rgba(34,197,94,0.65), rgba(16,185,129,0.55));
}
