/* 1. Center all elements using flexbox */
body {
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background-image: url('bg.jpg');
  background-size: cover;       
  background-position: center;
  background-repeat: no-repeat;
  height: 100vh;
}

/* 5, 6. Space container setup */
.space {
  width: 200px;
  height: 200px;
  position: relative;
}

.earth {
  width: 200px; /* example size */
  height: 200px;
  background-image: url('earth.png'); /* replace with your image */
  background-size: cover;
  animation: spin 27s linear infinite;
  transform-origin: center center;
  display: block;
  margin: auto; /* keeps it centered */
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}


/* 7, 8, 14. Earth centered in space */
.earth img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* 9, 10, 11, 16. Orbit setup and animation */
.orbit {
  width: 400px;
  height: 400px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: orbit 7s linear infinite;
}

/* 12, 13, 15. Moon setup */
.moon img {
  width: 30px;
  height: 30px;
  background-color: #ccc;
  border-radius: 50%;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
}

/* 16. Orbit animation */
@keyframes orbit {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}
