/* Harfang — ORGANISMES (conception atomique, niveau 3) : grandes parties de page (en-tête, bande de tir,
   bandeaux, défilés, encart abonnement, réglages, barre de partie, énigme, bilan, pied). Fiche CHARTE. */

/* ---------- en-tête ---------- */
.entete { position: sticky; top: 0; z-index: 10; background: var(--noir); color: #fff; }
.entete__ligne { display: flex; align-items: center; gap: 32px; height: 68px; }
.navigation { display: flex; gap: 28px; flex: 1; justify-content: flex-end; }   /* liens à droite, contre le bouton */
.navigation a { text-decoration: none; color: var(--argent); font-weight: 500; }
.navigation a:hover { color: #fff; }
@media (max-width: 680px) { .navigation { display: none; } .entete__ligne { justify-content: space-between; } }

/* ---------- bande de tir sous l'en-tête (5 octobre 2026, 2e version) ----------
   Le haut d'un tireur à genou dépasse tout à gauche ; en faisant défiler la page, la balle avance vers la
   droite et la bande se colore derrière elle, du gris foncé au gris clair (barre d'avancement de la page). */
.tir {
  position: relative;
  height: 19px;                   /* liseré compris : 18 px utiles, 2 px d'air au-dessus du casque, balle au milieu */
  border-top: 1px solid var(--or, #c7a23d);     /* fin liseré or entre l'en-tête et la bande */
  background: var(--noir, #0e0f12);
  pointer-events: none;           /* pas de overflow: hidden : l'éclat d'arrivée déborde de la bande */
}
.tir__remplissage {               /* la bande colorée derrière la balle */
  position: absolute; left: 0; top: 0; bottom: 0; right: 0;   /* toute la bande, découverte par clip-path */
  clip-path: inset(0 100% 0 0);
  background: linear-gradient(90deg, #1b1d22 0%, #2c2f36 25%, #6d727b 60%, #b9bec6 85%, #e9ebee 100%);
}
.tir__tireur {
  position: absolute; left: 6px; top: 2px;
  width: 32px; height: 16px;      /* moitié haute du dessin (8 rangées de 2 px) */
  image-rendering: pixelated;
  transition: transform 80ms ease-out;
}
.tir--recul .tir__tireur { transform: translateX(-2px); }
.tir__eclair {
  position: absolute; left: 37px; top: 4px;     /* au bout du canon (ligne de tir à 9 px) */
  width: 10px; height: 10px;
  opacity: 0;
}
.tir__balle {
  position: absolute; left: 0; top: 6.5px;      /* centre à 9 px */
  width: 10px; height: 5px;
  opacity: 0;
}
/* arrivée en bas de page (plus de cible) : gerbe de rayons dorés qui jaillit et s'évanouit, cœur lumineux
   qui gonfle puis reste comme marque d'impact ; centré sur la ligne de tir, 20 px avant le bord droit
   (plus près, les rayons sortaient de l'écran) */
.tir__eclat {
  position: absolute; right: 0; top: -11px;
  width: 40px; height: 40px;
  overflow: visible;
  opacity: 0;
}
.tir--touche .tir__eclat { opacity: 1; }
.tir__rayons, .tir__coeur { transform-box: fill-box; transform-origin: center; }
.tir__rayons { opacity: 0; }
.tir__eclat.joue .tir__rayons { animation: tir-rayons 520ms cubic-bezier(.15, .8, .3, 1) forwards; }
.tir__eclat.joue .tir__coeur { animation: tir-coeur 520ms ease-out forwards; }
@keyframes tir-rayons {
  0% { transform: scale(0.2) rotate(0deg); opacity: 1; }
  60% { opacity: 1; }
  100% { transform: scale(1.5) rotate(25deg); opacity: 0; }
}
@keyframes tir-coeur {
  0% { transform: scale(0); opacity: 1; }
  30% { transform: scale(1.6); opacity: 1; }
  100% { transform: scale(0.7); opacity: 0.95; }
}
@media (prefers-reduced-motion: reduce) {
  .tir__tireur { transition: none; }
  .tir__eclat.joue .tir__rayons { animation: none; }
  .tir__eclat.joue .tir__coeur { animation: none; transform: scale(0.7); }
}
/* l'en-tête grandit de la bande (68 + 19 = 87 px) : ce qui se colle dessous se décale d'autant */
body:has(.tir) .partie__barre { top: 87px; }
body:has(.tir) .enigme { scroll-margin-top: 139px; }
html:has(.tir) { scroll-padding-top: 87px; }   /* liens internes (#jeux…) : titre pas caché sous l'en-tête */

/* ---------- bandeau de l'accueil ---------- */
.bandeau { position: relative; background: var(--noir); color: #fff; }
.bandeau img { width: 100%; height: min(72vh, 640px); object-fit: cover; opacity: 0.85; }
.bandeau::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(14, 15, 18, 0.85) 0%, rgba(14, 15, 18, 0) 60%); }
.bandeau__texte { position: absolute; left: 0; right: 0; bottom: clamp(24px, 6vw, 64px); z-index: 1; }
.bandeau h1 { font-size: clamp(2.4rem, 6vw, 4.6rem); margin-bottom: 24px; text-shadow: 0 2px 20px rgba(0, 0, 0, 0.4); }

/* ---------- bandeau d'un jeu ---------- */
.tete-jeu { position: relative; background: var(--noir); color: #fff; }
.tete-jeu img { width: 100%; height: min(78vh, 680px); object-fit: cover; opacity: 0.8; }
.tete-jeu::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(14, 15, 18, 0.9) 0%, rgba(14, 15, 18, 0.45) 55%, rgba(14, 15, 18, 0) 100%); }
.tete-jeu__texte { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); z-index: 1; }
.tete-jeu h1 { font-size: clamp(3.4rem, 9vw, 7rem); line-height: 0.9; margin-bottom: 16px; }
.tete-jeu__chapo { max-width: 36ch; font-size: 1.15rem; color: #e6e8ec; margin: 0 0 24px; }
.tete-jeu__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 32px; }
@media (max-width: 640px) {
  .tete-jeu img { height: min(88vh, 640px); }
  .tete-jeu__texte { top: auto; bottom: 24px; transform: none; }
  .tete-jeu::after { background: linear-gradient(0deg, rgba(14, 15, 18, 0.92) 0%, rgba(14, 15, 18, 0.2) 75%); }
}

/* ---------- intro ---------- */
.intro { padding: 56px 0 8px; }
.intro p { font-family: var(--titre); font-size: clamp(1.4rem, 2.6vw, 2rem); line-height: 1.3; text-align: center; margin: 0; }
.intro em { color: var(--bleu); font-style: italic; }
@media (prefers-color-scheme: dark) { .intro em { color: var(--or-clair); } }

/* ---------- défilés horizontaux ---------- */
.defile { padding: 56px 0 64px; }
.defile--fonce { background: var(--bleu-fonce); color: #fff; }
.defile__tete { display: flex; align-items: end; justify-content: space-between; margin-bottom: 24px; }
.defile__tete h2 { font-size: clamp(2rem, 4vw, 3rem); }
.defile__fleches { display: flex; gap: 8px; }
.piste {
  list-style: none; margin: 0;
  display: flex; gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-left: var(--marge);
  padding: 4px var(--marge) 24px;          /* la première carte s'aligne sur le contenu, la dernière déborde */
  scrollbar-width: thin;
  scrollbar-color: var(--argent-fonce) transparent;
}

/* ---------- encart abonnement ---------- */
.plus {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: center;
  padding: 72px 0;
}
.plus h2 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 12px; }
.plus p { color: var(--encre-douce); margin: 0; }
.plus strong { color: var(--encre); }
.plus__actions { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
@media (max-width: 760px) { .plus { grid-template-columns: 1fr; } }

/* ---------- sections d'une page de jeu, réglages ---------- */
.section-jeu { padding: 64px 0 24px; }
.section-jeu h2, .reglages h2 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 28px; }
.reglages { background: var(--fond-alt); border-block: 1px solid var(--trait); padding: 64px 0; margin-top: 48px; }
.archives__note { color: var(--argent); margin-top: 8px; font-size: 0.9rem; }

/* ---------- barre d'état d'une partie ---------- */
.partie__barre { background: var(--bleu-fonce); color: #fff; position: sticky; top: 68px; z-index: 5; }
.partie__barre-ligne { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 24px; padding: 10px 0; }
.partie__barre p { margin: 0; }
.partie__progression { flex: 1; min-width: 0; }
.partie__progression span { color: var(--argent); font-size: 0.9rem; margin-left: 8px; }
.partie__score strong, .partie__chrono { font-family: var(--titre); font-size: 1.5rem; color: var(--or-clair); }
.partie__chrono--fin { color: var(--rouge-chrono); }
.partie__message { margin-top: 24px; padding: 14px 18px; background: var(--fond-alt); border-left: 3px solid var(--or); }

/* ---------- énigme (tête de manche) ---------- */
.enigme { padding: 28px 0 56px; scroll-margin-top: 120px; }
.enigme__tete { margin-bottom: 18px; }
.enigme__question { font-size: clamp(2rem, 4.5vw, 3.2rem); margin-bottom: 8px; }
.enigme__aide { color: var(--encre-douce); margin: 0; }

/* ---------- relais (duel), bilan ---------- */
.relais, .bilan { padding: 64px 0 80px; }
.relais h2, .bilan h2 { font-size: clamp(2.2rem, 5vw, 3.6rem); margin-bottom: 14px; }
.bilan__score { font-family: var(--titre); font-size: 1.8rem; color: var(--bleu); margin: 0 0 20px; }
@media (prefers-color-scheme: dark) { .bilan__score { color: var(--or-clair); } }
.bilan__liste { color: var(--encre-douce); padding-left: 20px; }
.bilan__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* ---------- pied ---------- */
.pied { background: var(--noir); color: var(--argent); padding: 44px 0; font-size: 0.9rem; position: relative; }
.pied::before { content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 1px; background: #fff; }   /* fin liseré blanc, un peu sous le haut du pied (visible en thème clair comme en sombre) */
.pied__grille { display: grid; grid-template-columns: 1fr auto; gap: 8px 32px; align-items: baseline; }
.pied__grille .marque { grid-column: 1 / -1; }   /* logo seul sur sa ligne ; devise et liens alignés dessous */
.pied p { margin: 0; }
.pied .marque { color: #fff; font-size: 1.6rem; }
.pied .marque__logo { width: 30px; height: 30px; }
.pied nav { display: flex; gap: 20px; flex-wrap: wrap; }
.pied nav a { text-decoration: none; }
.pied nav a:hover { color: #fff; text-decoration: underline; }
.pied__sources { grid-column: 1 / -1; font-size: 0.8rem; color: var(--argent-fonce); }
@media (max-width: 640px) { .pied__grille { grid-template-columns: 1fr; } }
