.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.modal.is-open {
  display: flex;
}

.modal__overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(61, 43, 31, 0.55);
  backdrop-filter: blur(2px);
}

.modal__content {
  position: relative;
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: min(80vh, 640px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 2.2rem;
  box-shadow: var(--shadow-strong);
  animation: modal-pop 0.2s ease;
}

@keyframes modal-pop {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal__close {
  position: sticky;
  top: 0;
  float: right;
  margin-top: -0.6rem;
  margin-right: -0.6rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--color-bg-alt);
  color: var(--color-brown);
  font-size: 1.3rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

.modal__close:hover {
  background-color: var(--color-gold);
  color: #fff;
}

.modal__title {
  font-size: 1.6rem;
  margin-bottom: 1rem;
  padding-right: 2rem;
}

.modal__description {
  color: var(--color-text-soft);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 1.8rem;
  white-space: pre-line;
}

.modal__actions {
  display: flex;
  justify-content: center;
}

@media (max-width: 480px) {
  .modal__content {
    padding: 1.6rem;
    max-height: 85vh;
    border-radius: var(--radius-md);
  }
}
