/* ── Mappa "Locuste nel Mondo" ── */

.wm-empty {
  color: var(--gray-mid);
  font-size: 0.9rem;
  text-align: center;
  padding: 48px 24px;
  border: 1px dashed var(--green-dark);
  background: var(--bg-card);
}

.wm-back { margin-bottom: 8px; }
.wm-back a { color: var(--gray-mid); font-size: 0.85rem; transition: color 0.2s; }
.wm-back a:hover { color: var(--green-bright); }

.wm-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 14px;
}
.wm-stats__item {
  font-size: 0.78rem;
  color: var(--gray-mid);
  letter-spacing: 0.03em;
}
.wm-stats__item span:first-child {
  text-transform: uppercase;
  font-weight: 700;
  color: var(--gold);
  margin-right: 6px;
}

.wm-tabs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.wm-info-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-title);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(201, 168, 96, 0.08);
  border: 1px solid rgba(201, 168, 96, 0.35);
  border-radius: 999px;
  padding: 7px 16px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.wm-info-btn:hover { background: rgba(201, 168, 96, 0.18); border-color: var(--gold); }

/* ── Tutorial mappa (modal a slide) ── */
.wm-tutorial {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.wm-tutorial[hidden] { display: none; }

.wm-tutorial__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 10, 0.86);
  backdrop-filter: blur(3px);
}

.wm-tutorial__card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: var(--border-green);
  border-radius: var(--radius);
  padding: 40px 32px 28px;
  text-align: center;
  animation: wmTutorialPop 0.32s cubic-bezier(.22,.61,.36,1);
}
@keyframes wmTutorialPop {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

.wm-tutorial__close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: var(--gray-mid);
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s;
}
.wm-tutorial__close:hover { color: var(--green-bright); }

.wm-tutorial__slides { position: relative; min-height: 230px; }

.wm-tutorial__slide { display: none; animation: wmSlideIn 0.3s ease; }
.wm-tutorial__slide.is-active { display: block; }
@keyframes wmSlideIn {
  from { opacity: 0; transform: translateX(14px); }
  to   { opacity: 1; transform: none; }
}

.wm-tutorial__icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 18px;
  color: var(--green-bright);
}
.wm-tutorial__icon svg { width: 100%; height: 100%; }

.wm-tutorial__title {
  font-family: var(--font-title);
  font-size: 1.4rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 12px;
}

.wm-tutorial__text {
  color: var(--gray-light);
  font-size: 0.92rem;
  line-height: 1.6;
}

.wm-tutorial__dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 26px 0 20px;
}
.wm-tutorial__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green-dark);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.wm-tutorial__dot.is-active { background: var(--green-bright); transform: scale(1.3); }

.wm-tutorial__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.wm-tutorial__prev,
.wm-tutorial__next {
  font-family: var(--font-title);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 4px;
  transition: color 0.2s;
}
.wm-tutorial__prev { color: var(--gray-mid); }
.wm-tutorial__prev:hover { color: var(--gray-light); }
.wm-tutorial__prev[hidden] { visibility: hidden; }
.wm-tutorial__next { color: var(--green-bright); margin-left: auto; }
.wm-tutorial__next:hover { color: var(--white); }

@media (prefers-reduced-motion: reduce) {
  .wm-tutorial__card,
  .wm-tutorial__slide { animation: none; }
}

.wm-frame {
  position: relative;
  overflow: hidden;
  background: var(--bg-card);
  border-top: var(--border-green);
  margin-top: 32px;
}

.wm-leaflet {
  width: 100%;
  height: 60vh;
  min-height: 360px;
  background: var(--bg-main);
}

/* Livello Mondo: più spazio verticale — con i continenti sparsi da un polo
   all'altro il fitBounds ha bisogno di più altezza per non sembrare
   compresso/tagliato rispetto alla larghezza piena disponibile. */
.wm-leaflet--world {
  height: 82vh;
  min-height: 520px;
  max-height: 880px;
}

/* ── Marker (L.divIcon) — stessa estetica del vecchio .wm-pin su immagine,
   ora dentro un wrapper posizionato da Leaflet invece che da noi in % ── */
.wm-pin {
  cursor: pointer;
  transition: transform 0.2s ease;
}

.wm-pin:hover { transform: scale(1.15); }

.wm-pin-dot,
.wm-pin-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

/* Vista Continente/Nazione-con-regioni: tante nazioni/regioni vicine, pin
   più piccoli per non farle sovrapporre troppo tra loro. */
.wm-pin--small .wm-pin-dot,
.wm-pin--small .wm-pin-ring {
  width: 10px;
  height: 10px;
}
.wm-pin--small .wm-pin-ring {
  animation-name: wm-pulse-small;
}
@keyframes wm-pulse-small {
  0%   { width: 10px; height: 10px; opacity: 0.9; }
  100% { width: 28px; height: 28px; opacity: 0; }
}

.wm-pin-dot {
  background: var(--gold);
  /* alone scuro per staccare il pin dai tile sotto, poi il bagliore oro */
  box-shadow:
    0 0 0 4px rgba(13, 13, 13, 0.85),
    0 0 10px 2px rgba(201, 168, 96, 0.9),
    0 0 22px 7px rgba(201, 168, 96, 0.35);
}

.wm-pin-ring {
  border: 1.5px solid var(--gold-light);
  animation: wm-pulse 1.8s ease-out infinite;
}

@keyframes wm-pulse {
  0%   { width: 16px; height: 16px; opacity: 0.9; }
  100% { width: 46px; height: 46px; opacity: 0; }
}

.wm-pin:hover .wm-pin-dot {
  background: var(--green-bright);
  box-shadow:
    0 0 0 4px rgba(13, 13, 13, 0.85),
    0 0 12px 3px rgba(77, 184, 77, 0.9),
    0 0 26px 8px rgba(77, 184, 77, 0.4);
}

.wm-pin--hidden .wm-pin-dot { background: var(--gray-mid); box-shadow: 0 0 0 4px rgba(13, 13, 13, 0.85); }
.wm-pin--hidden .wm-pin-ring { display: none; }
.wm-pin--hidden { opacity: 0.6; }

/* Non ancora sbloccato dalla collezione (diverso da --hidden: qui il punto
   è pubblico e cliccabile, solo "vuoto" finché non arriva il primo sticker
   verificato) — colore pieno del territorio in arrivo, per ora solo il pin. */
.wm-pin--locked .wm-pin-dot { background: var(--gray-mid); box-shadow: 0 0 0 4px rgba(13, 13, 13, 0.85); }
.wm-pin--locked .wm-pin-ring { display: none; }

/* ── Livello Mondo: etichetta testuale al posto del pin ── */
.wm-label-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 650; /* sopra a tutti i pane Leaflet (max markerPane 600) */
}

.wm-country-label {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  padding: 6px 8px; /* allarga la zona cliccabile oltre il solo testo */
  margin: -6px -8px; /* ...senza spostare il centro visivo del testo */
  pointer-events: auto;
  cursor: pointer;
  white-space: nowrap;
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.9), 0 0 12px rgba(201, 168, 96, 0.4);
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

/* La label è un <a href>: :link/:visited del browser hanno la stessa
   specificità di una classe e vincono sul colore base sopra (testo
   blu/viola invece che oro) — li ridichiariamo esplicitamente. */
.wm-country-label:link,
.wm-country-label:visited {
  color: var(--gold);
}

.wm-country-label:hover,
.wm-country-label:hover:visited { color: var(--green-bright); }

.wm-country-label--hidden,
.wm-country-label--hidden:link,
.wm-country-label--hidden:visited {
  color: var(--gray-mid);
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.9);
  opacity: 0.7;
}

/* Tooltip Leaflet: restyle minimo per il tema scuro */
.wm-leaflet .leaflet-tooltip {
  background: var(--bg-card);
  border: 1px solid var(--gold);
  color: var(--gray-light);
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 4px;
  box-shadow: none;
}
.wm-leaflet .leaflet-tooltip-top:before { border-top-color: var(--gold); }

/* ── Tab Mappa/Elenco ── */
.wm-tabs {
  display: flex;
  gap: 8px;
  margin-top: 28px;
}
.wm-tab {
  background: none;
  border: 1px solid var(--green-dark);
  color: var(--gray-mid);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 8px 16px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.wm-tab.is-active { color: var(--gold); border-color: var(--gold); background: rgba(201, 168, 96, 0.08); }
.wm-tab:hover:not(.is-active) { color: var(--gray-light); }

/* ── Checklist (tab Elenco) ── */
.wm-checklist { list-style: none; padding: 32px 0; margin: 0; }
.wm-checklist__continent {
  font-weight: 700;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--gray-mid);
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.wm-checklist__continent.is-unlocked,
.wm-checklist__nations li.is-unlocked,
.wm-checklist__regions li.is-unlocked { color: var(--gold); }
.wm-checklist__dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.5;
  margin-right: 10px;
}
.wm-checklist__nations {
  list-style: none;
  padding: 8px 0 4px 18px;
  margin: 0;
  columns: 3;
}
.wm-checklist__nations li { color: var(--gray-mid); font-size: 0.85rem; padding: 3px 0; break-inside: avoid; }
.wm-checklist__regions { list-style: none; padding: 2px 0 2px 18px; margin: 0; }
.wm-checklist__regions li { color: var(--gray-mid); font-size: 0.75rem; padding: 1px 0; }

@media (max-width: 640px) {
  .wm-leaflet { height: 50vh; min-height: 300px; }
  .wm-leaflet--world { height: 65vh; min-height: 380px; }
  .wm-pin-dot, .wm-pin-ring { width: 14px; height: 14px; }
  .wm-checklist__nations { columns: 1; }
}
