/* ============================
   RESET & BASE
   ============================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: #000010;
  color: #e8e8ff;
  min-height: 100vh;
  overflow: hidden;
}

/* ============================
   CANVAS THREE.JS
   ============================ */
#three-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 1;
  display: block;
}

/* ============================
   HEADER
   ============================ */
header {
  position: fixed;
  z-index: 20;
  width: 100%;
  top: 0;
  text-align: center;
  padding: 1.5rem 1rem 2rem;
  background: linear-gradient(to bottom, rgba(0,0,16,0.85) 0%, transparent 100%);
  pointer-events: none;
}

header h1 {
  font-size: clamp(1.6rem, 4vw, 3rem);
  font-weight: 900;
  background: linear-gradient(90deg, #ffe066, #ff9a3c, #ff6b6b, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 2px;
}

.subtitle {
  color: #a0a8cc;
  font-size: 0.95rem;
  margin-top: 0.3rem;
  letter-spacing: 1px;
}

/* ============================
   LABELS 3D DOS PLANETAS
   ============================ */
.planet-label-3d {
  position: fixed;
  color: rgba(200,220,255,0.92);
  font-size: 11px;
  font-family: 'Segoe UI', sans-serif;
  text-shadow: 0 0 6px rgba(100,150,255,0.9), 0 1px 3px rgba(0,0,0,0.8);
  pointer-events: none;
  z-index: 15;
  transform: translate(-50%, -100%);
  white-space: nowrap;
  transition: opacity 0.2s;
}

/* ============================
   CONTROLOS FLUTUANTES
   ============================ */
#controls {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.6rem;
  z-index: 20;
}

#controls button {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  color: #dde0ff;
  border-radius: 2rem;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background 0.2s, transform 0.15s;
  white-space: nowrap;
}

#controls button:hover {
  background: rgba(255,255,255,0.16);
  transform: translateY(-2px);
}

/* ============================
   MENU LATERAL DE PLANETAS
   ============================ */
#planet-nav {
  position: fixed;
  left: 0; top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

#nav-toggle {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-left: none;
  border-radius: 0 0.5rem 0.5rem 0;
  padding: 0.6rem 0.7rem;
  cursor: pointer;
  color: #dde0ff;
  font-size: 1.1rem;
  backdrop-filter: blur(6px);
  transition: background 0.2s;
  user-select: none;
}
#nav-toggle:hover { background: rgba(255,255,255,0.16); }

#nav-list {
  background: rgba(6,6,24,0.92);
  border: 1px solid rgba(120,140,255,0.15);
  border-left: none;
  border-radius: 0 0.8rem 0.8rem 0;
  padding: 0.6rem 0.5rem 0.6rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  backdrop-filter: blur(10px);
  max-width: 0;
  overflow: hidden;
  transition: max-width 0.3s ease, padding 0.3s ease;
}
#planet-nav.open #nav-list {
  max-width: 160px;
  padding: 0.6rem 0.5rem 0.6rem 0.5rem;
}

.nav-title {
  font-size: 0.7rem;
  color: rgba(180,190,220,0.5);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0 0.3rem 0.4rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  margin-bottom: 0.3rem;
  white-space: nowrap;
}

.nav-planet-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  border-radius: 0.4rem;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
  font-size: 0.85rem;
  color: #c8d0f0;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}
.nav-planet-btn:hover {
  background: rgba(255,255,255,0.09);
  color: #fff;
}
.nav-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ============================
   PAINEL DE INFORMAÇÕES
   ============================ */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,16,0.5);
  z-index: 40;
  backdrop-filter: blur(3px);
}

.info-panel {
  position: fixed;
  top: 0; right: 0;
  width: min(420px, 95vw);
  height: 100vh;
  background: linear-gradient(135deg, rgba(8,8,32,0.97), rgba(16,16,48,0.97));
  border-left: 1px solid rgba(120,140,255,0.2);
  z-index: 50;
  overflow-y: auto;
  padding: 2rem 1.5rem 3rem;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(.25,.8,.25,1);
  box-shadow: -4px 0 30px rgba(80,100,255,0.15);
}

.info-panel.open { transform: translateX(0); }

.hidden { display: none !important; }

.close-btn {
  position: absolute;
  top: 1rem; right: 1rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: #e0e0ff;
  border-radius: 50%;
  width: 36px; height: 36px;
  font-size: 1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.close-btn:hover { background: rgba(255,80,80,0.3); }

.panel-img-wrap {
  text-align: center;
  margin-bottom: 1.2rem;
  position: relative;
  display: inline-block;
}

.panel-img-wrap img {
  width: 180px; height: 180px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--planet-color, #6080ff);
  box-shadow: 0 0 20px var(--planet-color, #6080ff), 0 0 40px rgba(100,120,255,0.2);
  animation: panel-planet-spin 12s linear infinite;
  display: block;
}

.panel-img-wrap::after {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 180px; height: 180px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 32% 30%,
    rgba(255,255,255,0.25) 0%,
    rgba(255,255,255,0.04) 45%,
    rgba(0,0,0,0.2) 80%,
    rgba(0,0,0,0.40) 100%
  );
  pointer-events: none;
  z-index: 2;
}

.panel-emoji {
  font-size: 5rem;
  display: block;
  filter: drop-shadow(0 0 12px rgba(150,120,200,0.7));
}

#panel-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--planet-color, #aabbff);
  margin-bottom: 1rem;
  text-align: center;
  text-shadow: 0 0 15px var(--planet-color, #6080ff);
}

/* Grid de estatísticas */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
}

.stat-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 0.6rem;
  padding: 0.5rem 0.7rem;
  text-align: center;
}

.stat-label {
  font-size: 0.65rem;
  color: rgba(180,190,220,0.7);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.stat-value {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--planet-color, #aabbff);
}

/* Curiosidades */
.facts-list h3 {
  font-size: 0.9rem;
  color: rgba(200,210,255,0.7);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.7rem;
  margin-top: 1rem;
}

.fact-item {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.7rem;
  line-height: 1.5;
  font-size: 0.88rem;
  color: #c8d0f0;
}

.fact-icon { font-size: 1rem; flex-shrink: 0; }

/* Missões espaciais */
.missions-section { margin-top: 1rem; }

.mission-card {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 0.6rem;
  padding: 0.5rem 0.7rem;
  margin-bottom: 0.5rem;
}

.mission-year {
  background: rgba(var(--planet-rgb, 100,120,255), 0.25);
  border: 1px solid var(--planet-color, #6080ff);
  color: var(--planet-color, #aabbff);
  border-radius: 0.4rem;
  padding: 0.1rem 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}

.mission-info { flex: 1; }

.mission-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #e0e8ff;
  display: block;
}

.mission-desc {
  font-size: 0.78rem;
  color: rgba(190,200,230,0.75);
  line-height: 1.4;
}

/* Facto destacado */
.fun-fact-card {
  background: linear-gradient(135deg, rgba(100,120,255,0.15), rgba(100,120,255,0.05));
  border: 1px solid var(--planet-color, #6080ff);
  border-radius: 0.8rem;
  padding: 0.8rem 1rem;
  margin-bottom: 1.2rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.5;
  text-shadow: 0 0 8px rgba(0,0,0,0.5);
}

/* Animação painel */
@keyframes panel-planet-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ============================
   MINI PLAYER DE MÚSICA
   ============================ */
#music-player {
  display: flex;
  align-items: center;
  gap: 4px;
}

#music-track-name {
  font-size: 9px;
  color: rgba(255,255,255,0.6);
  max-width: 80px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================
   RESPONSIVO
   ============================ */
@media (max-width: 600px) {
  .info-panel { width: 100vw; }
  #controls { bottom: 1rem; }
}
