a.button-middle {
  display: inline-block;
  padding: 8px 12px;
  background-color: #ff5733;
  font-size: 18px;
  border-radius: 8px;
  border: 2px solid #cc4125;
  box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: background 0.3s, transform 0.2s;
  text-decoration: none;
  color: white;
  text-align: center;
}

a.button-middle:hover {
  background-color: #e64a2e;
  border-color: #b3311c;
  transform: scale(1.05);
}

a.button-middle:active {
  animation: bounceEffect 0.4s ease-in-out, fadeOut 0.6s ease-in-out 0.4s forwards;
}

@keyframes bounceEffect {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

@keyframes fadeOut {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.8); }
}

a.button-middle::after {
  content: "運命の結果！";
  font-size: 24px;
  color: #ff4500;
  font-weight: bold;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.5);
  opacity: 0;
  transition: opacity 0.6s ease-in-out, transform 0.6s ease-in-out;
}

a.button-middle:active::after {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
