:root {
  --bg-main: #02081a;
  --bg-deep: #010312;
  --blue-core: #4fd5ff;
  --blue-core-strong: #5ad9ff;
  --blue-soft: #7ce7ff;
  --purple-glow: #4a2bff;
  --text-main: #e7f3ff;
  --text-soft: #9bb1ff;
  --accent-future: #ff6ad5;
  --tooltip-bg: rgba(5, 10, 30, 0.96);
  --border-soft: rgba(124, 231, 255, 0.35);
  --border-future: rgba(255, 106, 213, 0.5);
  --shadow-soft: 0 0 35px rgba(90, 217, 255, 0.5);
  --shadow-future: 0 0 40px rgba(255, 106, 213, 0.6);
}

/* Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  background: radial-gradient(circle at top, #041842 0, #031021 45%, var(--bg-main) 100%);
  color: var(--text-main);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Tema deep (G) */
body[data-theme="deep"] {
  background: radial-gradient(circle at top, #020824 0, #020215 40%, var(--bg-deep) 100%);
}

/* Modo Lyra Awake (I) */
body.lyra-awake {
  --blue-core: #7cf0ff;
  --blue-core-strong: #9df5ff;
  --accent-future: #ff9df2;
}

/* Modo low-power (J) – reduz animações/pesos */
body.low-power .planet-circle {
  animation-duration: 26s !important;
  box-shadow: 0 0 14px rgba(90, 217, 255, 0.6);
}

body.low-power .connection-line,
body.low-power .connection-line-secondary {
  opacity: 0.1;
  box-shadow: none;
}

.portal-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

/* PRELOADER (A) */
.preloader {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, #041842 0, #010313 60%, #000000 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.preloader-hidden {
  opacity: 0;
  visibility: hidden;
}

.preloader-core {
  text-align: center;
}

.preloader-logo {
  font-size: 46px;
  letter-spacing: 0.32em;
  padding-left: 0.32em;
  font-weight: 800;
  color: var(--blue-core);
  text-shadow:
    0 0 20px rgba(79, 213, 255, 1),
    0 0 60px rgba(0, 120, 255, 0.95),
    0 0 120px rgba(0, 200, 255, 0.9);
  animation: logoPulse 3.8s ease-in-out infinite;
}

.preloader-text {
  margin-top: 10px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-soft);
}

/* HUD (F) */
.hud {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 80;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(2, 10, 30, 0.88);
  border: 1px solid rgba(124, 231, 255, 0.4);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.75);
  font-size: 11px;
  pointer-events: none;
}

.hud-line + .hud-line {
  margin-top: 2px;
}

.hud-line {
  color: var(--text-soft);
}

.hud-line:first-child {
  color: var(--blue-soft);
}

/* Universo arrastável */
.universe {
  position: absolute;
  width: 3000px;
  height: 3000px;
  top: 0;
  left: 0;
  cursor: grab;
  transform-origin: 0 0;
  transition: transform 0.15s ease-out;
  will-change: transform;        /* ⬅ adiciona essa linha */
  overflow: visible;
}

.universe.dragging {
  cursor: grabbing;
  transition: none;   /* ⬅ adiciona isso */
}

/* Estrelas infinitas */
.stars {
  position: absolute;
  inset: 0;
  background-size: 320px 320px;
  background-repeat: repeat;
  pointer-events: none;
  will-change: transform, background-position;
  opacity: 0.9;
}

/* Camada de estrelas de fundo */
.layer-back {
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.28) 0.7px, transparent 1.3px),
    radial-gradient(circle, rgba(0, 153, 255, 0.18) 0.9px, transparent 1.8px),
    radial-gradient(circle, rgba(0, 100, 255, 0.22) 1.4px, transparent 2.4px);
  opacity: 0.45;
}

/* Camada de estrelas da frente */
.layer-front {
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.75) 0.8px, transparent 1.4px),
    radial-gradient(circle, rgba(124, 231, 255, 0.7) 1.4px, transparent 2.4px),
    radial-gradient(circle, rgba(90, 217, 255, 0.45) 2px, transparent 3px);
  opacity: 0.7;
}

/* Partículas extras (K) */
#particles-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
  z-index: 3;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.9) 0, transparent 70%);
  opacity: 0.55;
  animation: particleFloat 18s linear infinite;
}

@keyframes particleFloat {
  0% {
    transform: translate3d(0, 0, 0);
    opacity: 0.2;
  }
  50% {
    opacity: 0.65;
  }
  100% {
    transform: translate3d(-120px, -260px, 0);
    opacity: 0.15;
  }
}

/* Núcleo central Genesis */
.core {
  position: absolute;
  inset: 50%;
  transform: translate(-50%, -50%);
  width: 320px;
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
}

/* Halo do núcleo (E) */
.genesis-halo {
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(79, 213, 255, 0.9) 0, rgba(79, 213, 255, 0.0) 60%);
  opacity: 0.32;
  filter: blur(16px);
  animation: haloPulse 6s ease-in-out infinite;
}

@keyframes haloPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.28;
  }
  50% {
    transform: scale(1.15);
    opacity: 0.45;
  }
}

/* Logo Genesis */
.genesis-logo {
  position: relative;
  font-size: 64px;
  letter-spacing: 0.32em;
  padding-left: 0.32em;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--blue-core);
  text-shadow:
    0 0 18px rgba(79, 213, 255, 1),
    0 0 42px rgba(0, 120, 255, 0.95),
    0 0 90px rgba(0, 120, 255, 0.85),
    0 0 150px rgba(0, 200, 255, 0.9);
  animation: logoPulse 4s ease-in-out infinite;
}

@keyframes logoPulse {
  0%, 100% {
    transform: translateY(0);
    text-shadow:
      0 0 14px rgba(79, 213, 255, 0.9),
      0 0 34px rgba(0, 120, 255, 0.85),
      0 0 70px rgba(0, 120, 255, 0.7),
      0 0 120px rgba(0, 200, 255, 0.7);
  }
  50% {
    transform: translateY(-3px);
    text-shadow:
      0 0 26px rgba(79, 213, 255, 1),
      0 0 70px rgba(0, 160, 255, 1),
      0 0 130px rgba(0, 200, 255, 0.95),
      0 0 190px rgba(0, 240, 255, 0.9);
  }
}

/* Planetas */
.planet {
  position: absolute;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  z-index: 20;
}

.planet:focus-visible {
  outline: 2px solid var(--blue-core-strong);
  outline-offset: 4px;
}

/* círculo base */
.planet-circle {
  width: 70px;
  height: 70px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.9) 0, transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(74, 43, 255, 0.8) 0, transparent 50%),
    radial-gradient(circle at 10% 90%, rgba(90, 217, 255, 0.9) 0, transparent 45%);
  transition:
    transform 0.18s ease-out,
    box-shadow 0.18s ease-out;
  animation:
    planetDrift 18s ease-in-out infinite,
    planetFloat 22s ease-in-out infinite;
}

/* Gravidade suave (D) */
@keyframes planetFloat {
  0%, 100% {
    transform: translate3d(0, 0, 0);
  }
  25% {
    transform: translate3d(2px, -4px, 0);
  }
  50% {
    transform: translate3d(-2px, 3px, 0);
  }
  75% {
    transform: translate3d(1px, 2px, 0);
  }
}

/* animação leve no scale */
@keyframes planetDrift {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.04);
  }
}

.planet-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-soft);
  backdrop-filter: blur(6px);
  background: linear-gradient(
    to right,
    rgba(3, 10, 30, 0.7),
    rgba(4, 18, 50, 0.7)
  );
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(124, 231, 255, 0.3);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
}

.planet:hover .planet-circle,
.planet:focus-visible .planet-circle {
  transform: scale(1.08);
  box-shadow:
    0 0 24px rgba(90, 217, 255, 0.9),
    0 0 40px rgba(74, 43, 255, 0.8);
}

/* Planetas futuros (sem label visível) */
.planet-future .planet-label {
  display: none;
}

.planet-circle-future {
  width: 60px;
  height: 60px;
  border-color: var(--border-future);
  box-shadow: var(--shadow-future);
}

/* Tooltip */
.tooltip {
  position: fixed;
  max-width: 260px;
  background: var(--tooltip-bg);
  border-radius: 16px;
  padding: 10px 12px;
  border: 1px solid rgba(124, 231, 255, 0.35);
  box-shadow:
    0 18px 45px rgba(0, 0, 0, 0.7),
    0 0 28px rgba(74, 43, 255, 0.7);
  z-index: 40;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(0, 10px, 0);
  transition:
    opacity 0.18s ease-out,
    transform 0.18s ease-out;
}

.tooltip.visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.tooltip-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-bottom: 6px;
  color: var(--blue-soft);
}

.tooltip-text {
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-main);
}

/* Letreiro inferior */
.bottom-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 4px;
  pointer-events: none;
}

.ticker {
  overflow: hidden;
  border-top: 1px solid rgba(124, 231, 255, 0.18);
  border-bottom: 1px solid rgba(124, 231, 255, 0.18);
  background: linear-gradient(
    to right,
    rgba(1, 10, 30, 0.94),
    rgba(2, 16, 46, 0.96),
    rgba(1, 10, 30, 0.94)
  );
}

.ticker-content {
  display: inline-block;
  white-space: nowrap;
  padding: 6px 0;
  padding-left: 100%;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
  animation: tickerMove 45s linear infinite;
}

@keyframes tickerMove {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}

.phases-phrase {
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(231, 243, 255, 0.82);
  padding-bottom: 8px;
}

/* ÓRBITAS */
.orbit-ring {
  position: absolute;
  border-radius: 999px;
  border: 1px dashed rgba(124, 231, 255, 0.22);
  box-shadow: 0 0 18px rgba(0, 90, 255, 0.22);
  pointer-events: none;
  opacity: 0.75;
  z-index: 5;
}

/* Linhas de conexão */
.connection-line {
  position: absolute;
  height: 2px;
  background: linear-gradient(
    to right,
    rgba(0, 200, 255, 0.0),
    rgba(0, 220, 255, 0.20),
    rgba(130, 0, 255, 0.25)
  );
  transform-origin: 0 50%;
  pointer-events: none;
  opacity: 0.18;
  box-shadow: none;
  z-index: 10;
}

.connection-line-secondary {
  height: 1px;
  opacity: 0.10;
  background: linear-gradient(
    to right,
    rgba(130, 0, 255, 0.0),
    rgba(130, 0, 255, 0.18),
    rgba(0, 180, 255, 0.24)
  );
  box-shadow: none;
}

/* Botão de compartilhamento */
.share-button {
  position: fixed;
  right: 18px;
  bottom: 72px;
  z-index: 60;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(124, 231, 255, 0.4);
  background: radial-gradient(circle at 30% 0, rgba(124, 231, 255, 0.4), rgba(4, 18, 50, 0.95));
  color: var(--text-main);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow:
    0 0 18px rgba(0, 120, 255, 0.7),
    0 12px 32px rgba(0, 0, 0, 0.7);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  pointer-events: auto;
}

.share-button:hover {
  transform: translateY(-1px);
  box-shadow:
    0 0 24px rgba(0, 160, 255, 0.9),
    0 14px 40px rgba(0, 0, 0, 0.8);
}

.share-button.shared {
  border-color: rgba(90, 217, 255, 0.9);
  box-shadow:
    0 0 30px rgba(90, 217, 255, 0.9),
    0 14px 40px rgba(0, 0, 0, 0.8);
}

/* Responsivo */
@media (max-width: 768px) {
  .hud {
    left: 10px;
    top: 8px;
    padding: 6px 8px;
    font-size: 10px;
  }

  .genesis-logo {
    font-size: 26px;
    letter-spacing: 0.35em;
  }

  .planet-circle {
    width: 58px;
    height: 58px;
  }

  .planet-circle-future {
    width: 50px;
    height: 50px;
  }

  .planet-label {
    font-size: 10px;
  }

  .tooltip {
    max-width: 220px;
    font-size: 11px;
  }

  .ticker-content {
    font-size: 10px;
  }

  .phases-phrase {
    font-size: 10px;
    letter-spacing: 0.14em;
  }

  .share-button {
    bottom: 88px;
    padding: 8px 14px;
    font-size: 10px;
  }
}
