/* ══════════════════════════════════════════════════════════════════════════════
   BOUSSOLE — habillage premium (2026-10-25), même univers que Ciel en Direct.
   Couche visuelle chargée après constella-ciel-direct.css. Sélecteurs préfixés
   « html » : les styles intégrés à constella.html arrivent après les <link>.
   Le cap affiché vient UNIQUEMENT du capteur (constella.inline-5.js).
   ══════════════════════════════════════════════════════════════════════════════ */
html #compass-section{
  --cb-cosmic:#0b1030;
  --cb-indigo:#151339;
  --cb-gold:#e8c36a;
  --cb-gold-hi:#ffd979;
  --cb-gold-old:#c9a24a;
  --cb-silver:#dde4f4;
  --cb-ink:#e9e1f4;
  --cb-ink-dim:#b4a9cf;
  --cb-glass:rgba(24,22,64,.55);
  position:relative;isolation:isolate;max-width:660px;padding:40px 26px 84px;border-radius:28px;
}
html #compass-section::before{
  content:"";position:absolute;inset:0;z-index:-2;border-radius:inherit;pointer-events:none;
  background:
    radial-gradient(circle at 50% 36%, rgba(255,217,121,.16) 0%, rgba(232,195,106,.07) 22%, rgba(232,195,106,0) 42%),
    radial-gradient(ellipse 60% 38% at 12% 20%, rgba(123,79,214,.40), rgba(123,79,214,0) 72%),
    radial-gradient(ellipse 52% 34% at 90% 46%, rgba(63,110,230,.32), rgba(63,110,230,0) 70%),
    radial-gradient(ellipse 56% 34% at 26% 84%, rgba(150,80,200,.24), rgba(150,80,200,0) 70%),
    linear-gradient(180deg, var(--cb-cosmic) 0%, var(--cb-indigo) 48%, #100d2c 100%);
}
/* Ciel : poussières d'or, étoiles, une constellation (Petite Ourse : la Polaire en tête) */
html #compass-section .cmp-sky{position:absolute;inset:0;z-index:-1;pointer-events:none;overflow:hidden;border-radius:inherit;}
html #compass-section .cmp-sky i{position:absolute;width:2px;height:2px;border-radius:50%;background:#fff3d2;box-shadow:0 0 6px 1px rgba(255,230,170,.65);opacity:.35;}
html #compass-section .cmp-sky i:nth-child(1){left:7%;top:7%}
html #compass-section .cmp-sky i:nth-child(2){left:19%;top:26%;background:#e2e8ff;box-shadow:0 0 6px 1px rgba(190,205,255,.7)}
html #compass-section .cmp-sky i:nth-child(3){left:5%;top:52%}
html #compass-section .cmp-sky i:nth-child(4){left:14%;top:78%;width:3px;height:3px}
html #compass-section .cmp-sky i:nth-child(5){left:30%;top:93%}
html #compass-section .cmp-sky i:nth-child(6){left:70%;top:5%;background:#e2e8ff;box-shadow:0 0 6px 1px rgba(190,205,255,.7)}
html #compass-section .cmp-sky i:nth-child(7){left:88%;top:14%}
html #compass-section .cmp-sky i:nth-child(8){left:95%;top:38%;width:3px;height:3px}
html #compass-section .cmp-sky i:nth-child(9){left:84%;top:66%;background:#e2e8ff;box-shadow:0 0 6px 1px rgba(190,205,255,.7)}
html #compass-section .cmp-sky i:nth-child(10){left:74%;top:90%}
html #compass-section .cmp-sky i:nth-child(11){left:50%;top:97%}
html #compass-section .cmp-sky i:nth-child(12){left:96%;top:82%}
html #compass-section .cmp-sky i:nth-child(13){left:40%;top:3%;opacity:.25}
html #compass-section .cmp-sky i:nth-child(14){left:3%;top:34%}
html #compass-section .cmp-sky svg{position:absolute;right:4%;top:3%;width:150px;height:auto;opacity:.55}

/* ── En-tête ── */
html #compass-section .cmp-title{
  font-size:clamp(30px,8vw,44px);letter-spacing:.34em;
  background:linear-gradient(180deg,#fff4cf 0%,var(--cb-gold-hi) 46%,#d3a43c 100%);
  -webkit-background-clip:text;background-clip:text;color:transparent;
  text-shadow:none;filter:drop-shadow(0 0 22px rgba(255,214,110,.35));
}
html #compass-section .cmp-eyebrow{color:var(--cb-ink-dim);letter-spacing:.3em;font-size:11.5px;}
html #compass-section .cmp-eyebrow::after{content:"";display:block;width:120px;height:1px;margin:14px auto 0;background:linear-gradient(90deg,transparent,var(--cb-gold),transparent);}

/* Cap en degrés : la lecture principale */
html #compass-section .cmp-readout{
  flex-direction:column;align-items:center;gap:2px;margin-top:18px;padding:12px 30px 10px;border-radius:22px;
  border:1px solid rgba(232,195,106,.45);
  background:linear-gradient(180deg,rgba(52,40,100,.62),rgba(20,18,58,.66));
  box-shadow:0 0 30px rgba(123,79,214,.22), inset 0 1px 0 rgba(255,236,190,.10);
}
html #compass-section .cmp-readout-deg{
  font-size:clamp(34px,10vw,46px);line-height:1.05;
  background:linear-gradient(180deg,#fff7d6 0%,var(--cb-gold-hi) 50%,#cf9d34 100%);
  -webkit-background-clip:text;background-clip:text;color:transparent;
  text-shadow:none;filter:drop-shadow(0 0 14px rgba(255,214,110,.45));
}
html #compass-section .cmp-readout-sep{display:none;}
html #compass-section .cmp-readout-dir{color:#e6d9b8;font-size:12px;letter-spacing:.24em;}
html #compass-section.aligned .cmp-readout{border-color:var(--cb-gold-hi);box-shadow:0 0 38px rgba(255,217,121,.42), inset 0 1px 0 rgba(255,236,190,.14);}

/* ── États du capteur ── */
html #compass-section .cmp-status{
  display:flex;align-items:flex-start;gap:10px;max-width:440px;margin:14px auto 16px;padding:12px 16px;
  border-radius:14px;border:1px solid rgba(180,169,207,.28);background:var(--cb-glass);
  -webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);
  font-style:normal;font-size:15.5px;line-height:1.45;color:var(--cb-ink);text-align:left;
}
html #compass-section .cmp-status:empty{display:none;}
html #compass-section .cmp-status::before{
  content:"";flex:0 0 10px;height:10px;margin-top:6px;border-radius:50%;background:var(--cb-ink-dim);
}
html #compass-section[data-cmp-state="live"] .cmp-status{border-color:rgba(232,195,106,.45);color:#f3e2b8;}
html #compass-section[data-cmp-state="live"] .cmp-status::before{background:#7ee0a4;box-shadow:0 0 10px rgba(126,224,164,.8);}
html #compass-section[data-cmp-state="waiting"] .cmp-status::before,
html #compass-section[data-cmp-state="perm"] .cmp-status::before{background:var(--cb-gold-hi);box-shadow:0 0 10px rgba(255,217,121,.7);}
html #compass-section[data-cmp-state="calibrate"] .cmp-status{border-color:rgba(255,190,110,.5);}
html #compass-section[data-cmp-state="calibrate"] .cmp-status::before{background:#ffb86b;box-shadow:0 0 10px rgba(255,184,107,.8);}
html #compass-section[data-cmp-state="relative"] .cmp-status::before,
html #compass-section[data-cmp-state="unavailable"] .cmp-status::before,
html #compass-section[data-cmp-state="denied"] .cmp-status::before,
html #compass-section[data-cmp-state="insecure"] .cmp-status::before{background:#ff8f8f;box-shadow:0 0 10px rgba(255,143,143,.6);}
/* sans cap fiable : on ne montre pas de faux alignement */
html #compass-section:not([data-cmp-state="live"]):not([data-cmp-state="calibrate"]) .cmp-readout-deg{opacity:.55;}

/* Boutons lumineux */
html #compass-section .cmp-btn{
  background:linear-gradient(135deg,#3a2a8a 0%,#5b3bc4 55%,#3a2a8a 100%);
  border:1px solid var(--cb-gold);color:#fff3cf;font-size:12.5px;letter-spacing:.2em;
  padding:14px 34px;border-radius:14px;min-height:48px;
  box-shadow:0 0 22px rgba(123,79,214,.35), inset 0 1px 0 rgba(255,236,190,.18);
}
html #compass-section .cmp-btn:hover{box-shadow:0 0 30px rgba(255,217,121,.35), inset 0 1px 0 rgba(255,236,190,.22);}
html #compass-section .cmp-btn:focus-visible{outline:2px solid var(--cb-gold-hi);outline-offset:3px;}

/* ── Instrument ── */
html #compass-section .cmp-stage{margin:10px auto 26px;}
html #compass-section .cmp-stage::before{
  content:"";position:absolute;left:50%;top:50%;width:min(110vw,560px);aspect-ratio:1/1;transform:translate(-50%,-50%);
  border-radius:50%;pointer-events:none;z-index:-1;
  background:radial-gradient(circle, rgba(255,217,121,.20) 0%, rgba(232,195,106,.08) 38%, rgba(123,79,214,.12) 56%, rgba(11,16,48,0) 70%);
}
html #compass-section #compass-svg{width:100%;max-width:470px;height:auto;aspect-ratio:1/1;display:block;margin:0 auto;}
html #compass-section .cmp-sheen{stroke-dasharray:70 1118;stroke-dashoffset:0;}

/* ── Cartes de direction ── */
html #compass-section .cmp-cards{gap:10px;max-width:460px;}
html #compass-section .cmp-card{
  display:flex;flex-direction:column;align-items:center;gap:4px;padding:14px 6px 12px;border-radius:14px;
  border:1px solid rgba(232,195,106,.40);
  background:linear-gradient(180deg,rgba(44,36,100,.66),rgba(20,18,58,.70));
  box-shadow:inset 0 1px 0 rgba(255,236,190,.08), 0 8px 22px rgba(5,4,20,.38);
}
html #compass-section .cmp-card-ico{width:22px;height:22px;color:var(--cb-gold);}
html #compass-section .cmp-card[data-dir="N"] .cmp-card-dir{color:var(--cb-gold-hi);}
html #compass-section .cmp-card[data-dir="S"] .cmp-card-dir{color:var(--cb-gold-old);}
html #compass-section .cmp-card[data-dir="E"] .cmp-card-dir,
html #compass-section .cmp-card[data-dir="O"] .cmp-card-dir{color:var(--cb-silver);}
html #compass-section .cmp-card-dir{font-size:20px;}
html #compass-section .cmp-card-deg{color:#c2b6dc;font-size:14.5px;font-variant-numeric:tabular-nums;}
html #compass-section .cmp-card.active{
  border-color:var(--cb-gold-hi);transform:translateY(-2px);
  background:linear-gradient(180deg,rgba(92,68,40,.58),rgba(32,26,72,.72));
  box-shadow:0 0 24px rgba(255,217,121,.32), inset 0 1px 0 rgba(255,236,190,.16);
}
html #compass-section .cmp-hint{color:var(--cb-ink-dim);font-size:15px;max-width:440px;margin-left:auto;margin-right:auto;}

/* ── Carte « Mission Boussole » ── */
html #compass-section .cmp-mission{
  border-radius:22px;padding:26px 26px 24px;margin-top:30px;
  border:1px solid transparent;
  background:
    linear-gradient(165deg,rgba(40,32,96,.72),rgba(18,16,56,.78)) padding-box,
    linear-gradient(135deg,rgba(255,217,121,.65),rgba(123,79,214,.65),rgba(255,217,121,.35)) border-box;
  -webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);
  box-shadow:0 14px 40px rgba(5,4,20,.45), 0 0 30px rgba(123,79,214,.18);
}
html #compass-section .cmp-mission-head{font-size:15px;letter-spacing:.24em;color:var(--cb-gold-hi);}
html #compass-section .cmp-mission-head::after{content:"";display:block;width:90px;height:1px;margin:12px 0 0;background:linear-gradient(90deg,var(--cb-gold),transparent);}
html #compass-section .cmp-mission-text{font-size:17px;color:var(--cb-ink);line-height:1.55;}
html #compass-section .cmp-mission-reward{color:#f3d98a;}
html #compass-section .cmp-btn-mission{width:100%;}

/* ── Mouvement : seulement si accepté ── */
@media (prefers-reduced-motion:no-preference){
  html #compass-section .cmp-sky i{animation:cbTwinkle 5.5s ease-in-out infinite;}
  html #compass-section .cmp-sky i:nth-child(3n){animation-duration:7s;animation-delay:-2s}
  html #compass-section .cmp-sky i:nth-child(3n+1){animation-duration:4.4s;animation-delay:-1s}
  html #compass-section .cmp-stage::before{animation:cbBreath 9s ease-in-out infinite;}
  html #compass-section .cmp-sheen{animation:cbSheen 11s linear infinite;}
}
@keyframes cbTwinkle{0%,100%{opacity:.18}50%{opacity:.95}}
@keyframes cbBreath{0%,100%{opacity:.75}50%{opacity:1}}
@keyframes cbSheen{to{stroke-dashoffset:-1188}}

/* ── Téléphone ── */
@media (max-width:620px){
  html #compass-section{padding:26px 12px 72px;border-radius:20px;}
  html #compass-section .cmp-title{letter-spacing:.2em;}
  html #compass-section .cmp-stage{margin-left:0;margin-right:0;}
  html #compass-section .cmp-cards{gap:7px;}
  html #compass-section .cmp-card{padding:12px 2px 10px;}
  html #compass-section .cmp-card-dir{font-size:18px;}
  html #compass-section .cmp-sky svg{width:110px;opacity:.4}
  html #compass-section .cmp-mission{padding:22px 18px 20px;}
  html #compass-section .cmp-mission-head{letter-spacing:.14em;font-size:14px;}
}
@media (max-width:360px){
  html #compass-section .cmp-cards{grid-template-columns:repeat(4,1fr);max-width:none;}
}
