/* Discussion du salon (31/10, playtest 2.12-2.13) : plus grande et plus légère (fond plus transparent, le texte garde
   une ombre pour rester lisible sur le décor), saisie en gros caractères. En écrivant, on revoit les derniers messages. */
#chat { width: min(760px, 62vw); bottom: 104px; gap: 6px; }
#chat .chat-log { gap: 3px; }
#chat .chat-log div {
  max-width: 100%; overflow-wrap: anywhere;
  padding: 3px 12px; font-size: 22px; line-height: 1.25;
  background: rgba(8, 15, 40, .48); border: 1px solid rgba(127, 166, 239, .32);
  text-shadow: 0 2px 0 #000, 0 0 6px rgba(0, 0, 0, .85);
  animation: chat-in .22s ease-out;
}
#chat .chat-log b { color: #9ef0ff; }
#chat.ecrit .chat-log div.old { opacity: .8; transition: opacity .2s; }
#chat .chat-in { font-size: 24px; padding: 8px 12px; background: rgba(8, 15, 40, .88); }
#chat .chat-in::placeholder { color: rgba(232, 240, 255, .55); }
#chat .chat-send { width: 52px; font-size: 22px; }
body.grand-texte #chat .chat-log div { font-size: 26px; }
body.grand-texte #chat .chat-in { font-size: 27px; }
@keyframes chat-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Téléphone : la discussion reste en haut, un peu moins grande pour laisser voir le jeu. */
body.is-touch #chat .chat-log div { font-size: 18px; padding: 2px 10px; }
body.is-touch #chat .chat-in { font-size: 18px; padding: 7px 10px; }
@media (prefers-reduced-motion: reduce) { #chat .chat-log div { animation: none; } }

/* Amis (31/10, playtest 2.8-2.11) : étoile des favoris à gauche, vrai bouton « Retirer » (croix + mot) à droite, confirmé avant. */
.ami { gap: 8px; }
.ami.fav { border-color: var(--gold-line); box-shadow: inset 0 0 0 1px rgba(255, 216, 90, .25); }
.ami .f-fav { min-width: 58px; min-height: 50px; padding: 2px 6px 2px 18px; }
.ami .f-fav img { transition: transform .15s; }
.ami .f-fav.pop img { animation: fav-pop .35s ease-out; }
.ami .f-del { margin-left: 6px; min-height: 50px; }
.ami .f-del:hover, .ami .f-del.focus { color: #fff; filter: drop-shadow(0 0 4px rgba(255, 110, 110, .6)); }
@keyframes fav-pop { 0% { transform: scale(.6) rotate(-20deg); } 60% { transform: scale(1.35) rotate(8deg); } 100% { transform: none; } }
/* Salon : état de chaque joueur (2.19) */
.lob-etat { display: inline-flex; align-items: center; gap: 4px; font-size: 16px; }
.lob-etat.pret { color: #8ff09a; animation: pret-in .3s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pret-in { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
/* Salon : « + Ami » à côté d'un joueur qui a un compte */
.add-ami { min-width: 0; padding: 2px 8px; font-size: 15px; border-color: rgba(158, 240, 255, .5); color: #9ef0ff; }
.add-ami:disabled { opacity: .7; color: var(--ok, #7fe08a); border-color: rgba(127, 224, 138, .5); }

/* Expéditions en salon (31/10, playtest 2.15-2.18) : choix de l'hôte, propositions des amis (leur tête sur la carte). */
.dep-modal .dg { position: relative; }
.dep-aide { margin: 6px 0 0; font-size: 17px; }
.dep-modal .dg.envie-moi { box-shadow: 0 0 0 2px #9ef0ff, 0 0 14px rgba(158, 240, 255, .35); }
/* (5/11) donjon ou N+ que l'hôte n'a pas, proposé par un ami qui l'a débloqué : en jaune, on peut le lancer */
.dep-modal .dg.propose { border-color: var(--gold, #ffd35c); background-image: linear-gradient(rgba(255, 211, 92, .16), rgba(255, 211, 92, .05));
  box-shadow: 0 0 0 2px var(--gold-line, #b88a2e), 0 0 12px rgba(255, 211, 92, .3); animation: prop-pulse 1.6s steps(4) infinite; }
.dep-modal .dg.propose.sel { animation: none; }
.dep-modal .prop-t { color: var(--gold, #ffd35c); }
.dep-modal .btn.propose:not(.primary) { border-color: var(--gold, #ffd35c); color: var(--gold, #ffd35c); }
.dep-modal .btn.propose.primary { box-shadow: 0 0 0 2px var(--gold, #ffd35c); }
@keyframes prop-pulse { 50% { box-shadow: 0 0 0 2px var(--gold, #ffd35c), 0 0 18px rgba(255, 211, 92, .45); } }
.dg-hote { position: absolute; top: -11px; left: 10px; padding: 1px 8px; font-size: 14px; color: #2a1a00;
  background: linear-gradient(#ffe58a, #f2b93b); border: 1px solid #8a5a10; border-radius: 3px; box-shadow: 0 2px 0 rgba(0, 0, 0, .4); white-space: nowrap; }
.dg-envies { position: absolute; top: 6px; right: 8px; display: flex; gap: 3px; }
.dg-envie { position: relative; width: 36px; height: 36px; border: 2px solid #9ef0ff; border-radius: 50%; background: rgba(8, 15, 40, .85);
  overflow: visible; animation: envie-in .35s cubic-bezier(.2, 1.6, .4, 1); }
.dg-envie.moi { border-color: var(--gold-line, #ffd35c); }
.dg-envie img { width: 100%; height: 100%; border-radius: 50%; image-rendering: pixelated; object-fit: cover; }
.dg-envie i { position: absolute; bottom: -7px; left: 50%; transform: translateX(-50%); padding: 0 3px; font-style: normal; font-size: 12px;
  color: #fff; background: #b8323a; border-radius: 3px; white-space: nowrap; }
#rdy.pret { filter: hue-rotate(80deg) saturate(1.2); }
@keyframes envie-in { from { transform: scale(0) translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Pastilles de touches (2.3) : inutiles au doigt, sauf si on branche une manette sur le téléphone. */
body.is-touch:not(.a-la-manette) .key[data-act] { display: none; }

/* Fenêtre des expéditions (31/10) : le titre et « Fermer » restent en haut, « Partir ! » / « Je suis prêt » en bas, même quand on défile. */
.dep-box .dep-haut { position: sticky; top: -2px; z-index: 2; padding: 4px 0 6px; background: linear-gradient(rgba(10, 18, 44, .98) 80%, rgba(10, 18, 44, 0)); }
.dep-box .dep-bas { position: sticky; bottom: -2px; z-index: 2; padding: 8px 0 4px; background: linear-gradient(rgba(10, 18, 44, 0), rgba(10, 18, 44, .98) 25%); }
/* (13/11, Kiko) Les crans N+ sont collés en bas avec « Partir ! » (zone fixe .dep-pied), toujours visibles : plus besoin de
   défiler jusqu'en bas de la liste des donjons, ni après avoir changé de donjon. Liseré en pixels au-dessus, comme la ROM. */
.dep-box .dep-pied { position: sticky; bottom: -2px; z-index: 2; margin: 10px -6px 0; padding: 6px 6px 2px; background: #0a122c;
  box-shadow: 0 -2px 0 #4060c0, 0 -4px 0 #05081a, 0 -12px 10px -6px rgba(10, 18, 44, .9), 0 10px 0 #0a122c; } /* (la dernière ombre cache le bas de la liste sous la zone) */
.dep-box .dep-pied .dep-bas { position: static; background: none; padding: 6px 0 2px; margin-top: 4px !important; }
.dep-crans { display: flex; align-items: center; gap: 4px 10px; flex-wrap: wrap; }
.box .dep-crans h3 { margin: 0; font-size: 22px; white-space: nowrap; }
.dep-crans-l { flex: 1 1 320px; gap: 6px; align-items: center; flex-wrap: wrap; }
.dep-crans-l .btn[data-t] { min-width: 64px; padding-left: 8px; padding-right: 8px; }
.dep-crans-l .btn.primary[data-t] { animation: cran-pop .18s steps(3, end); }
@keyframes cran-pop { from { transform: scale(.88); } to { transform: none; } }
.dep-crans-aide { flex: 1 1 260px; line-height: 1.2; }
/* Téléphone couché (peu de hauteur) : tout sur une ligne serrée, l'explication sur 2 lignes au plus (le texte entier en infobulle) */
@media (max-height: 520px) {
  .dep-box .dep-pied { margin-top: 6px; padding-top: 4px; }
  .box .dep-crans h3 { font-size: 18px; }
  .dep-crans-l { gap: 4px; }
  .dep-crans-l .btn[data-t] { min-width: 0; padding: 4px 8px; font-size: 15px; }
  .dep-crans-aide { font-size: 13px !important; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .dep-box .dep-pied .dep-bas { padding-top: 3px; margin-top: 2px !important; }
}
/* Téléphone debout (étroit) : boutons plus petits, la zone fixe reste basse */
@media (max-width: 600px) {
  .box .dep-crans h3 { font-size: 18px; }
  .dep-crans-l { gap: 4px; flex-basis: 100%; }
  .dep-crans-l .btn[data-t] { min-width: 0; padding: 4px 8px; font-size: 15px; }
  .dep-crans-aide { font-size: 13px !important; }
}
@media (prefers-reduced-motion: reduce) { .dep-crans-l .btn.primary[data-t] { animation: none; } }

/* Fin d'expédition et bilan de la Tour (31/10) : sur un petit écran, les boutons de retour restent collés en bas pendant qu'on défile. */
.res-bas { position: sticky; bottom: -14px; z-index: 3; margin-left: -12px; margin-right: -12px; padding: 10px 12px 12px;
  background: linear-gradient(rgba(8, 14, 36, 0), rgba(8, 14, 36, .97) 30%); }
