:root {
  --bg: #0b0f14;
  --panel: #0f1720;
  --text: #e6edf3;
  --muted: #9fb1c6;
  --accent: #6ee7ff;
  --accent-2: #b794f4;
  --ring: rgba(110, 231, 255, 0.35);
  --border: #1e2a38;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto,
    Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: radial-gradient(
    1200px 600px at 50% -10%,
    #122033 0%,
    var(--bg) 40%,
    var(--bg) 100%
  );
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100dvh;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(
    180deg,
    rgba(8, 12, 18, 0.6),
    rgba(8, 12, 18, 0.9)
  );
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(6px);
}
.title {
  text-align: center;
  margin: 0;
  padding: clamp(16px, 3vw, 28px) clamp(16px, 3vw, 36px);
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.05;
  text-transform: none;
  font-size: clamp(20px, 3.2vw, 36px);
}

main {
  display: grid;
  grid-template-columns: 1fr min(92vmin, 900px) 1fr;
  grid-template-rows: 1fr;
  align-items: center;
  justify-items: center;
  padding: 24px clamp(12px, 3vw, 32px);
  gap: 18px;
}
.stage {
  grid-column: 2;
  width: 100%;
}

.card {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.02),
    rgba(255, 255, 255, 0)
  );
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  border-radius: 20px;
}

.canvas-wrapper {
  width: 100%;
  max-width: 900px;
  position: relative;
}

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

.overlay {
  position: absolute;
  inset: 0;
  pointer-events: none; /* allow canvas interactions */
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.topbar,
.bottombar {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
}

.topbar {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.35), transparent);
  border-radius: 18px 18px 0 0;
}
.bottombar {
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.35), transparent);
  border-radius: 0 0 18px 18px;
}

.badge {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(10, 16, 24, 0.75);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
  font-size: 12px;
  color: var(--muted);
}

.accent-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: radial-gradient(
    circle at 35% 30%,
    var(--accent),
    var(--accent-2)
  );
  box-shadow: 0 0 12px var(--ring);
}

.controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}

button.icon {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(14, 22, 33, 0.85);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.08s ease, background 0.2s ease, border-color 0.2s ease;
}
button.icon:hover {
  transform: translateY(-1px);
  border-color: var(--ring);
}
button.icon:active {
  transform: translateY(0);
}

.legend {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  display: grid;
  gap: 4px;
  line-height: 1.35;
}

aside.info {
  grid-column: 3;
  align-self: center;
  width: min(36ch, 92%);
  display: none;
}
@media (min-width: 1100px) {
  aside.info {
    display: block;
  }
}
.info .card {
  padding: 16px 18px;
}
.info h2 {
  margin: 0 0 6px;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.info p {
  margin: 0;
  color: var(--text);
  font-size: 14px;
}

footer {
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  color: var(--muted);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.foot-right {
  display: flex;
  gap: 10px;
  align-items: center;
}
.dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  opacity: 0.8;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.canvas-wrapper.is-loading::after {
  content: "Loading NEOs…";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(2px);
  font-weight: 600;
  color: #fff;
}
.canvas-wrapper.is-loading::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 28px;
  height: 28px;
  margin: -40px 0 0 -14px;
  border: 3px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: nonr-spin 1s linear infinite;
}
@keyframes nonr-spin {
  to {
    transform: rotate(360deg);
  }
}
