/* =====================================================================
   Wiki Cards — onglet « Carte du monde » (folio-map)
   Tes cartes placées sur une carte du monde (ville / pays de l'article).
   Pour retirer l'onglet : enlever les lignes folio-map.css et folio-map.js de index.html.
   ===================================================================== */
#view-worldmap.active{display:block; padding:18px 32px 60px;}

.wm-head{display:flex; flex-wrap:wrap; align-items:flex-end; justify-content:space-between; gap:14px; margin-bottom:16px;}
.wm-head .count b{color:var(--gold-a, #f5d67c);}

/* ---------------------------------------------------------------- barre d'outils */
.wm-tools{display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin-bottom:14px;}
.wm-search{
  display:flex; align-items:center; gap:8px; flex:1 1 240px; min-width:0; padding:0 12px; border-radius:12px;
  background:rgba(7,8,12,0.75); border:1px solid rgba(255,255,255,0.09); box-shadow:inset 0 2px 6px rgba(0,0,0,0.5);
}
.wm-search:focus-within{border-color:var(--gold-b, #c9922e); box-shadow:inset 0 2px 6px rgba(0,0,0,0.5), 0 0 0 3px rgba(245,214,124,0.15);}
.wm-search svg{width:17px; height:17px; color:var(--text-faint, #778); flex-shrink:0;}
.wm-search input{flex:1; min-width:0; background:none; border:none; outline:none; color:var(--text, #eee); padding:10px 0; font:inherit; font-size:0.86rem;}
.wm-chips{display:flex; flex-wrap:wrap; gap:6px;}
.wm-chip{
  --c:#f5d67c; display:inline-flex; align-items:center; gap:6px; padding:6px 11px; border-radius:100px; cursor:pointer;
  font:600 0.7rem 'Chakra Petch', 'Space Grotesk', sans-serif; letter-spacing:0.06em; text-transform:uppercase;
  color:var(--text-dim, #aab); background:rgba(255,255,255,0.04); border:1px solid rgba(255,255,255,0.1);
  transition:color .15s, border-color .15s, background .15s;
}
.wm-chip i{width:8px; height:8px; border-radius:50%; background:var(--c); box-shadow:0 0 6px var(--c);}
.wm-chip:hover{color:var(--text, #eee); border-color:rgba(255,255,255,0.25);}
.wm-chip.on{color:#1a1408; background:linear-gradient(120deg, #f5d67c, #c9922e); border-color:transparent;}
.wm-chip.on i{background:#1a1408; box-shadow:none;}

/* ---------------------------------------------------------------- mise en page */
.wm-layout{display:grid; grid-template-columns:minmax(0, 1fr) 320px; gap:16px; align-items:start;}
.wm-map-wrap{position:relative; border-radius:18px; overflow:hidden; border:1px solid var(--fg-edge, rgba(245,214,124,0.22)); box-shadow:0 18px 40px -22px rgba(0,0,0,0.9);}
.wm-map{height:calc(100vh - 280px); min-height:460px; background:#0b0d12;}

.wm-reset{
  position:absolute; top:12px; right:12px; z-index:500; display:inline-flex; align-items:center; gap:6px; cursor:pointer;
  padding:8px 12px; border-radius:10px; font:600 0.7rem 'Chakra Petch', sans-serif; letter-spacing:0.08em; text-transform:uppercase;
  color:#f5d67c; background:rgba(14,16,22,0.9); border:1px solid rgba(245,214,124,0.4); backdrop-filter:blur(6px);
}
.wm-reset:hover{border-color:#f5d67c;}
.wm-reset svg{width:14px; height:14px;}

.wm-progress{
  position:absolute; left:12px; bottom:12px; z-index:500; width:min(320px, calc(100% - 24px)); padding:10px 12px; border-radius:12px;
  background:rgba(14,16,22,0.92); border:1px solid rgba(245,214,124,0.35); backdrop-filter:blur(6px);
  font:600 0.72rem 'Chakra Petch', sans-serif; letter-spacing:0.04em; color:var(--text, #eee);
  transition:opacity .3s;
}
.wm-progress[hidden]{display:none;}
.wm-progress-bar{height:5px; margin-top:7px; border-radius:100px; background:rgba(255,255,255,0.08); overflow:hidden;}
.wm-progress-bar i{display:block; height:100%; width:0; border-radius:inherit; background:linear-gradient(90deg, #c9922e, #f5d67c, #fff3c4); transition:width .4s ease; box-shadow:0 0 8px rgba(245,214,124,0.6);}

.wm-empty{
  position:absolute; inset:0; z-index:600; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px;
  padding:24px; text-align:center; background:rgba(11,13,18,0.82); color:var(--text-dim, #aab);
}
.wm-empty[hidden]{display:none;}
.wm-empty b{color:var(--text, #eee); font-size:1.05rem;}
.wm-empty p{margin:0; max-width:380px; font-size:0.86rem; line-height:1.5;}

/* ---------------------------------------------------------------- colonne de droite */
.wm-side{display:flex; flex-direction:column; gap:14px;}
.wm-stats{display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:8px;}
.wm-stat{padding:12px 8px; border-radius:14px; text-align:center; background:var(--fg-panel, #151821); border:1px solid var(--fg-edge, rgba(245,214,124,0.22));}
.wm-stat b{display:block; font:700 1.35rem 'Chakra Petch', sans-serif; color:#f5d67c; line-height:1.1;}
.wm-stat small{display:block; margin-top:3px; font-size:0.66rem; color:var(--text-dim, #aab); text-transform:uppercase; letter-spacing:0.06em;}

.wm-countries{border-radius:16px; background:var(--fg-panel, #151821); border:1px solid var(--fg-edge, rgba(245,214,124,0.22)); overflow:hidden;}
.wm-countries header{display:flex; align-items:baseline; justify-content:space-between; padding:14px 16px 8px;}
.wm-countries h2{margin:0; font:700 0.86rem 'Chakra Petch', sans-serif; letter-spacing:0.1em; text-transform:uppercase; color:var(--text, #eee);}
.wm-countries header small{font-size:0.72rem; color:var(--text-faint, #778);}
.wm-list{max-height:calc(100vh - 460px); min-height:220px; overflow-y:auto; padding:0 8px 10px;}
.wm-country{
  display:flex; align-items:center; gap:10px; width:100%; padding:8px 10px; border-radius:11px; cursor:pointer; text-align:left;
  background:none; border:1px solid transparent; color:var(--text, #eee); font:inherit; transition:background .15s, border-color .15s;
}
.wm-country:hover{background:rgba(255,255,255,0.04);}
.wm-country.on{background:linear-gradient(120deg, rgba(245,214,124,0.16), rgba(245,214,124,0.03)); border-color:rgba(245,214,124,0.35);}
.wm-flag{width:26px; font-size:1.2rem; line-height:1; text-align:center; flex-shrink:0;}
.wm-cname{flex:1; min-width:0;}
.wm-cname b{display:block; font-size:0.84rem; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.wm-cname i{display:block; height:4px; margin-top:5px; border-radius:100px; background:rgba(255,255,255,0.06); overflow:hidden;}
.wm-cname i span{display:block; height:100%; border-radius:inherit; background:linear-gradient(90deg, #c9922e, #f5d67c);}
.wm-cnum{font:700 0.9rem 'Chakra Petch', sans-serif; color:#f5d67c; min-width:28px; text-align:right;}
.wm-none{padding:18px 10px; text-align:center; font-size:0.8rem; color:var(--text-faint, #778);}

/* ---------------------------------------------------------------- Leaflet : thème sombre */
.wm-map.leaflet-container{background:#0b0d12; font-family:'Space Grotesk', system-ui, sans-serif;}
.wm-map .leaflet-control-zoom a{background:rgba(14,16,22,0.92); color:#f5d67c; border-color:rgba(245,214,124,0.25);}
.wm-map .leaflet-control-zoom a:hover{background:rgba(40,34,18,0.95);}
.wm-map .leaflet-bar{border:1px solid rgba(245,214,124,0.3); box-shadow:0 8px 20px -8px rgba(0,0,0,0.8);}
.wm-map .leaflet-control-attribution{background:rgba(11,13,18,0.75); color:rgba(255,255,255,0.45); font-size:0.62rem;}
.wm-map .leaflet-control-attribution a{color:rgba(245,214,124,0.75);}

/* épingle = vignette de la carte entourée de la couleur de sa rareté */
.wm-icon{background:none !important; border:none !important;}
.wm-pin{
  --c:#8b8b86; position:relative; width:40px; height:40px; padding:3px; border-radius:50%; box-sizing:border-box;
  background:var(--c); box-shadow:0 5px 14px rgba(0,0,0,0.65), 0 0 0 2px rgba(0,0,0,0.35);
  transition:transform .15s ease; transform-origin:50% 115%;
}
.wm-pin::after{content:''; position:absolute; left:50%; bottom:-7px; transform:translateX(-50%); border:7px solid transparent; border-bottom:0; border-top-color:var(--c);}
.wm-pin span{
  display:flex; align-items:center; justify-content:center; width:100%; height:100%; border-radius:50%;
  background:#1a1d27 center / cover no-repeat; color:#fff; font:700 0.62rem 'Chakra Petch', sans-serif; letter-spacing:0.04em;
}
.wm-pin.rare{box-shadow:0 5px 14px rgba(0,0,0,0.65), 0 0 14px 2px var(--c);}
.wm-pin.legend{animation:wm-glow 2.4s ease-in-out infinite;}
@keyframes wm-glow{50%{box-shadow:0 5px 14px rgba(0,0,0,0.65), 0 0 22px 6px var(--c);}}
.leaflet-marker-icon:hover .wm-pin, .wm-pin.hi{transform:scale(1.18);}

/* regroupements */
.wm-cluster{
  --c:#f5d67c; width:100%; height:100%; border-radius:50%; display:flex; align-items:center; justify-content:center; box-sizing:border-box;
  background:radial-gradient(circle, #1d2130 58%, #11141c 100%); border:3px solid var(--c);
  box-shadow:0 0 0 5px color-mix(in srgb, var(--c) 22%, transparent), 0 6px 16px rgba(0,0,0,0.6);
  color:#fff; font:700 0.86rem 'Chakra Petch', sans-serif;
}
.wm-cluster.big{font-size:1rem;}
.marker-cluster-anim .leaflet-marker-icon, .marker-cluster-anim .leaflet-marker-shadow{transition:transform .3s ease-out, opacity .3s ease-in;}

/* bulle d'une carte */
.wm-popup .leaflet-popup-content-wrapper{
  background:rgba(16,19,27,0.97); color:var(--text, #eee); border:1px solid rgba(245,214,124,0.35); border-radius:16px;
  box-shadow:0 20px 40px -12px rgba(0,0,0,0.9);
}
.wm-popup .leaflet-popup-tip{background:rgba(16,19,27,0.97); border:1px solid rgba(245,214,124,0.35);}
.wm-popup .leaflet-popup-content{margin:10px; width:220px !important;}
.wm-popup a.leaflet-popup-close-button{color:rgba(255,255,255,0.6); top:6px; right:6px;}
.wm-pop-img{position:relative; height:120px; border-radius:11px; background:#1a1d27 center / cover no-repeat;}
.wm-pop-img .tier{
  position:absolute; top:8px; left:8px; padding:2px 8px; border-radius:6px;
  font:700 0.62rem 'Chakra Petch', sans-serif; letter-spacing:0.06em; color:#0d1117;
}
.wm-pop-img .ini{position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font:700 2.4rem Georgia, serif; color:rgba(255,255,255,0.85);}
.wm-pop h4{margin:10px 0 3px; font:600 1rem 'Fraunces', Georgia, serif; line-height:1.25; color:var(--text, #eee);}
.wm-pop-where{display:flex; align-items:center; gap:5px; font-size:0.74rem; color:var(--text-dim, #aab);}
.wm-pop-where svg{width:13px; height:13px; color:#f5d67c; flex-shrink:0;}
.wm-pop-stats{display:flex; gap:14px; margin-top:8px; font:600 0.78rem 'Chakra Petch', sans-serif;}
.wm-pop-stats span{display:inline-flex; align-items:center; gap:4px;}
.wm-pop-stats svg{width:13px; height:13px;}
.wm-pop-stats .atk{color:#ff8f83;} .wm-pop-stats .def{color:#8fbdf5;}
.wm-pop-actions{display:flex; gap:6px; margin-top:10px;}
.wm-pop-actions button, .wm-pop-actions a{
  flex:1; display:inline-flex; align-items:center; justify-content:center; padding:7px 8px; border-radius:9px; cursor:pointer; text-decoration:none;
  font:700 0.68rem 'Chakra Petch', sans-serif; letter-spacing:0.06em; text-transform:uppercase;
}
.wm-pop-actions button{color:#1a1408; border:1px solid #ffeebf; background:linear-gradient(180deg, #ffe9a6, #f5d67c 35%, #c9922e);}
.wm-pop-actions a{color:var(--text, #eee); border:1px solid rgba(255,255,255,0.14); background:rgba(255,255,255,0.05);}
.wm-pop-actions a:hover{border-color:rgba(245,214,124,0.5); color:#f5d67c;}

/* ---------------------------------------------------------------- mobile */
@media (max-width:1100px){
  .wm-layout{grid-template-columns:minmax(0, 1fr);}
  .wm-list{max-height:340px;}
}
@media (max-width:760px){
  #view-worldmap.active{padding:12px 12px 40px !important;}
  .wm-map{height:58vh; min-height:340px;}
  .wm-chips{flex-wrap:nowrap; overflow-x:auto; scrollbar-width:none; margin:0 -12px; padding:0 12px 2px;}
  .wm-chips::-webkit-scrollbar{display:none;}
  .wm-chip{flex-shrink:0;}
  .wm-stat b{font-size:1.1rem;}
  .wm-pin{width:34px; height:34px;}
}
@media (prefers-reduced-motion: reduce){ .wm-pin.legend{animation:none;} }
