/* Page carte : la carte prend tout l'écran, la liste des spots vit à côté (ordi) ou dans une feuille qu'on tire (téléphone). */
.map-page { overflow: hidden; background: #eef0f3; }
.explorer { position: fixed; inset: 0; }
#map { position: absolute; inset: 0; }
.maplibregl-ctrl-attrib, .maplibregl-ctrl-logo { display: none !important; }
.credit { position: absolute; z-index: 3; right: 12px; bottom: 8px; margin: 0; font-size: 11px; color: #6e6e73; background: rgba(255, 255, 255, 0.85); padding: 3px 8px; border-radius: 8px; }

/* Panneau */
.panel {
  position: absolute; z-index: 4; left: 16px; top: 88px; bottom: 16px; width: 380px;
  display: flex; flex-direction: column;
  background: rgba(255, 255, 255, 0.96); border-radius: 30px;
  box-shadow: 0 24px 60px rgba(17, 12, 34, 0.18);
  overflow: hidden;
}
.grip { display: none; }
.panel-head { padding: 22px 22px 12px; }
.panel-head h1 { font-size: 30px; letter-spacing: -0.04em; }
.sub { display: flex; align-items: center; gap: 8px; margin: 8px 0 14px; font-size: 14px; color: var(--muted); }
.sub b { color: var(--ink); }
.panel .filters { margin: 0; flex-wrap: nowrap; }
.panel .filters button { padding: 10px 15px; }
.list { list-style: none; margin: 0; padding: 4px 12px 16px; overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch; }
.item {
  display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 20px; cursor: pointer;
  transition: background-color 0.2s;
}
.item:hover, .item.sel { background: #f5f5f7; }
.item img.th { width: 72px; height: 72px; border-radius: 16px; object-fit: cover; flex: none; }
.item .tx { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.item b { font-size: 16px; letter-spacing: -0.02em; }
.item small { font-size: 13px; color: var(--muted); }
.item .meta { display: flex; align-items: center; gap: 6px; margin-top: 5px; font-size: 12.5px; font-weight: 600; }
.item .meta .ok { color: #037a49; }
.item .who { display: inline-flex; margin-left: 4px; }
.item .who img { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #fff; object-fit: cover; }
.item .who img + img { margin-left: -6px; }
.item.off { display: none; }

/* Marqueurs */
.mk { position: relative; cursor: pointer; background: none; border: 0; padding: 0; margin: 0; font: inherit; -webkit-tap-highlight-color: transparent; }
.mk .ph { display: block; width: 54px; height: 54px; border-radius: 17px; overflow: hidden; border: 3px solid #fff; box-shadow: 0 12px 26px rgba(17, 12, 34, 0.28); background: #fff; transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1); }
.mk .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mk::after { content: ""; position: absolute; left: 50%; bottom: -7px; width: 12px; height: 12px; background: #fff; transform: translateX(-50%) rotate(45deg); border-radius: 2px; z-index: -1; }
.mk .who { position: absolute; top: -9px; right: -12px; display: flex; }
.mk .who img { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; object-fit: cover; }
.mk .who img + img { margin-left: -8px; }
.mk.sel .ph { transform: scale(1.18) translateY(-4px); border-color: var(--rose); }
.mk.sel::after { background: var(--rose); }
.mk.live .ph::before { content: ""; position: absolute; }
.mk .ring { position: absolute; left: 0; top: 0; width: 54px; height: 54px; border-radius: 18px; border: 3px solid var(--rose); opacity: 0; animation: ring 2.4s cubic-bezier(0.22, 1, 0.36, 1) infinite; pointer-events: none; }
@keyframes ring { 0% { transform: scale(1); opacity: 0.7; } 100% { transform: scale(1.9); opacity: 0; } }
.pote { width: 38px; height: 38px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--rose), 0 8px 18px rgba(17, 12, 34, 0.3); overflow: hidden; }
.pote img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pote-tag { position: absolute; left: 44px; top: 4px; white-space: nowrap; background: var(--ink); color: #fff; font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 999px; }

/* Fiche */
.detail {
  position: absolute; z-index: 5; right: 16px; top: 88px; width: 360px;
  background: #fff; border-radius: 30px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(17, 12, 34, 0.22);
}
.detail .close { position: absolute; right: 12px; top: 12px; z-index: 1; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.92); font-size: 22px; line-height: 1; cursor: pointer; }
.d-photo { display: block; width: 100%; height: 220px; object-fit: cover; }
.d-body { padding: 16px 20px 20px; }
.d-cat { margin: 0; font-size: 13px; font-weight: 600; color: var(--rose); }
.d-name { font-size: 30px; margin: 2px 0; }
.d-meta { margin: 0 0 12px; font-size: 14px; color: var(--muted); }
.d-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.d-chips span { font-size: 13px; font-weight: 600; padding: 5px 11px; border-radius: 999px; background: #f5f5f7; }
.d-chips .d-valid { background: rgba(4, 190, 112, 0.14); color: #037a49; }
.d-friends { margin: 12px 0 0; font-size: 14px; font-weight: 600; }
.d-friends:empty { display: none; }
.d-cta { margin-top: 16px; width: 100%; justify-content: center; }

/* Téléphone : filtres en haut, carrousel de spots en bas, au-dessus de la barre d'onglets. */
@media (max-width: 760px) {
  .map-page { background: #FFF5EA; }
  .panel { position: static; width: auto; background: none; box-shadow: none; border-radius: 0; overflow: visible; display: block; }
  .panel-head { position: absolute; z-index: 4; left: 0; right: 0; top: 70px; padding: 0; pointer-events: none; }
  .panel-head h1, .panel-head .sub { display: none; }
  .panel .filters { pointer-events: auto; flex-wrap: nowrap; overflow-x: auto; margin: 0; padding: 4px 12px 8px; gap: 8px; scrollbar-width: none; }
  .panel .filters::-webkit-scrollbar { display: none; }
  .panel .filters button { flex: none; background: #fff; box-shadow: 0 4px 14px rgba(17, 12, 34, 0.12); min-height: 40px; padding: 9px 16px; font-size: 14.5px; }
  .panel .filters button.on { background: var(--ink); }
  .list {
    position: absolute; z-index: 4; left: 0; right: 0; bottom: calc(var(--tabbar, 0px) + 12px);
    display: flex; gap: 10px; padding: 6px 20px 10px; overflow-x: auto; overflow-y: hidden; flex: none;
    scroll-snap-type: x mandatory; scroll-padding: 0 20px; scrollbar-width: none; overscroll-behavior-x: contain;
    transition: transform 0.35s var(--ease), opacity 0.25s;
  }
  .list::-webkit-scrollbar { display: none; }
  .item { flex: none; width: calc(100vw - 56px); max-width: 360px; scroll-snap-align: center; background: #fff; border-radius: 24px; padding: 10px; box-shadow: 0 10px 30px rgba(17, 12, 34, 0.16); }
  .item:hover { background: #fff; }
  .item.sel { background: #fff; box-shadow: 0 0 0 2.5px var(--rose), 0 10px 30px rgba(17, 12, 34, 0.16); }
  .item img.th { width: 84px; height: 84px; border-radius: 18px; }
  .item b { font-size: 17px; }
  .has-detail .list { transform: translateY(140%); opacity: 0; pointer-events: none; }
  .detail { left: 10px; right: 10px; top: auto; bottom: calc(var(--tabbar, 0px) + 10px); width: auto; border-radius: 26px; max-height: calc(100svh - 150px); overflow-y: auto; }
  .d-photo { height: 150px; }
  .d-name { font-size: 26px; }
  .credit { top: auto; bottom: calc(var(--tabbar, 0px) + 132px); right: 8px; font-size: 10px; }
  .has-detail .credit { display: none; }
  .mk .ph { width: 46px; height: 46px; border-radius: 15px; }
  .mk .ring { width: 46px; height: 46px; border-radius: 15px; }
  .mk.sel .ph { transform: scale(1.22) translateY(-5px); }
  .map-slow { top: 124px; }
}

.map-slow { position: absolute; z-index: 3; left: 50%; top: 96px; transform: translateX(-50%); margin: 0; max-width: 90%; background: #fff; border-radius: 16px; padding: 10px 16px; font-size: 14px; font-weight: 600; box-shadow: 0 10px 24px rgba(17,12,34,.15); }
@media (min-width: 761px) { .map-slow { left: calc(50% + 200px); } }

/* Apparition des marqueurs en CSS : visibles même si le JS est ralenti. */
@keyframes mkpop { from { opacity: 0; transform: translateY(-36px) scale(0.5); } to { opacity: 1; transform: none; } }
.mk .ph { animation: mkpop 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) both; animation-delay: var(--d, 0s); }
@media (prefers-reduced-motion: reduce) { .mk .ph { animation: none; } }
.mk.off { pointer-events: none; }
.mk.off .ph, .mk.off .who, .mk.off .ring, .mk.off::after { visibility: hidden; }
.maplibregl-marker.mk { transition: opacity 0.25s; }
@media (max-width: 760px) { .map-slow { left: 12px; right: 12px; top: 124px; transform: none; max-width: none; font-size: 13px; text-align: center; } }
