/* ============================================================
 * WorldMap — styles des markers de la carte monde réel
 * (MapLibre GL : ne JAMAIS surcharger `position` sur .maplibregl-marker,
 *  il doit rester `absolute` — cf. maplibre-gl.css)
 * ============================================================ */

/* Le canvas MapLibre remplit le conteneur existant */
#map-container .maplibregl-canvas-container,
#map-container canvas {
  border-radius: 8px;
}
#map-container {
  line-height: normal; /* annule le line-height:0 hérité de l'ère SVG */
}

/* ---------------- Markers ---------------- */
.wm-mk { cursor: pointer; }
.wm-mk img {
  display: block;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.35));
}
.wm-label {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -18px;
  white-space: nowrap;
  background: rgba(24, 28, 36, 0.85);
  color: #fff;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  pointer-events: none;
}

/* Placeholder sans sprite : pastille initiale */
.wm-placeholder {
  width: calc(34px * var(--wm-scale, 1));
  height: calc(34px * var(--wm-scale, 1));
  border-radius: 50%;
  background: var(--rz-accent, #3b82f6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.35);
}

/* Étiquettes masquées (réglage admin « Étiquettes de noms ») */
#map-container.wm-hide-labels .wm-label { display: none; }

/* Entreprises */
.wm-company img { width: calc(58px * var(--wm-scale, 1)); }
.wm-company .wm-label { background: rgba(79, 142, 247, 0.9); }

/* Joueurs */
.wm-player img { width: calc(40px * var(--wm-scale, 1)); }
.wm-player.offline { opacity: 0.55; filter: grayscale(0.7); }
.wm-player.is-self .wm-label {
  background: var(--rz-accent, #3fb27f);
  color: #08130d;
}
.wm-player.is-self img {
  filter: drop-shadow(0 0 6px var(--rz-accent, #3fb27f))
          drop-shadow(0 3px 4px rgba(0, 0, 0, 0.35));
}
.wm-player.moving .wm-label::after { content: " 🏃"; }

/* Anneau pulsant sous son propre avatar */
.wm-player.is-self::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 34px;
  height: 12px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(63, 178, 127, 0.55) 0%, transparent 70%);
  animation: wm-pulse 1.6s infinite;
}
@keyframes wm-pulse {
  0%, 100% { opacity: 0.9; transform: translateX(-50%) scale(1); }
  50%      { opacity: 0.4; transform: translateX(-50%) scale(1.35); }
}

/* PNJ (parties prenantes) */
.wm-npc img { width: calc(36px * var(--wm-scale, 1)); }
.wm-npc .wm-placeholder { background: #b07fd6; }
.wm-npc .wm-label { background: rgba(176, 127, 214, 0.9); }

/* ---------------- Popup entreprise ---------------- */
.maplibregl-popup-content {
  font-family: inherit;
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}
.wm-pop h3 { margin: 0; font-size: 14px; color: #223; }

/* ---------------- Contrôles carte dans la toolbar ---------------- */
#map-toolbar-actions select#wm-flavor {
  background: var(--rz-surface, #2a3040);
  color: var(--rz-text, #e8ecf3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 12px;
}
#map-toolbar-actions label.wm-3d-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  cursor: pointer;
  color: var(--rz-text, #e8ecf3);
}

/* ── Entraide P2P : partenaire disponible surligné (anneau + badge 🤝, pas
     d'information portée par la seule couleur) ─────────────────────────── */
.wm-mk.wm-help-eligible {
  outline: 3px solid #29ABE2;
  outline-offset: 3px;
  border-radius: 50%;
  animation: wm-help-pulse 1.6s ease-in-out infinite;
}
.wm-mk.wm-help-eligible::after {
  content: "🤝";
  position: absolute; top: -14px; right: -10px;
  font-size: 14px; line-height: 1;
}
@keyframes wm-help-pulse {
  0%, 100% { outline-color: rgba(41, 171, 226, 0.95); }
  50%      { outline-color: rgba(41, 171, 226, 0.35); }
}
