.modal {
  display: none;
  position: fixed;
  z-index: 1001;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.9);
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.modal.show {
  opacity: 1;
}

#map-modal .modal-content {
  background-color: transparent;
  padding: 0;
  border: none;
  border-radius: 0;
  position: relative;
  width: 100%;
  height: 100%;
  max-width: none;
  backdrop-filter: blur(10px);
  transform: scale(0.9);
  transition: transform 0.5s ease;
  overflow: hidden;
}

.modal.show #map-modal .modal-content {
  transform: scale(1);
}

.rules-content {
  background-color: #1414143b;
  backdrop-filter: blur(10px);
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid var(--primary-color);
  width: 90%;
  max-width: 800px;
  height: 80vh;
  display: flex;
  flex-direction: column;
}

.rules-container {
  overflow-y: auto;
  text-align: justify;
  padding-right: 1rem;
}

.rules-container h2 {
  text-align: center;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
}

.rules-container h3 {
  color: var(--primary-color);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  text-align: center;
  font-weight: 600;
}

.rules-container p,
.rules-container li {
  color: #e0e0e0;
  line-height: 1.7;
  margin-bottom: 0.5rem;
}

.rules-container ul {
  list-style-position: inside;
  padding-left: 1rem;
}

.rules-container a {
  color: #87ceeb;
  text-decoration: none;
}

.rules-container a:hover {
  text-decoration: underline;
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 10px;
  font-size: 2rem;
  color: #fff;
  cursor: pointer;
  transition: color 0.2s ease;
  z-index: 110;
}

.close-btn:hover {
  color: var(--primary-color);
}

.controls svg {
  fill: #f0f0f0;
}
.map-container {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
}

.main-title {
  position: absolute;
  top: 20px;
  left: 20px;
  padding: 0;
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 5.5rem;
  font-weight: 600;
  background: linear-gradient(to right, #f39c12, #87ceeb);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  z-index: 100;
  opacity: 0.3;
  pointer-events: none;
}

.container {
  background-image: linear-gradient(#040507, #000);
  inset: 0;
  position: fixed;
  z-index: -1;
}

.space {
  --size: 1px;
  width: var(--size);
  height: var(--size);
  background: rgba(200, 220, 255, 0.7);
  position: absolute;
  top: 0;
  left: 0;
  animation: move var(--duration) linear infinite;
}

.space-1 {
  --space-layer: 4vw 50vh 0 #a2b0d2, 18vw 88vh 0 #a2b0d2, 73vw 14vh 0 #a2b0d2,
    80vw 22vh 0 #a2b0d2;
  box-shadow: var(--space-layer);
  --duration: 150s;
}

.space-2 {
  --space-layer: 23vw 40vh 0 #a2b0d2, 33vw 75vh 0 #a2b0d2, 91vw 10vh 0 #a2b0d2,
    65vw 95vh 0 #a2b0d2;
  box-shadow: var(--space-layer);
  --duration: 100s;
}

.space-3 {
  --space-layer: 5vw 5vh 0 #a2b0d2, 48vw 68vh 0 #a2b0d2, 63vw 34vh 0 #a2b0d2;
  box-shadow: var(--space-layer);
  --duration: 75s;
}

.estrella,
.estrellaDos {
  position: absolute;
  background-color: rgba(200, 220, 255, 0.7);
  border-radius: 50%;
  animation: twinkle 6s linear infinite alternate;
}

.estrella {
  width: 1px;
  height: 1px;
}
.estrellaDos {
  width: 2px;
  height: 2px;
  box-shadow: 0 0 5px 0px rgba(200, 220, 255, 0.5);
}

#planet-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
}

.planet {
  position: absolute;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background-color: hsl(var(--planet-hue), 85%, 50%);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8),
    0 0 30px rgba(255, 255, 255, 0.1);
  cursor: pointer;
  overflow: hidden;
}

.planet::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-image: repeating-linear-gradient(
      145deg,
      transparent,
      hsla(var(--planet-hue), 90%, 60%, 0.25) 15%,
      transparent 20%
    ),
    repeating-linear-gradient(
      -145deg,
      transparent,
      hsla(var(--planet-hue), 70%, 40%, 0.25) 15%,
      transparent 20%
    );
  background-size: 150% 150%;
  mix-blend-mode: overlay;
}

.crater {
  position: absolute;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background-color: hsla(var(--planet-hue), 60%, 30%, 0.5);
  box-shadow: inset 1px 1px 2px hsla(var(--planet-hue), 95%, 70%, 0.1),
    inset -2px -2px 5px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

#connections {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

.planet-tooltip {
  position: fixed;
  background-color: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 0.9em;
  pointer-events: none;
  z-index: 1002;
  opacity: 0;
  transform: scale(0.9) translateY(10px);
  transition: opacity 0.2s ease-out, transform 0.2s ease-out;
  will-change: opacity, transform;
}

.planet-tooltip.visible {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.download-btn {
  position: absolute;
  bottom: 20px;
  left: 20px;
  background-color: rgba(20, 20, 20, 0.7);
  border: 1px solid #444;
  color: #ccc;
  padding: 10px 15px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  z-index: 100;
  transition: all 0.2s ease;
}

.download-btn:hover {
  background-color: rgba(30, 30, 30, 0.9);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.download-btn svg {
  width: 20px;
  height: 20px;
}

.map-control-btn {
  position: absolute;
  bottom: 20px;
  right: 20px;
  background-color: rgba(20, 20, 20, 0.7);
  border: 1px solid #444;
  color: #ccc;
  padding: 10px 15px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  z-index: 100;
  transition: all 0.2s ease;
}

.map-control-btn:hover {
  background-color: rgba(30, 30, 30, 0.9);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.map-control-btn:hover svg path {
  fill: var(--primary-color);
}

.map-control-btn svg {
  width: 20px;
  height: 20px;
  transition: fill 0.2s ease;
}

@keyframes move {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-100vh);
  }
}

@keyframes twinkle {
  from {
    opacity: 0.1;
  }
  to {
    opacity: 0.6;
  }
}
