/* ==========================================================
   EC@RT — PANEL UI  v11
   ========================================================== */

:root {
  --ecart-ui-size:     52px;
  --ecart-ui-gap:      8px;
  --ecart-ui-right:    18px;
  --ecart-ui-bottom:   calc(20px + env(safe-area-inset-bottom, 0px));
  --ecart-audio-bar-h: 59px;
  --ecart-z-title:     100020;
  --ecart-z-button:    100050;
  --ecart-z-panel:     100015;
  --ecart-z-audiobar:  99990;

  --ecart-btn-bg:        rgba(160, 12, 12, 0.76);
  --ecart-btn-border:    rgba(220, 55, 55, 0.58);
  --ecart-btn-hover-bg:  rgba(180, 15, 15, 0.86);
  --ecart-btn-hover-bd:  rgba(240, 75, 75, 0.70);
  --ecart-btn-active-bg: #ffffff;
}


/* ==========================================================
   ÉLÉMENTS NATIFS MASQUÉS
   ========================================================== */

#soundPanel,
.info-close,
.sound-close,
.mobile-map-toggle__label--close { display: none !important; }


/* ==========================================================
   SIDEBAR / TITRE — au-dessus des panels
   ========================================================== */

.sidebar, .site-title, .home-button {
  position: relative;
  z-index: var(--ecart-z-title) !important;
}


/* ==========================================================
   CLUSTER — SOUND / MAP / INFO
   ========================================================== */

.ecart-ui-cluster {
  position: fixed;
  right:  var(--ecart-ui-right);
  bottom: var(--ecart-ui-bottom);
  z-index: var(--ecart-z-button);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--ecart-ui-gap);
  transition: bottom 0.30s cubic-bezier(0.4, 0, 0.2, 1);
}

body.ecart-audio-active .ecart-ui-cluster {
  bottom: calc(var(--ecart-ui-bottom) + var(--ecart-audio-bar-h));
}


/* ==========================================================
   BASE BOUTON CLUSTER
   ========================================================== */

.ecart-ui-cluster > button {
  width:  var(--ecart-ui-size);
  height: var(--ecart-ui-size);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.16);
  background: var(--ecart-btn-bg);
  color: rgba(255,255,255,0.90);
  font-size:      0.50rem;
  font-weight:    700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.03),
    0 2px 10px rgba(0,0,0,0.20);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  transition:
    background   0.18s ease,
    color        0.18s ease,
    border-color 0.18s ease,
    box-shadow   0.18s ease,
    transform    0.14s ease;
}

.ecart-ui-cluster > button:hover {
  background:   var(--ecart-btn-hover-bg);
  color:        rgba(255,255,255,1);
  border-color: rgba(0,0,0,0.24);
  box-shadow:   0 2px 14px rgba(160,0,0,0.22);
}

.ecart-ui-cluster > button.is-open,
.ecart-ui-cluster > button.is-playing {
  background:   #ffffff;
  color:        #000000;
  border:       1px solid rgba(0,0,0,0.22);
  box-shadow:   0 2px 14px rgba(255,255,255,0.22);
}

.ecart-ui-cluster > button:active { transform: scale(0.90); }


/* ==========================================================
   CONTENEUR TOP-RIGHT — ŒIL + LIGHT
   ========================================================== */

#ecartTopRight {
  position: fixed;
  top:   calc(18px + env(safe-area-inset-top, 0px));
  right: var(--ecart-ui-right);
  z-index: 100060;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--ecart-ui-gap);
  pointer-events: auto;
}


/* ==========================================================
   TOAST — "SURFACE PHOTOSENSIBLE : ON / OFF"
   [6] Toujours ancré à droite des boutons ŒIL/LIGHT
   ========================================================== */

.ecart-toast {
  position: fixed;
  top:       calc(18px + env(safe-area-inset-top, 0px));
  right:     calc(var(--ecart-ui-right) + var(--ecart-ui-size) + 12px);
  left:      auto;
  transform: none;
  z-index:   100200;
  font-family:    Arial, Helvetica, sans-serif;
  font-size:      clamp(0.56rem, 1.3vw, 0.76rem);
  font-weight:    700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-align:     right;
  color: rgba(255,255,255,0.88);
  text-shadow:
    0 0 14px rgba(255,255,255,0.30),
    0 0 32px rgba(255,255,255,0.14);
  pointer-events: none;
  white-space:    nowrap;
  user-select:    none;
  animation: ecartToastAnim 2.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes ecartToastAnim {
  0%   { opacity: 0; letter-spacing: 0.32em; }
  14%  { opacity: 1; letter-spacing: 0.22em; }
  70%  { opacity: 1; letter-spacing: 0.22em; }
  100% { opacity: 0; letter-spacing: 0.14em; }
}

/* Sur appareils tactiles portrait : 2 boutons en ligne → décaler le toast */
@media (pointer: coarse) and (orientation: portrait) {
  .ecart-toast {
    right: calc(var(--ecart-ui-right) + var(--ecart-ui-size) + var(--ecart-ui-size) + var(--ecart-ui-gap) + 14px);
    top: calc(22px + env(safe-area-inset-top, 0px));
  }
}


/* ==========================================================
   BOUTONS ŒIL + LIGHT
   ========================================================== */

.ecart-focus-btn,
.ecart-light-btn {
  width:  var(--ecart-ui-size);
  height: var(--ecart-ui-size);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.16);
  background: var(--ecart-btn-bg);
  color: rgba(255,255,255,0.90);
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.03),
    0 2px 10px rgba(0,0,0,0.20);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  transition:
    background   0.18s ease,
    border-color 0.18s ease,
    color        0.18s ease,
    box-shadow   0.18s ease,
    transform    0.14s ease;
  pointer-events: auto;
}

.ecart-focus-btn:hover,
.ecart-light-btn:hover {
  background:   var(--ecart-btn-hover-bg);
  border-color: rgba(0,0,0,0.24);
}

.ecart-focus-btn:active,
.ecart-light-btn:active { transform: scale(0.90); }

.ecart-focus-btn.is-active,
.ecart-light-btn.is-active {
  background:   #ffffff;
  border:       1px solid rgba(0,0,0,0.22);
  color:        #000000;
  box-shadow:
    0 2px 10px rgba(255,255,255,0.18),
    0 0 0 1px rgba(0,0,0,0.04);
}

.ecart-focus-btn .eye-open   { display: block; }
.ecart-focus-btn .eye-closed { display: none;  }
body.ecart-focus-mode .ecart-focus-btn .eye-open   { display: none;  }
body.ecart-focus-mode .ecart-focus-btn .eye-closed { display: block; }


/* ==========================================================
   MODE FOCUS
   ========================================================== */

body.ecart-focus-mode .sidebar,
body.ecart-focus-mode .zone-identity {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.28s ease;
}
body.ecart-focus-mode #mobileMapToggle,
body.ecart-focus-mode #infoToggle     { display: none !important; }
body.ecart-focus-mode #mobileMapOverlay,
body.ecart-focus-mode #infoPanel {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}
body.ecart-focus-mode #ecartTopRight  { z-index: 100200; }


/* ==========================================================
   MODE JOUR (LIGHT)
   ========================================================== */

html.ecart-light-mode {
  filter: invert(0.88) brightness(1.04) contrast(0.90);
}
html.ecart-light-mode img,
html.ecart-light-mode video {
  filter: invert(0.88) brightness(1.04) contrast(0.90);
}
html.ecart-light-mode .mini-map-image {
  filter: invert(0.88) grayscale(1) contrast(1.00) brightness(0.96);
}

html.ecart-light-mode .ecart-ui-cluster > button,
html.ecart-light-mode .ecart-focus-btn,
html.ecart-light-mode .ecart-light-btn {
  background:   rgba(0,0,0,0.80);
  color:        rgba(255,255,255,0.96);
  border-color: rgba(255,255,255,0.14);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.02), 0 2px 10px rgba(0,0,0,0.28);
}
html.ecart-light-mode .ecart-ui-cluster > button:hover,
html.ecart-light-mode .ecart-focus-btn:hover,
html.ecart-light-mode .ecart-light-btn:hover {
  background: rgba(0,0,0,0.92);
  border-color: rgba(255,255,255,0.22);
  color: #fff;
}
html.ecart-light-mode .ecart-ui-cluster > button.is-open,
html.ecart-light-mode .ecart-ui-cluster > button.is-playing,
html.ecart-light-mode .ecart-focus-btn.is-active,
html.ecart-light-mode .ecart-light-btn.is-active {
  background:   #000;
  color:        #fff;
  border:       1px solid rgba(255,255,255,0.20);
  box-shadow:   0 2px 12px rgba(0,0,0,0.30);
}


/* ==========================================================
   OVERLAYS — INFO + MAP + SOUND
   [5] left: --ecart-sidebar-col pour ne pas recouvrir
       la sidebar et le titre sur desktop
   ========================================================== */

#infoPanel,
#mobileMapOverlay,
#ecartAudioPanel {
  position:  fixed !important;
  top:       0 !important;
  right:     0 !important;
  bottom:    0 !important;
  left:      var(--ecart-sidebar-col, 0px) !important;
  display:   flex !important;
  align-items:     center !important;
  justify-content: center !important;
  padding:
    clamp(12px, 3vw, 28px)
    calc(var(--ecart-ui-right) + var(--ecart-ui-size) + 18px)
    clamp(12px, 3vw, 28px)
    clamp(12px, 3vw, 28px) !important;
  box-sizing:    border-box;
  overflow:      hidden !important;
  background:    rgba(0,0,0,0.66) !important;
  backdrop-filter:         blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index:       var(--ecart-z-panel) !important;
  opacity:       0;
  pointer-events: none;
  visibility:    hidden;
  transition: opacity 0.22s ease, visibility 0s linear 0.22s;
  width:         auto !important;
  height:        auto !important;
  border:        none !important;
  border-radius: 0 !important;
  transform:     none !important;
  gap:           0 !important;
}

#infoPanel.is-open,
#mobileMapOverlay.is-open,
#ecartAudioPanel.is-visible {
  opacity:        1;
  pointer-events: auto;
  visibility:     visible;
  transition:     opacity 0.22s ease;
}


/* ==========================================================
   CARDS INTÉRIEURES
   [7] Scroll activé sur tous devices et formats
   ========================================================== */

.info-panel-inner,
.mobile-map-panel-inner,
.ecart-audio-panel-inner {
  box-sizing: border-box;
  width: min(100%, 560px);
  max-height: calc(100dvh - clamp(28px, 8vw, 64px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 22px;
  border-radius: 20px;
  background: rgba(8,8,8,0.96);
  color: rgba(255,255,255,0.88);
  border: 1px solid rgba(255,255,255,0.09);
  box-shadow: 0 16px 56px rgba(0,0,0,0.56), 0 0 0 1px rgba(255,255,255,0.025);
  transform: scale(0.96);
  transition: transform 0.22s ease;
}

#infoPanel.is-open        .info-panel-inner,
#mobileMapOverlay.is-open .mobile-map-panel-inner,
#ecartAudioPanel.is-visible .ecart-audio-panel-inner { transform: scale(1); }


/* ==========================================================
   TITRE PANEL
   ========================================================== */

.info-title,
.ecart-audio-panel-title {
  margin: 0 0 16px;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.38);
  line-height: 1.2;
}


/* ==========================================================
   INFO — typographie
   ========================================================== */

.info-description {
  font-size: 0.90rem;
  line-height: 1.62;
  color: rgba(255,255,255,0.80);
  letter-spacing: 0.012em;
}
.info-description p       { margin: 0; }
.info-description p + p   { margin-top: 0.50em; }

.info-gameplay {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.07);
}
.info-gameplay h3 {
  margin: 0 0 7px;
  font-size: 0.60rem;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.34);
}
.info-gameplay p {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.46;
  color: rgba(255,255,255,0.64);
}

.info-ref { margin-top: 18px; }
.info-ref h3 {
  font-size: 0.58rem;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.30);
  margin: 0 0 9px;
}
.info-ref-item {
  margin-bottom: 9px;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 0.80rem;
  line-height: 1.48;
  color: rgba(255,255,255,0.52);
  font-style: italic;
  letter-spacing: 0.012em;
}
.info-ref-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}


/* ==========================================================
   SOUND — tracklist
   [1] touch-action pan-y pour le scroll tactile en paysage
   ========================================================== */

.ecart-audio-panel-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ecart-audio-tracklist {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 340px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  scrollbar-width: none;
}
.ecart-audio-tracklist::-webkit-scrollbar { display: none; }

.ecart-audio-track {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255,255,255,0.50);
  touch-action: manipulation;
  transition: background 0.14s, color 0.14s, border-color 0.14s;
}
.ecart-audio-track:hover {
  background: rgba(255,255,255,0.04);
  color:      rgba(255,255,255,0.76);
}
.ecart-audio-track.is-active {
  background:   rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.09);
  color:        rgba(255,255,255,0.92);
}

.ecart-track-pp {
  width:  34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.80);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.14s, border-color 0.14s, transform 0.12s;
}
.ecart-track-pp:hover  { background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.36); }
.ecart-track-pp:active { transform: scale(0.88); }
.ecart-audio-track.is-active .ecart-track-pp {
  background:   rgba(255,255,255,0.92);
  border-color: transparent;
  color:        #111;
}

.ecart-track-body {
  flex: 1;
  min-width: 0;
  cursor: pointer;
  touch-action: manipulation;
}
.ecart-track-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}
.ecart-audio-track-index {
  font-size: 0.52rem;
  opacity: 0.40;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.ecart-audio-track-title {
  min-width: 0;
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.04em;
}

.ecart-track-progress-strip {
  position: relative;
  height: 2px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,0.10);
  cursor: pointer;
  touch-action: manipulation;
  transition: height 0.12s ease;
}
.ecart-audio-track.is-active .ecart-track-progress-strip { background: rgba(255,255,255,0.18); }
.ecart-track-progress-strip:hover { height: 4px; }

.ecart-track-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: rgba(255,255,255,0.85);
  border-radius: 999px;
  transition: width 0.25s linear;
}


/* ==========================================================
   SOUND — état lecture (bouton cluster)
   ========================================================== */

#soundToggle.is-playing {
  background:   #ffffff !important;
  color:        #000000 !important;
  border-color: transparent !important;
  animation: ecartSoundPulse 2.6s ease-in-out infinite;
}
@keyframes ecartSoundPulse {
  0%,100% { box-shadow: 0 0 0 0px rgba(255,255,255,0.20); }
      50% { box-shadow: 0 0 0 8px rgba(255,255,255,0.08); }
}


/* ==========================================================
   MAP — panneau + structure
   ========================================================== */

.mobile-map-panel {
  width: min(100%, 560px);
  height: min(80dvh, 700px);
  max-height: calc(100dvh - 32px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-map-panel-inner {
  width: 100% !important;
  height: 100%;
  max-height: none !important;
  display: flex;
  flex-direction: column;
  padding: clamp(14px, 2.5vw, 26px) !important;
  gap: clamp(6px, 1.4vw, 12px) !important;
  border-radius: 24px;
  background: rgba(0,0,0,0.94);
  border: 1px solid rgba(255,255,255,0.07);
  box-shadow: 0 20px 70px rgba(0,0,0,0.60), 0 0 60px rgba(255,255,255,0.03);
  overflow: hidden !important;
}

/* [4] Mini-map en PREMIER, barre nav EN DESSOUS */
.mobile-map-figure {
  flex: 1;
  min-height: 0;
  order: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-map-status-wrap {
  flex-shrink: 0;
  position: relative;
  z-index: 10;
  order: 2;
  margin-top: 8px;
  margin-bottom: 0;
}

.map-nav-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}

.map-nav-btn {
  width:  52px;
  height: 52px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.80);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  transition:
    background   0.15s ease,
    color        0.15s ease,
    border-color 0.15s ease,
    transform    0.12s ease;
}
.map-nav-btn:hover {
  background:   rgba(255,255,255,0.15);
  color:        rgba(255,255,255,1);
  border-color: rgba(255,255,255,0.36);
}
.map-nav-btn:active { transform: scale(0.88); }

.map-nav-label {
  flex: 1;
  min-width: 0;
  text-align: center;
  color: rgba(255,255,255,0.92);
  font-size: clamp(0.88rem, 2.2vw, 1.10rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-map-status {
  color: rgba(255,255,255,0.92);
  font-size: clamp(0.88rem, 2.2vw, 1.10rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
}


/* ==========================================================
   MINI-MAP — wrap + image
   [4.1] background transparent — plus de carré noir
   ========================================================== */

.mobile-mini-map-wrap {
  position: relative;
  width: min(100%, 520px);
  height: auto;
  aspect-ratio: 1 / 1;
  max-height: calc(100dvh - 150px);
  background: transparent;
  border: none;
  overflow: hidden;
  clip-path: inset(0 round 0px);
}

.mobile-mini-map-wrap .mini-map-image {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  filter: grayscale(1) contrast(1.08) brightness(0.90);
  opacity: 0.80;
}

.mobile-zone-hint { display: none !important; }


/* ==========================================================
   MINI-ZONES — états visuels
   [3] Suppression de .is-visited — pas de mémorisation
   ========================================================== */

.mobile-mini-map-wrap .mini-zone {
  position: absolute;
  z-index: 2;
  display: block;
  border-radius: 8px;
  border: 1.5px solid rgba(255,255,255,0.30);
  background: rgba(255,255,255,0.18);
  transition:
    background   0.20s ease,
    box-shadow   0.20s ease,
    border-color 0.20s ease,
    transform    0.20s ease;
  -webkit-tap-highlight-color: transparent;
}

.mobile-mini-map-wrap .mini-zone::before {
  content: "";
  position: absolute;
  inset: -8px;
  pointer-events: auto;
}

.mobile-mini-map-wrap .mini-zone-11 { z-index: 6 !important; }
.mobile-mini-map-wrap .mini-zone-9  { z-index: 4 !important; }

.mobile-mini-map-wrap .mini-zone:hover {
  background:   rgba(255,255,255,0.55) !important;
  border-color: rgba(255,255,255,0.70) !important;
  transform:    scale(1.03) !important;
}

.mobile-mini-map-wrap .mini-zone.is-current,
.mobile-mini-map-wrap .mini-zone.active {
  animation:    miniZoneCurrentBreath 3.2s ease-in-out infinite !important;
  background:   rgba(255,255,255,1.00) !important;
  border-color: rgba(255,255,255,0.90) !important;
}

.mobile-mini-map-wrap .mini-zone.is-selected {
  background:   rgba(255,255,255,0.90) !important;
  border-color: rgba(255,255,255,0.80) !important;
  transform:    scale(1.06) !important;
  box-shadow:   0 0 0 2px rgba(255,255,255,0.50) !important;
}


/* ==========================================================
   POSITIONS ZONES
   ========================================================== */

.mobile-mini-map-wrap .mini-zone-1  { top:52%;    left:16%;     width:16%;    height:10%;    }
.mobile-mini-map-wrap .mini-zone-2  { top:43%;    left:33%;     width:9%;     height:18%;    }
.mobile-mini-map-wrap .mini-zone-3  { top:43%;    left:43%;     width:13%;    height:18%;    }
.mobile-mini-map-wrap .mini-zone-4  { top:37%;    left:62%;     width:10%;    height:10%;    }
.mobile-mini-map-wrap .mini-zone-5  { top:22%;    left:40%;     width:30.89%; height:10%;    }
.mobile-mini-map-wrap .mini-zone-6  { top:22%;    left:24%;     width:9%;     height:10%;    }
.mobile-mini-map-wrap .mini-zone-7  { top:35%;    left:6%;      width:16%;    height:12%;    }
.mobile-mini-map-wrap .mini-zone-8  { top:33%;    left:32%;     width:11%;    height:7%;     }
.mobile-mini-map-wrap .mini-zone-9  { top:33%;    left:44%;     width:11%;    height:7%;     }
.mobile-mini-map-wrap .mini-zone-10 { top:22.25%; left:84.05%;  width:10.13%; height:16.95%; }
.mobile-mini-map-wrap .mini-zone-11 { top:22.2%;  left:75.05%;  width:8.41%;  height:8.45%;  }
.mobile-mini-map-wrap .mini-zone-12 { top:47.78%; left:88.65%;  width:7.56%;  height:16.70%; }
.mobile-mini-map-wrap .mini-zone-13 { top:65.07%;  left:77.12%;  width:19.97%; height:10.86%; }


/* ==========================================================
   BARRE AUDIO BAS DE PAGE
   ========================================================== */

#ecartAudioBar {
  position: fixed;
  bottom: 0;
  left:  var(--ecart-sidebar-col, 0px);
  right: 0;
  z-index: var(--ecart-z-audiobar);
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(6,6,6,0.94);
  border-top: 1px solid rgba(255,255,255,0.07);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}
#ecartAudioBar.is-visible { transform: translateY(0); pointer-events: auto; }

.ecart-audio-body {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 56px;
  padding: 0 16px;
  box-sizing: border-box;
}

.ecart-audio-icon { line-height: 1; }
.ecart-audio-icon--pause { display: none; }
#ecartAudioBar.is-playing .ecart-audio-icon--play  { display: none; }
#ecartAudioBar.is-playing .ecart-audio-icon--pause { display: block; }

.ecart-audio-title {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.88);
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.ecart-audio-meta {
  font-size: 0.62rem;
  color: rgba(255,255,255,0.34);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 2px;
}
.ecart-audio-time {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.40);
  letter-spacing: 0.06em;
  white-space: nowrap;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.ecart-audio-sep { opacity: 0.45; }

.ecart-audio-close {
  width: 26px; height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.11);
  background: transparent;
  color: rgba(255,255,255,0.30);
  cursor: pointer;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.14s, border-color 0.14s;
}
.ecart-audio-close:hover { color: rgba(255,255,255,0.72); border-color: rgba(255,255,255,0.36); }


/* ==========================================================
   ANIMATIONS
   ========================================================== */

@keyframes miniZoneCurrentBreath {
  0%,100% {
    transform: scale(1.010);
    box-shadow: 0 0 0 1.5px rgba(255,255,255,0.55), 0 0 8px rgba(255,255,255,0.22);
  }
  50% {
    transform: scale(1.030);
    box-shadow: 0 0 0 2px rgba(255,255,255,0.75), 0 0 14px rgba(255,255,255,0.32);
  }
}

@keyframes ecartDotPulse {
  0%, 100% { transform: scale(1);   opacity: 0.5; }
  50%       { transform: scale(1.5); opacity: 1;   }
}


/* ==========================================================
   PRÉCHARGEMENT — dots minimap
   ========================================================== */

.ecart-preload-dot {
  position: absolute;
  top: 7px; right: 7px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: transparent;
  pointer-events: none;
  user-select: none;
  z-index: 10;
  transition: background 0.4s ease, box-shadow 0.4s ease, transform 0.3s ease;
}
.ecart-preload-dot.is-loading {
  background: rgba(255,255,255,0.45);
  animation: ecartDotPulse 1.4s ease-in-out infinite;
}
.ecart-preload-dot.is-ready {
  background: #ffffff;
  box-shadow: 0 0 4px rgba(255,255,255,0.70), 0 0 10px rgba(255,255,255,0.35);
  transform: scale(1.15);
}
.ecart-preload-dot.is-error { background: transparent; }
.mini-zone.is-current .ecart-preload-dot,
.mini-zone.active     .ecart-preload-dot { display: none !important; }


/* ==========================================================
   TRANSITION NAVIGATION
   ========================================================== */

.ecart-nav-transition {
  position: fixed; inset: 0;
  z-index: 99999;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  will-change: opacity;
}
.ecart-nav-transition.is-active { opacity: 1; pointer-events: all; }

/* ==========================================================
   Z-INDEX / RESPONSIVE FINAL PROPRE
   ========================================================== */

:root {
  --ecart-z-title:    100060;
  --ecart-z-panel:    100300;
  --ecart-z-button:   100420;
  --ecart-z-audiobar: 99990;
}

.sidebar,
.sidebar-top,
.site-title,
.menu-toggle,
.home-button {
  z-index: var(--ecart-z-title) !important;
}

#infoPanel,
#mobileMapOverlay,
#ecartAudioPanel {
  z-index: var(--ecart-z-panel) !important;
}

.ecart-ui-cluster,
#ecartTopRight,
.ecart-focus-btn,
.ecart-light-btn {
  z-index: var(--ecart-z-button) !important;
}

/* Joystick derrière les panels */
.joystick,
.joystick-container,
.fixed-joystick,
#joystick,
#fixedJoystick,
.joystick-ui,
.mobile-joystick,
.touch-joystick,
[class*="joystick"],
[class*="Joystick"] {
  z-index: 40 !important;
}

body:has(#infoPanel.is-open) [class*="joystick"],
body:has(#mobileMapOverlay.is-open) [class*="joystick"],
body:has(#ecartAudioPanel.is-visible) [class*="joystick"],
body:has(#infoPanel.is-open) [class*="Joystick"],
body:has(#mobileMapOverlay.is-open) [class*="Joystick"],
body:has(#ecartAudioPanel.is-visible) [class*="Joystick"] {
  opacity: 0.18 !important;
  pointer-events: none !important;
}

/* Map totalement invisible quand fermée */
#mobileMapOverlay:not(.is-open),
#mobileMapOverlay:not(.is-open) * {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}


/* ==========================================================
   DESKTOP
   ========================================================== */

@media (pointer: fine) {
  :root {
    --ecart-ui-size: 52px;
    --ecart-ui-gap: 8px;
    --ecart-ui-right: 18px;
    --ecart-ui-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  }

  .ecart-ui-cluster {
    right: var(--ecart-ui-right) !important;
    bottom: var(--ecart-ui-bottom) !important;
    left: auto !important;
    top: auto !important;
    flex-direction: column !important;
    transform: none !important;
  }

  #ecartTopRight {
    top: calc(18px + env(safe-area-inset-top, 0px)) !important;
    right: var(--ecart-ui-right) !important;
    left: auto !important;
    bottom: auto !important;
    flex-direction: column !important;
    transform: none !important;
  }
}


/* ==========================================================
   TÉLÉPHONE PORTRAIT
   haut droite : LIGHT + EYE
   bas droite : INFO + MAP + SOUND
   ========================================================== */

@media (pointer: coarse) and (max-width: 767px) and (orientation: portrait) {
  :root {
    --ecart-ui-size: 52px;
    --ecart-ui-gap: 8px;
    --ecart-ui-right: 12px;
    --ecart-ui-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  }

  #ecartTopRight {
    top: calc(14px + env(safe-area-inset-top, 0px)) !important;
    right: calc(12px + env(safe-area-inset-right, 0px)) !important;
    left: auto !important;
    bottom: auto !important;
    flex-direction: row !important;
    gap: var(--ecart-ui-gap) !important;
    transform: none !important;
  }

  .ecart-light-btn { order: 1 !important; }
  .ecart-focus-btn { order: 2 !important; }

 .ecart-ui-cluster {
  left: auto !important;
  right: calc(12px + env(safe-area-inset-right, 0px)) !important;
  bottom: var(--ecart-ui-bottom) !important;
  top: auto !important;

  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: var(--ecart-ui-gap) !important;

  width: auto !important;
  transform: none !important;
}
  #infoToggle { order: 1 !important; }
  #mobileMapToggle { order: 2 !important; }
  #soundToggle { order: 3 !important; }

  .ecart-focus-btn,
  .ecart-light-btn,
  .ecart-ui-cluster > button {
    width: var(--ecart-ui-size) !important;
    height: var(--ecart-ui-size) !important;
    font-size: 0.48rem !important;
  }

  #infoPanel,
  #mobileMapOverlay,
  #ecartAudioPanel {
    left: 0 !important;
    right: 0 !important;
    padding:
      calc(72px + env(safe-area-inset-top, 0px))
      14px
      calc(74px + env(safe-area-inset-bottom, 0px))
      14px !important;
  }

  .info-panel-inner,
  .ecart-audio-panel-inner,
  .mobile-map-panel-inner {
    width: 100% !important;
    max-height: calc(100dvh - 150px) !important;
  }

  .mobile-map-panel {
    width: 100% !important;
    height: calc(100dvh - 150px) !important;
  }

  .mobile-mini-map-wrap {
    width: min(100%, 78vw) !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
    max-height: calc(100dvh - 230px) !important;
  }
}


/* ==========================================================
   TÉLÉPHONE PAYSAGE
   haut droite : LIGHT + EYE
   bas droite : SOUND + MAP + INFO
   ========================================================== */

@media (pointer: coarse) and (max-width: 767px) and (orientation: landscape) {
  :root {
    --ecart-ui-size: clamp(42px, 11vmin, 50px);
    --ecart-ui-gap: 5px;
    --ecart-ui-right: calc(4px + env(safe-area-inset-right, 0px));
    --ecart-ui-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
  }

  #ecartTopRight {
    top: calc(10px + env(safe-area-inset-top, 0px)) !important;
    right: var(--ecart-ui-right) !important;
    left: auto !important;
    bottom: auto !important;
    flex-direction: column !important;
    gap: var(--ecart-ui-gap) !important;
    transform: none !important;
  }

  .ecart-ui-cluster {
    top: auto !important;
    left: auto !important;
    right: var(--ecart-ui-right) !important;
    bottom: var(--ecart-ui-bottom) !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: var(--ecart-ui-gap) !important;
    width: auto !important;
    transform: none !important;
  }

  #soundToggle { order: 1 !important; }
  #mobileMapToggle { order: 2 !important; }
  #infoToggle { order: 3 !important; }

  .ecart-focus-btn,
  .ecart-light-btn,
  .ecart-ui-cluster > button {
    width: var(--ecart-ui-size) !important;
    height: var(--ecart-ui-size) !important;
    font-size: 0.38rem !important;
  }

  #infoPanel,
  #mobileMapOverlay,
  #ecartAudioPanel {
    left: 0 !important;
    right: 0 !important;
    padding:
      8px
      calc(var(--ecart-ui-size) + 24px + env(safe-area-inset-right, 0px))
      8px
      calc(54px + env(safe-area-inset-left, 0px)) !important;
  }

  .info-panel-inner,
  .ecart-audio-panel-inner,
  .mobile-map-panel-inner {
    max-height: calc(100dvh - 16px) !important;
    padding: 12px !important;
    border-radius: 16px !important;
  }

  .mobile-map-panel {
    width: 100% !important;
    height: calc(100dvh - 16px) !important;
  }

  .mobile-map-panel-inner {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    grid-template-rows: 1fr !important;
    gap: 10px !important;
  }

  .mobile-map-figure {
    grid-column: 1 !important;
    grid-row: 1 !important;
    order: initial !important;
    min-width: 0 !important;
  }

  .mobile-map-status-wrap {
    grid-column: 2 !important;
    grid-row: 1 !important;
    order: initial !important;
    margin: 0 !important;
    width: min(34vw, 180px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .map-nav-bar {
    width: 100% !important;
    flex-direction: column !important;
    gap: 8px !important;
  }

  .map-nav-label {
    white-space: normal !important;
    font-size: clamp(0.58rem, 1.5vw, 0.76rem) !important;
    line-height: 1.15 !important;
  }

  .map-nav-btn {
    width: 36px !important;
    height: 36px !important;
  }

  .mobile-mini-map-wrap {
    width: auto !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
    max-height: calc(100dvh - 70px) !important;
    max-width: calc(100dvh - 70px) !important;
  }

  .ecart-audio-tracklist {
    max-height: calc(100dvh - 82px) !important;
  }
}


/* ==========================================================
   TABLETTE PORTRAIT
   haut droite : LIGHT + EYE
   bas droite  : INFO + MAP + SOUND
   ========================================================== */

@media (pointer: coarse) and (min-width: 768px) and (orientation: portrait) {
  :root {
    --ecart-ui-size: 62px;
    --ecart-ui-gap: 10px;
  }

  #ecartTopRight {
    top: calc(18px + env(safe-area-inset-top, 0px)) !important;
    right: calc(18px + env(safe-area-inset-right, 0px)) !important;
    flex-direction: row !important;
    transform: none !important;
  }

  .ecart-ui-cluster {
    right: calc(22px + env(safe-area-inset-right, 0px)) !important;
    left: auto !important;
    bottom: calc(22px + env(safe-area-inset-bottom, 0px)) !important;
    top: auto !important;
    flex-direction: row !important;
    gap: var(--ecart-ui-gap) !important;
    transform: none !important;
  }

  #infoToggle { order: 1 !important; }
  #mobileMapToggle { order: 2 !important; }
  #soundToggle { order: 3 !important; }

  #infoPanel,
  #mobileMapOverlay,
  #ecartAudioPanel {
    left: 0 !important;
    padding:
      calc(88px + env(safe-area-inset-top, 0px))
      34px
      calc(90px + env(safe-area-inset-bottom, 0px))
      34px !important;
  }
}


/* ==========================================================
   TABLETTE PAYSAGE
   haut droite : LIGHT + EYE
   bas droite : SOUND + MAP + INFO
   ========================================================== */

@media (pointer: coarse) and (min-width: 768px) and (orientation: landscape) {
  :root {
    --ecart-ui-size: 58px;
    --ecart-ui-gap: 8px;
  }

  #ecartTopRight {
    top: calc(18px + env(safe-area-inset-top, 0px)) !important;
    right: calc(18px + env(safe-area-inset-right, 0px)) !important;
    flex-direction: column !important;
    transform: none !important;
  }

  .ecart-ui-cluster {
    top: auto !important;
    left: auto !important;
    right: calc(18px + env(safe-area-inset-right, 0px)) !important;
    bottom: calc(18px + env(safe-area-inset-bottom, 0px)) !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: var(--ecart-ui-gap) !important;
    width: auto !important;
    transform: none !important;
  }

  #soundToggle { order: 1 !important; }
  #mobileMapToggle { order: 2 !important; }
  #infoToggle { order: 3 !important; }

  #infoPanel,
  #mobileMapOverlay,
  #ecartAudioPanel {
    left: 0 !important;
    padding:
      24px
      calc(var(--ecart-ui-size) + 42px + env(safe-area-inset-right, 0px))
      24px
      calc(64px + env(safe-area-inset-left, 0px)) !important;
  }
}


/* ==========================================================
   GRANDS ÉCRANS
   ========================================================== */

@media (pointer: fine) and (min-width: 1440px) {
  :root {
    --ecart-ui-size: 50px;
    --ecart-ui-right: 24px;
    --ecart-ui-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  }
}
/* ==========================================================
   FIX MINI-MAP TEXTE — TELEPHONE PORTRAIT
   ========================================================== */

@media (pointer: coarse) and (max-width: 767px) and (orientation: portrait) {

  .mobile-map-status-wrap {
    margin-top: -6px !important;
    margin-bottom: 6px !important;
  }

  .map-nav-bar {
    min-height: 36px !important;
  }

  .map-nav-label {
    font-size: clamp(0.74rem, 2.8vw, 0.92rem) !important;
    line-height: 1.05 !important;
  }
}


/* ==========================================================
   FIX MINI-MAP — TELEPHONES PORTRAIT TRES FINS
   ========================================================== */

@media (pointer: coarse) and (max-width: 767px) and (orientation: portrait) {

  .mobile-map-panel {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
  }

  .mobile-map-panel-inner {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    align-items: center !important;
  }

  .mobile-map-figure {
    width: 100% !important;
    min-height: 0 !important;
  }

  .mobile-mini-map-wrap {
    width: min(82vw, 52dvh) !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
    max-width: 100% !important;
    max-height: 52dvh !important;
  }

  .mobile-mini-map-wrap .mini-map-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
  }
}


/* ==========================================================
   FINAL FIX — MINI MAP MOBILE/TABLETTE PAYSAGE
   responsive, non stretch, non décalée
   ========================================================== */
@media (pointer: coarse) and (max-width: 767px) and (orientation: landscape) {

  #mobileMapOverlay {
    left: 0 !important;
    right: 0 !important;
    padding:
      10px
      calc(var(--ecart-ui-size) + 28px + env(safe-area-inset-right, 0px))
      10px
      calc(54px + env(safe-area-inset-left, 0px)) !important;
  }

  .mobile-map-panel {
    width: 100% !important;
    height: calc(100dvh - 20px) !important;
    max-height: calc(100dvh - 20px) !important;
  }

  .mobile-map-panel-inner {
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;

    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;

    gap: 10px !important;
    padding: 10px !important;
    overflow: hidden !important;
  }

  .mobile-map-figure {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: 100% !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .mobile-mini-map-wrap {
    width: min(calc(100dvh - 56px), calc(100vw - 170px)) !important;
    height: min(calc(100dvh - 56px), calc(100vw - 170px)) !important;

    max-width: 100% !important;
    max-height: 100% !important;

    aspect-ratio: 1 / 1 !important;
    flex: 0 0 auto !important;

    position: relative !important;
    overflow: hidden !important;
  }

  .mobile-mini-map-wrap .mini-map-image {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
  }

  .mobile-map-status-wrap {
    flex: 0 0 clamp(92px, 24vw, 160px) !important;
    width: clamp(92px, 24vw, 160px) !important;
    height: 100% !important;
    margin: 0 !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .map-nav-bar {
    width: 100% !important;
    flex-direction: column !important;
    gap: 7px !important;
  }

  .map-nav-btn {
    width: 34px !important;
    height: 34px !important;
  }

  .map-nav-label {
    white-space: normal !important;
    font-size: clamp(0.56rem, 1.45vw, 0.74rem) !important;
    line-height: 1.12 !important;
  }

  .mobile-mini-map-wrap .mini-zone-13 {
    top: 65.07% !important;
    left: 77.12% !important;
    width: 19.97% !important;
    height: 10.86% !important;
  }
}