/* ===========================================================
   DDD LIVE — Shared gothic popup (pilot v1)
   Styles scoped to .ddd-popup; safe for existing pages.
=========================================================== */
body.ddd-popup-open { overflow: hidden; }

.ddd-popup {
  box-sizing: border-box;
  width: min(92vw, 470px);
  max-width: 470px;
  max-height: min(90dvh, 660px);
  margin: auto;
  padding: 34px 27px 24px;
  overflow: auto;
  border: 1px solid #9c783f;
  border-radius: 20px;
  color: #f4ecf1;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(107, 38, 135, .28), transparent 60%),
    linear-gradient(155deg, #15101b, #070a0d 72%);
  box-shadow: 0 0 0 3px rgba(4,5,6,.95), 0 0 0 4px rgba(147,102,52,.58),
              0 28px 80px rgba(0,0,0,.85), inset 0 0 35px rgba(0,0,0,.44);
  text-align: center;
  z-index: 2147483000;
}
/* Tiny filigree-style corner accents, no fixed artwork or logos. */
.ddd-popup::before,
.ddd-popup::after {
  position: absolute;
  top: 9px;
  color: #b99155;
  font: 22px/1 Georgia, serif;
  opacity: .9;
  pointer-events: none;
}
.ddd-popup::before { content: "❦"; left: 14px; }
.ddd-popup::after { content: "❦"; right: 57px; transform: scaleX(-1); }
.ddd-popup::backdrop {
  background: rgba(0,0,0,.78);
  backdrop-filter: blur(5px);
}
.ddd-popup[open] { animation: ddd-popup-enter .22s ease-out both; }
@keyframes ddd-popup-enter {
  from { opacity: 0; transform: translateY(15px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.ddd-popup__topline {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 0 23px;
  color: #d792f4;
  font: 800 10px/1.35 system-ui, sans-serif;
  letter-spacing: .19em;
}
.ddd-popup__topline > span:first-child,
.ddd-popup__topline > span:last-child { color: #b89358; }
.ddd-popup__close {
  position: absolute;
  top: 12px;
  right: 13px;
  display: grid;
  place-items: center;
  width: 37px;
  height: 37px;
  border: 1px solid rgba(217,167,113,.35);
  border-radius: 50%;
  background: #17101b;
  color: #d9ccdd;
  font: 26px/1 Arial, sans-serif;
  cursor: pointer;
}
.ddd-popup__close:hover, .ddd-popup__close:focus-visible {
  color: #fff;
  border-color: #d790f7;
  outline-offset: 2px;
}
.ddd-popup__seal {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  margin: 20px auto 14px;
  border: 2px solid #9c783f;
  border-radius: 50%;
  background: radial-gradient(circle, #3b174a 0%, #140f1c 70%);
  box-shadow: 0 0 0 5px rgba(157,104,59,.12), 0 0 28px rgba(177,49,228,.24);
  color: #d190e8;
  font: 52px/1 Georgia, serif;
}
.ddd-popup[data-type="success"] .ddd-popup__seal,
.ddd-popup[data-type="success"] .ddd-popup__title { color: #58fb7c; }
.ddd-popup[data-type="warning"] .ddd-popup__seal,
.ddd-popup[data-type="warning"] .ddd-popup__title { color: #ffd16f; }
.ddd-popup[data-type="danger"] .ddd-popup__seal,
.ddd-popup[data-type="danger"] .ddd-popup__title { color: #ff8998; }
.ddd-popup[data-type="reward"] .ddd-popup__seal,
.ddd-popup[data-type="reward"] .ddd-popup__title { color: #cc94ff; }
.ddd-popup__title {
  margin: 0 0 12px;
  color: #faf7f8;
  font: 400 clamp(25px, 5vw, 34px)/1.12 "CreepsterLocal", "Creepster", Georgia, serif;
  letter-spacing: -.02em;
  text-wrap: balance;
}
.ddd-popup__message {
  max-width: 38ch;
  margin: 0 auto 23px;
  color: #d6ced9;
  font: 400 15px/1.65 system-ui, -apple-system, 'Segoe UI', sans-serif;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.ddd-popup__actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}
.ddd-popup__button {
  min-height: 46px;
  min-width: 130px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  font: 800 13px/1.2 system-ui, sans-serif;
  cursor: pointer;
  transition: filter .15s ease, transform .15s ease;
}
.ddd-popup__button:hover { filter: brightness(1.12); transform: translateY(-1px); }
.ddd-popup__button:focus-visible { outline: 2px solid white; outline-offset: 3px; }
.ddd-popup__button--primary {
  color: #041309;
  background: #2bfa51;
  box-shadow: 0 0 20px rgba(43,250,81,.16);
}
.ddd-popup__button--cancel {
  color: #f7eafd;
  border-color: #a65bc5;
  background: #4d1c65;
}
.ddd-popup__button[hidden] { display: none; }
.ddd-popup__footer {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid rgba(171,125,71,.28);
  color: #a98eb3;
  font: 700 9px/1.4 system-ui, sans-serif;
  letter-spacing: .2em;
}
@media (max-width: 480px) {
  .ddd-popup { padding: 35px 18px 20px; border-radius: 16px; }
  .ddd-popup__actions { flex-direction: column-reverse; }
  .ddd-popup__button { width: 100%; }
  .ddd-popup__topline { letter-spacing: .09em; font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .ddd-popup[open] { animation: none; }
  .ddd-popup__button { transition: none; }
}
