/* ===== Wish Map (page + component) ===== */
:root {
  --wm-bg-1: #0b0626;
  --wm-bg-2: #24106b;
  --wm-bg-3: #3a1b9e;
  --wm-card: rgba(30, 14, 84, 0.85);
  --wm-border: rgba(173, 140, 255, 0.35);
  --wm-text: #ffffff;
  --wm-soft: #cfc4ff;
  --wm-accent: #b388ff;
  --wm-pin: #ff5fa2;
  --wm-green: #4be36a;
  --wm-radius: 20px;
}

* { box-sizing: border-box; }

/* ---------- Page (only for this dummy page) ---------- */
.wm-page {
  margin: 0;
  min-height: 100vh;
  font-family: "Outfit", system-ui, sans-serif;
  color: var(--wm-text);
  background: radial-gradient(ellipse at top, var(--wm-bg-3) 0%, var(--wm-bg-2) 40%, var(--wm-bg-1) 100%);
  background-attachment: fixed;
  padding-bottom: 90px; /* space for the bottom banner ad */
}

.wm-header {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 16px 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.wm-header h1 {
  font-family: "Fredoka", sans-serif;
  font-size: clamp(32px, 6vw, 52px);
  line-height: 1;
  margin: 0;
  background: linear-gradient(90deg, #8fd8ff, #c79bff 60%, #ff9ad5);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.wm-header p {
  margin: 8px 0 0;
  color: var(--wm-soft);
  font-size: 16px;
}

.wm-back {
  color: var(--wm-soft);
  text-decoration: none;
  font-size: 14px;
}
.wm-back:hover { color: #fff; }

.wm-page main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* bottom banner ad placeholder (client: banner always at the bottom) */
.wm-ad-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 6, 38, 0.95);
  border-top: 1px solid var(--wm-border);
  color: var(--wm-soft);
  font-size: 13px;
  z-index: 50;
}

/* ---------- Component ---------- */
.wish-map {
  background: var(--wm-card);
  border: 1px solid var(--wm-border);
  border-radius: var(--wm-radius);
  padding: 14px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, .4), 0 0 40px rgba(147, 112, 219, .2);
}

.wm-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.wm-types {
  display: flex;
  gap: 6px;
  background: rgba(0, 0, 0, .25);
  padding: 4px;
  border-radius: 999px;
}

.wm-type {
  border: none;
  background: transparent;
  color: var(--wm-soft);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.wm-type[aria-pressed="true"] {
  background: linear-gradient(135deg, #8f6bff, #b388ff);
  color: #fff;
}
.wm-total {
  font-size: 14px;
  color: var(--wm-soft);
  background: rgba(0, 0, 0, .25);
  padding: 8px 14px;
  border-radius: 999px;
}
.wm-total .wm-count { color: #fff; font-size: 16px; }

.wm-create {
  border: none;
  background: linear-gradient(180deg, #5df27a, var(--wm-green));
  color: #fff;
  font-family: "Fredoka", sans-serif;
  font-size: 16px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 6px 0 #1f9a3a, 0 10px 20px rgba(75, 227, 106, .35);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .3);
  transition: transform .15s ease;
}
.wm-create:hover { transform: translateY(-2px); }
.wm-create:active { transform: translateY(2px); box-shadow: 0 3px 0 #1f9a3a; }

.wm-map-wrap {
  position: relative;
  height: 70vh;
  min-height: 420px;
  border-radius: 16px;
  overflow: hidden;
  background: #1a0d4d;
}

.wm-map { position: absolute; inset: 0; }

/* loading */
.wm-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(26, 13, 77, .9);
  color: var(--wm-soft);
  z-index: 5;
}
.wm-loading[hidden] { display: none; }
.wm-spinner {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, .2);
  border-top-color: var(--wm-accent);
  animation: wm-spin .8s linear infinite;
}
@keyframes wm-spin { to { transform: rotate(360deg); } }

/* error / info toast */
.wm-error {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 24px);
  background: rgba(255, 82, 110, .95);
  color: #fff;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 14px;
  z-index: 6;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .35);
}
.wm-error[hidden] { display: none; }

/* empty notice */
.wm-empty-notice {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(30, 14, 84, 0.92);
  color: #fff;
  padding: 16px 28px;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 500;
  z-index: 5;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  text-align: center;
  pointer-events: none;
  backdrop-filter: blur(8px);
}
.wm-empty-notice[hidden] { display: none; }

/* locate me */
.wm-locate {
  position: absolute;
  right: 12px;
  bottom: 120px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: #fff;
  color: #3a1b9e;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .3);
  z-index: 4;
}
.wm-locate.is-busy { animation: wm-spin 1s linear infinite; }

/* pins */
.wm-pin {
  width: 40px;
  height: 40px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid #fff;
  background: var(--wm-pin);
  color: var(--wm-pin);
  box-shadow: 0 6px 14px rgba(0, 0, 0, .35), 0 0 18px currentColor;
  cursor: pointer;
  transition: transform .2s ease;
}
.wm-pin-ico {
  transform: rotate(45deg);
  color: #fff;
  font-size: 18px;
  line-height: 1;
}
.wm-pin:hover,
.wm-pin.is-selected { transform: rotate(-45deg) scale(1.2); }
.wm-pin.is-selected { border-color: #ffe066; }

/* clusters */
.wm-cluster {
  min-width: 44px;
  height: 44px;
  padding: 0 10px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, #b388ff, #6a3df0);
  color: #fff;
  font-weight: 700;
  border: 3px solid rgba(255, 255, 255, .85);
  box-shadow: 0 0 0 6px rgba(179, 136, 255, .3), 0 6px 14px rgba(0, 0, 0, .35);
}

/* ---------- wish details pop-up ---------- */
.wm-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(5, 2, 20, .7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.wm-modal[hidden] { display: none; }

.wm-modal-box {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  padding: 22px;
  border-radius: 22px;
  color: #fff;
  background: linear-gradient(180deg, #3a1b9e, #1e0e54);
  border: 2px solid var(--wm-accent);
  box-shadow: 0 25px 60px rgba(0, 0, 0, .55), 0 0 40px rgba(179, 136, 255, .3);
  animation: wm-pop .22s ease;
}
.wm-modal-box::-webkit-scrollbar {
  width: 6px;
}
.wm-modal-box::-webkit-scrollbar-track {
  background: rgba(11, 6, 38, .4);
  border-radius: 8px;
}
.wm-modal-box::-webkit-scrollbar-thumb {
  background: rgba(179, 136, 255, .4);
  border-radius: 8px;
}
.wm-modal-box::-webkit-scrollbar-thumb:hover {
  background: rgba(179, 136, 255, .7);
}
.wm-modal-box:focus { outline: none; }
@keyframes wm-pop {
  from { opacity: 0; transform: translateY(10px) scale(.96); }
  to { opacity: 1; transform: none; }
}

.wm-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.wm-modal-close:hover { background: rgba(255, 255, 255, .25); }

/* user */
.wm-user { display: flex; align-items: center; gap: 12px; padding-right: 40px; margin-bottom: 16px; }
.wm-avatar {
  position: relative;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 3px solid #fff;
  box-shadow: 0 0 0 3px rgba(179, 136, 255, .45);
}
.wm-avatar-initials { font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 20px; color: #fff; }
.wm-avatar-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #fff; }
.wm-author { font-family: "Fredoka", sans-serif; font-size: 18px; font-weight: 600; overflow-wrap: anywhere; }
.wm-time { font-size: 13px; color: var(--wm-soft); }
.wm-time-ago { color: #fff; font-weight: 600; }

/* the wish */
.wm-wish {
  padding: 16px;
  border-radius: 16px;
  background: rgba(11, 6, 38, .45);
  border: 1px solid rgba(173, 140, 255, .25);
}
.wm-wish-img-wrap {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 12px 0;
  border-radius: 14px;
  overflow: hidden;
  max-height: 250px;
  border: 1px solid rgba(173, 140, 255, .3);
  background: rgba(0, 0, 0, .35);
  display: flex;
  align-items: center;
  justify-content: center;
}
.wm-wish-img-wrap[hidden] {
  display: none !important;
}
.wm-wish-img {
  width: 100%;
  max-width: 100%;
  max-height: 250px;
  object-fit: contain;
  display: block;
}
.wm-badge {
  display: inline-block;
  background: rgba(255, 95, 162, .25);
  color: #ffb3d4;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.wm-text {
  font-family: "Fredoka", sans-serif;
  font-size: 20px;
  line-height: 1.4;
  margin: 0;
  overflow-wrap: anywhere;
}

.wm-meta { font-size: 14px; color: var(--wm-soft); margin-top: 14px; display: grid; gap: 2px; }
.wm-place::before { content: "📍 "; }
.wm-coords { font-size: 12px; opacity: .8; }

.wm-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, .1);
  font-size: 13px;
  color: var(--wm-soft);
}
.wm-like {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 143, 192, .5);
  background: transparent;
  color: #ffb3d4;
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background .2s ease, transform .15s ease;
}
.wm-like:hover { background: rgba(255, 95, 162, .15); }
.wm-like[aria-pressed="true"] { background: var(--wm-pin); border-color: var(--wm-pin); color: #fff; }
.wm-like[aria-pressed="true"] .wm-like-ico { animation: wm-beat .3s ease; }
@keyframes wm-beat { 50% { transform: scale(1.35); } }
.wm-source { font-size: 12px; }

.wm-modal-close:focus-visible,
.wm-like:focus-visible,
.wm-type:focus-visible,
.wm-create:focus-visible,
.wm-locate:focus-visible {
  outline: 3px solid #7cf3c4;
  outline-offset: 2px;
}

/* mobile: panel becomes a bottom sheet */
@media (max-width: 640px) {
  .wish-map { padding: 10px; }
  .wm-map-wrap { height: 65vh; }
  .wm-toolbar { flex-direction: column; align-items: stretch; }
  .wm-types, .wm-total { justify-content: center; text-align: center; }
  .wm-modal { place-items: end center; padding: 0; }
  .wm-modal-box {
    max-width: none;
    border-radius: 22px 22px 0 0;
    border-bottom: none;
    max-height: 85vh;
    padding-bottom: calc(22px + env(safe-area-inset-bottom));
  }
  .wm-locate { bottom: 20px; right: 10px; }
}