/* public/css/style.css */

/* ---------- FONT ---------- */
@font-face {
  font-family: 'Mikhak';
  src: url('../font/Mikhak.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: 'Mikhak', ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  user-select: none;
}

/* ---------- LEFT PANEL: DAY / BLUE SKY ---------- */
.sky-blue {
  background: linear-gradient(to bottom, #4aa3e0 0%, #7ec8f0 45%, #b9e2f7 100%);
}

/* ---------- EARTH CONTAINER ---------- */
/* Anchored by TOP edge. Its position is a fraction of the panel's height,
   so "top: 55%" means the top of the Earth sits 55% down the panel. */

.earth-container {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 620px;
  aspect-ratio: 1 / 1;
  top: 55%;
}

.earth {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 60px 10px rgba(80, 160, 230, 0.55),
    inset 0 0 40px rgba(0, 0, 0, 0.2);
  animation: spin 20s linear infinite;
  transform-origin: center center;
}

.earth-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* ---------- AGING GIANT ON EARTH ---------- */
.earth-man {
  position: absolute;
  left: 50%;
  top: -10px;
  transform: translate(-50%, -100%);
  width: 220px;
  height: 330px;
  pointer-events: none;
  filter: drop-shadow(0 6px 18px rgba(0, 40, 80, 0.35));
  z-index: 5;
}

.earth-man img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity .35s ease;
  user-select: none;
  -webkit-user-drag: none;
}

/* ---------- RIGHT PANEL: NIGHT / STARS ---------- */
.starry-night {
  background:
    radial-gradient(1px 1px at 20% 30%, #fff, transparent),
    radial-gradient(1px 1px at 40% 70%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 60% 20%, #fff, transparent),
    radial-gradient(1px 1px at 80% 50%, #fff, transparent),
    radial-gradient(1px 1px at 10% 80%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 75% 85%, #fff, transparent),
    radial-gradient(1px 1px at 55% 55%, #fff, transparent),
    radial-gradient(1px 1px at 30% 15%, #fff, transparent),
    radial-gradient(2px 2px at 90% 10%, #ffe9a8, transparent),
    radial-gradient(1px 1px at 5% 45%, #fff, transparent),
    radial-gradient(1px 1px at 65% 75%, #fff, transparent),
    radial-gradient(1px 1px at 45% 40%, #fff, transparent),
    radial-gradient(1px 1px at 85% 65%, #fff, transparent),
    radial-gradient(1px 1px at 15% 60%, #fff, transparent),
    radial-gradient(1px 1px at 95% 35%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 35% 90%, #fff, transparent),
    radial-gradient(1px 1px at 50% 10%, #fff, transparent),
    radial-gradient(1px 1px at 70% 40%, #fff, transparent),
    linear-gradient(to bottom, #05070f 0%, #0a1228 60%, #131a33 100%);
  background-repeat: no-repeat;
  background-size: cover;
}

/* ---------- ROCKET ---------- */
.rocket {
  transition: filter 0.2s ease;
  filter: drop-shadow(0 0 10px rgba(255, 150, 60, 0.65));
  will-change: left, top;
  cursor: ns-resize;
  touch-action: none;
  /* ← prevents scroll/zoom stealing the drag */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.rocket.dragging {
  filter: drop-shadow(0 0 20px rgba(255, 200, 80, 0.95));
  cursor: grabbing;
}

.rocket.reached {
  filter: drop-shadow(0 0 25px rgba(255, 220, 120, 1));
}

.rocket img {
  pointer-events: none;
}

/* data box follows rocket with slight offset */
#rocket-data {
  transition: opacity 0.2s ease;
}

/* ---------- RESPONSIVE OVERRIDES ---------- */

/* Mobile: Earth panel is 35% of screen height.
   Earth pushed down so only ~30% shows at the bottom of the panel.
   The man sits directly on the visible cap (tiny negative top). */
@media (max-width: 767px) {
  .earth-container {
    width: 130%;
    max-width: 340px;
    top: 70%;
  }

  .earth-man {
    width: 130px;
    height: 195px;
    top: -5px;
  }

  .earth {
    animation-duration: 30s;
  }
}

/* Smaller phones */
@media (max-width: 420px) {
  .earth-container {
    width: 140%;
    max-width: 300px;
    top: 72%;
  }

  .earth-man {
    width: 110px;
    height: 165px;
    top: -5px;
  }
}