/* =========================================================
   DYNASTY — MODALS
   Shared modal windows
   ========================================================= */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 900;
  padding: 0;
}

.modal-box {
  background: var(--dynasty-panel);
  border: 1px solid var(--dynasty-border);
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%;
  max-width: 460px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 20px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.modal-header h2 {
  font-size: 16px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--dynasty-muted);
  font-size: 20px;
  cursor: pointer;
}

body.modal-open {
  overflow: hidden;
}

/* ---------- responsive layout ---------- */

@media (min-width: 640px) {
  .modal-overlay {
    align-items: center;
    padding: 20px;
  }

  .modal-box {
    border-radius: var(--radius);
  }
}

@media (max-width: 420px) {
  .modal-box {
    padding: 16px;
  }
}