/* Carte des planètes en mode simple et sa vidéo (lot M2, D-606). Reprise des maquettes du lot M
   (carte_planetes.css, carte_planetes_pos.css, video_carte.css). Accueil et page des mondes.
   Aucun style en ligne (CSP style-src 'self') ; seuls des classes et l'attribut « d » des traces changent. */

/* ---------- la carte ---------- */
.cp-carte {
  position: relative; aspect-ratio: 16 / 9; min-height: 520px; overflow: hidden; color: var(--texte);
  background: #0D0C28 url("../img/ciel-carte.webp") center / cover no-repeat; image-rendering: pixelated;
  box-shadow: 0 -4px 0 0 var(--contour), 0 4px 0 0 var(--contour), -4px 0 0 0 var(--contour), 4px 0 0 0 var(--contour),
    0 12px 0 0 rgba(44, 30, 26, .32);
}
.cp-liste { list-style: none; margin: 0; padding: 0; }
.cp-traces { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.cp-traces path { fill: none; stroke: var(--accent); stroke-width: 4; stroke-dasharray: 4 10; opacity: .8; }

.cp-monde { position: absolute; transform: translate(-50%, -50%); z-index: 2; }
.cp-monde.vise { z-index: 4; }
.cp-carte.a-vise .cp-monde:not(.vise) { opacity: .4; transition: opacity .15s; }
.cp-cible { display: flex; flex-direction: column; align-items: center; text-decoration: none; color: var(--texte); }
.cp-astre { position: relative; display: block; padding: 12px; }
.cp-astre img { display: block; height: auto; max-width: none; image-rendering: pixelated; }
.cp-nom { margin-top: 2px; font: 400 21px/1 var(--titre); text-shadow: 0 3px 0 var(--contour); white-space: nowrap; }
.cp-etat {
  margin-top: 6px; font: 800 12px/1 var(--corps); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
  padding: 4px 7px 5px; background: var(--reussite); color: #0F3A16; box-shadow: 0 0 0 2px var(--contour);
}
.cp-monde.depart .cp-etat { background: var(--gratuit); color: #08304A; }
a.cp-cible { cursor: pointer; }
a.cp-cible:hover { color: var(--texte); }
a.cp-cible:focus-visible { outline: 3px solid var(--gratuit); outline-offset: 2px; }

/* monde visé (survol ou focus) : cadre pixel or et bulle */
.cp-monde.ouvert .cp-astre::before {
  content: ""; position: absolute; inset: 0; visibility: hidden; background:
    linear-gradient(var(--accent), var(--accent)) left top / 18px 4px no-repeat,
    linear-gradient(var(--accent), var(--accent)) left top / 4px 18px no-repeat,
    linear-gradient(var(--accent), var(--accent)) right top / 18px 4px no-repeat,
    linear-gradient(var(--accent), var(--accent)) right top / 4px 18px no-repeat,
    linear-gradient(var(--accent), var(--accent)) left bottom / 18px 4px no-repeat,
    linear-gradient(var(--accent), var(--accent)) left bottom / 4px 18px no-repeat,
    linear-gradient(var(--accent), var(--accent)) right bottom / 18px 4px no-repeat,
    linear-gradient(var(--accent), var(--accent)) right bottom / 4px 18px no-repeat;
}
.cp-monde.vise .cp-astre::before { visibility: visible; }
.cp-monde.vise .cp-nom { color: var(--accent); }

.cp-bulle {
  display: none; position: absolute; left: calc(100% - 4px); top: -36px; width: 236px; z-index: 5; pointer-events: none;
  background: var(--panneau); color: var(--encre); padding: 12px 14px 13px; font-size: 14px; line-height: 1.4; text-align: left;
  box-shadow: 0 -4px 0 0 var(--contour), 0 4px 0 0 var(--contour), -4px 0 0 0 var(--contour), 4px 0 0 0 var(--contour), 0 8px 0 0 rgba(0, 0, 0, .35);
}
.cp-monde.vise .cp-bulle { display: block; }
/* Places de la bulle choisies par carte.js (moins de recouvrement) ; étiquette encore couverte : effacée. */
.cp-bulle.b-bas { top: auto; bottom: -36px; }
.cp-bulle.b-gauche { left: auto; right: calc(100% - 4px); }
.cp-carte .cp-couverte { opacity: 0; transition: opacity .1s; }
.cp-bulle .cp-apercu { position: relative; display: block; margin: -2px -4px 10px; box-shadow: 0 0 0 3px var(--contour); }
.cp-bulle .cp-apercu img { display: block; width: 100%; height: 112px; object-fit: cover; image-rendering: auto; }
.cp-bulle .cp-src { position: absolute; right: 4px; bottom: 4px; font: 800 10px/1 var(--corps); letter-spacing: .06em; text-transform: uppercase; color: #FFFFFF; background: rgba(8, 7, 24, .72); padding: 3px 5px 4px; }
.cp-bulle b { display: block; font: 400 19px/1.1 var(--titre); color: var(--encre); margin-bottom: 4px; }
.cp-bulle .cp-txt { display: block; margin: 0 0 8px; }
.cp-bulle .cp-aide { display: block; color: var(--encre2); font-size: 13px; }
.cp-bulle kbd { display: inline-block; font: 800 12px/1 var(--corps); padding: 3px 6px 4px; background: var(--encart); color: var(--texte); margin-right: 4px; }

/* monde voilé : grisé, « Ouvre plus tard », aucun lien (D-587) */
.cp-monde.voile .cp-astre { padding: 6px; }
.cp-monde.voile img { filter: saturate(.35) brightness(.62); }
.cp-monde.voile .cp-nom { font-size: 17px; color: var(--texte2); }
.cp-monde.voile .cp-etat { display: inline-flex; align-items: center; gap: 5px; background: #2A2C4A; color: var(--texte2); box-shadow: 0 0 0 2px #121228; }
.cp-monde.voile .cp-etat i { width: 10px; height: 12px; flex: none; background: url("../img/picto-cadenas.webp") center / contain no-repeat; image-rendering: pixelated; }

/* places : x et y en %, centre du monde ; largeur de l'image en px (carte3d/src/dimensions.json, vue 6) */
.cp-carte .pos-depart { left: 11%; top: 55%; } .cp-carte .pos-depart .cp-astre img { width: 174px; }
.cp-carte .pos-aether { left: 33%; top: 31%; } .cp-carte .pos-aether .cp-astre img { width: 192px; }
.cp-carte .pos-lune { left: 32%; top: 78%; } .cp-carte .pos-lune .cp-astre img { width: 108px; }
.cp-carte .pos-mars { left: 62%; top: 27%; } .cp-carte .pos-mars .cp-astre img { width: 84px; }
.cp-carte .pos-venus { left: 52%; top: 70%; } .cp-carte .pos-venus .cp-astre img { width: 88px; }
.cp-carte .pos-mercure { left: 70%; top: 48%; } .cp-carte .pos-mercure .cp-astre img { width: 56px; }
.cp-carte .pos-glacio { left: 73%; top: 21%; } .cp-carte .pos-glacio .cp-astre img { width: 80px; }
.cp-carte .pos-starlight { left: 77%; top: 74%; } .cp-carte .pos-starlight .cp-astre img { width: 168px; }
.cp-carte .pos-otherside { left: 88%; top: 30%; } .cp-carte .pos-otherside .cp-astre img { width: 80px; }
.cp-carte .pos-poches { left: 92%; top: 68%; } .cp-carte .pos-poches .cp-astre img { width: 68px; }

/* ---------- le bloc de l'accueil et de la page des mondes ---------- */
.cp-section { padding-top: 40px; }
.cp-tete { display: flex; align-items: end; justify-content: space-between; gap: 12px 28px; flex-wrap: wrap; margin-bottom: 22px; }
.cp-tete h2 { font-size: 40px; margin: 12px 0 0; }
.cp-tete p { margin: 0; color: var(--encre2); max-width: 520px; }
.cp-sous { display: flex; align-items: center; gap: 14px 24px; flex-wrap: wrap; margin-top: 22px; }
.cp-sous .cp-note { margin: 0; font-size: 15px; color: var(--encre2); }
.cp-sous .lien-suite { margin-left: auto; }
/* En mode interactif, l'accueil montre la carte 3D en haut : le bloc simple se cache (il revient au repli). */
.mode-interactif .cp-accueil { display: none; }

/* ---------- la vidéo de la carte, derrière son bouton ---------- */
.cp-video .vc-mondes { margin-top: 22px; }
.vc-lecteur { min-width: 0; }
.vc-ecran { position: relative; aspect-ratio: 16 / 9; background: var(--nuit); overflow: hidden; }
.vc-ecran picture, .vc-ecran img, .vc-ecran video { display: block; width: 100%; height: 100%; object-fit: cover; }
.vc-ecran video { position: absolute; inset: 0; background: var(--nuit); }
.vc-affiche { image-rendering: pixelated; }
.vc-voir { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); white-space: nowrap; }
.vc-voir:active { transform: translate(-50%, calc(-50% + 2px)); }
.vc-duree { position: absolute; right: 14px; bottom: 14px; background: rgba(11, 10, 31, .88); color: #FFFFFF; font: 800 14px/1 var(--corps); padding: 7px 10px; }
.vc-lecteur.lecture .vc-voir, .vc-lecteur.lecture .vc-duree { display: none; }
.vc-commandes { display: flex; align-items: center; gap: 16px; min-height: 52px; margin-top: 14px; }
.vc-pause { min-width: 168px; }
.vc-message { margin: 0; font-size: 15px; color: var(--encre2); }

/* liste des mondes sous la vidéo, en liens texte */
.vc-mondes h3 { font-size: 26px; margin-bottom: 12px; }
.vc-mondes ul { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px 14px; }
.vc-mondes li { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px 11px; background: var(--encart); color: var(--texte);
  box-shadow: 0 -3px 0 0 var(--contour), 0 3px 0 0 var(--contour), -3px 0 0 0 var(--contour), 3px 0 0 0 var(--contour); }
.vc-mondes a { font: 400 21px/1.15 var(--titre); color: #FFFFFF; text-decoration: none; box-shadow: inset 0 -3px 0 var(--or); align-self: flex-start; padding-bottom: 2px; }
.vc-mondes a:hover { color: var(--accent); }
/* Toute la carte d'un monde ouvert est sa cible (44 px au moins) : le lien la couvre par un ::after. */
.vc-mondes li.ouvert { position: relative; }
.vc-mondes li.ouvert a::after { content: ""; position: absolute; inset: 0; }
.vc-mondes a:focus-visible { outline: 3px solid var(--gratuit); outline-offset: 4px; }
.vc-mondes span { font: 800 12px/1.4 var(--corps); letter-spacing: .08em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 6px; }
.vc-mondes .ouvert span { color: var(--reussite); }
.vc-mondes .voile { background: var(--encart-creux); }
.vc-mondes .voile b.cp-vnom { font: 400 21px/1.15 var(--titre); color: var(--texte2); }
.vc-mondes .voile span { color: var(--texte3); }
/* cadenas en pixels, dessiné en CSS */
.vc-mondes .voile i { width: 10px; height: 12px; flex: none; background:
  linear-gradient(var(--texte3), var(--texte3)) 0 5px / 10px 7px no-repeat,
  linear-gradient(var(--texte3), var(--texte3)) 2px 0 / 6px 2px no-repeat,
  linear-gradient(var(--texte3), var(--texte3)) 2px 0 / 2px 5px no-repeat,
  linear-gradient(var(--texte3), var(--texte3)) 6px 0 / 2px 5px no-repeat; }

/* ---------- téléphone et tablette : carte en hauteur, 960 px (x en %, y en px) ---------- */
@media (max-width: 900px) {
  .cp-carte { aspect-ratio: auto; min-height: 0; height: 960px; background-size: auto 100%; }
  .cp-carte .cp-nom { font-size: 19px; }
  .cp-carte .voile .cp-nom { font-size: 15px; }
  .cp-carte .cp-etat { font-size: 11px; letter-spacing: .06em; }
  .cp-carte .cp-bulle { display: none; }
  .cp-carte .cp-monde.vise .cp-bulle { display: none; }
  .cp-carte .pos-depart { left: 50%; top: 100px; } .cp-carte .pos-depart .cp-astre img { width: 116px; }
  .cp-carte .pos-aether { left: 72%; top: 300px; } .cp-carte .pos-aether .cp-astre img { width: 128px; }
  .cp-carte .pos-lune { left: 26%; top: 290px; } .cp-carte .pos-lune .cp-astre img { width: 72px; }
  .cp-carte .pos-mars { left: 27%; top: 460px; } .cp-carte .pos-mars .cp-astre img { width: 42px; }
  .cp-carte .pos-venus { left: 73%; top: 520px; } .cp-carte .pos-venus .cp-astre img { width: 44px; }
  .cp-carte .pos-mercure { left: 27%; top: 590px; } .cp-carte .pos-mercure .cp-astre img { width: 28px; }
  .cp-carte .pos-glacio { left: 73%; top: 650px; } .cp-carte .pos-glacio .cp-astre img { width: 40px; }
  .cp-carte .pos-starlight { left: 27%; top: 735px; } .cp-carte .pos-starlight .cp-astre img { width: 84px; }
  .cp-carte .pos-otherside { left: 73%; top: 790px; } .cp-carte .pos-otherside .cp-astre img { width: 40px; }
  .cp-carte .pos-poches { left: 27%; top: 870px; } .cp-carte .pos-poches .cp-astre img { width: 34px; }
}
@media (max-width: 600px) {
  .cp-tete h2 { font-size: 30px; }
  .cp-sous .lien-suite { margin-left: 0; }
  .cp-sous .btn { width: 100%; }
  .vc-voir { font-size: 16px; min-height: 44px; padding: 8px 14px 12px; }
  .vc-duree { right: 8px; bottom: 8px; font-size: 12px; padding: 5px 7px; }
  .vc-pause { min-height: 44px; flex: 1; }
  .vc-commandes { flex-wrap: wrap; }
  .vc-mondes ul { grid-template-columns: 1fr 1fr; }
  .vc-mondes a { font-size: 18px; }
}
