/* XRP Rainbow — mise en page propre au site. Les composants viennent de pupitre.css. */

@font-face {
  font-family: "Sofia Sans Extra Condensed";
  font-style: normal;
  font-weight: 800 900;
  font-display: swap;
  src: url("fonts/sofia-sans-extra-condensed-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Rubik";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/rubik-latin.woff2") format("woff2");
}

:root { --bande-alpha: .92; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bande-alpha: .8; } }
:root[data-theme="dark"] { --bande-alpha: .8; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { overflow-x: clip; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.page { max-width: 1240px; margin: 0 auto; padding-inline: var(--espace-4); display: grid; gap: var(--espace-8); }
.pp-barre { max-width: 1240px; margin: 0 auto; }
.pp-barre > span { color: var(--encre-2); font-weight: 600; }

/* En-tête : le nom est plus long que « Réseau », on le réduit un peu pour garder l'objet dans la page */
.pp-entete__nom { font-size: clamp(84px, 16vw, 208px); }
.pp-entete__actions .pp-voyant { color: var(--encre-2); }

/* Bande sombre : la zone du jour en très grand, puis les mesures */
.zone { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 440px); gap: var(--espace-6) var(--espace-8); align-items: end; }
.zone__nom { margin: 0; font: 900 clamp(60px, 8.4vw, 112px)/.84 var(--font-affiche); text-transform: uppercase; text-wrap: balance; color: var(--sur-nuit); }
.arc { display: grid; gap: var(--espace-3); }
.arc__jauge { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 5px; height: 22px; }
.arc__jauge i { border-radius: var(--rayon-pilule); box-shadow: inset 0 0 0 2.5px var(--c); }
.arc__jauge i.on { background: var(--c); box-shadow: 0 0 0 3px var(--nuit), 0 0 0 5.5px var(--sur-nuit); }
.arc__bouts { display: flex; justify-content: space-between; gap: var(--espace-3); font: 600 14px/20px var(--font-texte); color: var(--sur-nuit); }
.arc__bouts span:first-child, .arc__bouts span:last-child { opacity: .7; }
@media (max-width: 860px) { .zone { grid-template-columns: minmax(0, 1fr); } }

/* Graphique */
.outils-graphique { display: flex; flex-wrap: wrap; align-items: center; gap: var(--espace-3) var(--espace-4); }
.choix { position: relative; display: inline-flex; align-items: center; gap: var(--espace-2); font: 600 14px/18px var(--font-texte); }
.choix select {
  -webkit-appearance: none; appearance: none; height: 42px; padding: 0 38px 0 18px;
  border: var(--trait) solid var(--encre); border-radius: var(--rayon-pilule);
  background: var(--blanc); color: var(--encre); font: 600 14px/18px var(--font-texte); cursor: pointer;
}
.choix::after { content: "↓"; position: absolute; right: 16px; pointer-events: none; font-weight: 700; }
.graphique { position: relative; height: clamp(380px, 64vh, 680px); touch-action: pan-y; }
.graphique canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#overlay { cursor: crosshair; border-radius: var(--rayon-m); }
.graphique-pied { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: var(--espace-3) var(--espace-6); }
.legende { display: flex; flex-wrap: wrap; gap: 6px 16px; font: 500 13px/18px var(--font-texte); }
.legende span { display: inline-flex; align-items: center; gap: 7px; }
.legende i { width: 16px; height: 10px; border-radius: var(--rayon-pilule); flex: none; }
.legende i.trait { height: 3px; background: var(--encre); }
.legende i.trait.fin { height: 2px; opacity: .5; }
.astuce { font: 500 13px/18px var(--font-texte); color: var(--encre-2); }
.astuce .tactile { display: none; }
@media (hover: none) { .astuce .souris { display: none; } .astuce .tactile { display: inline; } }

/* Bulle de survol : une carte sombre qui flotte */
.bulle {
  position: absolute; top: 0; left: 0; z-index: 2; pointer-events: none;
  width: 300px; max-width: calc(100% - 8px); padding: 16px 18px;
  border-radius: var(--rayon-m); background: var(--nuit); color: var(--sur-nuit); box-shadow: var(--ombre-flottant);
  display: grid; gap: 6px; font: 500 14px/20px var(--font-texte);
}
.bulle__date { font: 700 12px/16px var(--font-texte); letter-spacing: .06em; text-transform: uppercase; opacity: .8; }
.bulle__date::before { content: "( "; }
.bulle__date::after { content: " )"; }
.bulle__prix { margin: 4px 0 2px; font: 900 48px/.84 var(--font-affiche); font-variant-numeric: tabular-nums; }
.bulle__bande { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.bulle i { width: 12px; height: 12px; border-radius: var(--rayon-pilule); flex: none; }
.bulle__bandes { list-style: none; margin: 6px 0 0; padding: 10px 0 0; border-top: 2px solid; border-color: inherit; display: grid; gap: 1px; }
.bulle__bandes { border-top-color: rgba(250, 242, 240, .22); }
.bulle__bandes li { display: flex; align-items: center; gap: 8px; font-size: 13px; line-height: 19px; opacity: .72; }
.bulle__bandes li .n { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bulle__bandes li .v { font-variant-numeric: tabular-nums; }
.bulle__bandes li.on { opacity: 1; font-weight: 700; }
@media (max-width: 560px) { .bulle__bandes { display: none; } .bulle { width: 220px; } }

/* Tableau des bandes */
.pastille-bande { display: inline-block; width: 18px; height: 18px; border-radius: var(--rayon-pilule); flex: none; }
.nom-bande { display: inline-flex; align-items: center; gap: var(--espace-3); font-weight: 600; }
.pp-tableau tr.actuelle td { background: var(--famille); }
.pp-tableau .pp-pastille { margin-left: var(--espace-2); }
.note { margin: 0; color: var(--encre-2); max-width: var(--largeur-texte); }

/* Modèle */
.colonnes { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--espace-4); align-items: start; }
@media (max-width: 960px) { .colonnes { grid-template-columns: minmax(0, 1fr); } }
.texte-modele { display: grid; gap: var(--espace-4); max-width: var(--largeur-texte); }
.texte-modele p { margin: 0; }
.champs { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--espace-6) var(--espace-4); }
.curseur { display: flex; align-items: center; gap: var(--espace-3); height: var(--hauteur-touche); padding: 0 20px; border: var(--trait) solid var(--encre); border-radius: var(--rayon-pilule); background: var(--blanc); }
.curseur input[type="range"] {
  -webkit-appearance: auto; appearance: auto; flex: 1; width: auto; min-width: 0; height: auto;
  padding: 0; border: 0; border-radius: 0; background: none; accent-color: var(--rouge);
}
.curseur output { min-width: 4.5ch; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.equation {
  margin: 0; padding: 16px 20px; border-radius: var(--rayon-m); background: var(--blanc);
  font: 500 14px/22px var(--font-texte); font-variant-numeric: tabular-nums; overflow-x: auto; white-space: nowrap;
}
.equation span { display: block; }
.equation span:first-child { font-weight: 700; }
.equation span + span { color: var(--encre-2); }
.erreur { margin: 0; font-weight: 600; color: var(--rouge-texte); }

/* Pied de page */
.pied { display: grid; gap: var(--espace-3); padding-top: var(--espace-8); }
.pied p { margin: 0; max-width: 80ch; color: var(--encre-2); }
