/* Page « La cellule et son ADN » (d'après la maquette validée : Main, Noyau, ADN, PhaseM). */

/* ---- En-tête : fil d'Ariane des échelles ---- */

.fil ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 14px; }
.fil li { display: flex; align-items: center; gap: 6px; }
.fil li + li::before { content: '›'; color: var(--eteint); }
.fil button {
  min-height: 44px; padding: 0 10px; border-radius: 999px; border: 0; background: transparent; color: var(--accent);
  font-size: 14px; cursor: pointer;
}
.fil button:hover { color: var(--accent-clair); text-decoration: underline; }
.fil button[aria-current] { background: var(--accent); color: var(--accent-texte); font-weight: 600; padding: 0 14px; text-decoration: none; }
.fil-inactif { color: var(--eteint); padding: 0 10px; }

/* ---- Mise en page : scène à gauche, panneau des vidéos à droite (dessous quand la place manque) ---- */

.cellule-page { display: flex; flex-wrap: wrap; align-items: flex-start; max-width: 1640px; margin: 0 auto; }
.cellule-principal { flex: 999 1 640px; min-width: 0; padding: 20px; }
.panneau-videos {
  flex: 1 1 340px; min-width: 0; max-width: 100%; padding: 20px 20px 28px;
  display: flex; flex-direction: column; gap: 14px;
}

.zone-scene { position: relative; outline: none; }
.scene {
  position: relative; width: 100%; aspect-ratio: 16 / 10; border-radius: 20px; overflow: hidden;
  background: radial-gradient(ellipse 62% 75% at 50% 50%, #16382b 0%, #050f0b 100%);
  border: 1px solid rgba(116, 198, 157, 0.2); touch-action: pan-x pan-y;
}
.scene:focus-visible { outline: 3px solid var(--ambre); outline-offset: 3px; }
.calques { position: absolute; inset: 0; }
.calque, .calque-sortant { position: absolute; inset: 0; }
.calque-sortant { pointer-events: none; }
.scene-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.legende-scene { margin: 12px 4px 0; font-size: 14px; color: var(--pale); }
.aide { margin: 4px 4px 0; font-size: 13px; color: var(--doux); }

/* ---- Repères vidéo ---- */

.repere {
  position: absolute; z-index: 2; display: flex; align-items: center; gap: 10px; min-height: 44px;
  padding: 7px 16px 7px 7px; border-radius: 999px; background: rgba(8, 26, 19, 0.92); border: 1.5px solid var(--accent);
  color: var(--texte); white-space: nowrap; text-align: left; font-size: 14px; cursor: pointer;
  transform: translate(var(--dx, 0px), var(--dy, 0px));
}
.repere-gauche { transform: translate(calc(-100% + var(--dx, 0px)), var(--dy, 0px)); }
.repere:hover { background: var(--surface-2); }
.repere-icone {
  flex: 0 0 30px; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--accent-texte);
  display: flex; align-items: center; justify-content: center;
}
.repere-icone svg { margin-left: 2px; }
.repere-textes { display: flex; flex-direction: column; line-height: 1.2; font-weight: 500; }
.repere-info { font-size: 12px; font-weight: 400; color: var(--doux); }
.repere-allume { border: 2px solid var(--ambre); box-shadow: 0 0 0 6px rgba(255, 183, 3, 0.18); }
.repere-allume .repere-icone { background: var(--ambre); }
.repere-allume .repere-info { color: var(--ambre); }
.repere-cible { animation: pulsation 0.85s ease-in-out 3; }
@keyframes pulsation {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 183, 3, 0.55); }
  50% { box-shadow: 0 0 0 14px rgba(255, 183, 3, 0.15); }
}

.cible-zoom {
  position: absolute; z-index: 1; transform: translate(-50%, -32px); display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 0; border: 0; background: none; color: var(--texte); cursor: zoom-in;
}
.cible-icone {
  width: 64px; height: 64px; border-radius: 50%; background: rgba(8, 26, 19, 0.85); border: 2px solid #bfe6d2; color: #bfe6d2;
  display: flex; align-items: center; justify-content: center; transition: border-color 0.15s, color 0.15s;
}
.cible-zoom:hover .cible-icone { border-color: var(--ambre); color: var(--ambre); }
.cible-texte { padding: 6px 12px; border-radius: 10px; background: rgba(8, 26, 19, 0.88); font-size: 14px; font-weight: 500; white-space: nowrap; }
.cible-zoom:focus-visible { outline: none; }
.cible-zoom:focus-visible .cible-icone { outline: 3px solid var(--ambre); outline-offset: 2px; }

/* ---- Outils posés sur la scène (grand écran) ---- */

.outils-scene { position: absolute; inset: 0; pointer-events: none; }
.outils-scene > * { position: absolute; pointer-events: auto; }

.etapes {
  left: 50%; top: 16px; transform: translateX(-50%); display: flex; gap: 8px; padding: 6px; border-radius: 14px;
  background: rgba(8, 26, 19, 0.9); border: 1px solid rgba(116, 198, 157, 0.3); z-index: 3;
}
.etapes button {
  min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1.5px solid rgba(159, 194, 177, 0.5);
  background: transparent; color: var(--doux); font-size: 14px; cursor: pointer;
}
.etapes button:hover { color: var(--texte); border-color: var(--accent); }
.etapes button[aria-pressed="true"] { border-color: var(--ambre); background: var(--ambre); color: #10241b; font-weight: 700; }

.mini-carte {
  right: 16px; top: 16px; width: 168px; height: 105px; border-radius: 12px; overflow: hidden;
  background: rgba(8, 26, 19, 0.9); border: 1px solid rgba(116, 198, 157, 0.3); pointer-events: none !important;
}

.cycle {
  left: 16px; bottom: 16px; width: 300px; padding: 14px; border-radius: 16px; display: flex; flex-direction: column; gap: 10px;
  background: rgba(8, 26, 19, 0.93); border: 1px solid rgba(116, 198, 157, 0.3); z-index: 3;
}
.cycle-fort { border-color: rgba(255, 183, 3, 0.5); }
.cycle-haut { display: flex; align-items: center; gap: 14px; }
.anneau { flex: 0 0 104px; overflow: visible; }
.anneau .segment { stroke: rgba(116, 198, 157, 0.45); pointer-events: stroke; cursor: pointer; transition: stroke 0.2s, stroke-width 0.2s; outline: none; }
.anneau .segment:hover { stroke: rgba(116, 198, 157, 0.75); }
.anneau .segment-actif, .anneau .segment-actif:hover { stroke: var(--ambre); stroke-width: 20; }
.anneau .segment:focus-visible { stroke-width: 22; filter: drop-shadow(0 0 2px #ffffff) drop-shadow(0 0 2px #ffffff); }
.anneau-lettres { pointer-events: none; }
.aiguille { transform-origin: 60px 60px; transition: transform 0.6s cubic-bezier(0.45, 0, 0.25, 1); pointer-events: none; }
.cycle-textes { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cycle-titre { font-size: 12px; color: var(--doux); letter-spacing: 0.08em; text-transform: uppercase; }
.cycle-phase { font-size: 16px; font-weight: 600; }
.cycle-fort .cycle-phase { color: var(--ambre); }
.cycle-detail { font-size: 13px; color: var(--pale); line-height: 1.35; }
.cycle-boutons { display: flex; gap: 8px; }
.bouton-cycle {
  flex: 1 1 0; min-height: 44px; border-radius: 10px; border: 1.5px solid rgba(116, 198, 157, 0.5); background: transparent;
  color: var(--texte); font-size: 14px; cursor: pointer;
}
.bouton-cycle:hover { background: var(--surface-2); }
.bouton-cycle-ambre { border-color: var(--ambre); color: var(--ambre); font-weight: 600; }

.zooms { right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 6px; z-index: 3; }
.bouton-carre {
  width: 44px; height: 44px; border-radius: 12px; border: 1px solid rgba(116, 198, 157, 0.35); background: rgba(8, 26, 19, 0.92);
  color: var(--texte); display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.bouton-carre:hover:not(:disabled) { border-color: var(--accent); }
.bouton-carre:disabled { opacity: 0.4; cursor: default; }

/* ---- Scène étroite (moins de 820 px) : outils sous la scène, repères réduits à leur icône ---- */

.zone-scene.etroite .scene { border-radius: 14px; }
.zone-scene.etroite .outils-scene {
  position: static; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; margin-top: 10px; pointer-events: auto;
}
.zone-scene.etroite .outils-scene > * { position: static; transform: none; }
.zone-scene.etroite .etapes { order: -1; flex: 1 1 100%; flex-wrap: wrap; justify-content: center; }
.zone-scene.etroite .etapes button { flex: 1 1 auto; padding: 0 10px; }
.zone-scene.etroite .cycle { order: 2; flex: 1 1 260px; width: auto; }
.zone-scene.etroite .zooms { order: 1; flex-direction: row; }
.zone-scene.etroite .mini-carte { order: 1; width: 120px; height: 75px; margin-left: auto; }
.zone-scene.etroite .repere { padding: 6px; gap: 0; }
.zone-scene.etroite .repere-icone { flex-basis: 32px; width: 32px; height: 32px; }
.zone-scene.etroite .repere-textes, .zone-scene.etroite .cible-texte {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.zone-scene.etroite .cible-zoom { transform: translate(-50%, -50%); }
.zone-scene.etroite .cible-icone { width: 48px; height: 48px; }
.zone-scene.etroite .scene-svg .etiquettes { font-size: 34px; }
.zone-scene.etroite .scene-svg .barre-echelle text { font-size: 32px; }

/* ---- Panneau des vidéos ---- */

.onglets { display: flex; gap: 6px; padding: 4px; border-radius: 14px; background: var(--surface); }
.onglets [role="tab"] {
  flex: 1 1 0; min-height: 44px; padding: 0 8px; border-radius: 10px; border: 0; background: transparent;
  color: var(--doux); font-size: 14px; cursor: pointer;
}
.onglets [role="tab"][aria-selected="true"] { background: var(--surface-3); color: var(--texte); font-weight: 600; }
.panneau-onglet { display: flex; flex-direction: column; gap: 12px; }
.panneau-onglet[hidden] { display: none; }
.parcours-intro, .message-vide { margin: 0; color: var(--doux); font-size: 14px; }

.liste-videos { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ligne-video { display: flex; gap: 8px; align-items: stretch; }
.liste-parcours { counter-reset: parcours; }
.liste-parcours .ligne-video { counter-increment: parcours; }
.liste-parcours .ligne-video::before {
  content: counter(parcours); flex: 0 0 26px; align-self: center; text-align: center; color: var(--doux); font-size: 14px; font-weight: 600;
}
.carte-mini {
  flex: 1 1 auto; min-width: 0; display: flex; gap: 12px; padding: 10px; border-radius: 14px; text-align: left;
  background: var(--surface-2); border: 1px solid var(--bord); color: var(--texte); cursor: pointer;
}
.carte-mini:hover { border-color: var(--accent); }
.carte-allumee { border: 2px solid var(--ambre); }
.carte-mini-image { position: relative; flex: 0 0 112px; height: 63px; border-radius: 8px; overflow: hidden; background: var(--surface-3); }
.carte-mini-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.carte-mini-lire {
  position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%;
  background: rgba(116, 198, 157, 0.92); color: var(--accent-texte); display: flex; align-items: center; justify-content: center;
}
.carte-allumee .carte-mini-lire { background: var(--ambre); }
.carte-mini-textes { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.carte-mini-titre { font-size: 15px; font-weight: 600; line-height: 1.25; }
.carte-mini-info { font-size: 12px; color: var(--doux); }
.pastille {
  align-self: flex-start; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--ambre); color: #0b2219;
}
.bouton-situer-mini {
  flex: 0 0 44px; border-radius: 12px; border: 1px solid var(--bord); background: var(--surface); color: var(--doux); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.bouton-situer-mini:hover { color: var(--ambre); border-color: var(--ambre); }

.lignes-zoom, .moments, .puces { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.lignes-zoom button, .moments button {
  width: 100%; min-height: 44px; display: flex; align-items: center; gap: 12px; padding: 6px 12px; border-radius: 10px; border: 0;
  background: var(--surface); color: var(--texte); font-size: 14px; text-align: left; cursor: pointer;
}
.lignes-zoom button { justify-content: space-between; }
.lignes-zoom button:hover, .moments button:hover { background: var(--surface-2); }
.lignes-zoom .lieu { color: var(--doux); font-size: 12px; white-space: nowrap; }
.moments .temps { color: var(--ambre); font-variant-numeric: tabular-nums; min-width: 2.6em; }
.puces { flex-direction: row; flex-wrap: wrap; font-size: 13px; }
.puces li { padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--bord-fort); }

.schema-bloc {
  display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; background: var(--surface);
  border: 1px solid rgba(255, 183, 3, 0.4);
}
.schema-bloc img { flex: 0 0 96px; width: 96px; height: 54px; border-radius: 8px; object-fit: cover; border: 1px solid var(--bord); }
.schema-textes { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.schema-titre { font-size: 14px; font-weight: 600; }
.schema-info { font-size: 12px; color: var(--doux); }
.schema-liens { display: flex; flex-wrap: wrap; gap: 6px; }
.lien-schema {
  min-height: 44px; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; border-radius: 8px;
  border: 1px solid var(--bord-fort); color: var(--texte); text-decoration: none; font-size: 13px;
}
.lien-schema:hover { background: var(--surface-2); color: var(--texte); }

@media (max-width: 860px) {
  .cellule-principal { padding: 12px 12px 0; }
  .panneau-videos { padding: 16px 12px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .aiguille { transition: none; }
  .repere-cible { animation: none; outline: 3px solid var(--ambre); outline-offset: 3px; }
}
