:root {
  --bg-color: #000000;
  --hud-bg: rgba(0, 0, 0, 0.6);
  --hud-text: #ffffff;
  --accent: #00d8ff;
  --bubble-color: rgba(0, 216, 255, 0.9);
  --bubble-border: rgba(255, 255, 255, 0.8);
  --bubble-shadow: rgba(0, 0, 0, 0.9);
  --modal-bg: rgba(0, 0, 0, 0.75);
  --modal-panel-bg: #070815;
  --modal-accent: #00d8ff;
}

/* Reset-ish */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-color);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #ffffff;
}

#app {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* HUD / header (optional) */
#hud {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 10;
  padding: 8px 14px;
  background: var(--hud-bg);
  border-radius: 999px;
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hud-title {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  opacity: 0.9;
}

.hud-subtitle {
  font-size: 0.8rem;
  opacity: 0.7;
}

/* Viewport: the visible window where you pan & zoom the universe */
#viewport {
  position: relative;
  flex: 1;
  overflow: hidden;
  cursor: grab;
}

/* This is what gets translated/scaled for pan/zoom */
#universe-wrapper {
  position: absolute;
  inset: 0;
  transform-origin: 0 0; /* top-left for simpler math */
  transform: translate(0px, 0px) scale(1);
  transition: transform 0.05s linear;
}

/* While dragging */
#viewport.dragging {
  cursor: grabbing;
}

/* The actual starfield plane */
#universe {
  position: absolute;
  top: 0;
  left: 0;

  /* Match or approximate your image size */
  width: 4747px;
  height: 4747px;

  background-image: url("../img/background.webp");
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

/* Center node exactly in the middle of the universe */
#center-node {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 220px;
  height: 220px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 30%, #ffffff, #333333);
}

#center-node img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 20px;
  object-fit: contain;
}

/* Orbits centered on the same middle point */
.orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  transform-origin: center center;
  /* JS will set rotate(angle) + translate(-50%, -50%) */
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.18);
}

/* Equidistant orbits (constant step in radius) */
.orbit-1 {
  width: 200px; /* diameter = 2 * radius; step is 160px here */
  height: 200px;
}
.orbit-2 {
  width: 300px; /* 360 + 160 */
  height: 300px;
}
.orbit-3 {
  width: 400px; /* 520 + 160 */
  height: 400px;
}
.orbit-4 {
  width: 500px; /* 680 + 160 */
  height: 500px;
}

/* Bubbles (planet-like nodes) */
.bubble {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid var(--bubble-border);
  background: radial-gradient(circle at 30% 30%, #ffffff, var(--bubble-color));
  box-shadow: 0 0 14px var(--bubble-shadow);
  color: #000000;
  cursor: pointer;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

/* Bubble content that will be kept upright by JS */
.bubble-inner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Different starting positions around the orbit (optional variety) */
.orbit-2 .bubble {
  top: 50%;
  left: 100%;
  transform: translate(-50%, -50%);
}

.orbit-3 .bubble {
  top: 100%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.orbit-4 .bubble {
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
}

/* Hover / focus effect */
.bubble:hover,
.bubble:focus-visible {
  box-shadow: 0 0 18px rgba(0, 216, 255, 1);
  transform: translate(-50%, -50%) scale(1.1);
}

/* Click animation */
.bubble:active {
  transform: translate(-50%, -50%) scale(0.95);
}

/* Modal */
#modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--modal-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

#modal-backdrop.hidden {
  display: none;
}

#modal {
  position: relative;
  max-width: min(90vw, 480px);
  background: var(--modal-panel-bg);
  padding: 20px 24px 18px;
  border-radius: 16px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

#modal h2 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

#modal p {
  margin: 0 0 16px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #d0d0e0;
}

#modal a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 999px;
  border: none;
  background: var(--modal-accent);
  color: #000;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}

#modal a:hover {
  filter: brightness(1.1);
}

#modal-close {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: #ffffff;
  font-size: 1.4rem;
  cursor: pointer;
}

/* Responsive tweaks */
@media (max-width: 768px) {
  #center-node {
    width: 160px;
    height: 160px;
  }

  .bubble {
    width: 48px;
    height: 48px;
  }

  .bubble-inner {
    font-size: 0.6rem;
  }
}
