:root {
  --bg: #0b0f14;
  --panel: rgba(20, 25, 36, 0.85);
  --border: rgba(255,255,255,0.08);
  --text: #e6e9f0;
  --muted: #9aa3b2;

  --blue: #4aa3ff;
  --green: #67e480;
  --mars: #d96b3b;
  --mars-dark: #3a1f14;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont;
  background: radial-gradient(1200px 800px at 30% 20%, #141a2a, var(--bg));
  color: var(--text);
}

/* ===== HEADER ===== */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(12,15,20,0.85);
  backdrop-filter: blur(12px);
}

.title .h1 {
  font-size: 17px;
  font-weight: 700;
}

.title .sub {
  font-size: 12px;
  color: var(--muted);
}

.controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

button {
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
}

button.primary {
  background: rgba(74,163,255,0.15);
}

button.danger {
  background: rgba(255,90,107,0.15);
}

/* ===== MISSION PANEL ===== */

.mission-panel {
  margin: 20px;
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  border-radius: 24px;
  background: linear-gradient(
    180deg,
    rgba(255,255,255,0.04),
    rgba(255,255,255,0.01)
  );
  border: 1px solid var(--border);
}

/* MAP */

.map-section {
  padding: 16px;
  border-radius: 20px;
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--border);
}

canvas {
  width: 100%;
  display: block;
  border-radius: 16px;
}

/* TELEMETRY COLUMN */

.telemetry-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel {
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--panel);
  border: 1px solid var(--border);
}

.panel-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
}

.readout {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco;
  font-size: 12px;
  color: var(--muted);
  white-space: pre-wrap;
}

/* LEGEND */

.legend {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  display: inline-block;
  margin-right: 8px;
}

.swatch.rover    { background: var(--blue); }
.swatch.target   { background: var(--green); }
.swatch.obstacle { background: var(--mars-dark); }
.swatch.path     { background: var(--mars); }
.swatch.explored { background: rgba(217,107,59,0.35); }

/* CAMERA */

.camera-panel img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 12px;
  opacity: 0.9;
}

/* RESPONSIVE */

@media (max-width: 980px) {
  .mission-panel {
    grid-template-columns: 1fr;
  }
}
