.endScreen {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 25;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  background-color: rgba(0, 0, 0, 0.5);
}

.endScreen.active {
  display: flex;
}

.game-over-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 540px;
  gap: 20px;
  position: relative;
}

#gameOverImg {
  display: block;
  max-width: 80%;
  height: auto;
}

#restartContainer {
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.6s ease-in-out, transform 0.6s ease-in-out;
  pointer-events: auto;
  z-index: 100;
}

#restartContainer.slide-in {
  opacity: 1;
  transform: translate(-50%, 0);
}

.restart-container {
  position: relative;
  opacity: 0;
  transition: opacity 0.6s ease-in-out, transform 0.6s ease-in-out;
  pointer-events: auto;
  z-index: 100;
  margin: 20px 0;
}

.restart-container.slide-in {
  opacity: 1;
  transform: translateY(0);
}

.game-over-content {
  display: flex;
  justify-content: space-around;
  position: absolute;
  bottom: 10px;
  width: 100%;
}

#gameOverSVG {
  width: 100%;
  max-width: 400px;
  display: block;
}

#gameOverSVG .btn {
  font-size: 96px;
  fill: var(--primary-bright-yellow);
  stroke: var(--primary-orange-dark);
  stroke-width: 2px;
  paint-order: stroke;
  text-anchor: middle;
  cursor: pointer;
  opacity: 0;
  animation: fadeIn 1s forwards;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6);
  dominant-baseline: middle;
}

#gameOverSVG .btn:hover {
  fill: #ffb000;
  transition: fill 0.2s;
}

#restartGameSVG {
  width: 100%;
  max-width: 400px;
  display: block;
  margin-bottom: 40px;
}

#restartGameSVG .btn {
  font-size: 96px;
  fill: var(--primary-bright-yellow);
  stroke: var(--primary-orange-dark);
  stroke-width: 2px;
  paint-order: stroke;
  text-anchor: middle;
  cursor: pointer;
  opacity: 0;
  animation: fadeIn 1s forwards;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6);
  dominant-baseline: middle;
}

#restartGameSVG .btn:hover {
  fill: #ffb000;
  transition: fill 0.2s;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.level-complete-prompt-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.level-complete-content {
  text-align: center;
  color: #fff;
  padding: 40px;
  border-radius: 20px;
  background: linear-gradient(
    135deg,
    var(--primary-orange),
    var(--primary-orange-hover)
  );
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.level-complete-title {
  font-size: 48px;
  margin-bottom: 20px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  animation: glow 2s ease-in-out infinite alternate;
}

.level-complete-subtitle {
  font-size: 24px;
  margin-bottom: 30px;
  opacity: 0.9;
}

.level-complete-progress {
  width: 300px;
  margin: 0 auto;
}

.progress-bar {
  width: 100%;
  height: 20px;
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-yellow), #fff);
  border-radius: 10px;
  width: 0%;
  animation: fillProgress 3s ease-in-out forwards;
}

@keyframes fillProgress {
  to {
    width: 100%;
  }
}

@keyframes glow {
  from {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  }
  to {
    text-shadow: 2px 2px 20px rgba(255, 204, 0, 0.8);
  }
}
