/* Collection : fiches des Personnages (client/collection.ts). Couleurs : matatak-ui.css */
#main-wrap { --main-max-width: 100%; } /* voir jouer.css : largeur héritée calculée sur la hauteur */
main.collection { grid-area: main; width: 100%; min-width: 0; font: 400 15.5px/1.5 'Nunito', system-ui, sans-serif; color: var(--mt-encre); }
.collection-page { width: min(1320px, 100% - 32px); margin: 0 auto; padding: 28px 0 40px; text-align: left; }
.collection-page .chargement { color: var(--mt-doux); text-align: center; padding: 60px 0; }

.collection-page .tete { height: auto; z-index: auto; } /* site.css stylise tout <header> */
.tete h1 { margin: 0; font: 400 clamp(26px, 3.4vw, 34px)/1.15 'Tribeca', 'Jost', sans-serif; letter-spacing: .06em; color: var(--mt-or); }
.tete p { padding: 0; }

/* Filtres */
.filtres-barre { display: flex; align-items: center; gap: 12px; padding-top: 10px; }
.filtres-bouton { display: inline-flex; align-items: center; gap: 8px; }
.filtres-bouton svg { width: 18px; height: 18px; flex: none; }
.filtres-nb { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--mt-or); color: #241805; font: 900 12px 'Nunito', sans-serif; }
.filtres-effacer { min-height: 40px; padding: 0 6px; border: 0; background: none; cursor: pointer; font: 800 13.5px 'Nunito', sans-serif; color: var(--mt-discret); }
.filtres-effacer:hover { color: var(--mt-encre); }
.filtres { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 10px 0; margin-bottom: 8px; }
.filtres .groupe { display: flex; flex-wrap: wrap; gap: 6px; }
.puce { min-height: 40px; padding: 0 14px; border: 0; border-radius: 12px; cursor: pointer; background: var(--mt-surface); box-shadow: inset 0 0 0 1.5px var(--mt-filet); font: 800 14px 'Nunito', sans-serif; color: var(--mt-doux); touch-action: manipulation; }
.puce.on { color: var(--mt-encre); box-shadow: inset 0 0 0 2px var(--c, var(--mt-or)); }
.filtres span .puce { color: var(--c); }
.filtres .ranger { align-items: center; }
.filtres .ranger-titre { margin-right: 2px; font: 800 13px 'Nunito', sans-serif; color: var(--mt-discret); }

.rang h2 { margin: 30px 0 14px; font: 900 13px 'Jost', sans-serif; letter-spacing: .2em; text-transform: uppercase; color: var(--mt-discret); }
.fiches { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px 18px; } /* par 4, comme le jeu */

/* Grille : la carte seule, son nom dessous */
.carte-col { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; padding: 0; border: 0; background: none; cursor: pointer; color: inherit; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.carte-col { perspective: 900px; }
.carte-col .carte-3d { --carte: 100%; transition: transform .3s cubic-bezier(.3, .8, .3, 1); }
.carte-col .face { box-shadow: 0 18px 30px -16px rgba(0, 0, 0, .95); transition: box-shadow .3s; }
.carte-col:hover .carte-3d, .carte-col:focus-visible .carte-3d { transform: translateY(-4px); }
.carte-col:hover .face, .carte-col:focus-visible .face { box-shadow: 0 26px 36px -18px rgba(0, 0, 0, .95), 0 0 0 2px var(--c); }
.carte-col:active .carte-3d { transform: scale(.97); }
/* En entrant à l'écran : simple fondu qui monte un peu (Hugo, 02/11/2026 : le tour complet donnait la nausée) */
.carte-col.entre .carte-3d { animation: carte-entre .45s ease-out var(--retard, 0ms) both; }
@keyframes carte-entre {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.carte-col:focus-visible { outline: none; }
.carte-col .nom { font: 400 clamp(15px, 1.6vw, 19px)/1.1 'Tribeca', 'Jost', sans-serif; letter-spacing: .06em; color: var(--c); text-align: center; overflow-wrap: anywhere; }
.carte-col .force { margin-top: -4px; font-size: 12px; }

.force { margin-top: 6px; font-size: 13px; font-weight: 800; color: var(--mt-doux); }
.force .etoiles { letter-spacing: 1px; }
.force.f1 .etoiles { color: #9a9690; } .force.f2 .etoiles { color: #4a8fd6; } .force.f3 .etoiles { color: #9b5bc4; } .force.f4 .etoiles { color: #ee8a1f; }
.force.roi { font-weight: 700; color: var(--mt-or); }

/* Fiche détaillée : grande carte qui se retourne, infos, déplacements à la demande */
.detail { position: fixed; inset: 0; margin: auto; width: min(1440px, calc(100vw - 40px)); height: fit-content; max-height: calc(100svh - 20px); overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding: 24px; border: 0; border-radius: 22px; text-align: left; background: linear-gradient(170deg, var(--mt-surface-2), var(--mt-surface)); color: var(--mt-encre); box-shadow: inset 0 0 0 1px var(--mt-filet), inset 0 4px 0 var(--c), 0 30px 80px rgba(0, 0, 0, .7); font: 400 15.5px/1.5 'Nunito', system-ui, sans-serif; }
/* Grand écran : carte | texte | plateau ; de 761 à 1199 px : carte puis texte à gauche, plateau à droite */
.detail[open] { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .9fr) minmax(0, 1.15fr); grid-template-areas: 'carte infos jeu' 'nav nav nav'; gap: 8px 32px; align-items: start; animation: ouverture .3s cubic-bezier(.2, .9, .3, 1); }
@media (min-width: 761px) { .detail { padding-top: 66px; } } /* croix de 52 px */ /* la croix de fermeture au-dessus des colonnes */
.d-carte { grid-area: carte; } .d-infos { grid-area: infos; } .d-depl { grid-area: jeu; } .d-nav { grid-area: nav; }
@media (max-width: 1199px) and (min-width: 761px) {
  .detail { width: min(1000px, calc(100vw - 32px)); }
  .detail[open] { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); grid-template-areas: 'carte jeu' 'infos jeu' 'nav nav'; grid-template-rows: auto auto auto; align-content: start; }
  .d-carte { width: min(100%, calc(100svh - 120px)); justify-self: center; }
  .detail .t-plateau { width: min(100%, calc(100svh - 150px)); align-self: center; }
}
@keyframes ouverture { from { opacity: 0; transform: translateY(14px) scale(.98); } }
/* Personnage suivant / précédent : la fiche glisse depuis le côté, sans rebond */
.detail.vers-droite[open] { animation: glisse-droite .22s ease-out; }
.detail.vers-gauche[open] { animation: glisse-gauche .22s ease-out; }
@keyframes glisse-droite { from { opacity: .4; transform: translateX(36px); } }
@keyframes glisse-gauche { from { opacity: .4; transform: translateX(-36px); } }
/* La fiche ne défile jamais de côté (iPhone, 19/11 : elle glissait à gauche en défilant, coupant le texte) : overflow-x
   plus haut ; ce qui dépassait : la zone de toucher de la croix (12 px autour) et l'arrivée de côté (36 px) */
/* Balayage horizontal sur la carte et le texte : le navigateur ne garde que le défilement vertical */
.detail .d-carte, .detail .d-infos { touch-action: pan-y; }
.detail::backdrop { background: rgba(10, 8, 7, .8); backdrop-filter: blur(4px); }
.d-fermer { position: absolute; top: 8px; right: 10px; z-index: 5; display: grid; place-items: center; width: 52px; height: 52px; padding: 0; border: 0; border-radius: 50%; background: var(--mt-filet); color: var(--mt-encre); line-height: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.d-fermer:hover { color: var(--mt-jaune); }
/* Zone à toucher plus large que le rond (12 px autour) : la croix est posée sur la carte, la rater la retournait (Hugo, 18/11/2026) */
.d-fermer::after { content: ''; position: absolute; inset: -12px; border-radius: 50%; }
.d-carte { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.d-astuce { margin: 0; font-size: 13px; color: var(--mt-discret); }
.carte3d { position: relative; width: 100%; aspect-ratio: 1; padding: 0; border: 0; background: none; cursor: pointer; perspective: 1200px; -webkit-tap-highlight-color: transparent; }
.carte3d .face { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 6%; backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: transform .6s cubic-bezier(.3, .8, .3, 1); box-shadow: 0 22px 40px -18px rgba(0, 0, 0, .95); }
.carte3d .clair { transform: rotateY(180deg); }
.carte3d.retournee .sombre { transform: rotateY(-180deg); }
.carte3d.retournee .clair { transform: rotateY(0); }
.carte3d:focus-visible { outline: 2px solid var(--mt-jaune); outline-offset: 4px; border-radius: 6%; }
.d-infos { min-width: 0; padding-top: 6px; }
.d-nom { margin: 0 48px 4px 0; font: 400 clamp(28px, 4vw, 38px)/1.1 'Tribeca', 'Jost', sans-serif; letter-spacing: .05em; color: var(--c); }
.identite { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 14.5px; font-weight: 700; color: var(--mt-doux); }
.identite .saison { color: var(--c); }
.identite .ext { color: var(--mt-discret); font-weight: 600; }
.detail .replique { margin: 14px 0 0; padding: 0; text-indent: 0; text-align: left; font-style: italic; font-size: 16px; color: var(--mt-encre); }
.d-depl { display: flex; flex-direction: column; gap: 12px; padding-top: 6px; }
.en-jeu .t-plateau { cursor: pointer; }
.d-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 22px; padding-top: 14px; box-shadow: inset 0 1px 0 var(--mt-filet); }
.d-nav button { min-height: 44px; padding: 0 12px; border: 0; border-radius: 12px; background: none; cursor: pointer; font: 800 14px 'Nunito', sans-serif; color: var(--mt-doux); }
.d-nav button:hover { color: var(--mt-or); }
.d-nav .d-suiv { margin-left: auto; }

/* Légende des marques */
.legende { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--mt-doux); }
.legende span { display: inline-flex; align-items: center; gap: 8px; }
.legende i { position: relative; width: 18px; height: 18px; border-radius: 3px; background: #6b4a3d; }
.marque { position: absolute; width: 12.5%; height: 12.5%; }
.marque::after, .legende i[class*="m-"]::after { content: ''; position: absolute; inset: 30%; transform: rotate(45deg); border-radius: 2px; }
.m-libre::after { background: var(--mt-jaune); box-shadow: 0 0 0 1px var(--mt-or-fonce); }
.m-deplace::after { box-shadow: inset 0 0 0 2px var(--mt-jaune); }
.m-capture::after { background: var(--mt-hiver); box-shadow: 0 0 0 1px #2f6f8f; }

/* Plateau et mini-jeu : adversaires qui apparaissent au hasard, 30 s pour en capturer le plus possible */
.t-plateau { position: relative; width: 100%; aspect-ratio: 1; border-radius: 10px; background: center / cover no-repeat; overflow: hidden; touch-action: manipulation; box-shadow: 0 14px 30px -16px rgba(0, 0, 0, .9); }
.t-perso, .t-ennemi, .t-cible, .t-eclat, .t-plus { position: absolute; width: 12.5%; height: 12.5%; }
/* L'image est posée par le script sur l'élément ; ::before la reprend avec les coins arrondis des pièces en partie */
.t-perso, .t-ennemi { background: center / 0 0 no-repeat; }
.t-perso::before, .t-ennemi::before { content: ''; position: absolute; inset: 4.55%; border-radius: 8%; background: inherit; background-size: cover; }
.t-perso { z-index: 3; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .7)); transition: left .3s cubic-bezier(.3, .8, .3, 1), top .3s cubic-bezier(.3, .8, .3, 1); }
.t-ennemi { z-index: 1; transform: rotate(180deg); animation: apparition .4s cubic-bezier(.2, .9, .3, 1.4); }
.t-ennemi.part { animation: depart .35s ease-in forwards; }
@keyframes apparition { from { transform: rotate(180deg) scale(0); opacity: 0; } }
@keyframes depart { to { transform: rotate(180deg) scale(.3); opacity: 0; } }
.t-cible { z-index: 2; padding: 0; border: 0; background: none; cursor: pointer; }
.t-cible::after { content: ''; position: absolute; inset: 32%; transform: rotate(45deg); border-radius: 2px; background: var(--mt-jaune); box-shadow: 0 0 0 1px var(--mt-or-fonce); }
.t-cible.capture::after { inset: 4%; transform: none; border-radius: 10px; background: none; box-shadow: inset 0 0 0 3px var(--mt-jaune), 0 0 14px rgba(246, 201, 69, .6); }
.t-cible:hover::after, .t-cible:focus-visible::after { filter: brightness(1.2); }
.t-eclat { z-index: 4; pointer-events: none; border-radius: 50%; background: radial-gradient(circle, rgba(246, 201, 69, .9), transparent 65%); animation: eclat .7s ease-out forwards; }
@keyframes eclat { from { transform: scale(.4); opacity: 1; } to { transform: scale(2.2); opacity: 0; } }
.t-plus { z-index: 5; display: grid; place-items: center; pointer-events: none; font: 900 22px 'Jost', sans-serif; color: var(--mt-jaune); text-shadow: 0 2px 8px rgba(0, 0, 0, .9); animation: monte .8s ease-out forwards; }
@keyframes monte { to { transform: translateY(-70%); opacity: 0; } }
.t-temps { height: 6px; border-radius: 99px; background: var(--mt-surface-3, rgba(255, 255, 255, .06)); overflow: hidden; visibility: hidden; }
.en-jeu .t-temps { visibility: visible; }
.t-temps i { display: block; height: 100%; background: var(--mt-or); transform-origin: left; transition: transform .1s linear; }
.en-jeu .marque { display: none; }
.t-barre [hidden] { display: none; }
.t-barre { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.t-score { margin-right: auto; font-weight: 800; color: var(--mt-or); }
.notes { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 13px; color: var(--mt-doux); }

@media (max-width: 1150px) { .fiches { gap: 18px 12px; } }
@media (max-width: 760px) {
  .collection-page { width: calc(100% - 24px); padding-top: 18px; }
  .fiches { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
  .filtres { gap: 6px; }
  .detail { width: 100vw; max-width: 100vw; max-height: 100svh; height: 100svh; border-radius: 0; padding: 16px 16px 28px; }
  .detail[open] { display: block; }
  .d-carte { position: static; width: min(100%, 440px); margin: 8px auto 0; }
  .d-infos { padding-top: 16px; }
  .d-depl { margin-top: 20px; }
  .t-barre .mt-btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { .carte3d .face, .t-perso, .t-ennemi, .carte-col .carte-3d, .detail[open], .detail.vers-droite[open], .detail.vers-gauche[open] { transition: none; animation: none; } }

/* /collection#equipes (fin du tutoriel) : les 4 équipes de départ, 3 cartes chacune */
.equipes-depart .equipe { margin-top: 26px; }
.equipe-tete { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.equipe-tete h2 { margin: 0; font: 400 24px/1.1 'Tribeca', 'Jost', sans-serif; letter-spacing: .05em; color: var(--c); }
.equipe-tete h2 span { color: var(--mt-encre); }
.difficulte { display: inline-flex; gap: 6px; }
.difficulte i { width: 10px; height: 10px; transform: rotate(45deg); border-radius: 2px; box-shadow: inset 0 0 0 1.5px var(--c); }
.difficulte i.plein { background: var(--c); }
.equipe .phrase { margin: 4px 0 12px; color: var(--mt-doux); font-style: italic; }
.fiches.trois { grid-template-columns: repeat(3, minmax(0, 220px)); }
.equipes-suite { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 36px 0 10px; }
.equipes-suite .mt-btn { width: min(100%, 340px); }
.equipes-suite .tout { min-height: 40px; display: inline-flex; align-items: center; font-weight: 700; color: var(--mt-doux); text-decoration: none; }
.equipes-suite .tout:hover { color: var(--mt-encre); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 760px) {
  .fiches.trois { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .fiches.trois .carte-col .nom { font-size: 12px; }
  .equipe-tete h2 { font-size: 20px; }
}
/* Ordinateur : page des équipes resserrée et centrée (cartes et difficulté alignées) */
.collection-page.equipes-depart { width: min(760px, 100% - 32px); }
.equipes-depart .fiches.trois { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Aventure : Personnages pas encore recrutés (client/collection.ts, etatAventure) */
.carte-col.verrou .face { filter: grayscale(1) brightness(.4); }
.carte-col.verrou .nom { color: var(--mt-doux); }
.carte-col .arrivee { font: 800 12px 'Nunito', sans-serif; color: var(--mt-discret); }
