.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.modal.is-active {
  opacity: 1;
  visibility: visible;
}

.modal-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(5px);
  z-index: 1;
  cursor: pointer;
}

.modal-content {
  position: relative;
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
  z-index: 10;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center; /* 中央揃え！ */
}

@media screen and (max-width: 768px) {
  .modal-content {
    width: 100%;
    min-height: 400px;
    box-sizing: border-box;
  }
}

.modal-close-button {
  position: absolute;
  top: 10px;
  right: 10px;
  background: white;
  color: black;
  border: none;
  padding: 5px 10px;
  font-size: 16px;
  cursor: pointer;
  border-radius: 50%;
  z-index: 20;
}
.modal-close-button:hover {
  background: lightgray;
}

.modal-wrapper {
  position: relative;
  display: inline-block;
}

.modal-content {
  position: relative;
  z-index: 2;
}

.floating-message {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  font-size: 18px;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  padding: 10px 15px;
  border-radius: 12px;
  z-index: 3;

  display: inline-block;
  max-width: 80vw;
  white-space: nowrap;
}