:root {
  --bg: #04060d;
  --ink: #e8eaf6;
  --ink-dim: #8b93b8;
  --core: #7c6cff;
  --panel-bg: rgba(10, 13, 26, .92);
  --line: rgba(139, 147, 184, .18);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------- фон ---------- */

#stars {
  position: fixed;
  inset: 0;
  z-index: 0;
}

.nebula {
  position: fixed;
  z-index: 0;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .5;
  pointer-events: none;
  animation: nebulaDrift 40s ease-in-out infinite alternate;
}
.nebula-a {
  width: 55vw; height: 55vw;
  left: -18vw; top: -22vw;
  background: radial-gradient(circle, rgba(88, 66, 214, .28), transparent 65%);
}
.nebula-b {
  width: 48vw; height: 48vw;
  right: -16vw; bottom: -18vw;
  background: radial-gradient(circle, rgba(24, 128, 158, .22), transparent 65%);
  animation-delay: -14s;
}
.nebula-c {
  width: 30vw; height: 30vw;
  right: 8vw; top: -12vw;
  background: radial-gradient(circle, rgba(190, 76, 139, .14), transparent 65%);
  animation-delay: -27s;
}
@keyframes nebulaDrift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(4vw, 2.5vw) scale(1.12); }
}

/* ---------- HUD ---------- */

.hud {
  position: fixed;
  z-index: 5;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 30px 38px;
  pointer-events: none;
}
.hud-kicker {
  display: block;
  font-size: 11px;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 10px;
}
.hud h1 {
  font-family: "Unbounded", "Inter", sans-serif;
  font-weight: 500;
  font-size: clamp(20px, 2.4vw, 30px);
  letter-spacing: .04em;
  background: linear-gradient(100deg, #fff 20%, #a79cff 80%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hud-hint {
  font-size: 12px;
  color: var(--ink-dim);
  letter-spacing: .08em;
  padding-top: 34px;
  transition: opacity .5s;
}

/* ---------- сцена ---------- */

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.orbit {
  fill: none;
  stroke: var(--line);
  stroke-width: 1;
  transition: stroke .4s;
}
.orbit.moon-orbit {
  stroke-dasharray: 2 7;
  stroke: rgba(139, 147, 184, .28);
}
.orbit.is-hot { stroke: rgba(210, 215, 255, .45); }

.planet-group { cursor: pointer; }
.planet-hit { fill: transparent; }

.planet-label {
  font-family: "Inter", sans-serif;
  font-size: 13px;
  letter-spacing: .14em;
  text-transform: uppercase;
  fill: var(--ink-dim);
  text-anchor: middle;
  pointer-events: none;
  transition: fill .3s;
}
.planet-group:hover .planet-label { fill: #fff; }

.planet-ring {
  fill: none;
  stroke-width: 1;
  opacity: 0;
  pointer-events: none;
}

.moon-dot { pointer-events: none; }
.moon-label {
  font-size: 9.5px;
  letter-spacing: .1em;
  fill: rgba(139, 147, 184, .75);
  text-anchor: middle;
  pointer-events: none;
}

.core-label {
  font-family: "Unbounded", sans-serif;
  font-weight: 700;
  font-size: 21px;
  letter-spacing: .18em;
  fill: #fff;
  text-anchor: middle;
  pointer-events: none;
}
.core-sub {
  font-size: 10.5px;
  letter-spacing: .3em;
  text-transform: uppercase;
  fill: rgba(232, 234, 246, .55);
  text-anchor: middle;
  pointer-events: none;
}
#coreGroup { cursor: pointer; }

/* ---------- тултип ---------- */

.tooltip {
  position: fixed;
  z-index: 6;
  max-width: 250px;
  padding: 12px 16px;
  background: rgba(12, 15, 30, .88);
  border: 1px solid rgba(160, 168, 210, .22);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .22s, transform .22s;
}
.tooltip.is-on { opacity: 1; transform: translateY(0); }
.tooltip-name {
  font-family: "Unbounded", sans-serif;
  font-weight: 500;
  font-size: 13px;
  margin-bottom: 4px;
}
.tooltip-tag {
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-dim);
}

/* ---------- боковая панель ---------- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 7;
  background: radial-gradient(circle at 35% 50%, transparent 30%, rgba(2, 3, 8, .55));
  opacity: 0;
  pointer-events: none;
  transition: opacity .5s;
}
.backdrop.is-on { opacity: 1; pointer-events: auto; }

.panel {
  position: fixed;
  z-index: 8;
  top: 0; right: 0; bottom: 0;
  width: min(430px, 92vw);
  background: var(--panel-bg);
  border-left: 1px solid rgba(160, 168, 210, .16);
  backdrop-filter: blur(22px);
  transform: translateX(105%);
  visibility: hidden;
}
.panel-scroll {
  height: 100%;
  overflow-y: auto;
  padding: 64px 42px 48px;
  scrollbar-width: thin;
  scrollbar-color: rgba(139,147,184,.3) transparent;
}
.panel-close {
  position: absolute;
  top: 20px; right: 22px;
  z-index: 2;
  width: 38px; height: 38px;
  border: 1px solid rgba(160, 168, 210, .25);
  border-radius: 50%;
  background: transparent;
  color: var(--ink-dim);
  font-size: 14px;
  cursor: pointer;
  transition: color .25s, border-color .25s, transform .25s;
}
.panel-close:hover { color: #fff; border-color: #fff; transform: rotate(90deg); }

.panel-orb { margin-bottom: 26px; }
.panel-orb span {
  display: block;
  width: 58px; height: 58px;
  border-radius: 50%;
  background: var(--accent, var(--core));
  box-shadow: 0 0 34px var(--accent, var(--core)), inset -8px -10px 18px rgba(0,0,0,.45);
}

.panel-status {
  display: inline-block;
  font-size: 10px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--accent, var(--core));
  border: 1px solid currentColor;
  border-radius: 99px;
  padding: 4px 12px;
  margin-bottom: 14px;
}
.panel h2 {
  font-family: "Unbounded", sans-serif;
  font-weight: 500;
  font-size: 26px;
  letter-spacing: .02em;
  margin-bottom: 10px;
}
.panel-tagline {
  color: var(--ink-dim);
  font-size: 14px;
  line-height: 1.55;
  margin-bottom: 26px;
}
.panel-body p {
  font-size: 14px;
  font-weight: 300;
  line-height: 1.7;
  color: #c3c8e2;
  margin-bottom: 14px;
}
.panel-body p strong { font-weight: 600; color: var(--ink); }

.panel-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 30px;
}
.panel-chips span {
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--ink-dim);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 5px 12px;
}

.panel-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  color: #fff;
  border: 1px solid var(--accent, var(--core));
  border-radius: 99px;
  padding: 13px 26px;
  transition: background .3s, box-shadow .3s;
}
.panel-link:hover {
  background: color-mix(in srgb, var(--accent, var(--core)) 22%, transparent);
  box-shadow: 0 0 26px color-mix(in srgb, var(--accent, var(--core)) 45%, transparent);
}
.panel-link span { transition: transform .3s; }
.panel-link:hover span { transform: translateX(5px); }
.panel-link.is-hidden { display: none; }

@media (max-width: 640px) {
  .hud { padding: 20px 22px; }
  .hud-hint { display: none; }
  .panel-scroll { padding: 60px 26px 40px; }
}
