/* ══════════════════════════════════════════════════════════════
   Heartability shared modal — one standard popup for the whole site.
   Use via assets/js/modal.js: HGModal.confirm(...) / HGModal.alert(...)
   Visual style matches the existing game-room popups (cream body,
   blue/aqua double border), sized for readability.
   ══════════════════════════════════════════════════════════════ */

.hg-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.hg-modal-overlay.open { display: flex; }

.hg-modal {
  background: #f5f0ea;
  box-shadow: 0 0 0 3px var(--blue, #6579e2), 0 0 0 6px var(--aqua, #83d2e6), 4px 8px 28px rgba(0, 0, 0, 0.35);
  width: min(92vw, 420px);
  overflow: hidden;
  animation: hgModalPopIn 0.2s ease both;
}

@keyframes hgModalPopIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hg-modal-titlebar {
  min-height: 44px;
  background: #e8e3da;
  border-bottom: 2px solid #bbb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  font-family: var(--font-hand, "ZoesHandwriting", cursive);
  font-size: 21px;
  color: #333;
}

.hg-modal-close {
  cursor: pointer;
  color: #999;
  font-family: var(--font-hand, "ZoesHandwriting", cursive);
  font-size: 22px;
  line-height: 1;
  padding: 4px;
  flex-shrink: 0;
}
.hg-modal-close:hover { color: var(--blue, #6579e2); }

.hg-modal-body {
  padding: 22px 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hg-modal-message {
  font-family: var(--font-hand, "ZoesHandwriting", cursive);
  font-size: 19px;
  line-height: 1.55;
  color: #222;
  white-space: pre-line;
}

.hg-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.hg-modal-btn {
  font-family: var(--font-hand, "ZoesHandwriting", cursive);
  font-size: 19px;
  color: #444;
  background: #d9d4cb;
  border: 2px solid #aaa;
  box-shadow: 2px 2px 0 #888;
  padding: 9px 18px;
  cursor: pointer;
  transition: all 0.05s;
}
.hg-modal-btn:hover { background: #cfc9be; }
.hg-modal-btn:active { box-shadow: none; transform: translate(2px, 2px); }

.hg-modal-btn-primary {
  color: #fff;
  background: var(--blue, #6579e2);
  border-color: #4a5bc4;
  box-shadow: 2px 2px 0 #3a4aaa;
}
.hg-modal-btn-primary:hover { background: #4a5bc4; }

.hg-modal-btn-danger {
  color: #fff;
  background: #d9534f;
  border-color: #b33a36;
  box-shadow: 2px 2px 0 #8a2a27;
}
.hg-modal-btn-danger:hover { background: #c9433f; }

@media (max-width: 480px) {
  .hg-modal-titlebar { font-size: 20px; }
  .hg-modal-message, .hg-modal-btn { font-size: 18px; }
}
