#ending {
  display: none;
  height: 100vh;
  background: linear-gradient(to top, #0f2027, #203a43, #2c5364);
  color: white;
  text-align: center;
  padding: 6rem 2rem;
  font-family: "Germania", serif;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

#ending.active {
  display: flex;
}

.ending-overlay {
  position: absolute;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6); 
  top: 0;
  left: 0;
  z-index: 1;
}

.ending-wrapper {
  position: relative;
  z-index: 2; 
  max-width: 700px;
  animation: fadeInUp 1s ease both;
}


.ending-wrapper {
  max-width: 700px;
  animation: fadeInUp 1s ease both;
}

.ending-title {
  font-size: 2.6rem;
  margin-bottom: 1rem;
}

.ending-subtitle {
  font-size: 1.4rem;
  line-height: 1.8;
  margin-bottom: 2rem;
}

#restartButton {
  background: transparent;
  border: 2px solid white;
  color: white;
  padding: 0.75rem 1.5rem;
  font-size: 1.125rem;
  border-radius: 1.5rem;
  cursor: pointer;
  font-family: "Rye", serif;
  transition: all 0.3s ease;
}

#restartButton:hover {
  background: white;
  color: black;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.typing-cursor::after {
  content: "|";
  animation: blink 1s infinite;
  margin-left: 4px;
}

@keyframes blink {
  0% { opacity: 1; }
  50% { opacity: 0; }
  100% { opacity: 1; }
}