/* File: legend.css — dock légende carte (languette ┃ panneau) ; repli par largeur sans écraser le contenu
 * Desc: Dock ancré **bord gauche** carte ; glyphes ● ○ ⊙ via `--parr-glyph-font`.
 * Version 1.0.20 — centrage vertical : zone utile au-dessus du dock signature (`--parr-signature-reserve-h`)
 * Version 1.0.19 — `.parr-glyph-statut` hauteur 23px
 * Version 1.0.18 — section Parrainages : `.legend-pct` en blanc
 * Version 1.0.17 — glyphes : `.parr-glyph-char` + translateY optique ; tailles 17/20/30 px
 * Version 1.0.16 — [panneau┃tirette] collage comme liste communes ; glyphes 17/20/35 px centrés
 * Version 1.0.15 — dock gauche ; glyphes ×3 ; aucun ○ noir contour blanc ; sans « sans score »
 * Version 1.0.14 — glyphes UTF **●** score / **○** parrainages / **⊙** statut (`.parr-glyph-*`)
 * Copyright 2026 DNAvatar.org - Arnaud Maignan
 * Licensed under Apache License 2.0 with Commons Clause. See LICENSE_HEADER.txt for full terms.
 * Logs:
 * - 1.0.20: `.legend-dock` — `top: calc(50% - var(--parr-signature-reserve-h) / 2)` (footer signature)
 * - 1.0.19: `.parr-glyph-statut` — `height: 23px`
 * - 1.0.18: `.legend-parrain .legend-pct` — couleur `#fff`
 * - 1.0.17: centrage glyphes via `.parr-glyph-char` (évite ascender vide des polices symboles)
 * - 1.0.16: ordre DOM panneau puis tirette ; bord joint côté carte (`margin-left: -1px` sur tirette)
 * - 1.0.15: légende à gauche ; carets inversés ; tailles glyphes ×3 ; `parr-glyph-parrain-aucun`
 * - 1.0.14: `.parr-glyph-score` / `-parrain` / `-statut` — légende alignée fiche (● ○ ⊙)
 */

/* ===== LÉGENDE CARTE — dock bord gauche ; [panneau ┃ tirette] — collage identique à .ia-dock ===== */
.legend-dock {
  --legend-panel-max-height: min(82vh, 560px);
  --legend-panel-width: min(220px, 44vw);
  position: absolute;
  left: 0;
  right: auto;
  top: calc(50% - var(--parr-signature-reserve-h, 0px) / 2);
  transform: translateY(-50%);
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  max-width: min(240px, 48vw);
  z-index: 765;
  pointer-events: none;
  background: transparent;
  border: none;
  overflow: visible;
  box-sizing: border-box;
}
.legend-dock > * {
  pointer-events: auto;
}
.legend-panel-wrap {
  overflow: hidden;
  min-width: 0;
  flex: 0 1 auto;
  max-width: var(--legend-panel-width);
  max-height: var(--legend-panel-max-height);
  display: flex;
  flex-direction: column;
  transition:
    max-width 0s ease,
    min-width 0s ease,
    opacity 0s ease;
  box-sizing: border-box;
}
.legend-dock.legend-dock-collapsed .legend-panel-wrap {
  max-width: 0 !important;
  min-width: 0 !important;
  opacity: 0;
  pointer-events: none;
  transition:
    max-width var(--languette-pliage, 0.2s ease),
    min-width var(--languette-pliage, 0.2s ease),
    opacity var(--languette-pliage, 0.2s ease);
}
.legend-dock .legend-dock-toggle {
  background: rgba(15, 30, 62, 0.88);
  border: 1px solid var(--c-border);
  border-radius: var(--languette-radius-left);
  border-left: none;
  flex-shrink: 0;
  align-self: center;
  margin: 0 0 0 -1px;
  position: static;
  transform: none;
  color: #a9a9a9;
  box-sizing: border-box;
  overflow: hidden;
}
.legend-dock.legend-dock-collapsed .legend-dock-toggle {
  margin-left: 0;
  border-left: 1px solid var(--c-border);
  border-radius: var(--languette-radius-left);
}
.legend-dock .legend-dock-toggle:hover {
  color: #7f6af7;
  filter: brightness(1.12);
  background: rgba(15, 30, 62, 0.95);
}
.legend {
  position: relative;
  left: auto;
  bottom: auto;
  margin: 0;
  z-index: 0;
  box-sizing: border-box;
  width: var(--legend-panel-width);
  min-width: var(--legend-panel-width);
  max-height: var(--legend-panel-max-height);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 6px 8px;
  font-size: 10px;
  background: rgba(15, 30, 62, 0.88);
  border: 1px solid var(--c-border);
  border-right: none;
  border-left: 1px solid var(--c-border);
  color: var(--c-text);
  scrollbar-width: thin;
}
.legend-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #5ed4e0;
  margin-bottom: 5px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(94, 212, 224, 0.45);
}
.legend-title-gap { margin-top: 8px; }
.legend-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  min-width: 0;
  line-height: 1.35;
}
.legend-lbl,
.legend-pct {
  line-height: 1.35;
}
/* Glyphes ● ○ ⊙ — boîte fixe ; caractère dans `.parr-glyph-char` (centrage vs libellé) */
.parr-glyph {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 30px;
  padding: 0;
  margin: 0;
  line-height: 0;
  font-style: normal;
  font-family: var(--parr-glyph-font);
  overflow: visible;
}
.parr-glyph-char {
  display: block;
  line-height: 1;
  text-align: center;
}
.parr-glyph-score {
  height: 17px;
  font-size: 17px;
}
.parr-glyph-score .parr-glyph-char {
  transform: translateY(1px);
}
.parr-glyph-parrain {
  height: 20px;
  font-size: 20px;
}
.parr-glyph-parrain .parr-glyph-char {
  transform: translateY(1px);
}
.parr-glyph-parrain-aucun {
  color: #000;
}
.parr-glyph-parrain-aucun .parr-glyph-char {
  -webkit-text-stroke: 1.2px #fff;
  paint-order: stroke fill;
  text-shadow: 0 0 1px #fff;
  transform: translateY(1px);
}
.parr-glyph-statut {
  height: 23px;
  font-size: 30px;
  font-weight: 600;
}
.parr-glyph-statut .parr-glyph-char {
  transform: translateY(2px);
}
.legend-dot {
  box-sizing: border-box;
  width: 9px;
  height: 9px;
  min-width: 9px;
  min-height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  display: block;
  border-style: none;
  border-width: 0;
}
.legend-map-ring {
  box-sizing: border-box;
  width: 10px;
  height: 10px;
  min-width: 10px;
  min-height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  display: block;
  background: transparent;
  border: none;
  box-shadow: 0 0 0 2px var(--legend-ring);
}
.legend-parrain .legend-map-ring {
  width: 7px;
  height: 7px;
  min-width: 7px;
  min-height: 7px;
  box-shadow: 0 0 0 1.5px var(--legend-ring);
}
.legend-weight {
  font-weight: 400;
  font-size: 9.5px;
  letter-spacing: 0;
  text-transform: none;
  color: rgba(94, 212, 224, 0.55);
  margin-left: 4px;
}
.legend-lbl {
  flex: 1;
  min-width: 0;
}
.legend-pct {
  font-family: "SF Mono", Consolas, "Courier New", monospace;
  font-size: 9.5px;
  color: #8898aa;
  white-space: nowrap;
  flex-shrink: 0;
}
/* Section Parrainages : % des types (petit/grand, anneaux) en blanc */
.legend-parrain .legend-pct {
  color: #fff;
}
.legend-border {
  box-sizing: border-box;
  width: 14px;
  height: 14px;
  min-width: 14px;
  min-height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  display: block;
  background: transparent;
  border: 2px solid;
}
