/* ATLAS — capa visual exclusiva para las escenas 3D de BACKUP_3D. */

#solar-system {
  min-height: 138vh;
  isolation: isolate;
}

#solar-system .scene-3d-container {
  cursor: grab;
  touch-action: pan-y;
}

#solar-system .scene-3d-container.is-dragging { cursor: grabbing; }
#solar-system .scene-3d-container.is-tool-hover:not(.is-dragging) { cursor: pointer; }

.scene-3d-overlay--atlas {
  justify-content: flex-end;
  background:
    radial-gradient(ellipse 58% 42% at 50% 42%, transparent 42%, rgba(5, 10, 18, 0.22) 100%),
    linear-gradient(to top, rgba(5, 10, 18, 0.97) 0%, rgba(5, 10, 18, 0.38) 22%, transparent 54%);
}

#solar-system .scene-3d-content--atlas {
  width: min(1080px, calc(100% - 32px));
  max-width: none;
  padding: 0 16px clamp(38px, 6vh, 76px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

#solar-system .atlas-hero-title {
  margin: 0 0 clamp(22px, 4vh, 44px);
  max-width: none;
  font-family: var(--font-display);
  font-size: clamp(64px, 11vw, 150px);
  font-weight: 400;
  line-height: 0.82;
  letter-spacing: 0.19em;
  text-indent: 0.19em;
  color: rgba(230, 198, 126, 0.9);
  text-shadow:
    0 0 18px rgba(200, 164, 92, 0.22),
    0 16px 70px rgba(0, 0, 0, 0.86);
}

#solar-system .scene-hud {
  margin: 0;
  padding: 16px clamp(20px, 4vw, 42px);
  gap: clamp(22px, 5vw, 64px);
  background: linear-gradient(180deg, rgba(4, 15, 24, 0.72), rgba(3, 10, 17, 0.88));
  border: 1px solid rgba(95, 222, 255, 0.16);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.035),
    0 18px 60px rgba(0, 0, 0, 0.36),
    0 0 48px rgba(0, 212, 255, 0.035);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.atlas-tool-tip {
  position: absolute;
  z-index: 24;
  left: 0;
  top: 0;
  padding: 8px 12px;
  border: 1px solid rgba(90, 226, 255, 0.28);
  border-radius: 999px;
  background: rgba(3, 12, 20, 0.88);
  box-shadow: 0 10px 38px rgba(0, 0, 0, 0.45), 0 0 24px rgba(0, 212, 255, 0.08);
  color: #e8f7ff;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, calc(-100% - 16px)) scale(0.94);
  transition: opacity 160ms ease, transform 160ms ease;
}

.atlas-tool-tip.is-visible {
  opacity: 1;
  transform: translate(-50%, calc(-100% - 16px)) scale(1);
}

/* Estado de la luna dentro de la etiqueta: ingresar o proximamente */
.atlas-tool-tip__go,
.atlas-tool-tip__soon {
  margin-left: 10px;
  padding-left: 10px;
  border-left: 1px solid rgba(90, 226, 255, 0.24);
}
.atlas-tool-tip__go { color: #00d4ff; }
.atlas-tool-tip__soon { color: #ffd56a; }

/* Aviso al tocar una luna que todavia no esta disponible */
.atlas-tool-notice {
  position: absolute;
  z-index: 26;
  left: 50%;
  top: 30%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 26px;
  border: 1px solid rgba(255, 213, 106, 0.32);
  border-radius: 14px;
  background: rgba(3, 12, 20, 0.9);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(255, 213, 106, 0.08);
  color: #e8f7ff;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 16px) scale(0.96);
  transition: opacity 200ms ease, transform 200ms ease;
}
.atlas-tool-notice.is-visible {
  opacity: 1;
  transform: translate(-50%, 26px) scale(1);
}
.atlas-tool-notice strong {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.02em;
}
.atlas-tool-notice span {
  color: #ffd56a;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.premium-interaction-hint {
  position: absolute;
  z-index: 8;
  right: clamp(16px, 3vw, 42px);
  bottom: clamp(16px, 3vw, 34px);
  color: rgba(163, 201, 216, 0.55);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  pointer-events: none;
}

#ivanBrainObj {
  touch-action: pan-y;
}

#ivanBrainObj.brain-3d-active::after {
  content: 'ARRASTRA PARA EXPLORAR';
  position: absolute;
  right: clamp(18px, 4vw, 58px);
  bottom: 24px;
  z-index: 4;
  color: rgba(147, 201, 221, 0.46);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.16em;
  pointer-events: none;
}

#globeCanvas {
  cursor: grab;
  touch-action: pan-y;
  background:
    radial-gradient(circle at 50% 48%, rgba(0, 132, 168, 0.12), rgba(5, 10, 18, 0) 64%),
    #050a12;
}

#globeCanvas.is-dragging { cursor: grabbing; }

#portal {
  min-height: max(780px, 96vh);
}

#portalCanvas::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 34% 28% at 50% 43%, rgba(0, 212, 255, 0.075), transparent 72%),
    linear-gradient(90deg, rgba(5, 10, 18, 0.18), transparent 30%, transparent 70%, rgba(5, 10, 18, 0.18));
}

#portal .scene-3d-overlay {
  background:
    radial-gradient(ellipse 45% 42% at 50% 31%, rgba(5, 10, 18, 0.06), rgba(5, 10, 18, 0.13) 66%, rgba(5, 10, 18, 0.36) 100%),
    linear-gradient(to top, rgba(5, 10, 18, 0.98) 0%, rgba(5, 10, 18, 0.72) 28%, rgba(5, 10, 18, 0.12) 61%, rgba(5, 10, 18, 0.2) 100%);
}

#portal .scene-3d-content {
  width: min(820px, calc(100% - 32px));
  max-width: none;
  padding: 0 16px clamp(24px, 3.6vh, 42px);
}

#portal .portal-flow {
  margin-bottom: 15px;
  padding: 8px 14px;
  border: 1px solid rgba(0, 212, 255, 0.11);
  border-radius: 999px;
  background: rgba(3, 13, 21, 0.48);
  backdrop-filter: blur(7px);
}

#portal .scene-label { margin-bottom: 8px; }
#portal .scene-title { margin-bottom: 10px; }
#portal .scene-desc { margin-bottom: 11px; }
#portal .scene-desc-sub { margin-bottom: 15px; }
#portal .portal-close { margin: 0 auto 17px; }

.portal-stage-labels {
  position: absolute;
  z-index: 3;
  top: clamp(98px, 14vh, 138px);
  left: 4.5%;
  right: 4.5%;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: start;
  pointer-events: none;
}

.portal-stage-label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-family: var(--font-mono);
  text-shadow: 0 2px 15px #02060a, 0 0 18px rgba(0, 212, 255, 0.28);
}

.portal-stage-label b {
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--cyan);
}

.portal-stage-label small {
  font-size: 7px;
  letter-spacing: 0.12em;
  color: var(--frost);
  opacity: 0.58;
}

.portal-stage-label--core { text-align: center; align-items: center; }
.portal-stage-label--output { text-align: right; align-items: flex-end; }

#portal .scene-title,
#portal .scene-desc,
#portal .scene-desc-sub,
#portal .portal-close {
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.95), 0 0 34px rgba(5, 10, 18, 0.8);
}

.territory-3d {
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.territory-3d.is-dragging { cursor: grabbing; }

.territory-scene {
  isolation: isolate;
  outline: none;
}

.territory-scene:focus-visible {
  box-shadow: inset 0 0 0 1px rgba(0, 212, 255, 0.62), inset 0 0 32px rgba(0, 212, 255, 0.08);
}

.territory-interaction {
  position: absolute;
  z-index: 5;
  right: clamp(16px, 3vw, 46px);
  bottom: clamp(18px, 3vh, 34px);
  display: flex;
  align-items: center;
  gap: 13px;
  pointer-events: none;
}

.territory-interaction-hint {
  padding: 10px 13px;
  border: 1px solid rgba(0, 212, 255, 0.17);
  border-radius: 999px;
  background: rgba(2, 8, 15, 0.74);
  box-shadow: 0 9px 26px rgba(0, 0, 0, 0.34), inset 0 0 18px rgba(0, 212, 255, 0.035);
  color: rgba(167, 222, 234, 0.72);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.14em;
  line-height: 1;
  white-space: nowrap;
  backdrop-filter: blur(9px);
}

.territory-hint-mobile { display: none; }

.territory-control-buttons {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px;
  border: 1px solid rgba(0, 212, 255, 0.24);
  border-radius: 999px;
  background: rgba(2, 8, 15, 0.82);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.42), inset 0 0 20px rgba(0, 212, 255, 0.055);
  pointer-events: auto;
  backdrop-filter: blur(11px);
}

.territory-control-buttons button {
  min-width: 34px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.territory-control-buttons button:hover,
.territory-control-buttons button:focus-visible {
  border-color: rgba(0, 212, 255, 0.48);
  background: rgba(0, 212, 255, 0.12);
  box-shadow: 0 0 17px rgba(0, 212, 255, 0.16);
  color: #d7fbff;
  outline: none;
}

.territory-control-buttons .territory-reset {
  min-width: 104px;
  color: rgba(167, 222, 234, 0.82);
  font-size: 7px;
  letter-spacing: 0.13em;
}

@media (max-width: 767px) {
  #solar-system { min-height: 118vh; }

  #solar-system .scene-3d-content--atlas {
    width: 100%;
    padding-bottom: 28px;
  }

  #solar-system .atlas-hero-title {
    font-size: clamp(52px, 19vw, 86px);
    margin-bottom: 24px;
    letter-spacing: 0.12em;
    text-indent: 0.12em;
  }

  #solar-system .scene-hud {
    width: min(94vw, 520px);
    gap: 10px;
    padding: 14px 8px;
  }

  #solar-system .hud-stat { flex: 1; min-width: 0; }
  #solar-system .hud-value { font-size: 21px; }
  #solar-system .hud-value.hud-status { font-size: 14px; }
  #solar-system .hud-label { font-size: 7px; letter-spacing: 0.1em; }

  #portal { min-height: max(720px, 94vh); }
  #portal .scene-3d-content {
    width: 100%;
    padding: 0 14px 24px;
  }
  #portal .scene-title { font-size: clamp(30px, 8.5vw, 38px); }
  #portal .scene-desc { font-size: 13px; line-height: 1.55; }
  #portal .scene-desc-sub { font-size: 11.5px; line-height: 1.5; }
  #portal .portal-flow { gap: 7px; padding: 7px 9px; }
  #portal .portal-flow-step { font-size: 7px; }
  #portal .portal-flow .line { width: 9px; }
  .portal-stage-labels {
    top: 88px;
    left: 12px;
    right: 12px;
  }
  .portal-stage-label b { font-size: 7px; letter-spacing: 0.12em; }
  .portal-stage-label small { display: none; }

  .territory-interaction {
    right: 12px;
    bottom: 12px;
    left: 12px;
    justify-content: space-between;
    gap: 8px;
  }
  .territory-interaction-hint {
    max-width: calc(100% - 146px);
    overflow: hidden;
    padding: 9px 10px;
    font-size: 6.5px;
    letter-spacing: 0.09em;
    text-overflow: ellipsis;
  }
  .territory-hint-desktop { display: none; }
  .territory-hint-mobile { display: inline; }
  .territory-control-buttons { flex: 0 0 auto; }
  .territory-control-buttons button { min-width: 30px; height: 28px; padding: 0 8px; }
  .territory-control-buttons .territory-reset { min-width: 68px; font-size: 0; }
  .territory-control-buttons .territory-reset::after {
    content: 'CENTRAR';
    font-size: 6px;
    letter-spacing: 0.11em;
  }

  .premium-interaction-hint,
  #ivanBrainObj.brain-3d-active::after { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .atlas-tool-tip,
  .atlas-tool-notice { transition: none; }
  .territory-control-buttons button { transition: none; }
}
