/* Les systemes solaires, la creation par systeme et les pistes.
   Complete app.css : memes variables, memes conventions. */

/* ================= Systemes solaires ================= */

.zone-nom {
  font-family: var(--police); font-weight: 800; letter-spacing: -0.01em;
  font-size: calc(var(--fs, 24px) * 1.75); fill: var(--or-vif); text-anchor: middle;
  cursor: pointer; opacity: 0.9;
}
.zone-nom:hover { fill: var(--texte); }
.anneau-usage {
  fill: none; stroke: var(--filet); stroke-width: 1.2; stroke-dasharray: 2 9;
  vector-effect: non-scaling-stroke; pointer-events: none;
}
.etiq-anneau {
  font-family: var(--police); font-size: calc(var(--fs, 24px) * 0.62); fill: var(--attenue); opacity: 0.8;
  text-anchor: middle; pointer-events: none;
  paint-order: stroke; stroke: var(--contour); stroke-width: calc(var(--fs, 24px) * 0.2); stroke-linejoin: round;
}
.zone-vide { font-family: var(--police); font-size: calc(var(--fs, 24px) * 1.1); fill: var(--attenue); text-anchor: middle; pointer-events: none; }
.zone-vide.petit { font-size: calc(var(--fs, 24px) * 0.85); opacity: 0.8; }
.anneau-theorique {
  fill: none; stroke: var(--attenue); stroke-width: 1.6; stroke-dasharray: 2 5;
  vector-effect: non-scaling-stroke; pointer-events: none;
}
.point-inconnu {
  font-family: var(--police); font-size: calc(var(--fs, 24px) * 1.3); font-weight: 800;
  fill: var(--or-vif); text-anchor: middle; pointer-events: none;
}
.lien.long { stroke-width: 2.2; opacity: 0.95; }

.repere-piste { pointer-events: none; }
.repere-piste .rep-in { transform: scale(var(--k, 1)); }
.rep-fond { fill: var(--or); stroke: var(--contour); stroke-width: 2; }
.rep-n { font-family: var(--police); font-size: 14px; font-weight: 800; fill: var(--sur-or); text-anchor: middle; }
#ciel.pointage, #ciel.pointage .astre, #ciel.pointage .lien-zone { cursor: crosshair; }

.repere.theorique { border: 2px dotted var(--attenue); }
.repere.sans { background: none; width: auto; height: auto; color: var(--or-vif); font-weight: 800; line-height: 1; }
.repere.sans::before { content: "?"; }
.repere.orbite { border: 1.5px dashed var(--filet-fort); }

.mesure {
  font-size: 0.78rem; font-weight: 700; padding: 0.15rem 0.6rem; border-radius: 999px;
  border: 1px solid currentColor; align-self: flex-start; margin: 0;
}
.mesure.mesuree { color: var(--service-f); }
.mesure.theorique { color: var(--attenue); border-style: dashed; }
.lb-sys { font-size: 0.74rem; color: var(--attenue); border: 1px solid var(--filet); border-radius: 999px; padding: 0.05rem 0.5rem; }

/* ================= Creation : choix du systeme ================= */

.rafale { grid-template-columns: minmax(0, 1fr) auto auto; }
.rafale > input { order: 1; }
.rafale > button[type="submit"] { order: 2; }
.rafale > #rafale-fermer { order: 3; }
.rafale-systeme {
  order: 4; grid-column: 1 / -1; display: flex; align-items: center; gap: 0.6rem;
  font-size: 0.82rem; color: var(--attenue);
}
.rafale-systeme select { width: auto; flex: 1; max-width: 14rem; padding: 0.3rem 0.5rem; }
.rafale-contexte { order: 5; }

/* ================= Pistes ================= */

.pistes-bouton { display: inline-flex; align-items: center; gap: 0.4rem; }
.pistes-bouton b {
  background: var(--or); color: var(--sur-or); border-radius: 999px; min-width: 1.25rem; height: 1.25rem;
  display: inline-grid; place-items: center; font-size: 0.72rem; padding: 0 0.3rem;
}

.pistes {
  position: absolute; z-index: 4; top: 0; left: 0; bottom: 0; width: min(400px, 100%);
  background: var(--surface); border-right: 1px solid var(--filet);
  backdrop-filter: blur(14px);
  display: flex; flex-direction: column; gap: 0.8rem; overflow: hidden;
  padding: 1rem 1.1rem 0;
}
.pistes-titre { font-size: 1.3rem; font-weight: 800; flex: 1; }
.pistes-saisie { display: flex; flex-direction: column; gap: 0.5rem; }
.pistes-outils { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.pistes-outils .principal { margin-left: auto; }
.pistes-filtre select { padding: 0.35rem 0.6rem; font-size: 0.86rem; }
.pistes-corps {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
}
.pistes-liste { display: flex; flex-direction: column; gap: 0.7rem; }
.alerte-poids { padding-bottom: 0.8rem; color: var(--verrou); }

.piste-vignettes { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.piste-vignette { position: relative; }
.piste-vignette img {
  display: block; height: 4.5rem; width: auto; max-width: 8rem; object-fit: cover;
  border-radius: 8px; border: 1px solid var(--filet); cursor: zoom-in;
}
.piste-vignette.agrandie { width: 100%; }
.piste-vignette.agrandie img { height: auto; width: 100%; max-width: 100%; cursor: zoom-out; }
.piste-vignette button {
  position: absolute; top: 3px; right: 3px; width: 1.4rem; height: 1.4rem; padding: 0; border-radius: 50%;
  background: var(--surface-pleine); display: grid; place-items: center; line-height: 1;
}

.badge-rep {
  display: inline-grid; place-items: center; width: 1.25rem; height: 1.25rem; border-radius: 50%;
  background: var(--or); color: var(--sur-or); font-size: 0.8rem; font-weight: 800; flex: none;
}
.repere-brouillon { display: flex; align-items: center; gap: 0.5rem; font-size: 0.86rem; font-weight: 600; }
.repere-brouillon span:nth-child(2) { flex: 1; min-width: 0; }
.repere-lien {
  display: inline-flex; align-items: center; gap: 0.5rem; align-self: flex-start;
  background: none; border-color: var(--filet); font-weight: 600; max-width: 100%;
}

.piste {
  background: var(--creux); border: 1px solid var(--filet); border-radius: var(--rayon);
  padding: 0.7rem; display: flex; flex-direction: column; gap: 0.55rem;
}
.piste.validee { opacity: 0.75; }
.piste-tete { display: flex; align-items: center; gap: 0.5rem; }
.piste-n { font-weight: 800; }
.piste-etat { font-size: 0.82rem; font-weight: 600; flex: 1; }
.croix { width: 1.1rem; height: 1.1rem; border: 2px solid var(--filet-fort); border-radius: 4px; position: relative; flex: none; }
.croix.traitee, .croix.validee { border-color: currentColor; }
.croix.traitee { color: var(--application-f); }
.croix.validee { color: var(--texte); }
.croix.traitee::before, .croix.traitee::after, .croix.validee::before, .croix.validee::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 120%; height: 2px; background: currentColor;
}
.croix.traitee::before, .croix.validee::before { transform: translate(-50%, -50%) rotate(45deg); }
.croix.traitee::after, .croix.validee::after { transform: translate(-50%, -50%) rotate(-45deg); }
.piste-reponse {
  margin: 0; padding: 0.5rem 0.7rem; border-left: 3px solid var(--application-f); background: var(--creux);
  font-size: 0.88rem; display: flex; flex-direction: column; gap: 0.2rem;
}
.piste-actions { display: flex; justify-content: space-between; align-items: center; }

.barre-pointage {
  position: absolute; z-index: 6; top: 14px; left: 50%; transform: translateX(-50%);
  width: min(32rem, calc(100% - 28px));
  background: var(--surface-pleine); border: 1px solid var(--or); border-radius: var(--rayon);
  padding: 0.6rem 0.7rem 0.6rem 0.9rem; display: flex; align-items: center; gap: 0.7rem;
  box-shadow: 0 14px 40px -14px rgba(0, 0, 0, 0.6); font-weight: 600;
}
.barre-pointage span { flex: 1; }
.barre-pointage b { color: var(--or-vif); font-size: 1.2rem; }

@media (min-width: 900px) {
  body.fiche-ouverte .commandes { right: 434px; }
  body.pistes-ouvertes .lentille { left: 414px; }
}

@media (max-width: 899px) {
  .pistes {
    top: auto; left: 0; width: 100%; max-height: 66%;
    border-right: 0; border-top: 1px solid var(--filet-fort); border-radius: 18px 18px 0 0;
  }
  body.pistes-ouvertes .lentille, body.pistes-ouvertes .commandes { display: none; }
  .pistes-bouton span { display: none; }
  body.pointage-actif .fiche { display: none; }
}

/* ================= Lisibilite : noms et etiquettes ================= */

/* Un nom cache pour ne pas en couvrir un autre reparait des qu'on s'en approche. */
.astre.sans-nom .nom { display: none; }
.astre.sans-nom:hover .nom,
.astre.sans-nom.choisi .nom,
.astre.sans-nom:focus-visible .nom { display: inline; }

/* Les donnees echangees sur les liens ne se lisent qu'en zoomant, ou pour la brique visee. */
#ciel.dezoome .lien-texte:not(.actif) { display: none; }
