/* Univers Dofus Retro (05/11/2026) : art officiel partout. Composants de gabarits/composants/univers.njk (médaillons d'objets,
   en-tête sur capture, vitrine du client natif, cartes postales des zones, bestiaire défilant, frise des Dofus, atouts, duel,
   questions, visages). Contrat docs/MOUVEMENT.md : états masqués seulement sous html.js, transform et opacity seuls animés,
   html.sans-mouvement = tout statique. Une classe = ce fichier seul. */

/* ---------- Médaillons : une icône officielle sur un disque de parchemin cerclé de bois ---------- */
.medaillon {
  display: inline-grid; place-items: center; flex: none; border-radius: 50%; box-sizing: content-box; padding: 4px;
  background: radial-gradient(circle at 35% 30%, #fff8e6 0%, var(--parchemin) 55%, var(--parchemin-3) 100%);
  box-shadow: inset 0 0 0 1px var(--filet), 0 0 0 2px var(--bois), 0 2px 4px rgba(0, 0, 0, 0.45);
}
.medaillon img { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 1px 1px rgba(60, 30, 5, 0.35)); }
.medaillon--24 { width: 18px; height: 18px; padding: 3px; }
.medaillon--32 { width: 24px; height: 24px; }
.medaillon--36 { width: 28px; height: 28px; }
.medaillon--40 { width: 30px; height: 30px; padding: 5px; }
.medaillon--56 { width: 44px; height: 44px; padding: 6px; }
/* Icônes officielles passées à v.ico (navigation, pied) : même médaillon, sans balise en plus. */
.ico[src^='/jeu/'] {
  box-sizing: border-box; padding: 3px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff8e6 0%, var(--parchemin) 55%, var(--parchemin-3) 100%);
  box-shadow: inset 0 0 0 1px var(--filet), 0 0 0 2px var(--bois), 0 1px 3px rgba(0, 0, 0, 0.5);
  filter: none;
}
.entete .nav__liste a .ico[src^='/jeu/'], .entete .nav__sous .ico[src^='/jeu/'] { width: 28px; height: 28px; }
.entete .nav__liste a:hover .ico[src^='/jeu/'], .entete .nav__liste a[aria-current='page'] .ico[src^='/jeu/'], .nav__sous a:hover .ico[src^='/jeu/'] { box-shadow: inset 0 0 0 1px var(--filet), 0 0 0 2px var(--or), 0 0 10px rgba(241, 205, 122, 0.6); }
.pied .ico[src^='/jeu/'] { width: 24px; height: 24px; margin-right: 8px; padding: 2px; }
.menu-mobile .nav__liste a .ico[src^='/jeu/'] { width: 36px; height: 36px; }

/* ---------- En-tête de page sur une capture nette ---------- */
.entete-page--capture { min-height: 300px; display: flex; align-items: flex-end; border-bottom-color: var(--or); }
.entete-page--capture .entete-page__image { object-position: 50% 45%; filter: saturate(1.05); }
.entete-page--haut .entete-page__image { object-position: 50% 15%; }
.entete-page--bas .entete-page__image { object-position: 50% 85%; }
.entete-page--capture::after { background: linear-gradient(180deg, rgba(27, 18, 12, 0.15) 0%, rgba(27, 18, 12, 0.3) 45%, rgba(27, 18, 12, 0.92) 100%), linear-gradient(90deg, rgba(27, 18, 12, 0.55), transparent 60%); }
.entete-page--capture .page { padding-block: 70px 30px; }
.entete-page--capture h1 { margin-bottom: 0.15em; }
.entete-page--capture .entete-page__texte { font-size: 1.15rem; max-width: 40em; }

/* ---------- Vitrine du client natif ---------- */
.vitrine {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 34px; align-items: center; padding: 30px 32px;
  border: 3px solid var(--bois); border-radius: 12px; overflow: hidden;
  background: radial-gradient(ellipse 60% 80% at 85% 50%, rgba(226, 176, 74, 0.16), transparent 70%), var(--grain-sombre), linear-gradient(180deg, #33200f, #1d1107);
  box-shadow: var(--ombre), inset 0 0 0 1px var(--filet);
}
.vitrine::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: var(--ornement-coins); opacity: 0.8; }
.vitrine__texte { min-width: 0; color: var(--creme); }
.vitrine__sur { margin: 0 0 4px; font-family: var(--police-titre); font-size: 0.9rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--or); }
.vitrine__titre { margin: 0 0 10px; font-size: clamp(1.7rem, 3vw, 2.4rem); line-height: 1.12; }
.vitrine__accroche { margin: 0 0 16px; font-size: 1.1rem; color: #f3e8cd; }
.vitrine__points { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 10px; }
.vitrine__points li { display: flex; align-items: center; gap: 12px; }
.vitrine__points strong { display: block; color: var(--or-clair); font-family: var(--police-titre); letter-spacing: 0.03em; }
.vitrine__points span { font-size: 0.98rem; line-height: 1.4; }
.vitrine .actions { margin-top: 0; }
.vitrine__media { margin: 0; min-width: 0; }
.vitrine__cadre {
  position: relative; display: block; overflow: hidden; border: 4px solid var(--bois); border-radius: 10px; background: #1a110a;
  box-shadow: 0 0 0 1px var(--filet), 0 18px 40px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(255, 220, 150, 0.15);
  transform: perspective(1200px) rotateX(calc((var(--gy, 50) - 50) * -0.08deg)) rotateY(calc((var(--gx, 50) - 50) * 0.1deg));
  transition: transform 0.2s ease-out;
}
.vitrine__cadre img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9.3; object-fit: cover; }
.vitrine__reflet { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at calc(var(--gx, 50) * 1%) calc(var(--gy, 50) * 1%), rgba(255, 245, 210, 0.22), transparent 42%); mix-blend-mode: screen; }
.vitrine__bande { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 12px 0 0; padding: 0; list-style: none; }
.vitrine__bande a { display: block; overflow: hidden; border: 2px solid var(--bois); border-radius: 6px; box-shadow: 0 0 0 1px var(--filet), 0 4px 10px rgba(0, 0, 0, 0.5); background: #1a110a; }
.vitrine__bande img { display: block; width: 100%; aspect-ratio: 16 / 9.3; object-fit: cover; transition: transform 0.35s ease; }
.vitrine__bande a:hover img, .vitrine__bande a:focus-visible img { transform: scale(1.08); }
.vitrine__legende { margin: 10px 0 0; font-size: 0.9rem; color: #c9b894; text-align: right; font-style: italic; }

/* ---------- Cartes postales des zones ---------- */
.postales { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px 22px; list-style: none; margin: 0; padding: 10px 6px 14px; }
.postale { --r: 0deg; min-width: 0; }
.postale--0 { --r: -1.6deg; } .postale--1 { --r: 1.1deg; } .postale--2 { --r: -0.7deg; } .postale--3 { --r: 1.4deg; } .postale--4 { --r: -1.2deg; } .postale--5 { --r: 0.9deg; }
.postale__lien {
  position: relative; display: block; text-decoration: none; color: var(--encre); padding: 10px 10px 14px; border-radius: 6px;
  background: var(--grain-parchemin), linear-gradient(180deg, #fbf3df, var(--parchemin-2)); background-color: var(--parchemin);
  box-shadow: 0 0 0 1px var(--filet), 0 10px 22px rgba(0, 0, 0, 0.55), inset 0 0 0 3px #fff6e3;
  transform: rotate(var(--r)); transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.postale__lien:hover, .postale__lien:focus-visible { transform: rotate(0deg) translateY(-6px) scale(1.03); box-shadow: 0 0 0 1px var(--filet), 0 18px 34px rgba(0, 0, 0, 0.65), inset 0 0 0 3px #fff6e3; z-index: 2; }
.postale__image { display: block; width: 100%; aspect-ratio: 16 / 9.3; object-fit: cover; border: 1px solid var(--filet); background: #1a110a; }
.postale__etiquette { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 10px; padding: 0 2px; }
.postale__nom { font-family: var(--police-titre); font-size: 1.15rem; font-weight: 700; color: var(--bois); letter-spacing: 0.02em; white-space: nowrap; }
.postale__zone { flex: none; font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--encre-douce); white-space: nowrap; }
.postale__lien::after { /* timbre : sceau doré dans le coin */
  content: ''; position: absolute; right: -8px; top: -10px; width: 42px; height: 42px; background: url(/svg/ornements/sceau-or.svg) center / contain no-repeat;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5)); transform: rotate(12deg);
}

/* ---------- Bestiaire défilant ---------- */
.bestiaire {
  display: flex; overflow: hidden; padding: 14px 0 10px; border-block: 2px solid var(--bois); box-shadow: inset 0 1px 0 var(--filet), inset 0 -1px 0 var(--filet);
  background: var(--grain-sombre), linear-gradient(180deg, #2a190c, #1b110a);
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}
.bestiaire__piste { display: flex; flex: none; gap: 26px; margin: 0; padding: 0 13px; list-style: none; will-change: transform; }
html:not(.sans-mouvement) .bestiaire__piste { animation: bestiaire-defile 70s linear infinite; }
.bestiaire:hover .bestiaire__piste, .bestiaire:focus-within .bestiaire__piste { animation-play-state: paused; }
@keyframes bestiaire-defile { to { transform: translateX(-100%); } }
.bestiaire__monstre { flex: none; }
.bestiaire__monstre a { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 140px; text-decoration: none; color: var(--creme); transition: transform 0.25s ease; }
.bestiaire__monstre a:hover, .bestiaire__monstre a:focus-visible { transform: translateY(-6px) scale(1.06); }
.bestiaire__monstre img { display: block; width: 120px; height: 120px; object-fit: contain; transform-origin: 50% 85%; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.6)); }
/* Les sprites sont à l'échelle du jeu : les petites bêtes sont agrandies, les colosses réduits, sans changer la boîte. */
.bestiaire__monstre--tp img { transform: scale(2); }
.bestiaire__monstre--p img { transform: scale(1.5); }
.bestiaire__monstre--g img { transform: scale(0.85); }
.bestiaire__nom { padding: 3px 12px; border: 2px solid var(--bois); border-radius: 999px; background: var(--parchemin); color: var(--encre); font-family: var(--police-titre); font-size: 0.92rem; font-weight: 700; letter-spacing: 0.03em; white-space: nowrap; box-shadow: inset 0 0 0 1px var(--filet); }
/* Sans mouvement : une seule piste, qui prend toute la largeur et passe à la ligne (jamais de défilement horizontal de la page). */
html.sans-mouvement .bestiaire { mask-image: none; -webkit-mask-image: none; flex-wrap: wrap; }
html.sans-mouvement .bestiaire__piste { flex: 1 1 100%; width: 100%; flex-wrap: wrap; justify-content: center; row-gap: 16px; animation: none; will-change: auto; }
html.sans-mouvement .bestiaire__piste[aria-hidden='true'] { display: none; }

/* ---------- Frise des Dofus ---------- */
.frise-dofus { display: flex; justify-content: center; align-items: center; gap: clamp(14px, 4vw, 48px); margin: 6px 0; }
.frise-dofus img { width: clamp(38px, 5vw, 56px); height: auto; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 10px rgba(241, 205, 122, 0.25)); }
.frise-dofus img:nth-child(2) { animation-delay: -0.7s; } .frise-dofus img:nth-child(3) { animation-delay: -1.4s; }
.frise-dofus img:nth-child(4) { animation-delay: -2.1s; } .frise-dofus img:nth-child(5) { animation-delay: -2.8s; } .frise-dofus img:nth-child(6) { animation-delay: -3.5s; }

/* ---------- Atouts ---------- */
.atouts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; list-style: none; margin: 0; padding: 0; }
.atouts--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.atouts--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.atout {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 18px 20px; text-align: center;
  background: var(--grain-parchemin), var(--parchemin); background-color: var(--parchemin); color: var(--encre);
  border: 3px solid var(--bois); border-radius: var(--rayon); box-shadow: var(--ombre), inset 0 0 0 1px var(--filet);
  transform: perspective(900px) rotateX(calc((var(--gy, 50) - 50) * -0.06deg)) rotateY(calc((var(--gx, 50) - 50) * 0.06deg)); transition: transform 0.2s ease-out, box-shadow 0.2s;
}
.atout:hover { box-shadow: 0 12px 26px rgba(0, 0, 0, 0.55), inset 0 0 0 1px var(--filet); }
.atout .medaillon { margin-top: -4px; }
.atout__titre { margin: 4px 0 0; font-size: 1.2rem; color: var(--bois); }
.atout__texte { margin: 0; font-size: 0.98rem; color: var(--encre); line-height: 1.5; }

/* ---------- Duel : Dofus Retro / Amakya ---------- */
.duel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.duel__cote { padding: 20px 22px 18px; border: 3px solid var(--bois); border-radius: var(--rayon); box-shadow: var(--ombre), inset 0 0 0 1px var(--filet); background: var(--grain-parchemin), var(--parchemin); background-color: var(--parchemin); color: var(--encre); }
.duel__cote--amakya { background: var(--grain-sombre), linear-gradient(180deg, #33200f, #1d1107); color: var(--creme); }
.duel__titre { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; font-size: 1.3rem; color: var(--bois); }
.duel__cote--amakya .duel__titre { color: var(--or-clair); }
.duel__points { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.duel__points li { position: relative; padding-left: 26px; line-height: 1.45; }
.duel__points li::before { content: ''; position: absolute; left: 2px; top: 0.45em; width: 14px; height: 14px; background: url(/svg/ornements/separateur.svg) center / contain no-repeat; }

/* ---------- Questions (details parchemin) ---------- */
.questions { display: grid; gap: 10px; }
.question { border: 3px solid var(--bois); border-radius: var(--rayon); box-shadow: var(--ombre), inset 0 0 0 1px var(--filet); background: var(--grain-parchemin), var(--parchemin); background-color: var(--parchemin); color: var(--encre); overflow: hidden; }
.question summary { display: flex; align-items: center; gap: 12px; padding: 12px 18px; cursor: pointer; list-style: none; font-family: var(--police-titre); font-size: 1.12rem; font-weight: 700; color: var(--bois); background: linear-gradient(180deg, rgba(255, 255, 255, 0.35), transparent); }
.question summary::-webkit-details-marker { display: none; }
.question summary::before { content: ''; flex: none; width: 10px; height: 10px; border: solid var(--bois); border-width: 0 3px 3px 0; transform: rotate(-45deg); transition: transform 0.2s; }
.question[open] summary::before { transform: rotate(45deg); }
.question summary:hover { color: var(--lien); }
.question__reponse { padding: 4px 18px 14px 40px; }
.question__reponse p { margin: 0; }

/* ---------- Visages du pied de page ---------- */
.visages { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; list-style: none; margin: 0 0 22px; padding: 0 0 18px; border-bottom: 1px solid rgba(184, 138, 85, 0.35); }
.visages img { display: block; width: 44px; height: 44px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff8e6, var(--parchemin-3)); box-shadow: 0 0 0 2px var(--bois), 0 2px 4px rgba(0, 0, 0, 0.5); transition: transform 0.2s ease; }
.visages li:hover img { transform: translateY(-4px) scale(1.1); }

/* ---------- Grille des cartes à médaillon officiel (carte__ico avec un chemin /jeu/) ---------- */
.carte__ico .ico[src^='/jeu/'] { width: 52px; height: 52px; padding: 6px; }

/* ---------- Adaptation ---------- */
@media (max-width: 1000px) {
  .vitrine { grid-template-columns: minmax(0, 1fr); gap: 22px; padding: 22px 20px; }
  .vitrine__media { order: -1; }
  .postales { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .atouts, .atouts--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .postales { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .postale { --r: 0deg; }
  .atouts, .atouts--2, .atouts--4, .duel { grid-template-columns: minmax(0, 1fr); }
  .vitrine__bande { grid-template-columns: repeat(2, 1fr); }
  .entete-page--capture { min-height: 220px; }
  .entete-page--capture .page { padding-block: 44px 22px; }
  .bestiaire__monstre a { width: 112px; }
  .bestiaire__monstre img { width: 92px; height: 92px; }
  .visages img { width: 36px; height: 36px; }
}
