html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #000;
  color: #fff;
  font-family: Arial, sans-serif;
}

body {
  position: relative;
}

canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  pointer-events: none;
}

.intro-overlay,
.exit-overlay {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.intro-overlay {
  background:
    radial-gradient(circle at center, rgba(255,255,255,0.10), rgba(0,0,0,0.88) 52%, rgba(0,0,0,1) 100%);
  backdrop-filter: blur(10px);
  opacity: 1;
  transform: scale(1.04);
}

body.loaded .intro-overlay {
  animation: introFade 1.05s cubic-bezier(.2, .9, .2, 1) forwards;
}

@keyframes introFade {
  0% {
    opacity: 1;
    transform: scale(1.04);
  }
  55% {
    opacity: 0.55;
    transform: scale(1.015);
  }
  100% {
    opacity: 0;
    transform: scale(1);
  }
}

.exit-overlay {
  background:
    radial-gradient(circle at center, rgba(255,255,255,0.02), rgba(0,0,0,0.80) 55%, rgba(0,0,0,1) 100%);
  opacity: 0;
  transform: scale(1);
  transition: opacity 0.72s ease, transform 0.72s ease;
}

body.leaving .exit-overlay {
  opacity: 1;
  transform: scale(1.03);
}

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 5;
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.46);
  backdrop-filter: blur(12px);
}

.back-link {
  border: 0;
  cursor: pointer;
  color: #fff;
  font-size: 0.98rem;
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  transition: transform 0.25s ease, background 0.25s ease;
}

.back-link:hover {
  transform: scale(1.06);
  background: rgba(255, 255, 255, 0.16);
}

.topbar-title {
  text-align: center;
  margin-right: 12px;
}

.topbar-title span {
  display: block;
  font-size: 1.1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.topbar-title small {
  display: block;
  margin-top: 4px;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  opacity: 0.7;
  text-transform: uppercase;
}

.planet-page {
  position: relative;
  z-index: 1;
  width: 100vw;
  height: 100vh;
}

.planet-stage {
  position: relative;
  width: min(1960px, 98vw);
  height: min(86vh, 820px);
  margin: 0 auto;
  top: 50%;
  transform: translateY(-44%);
}

.planet-card {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%) scale(0.68);
  opacity: 0;
  width: var(--size);
  text-align: center;
  transition:
    opacity 0.78s ease,
    transform 0.78s cubic-bezier(.16, .92, .18, 1);
  transition-delay: var(--delay);
  filter: saturate(1.02);
}

body.loaded .planet-card {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.planet-card img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  filter: drop-shadow(0 0 24px rgba(255,255,255,0.16));
  transition: transform 0.28s ease, filter 0.28s ease;
}

.planet-card:hover img {
  transform: scale(1.06);
  filter: drop-shadow(0 0 34px rgba(255,255,255,0.24));
}

.planet-card h2 {
  margin: 12px 0 0;
  font-size: clamp(0.92rem, 1.15vw, 1.4rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.18);
}

.mercury img { max-width: 84px; }
.venus img { max-width: 118px; }
.earth img { max-width: 122px; }
.mars img { max-width: 102px; }
.jupiter img { max-width: 250px; }
.saturn img { max-width: 220px; }
.uranus img { max-width: 132px; }
.neptune img { max-width: 132px; }

@media (max-width: 1100px) {
  .planet-stage {
    transform: translateY(-40%) scale(0.86);
  }
}

@media (max-width: 760px) {
  .topbar {
    height: 72px;
    padding: 0 14px;
  }

  .topbar-title span {
    font-size: 0.95rem;
  }

  .topbar-title small {
    font-size: 0.66rem;
  }

  .planet-stage {
    transform: translateY(-34%) scale(0.68);
  }

  .planet-card h2 {
    font-size: 0.82rem;
  }
}