/* Carte des ressources (assets/carte.js) : s'appuie sur chasse.css (blocs, fiche verte, carte, position) */
.ca .ch-bloc h4 span { display: flex; align-items: center; gap: 10px; }
.ca .ch-bloc h4 .ch-lien { font-size: 12px; padding: 0; }

/* Ressources choisies */
.ca-puces { display: flex; flex-wrap: wrap; gap: 6px; }
.ca-puces:not(:empty) { margin-bottom: 12px; }
.ca-puce { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 3px; border-radius: 99px; cursor: pointer;
  border: 2px solid var(--c); background: color-mix(in srgb, var(--c) 16%, var(--inset)); color: var(--txt); font-size: 13px; font-weight: 700; }
.ca-puce img { width: 24px; height: 24px; object-fit: contain; }
.ca-puce i { font-style: normal; font-size: 11px; color: var(--mut); }
.ca-puce:hover i { color: #fff; }
.ca-puce:hover { background: color-mix(in srgb, var(--c) 30%, var(--inset)); }

/* Filtre par métier */
.ca-metiers { display: flex; gap: 6px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.ca-metiers::-webkit-scrollbar { display: none; }
.ca-metiers .ad12-chip { flex: none; padding: 6px 11px; font-size: 12px; background: var(--inset); }
.ca-metiers .ad12-chip.on { background: rgba(245,166,35,.15); }

/* Liste des ressources */
.ca-liste { max-height: 330px; margin-top: 10px; }
.ca-groupe { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 10px; border: none;
  border-radius: 10px; background: var(--card); color: var(--or-hi); font: 600 11.5px var(--f-titre); letter-spacing: .08em; text-transform: uppercase;
  text-align: left; cursor: pointer; }
.ca-groupe:hover { background: var(--card-hi); }
.ca-groupe i { font-style: normal; color: var(--mut); transition: transform .15s; }
.ca-groupe.ouvert i { transform: rotate(90deg); }
.ca-groupe u { text-decoration: none; padding: 1px 7px; border-radius: 99px; background: rgba(245,166,35,.15); font: 800 10.5px var(--f-txt);
  letter-spacing: 0; text-transform: none; }
.ca-groupe span { margin-left: auto; color: var(--mut2); font: 800 11px var(--f-txt); letter-spacing: 0; }
.ca-r { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border-radius: 10px; border: 1px solid transparent;
  background: none; color: #c3cdd8; text-align: left; cursor: pointer; }
.ca-r img { width: 32px; height: 32px; object-fit: contain; flex: none; }
.ca-r > span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ca-r b { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ca-r small { font-size: 11.5px; color: var(--mut2); font-weight: 700; }
.ca-r em { font-style: normal; font-size: 11px; font-weight: 800; color: var(--mut2); white-space: nowrap; }
.ca-coche { font-style: normal; display: grid; place-items: center; width: 22px; height: 22px; flex: none; border-radius: 7px;
  background: var(--inset); color: var(--mut); font: 700 13px var(--f-titre); }
.ca-r:hover, .ca-r.actif { background: rgba(255,255,255,.06); color: #fff; }
.ca-r:hover .ca-coche { color: var(--or-hi); }
.ca-r.on { background: color-mix(in srgb, var(--c) 14%, transparent); border-color: color-mix(in srgb, var(--c) 45%, transparent); color: #fff; }
.ca-r.on .ca-coche { background: var(--c); color: #0c1520; }

/* Fiche de la carte choisie */
.ca-res .ch-res-h > div { flex: 1; min-width: 0; }
.ca-fermer { align-self: flex-start; border: none; background: none; color: #a7d9b8; font-size: 15px; cursor: pointer; padding: 2px 4px; }
.ca-fermer:hover { color: #fff; }
.ca-res-l { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; }
.ca-res-l div { display: flex; align-items: center; gap: 10px; padding: 5px 10px 5px 5px; border-radius: 10px; background: rgba(12,21,32,.35); border-left: 3px solid var(--c); }
.ca-res-l img { width: 28px; height: 28px; object-fit: contain; }
.ca-res-l span { flex: 1; font-weight: 700; font-size: 14px; }
.ca-res-l b { font: 700 16px var(--f-titre); color: #fff; }
.ca-cond { margin: 10px 0 0; font-size: 12.5px; color: #f5c46b; }

/* Les plus proches */
.ca-proches:not(:empty) { margin-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.ca-ligne { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; background: rgba(255,255,255,.03); cursor: pointer; font-size: 13px; }
.ca-ligne:hover, .ca-ligne:focus-visible { background: rgba(255,255,255,.07); outline: none; }
.ca-ligne.on { background: rgba(74,222,128,.14); }
.ca-dist { flex: none; min-width: 64px; font-weight: 800; color: var(--or-hi); font-size: 12px; }
.ca-ligne .ch-co { flex: none; font-weight: 700; }
.ca-qs { flex: 1; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.ca-q { display: inline-flex; align-items: center; gap: 2px; padding: 1px 6px 1px 1px; border-radius: 99px; background: var(--inset);
  box-shadow: inset 0 0 0 1.5px var(--c); font-weight: 800; font-size: 12px; }
.ca-q img { width: 20px; height: 20px; object-fit: contain; }

/* Les coins les plus riches */
.ca-zones { display: flex; flex-direction: column; gap: 2px; }
.ca-z { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 1px solid transparent; border-radius: 10px; background: none;
  color: #c3cdd8; text-align: left; cursor: pointer; }
.ca-z:hover { background: rgba(255,255,255,.06); color: #fff; }
.ca-z.on { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.25); color: #fff; }
.ca-rang { display: grid; place-items: center; width: 22px; height: 22px; flex: none; border-radius: 50%; background: var(--inset); color: var(--mut); font: 700 11px var(--f-titre); }
.ca-z:first-child .ca-rang { background: var(--or); color: #1a1004; }
.ca-z-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ca-z-t b { font-size: 14px; font-weight: 700; }
.ca-z-t small { font-size: 11.5px; color: var(--mut2); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ca-z-t i { display: block; height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--or), var(--or-hi)); opacity: .75; }
.ca-z em { font-style: normal; font: 700 15px var(--f-titre); color: #fff; }

/* Carte et ce qui flotte dessus */
.ca-cadre { position: relative; }
.ca-carte.charge::after { content: ''; position: absolute; z-index: 1000; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--or), transparent); background-size: 50% 100%; background-repeat: no-repeat; animation: ca-charge 1s linear infinite; }
@keyframes ca-charge { from { background-position: -50% 0; } to { background-position: 150% 0; } }
.ca-monde { position: absolute; z-index: 1000; top: 12px; right: 12px; max-width: calc(100% - 80px); padding: 8px 30px 8px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(12,21,32,.88) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23f5a623'/%3E%3C/svg%3E") no-repeat right 11px center;
  color: var(--txt); font: 700 13px var(--f-txt); -webkit-appearance: none; appearance: none; cursor: pointer; backdrop-filter: blur(6px); }
.ca-zone { position: absolute; z-index: 1000; top: 56px; right: 12px; padding: 6px 11px; border-radius: 99px; border: 1px solid rgba(255,255,255,.35);
  background: rgba(12,21,32,.88); color: #fff; font: 700 12px var(--f-txt); cursor: pointer; backdrop-filter: blur(6px); }
.ca-zone span { color: var(--mut); }
.ca-legende { position: absolute; z-index: 1000; left: 12px; bottom: 26px; right: 12px; display: flex; flex-wrap: wrap; gap: 6px; pointer-events: none; }
.ca-legende span { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 4px; border-radius: 99px; background: rgba(12,21,32,.88);
  border: 1px solid var(--line); font-size: 12px; backdrop-filter: blur(6px); }
.ca-legende i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); margin-left: 4px; }
.ca-legende img { width: 20px; height: 20px; object-fit: contain; }
.ca-legende .absent { opacity: .55; } .ca-legende .absent b { font-weight: 600; color: var(--mut); }
.ca-accueil { position: absolute; z-index: 1000; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 12px;
  padding: 14px 20px; border-radius: 14px; background: rgba(12,21,32,.85); border: 1px solid var(--line); pointer-events: none; backdrop-filter: blur(6px);
  font-weight: 700; white-space: nowrap; }
.ca-accueil b { color: var(--or); font: 700 26px var(--f-titre); }
.ca-accueil[hidden] { display: none; }

/* Boutons sous le zoom : volet des ressources, grand écran */
.ca-outils a { display: grid !important; place-items: center; color: #333; }
.ca-outils svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ca-outils a.on { background: var(--or); color: #1a1004; }
.ca-outils [data-outil="grand"] svg + svg, .ca-outils [data-outil="grand"].on svg:first-child { display: none; }
.ca-outils [data-outil="grand"].on svg + svg { display: block; }

/* Volet masqué : la carte prend toute la largeur */
.ca.ca-replie { grid-template-columns: minmax(0, 1fr); }
.ca.ca-replie .ca-panneau { display: none; }

/* Grand écran : la page (volet compris) couvre la fenêtre */
.ca.ca-grand { position: fixed; inset: 0; z-index: 9999; margin: 0; padding: 12px; background: var(--bg); align-items: stretch; }
.ca.ca-grand .ca-panneau { max-height: calc(100vh - 24px); overflow: auto; scrollbar-width: thin; }
.ca.ca-grand .ch-carte-l { position: static; }
.ca.ca-grand .ch-carte { height: calc(100vh - 24px); }
html.ca-plein, html.ca-plein body { overflow: hidden; }

/* Marques sur la carte */
.ca-m { display: flex; align-items: center; gap: 1px; padding: 2px 8px 2px 2px; border-radius: 99px; background: #0c1520; color: #fff;
  border: 2.5px solid var(--c); box-shadow: 0 0 0 1px #000, 0 3px 8px rgba(0,0,0,.6); white-space: nowrap; cursor: pointer; transition: transform .12s; }
.ca-m:hover { transform: scale(1.12); }
.ca-m img { width: 26px; height: 26px; object-fit: contain; }
.ca-m b { margin-left: 3px; font: 700 13px var(--f-titre); }
.ca-case { position: relative; padding: 1px; border-radius: 50%; }
.ca-case span { position: absolute; right: -8px; bottom: -7px; padding: 0 5px; border-radius: 8px; background: var(--c); color: #0c1520;
  font: 800 11px var(--f-txt); box-shadow: 0 0 0 1px #000; }
.ca-case u { position: absolute; left: -5px; top: -5px; display: flex; gap: 1px; text-decoration: none; }
.ca-case u i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 1.5px #0c1520; }
.ca-nb span { position: absolute; transform: translate(-50%, -50%); color: #fff; font: 800 11px var(--f-txt); white-space: nowrap; pointer-events: none;
  text-shadow: 0 0 2px #000, 0 0 2px #000, 0 0 3px #000; }
.ca-nb.petit span { font-size: 9px; letter-spacing: -.3px; }

@media (max-width: 1000px) {
  /* Ressources d'abord, la carte juste dessous, le reste ensuite. */
  .ca .ca-panneau { display: contents; }
  .ca .ca-b1 { order: 1; } .ca .ca-carte-l { order: 2; } .ca .ca-res { order: 3; } .ca .ca-b2 { order: 4; } .ca .ca-b3 { order: 5; }
  .ca { gap: 12px; grid-template-columns: minmax(0, 1fr); }
  .ca .ca-panneau > * { min-width: 0; }
  .ca-liste { max-height: 240px; }
  .ca .ch-carte { height: 58vh; min-height: 320px; }
  .ca-accueil { white-space: normal; width: 80%; }
  .ca.ca-replie .ca-panneau { display: contents; }
  .ca.ca-replie .ca-panneau > * { display: none; }
  /* Grand écran sur téléphone : la carte seule. */
  .ca.ca-grand { display: block; padding: 0; }
  .ca.ca-grand .ca-panneau > * { display: none; }
  .ca.ca-grand .ch-carte { height: 100vh; height: 100dvh; min-height: 0; border-radius: 0; border: 0; }
}
