/* ==========================================================================
   Nextendo Network — styles de la couche UI partagée (nx-ui.js) :
   sélecteur de langue, chip profil connecté, rich presence amis. RTL inclus.
   ========================================================================== */

/* ---- sélecteur de langue ---- */
.lang-switch { position: relative; }
.lang-switch__btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.5rem 0.72rem; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--line);
  color: var(--muted); font: inherit; font-size: 0.86rem; font-weight: 600;
  cursor: pointer; transition: color .2s var(--ease), border-color .2s var(--ease);
}
.lang-switch__btn:hover { color: var(--ink); border-color: var(--primary); }
.lang-switch__flag { font-size: 1.05rem; line-height: 1; }
.lang-switch__btn > i { font-size: 0.82rem; transition: transform .2s var(--ease); }
.lang-switch.open .lang-switch__btn > i { transform: rotate(180deg); }
.lang-switch__menu {
  position: absolute; top: calc(100% + 0.5rem); right: 0; min-width: 186px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r);
  padding: 0.35rem; display: none; flex-direction: column; gap: 2px; z-index: var(--z-nav);
  box-shadow: 0 18px 50px -22px rgba(0,0,0,.7); max-height: 74vh; overflow: auto;
}
.lang-switch.open .lang-switch__menu { display: flex; }
.lang-switch__item {
  display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.7rem;
  border-radius: 10px; background: none; border: 0; color: var(--muted);
  font: inherit; font-size: 0.92rem; text-align: left; cursor: pointer; width: 100%;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.lang-switch__item:hover { background: color-mix(in oklch, var(--ink) 8%, transparent); color: var(--ink); }
.lang-switch__item.is-active { color: var(--primary-bright); font-weight: 600; }
.lang-switch__btn > i.ph-translate { font-size: 1.05rem; }
.lang-switch__code { font-family: var(--mono); font-weight: 600; }
.lang-switch__item .lang-switch__code { min-width: 2.1em; text-align: center; color: var(--faint); font-size: 0.78rem; font-weight: 500; }
.lang-switch__item.is-active .lang-switch__code { color: var(--primary-bright); }

/* ---- chip profil (connecté) ---- */
.nx-chip { position: relative; }
.nx-chip__btn {
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding: 0.32rem 0.62rem 0.32rem 0.38rem; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--line); color: var(--ink);
  font: inherit; cursor: pointer; transition: border-color .2s var(--ease);
}
.nx-chip__btn:hover { border-color: var(--primary); }
.nx-chip__av {
  width: 30px; height: 30px; border-radius: 50%; overflow: hidden; flex: 0 0 auto;
  display: grid; place-items: center; background: var(--surface-2); color: var(--ink);
  font-weight: 700; font-size: 0.95rem;
}
.nx-chip__av img { width: 100%; height: 100%; object-fit: cover; }
.nx-chip__av i { font-size: 1.05rem; }
.nx-chip__av--lg { width: 44px; height: 44px; font-size: 1.2rem; }
.nx-chip__meta { display: flex; flex-direction: column; line-height: 1.15; text-align: left; max-width: 150px; }
.nx-chip__name { font-weight: 600; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nx-chip__fc { font-size: 0.72rem; color: var(--faint); font-family: var(--mono); }
.nx-chip__btn > i { font-size: 0.8rem; color: var(--muted); transition: transform .2s var(--ease); }
.nx-chip.open .nx-chip__btn > i { transform: rotate(180deg); }
.nx-chip__menu {
  position: absolute; top: calc(100% + 0.5rem); right: 0; min-width: 244px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 0.5rem; display: none; flex-direction: column; gap: 2px; z-index: var(--z-nav);
  box-shadow: 0 18px 50px -22px rgba(0,0,0,.7);
}
.nx-chip.open .nx-chip__menu { display: flex; }
.nx-chip__head { display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 0.7rem 0.7rem; border-bottom: 1px solid var(--line-soft); margin-bottom: 0.35rem; }
.nx-chip__live { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.78rem; color: var(--signal); margin-top: 0.15rem; }
.nx-chip__item {
  display: flex; align-items: center; gap: 0.65rem; padding: 0.6rem 0.7rem;
  border-radius: 10px; background: none; border: 0; color: var(--muted);
  font: inherit; font-size: 0.92rem; text-align: left; cursor: pointer; text-decoration: none; width: 100%;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.nx-chip__item:hover { background: color-mix(in oklch, var(--ink) 8%, transparent); color: var(--ink); }
.nx-chip__item i { font-size: 1.1rem; }
.nx-chip__item--danger:hover { color: oklch(0.72 0.16 25); }

/* ---- rich presence (page perso : ami en jeu) ---- */
.friend__status--game { color: var(--primary-bright); }
.friend__game {
  display: inline-flex; align-items: center; gap: 0.35rem; max-width: 15ch;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.friend__game i { font-size: 0.95rem; }
.friend__dot.playing { background: var(--primary-bright); box-shadow: 0 0 0 3px color-mix(in oklch, var(--primary) 28%, transparent); }
.fm-badge--game { color: var(--primary-bright); }
.fm-now {
  display: flex; align-items: center; gap: 0.6rem; margin: 0.5rem 0 0.2rem;
  padding: 0.55rem 0.75rem; border-radius: var(--r); border: 1px solid var(--line-soft);
  background: color-mix(in oklch, var(--primary) 8%, transparent);
}
.fm-now__ico { font-size: 1.3rem; color: var(--primary-bright); }
.fm-now__k { font-size: 0.72rem; color: var(--faint); text-transform: uppercase; letter-spacing: .04em; }
.fm-now__v { font-weight: 600; font-size: 0.95rem; }

/* ---- RTL (arabe) ---- */
[dir="rtl"] .lang-switch__menu,
[dir="rtl"] .nx-chip__menu { right: auto; left: 0; }
[dir="rtl"] .lang-switch__item,
[dir="rtl"] .nx-chip__meta,
[dir="rtl"] .nx-chip__item { text-align: right; }
[dir="rtl"] .nx-chip__btn { padding: 0.32rem 0.38rem 0.32rem 0.62rem; }

/* ---- responsive : garder sélecteur + chip visibles, alléger le texte ---- */
@media (max-width: 720px) {
  .nx-chip__meta { display: none; }
  .lang-switch__code { display: none; }
}
