:root {
  --bg: radial-gradient(circle at center, #0b0020, #000010);
  --accent: #b66dff;
  --muted: #b9b3d0;
  --panel: rgba(255, 255, 255, 0.06);
  --w: 980px;
  --impact: #ff6b6b;
  --escape: #facc15;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, Segoe UI, Roboto, Arial;
  background: var(--bg);
  color: #f5f5f7;
  display: flex;
  justify-content: center;
  padding: 28px;
}

.wrap {
  width: 100%;
  max-width: var(--w);
}

/* Home bar + title — matched to the existing site page */
.home-bar {
  width: 100%;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.home-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--accent);
  font-weight: 600;
  font-size: 16px;
}

.home-icon {
  width: 32px;
  height: 32px;
  margin-right: 8px;
  animation: pulseStar 3s ease-in-out infinite;
  filter: drop-shadow(0 0 6px rgba(124, 58, 237, 0.8));
  border-radius: 50%;
}

@keyframes pulseStar {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.85; }
}

header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

h1 {
  margin: 0;
  font-size: 20px;
  color: #e0c3ff;
  font-weight: 400;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

/* Intro text */
.intro-text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
  text-align: justify;
  margin-bottom: 20px;
  opacity: 0;
  transform: translateY(10px);
  animation: fadeIn 1.5s ease-in forwards;
}

.intro-text p { margin: 0; }

@keyframes fadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Panels and controls */
.card {
  background: var(--panel);
  padding: 16px;
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
  margin-bottom: 16px;
}

.controls {
  display: grid;
  grid-template-columns: auto 220px auto;
  row-gap: 0.6rem;
  column-gap: 0.8rem;
  align-items: center;
}

button {
  background: linear-gradient(135deg, #b66dff, #7e5cff);
  border: none;
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}

button:hover { opacity: 0.9; }

input[type=range] { width: 200px; }

.preset-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.status-card {
  border: 1px solid rgba(182, 109, 255, 0.22);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.status-card.impact {
  border-color: rgba(255, 107, 107, 0.55);
  box-shadow: 0 0 18px rgba(255, 107, 107, 0.12), 0 6px 24px rgba(0,0,0,.45);
}

.status-card.escape {
  border-color: rgba(250, 204, 21, 0.55);
  box-shadow: 0 0 18px rgba(250, 204, 21, 0.10), 0 6px 24px rgba(0,0,0,.45);
}

.status-title {
  color: #e0c3ff;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 3px;
}

.status-card.impact .status-title { color: #ff9b9b; }
.status-card.escape .status-title { color: #fde267; }

.canvas {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#orbitCanvas {
  width: 100%;
  height: auto;
  max-width: 800px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.4);
}

.parameters-title {
  color: #e0c3ff;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
}

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

.parameter {
  min-width: 0;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.parameter span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 3px;
}

.parameter strong {
  display: block;
  color: #f5f5f7;
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  body { padding: 18px; }
  header { align-items: flex-start; flex-direction: column; gap: 4px; }
  .controls { grid-template-columns: 1fr; }
  input[type=range] { width: 100%; }
  .parameters-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 460px) {
  .parameters-grid { grid-template-columns: 1fr; }
}
