/* Our supporters: the sticker-style world map, its heart pins and popover,
   the total and the list by country. Builds on hub.css and pages.css. */

.sup { max-width: 1100px; }
.intro { margin: -6px 0 16px; font-size: 19px; line-height: 1.45; color: var(--ink-soft); }

.map-card {
  position: relative; background: var(--paper); border-radius: 28px; box-shadow: var(--shadow);
  padding: 12px 12px 6px; margin: 0 0 22px;
}

.map { position: relative; }
.map-clip {
  position: relative; overflow: hidden; border-radius: 20px;
  aspect-ratio: 1000 / 420; background: #a9d8fb;
  touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab;
  border: 3px solid #fff; box-shadow: inset 0 0 0 2px rgba(61, 44, 85, 0.06);
}
.map-clip:active { cursor: grabbing; }
.map-clip svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pins { position: absolute; inset: 0; pointer-events: none; }

/* Art movement: waves bob, clouds drift, the boat rocks, the whale spouts. */
.wave { fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; opacity: 0.75; animation: bob 3.6s ease-in-out infinite; }
.wave.w1 { animation-delay: -1.2s; }
.wave.w2 { animation-delay: -2.4s; }
.cloud { animation: drift 14s ease-in-out infinite alternate; }
.cloud.c2 { animation-duration: 18s; animation-delay: -6s; }
.cloud.c3 { animation-duration: 16s; animation-delay: -3s; }
.boat { animation: rock 3s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 90%; }
.spout { animation: spout 2.8s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-2px); } }
@keyframes drift { to { translate: 28px 0; } }
@keyframes rock { 0%, 100% { rotate: -5deg; } 50% { rotate: 5deg; } }
@keyframes spout { 0%, 100% { opacity: 0.2; } 50% { opacity: 1; } }

/* The country's spot and its heart pin. */
.spot {
  position: absolute; left: 0; top: 0; width: 9px; height: 9px; border-radius: 50%;
  background: #ff6b6b; border: 2px solid #fff; box-shadow: 0 1px 2px rgba(61, 44, 85, 0.3);
}
.pin {
  --s: 40px;
  position: absolute; left: 0; top: 0; width: var(--s); height: var(--s);
  padding: 0; border: 0; background: none; cursor: pointer; pointer-events: auto;
  font: inherit; color: #fff; -webkit-tap-highlight-color: transparent;
}
.heart {
  position: relative; display: grid; place-items: center; width: 100%; height: 100%;
  animation: pinIn 0.7s cubic-bezier(0.2, 1.8, 0.4, 1) var(--d, 0ms) both;
  transition: transform 0.15s;
}
.heart svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 3px 0 rgba(61, 44, 85, 0.28)); }
.heart path { fill: #ff6b6b; stroke: #fff; stroke-width: 3.2; stroke-linejoin: round; }
.num {
  position: relative; margin-top: -8%; font-weight: 700; line-height: 1;
  font-size: calc(var(--s) * 0.4); text-shadow: 0 2px 0 rgba(209, 72, 72, 0.9);
}
.pin:hover .heart { transform: scale(1.1); }
.pin:active .heart { transform: scale(0.94); }
.pin.on .heart path { fill: #f783ac; }
.pin.on .heart { transform: scale(1.12); }
.pin:focus-visible { outline: none; }
.pin:focus-visible .heart svg { filter: drop-shadow(0 0 0 #fff) drop-shadow(0 0 4px #4dabf7) drop-shadow(0 0 3px #4dabf7); }
@keyframes pinIn {
  0% { transform: translateY(-40px) scale(0.2); opacity: 0; }
  60% { opacity: 1; }
  100% { transform: none; opacity: 1; }
}

/* Zoom buttons, bottom-left inside the map (open Pacific). */
.zoom { position: absolute; left: 10px; bottom: 10px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.zbtn {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: #fff; border: 3px solid var(--line); box-shadow: 0 4px 0 var(--line-d);
  font: 700 24px/1 var(--font); color: var(--ink); cursor: pointer; padding: 0;
  transition: transform 0.1s;
}
.zbtn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line-d); }
.zbtn:disabled { opacity: 0.45; cursor: default; transform: none; box-shadow: 0 4px 0 var(--line-d); }
.zbtn:focus-visible { outline: 4px solid rgba(77, 171, 247, 0.75); outline-offset: 2px; }
#zoomReset { font-size: 20px; }

/* The little paper card with the names. */
.pop {
  --tail: 50%;
  position: absolute; z-index: 100; padding: 14px 18px 14px; border-radius: 22px;
  background: var(--paper); border: 3px solid #fff; box-shadow: 0 10px 28px rgba(61, 44, 85, 0.28), 0 0 0 2px var(--line);
  text-align: center;
}
.pop::after {
  content: ''; position: absolute; left: var(--tail); bottom: -11px; width: 18px; height: 18px; margin-left: -9px;
  background: var(--paper); border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg); border-radius: 0 0 5px 0;
}
.pop.below::after { bottom: auto; top: -11px; transform: rotate(-135deg); }
.pop.pop-in { animation: popIn 0.35s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes popIn { from { transform: scale(0.6); opacity: 0; } }
.pop-x {
  position: absolute; top: 6px; right: 6px; width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: none; color: var(--ink-soft); font: 700 28px/1 var(--font); cursor: pointer;
}
.pop-x:focus-visible { outline: 3px solid rgba(77, 171, 247, 0.75); }
.pop-flag { font-size: 38px; line-height: 1; }
.pop-title { margin: 4px 26px 0; font-size: 23px; line-height: 1.15; outline: none; }
.pop-count { margin: 2px 0 8px; font-size: 17px; color: #d14848; }
.pop-names {
  list-style: none; margin: 0; padding: 0; max-height: 200px; overflow-y: auto;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px;
}
.pop-names li {
  padding: 4px 11px; border-radius: 999px; background: #fff; border: 2px solid var(--line);
  font-size: 16px; line-height: 1.3; overflow-wrap: anywhere;
}

.map-msg {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 60;
  width: min(340px, calc(100% - 32px)); margin: 0; padding: 14px 18px; border-radius: 20px;
  background: var(--paper); box-shadow: var(--shadow); text-align: center; font-size: 18px;
}

.total { margin: 12px 8px 8px; text-align: center; font-size: clamp(21px, 4.4vw, 28px); font-weight: 700; }

/* The list by country. */
.by-country { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.by-country > li { background: #fff; border: 3px solid var(--line); border-radius: 20px; padding: 12px 14px; }
.card .by-country > li { font-size: inherit; }
.bc-head { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-size: 20px !important; line-height: 1.2 !important; }
.bc-flag { font-size: 30px; line-height: 1; }
.bc-count { margin-left: auto; flex: none; padding: 2px 10px; border-radius: 999px; background: #ffe3e3; color: #d14848; font-size: 15px; }
.bc-names { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.card .bc-names li { padding: 3px 10px; border-radius: 999px; background: var(--paper); border: 2px solid var(--line); font-size: 16px; line-height: 1.35; overflow-wrap: anywhere; }

.no-flags .pop-flag, .no-flags .bc-flag {
  display: inline-block; padding: 3px 8px; border-radius: 10px; background: var(--blue); color: #fff;
  font-size: 15px; line-height: 1.2; letter-spacing: 1px; box-shadow: 0 3px 0 var(--blue-d);
}
.no-flags .pop-flag { margin-top: 4px; }

.empty { text-align: center; }
.empty-art { font-size: 54px; }

.join { text-align: center; }
.notes { list-style: none; margin: 18px auto 0; padding: 0; max-width: 560px; }
.card .notes li { font-size: 16px; line-height: 1.5; color: var(--ink-soft); }
.notes li::before { content: '💛 '; }

@media (max-width: 640px) {
  .map-card { padding: 8px 8px 4px; border-radius: 24px; }
  .map-clip { aspect-ratio: 1000 / 640; border-radius: 16px; }
  .zoom { left: 8px; bottom: 8px; gap: 6px; flex-direction: row; }
  .zbtn { width: 38px; height: 38px; font-size: 21px; border-width: 2px; box-shadow: 0 3px 0 var(--line-d); }
  .intro { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  .wave, .cloud, .boat, .spout, .heart, .pop.pop-in { animation: none; }
  .heart, .zbtn { transition: none; }
}

/* Set from map.js so the outline stays a similar thickness at every zoom. */
#world .outline { stroke-width: var(--outline, 9); }
#world .lakes { stroke-width: var(--lake, 3); }
@media (max-width: 640px) { .notes { text-align: left; } }
