/* Partenaires en groupe (18/11) : fenêtre « Voulez-vous prendre un coéquipier ? » (client/js/partenaires-groupe.js).
   Style des fenêtres du jeu (cadre bleu nuit, or), animations en pas (pixel art), portraits 40 px ×2.
   (20/11, retour de Kiko) refaite : un bandeau dit en gros QUI a la main (son portrait, le temps qui reste), la liste des
   joueurs montre l'hôte et ce que chacun a pris ; les marques des portraits (favori, shiny, niveau, conseillé) sont petites,
   une par coin. */
.modal.pg-modal { z-index: 60; animation: pgFond .2s steps(4, end); }
.modal.pg-modal.pg-sort { animation: pgSort .25s steps(4, end) forwards; }
.modal.pg-modal.pg-sort.lent { animation: pgSort .3s steps(4, end) .55s forwards; }
@keyframes pgFond { from { opacity: 0; } to { opacity: 1; } }
@keyframes pgSort { to { opacity: 0; } }
/* (19/11, bug Discord de Fainspirit) la fenêtre est agrandie par --ui (Taille de l'interface) : ses bornes sont divisées par --ui,
   sinon le bouton « Partir avec … » sortait de l'écran ; seule la liste rétrécit (et défile), le reste garde sa taille. */
.pg-box { position: relative; width: min(880px, calc(96vw / var(--ui, 1))); max-height: calc(100vh / var(--ui, 1) - 24px); display: flex; flex-direction: column; gap: 8px; overflow-y: auto; animation: pgPop .3s steps(5, end); }
.pg-box > * { flex: none; }
@keyframes pgPop { 0% { scale: .85; opacity: 0; } 70% { scale: 1.03; opacity: 1; } 100% { scale: 1; } }

/* En-tête : le donjon et ses faiblesses */
.pg-tete { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.pg-dg { color: var(--gold); font-size: 28px; line-height: 38px; text-shadow: 0 2px 0 #000; padding: 0 12px; background: linear-gradient(#2a3d8a, #14245a); box-shadow: inset 0 0 0 2px var(--gold-line), 0 3px 0 #030716; }
.pg-faibles { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 3px 8px 3px 10px; font-size: 17px; background: #0a1233; box-shadow: inset 0 0 0 2px #22357a, 0 2px 0 #030716; }
.pg-faibles-t { color: var(--dim); }
.pg-types { display: inline-flex; gap: 4px; }
.pg-type { display: inline-block; padding: 0 8px; font-size: 17px; line-height: 24px; color: #0a1020; text-shadow: none; background: var(--c); box-shadow: inset 0 -3px 0 rgba(0,0,0,.25), 0 2px 0 #030716; animation: pgBrille 2.4s steps(8, end) infinite; }
.pg-pk .pg-type { font-size: 14px; line-height: 18px; padding: 0 5px; animation: none; }
.pg-pk .pg-type.fort { box-shadow: inset 0 -3px 0 rgba(0,0,0,.25), 0 0 0 2px var(--gold); }
@keyframes pgBrille { 0%, 80%, 100% { filter: none; } 88% { filter: brightness(1.35); } }

/* Bandeau : qui a la main, et le temps qui reste */
.pg-main { display: flex; align-items: center; gap: 12px; padding: 6px 10px 6px 6px; background: linear-gradient(90deg, #1b2c6e, #0f1b46 70%); box-shadow: inset 0 0 0 2px #2b3f8f, 0 3px 0 #030716; }
.pg-main.moi { background: linear-gradient(90deg, #4a3a0e, #1b2350 65%); box-shadow: inset 0 0 0 2px var(--gold-line), 0 3px 0 #030716; }
.pg-box.neuve .pg-main { animation: pgBandeau .35s steps(5, end); }
@keyframes pgBandeau { from { translate: -24px 0; opacity: 0; } to { translate: 0 0; opacity: 1; } }
.pg-qui { position: relative; flex: none; width: 64px; height: 64px; background: rgba(0, 0, 0, .35); box-shadow: inset 0 0 0 2px #31508f; }
.pg-main.moi .pg-qui { box-shadow: inset 0 0 0 2px var(--gold); }
.pg-qui img { width: 64px; height: 64px; image-rendering: pixelated; animation: pgRespire 1.6s steps(2, end) infinite; }
@keyframes pgRespire { 50% { translate: 0 -2px; } }
.pg-bulle { position: absolute; right: -16px; top: -12px; min-width: 26px; padding: 0 4px 4px; text-align: center; font-style: normal; font-size: 20px; line-height: 14px; color: #0a1020; background: #f4f6ff; box-shadow: 0 0 0 2px #0a1020, 0 2px 0 2px #030716; }
.pg-bulle b { animation: pgPoint 1.2s steps(1, end) infinite; opacity: 0; }
.pg-bulle b:nth-child(2) { animation-delay: .3s; } .pg-bulle b:nth-child(3) { animation-delay: .6s; }
.box h2.pg-q { margin: 0; font-size: 26px; line-height: 1.15; }
.pg-main.attend h2.pg-q { color: #eef3ff; }
.pg-sous { margin: 2px 0 0; font-size: 16px; line-height: 1.25; color: var(--dim); }
.pg-sous .pg-passe { color: var(--gold); }
.pg-sous .pg-peut { color: #b9c8ee; }
.pg-chrono { flex: none; display: grid; place-items: center; min-width: 64px; height: 48px; padding: 0 6px; background: #0a1233; box-shadow: inset 0 0 0 2px #2b3f8f; }
.pg-chrono .pg-sec { font-size: 26px; text-shadow: 0 2px 0 #000; }
.pg-chrono.vite { box-shadow: inset 0 0 0 2px var(--bad); animation: pgVite .5s steps(2, end) infinite; }
.pg-chrono.vite .pg-sec { color: #ffb0a0; }
/* Barre du temps : verte, puis rouge et clignotante les 5 dernières secondes */
.pg-barre { position: relative; height: 12px; margin-top: -4px; background: #0a1233; box-shadow: inset 0 0 0 2px var(--line-in, #2b3f8f); }
.pg-barre i { position: absolute; inset: 3px auto 3px 3px; max-width: calc(100% - 6px); background: linear-gradient(#9dffb0, var(--ok)); transition: width .1s linear; }
.pg-barre i.vite { background: linear-gradient(#ffb0a0, var(--bad)); animation: pgVite .5s steps(2, end) infinite; }
@keyframes pgVite { 50% { filter: brightness(1.5); } }

/* Les joueurs : hôte, qui a la main, ce que chacun a pris */
.pg-etat { display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: 17px; }
.pg-j { display: inline-flex; align-items: center; gap: 6px; padding: 0 10px 0 2px; min-height: 44px; background: #0f1b46; box-shadow: inset 0 0 0 2px #22357a; }
.pg-j.moi { background: #16245a; }
.pg-j.moi b { color: var(--gold); }
.pg-j.tour { box-shadow: inset 0 0 0 2px var(--gold); animation: pgTour 1s steps(2, end) infinite; }
.pg-j.a-pris { box-shadow: inset 0 0 0 2px var(--ok); }
.pg-j.a-pris .pg-st.pris { animation: pgPris .4s steps(4, end); }
@keyframes pgTour { 50% { filter: brightness(1.25); } }
@keyframes pgPris { 0% { scale: .6; } 60% { scale: 1.15; } 100% { scale: 1; } }
.pg-jn { display: inline-flex; align-items: center; gap: 4px; }
.pg-hote { display: inline-block; line-height: 0; filter: drop-shadow(0 1px 0 #000); }
.pg-hote .pxi { --k: 1px; }
.pg-st { display: inline-flex; align-items: center; gap: 4px; }
.pg-st.pris .pg-mini { width: 32px; height: 32px; }
.pg-tag { padding: 0 6px; font-size: 15px; line-height: 20px; color: #0a1020; background: var(--gold); box-shadow: 0 2px 0 #030716; }
.pg-mini { width: 40px; height: 40px; image-rendering: pixelated; }
.pg-pense i { animation: pgPoint 1.2s steps(1, end) infinite; opacity: 0; font-style: normal; }
.pg-pense i:nth-child(2) { animation-delay: .3s; } .pg-pense i:nth-child(3) { animation-delay: .6s; }
@keyframes pgPoint { 0%, 100% { opacity: 0; } 25%, 75% { opacity: 1; } }

/* Mes Pokémon */
.pg-legende { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: -2px 0 -4px; font-size: 14px; }
.pg-legende > span + .fav-etoile { margin-left: 10px; }
.pg-legende .pg-bon { position: static; }
.pg-box > .pg-grille { flex: 0 1 auto; }
.pg-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px 6px; overflow-y: auto; min-height: 112px; max-height: calc(52vh / var(--ui, 1)); padding: 6px 6px 6px 4px; overscroll-behavior: contain; }
.btn.pg-pk { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px 6px; border-width: 6px; min-width: 0; animation: pgCarte .25s steps(4, end) backwards; animation-delay: calc(var(--i) * 18ms); }
@keyframes pgCarte { from { opacity: 0; translate: 0 8px; } to { opacity: 1; translate: 0 0; } }
.btn.pg-pk.bon { background: linear-gradient(#3a3210, transparent 60%); }
.btn.pg-pk.choisi { outline: 3px solid var(--gold); outline-offset: -3px; filter: brightness(1.15); }
.btn.pg-pk.choisi .pg-pt > img { animation: pgSaut .5s steps(2, end) infinite; }
.btn.pg-pk.saute { animation: pgSaut .35s steps(4, end) 2; }
.btn.pg-pk.refuse { opacity: .45; filter: grayscale(.8); }
@keyframes pgSaut { 0%, 100% { translate: 0 0; } 50% { translate: 0 -3px; } }
.pg-pt { position: relative; width: 80px; height: 80px; background: rgba(0, 0, 0, .35); box-shadow: inset 0 0 0 2px #31508f; }
.btn.pg-pk.bon .pg-pt { box-shadow: inset 0 0 0 2px var(--gold-line); }
.pg-pt > img { display: block; width: 80px; height: 80px; image-rendering: pixelated; } /* (19/11) le portrait seulement : avant, l'étoile « conseillé » et l'étincelle shiny prenaient aussi 80 px */
/* une marque par coin, petite (au plus 18 px pour un portrait de 80 px) */
.pg-pt .pg-fav { position: absolute; left: -4px; top: -4px; z-index: 1; }
.pg-pt .pg-shiny { position: absolute; right: -5px; top: -5px; }
.pg-niv { position: absolute; left: 2px; bottom: 0; font-size: 14px; font-style: normal; line-height: 16px; text-shadow: 0 2px 0 #000, 1px 0 0 #000, -1px 0 0 #000; }
.pg-bon { position: absolute; right: -4px; bottom: -4px; z-index: 1; display: inline-grid; place-items: center; width: 17px; height: 17px; font-style: normal; line-height: 0;
  background: radial-gradient(circle at 40% 35%, #fff3b0, var(--gold) 45%, var(--gold2)); border-radius: 50%; box-shadow: 0 0 0 2px #3a2206, 0 2px 0 2px #030716; animation: pgBrille 1.6s steps(6, end) infinite; }
.pg-bon .pxi { --k: 1px; filter: brightness(1.6) saturate(.3); }
.pg-nom { font-size: 17px; line-height: 1.1; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pg-ty { display: flex; gap: 3px; }
.pg-obj { display: flex; gap: 2px; }
.pg-bd { width: 16px; height: 16px; image-rendering: pixelated; vertical-align: -2px; }
.pg-obj .pg-bd { width: 24px; height: 24px; }
.pg-vide { margin: 4px 0; padding: 8px 10px; font-size: 18px; background: #0f1b46; box-shadow: inset 0 0 0 2px #22357a; }
/* Fiche du Pokémon choisi */
.pg-fiche { display: flex; gap: 10px; align-items: center; padding: 4px 8px; background: #0f1b46; box-shadow: inset 0 0 0 2px var(--gold-line); font-size: 18px; animation: pgCarte .2s steps(4, end); }
.pg-fiche-img { width: 80px; height: 80px; image-rendering: pixelated; flex: none; }
.pg-conseil { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; color: var(--gold); font-size: 16px; }
.pg-conseil .pg-bon { position: relative; right: auto; bottom: auto; }
.pg-atts { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0; }
.pg-att { padding: 0 6px; font-size: 15px; line-height: 20px; background: #14245a; box-shadow: inset 3px 0 0 var(--c); }
.pg-objets { font-size: 15px; }
/* Boutons */
.pg-actions { justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
.btn.pg-passer { display: inline-flex; align-items: center; gap: 6px; padding-left: 4px; }
.btn.pg-passer .pg-mini { width: 32px; height: 32px; margin: -6px 0; }
.btn.pg-sans { color: #ffd0c0; }
/* Ceux qui attendent */
.pg-attente { display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 64px; font-size: 18px; }
.pg-attente.pret b { color: var(--gold); }
.pg-pret { width: 64px; height: 64px; image-rendering: pixelated; animation: pgSaut .6s steps(2, end) infinite; }
.pg-ball { flex: none; width: 32px; height: 32px; background: linear-gradient(#ff5a5a 0 45%, #111 45% 55%, #f4f4f4 55%); box-shadow: inset 0 0 0 3px #111; animation: pgRoule 1s steps(8, end) infinite; }
@keyframes pgRoule { to { rotate: 360deg; } }
/* « C'est parti ! » au départ */
.pg-parti { position: absolute; left: 50%; top: 50%; translate: -50% -50%; z-index: 3; padding: 4px 22px; font-size: 40px; color: var(--gold); text-shadow: 0 3px 0 #000; white-space: nowrap;
  background: linear-gradient(#2a3d8a, #14245a); box-shadow: inset 0 0 0 3px var(--gold), 0 4px 0 #030716; animation: pgTampon .4s steps(5, end); }
@keyframes pgTampon { 0% { scale: 2; opacity: 0; } 60% { scale: .9; opacity: 1; } 100% { scale: 1; } }
.pg-toast { position: fixed; left: 50%; top: 18%; translate: -50% 0; z-index: 80; padding: 8px 16px; background: #14245a; box-shadow: inset 0 0 0 2px var(--bad), 0 4px 0 #030716; font-size: 20px; animation: pgPop .3s steps(5, end); }
/* Téléphone (petit écran) : cartes plus petites, la liste garde la place */
@media (max-width: 700px), (max-height: 520px) {
  .pg-box { gap: 5px; }
  .pg-dg { font-size: 20px; line-height: 28px; } .pg-faibles { font-size: 14px; padding: 1px 6px; } .pg-type { font-size: 14px; line-height: 20px; }
  .pg-main { gap: 8px; padding: 3px 6px 3px 3px; }
  .pg-qui, .pg-qui img { width: 40px; height: 40px; }
  .box h2.pg-q { font-size: 19px; } .pg-sous { font-size: 13px; }
  .pg-chrono { min-width: 48px; height: 34px; } .pg-chrono .pg-sec { font-size: 19px; }
  .pg-barre { height: 8px; margin-top: -3px; } .pg-barre i { inset: 2px auto 2px 2px; }
  .pg-etat { font-size: 14px; gap: 4px 6px; } .pg-j { min-height: 34px; } .pg-mini { width: 32px; height: 32px; } .pg-st.pris .pg-mini { width: 28px; height: 28px; }
  .pg-legende { display: none; }
  .pg-grille { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); max-height: 34vh; min-height: 100px; }
  .pg-pt, .pg-pt > img { width: 64px; height: 64px; }
  .pg-fiche { font-size: 15px; } .pg-fiche-img { width: 48px; height: 48px; }
  .pg-attente { min-height: 44px; font-size: 15px; } .pg-pret { width: 44px; height: 44px; }
  .btn.pg-passer .pg-mini { width: 24px; height: 24px; }
}
/* Téléphone en paysage (peu de hauteur) : la liste prend toute la place qui reste ; la fiche et les explications
   s'effacent (le nom, le niveau et les types sont sur la carte, le bouton dit « Partir avec … ») */
@media (max-height: 520px) {
  .pg-box > .pg-grille { flex: 1 1 auto; max-height: none; min-height: 96px; }
  .pg-fiche { display: none; }
  .pg-sous > span:not(.pg-passe) { display: none; } .pg-sous:not(:has(.pg-passe)) { display: none; }
  .pg-bulle { display: none; }
  .btn.pg-pk { padding: 3px 2px 4px; } .pg-pk .pg-obj { display: none; }
  .pg-actions .btn { padding-top: 4px; padding-bottom: 4px; }
}

/* (24/11, demande de Kiko) tris, recherche et groupes (favoris, avantage de type, les autres) */
.pg-outils { gap: 4px; align-items: center; flex-wrap: nowrap; margin: 2px 0 0; }
.pg-tri-t { font-size: 15px; white-space: nowrap; }
.btn.mini.pg-tri { font-size: 15px; }
.pg-cherche { min-width: 120px; }
.pg-cherche .field { font-size: 18px; padding-top: 2px; padding-bottom: 2px; }
.pg-groupe { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; margin: 4px 0 -2px; font-size: 16px; color: #e8e8f8; }
.pg-groupe:first-child { margin-top: 0; }
.pg-groupe b { text-shadow: 0 2px 0 #101018; }
.pg-groupe .muted { font-size: 13px; }
.pg-groupe-l { flex: 1; height: 2px; background: linear-gradient(90deg, rgba(255,255,255,.35), transparent); }
.pg-groupe.pg-g-fav b { color: #ffe27a; } .pg-groupe.pg-g-fav .pg-groupe-l { background: linear-gradient(90deg, #ffd35c, transparent); }
.pg-groupe.pg-g-bon b { color: var(--gold, #ffd35c); } .pg-groupe.pg-g-bon .pg-groupe-l { background: linear-gradient(90deg, var(--gold-line, #c9a23a), transparent); }
.pg-groupe .pg-bon { position: static; }
.pg-rien { grid-column: 1 / -1; text-align: center; }
@media (max-width: 700px), (max-height: 520px) {
  .pg-tri-t { display: none; }
  .btn.mini.pg-tri { font-size: 13px; }
  .pg-cherche .field { font-size: 15px; }
  .pg-groupe { font-size: 13px; margin: 2px 0 -3px; }
}
