
#moteur-genius {
  --mg-fond: #0A0C10;
  --mg-texte: var(--texte, #F2F0EB);
  --mg-doux: var(--doux, #A3A4AA);
  --mg-discret: var(--discret, #7D7F85);
  --mg-jaune: var(--jaune, #F5C21B);
  --mg-titre: var(--titre, "Barlow Condensed", "Arial Narrow", Arial, sans-serif);
  --mg-corps: var(--corps, "Barlow", "Segoe UI", Arial, sans-serif);
  --mg-gout: var(--gouttiere, clamp(16px, 4vw, 56px));
  
  --mg-nav: 60px;
  display: block;
  background: var(--mg-fond);
}
#moteur-genius *, #moteur-genius *::before, #moteur-genius *::after { box-sizing: border-box; }

.mg { position: relative; background: var(--mg-fond); color: var(--mg-texte); font-family: var(--mg-corps); }

.mg-piste { position: relative; height: 290vh; }
.mg-scene {
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(8px, 1.5vh, 16px);
  padding: clamp(12px, 2.6vh, 30px) var(--mg-gout);
  padding-top: calc(var(--mg-nav) + clamp(8px, 1.8vh, 20px));
  overflow: hidden;
}

.mg-titre {
  flex: 0 0 auto; margin: 0; text-align: center;
  font-family: var(--mg-titre); font-weight: 700; font-size: clamp(30px, 3.6vw, 50px); line-height: 1; letter-spacing: .01em;
  color: var(--mg-texte);
}


.mg-cadre { position: relative; flex: 1 1 auto; width: 100%; min-height: 0; }
.mg-fixe, .mg-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.mg-fixe { object-fit: contain; transition: opacity .35s ease; }

.mg-fixe:not([src]) { visibility: hidden; }
.mg.pret .mg-fixe { opacity: 0; }
.mg.reduit .mg-fixe { opacity: 1; transition: none; }
.mg.reduit .mg-canvas { display: none; }


.mg-mots { position: absolute; inset: 0; pointer-events: none; }
.mg-mot { position: absolute; width: 0; height: 0; margin: 0; opacity: 0; transition: opacity .5s ease; }
.mg-mot.vu { opacity: 1; }
.mg.reduit .mg-mot { transition: none; }
.mg-point {
  position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--mg-jaune);
  box-shadow: 0 0 0 4px rgba(245, 194, 27, .16), 0 0 16px rgba(245, 194, 27, .55);
}
.mg-filet { position: absolute; top: -.5px; height: 1px; width: 30px; background: rgba(245, 194, 27, .75); }
.mg-mot.a-droite .mg-filet { left: 9px; }
.mg-mot.a-gauche .mg-filet { right: 9px; }
.mg-mot span {
  position: absolute; top: 0; transform: translateY(-52%);
  white-space: nowrap;
  font-family: var(--mg-titre); font-weight: 600; letter-spacing: .05em;
  font-size: clamp(17px, 1.65vw, 25px); line-height: 1;
  color: var(--mg-texte);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .9), 0 0 18px rgba(0, 0, 0, .95);
}
.mg-mot.a-droite span { left: 46px; }
.mg-mot.a-gauche span { right: 46px; }

.mg-mot.a-haut .mg-filet, .mg-mot.a-bas .mg-filet { left: -.5px; width: 1px; height: 24px; }
.mg-mot.a-haut .mg-filet { top: auto; bottom: 9px; }
.mg-mot.a-bas .mg-filet { top: 9px; }
.mg-mot.a-haut span { left: 0; top: -38px; transform: translate(-50%, -100%); }
.mg-mot.a-bas span { left: 0; top: 38px; transform: translate(-50%, 0); }


.mg-domaines { list-style: none; margin: 0; padding: 0; }
.mg-domaine {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 13px 6px 11px;
  border: 1px solid rgba(242, 240, 235, .10); border-radius: 999px;
  background: rgba(11, 12, 15, .6);
  font: 500 clamp(13px, 1vw, 15px)/1.1 var(--mg-corps); letter-spacing: .01em; white-space: nowrap;
  color: var(--mg-discret);
  transition: color .5s ease, border-color .5s ease;
}
.mg-domaine i { flex: none; width: 7px; height: 7px; border-radius: 50%; background: rgba(242, 240, 235, .22); transition: background-color .5s ease, box-shadow .5s ease; }
.mg-domaine.allume { color: var(--mg-texte); border-color: rgba(245, 194, 27, .45); }
.mg-domaine.allume i { background: var(--mg-jaune); box-shadow: 0 0 10px rgba(245, 194, 27, .75); }
.mg.reduit .mg-domaine, .mg.reduit .mg-domaine i { transition: none; }


@media (min-width: 901px) {
  .mg-domaines {
    position: absolute; left: var(--mg-gout); right: var(--mg-gout);
    display: grid; grid-template-columns: var(--mg-libre, 220px) 1fr var(--mg-libre, 220px);
    grid-auto-flow: row dense; align-content: center; row-gap: clamp(10px, 2.2vh, 24px);
    pointer-events: none;
  }
  .mg-domaine:nth-child(odd) { grid-column: 1; justify-self: end; }
  .mg-domaine:nth-child(even) { grid-column: 3; justify-self: start; }
}


.mg-bas { flex: 0 0 auto; width: 100%; max-width: 980px; display: flex; flex-direction: column; align-items: center; gap: clamp(8px, 1.3vh, 14px); text-align: center; }
.mg-legende { margin: 0; font-family: var(--mg-titre); font-weight: 500; font-size: clamp(19px, 1.9vw, 26px); line-height: 1.15; letter-spacing: .01em; color: var(--mg-doux); }
.mg-bouton {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 10px 20px 10px 16px;
  font: 600 15px/1 var(--mg-corps); letter-spacing: .01em;
  color: var(--mg-texte); background: transparent;
  border: 1px solid rgba(245, 194, 27, .75); border-radius: 999px;
  cursor: pointer;
  transition: background-color .25s ease, color .25s ease;
}
.mg-bouton::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--mg-jaune); box-shadow: 0 0 10px rgba(245, 194, 27, .7); }
.mg-bouton:hover { background: rgba(245, 194, 27, .12); }
.mg-bouton:focus-visible { outline: 2px solid var(--mg-texte); outline-offset: 3px; }
.mg-mention { margin: 0; font-size: 11px; line-height: 1.3; color: var(--mg-discret); }


@media (max-width: 900px) {
  .mg-domaines { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; width: 100%; max-width: 620px; }
  .mg-domaine { justify-content: flex-start; gap: 6px; padding: 6px 8px; font-size: 12.5px; white-space: normal; text-wrap: balance; }
}
@media (max-width: 760px) {
  .mg-piste { height: 260vh; }
  .mg-scene { gap: 10px; padding-top: calc(var(--mg-nav) + 8px); padding-bottom: 12px; }
  .mg-titre { font-size: 30px; }
  
  .mg-cadre { flex: 0 0 auto; width: min(100vw, 56svh); margin: 0 calc(-1 * var(--mg-gout)); aspect-ratio: 900 / 803; }
  .mg-domaines { gap: 6px; }
  .mg-domaine { padding: 5px 7px; font-size: 11.5px; gap: 5px; }
  .mg-domaine i { width: 6px; height: 6px; }
  .mg-legende { font-size: 18px; max-width: 20em; }
  .mg-mot span { font-size: 16px; }
  .mg-filet { width: 18px; }
  .mg-mot.a-haut .mg-filet, .mg-mot.a-bas .mg-filet { width: 1px; height: 16px; }
  .mg-mot.a-haut span { top: -28px; }
  .mg-mot.a-bas span { top: 28px; }
  .mg-mot.a-droite span { left: 32px; }
  .mg-mot.a-gauche span { right: 32px; }
}
@media (max-width: 760px) and (max-height: 720px) {
  .mg-legende { display: none; }
  .mg-titre { font-size: 26px; }
  .mg-cadre { width: min(100vw, 50svh); }
  .mg-domaine { padding: 4px 6px; font-size: 11px; }
}
