/* ---------- Tableau des quêtes (30/10) : façon Explorateurs du Ciel ----------
   À gauche, la liste dans la fenêtre bleue du jeu (curseur du menu sur la ligne choisie) ;
   à droite, la fiche de mission sur le parchemin de la ROM, puis ses récompenses en clair et les boutons. */
.screen.tableau-ecran { width: min(1440px, calc((100vw - 24px) / var(--ui, 1))); }
.board-wrap { width: 100%; }
.board-body { max-height: calc((100vh - 190px) / var(--ui, 1)); overflow: auto; padding: 4px; }
.qb { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 500px); gap: 12px; align-items: start; }
.qd-cote { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.qb + .qb, h3 + .qb { margin-bottom: 10px; }

/* La liste */
.qb-liste { display: flex; flex-direction: column; gap: 2px; padding: 4px 6px; max-height: calc((100vh - 300px) / var(--ui, 1)); min-height: 200px; overflow: auto; }
.note { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%;
  padding: 4px 8px 4px 24px; border: 0; border-radius: 3px; background: transparent; color: var(--txt); font: inherit; text-align: left; cursor: pointer;
  text-shadow: 0 2px 0 #000; animation: qbLigne .3s steps(3, end) backwards; animation-delay: calc(var(--i, 0) * 28ms); }
@keyframes qbLigne { from { transform: translateX(-16px); opacity: 0; } }
.note:hover, .note:focus-visible, .note.focus { background: rgba(255,255,255,.07); outline: none; }
.note.sel { background: linear-gradient(90deg, rgba(255,216,90,.22), rgba(255,216,90,.06)); box-shadow: inset 0 0 0 2px rgba(255,216,90,.45); }
/* Le curseur du menu de Donjon Mystère devant la ligne choisie (il sautille) */
.note::before { content: ''; position: absolute; left: 4px; top: 50%; width: 14px; height: 14px; margin-top: -7px; opacity: 0;
  background: url('assets/ui/curseurs/curseur_menu.png') center / contain no-repeat; image-rendering: pixelated; }
.note.sel::before { opacity: 1; animation: qbCurseur .6s steps(2, end) infinite; }
.note:not(.sel):hover::before { opacity: .45; }
@keyframes qbCurseur { 50% { transform: translateX(3px); } }
.note .n-pt { width: 44px; height: 44px; image-rendering: pixelated; border: 2px solid var(--box-line); border-radius: 4px; background: #0a1233; }
.note .n-main { display: flex; flex-direction: column; min-width: 0; line-height: 1.1; }
.note .n-tag { align-self: flex-start; margin-bottom: 1px; padding: 0 5px; font-size: 12px; letter-spacing: 1px; line-height: 16px; color: #10183a; text-shadow: none;
  background: var(--kc); border: 1px solid rgba(0,0,0,.6); white-space: nowrap; }
.note.k-wanted .n-tag { color: #fff; background: #b01a10; }
.note .n-title { font-size: 20px; font-weight: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note.sel .n-title { color: var(--gold); }
.note .n-where { font-size: 16px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note .n-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.note .n-stars { display: flex; gap: 1px; }
.note .n-stars .pxi, .qd-etoiles .pxi { margin: 0; filter: drop-shadow(0 1px 0 rgba(0,0,0,.7)); }
.note .n-gain { display: inline-flex; align-items: center; gap: 4px; font-size: 16px; color: var(--gold); }
.note .n-gain .pxi { margin: 0; }
.note .n-obj { width: 24px; height: 24px; image-rendering: pixelated; margin-left: 2px; border-radius: 3px; box-shadow: 0 0 0 2px var(--rc); background: rgba(0,0,0,.35); }
.note .n-proposed { font-size: 15px; color: #ffe08a; }
.cork-empty { margin: 20px; text-align: center; color: var(--dim); }
/* Animations : acceptée (la ligne s'envole), relancée (elle se retourne), nouvelle (éclair doré) */
.note.taken { animation: qbPrise .45s steps(5, end) forwards; }
@keyframes qbPrise { to { transform: translateX(40px); opacity: 0; } }
.note.flip-out { animation: qbRetourne .24s steps(3, end) forwards; }
@keyframes qbRetourne { to { transform: scaleY(0); filter: brightness(1.8); } }
.qb-liste.calme .note:not(.rerolled) { animation: none; }
.note.rerolled { animation: qbNouvelle .7s steps(6, end) backwards; }
@keyframes qbNouvelle { 0% { transform: scaleY(0); background: rgba(255,216,90,.7); } 40% { transform: none; background: rgba(255,216,90,.5); } }

/* La fiche : le parchemin de la ROM (256 x 192), tout est placé en pourcentage pour suivre sa taille */
.qb-fiche { position: sticky; top: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.qd-parch { position: relative; container-type: inline-size; aspect-ratio: 4 / 3; color: #3a2208; text-shadow: none; image-rendering: pixelated;
  background: url('assets/ui/fonds/parchemin.png') 0 0 / 100% 100% no-repeat; filter: drop-shadow(0 6px 8px rgba(0,0,0,.5));
  font-family: 'PMD Font', 'Pixelify', sans-serif;
  /* Sur un écran peu haut, le parchemin rapetisse pour que les récompenses et les boutons restent visibles. */
  width: min(100%, max(300px, (100vh / var(--ui, 1) - 300px) * 1.333)); justify-self: center; align-self: start; }
.qd-parch.change { animation: qbFiche .28s steps(4, end); }
@keyframes qbFiche { from { transform: translateY(8px); opacity: .2; } }
.qd-parch.flip-out { animation: qbRetourne .24s steps(3, end) forwards; }
.qd-tag { position: absolute; right: 6%; top: 4%; padding: 0 .5em; font-size: max(11px, 2.6cqw); letter-spacing: 1px; line-height: 1.5; color: #10183a;
  background: var(--kc); border: 2px solid #3a2208; }
.qd-titre { position: absolute; left: 19%; right: 7%; top: 11%; font-size: max(17px, 5.4cqw); font-weight: normal; line-height: 1.1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #2a1404; }
.qd-etoiles { position: absolute; left: 14%; top: 23.5%; }
.qd-pt { position: absolute; left: 11.6%; top: 36.4%; width: 17%; aspect-ratio: 1; display: grid; place-items: center; }
.qd-pt img { width: 92%; height: 92%; image-rendering: pixelated; }
.qd-infos { position: absolute; left: 33%; right: 7%; top: 34%; bottom: 23%; overflow: hidden; font-size: max(15px, 3.9cqw); line-height: 1.22; }
.qd-l { display: inline-block; min-width: 3.6em; margin-right: .4em; color: #9a4a0a; }
.qd-l::after { content: ' :'; }
.qd-avec { display: flex; align-items: center; gap: 6px; }
.qd-avec img { width: 2em; height: 2em; image-rendering: pixelated; }
.qd-txt { margin: .3em 0 0; color: #5a3510; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
/* Le tampon rouge « Acceptée ! » quand on prend la quête */
.qd-tampon { position: absolute; left: 50%; top: 46%; padding: .1em .5em; font-size: max(20px, 7cqw); color: #c81808; border: .12em solid #c81808;
  transform: translate(-50%, -50%) rotate(-12deg); opacity: .9; animation: qbTampon .3s steps(3, end) both; pointer-events: none; mix-blend-mode: multiply; }
@keyframes qbTampon { from { transform: translate(-50%, -50%) rotate(-12deg) scale(2.2); opacity: 0; } }

/* Les récompenses : une ligne chacune, icône dans une case de même taille, nom, nombre aligné à droite */
.qd-rew { padding: 4px 10px 8px; }
.qd-rew h3 { margin: 0 0 4px; }
.rw-liste { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 14px; }
.rw-l { display: flex; align-items: center; gap: 8px; min-height: 34px; font-size: 18px; line-height: 1.1; }
.rw-ic { flex: none; width: 34px; height: 34px; display: grid; place-items: center; }
.rw-ic img, .rw-ic .pxi { margin: 0 !important; }
.rw-ic .gel-ico, .rw-ic .rw-img { width: 32px; height: 32px; image-rendering: pixelated; }
.rw-nom { flex: 1; min-width: 0; }
.rw-n { margin-left: auto; color: var(--gold); font-weight: normal; white-space: nowrap; }
.rw-poke { grid-column: 1 / -1; }
.rw-obj { grid-column: 1 / -1; margin-top: 4px; padding: 4px 6px; border-left: 4px solid var(--rc); background: rgba(0,0,0,.28); }
.rw-obj .rw-ic { border-radius: 4px; box-shadow: 0 0 0 2px var(--rc); background: rgba(0,0,0,.35); }
.rw-desc { display: block; margin-top: 2px; font-size: 15px; color: var(--dim); }

/* Les boutons sous la fiche, et le dé en pixel art */
.qd-btns { justify-content: flex-end; gap: 8px; }
.qd-btns .n-proposed { margin-right: auto; font-size: 16px; color: #ffe08a; }
.qd-btns .n-rr { margin-right: auto; }
.de-px { width: 24px; height: 24px; image-rendering: pixelated; vertical-align: middle; flex: none; }
.n-rr .de-px { width: 32px; height: 32px; margin: -6px 0; }
.n-rr .rr-n { min-width: 1.2em; padding: 0 4px; color: var(--gold); font-weight: normal; background: rgba(0,0,0,.35); border-radius: 6px; text-align: center; }
.n-rr:not([disabled]):hover .de-px, .m-rr:not([disabled]):hover .de-px { animation: qbDeSecoue .4s steps(4, end); }
.de-px.roule { animation: qbDeRoule .26s steps(4, end) infinite; }
@keyframes qbDeSecoue { 25% { transform: rotate(-16deg); } 75% { transform: rotate(16deg); } }
@keyframes qbDeRoule { 25% { transform: rotate(90deg) translateY(-4px); } 50% { transform: rotate(180deg); } 75% { transform: rotate(270deg) translateY(-4px); } 100% { transform: rotate(360deg); } }
.bf-rr { display: inline-flex; align-items: center; gap: 6px; }
.m-rr { padding: 2px 8px; } .m-rr .de-px { width: 32px; height: 32px; }
.m-rr-n { display: inline-flex; align-items: center; gap: 6px; }

/* Écran large : la liste, le parchemin, et à côté les récompenses et les boutons (tout tient sans défiler) */
@media (min-width: 1100px) {
  .qb { grid-template-columns: minmax(340px, 1fr) minmax(0, 1.6fr); }
  .qb-fiche { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 300px); align-items: start; }
  .qd-cote .rw-liste { grid-template-columns: 1fr; }
  .qd-cote .qd-btns { flex-wrap: wrap; }
}
/* Petit parchemin (téléphone) : étoiles plus petites, étiquettes resserrées */
@container (max-width: 440px) {
  .qd-etoiles { zoom: .7; }
  .qd-l { min-width: 0; }
  .qd-titre { top: 10%; }
}
/* Écran étroit (téléphone) : la fiche au-dessus, la liste en dessous */
@media (max-width: 820px) {
  .qb { grid-template-columns: 1fr; }
  .board-tabs { gap: 6px; }
  .board-tabs .btn { padding: 2px 10px 2px 18px; font-size: 16px; }
  .qb-fiche { position: static; order: -1; }
  .qb-liste { max-height: none; min-height: 0; }
  .rw-liste { grid-template-columns: 1fr; }
  .qd-txt { -webkit-line-clamp: 2; }
  .note { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 8px; padding-left: 22px; }
  .note .n-pt { width: 40px; height: 40px; }
  .note .n-title { font-size: 18px; }
}
@media (max-width: 480px) {
  .note { grid-template-columns: 40px minmax(0, 1fr); }
  .note .n-side { grid-column: 2; flex-direction: row; align-items: center; justify-content: space-between; }
}
/* ---------- Lot I4 (5/11) : tableau simplifié pour un débutant (un seul donjon ouvert) ---------- */
.board-filtre.bf-debut { flex-wrap: nowrap; }
.q-aide-debut { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; color: #dfe7ff; min-width: 0; animation: qAideEntre .3s steps(3, end); }
.q-aide-debut .pxi { margin: 0; flex: none; animation: qAideLoupe 2s steps(2, end) infinite; }
@keyframes qAideEntre { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes qAideLoupe { 50% { transform: translate(1px, -2px); } }

/* ---------- Quêtes histoire (7/11) : chapitres, groupe, donjon adaptatif ---------- */
.hq-tab { position: relative; }
.hq-tab.primary { animation: hqTab 2.4s ease-in-out infinite; }
@keyframes hqTab { 50% { filter: brightness(1.15); } }
/* petit livre en pixels devant « Quêtes histoire » */
.hq-livre { display: inline-block; width: 28px; height: 24px; margin-right: 6px; vertical-align: -4px; image-rendering: pixelated;
  background: url(assets/ui/icones/livre.png) 0 0 / 100% 100% no-repeat; } /* (11/11) pixel art : tools/histoire/icones_histoire.py */
.hq-tab.primary .hq-livre { animation: hqLivre 1.6s steps(2, end) infinite; }
@keyframes hqLivre { 50% { transform: translateY(-2px) rotate(-6deg); } }

.hq { display: flex; flex-direction: column; gap: 8px; }
.hq-haut { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 8px; align-items: stretch; }
.hq-adapt { display: flex; gap: 12px; align-items: center; font-size: 18px; line-height: 1.2; }
.hq-adapt > div { display: flex; flex-direction: column; gap: 3px; }
.hq-adapt b { font-size: 21px; }
/* la balance (pixel art, tools/histoire/icones_histoire.py, 11/11) : elle « pèse » doucement, image par image */
.hq-balance { flex: 0 0 auto; width: 63px; height: 54px; image-rendering: pixelated; background: url(assets/ui/icones/balance.png) 0 0 / 100% 100% no-repeat;
  animation: hqPese 2.4s steps(1, end) infinite; }
@keyframes hqPese { 0%, 100% { translate: 0 0; } 50% { translate: 0 -3px; } }

.hq-groupe { display: flex; flex-direction: column; gap: 4px; font-size: 18px; }
.hq-gtitre { color: #8fd0ff; font-size: 21px; }
.hq-membres { display: flex; flex-wrap: wrap; gap: 6px; }
.hq-membre { display: grid; grid-template-columns: 40px auto; grid-template-rows: auto auto; column-gap: 6px; align-items: center; padding: 2px 8px 2px 2px;
  border: 2px solid var(--line); border-radius: 6px; background: rgba(7, 13, 36, .6); line-height: 1.05; }
.hq-membre img { grid-row: span 2; width: 40px; height: 40px; image-rendering: pixelated; border-radius: 4px; background: #0a1233; }
.hq-membre.moi { border-color: var(--gold-line); }
.hq-membre.pret { box-shadow: inset 0 0 0 1px rgba(110, 226, 122, .55); }
.hq-mnom { font-size: 17px; }
.hq-mch { font-size: 15px; color: var(--gold); }
.hq-hote { margin-left: 6px; padding: 0 4px; font-style: normal; font-size: 12px; color: #3a2400; text-shadow: none; background: var(--gold); border-radius: 3px; vertical-align: 2px; }
.hq-regle { font-size: 16px; color: var(--dim); }

/* la liste des chapitres : un chemin de cartes */
/* (7/11, D) nom de la quête, au-dessus des chapitres */
.hq-quete { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 15px; letter-spacing: .5px; padding: 2px 0 0; }
.hq-quete i { font-style: normal; animation: hq-sablier 3.2s ease-in-out infinite; display: inline-block; }
.hq-quete i:last-child { animation-delay: 1.6s; }
@keyframes hq-sablier { 0%, 70% { transform: rotate(0); } 85%, 100% { transform: rotate(180deg); } }
@media (prefers-reduced-motion: reduce) { .hq-quete i { animation: none; } }
.hq-liste { display: flex; flex-direction: column; gap: 6px; padding: 2px 4px 2px 18px; position: relative; }
.hq-liste::before { content: ''; position: absolute; left: 39px; top: 20px; bottom: 20px; width: 4px; background: repeating-linear-gradient(180deg, #31508f 0 8px, transparent 8px 14px); }
.hq-ch { position: relative; display: grid; grid-template-columns: 46px 64px minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; padding: 6px 12px 6px 4px;
  border: 2px solid var(--line); border-radius: 8px; background: linear-gradient(180deg, rgba(20, 36, 84, .92), rgba(9, 18, 48, .92)); color: var(--txt);
  font: inherit; text-align: left; cursor: pointer; text-shadow: 0 2px 0 #000; transition: transform .12s, border-color .12s; }
.hq-anim .hq-ch { animation: hqArrive .38s cubic-bezier(.2, .9, .3, 1.25) backwards; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes hqArrive { from { transform: translateX(-28px) scale(.96); opacity: 0; } }
.hq-ch:hover, .hq-ch.focus, .hq-ch:focus-visible { outline: none; transform: translateX(4px); border-color: var(--line-in); }
.hq-ch.sel { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(255, 211, 92, .25), 0 0 14px rgba(255, 211, 92, .25); }
.hq-ch.sel::before { content: ''; position: absolute; left: -16px; top: 50%; width: 14px; height: 14px; margin-top: -7px;
  background: url('assets/ui/curseurs/curseur_menu.png') center / contain no-repeat; image-rendering: pixelated; animation: qbCurseur .6s steps(2, end) infinite; }
.hq-num { position: relative; z-index: 1; display: grid; place-items: center; width: 40px; height: 40px; margin-left: 2px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #4a6bb8, #1a2a5c); border: 3px solid #31508f; font-size: 22px; color: var(--dim); }
.hq-por img { display: block; width: 64px; height: 64px; image-rendering: pixelated; border: 2px solid #31508f; border-radius: 6px; background: #0a1233; }
.hq-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.12; }
.hq-titre { font-size: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hq-lieu { font-size: 15px; color: #8fd0ff; }
.hq-res { font-size: 16px; color: var(--dim); }
.hq-etat { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 76px; font-size: 15px; }
.hq-etat i { font-style: normal; font-size: 22px; line-height: 1; }
/* fait : doré, avec le coche */
.hq-fait .hq-num { background: radial-gradient(circle at 35% 30%, #ffe9a0, #c8901e); border-color: #7a5410; color: #3a2400; text-shadow: none; }
.hq-fait .hq-coche { color: var(--ok); }
.hq-fait .hq-etat span { color: var(--ok); }
/* jouable : il brille et la flèche avance */
.hq-jouable { border-color: #6aa8ff; }
.hq-jouable .hq-num { background: radial-gradient(circle at 35% 30%, #9fd4ff, #2e6fd8); border-color: #cfe0ff; color: #fff; animation: hqPouls 1.4s ease-in-out infinite; }
.hq-jouable .hq-fleche { color: var(--gold); animation: hqFleche .8s steps(2, end) infinite; }
@keyframes hqPouls { 50% { box-shadow: 0 0 0 6px rgba(127, 166, 239, .25), 0 0 16px rgba(159, 212, 255, .55); } }
@keyframes hqFleche { 50% { transform: translateX(4px); } }
/* verrouillé : gris, portrait en ombre noire */
.hq-verrou { background: linear-gradient(180deg, rgba(20, 24, 40, .9), rgba(10, 12, 24, .9)); border-color: #2a3350; }
.hq-verrou .hq-por img { filter: brightness(0) drop-shadow(0 0 1px #3a4a78); }
.hq-verrou .hq-titre, .hq-verrou .hq-res { color: #5d6a8e; }
.hq-verrou .hq-cad { filter: grayscale(1) brightness(.8); }
/* le chapitre du groupe : un ruban qui ondule */
.hq-commun { border-color: var(--gold); }
.hq-ruban { position: absolute; right: 10px; top: -10px; padding: 0 8px; font-size: 14px; line-height: 18px; color: #3a2400; text-shadow: none;
  background: linear-gradient(180deg, #ffe9a0, #f0a830); border: 2px solid #7a5410; border-radius: 3px; transform-origin: 50% 0; animation: hqRuban 2.6s ease-in-out infinite; }
@keyframes hqRuban { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg) translateY(-1px); } }
.hq-tetes { position: absolute; left: 120px; bottom: -8px; display: flex; gap: 2px; }
.hq-tetes img { width: 26px; height: 26px; image-rendering: pixelated; border: 2px solid var(--gold-line); border-radius: 50%; background: #0a1233; animation: hqTete 1.2s ease-in-out infinite; }
.hq-tetes img:nth-child(2) { animation-delay: .15s; } .hq-tetes img:nth-child(3) { animation-delay: .3s; } .hq-tetes img:nth-child(4) { animation-delay: .45s; }
@keyframes hqTete { 50% { transform: translateY(-3px); } }
/* départ : la carte s’envole, le bouton flashe */
.hq-envol { animation: hqEnvol .45s ease-in forwards !important; }
@keyframes hqEnvol { 40% { transform: scale(1.04); filter: brightness(1.5); } 100% { transform: translateX(40px) scale(1.02); opacity: .2; } }
.hq-part { animation: hqPart .4s ease-out; }
@keyframes hqPart { 30% { transform: scale(1.08); filter: brightness(1.6); } }

.hq-bas { position: sticky; bottom: 0; z-index: 2; display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.hq-cible { display: flex; gap: 10px; align-items: center; min-width: 0; font-size: 20px; }
.hq-cnum { display: grid; place-items: center; flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; font-size: 24px; color: #fff;
  background: radial-gradient(circle at 35% 30%, #9fd4ff, #2e6fd8); border: 3px solid #cfe0ff; animation: hqPouls 1.4s ease-in-out infinite; }
.hq-note { font-size: 16px; }
.hq-go { min-width: 220px; font-size: 24px; }

@media (max-width: 1100px) { .hq-haut { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
  .hq-ch { grid-template-columns: 38px 48px minmax(0, 1fr); padding-right: 8px; }
  .hq-num { width: 34px; height: 34px; font-size: 19px; }
  .hq-por img { width: 48px; height: 48px; }
  .hq-etat { grid-column: 3; flex-direction: row; justify-content: flex-start; gap: 6px; min-width: 0; }
  .hq-etat i { font-size: 16px; }
  .hq-liste::before { left: 35px; }
  .hq-tetes { left: 92px; }
  .hq-bas { flex-direction: column; align-items: stretch; }
  .hq-go { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) { .hq *, .hq-tab, .hq-tab * { animation: none !important; } }

/* ---------- (8/11, F) Invitation à une quête histoire : « Ceci est une quête histoire… Voulez-vous participer ? » ---------- */
.modal.hinv-modal { z-index: 60; background: radial-gradient(ellipse at 50% 40%, rgba(40, 60, 140, .35), rgba(3, 6, 20, .78)); }
.hinv { position: relative; width: min(640px, 94vw); padding: 0; border: 3px solid var(--gold); border-radius: 10px;
  background: linear-gradient(180deg, rgba(24, 40, 96, .97), rgba(9, 16, 44, .97)); box-shadow: 0 0 0 3px #1a2a5c, 0 0 28px rgba(255, 211, 92, .35), 0 10px 26px rgba(0, 0, 0, .6);
  animation: hinvEntre .42s cubic-bezier(.2, 1.4, .4, 1); text-shadow: 0 2px 0 #000; }
@keyframes hinvEntre { from { transform: translateY(26px) scale(.9); opacity: 0; } }
.hinv-ruban { position: absolute; left: 50%; top: -16px; display: flex; align-items: center; gap: 8px; padding: 2px 16px; white-space: nowrap; font-size: 19px; color: #3a2400; text-shadow: none;
  background: linear-gradient(180deg, #ffe9a0, #f0a830); border: 2px solid #7a5410; border-radius: 4px; transform: translateX(-50%); animation: hinvRuban .5s .1s cubic-bezier(.2, 1.5, .4, 1) backwards; }
.hinv-ruban .hq-livre { margin: 0; animation: hqLivre 1.6s steps(2, end) infinite; }
@keyframes hinvRuban { from { transform: translateX(-50%) translateY(-18px) scale(.6); opacity: 0; } }
.hinv-corps { max-height: calc(92vh - 6px); overflow: auto; padding: 26px 22px 18px; }
.hinv-haut { display: flex; gap: 16px; align-items: center; }
/* le portrait du chef, devant un Rouage du Temps qui tourne */
.hinv-por { position: relative; flex: 0 0 auto; width: 104px; height: 104px; display: grid; place-items: center; }
.hinv-por i { position: absolute; inset: -6px; border-radius: 50%; z-index: 0;
  background: repeating-conic-gradient(#ffd35c 0 12deg, #7a5410 12deg 18deg, transparent 18deg 30deg); -webkit-mask: radial-gradient(circle, transparent 54%, #000 55%); mask: radial-gradient(circle, transparent 54%, #000 55%);
  animation: hinvRouage 9s linear infinite; opacity: .9; }
@keyframes hinvRouage { to { transform: rotate(360deg); } }
.hinv-por img { position: relative; z-index: 1; width: 88px; height: 88px; image-rendering: pixelated; border: 3px solid var(--gold-line); border-radius: 50%; background: #0a1233;
  animation: hinvPor 2.4s ease-in-out infinite; }
@keyframes hinvPor { 50% { transform: translateY(-2px); box-shadow: 0 0 14px rgba(255, 211, 92, .45); } }
.hinv-txt { min-width: 0; display: flex; flex-direction: column; gap: 3px; line-height: 1.15; }
.hinv-q { font-size: 19px; color: #8fd0ff; }
.hinv-txt h2 { margin: 0; font-size: 27px; line-height: 1.1; }
.hinv-res { margin: 2px 0 0; font-size: 18px; color: var(--txt); }
.hinv-lieu { font-size: 16px; color: #8fd0ff; }
.hinv-regle { margin: 12px 0 6px; font-size: 16px; line-height: 1.2; color: var(--dim); }
.hinv-change { color: #ffb4a8; }
.hinv-tetes { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 6px 0; }
.hinv-tete { display: flex; align-items: center; gap: 5px; padding: 2px 8px 2px 2px; font-size: 16px; border: 2px solid var(--line); border-radius: 6px; background: rgba(7, 13, 36, .6); }
.hinv-tete img { width: 32px; height: 32px; image-rendering: pixelated; border-radius: 4px; background: #0a1233; }
.hinv-tete i { font-style: normal; font-family: inherit; min-width: 12px; text-align: center; color: var(--dim); animation: hinvAttend 1.2s steps(3, end) infinite; }
.hinv-tete.oui { border-color: rgba(110, 226, 122, .7); }
.hinv-tete i.ok { width: 7px; height: 12px; min-width: 0; margin: 0 4px 3px 3px; border: solid #6ee27a; border-width: 0 3px 3px 0; transform: rotate(45deg); animation: hinvOui .35s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes hinvAttend { 50% { opacity: .35; } }
@keyframes hinvOui { from { transform: rotate(45deg) scale(2.2); opacity: 0; } }
.hinv-question { margin: 10px 0 8px; text-align: center; font-size: 25px; color: var(--gold); animation: hinvQ 1.8s ease-in-out infinite; }
@keyframes hinvQ { 50% { transform: scale(1.03); } }
.hinv-boutons { display: flex; gap: 12px; justify-content: center; }
.hinv-boutons .btn { min-width: 200px; min-height: 52px; font-size: 22px; }
.hinv-attente { margin-top: 10px; padding: 8px; text-align: center; font-size: 19px; color: var(--ok); border: 2px dashed rgba(110, 226, 122, .5); border-radius: 6px; animation: hinvEntre .3s ease-out; }
/* (12/11) temps qui reste pour répondre à l'invitation : la barre se vide, personne ne part si tout le monde n'a pas répondu */
.hinv-temps { margin-top: 10px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.hinv-temps i { display: block; height: 100%; background: linear-gradient(90deg, #ffd56a, #ff9a3a); transform-origin: left; animation: hinvTemps linear forwards; }
@keyframes hinvTemps { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.hinv-modal.hinv-part .hinv { animation: hinvPart .26s ease-in forwards; }
@keyframes hinvPart { to { transform: translateY(30px) scale(.94); opacity: 0; } }
@media (max-width: 560px) {
  .hinv-corps { padding: 24px 12px 14px; }
  .hinv-haut { flex-direction: column; text-align: center; gap: 8px; }
  .hinv-por { width: 86px; height: 86px; }
  .hinv-por img { width: 72px; height: 72px; }
  .hinv-txt h2 { font-size: 23px; }
  .hinv-boutons { flex-direction: column-reverse; }
  .hinv-boutons .btn { min-width: 0; width: 100%; }
}
@media (max-height: 460px) {
  .hinv-corps { padding-top: 20px; }
  .hinv-por { width: 72px; height: 72px; } .hinv-por img { width: 60px; height: 60px; }
  .hinv-regle { margin: 6px 0 4px; } .hinv-question { margin: 4px 0; font-size: 21px; }
  .hinv-boutons .btn { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .hinv, .hinv *, .hinv-modal { animation: none !important; } }
.hinv [hidden] { display: none !important; }
/* (18/11) Quêtes histoire : les livres (livre 1 « Rouages du Temps », livre 2 « Équipe Charme » : Lockpin dans un cœur) */
.hq-livres { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.hq-lv { display: flex; align-items: center; gap: 10px; padding: 6px 16px 6px 8px; border-radius: 10px; border: 2px solid rgba(255,255,255,.18); background: rgba(10,20,50,.55); color: inherit; font: inherit; cursor: pointer; text-align: left; min-width: 0; transition: transform .12s, border-color .12s; }
.hq-lv:hover, .hq-lv:focus-visible { transform: translateY(-1px); border-color: rgba(255,255,255,.5); }
.hq-lv.sel { border-color: #ffd35c; background: rgba(40,50,100,.8); box-shadow: 0 0 0 1px rgba(255,211,92,.35), 0 3px 0 rgba(0,0,0,.35); }
.hq-lv.ferme { opacity: .7; }
.hq-lvp { position: relative; width: 48px; height: 48px; flex: none; border-radius: 8px; overflow: hidden; border: 2px solid #8fb8ff; background: #14224a; }
.hq-lvp img { width: 100%; height: 100%; image-rendering: pixelated; display: block; }
.hq-lv-charme .hq-lvp { width: 44px; height: 40px; transform-origin: center; scale: 1.2; margin: 4px 5px; border: 0; border-radius: 0; background: #ff7ab0; clip-path: path('M22 39 C4 26 0 17 0 10.5 C0 4 5 0 11 0 C16 0 20 3 22 7 C24 3 28 0 33 0 C39 0 44 4 44 10.5 C44 17 40 26 22 39 Z'); }
.hq-lv-charme .hq-lvp img { width: 34px; height: 34px; margin: 2px 5px 0; }
.hq-lv-charme.sel .hq-lvp { animation: hq-coeur 1.4s ease-in-out infinite; }
@keyframes hq-coeur { 0%, 100% { transform: scale(1); } 12% { transform: scale(1.1); } 24% { transform: scale(1); } 36% { transform: scale(1.07); } }
.hq-lvt { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.hq-lvt small { font-size: 12px; opacity: .85; }
.hq-lvt b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hinv-livre { font-size: 11px; opacity: .85; letter-spacing: .4px; }
.hinv-livre span { color: #ff9ac8; }
@media (prefers-reduced-motion: reduce) { .hq-lv-charme.sel .hq-lvp { animation: none; } }
