:root {
  color-scheme: dark;
  --bg: #05070d;
  --panel: #0d1420;
  --panel-border: #26364d;
  --text: #e6edf5;
  --muted: #9dacbd;
  --accent: #6fb7ff;
  --button: #162235;
  --button-border: #3b5270;
  --canvas-border: #31445f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 35% 18%, rgba(41, 87, 140, 0.18), transparent 32rem),
    linear-gradient(135deg, #03050a 0%, var(--bg) 58%, #080d16 100%);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
}

.sim-area {
  min-width: 0;
  min-height: 420px;
  display: grid;
  place-items: center;
  padding: 18px;
}

#space-canvas {
  width: min(100%, 1100px);
  height: min(72vh, 720px);
  display: block;
  border: 1px solid var(--canvas-border);
  border-radius: 8px;
  background: #070b12;
  box-shadow:
    0 0 0 1px rgba(111, 183, 255, 0.08),
    0 22px 70px rgba(0, 0, 0, 0.45);
  cursor: default;
}

.control-panel {
  border-left: 1px solid var(--panel-border);
  background:
    linear-gradient(180deg, rgba(21, 31, 48, 0.98), var(--panel));
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

h1 {
  margin: 0;
  font-size: 1.1rem;
  letter-spacing: 0;
}

.status {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
  font-size: 0.93rem;
}

.controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

button,
input {
  font: inherit;
}

button {
  min-height: 36px;
  border: 1px solid var(--button-border);
  border-radius: 6px;
  background: linear-gradient(180deg, #1a2a41, var(--button));
  color: var(--text);
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

button:hover {
  border-color: #6fb7ff;
  color: #ffffff;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

label {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.92rem;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.inspector {
  flex: 1;
  min-height: 180px;
  margin: 0;
  overflow: auto;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  padding: 12px;
  background: rgba(3, 7, 13, 0.92);
  color: var(--text);
  white-space: pre-wrap;
  font-size: 0.83rem;
  line-height: 1.45;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.28);
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .control-panel {
    border-left: 0;
    border-top: 1px solid var(--panel-border);
  }

  #space-canvas {
    height: 58vh;
  }
}
