/* ============================================================
   DAWNFALL — New Nations : Solar System
   ============================================================ */

/* ── Starfield + system wrap ──────────────────────────────── */

/* Prevent auth-pg from flex-expanding; let nn-system-wrap fill remaining space */
.auth-pg { flex: none; }

.auth-pg-icon img { width: 100%; height: 100%; object-fit: contain; }

.nn-system-wrap {
  display: flex;
  flex: 1;
  align-items: flex-end;
  justify-content: center;
  gap: 48px;
  padding: 32px 48px 40px;
  position: relative;
  overflow: hidden;
  background: #07080f;
}

.nn-starfield {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* ── Solar system container ───────────────────────────────── */

.nn-solar {
  position: relative;
  width:  560px;
  height: 560px;
  flex-shrink: 0;
}

/* ── Orbit rings ──────────────────────────────────────────── */

.nn-orbit {
  position: absolute;
  top: 50%; left: 50%;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.07);
  transform: translate(-50%, -50%);
  animation: nn-orbit-spin linear infinite;
  pointer-events: none;
}

.nn-body { pointer-events: auto; }

/* Orbit sizes — width = height = 2 × radius. Container = 560px, center = 280. */
.nn-orbit-mercury { width: 124px; height: 124px; animation-duration: 40s;  border-color: rgba(255,255,255,0.05); }
.nn-orbit-venus   { width: 152px; height: 152px; animation-duration: 75s;  animation-delay: -10s; }
.nn-orbit-terra   { width: 170px; height: 170px; animation-duration: 135s; animation-delay: -60s; }
.nn-orbit-martius { width: 196px; height: 196px; animation-duration: 225s; animation-delay: -100s; }
.nn-orbit-jupiter { width: 294px; height: 294px; animation-duration: 375s; border-color: rgba(255,255,255,0.03); }
.nn-orbit-saturn  { width: 362px; height: 362px; animation-duration: 570s; border-color: rgba(255,255,255,0.025); }
.nn-orbit-uranus  { width: 456px; height: 456px; animation-duration: 750s; border-color: rgba(255,255,255,0.02); }
.nn-orbit-neptune { width: 530px; height: 530px; animation-duration: 950s; border-color: rgba(255,255,255,0.015); }

/* Luna orbits Terra — nested inside terra system */
.nn-terra-system {
  position: absolute;
  top: 0; left: 50%;
  transform: translate(-50%, -50%);
  animation: nn-orbit-spin 135s linear -60s infinite reverse;
}

.nn-orbit-luna {
  width:  18px; height: 18px;
  animation-duration: 30s;
  border-color: rgba(255,255,255,0.12);
}

.nn-orbit-angel {
  width:  12px; height: 12px;
  animation-duration: 90s;
  border: none;
}

@keyframes nn-orbit-spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(-360deg); }
}

/* ── Planet base ──────────────────────────────────────────── */

.nn-body {
  position: absolute;
  top: 0; left: 50%;
  border-radius: 0;
  cursor: pointer;
  transition: filter 0.2s, transform 0.2s;
}

.nn-body:hover { filter: brightness(1.3); transform: translate(-50%, -50%) scale(1.15); }
.nn-body:hover .nn-body-inner { outline: 2px solid rgba(255,255,255,0.4); }

.nn-body-inner {
  width: 100%; height: 100%;
  border-radius: inherit;
  image-rendering: pixelated;
  background-size: cover;
  background-repeat: no-repeat;
}

/* Counter-rotate so planet texture stays upright */
.nn-orbit-mercury > .nn-body { animation: nn-orbit-spin  40s linear infinite reverse; }
.nn-orbit-venus   > .nn-body { animation: nn-orbit-spin  75s linear  -10s infinite reverse; }
.nn-orbit-martius > .nn-body { animation: nn-orbit-spin 225s linear -100s infinite reverse; }
.nn-orbit-jupiter > .nn-body { animation: nn-orbit-spin 375s linear infinite reverse; }
.nn-orbit-saturn  > .nn-body { animation: nn-orbit-spin 570s linear infinite reverse; }
.nn-orbit-uranus  > .nn-body { animation: nn-orbit-spin 750s linear infinite reverse; }
.nn-orbit-neptune > .nn-body { animation: nn-orbit-spin 950s linear infinite reverse; }

/* ── Sun ──────────────────────────────────────────────────── */

.nn-sun {
  position: absolute;
  top: 50%; left: 50%;
  width: 22px; height: 22px;
  transform: translate(-50%, -50%);
  cursor: pointer;
  animation: nn-sun-pulse 5s ease-in-out infinite;
  will-change: transform;
  border-radius: 0;
}

.nn-sun .nn-body-inner {
  background-color: #ffffff;
  border-radius: 0;
  box-shadow:
    0 0  5px  2px rgba(255,255,255,0.65),
    0 0 12px  4px rgba(245,200,100,0.28),
    0 0 26px  8px rgba(245,166,35,0.13);
}

@keyframes nn-sun-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50%       { transform: translate(-50%, -50%) scale(1.1); }
}

/* ── Self-rotation (axis spin on .nn-body-inner) ──────────── */

@keyframes nn-self-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ── Venus ────────────────────────────────────────────────── */

.nn-venus { width: 8px; height: 8px; transform: translate(-50%, -50%); }
.nn-venus .nn-body-inner { background-color: #c97d3a; animation: nn-self-spin 82s linear infinite; }

/* ── Terra ────────────────────────────────────────────────── */

.nn-terra {
  width: 8px; height: 8px;
  transform: translate(-50%, -50%);
  animation: nn-terra-spin 90s linear infinite reverse;
}

.nn-terra .nn-body-inner { background-color: #2d6fa3; }

@keyframes nn-terra-spin {
  from { transform: translate(-50%, -50%) rotate(0deg);   }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ── Luna ─────────────────────────────────────────────────── */

/* No counter-rotation on Luna — tidal lock: same face always toward Terra */
.nn-luna { width: 3px; height: 3px; transform: translate(-50%, -50%); animation: none; }
.nn-luna .nn-body-inner { background-color: #8a8a8a; }

/* ── Fallen angel (geosynchronous = same period as terra self-rotation) ── */

.nn-angel {
  width: 3px; height: 3px;
  transform: translate(-50%, -50%);
  animation: nn-orbit-spin 90s linear infinite reverse;
  border-radius: 50% !important;
  cursor: pointer;
}

.nn-angel .nn-body-inner {
  border-radius: 50%;
  background-color: #e8dfc8;
  box-shadow:
    0 0 4px  2px rgba(232,223,200,0.7),
    0 0 10px 4px rgba(232,223,200,0.3);
}

.nn-angel:hover { filter: brightness(1.4); }

/* ── Martius ──────────────────────────────────────────────── */

.nn-martius { width: 4px; height: 4px; transform: translate(-50%, -50%); }
.nn-martius .nn-body-inner { background-color: #8b3a2a; animation: nn-self-spin 72s linear infinite reverse; }

/* ── Background planets ───────────────────────────────────── */

/* ── Masked planets (unknown / hors-jeu) ──────────────────── */

.nn-masked { opacity: 0.28; }
.nn-masked:hover { filter: brightness(1.15); transform: translate(-50%, -50%) scale(1.08); opacity: 0.45; }
.nn-masked:hover .nn-body-inner { outline: none; }

.nn-mercury { width:  3px; height:  3px; transform: translate(-50%, -50%); }
.nn-mercury .nn-body-inner { background-color: #8a8278; animation: nn-self-spin 115s linear infinite; }

.nn-jupiter { width: 11px; height: 11px; transform: translate(-50%, -50%); }
.nn-jupiter .nn-body-inner { background-color: #7e7870; animation: nn-self-spin 25s linear infinite; }

.nn-saturn  { width:  9px; height:  9px; transform: translate(-50%, -50%); }
.nn-saturn  .nn-body-inner { background-color: #8a8278; animation: nn-self-spin 28s linear infinite; }

.nn-uranus  { width:  4px; height:  4px; transform: translate(-50%, -50%); }
.nn-uranus  .nn-body-inner { background-color: #7e7870; animation: nn-self-spin 40s linear infinite reverse; }

.nn-neptune { width:  4px; height:  4px; transform: translate(-50%, -50%); }
.nn-neptune .nn-body-inner { background-color: #7a7268; animation: nn-self-spin 35s linear infinite; }

/* ── Station trajectory (SVG overlay) ────────────────────── */

.nn-trajectory-svg {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  overflow: visible;
}

.nn-trajectory-line {
  stroke: rgba(100,180,255,0.35);
  stroke-width: 1.5;
  stroke-dasharray: 6 5;
  fill: none;
  animation: nn-dash-flow 2s linear infinite;
}

@keyframes nn-dash-flow {
  from { stroke-dashoffset: 0; }
  to   { stroke-dashoffset: -22; }
}

.nn-station-dot {
  position: absolute;
  width: 6px; height: 6px;
  border-radius: var(--card-radius);
  background: rgba(100,180,255,0.8);
  box-shadow: 0 0 5px 2px rgba(100,180,255,0.4);
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: filter 0.2s;
  animation: nn-station-pulse 2.5s ease-in-out infinite;
}

.nn-station-dot:hover { filter: brightness(1.4); }

@keyframes nn-station-pulse {
  0%, 100% { box-shadow: 0 0 6px  2px rgba(100,180,255,0.4); }
  50%       { box-shadow: 0 0 12px 4px rgba(100,180,255,0.65); }
}

/* ── Tooltip ──────────────────────────────────────────────── */

.nn-tooltip {
  position: absolute;
  z-index: 10;
  pointer-events: none;
  background: rgba(10,12,22,0.92);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--card-radius);
  padding: 10px 14px;
  min-width: 150px;
  max-width: 220px;
  backdrop-filter: blur(8px);
  animation: nn-tip-in 0.12s ease both;
}

@keyframes nn-tip-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0);   }
}

.nn-tooltip-name {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 3px;
}

.nn-tooltip-type {
  font-size: 11px;
  font-weight: 600;
  color: var(--brand-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.nn-tooltip-desc {
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  line-height: 1.55;
}

@keyframes nn-glitch {
  0%   { transform: translateX(0);                    color: rgba(255,255,255,0.28); text-shadow: none; }
  10%  { transform: translateX(-3px) skewX(-3deg);    color: #0ff;                   text-shadow:  2px 0 rgba(255,0,60,0.8); }
  20%  { transform: translateX(2px);                  color: rgba(255,255,255,0.06); text-shadow: -2px 0 rgba(0,255,255,0.7); }
  30%  { transform: translateX(0);                    color: rgba(255,60,60,0.85);   text-shadow: none; }
  40%  { transform: translateX(-2px) scaleX(1.04);   color: rgba(255,255,255,0.45); text-shadow:  3px 0 rgba(0,255,255,0.5); }
  50%  { transform: translateX(3px) skewX(2deg);     color: rgba(255,255,255,0.28); text-shadow: -3px 0 rgba(255,0,60,0.6); }
  60%  { transform: translateX(-1px);                 color: #f0f;                   text-shadow:  2px 0 rgba(0,255,255,0.8); }
  70%  { transform: translateX(2px) scaleX(0.97);    color: rgba(255,255,255,0.1);  text-shadow: -1px 0 rgba(255,0,60,0.5); }
  80%  { transform: translateX(0) skewX(-1deg);      color: rgba(255,255,255,0.55); text-shadow: none; }
  90%  { transform: translateX(-2px);                 color: rgba(255,255,255,0.15); text-shadow:  2px 0 rgba(255,0,60,0.7); }
  100% { transform: translateX(0);                    color: rgba(255,255,255,0.28); text-shadow: none; }
}

.nn-tooltip-unknown {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  animation: nn-glitch 0.55s steps(1) infinite;
}

.nn-tooltip-unknown:nth-child(1) { animation-delay: 0s; }
.nn-tooltip-unknown:nth-child(2) { animation-delay: 0.18s; }
.nn-tooltip-unknown:nth-child(3) { animation-delay: 0.36s; }

/* ── Info panel ───────────────────────────────────────────── */

.nn-info-panel {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  width: 220px;
  background: rgba(7,8,15,0.9);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--card-radius);
  padding: 20px 18px;
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  min-height: 120px;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.nn-info-panel--pinned {
  border-color: rgba(100,180,255,0.35);
  box-shadow: 0 0 0 1px rgba(100,180,255,0.08);
}

.nn-panel-idle {
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  text-align: center;
  margin: auto 0;
  line-height: 1.6;
  font-style: italic;
}

.nn-panel-content {
  display: flex;
  flex-direction: column;
}

.nn-panel-name {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
}

.nn-panel-type {
  font-size: 10px;
  font-weight: 600;
  color: var(--brand-2);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

.nn-panel-desc {
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  line-height: 1.6;
}

.nn-panel-bar-wrap {
  margin-top: 14px;
  height: 2px;
  background: rgba(255,255,255,0.07);
  border-radius: 0;
  overflow: hidden;
}

.nn-panel-bar {
  height: 100%;
  width: 100%;
  background: var(--brand-2);
  border-radius: 0;
  transform-origin: left;
}

/* ── 3D container ─────────────────────────────────────────── */

#nn-3d-container {
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* ── View toggle (2D / 3D) ────────────────────────────────── */

.nn-view-toggle {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 10;
  display: flex;
  gap: 2px;
  background: rgba(7,8,15,0.85);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--card-radius);
  padding: 3px;
  backdrop-filter: blur(10px);
}

.nn-toggle-opt {
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.4);
  background: transparent;
  border: none;
  border-radius: 0;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
  font-family: inherit;
}

.nn-toggle-opt.active {
  color: #fff;
  background: rgba(255,255,255,0.1);
}

/* ── Zoom + Pan ───────────────────────────────────────────── */

.nn-solar { cursor: grab; }
.nn-info-panel { cursor: default; }

/* ── Panel locked state ───────────────────────────────────── */

.nn-panel-locked {
  font-style: italic;
  text-align: center;
  color: rgba(255,255,255,0.28);
  line-height: 1.6;
  margin: auto 0;
}

/* ── Footer nav ───────────────────────────────────────────── */

.nn-footer {
  text-align: center;
  padding: 24px 24px 40px;
  background: #07080f;
}

.nn-footer span {
  display: block;
  font-size: 12px;
  color: #fff;
  margin-bottom: 8px;
}

.nn-footer a {
  font-size: 13px;
  color: #fff;
  text-decoration: none;
  transition: color 0.2s;
}

.nn-footer a:hover { color: rgba(255,255,255,0.7); }

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 850px) {
  .nn-system-wrap { flex-direction: column; align-items: center; gap: 0; }
  .nn-info-panel  { width: 180px; top: 8px; right: 8px; padding: 14px; }
}

@media (max-width: 600px) {
  .nn-solar { transform: scale(0.78); }
  .nn-system-wrap { padding: 0 0 24px; min-height: 370px; }
}

@media (max-width: 420px) {
  .nn-solar { transform: scale(0.55); }
  .nn-system-wrap { min-height: 270px; }
}

@media (max-width: 420px) {
  .nn-solar { transform: scale(0.55); }
  .nn-system-wrap { min-height: 270px; }
}
