/* Adopte un rond-point — le prétendant, sa fiche, le swipe */
:root { --accent: #e34d68; --accent-fonce: #b83a52; }

/* --- recherche --- */
.search-wrap { position: relative; }
.results {
  position: absolute; z-index: 500; left: 0; right: 0; top: calc(100% + 4px);
  background: var(--asphalte-2); border: 1px solid var(--ligne); border-radius: 10px;
  max-height: 320px; overflow-y: auto; box-shadow: 0 12px 30px #0009;
}
.results button {
  display: block; width: 100%; text-align: left; background: none; border: none;
  border-bottom: 1px solid var(--ligne); color: var(--craie); padding: 10px 13px; cursor: pointer;
}
.results button:last-child { border-bottom: none; }
.results button:hover { background: var(--asphalte-3); }
.results .rnom { font-size: 16px; }
.results .rville { font-size: 14px; color: var(--craie-douce); }
.results .rpris { color: var(--vert); font-size: 13px; }

/* --- la fiche du prétendant --- */
.deck { position: relative; min-height: 300px; }
.card-rp {
  background: var(--asphalte-2); border: 1px solid var(--ligne); border-radius: 18px;
  overflow: hidden; box-shadow: 0 14px 34px #0007;
  will-change: transform; touch-action: pan-y;
  /* rien ne doit être sélectionné ni traîné pendant le glissement */
  user-select: none; -webkit-user-select: none; cursor: grab;
}
.card-rp img { -webkit-user-drag: none; user-select: none; pointer-events: none; }
.card-rp a, .card-rp button { pointer-events: auto; }
.card-rp.dragging { transition: none; cursor: grabbing; }
.card-rp.animating { transition: transform .32s ease, opacity .32s ease; }
.card-photo { display: block; width: 100%; height: clamp(210px, 30vh, 380px); object-fit: cover; background: #0f1316; }
.card-nophoto {
  height: clamp(170px, 24vh, 300px); display: flex; flex-direction: column; gap: 8px;
  align-items: center; justify-content: center; color: #6d757f;
  background: repeating-linear-gradient(45deg, #171c21 0 14px, #1b2127 14px 28px);
  font-size: 15px; font-style: italic; text-align: center; padding: 0 20px;
}
.card-body { padding: 17px 20px 20px; display: flex; flex-direction: column; gap: 11px; }
.card-body h2 {
  font-family: "Saira Condensed", sans-serif; font-weight: 800; font-size: clamp(25px, 2.4vw, 32px);
  line-height: 1.05; letter-spacing: .4px; text-wrap: balance;
}
.card-lieu { font-size: 16px; color: var(--craie-douce); margin-top: -6px; }
.card-credit {
  font-size: 13.5px; color: #9aa3ad; text-align: right;
  padding: 6px 18px 0; background: var(--asphalte-2);
}
.card-credit a { color: var(--sodium); text-decoration: underline; text-underline-offset: 2px; }
.card-credit a:hover { color: #ffd694; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
  font-family: "Saira Condensed", sans-serif; font-size: 13px; letter-spacing: .4px;
  border: 1px solid var(--sodium); color: var(--sodium);
  border-radius: 999px; padding: 2px 11px; white-space: nowrap;
}
.facts { display: flex; flex-wrap: wrap; gap: 7px; }
.fact {
  background: var(--asphalte); border: 1px solid var(--ligne); border-radius: 9px;
  padding: 5px 11px; font-size: 14px; color: var(--craie-douce);
}
.fact b { font-family: "IBM Plex Mono", monospace; font-size: 14px; color: var(--craie); font-weight: 600; }
.card-links { display: flex; gap: 14px; flex-wrap: wrap; font-size: 15px; }
.card-links a, .card-links button {
  color: var(--sodium); background: none; border: none; padding: 0; cursor: pointer;
  font-size: 15px; text-decoration: underline; text-underline-offset: 3px;
}
.card-adopted {
  background: #1d2a1e; border: 1px solid #3c6b3f; border-radius: 10px;
  padding: 9px 12px; font-size: 15px;
}

/* verdict qui apparaît pendant le glissement */
.stamp {
  position: absolute; top: 22px; font-family: "Saira Condensed", sans-serif; font-weight: 800;
  font-size: 30px; letter-spacing: 2px; text-transform: uppercase; padding: 5px 16px;
  border: 4px solid; border-radius: 10px; opacity: 0; pointer-events: none; z-index: 3;
}
.stamp-yes { left: 20px; color: var(--vert); border-color: var(--vert); transform: rotate(-14deg); }
.stamp-no { right: 20px; color: var(--coeur); border-color: var(--coeur); transform: rotate(14deg); }

/* --- boutons d'action --- */
.actions { display: flex; gap: 16px; justify-content: center; align-items: center; }
.round-btn {
  width: 60px; height: 60px; border-radius: 50%; border: 2px solid var(--ligne);
  background: var(--asphalte-2); color: var(--craie); font-size: 24px; cursor: pointer;
  transition: transform .15s, border-color .15s, background .15s;
}
.round-btn:hover { transform: scale(1.09); }
.round-btn.pass:hover { border-color: var(--coeur); color: var(--coeur); }
.round-btn.adopt { width: 68px; height: 68px; font-size: 28px; border-color: var(--vert); }
.round-btn.adopt:hover { background: var(--vert); }
.round-btn.kudo { width: 52px; height: 52px; font-size: 21px; }
.round-btn.kudo:hover { border-color: var(--sodium); background: rgba(245,166,35,.15); }
.swipe-hint { font-size: 13.5px; color: #6d757f; text-align: center; font-style: italic; }

/* --- formulaires --- */
.adopt-form, .photo-form {
  background: var(--asphalte-2); border: 1px solid var(--accent); border-radius: 14px;
  padding: 15px 17px; display: flex; flex-direction: column; gap: 11px;
}
.photo-form { border-color: var(--ligne); }
.adopt-form h3, .photo-form h3 { color: var(--craie); }
.form-row { display: flex; gap: 10px; }
.form-row .btn { flex: 1; }
.lic { flex-direction: row; gap: 9px; align-items: flex-start; font-size: 14px; }
.lic input { width: auto; accent-color: var(--sodium); margin-top: 4px; }
.form-msg { font-size: 14.5px; color: var(--craie-douce); }

/* --- ronds-points voisins --- */
.voisins { display: flex; flex-direction: column; gap: 8px; }
.voisins-list { display: flex; flex-wrap: wrap; gap: 7px; }
.voisin {
  background: var(--asphalte-2); border: 1px solid var(--ligne); border-radius: 999px;
  padding: 6px 13px; font-size: 14.5px; color: var(--craie-douce); cursor: pointer;
  display: inline-flex; gap: 7px; align-items: baseline; transition: border-color .15s, color .15s;
}
.voisin:hover { border-color: var(--accent); color: var(--craie); }
.voisin .d { font-family: "IBM Plex Mono", monospace; font-size: 12.5px; color: #6d757f; }
.voisin.pris { border-color: #3c6b3f; }

/* compteur et pagination des résultats */
.rcount {
  padding: 8px 13px; font-size: 13.5px; color: #7f8792;
  border-bottom: 1px solid var(--ligne); font-style: italic;
}
.rmore {
  width: 100%; background: var(--asphalte-3); border: none; cursor: pointer;
  color: var(--sodium); padding: 10px 13px; font-size: 14.5px;
  font-family: "Saira Condensed", sans-serif; letter-spacing: .5px; text-transform: uppercase;
}
.rmore:hover { background: #2a323a; }

/* bouton « chercher dans cette zone » posé sur la carte */
#map { position: relative; }
.zone-btn {
  position: absolute; z-index: 450; top: 14px; left: 50%; transform: translateX(-50%);
  background: var(--asphalte-2); color: var(--craie);
  border: 1px solid var(--accent); border-radius: 999px; cursor: pointer;
  padding: 10px 20px; font-family: "Saira Condensed", sans-serif; font-weight: 700;
  font-size: 14.5px; letter-spacing: .8px; text-transform: uppercase;
  box-shadow: 0 6px 20px #0008; white-space: nowrap;
}
.zone-btn:hover { background: var(--accent); color: #fff; }
.zone-btn:disabled { opacity: .6; cursor: wait; }

/* liste des ronds-points de la zone explorée */
.zone-res { display: flex; flex-direction: column; gap: 8px; }
.zone-res h3 { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.zone-res .fermer {
  background: none; border: none; color: var(--craie-douce); cursor: pointer; font-size: 15px;
}

/* famille du carrefour : rond-point ou carrefour circulaire */
.type-badge {
  display: inline-block; margin-left: 8px; vertical-align: 2px;
  font-family: "Saira Condensed", sans-serif; font-size: 12.5px; letter-spacing: .5px;
  text-transform: uppercase; border-radius: 999px; padding: 2px 10px;
  border: 1px solid var(--accent); color: var(--accent); white-space: nowrap;
}
.type-badge.circ { border-color: #8a94a0; color: #b6bec8; }

/* bascule entre la vue au sol et la vue aérienne */

/* voisin situé hors du cadre actuellement affiché */
.voisin.hors { opacity: .5; border-style: dashed; }
.voisin.hors::after { content: " ⤢"; font-size: 11px; }

/* légende au survol des trois boutons ronds */
.actions { position: relative; }
.round-btn { position: relative; }
.round-btn::after {
  content: attr(data-legende);
  position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%);
  background: var(--asphalte-3); color: var(--craie);
  border: 1px solid var(--ligne); border-radius: 8px;
  padding: 5px 12px; font-family: "Saira Condensed", sans-serif; font-size: 13.5px;
  letter-spacing: .6px; text-transform: uppercase; white-space: nowrap;
  opacity: 0; visibility: hidden; transition: opacity .15s ease;
  pointer-events: none; box-shadow: 0 6px 16px #0009;
}
.round-btn::before {
  content: ""; position: absolute; bottom: calc(100% + 4px); left: 50%;
  transform: translateX(-50%); border: 6px solid transparent;
  border-top-color: var(--ligne); opacity: 0; visibility: hidden; transition: opacity .15s ease;
  pointer-events: none;
}
.round-btn:hover::after, .round-btn:focus-visible::after,
.round-btn:hover::before, .round-btn:focus-visible::before { opacity: 1; visibility: visible; }
.round-btn.pass:hover::after { border-color: var(--coeur); }
.round-btn.adopt:hover::after { border-color: var(--vert); }
.round-btn.kudo:hover::after { border-color: var(--sodium); }

/* onglet de vue sans image disponible */

/* choix du type de vue dans le formulaire photo */
.vuepick { display: flex; gap: 8px; flex-wrap: wrap; }
.vuepick label {
  flex: 1; min-width: 140px; display: flex; gap: 8px; align-items: center; cursor: pointer;
  border: 1px solid var(--ligne); border-radius: 10px; padding: 8px 11px;
  font-size: 14px; color: var(--craie-douce);
}
.vuepick input { width: auto; margin: 0; accent-color: var(--sodium); flex-shrink: 0; }
.vuepick label:has(input:checked) { border-color: var(--sodium); color: var(--craie); }

/* applaudissement déjà donné : le bouton le montre et ne réagit plus */
.round-btn.kudo.donne {
  border-color: var(--sodium);
  background: rgba(245, 166, 35, .22);
  cursor: default;
  opacity: 1;
}
.round-btn.kudo.donne:hover { transform: none; }

/* ---------- repli de la carte ---------- */
/* Onglet fixe sur le bord droit : il reste atteignable dans les deux états,
   carte ouverte comme repliée, ce qu'un bouton posé dans la carte ne ferait pas. */
#carte-bascule {
  position: fixed; right: 0; top: 50%; transform: translateY(-50%);
  z-index: 1100; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 7px; border: 1px solid var(--ligne); border-right: none;
  border-radius: 12px 0 0 12px;
  background: var(--asphalte-2); color: var(--craie-douce);
  font-family: "Saira Condensed", sans-serif; font-size: 12.5px; letter-spacing: 1px;
  text-transform: uppercase; cursor: pointer;
  box-shadow: -4px 0 16px #0006;
  transition: color .2s, border-color .2s;
}
#carte-bascule:hover { color: var(--craie); border-color: var(--sodium); }
#carte-bascule .mot { writing-mode: vertical-rl; }
#carte-bascule .fleche { font-size: 11px; transition: transform .2s; }
/* carte ouverte : la flèche pousse vers la droite (ranger) ; repliée, elle
   invite à ramener la carte vers la gauche */
#app.carte-repliee ~ #carte-bascule .fleche,
#carte-bascule.replie .fleche { transform: rotate(180deg); }

/* Pas d'animation de largeur : animer flex-basis force un recalcul de mise en
   page à chaque image, et Leaflet redessine ses tuiles pendant tout ce temps.
   Le repli est instantané, ce qui est aussi plus net à l'usage. */
#app.carte-repliee #map {
  flex-basis: 0; max-width: 0; min-width: 0; overflow: hidden; border-right: none;
}
#app.carte-repliee #sidebar { border-right: none; }

@media (max-width: 760px) {
  #app.carte-repliee #map { height: 0; border-top: none; }
  #carte-bascule { padding: 11px 6px; }
}
@media (prefers-reduced-motion: reduce) {
  #carte-bascule .fleche { transition: none; }
}

/* ---------- mes adoptions ---------- */
.mes-adoptions {
  align-self: flex-start; margin-top: 10px; padding: 7px 14px;
  background: none; border: 1px solid var(--ligne); border-radius: 999px;
  color: var(--craie-douce); cursor: pointer;
  font-family: "Saira Condensed", sans-serif; font-size: 14px;
  letter-spacing: .6px; text-transform: uppercase;
}
.mes-adoptions:hover { border-color: var(--vert); color: var(--craie); }
/* la liste des résultats de recherche flotte au-dessus du champ ; celle-ci
   s'inscrit dans le flux, sous le bouton qui l'ouvre */
.results.statique { position: static; margin-top: 8px; max-height: 320px; }
