
.clear-image {
  width: 320px;
  height: auto;
  animation: clearImageAnimation 3s ease-in-out;
  filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.4));
  position: relative;
  z-index: 2;
}

.clear-buttons {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 25px;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.5s ease-out;
  z-index: 4;
}

.clear-buttons.show-buttons {
  opacity: 1;
  transform: translateY(0);
}

.clear-button {
  padding: 15px 25px;
  font-size: 16px;
  font-weight: bold;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
  min-width: 140px;
}

.clear-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s ease;
}

.clear-button:hover::before {
  left: 100%;
}

.next-stage-btn {
  background: linear-gradient(145deg, #4caf50 0%, #45a049 100%);
  color: white;
}

.next-stage-btn:hover {
  background: linear-gradient(145deg, #66bb6a 0%, #4caf50 100%);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.retry-btn {
  background: linear-gradient(145deg, #ff9800 0%, #f57c00 100%);
  color: white;
}

.retry-btn:hover {
  background: linear-gradient(145deg, #ffb74d 0%, #ff9800 100%);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.stage-select-btn {
  background: linear-gradient(145deg, #2196f3 0%, #1976d2 100%);
  color: white;
}

.stage-select-btn:hover {
  background: linear-gradient(145deg, #42a5f5 0%, #2196f3 100%);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

@keyframes stageImageAnimation {
  0% {
    transform: translateY(-80px) scale(0.6) rotate(-5deg);
    opacity: 0;
  }
  25% {
    transform: translateY(-10px) scale(1.05) rotate(1deg);
    opacity: 1;
  }
  50% {
    transform: translateY(0) scale(1) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(0) scale(1) rotate(0deg);
    opacity: 1;
  }
}

@keyframes levelTextAnimation {
  0% {
    transform: scale(0) rotate(-10deg);
    opacity: 0;
  }
  25% {
    transform: scale(0.3) rotate(-5deg);
    opacity: 0.3;
  }
  50% {
    transform: scale(1.2) rotate(2deg);
    opacity: 1;
  }
  75% {
    transform: scale(1.05) rotate(-1deg);
    opacity: 1;
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

@keyframes clearImageAnimation {
  0% {
    transform: translateY(80px) scale(0.5) rotate(5deg);
    opacity: 0;
  }
  25% {
    transform: translateY(80px) scale(0.5) rotate(5deg);
    opacity: 0;
  }
  50% {
    transform: translateY(10px) scale(1.1) rotate(-2deg);
    opacity: 1;
  }
  75% {
    transform: translateY(-5px) scale(1.05) rotate(1deg);
    opacity: 1;
  }
  100% {
    transform: translateY(0) scale(1) rotate(0deg);
    opacity: 1;
  }
}

@keyframes sparkleAnimation {
  0%,
  100% {
    opacity: 0.5;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

/* キラキラエフェクト用 */
.stage-clear-overlay::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(
      circle at 20% 20%,
      rgba(255, 255, 255, 0.8) 2px,
      transparent 2px
    ),
    radial-gradient(
      circle at 80% 80%,
      rgba(255, 255, 255, 0.6) 1px,
      transparent 1px
    ),
    radial-gradient(
      circle at 40% 60%,
      rgba(255, 255, 255, 0.7) 1.5px,
      transparent 1.5px
    ),
    radial-gradient(
      circle at 60% 30%,
      rgba(255, 255, 255, 0.5) 1px,
      transparent 1px
    ),
    radial-gradient(
      circle at 30% 80%,
      rgba(255, 255, 255, 0.8) 2px,
      transparent 2px
    );
  background-size: 100px 100px, 150px 150px, 80px 80px, 120px 120px, 90px 90px;
  animation: sparkleAnimation 2s ease-in-out infinite;
  pointer-events: none;
}
