/* ============================================================================
   LudiInvit — habillage de l'invitation.

   Fond sombre en toutes circonstances, comme le panneau de règles et pour la
   même raison : une invitation RECOUVRE le jeu, elle doit s'en détacher.
   Seuls les accents suivent le thème.
   ========================================================================== */

.li-voile {
  position: fixed; inset: 0; z-index: 9200;
  display: flex; align-items: center; justify-content: center;
  padding: 4vmin;
  background: rgba(8, 6, 16, .66);
  backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .2s ease;
}
.li-voile.est-ouvert { opacity: 1; }

.li-carte {
  width: min(430px, 100%);
  background: linear-gradient(rgba(24, 20, 52, .985), rgba(13, 10, 30, .99));
  color: #ece8f8;
  border: 1px solid var(--or, var(--gold, #e7c96b));
  border-radius: 20px;
  box-shadow: 0 26px 70px rgba(0, 0, 0, .6);
  overflow: hidden;
  transform: translateY(16px) scale(.98);
  transition: transform .26s cubic-bezier(.2, .9, .3, 1.25);
}
.li-voile.est-ouvert .li-carte { transform: none; }

/* ---------------------------------------------------------------- la tête */
.li-tete {
  display: flex; align-items: center; gap: 13px;
  padding: 16px 16px 14px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .09), transparent 70%);
  border-bottom: 1px solid rgba(255, 255, 255, .10);
}
/*  Le portrait arrive parfois APRÈS l'ouverture : le manifeste des
    personnages se charge en réseau. On réserve donc sa place dès le départ,
    sinon la carte sursaute quand l'image se pose.
    **Une image qui arrive en retard doit occuper sa place d'avance.**  */
.li-portrait {
  flex: none; width: 62px; height: 62px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .07);
  border: 2px solid var(--or, var(--gold, #e7c96b));
  overflow: hidden;
  display: flex; align-items: flex-end; justify-content: center;
}
.li-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.li-portrait.est-arrive img { animation: li-pop .3s ease-out; }
@keyframes li-pop { from { transform: scale(.8); opacity: 0; } to { transform: none; opacity: 1; } }

.li-tete-txt { flex: 1; min-width: 0; }
.li-sur {
  font: 700 12px/1 system-ui, sans-serif;   /* 10,5 px : sous la barre de lisibilité */
  text-transform: uppercase; letter-spacing: .1em;
  color: inherit; opacity: .6; margin-bottom: 4px;
}
.li-tete h3 {
  margin: 0;
  font: 700 19px/1.2 Georgia, 'Times New Roman', serif;
  color: var(--or, var(--gold, #e7c96b));
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/*  32 × 32 pour la seule sortie de la carte au doigt : douze pixels sous le
    plancher tactile, dans un coin où l'on vise mal.  */
.li-fermer {
  flex: none; width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  font: 400 16px/1 system-ui, sans-serif;
  color: inherit; background: rgba(255, 255, 255, .08);
  border: 0; border-radius: 10px; cursor: pointer; transition: background .16s;
}
.li-fermer:hover { background: rgba(255, 255, 255, .17); }

/* --------------------------------------------------------------- le corps */
.li-corps { padding: 18px 18px 6px; }
.li-phrase {
  margin: 0 0 16px;
  font: italic 400 17px/1.5 Georgia, 'Times New Roman', serif;
  transition: opacity .14s ease;
  min-height: 3.1em;              /* la carte ne saute pas au changement */
}
.li-phrase b { font-style: normal; color: var(--or, var(--gold, #e7c96b)); }

.li-qui { display: flex; align-items: center; gap: 10px; font: 400 14px/1.3 system-ui, sans-serif; }
.li-avatar {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  object-fit: cover; border: 1px solid rgba(255, 255, 255, .3);
  background: rgba(255, 255, 255, .07);
}
.li-avatar-lettre {
  display: flex; align-items: center; justify-content: center;
  font: 700 15px/1 system-ui, sans-serif;
  color: var(--or, var(--gold, #e7c96b));
}

.li-lien {
  margin-top: 14px; padding: 9px 11px;
  background: rgba(0, 0, 0, .3);
  border: 1px dashed rgba(255, 255, 255, .18);
  border-radius: 10px;
  /*  11,5 px pour l'adresse qu'on est censé lire et recopier : c'est la ligne
      la plus utile de la carte, et c'était la plus petite.  */
  font: 400 12.5px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  opacity: .72;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------------------------------------------------------------- le pied */
.li-pied {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 16px 18px 18px;
}
/*  38 px et 33 px calculés pour les deux boutons de la carte : sous le
    plancher tactile, sur l'écran où l'on accepte ou refuse une invitation.  */
.li-cta {
  flex: 1 1 140px;
  font: 700 14px/1 system-ui, sans-serif;
  color: #241c04;
  background: linear-gradient(var(--or, var(--gold, #e7c96b)), #c9a13f);
  border: 0; border-radius: 11px; padding: 12px 14px;
  min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: transform .15s, box-shadow .15s;
}
.li-cta:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
.li-cta-2 { background: rgba(255, 255, 255, .10); color: inherit; }
/*  Sans fond, ce bouton n'est QUE sa bordure : .16 la laissait à 1,54:1, soit
    la moitié des 3:1 exigés pour le contour d'une commande. À .38 : 3,1:1.  */
.li-autre {
  flex: 1 1 100%;
  font: 600 13px/1 system-ui, sans-serif;
  color: inherit; opacity: .72;
  background: none; border: 1px solid rgba(255, 255, 255, .38);
  border-radius: 11px; padding: 10px 12px;
  min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: opacity .15s, background .15s;
}
.li-autre:hover { opacity: 1; background: rgba(255, 255, 255, .07); }

@media (max-width: 480px) {
  .li-carte { width: 100%; border-radius: 18px; }
  .li-phrase { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .li-voile, .li-carte, .li-cta, .li-phrase { transition: none; }
  .li-carte { transform: none; }
  .li-portrait.est-arrive img { animation: none; }
}
