/* LES AMIS (Max, 03/10 ; conception-ranked/social/SPEC.md §12) : le bouton « Amis » de l'entrée et sa pastille, le panneau
   (#bdAmis : Amis, Demandes, Ajouter, Confidentialité), les cartes de notification (#bdNotifs), la bascule 1 VS 1 ⇄ 2 VS 2
   de la room (#hubFmtSw), la carte d'un membre parti jouer (« Regarder »), le spectateur extérieur (#specWho, #specFin),
   « Tes amis en ligne » (#partyAmis) et le bouton du profil d'un autre joueur (.pf-ami). La patte du nouveau menu : encre
   épaisse, ombres décalées, capitales italiques pour les titres, l'or pour l'action, la nuit pour les panneaux. PC et
   téléphone au même niveau : rien sous 12 px, des cibles de 44 px au doigt, rien de coupé sans points de suspension. */

/* (les panneaux posés sur la page, hors de l'entrée : la même unité que l'entrée — les boutons .hub-go et .hub-btn la lisent) */
.bd-amis-m, .bd-notifs, #partyModal, .spec-who, .spec-fin {
  --u: clamp(6px, min(0.521vw, 0.926vh), 15px);
  --out: 2px 2px 0 var(--ink), -1.5px -1.5px 0 var(--ink), 1.5px -1.5px 0 var(--ink), -1.5px 1.5px 0 var(--ink), 0 2px 0 var(--ink);
  --nuit: #1B1638; --nuit2: #120E28; --or: #FFD23F;
}
/* les pseudos des nouvelles listes : isolés du texte autour (écriture à l'envers), jamais plus larges que leur case */
.bd-nom-j { unicode-bidi: isolate; overflow-wrap: anywhere; min-width: 0; }

/* ═══ le bouton « Amis » de l'entrée : sa pastille chiffrée (demandes reçues + invitations) ═══ */
.hub-amis-n { position: absolute; z-index: 2; top: -8px; right: -8px; min-width: 22px; height: 22px; box-sizing: border-box; padding: 0 5px; border: 2.5px solid var(--ink); border-radius: 11px; background: #FF3B30; color: #fff; font: 800 13px/17px var(--fc); font-style: normal; text-align: center; box-shadow: 1.5px 1.5px 0 var(--ink); }
.hub-amis[aria-expanded="true"] { background: var(--gold); }

/* ═══ la bascule de la room : 1 VS 1 ⇄ 2 VS 2 (le chef choisit) ═══ */
.hl-fmt { flex: none; }
.hl-fmt button { min-height: calc(var(--u) * 6); }
.hl-fmt button[aria-disabled="true"] { cursor: not-allowed; }
.hl-fmt button[aria-disabled="true"]:not([aria-pressed="true"]) { color: rgba(21, 21, 21, 0.4); }
/* (« Prêt » terne : un membre de la room est parti jouer, la recherche de groupe attend son retour) */
.hub-go.terne { filter: grayscale(0.7) brightness(0.92); opacity: 0.72; }

/* ═══ la carte d'un membre parti jouer : son mode et « Regarder » ═══ */
.hl-st.hl-joue { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(var(--u) * 0.6); padding: calc(var(--u) * 0.8) calc(var(--u) * 1) calc(var(--u) * 1); background: linear-gradient(#FFC870, #F59A1C); color: var(--ink); animation: none; }
.hl-st.hl-joue > span { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* (l'état d'un membre, en bas de sa carte — « Regarde Kiro_88 », « Choisit sa balle… » : son texte est dans un span, la
   grille de .hl-st ne coupe pas avec « … » le texte qu'elle porte elle-même) */
.hl-st > span { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hl-regarder { min-height: 40px; padding: calc(var(--u) * 0.4) calc(var(--u) * 1.6) calc(var(--u) * 0.6); }
.hl-regarder svg { width: 1.4em; height: 1.4em; }
.hl-p.away:has(.hl-joue) { cursor: default; }

/* ═══ LE PANNEAU « AMIS » : il sort de la droite, toute la hauteur, dans la nuit du profil ═══ */
.modal.bd-amis-m { display: block; padding: 0; background: rgba(8, 6, 22, 0.45); }
.bd-amis {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(460px, 34vw); min-width: min(380px, 100vw); box-sizing: border-box; display: flex; flex-direction: column; gap: 10px;
  padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) 16px;
  border-left: 5px solid var(--ink); border-radius: 22px 0 0 22px; color: #fff;
  background: radial-gradient(ellipse 90% 40% at 70% 0%, rgba(255, 210, 63, 0.16), transparent 70%), repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0 10px, rgba(255, 255, 255, 0) 10px 20px), linear-gradient(170deg, #2A2260, var(--nuit) 45%, var(--nuit2));
  box-shadow: -8px 0 0 rgba(21, 21, 21, 0.45); animation: baIn 0.24s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes baIn { from { transform: translateX(104%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .bd-amis { animation: none; } .bn-card { animation: none !important; } }
.ba-head { flex: none; display: flex; align-items: center; gap: 10px; min-width: 0; }
.ba-hi { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border: 3px solid var(--ink); border-radius: 14px; background: #5B43D6; box-shadow: 3px 3px 0 var(--ink); }
.ba-hi svg { width: 34px; height: 34px; }
.ba-ht { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ba-ht h2 { margin: 0; font: italic 800 34px/0.95 var(--fc); text-transform: uppercase; letter-spacing: 0.5px; color: var(--or); text-shadow: var(--out), 3px 3px 0 var(--ink); padding: 0 4px 2px 0; }
.ba-ht small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 13px/1.1 var(--fc); letter-spacing: 1px; text-transform: uppercase; color: rgba(255, 255, 255, 0.78); }
.ba-ib { flex: none; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 3px solid var(--ink); border-radius: 12px; background: var(--card); color: var(--ink); box-shadow: 3px 3px 0 var(--ink); cursor: pointer; font: 800 20px/1 var(--fc); transition: transform 0.1s ease; }
.ba-ib svg { width: 24px; height: 24px; }
.ba-ib:hover { background: #fff; transform: translate(-1px, -1px); }
.ba-ib:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.ba-ib[aria-pressed="true"] { background: var(--or); }
.ba-tabs { flex: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 3px solid var(--ink); border-radius: 12px; background: var(--card); box-shadow: 3px 3px 0 var(--ink); overflow: hidden; }
.ba-tabs button { position: relative; min-height: 44px; min-width: 0; padding: 0 6px; border: 0; border-left: 3px solid var(--ink); background: none; color: var(--ink); cursor: pointer; font: italic 800 17px/1 var(--fc); text-transform: uppercase; letter-spacing: 0.5px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.ba-tabs button:first-child { border-left: 0; }
.ba-tabs button[aria-selected="true"] { background: var(--ink); color: var(--or); }
.ba-n { display: inline-grid; place-items: center; min-width: 20px; height: 20px; box-sizing: border-box; padding: 0 5px; border: 2px solid var(--ink); border-radius: 10px; background: #FF3B30; color: #fff; font: 800 12px/1 var(--fc); font-style: normal; }
.ba-tabs button[aria-selected="true"] .ba-n { border-color: var(--or); }
.ba-body { flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; gap: 8px; padding: 2px 6px 8px 2px; }
.ba-list { display: flex; flex-direction: column; gap: 8px; }
.ba-sec { margin: 8px 0 0; font: italic 800 18px/1 var(--fc); text-transform: uppercase; letter-spacing: 1px; color: var(--or); text-shadow: var(--out); }
.ba-sec:first-child { margin-top: 2px; }
.ba-vide { margin: 4px 2px; font: 600 14px/1.35 var(--fb); color: rgba(255, 255, 255, 0.8); }
.ba-vide-box { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 14px; border: 3px dashed rgba(255, 255, 255, 0.35); border-radius: 14px; }
.ba-lien { min-height: 44px; padding: 0 4px; border: 0; background: none; color: #fff; cursor: pointer; font: 700 14px/1 var(--fb); text-decoration: underline; text-underline-offset: 3px; }
.ba-back { align-self: flex-start; }

/* une ligne d'ami : son portrait (sa balle vitrine dans son cercle, son niveau, sa pastille d'état), son pseudo, son @, son
   état ; un bouton selon l'état, puis « ⋯ » */
.ba-row { position: relative; flex: none; display: grid; grid-template-columns: 48px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; min-height: 52px; box-sizing: border-box; padding: 6px 6px 6px 8px; border: 3px solid var(--ink); border-radius: 14px; background: var(--card); color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.ba-row[data-etat="hors"], .ba-row[data-etat="inconnu"] { background: #E4E0D6; }
.ba-row[data-etat="hors"] .ba-por img { filter: grayscale(0.85); opacity: 0.75; }
.ba-row.ba-bl { grid-template-columns: minmax(0, 1fr) auto; }
.ba-por { position: relative; display: block; width: 46px; height: 46px; }
.ba-por .ba-b { position: absolute; inset: 5px; width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--ink); box-sizing: border-box; object-fit: cover; background: #fff; }
.ba-por .ba-c { position: absolute; inset: -1px; width: 48px; height: 48px; pointer-events: none; }
.ba-lv { position: absolute; left: -4px; bottom: -4px; min-width: 20px; height: 18px; box-sizing: border-box; padding: 0 4px; border: 2px solid var(--ink); border-radius: 9px; background: var(--or); color: var(--ink); font: italic 800 12px/14px var(--fc); text-align: center; }
.ba-dot { position: absolute; right: -2px; bottom: -2px; width: 14px; height: 14px; border: 2.5px solid var(--ink); border-radius: 50%; background: #9AA3B2; }
.e-partie { background: #FF5A4E !important; } .e-file { background: var(--or) !important; } .e-regarde { background: #A970FF !important; }
.e-groupe, .e-salon { background: #4D8BFF !important; } .e-menu { background: #3DDC84 !important; } .e-hors, .e-inconnu { background: #9AA3B2 !important; }
/* (le pseudo, puis le @ s’il tient sur la ligne — sinon dessous ; l’état sur toute la largeur, sur deux lignes au besoin) */
.ba-txt { min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; row-gap: 1px; }
.ba-nom { flex: 0 1 auto; max-width: 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 800 18px/1.1 var(--fc); letter-spacing: 0.3px; }
.ba-at { flex: 0 0 auto; max-width: 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 12px/1.1 var(--fb); color: rgba(21, 21, 21, 0.58); }
.ba-etat { flex: 1 1 100%; min-width: 0; display: flex; align-items: flex-start; gap: 6px; font: 700 13px/1.2 var(--fb); color: rgba(21, 21, 21, 0.78); }
.ba-etat > span { min-width: 0; overflow-wrap: anywhere; }
.ba-etat.attente { color: #B5700A; }
.ba-pas { flex: none; width: 10px; height: 10px; margin-top: 0.22em; border: 2px solid var(--ink); border-radius: 50%; }
.ba-act { display: flex; align-items: center; gap: 6px; }
.ba-act .hub-go-s, .ba-act .hub-btn { min-height: 40px; padding: 0 12px; font-size: 15px; white-space: nowrap; }
.ba-act .hub-go-s { font: italic 800 16px/1 var(--fc); }
.ba-act .hub-btn svg { width: 22px; height: 22px; }
.ba-act .off, .ba-act [aria-disabled="true"] { filter: grayscale(1); opacity: 0.55; cursor: not-allowed; }
.ba-act .ba-invok { filter: none; opacity: 1; background: #3DDC84; cursor: default; }
.ba-more { width: 36px; height: 40px; padding: 0; border: 0; border-radius: 10px; background: none; color: var(--ink); cursor: pointer; font: 800 22px/1 var(--fc); }
.ba-more:hover, .ba-more[aria-expanded="true"] { background: rgba(21, 21, 21, 0.1); }
.ba-menu { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; padding-top: 2px; }
.ba-mb { min-height: 40px; padding: 0 12px; border: 2.5px solid var(--ink); border-radius: 10px; background: #fff; color: var(--ink); cursor: pointer; font: italic 800 14px/1 var(--fc); text-transform: uppercase; box-shadow: 2px 2px 0 var(--ink); }
.ba-mb.danger, .pf-ami .danger { background: #FFE1DD; color: #A31810; }
.ba-mb[data-sur="1"], .pf-ami .danger[data-sur="1"] { background: #E5484D; color: #fff; }
.ba-dem .ba-act.ba-two { flex-direction: row; }

/* « Ajouter » : le champ en haut, la réponse dessous */
.ba-add { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 3px solid var(--ink); border-radius: 14px; background: rgba(255, 255, 255, 0.08); }
.ba-lab { font: italic 800 15px/1 var(--fc); text-transform: uppercase; letter-spacing: 1px; color: rgba(255, 255, 255, 0.85); }
.ba-addr { display: flex; gap: 8px; min-width: 0; }
.ba-at-in { flex: 1; min-width: 0; }
.ba-at-in input { width: 100%; min-width: 0; height: 46px; box-sizing: border-box; padding: 0 10px; border: 3px solid var(--ink); border-radius: 11px; background: #fff; color: var(--ink); font: 700 17px/1 var(--fb); }
.ba-at-in i { color: rgba(21, 21, 21, 0.55); }
.ba-addr .hub-go-s { flex: none; min-height: 46px; padding: 0 16px; font: italic 800 17px/1 var(--fc); }
.ba-msg { margin: 0; min-height: 0; font: 700 14px/1.3 var(--fb); }
.ba-msg.ok { color: #6CF0A6; } .ba-msg.ko { color: #FF9C90; }

/* « Confidentialité » : deux interrupteurs */
.ba-sw { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 12px; border: 3px solid var(--ink); border-radius: 14px; background: var(--card); color: var(--ink); box-shadow: 3px 3px 0 var(--ink); cursor: pointer; }
.ba-swt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ba-swt b { font: 800 17px/1.15 var(--fc); }
.ba-swt small { font: 600 13px/1.25 var(--fb); color: rgba(21, 21, 21, 0.65); }
.ba-sw input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ba-swk { position: relative; flex: none; width: 54px; height: 30px; border: 3px solid var(--ink); border-radius: 15px; background: #C9C2B4; box-sizing: border-box; transition: background-color 0.15s ease; }
.ba-swk::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border: 2px solid var(--ink); border-radius: 50%; background: #fff; box-sizing: border-box; transition: transform 0.15s ease; }
.ba-sw input:checked ~ .ba-swk { background: #3DDC84; }
.ba-sw input:checked ~ .ba-swk::after { transform: translateX(24px); }
.ba-sw input:focus-visible ~ .ba-swk { outline: 3px solid #fff; outline-offset: 2px; }

/* un invité : les amis, c'est avec un compte */
.ba-invite { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 18px 16px; border: 3px solid var(--ink); border-radius: 16px; background: rgba(255, 255, 255, 0.07); }
.ba-ii { display: grid; place-items: center; width: 64px; height: 64px; border: 3px solid var(--ink); border-radius: 18px; background: #5B43D6; box-shadow: 3px 3px 0 var(--ink); }
.ba-ii svg { width: 48px; height: 48px; }
.ba-invite h3 { margin: 0; font: italic 800 26px/1 var(--fc); text-transform: uppercase; color: var(--or); text-shadow: var(--out); padding-right: 2px; }
.ba-invite p { margin: 0; font: 600 15px/1.4 var(--fb); color: rgba(255, 255, 255, 0.88); }
.ba-irow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.ba-ilien { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 6px; padding-top: 12px; border-top: 2px dashed rgba(255, 255, 255, 0.3); align-self: stretch; }
.ba-ilien small { font: italic 800 14px/1 var(--fc); text-transform: uppercase; letter-spacing: 1px; color: rgba(255, 255, 255, 0.75); }

/* ═══ LES CARTES DE NOTIFICATION : PC en haut à droite, sous la barre ; téléphone en haut au milieu ═══ */
.bd-notifs { position: fixed; z-index: 24; top: calc(env(safe-area-inset-top, 0px) + 92px); right: calc(env(safe-area-inset-right, 0px) + 18px); width: 380px; max-width: calc(100vw - 32px); display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.bd-notifs:empty { display: none; }
.bn-card { position: relative; pointer-events: auto; display: grid; grid-template-columns: 46px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; min-height: 64px; box-sizing: border-box; padding: 8px 8px 12px 10px; overflow: hidden; border: 4px solid var(--ink); border-radius: 16px; color: #fff; background: radial-gradient(ellipse 80% 90% at 0% 0%, rgba(255, 210, 63, 0.22), transparent 70%), linear-gradient(170deg, #34297A, var(--nuit)); box-shadow: 5px 5px 0 var(--ink); animation: bnIn 0.26s cubic-bezier(0.2, 0.9, 0.3, 1); }
@keyframes bnIn { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.bn-t { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
/* (la phrase sur deux lignes au plus : « Kiro_88 t’invite dans son groupe » en entier) */
.bn-l1 { min-width: 0; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere; font: 600 15px/1.2 var(--fb); }
.bn-l1 b { font: 800 17px/1 var(--fc); color: var(--or); }
.bn-l2 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 12px/1.2 var(--fc); letter-spacing: 1px; text-transform: uppercase; color: rgba(255, 255, 255, 0.78); }
.bn-l3 { font: italic 600 12px/1.2 var(--fb); color: #FFC870; }
.bn-go { min-height: 44px; padding: 0 14px; font: italic 800 17px/1 var(--fc); white-space: nowrap; }
.bn-tard { min-height: 44px; padding: 0 10px; font-size: 14px; }
.bn-x { width: 40px; height: 44px; padding: 0; border: 0; border-radius: 10px; background: none; color: #fff; cursor: pointer; font: 800 20px/1 var(--fc); }
.bn-x:hover { background: rgba(255, 255, 255, 0.12); }
.bn-demande { grid-template-columns: 46px minmax(0, 1fr) auto auto; }
.bn-oeil { display: grid; place-items: center; width: 44px; height: 44px; border: 3px solid var(--ink); border-radius: 12px; background: #A970FF; box-shadow: 2px 2px 0 var(--ink); }
.bn-oeil svg { width: 30px; height: 30px; }
.bn-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: rgba(0, 0, 0, 0.35); }
.bn-bar > i { position: absolute; inset: 0; background: var(--or); transform-origin: left center; transition: transform 0.5s linear; }
.bn-plus { pointer-events: auto; align-self: flex-end; padding: 4px 10px; border: 3px solid var(--ink); border-radius: 10px; background: var(--card); color: var(--ink); font: italic 800 15px/1 var(--fc); box-shadow: 3px 3px 0 var(--ink); }

/* ═══ LE SPECTATEUR EXTÉRIEUR : qui tu regardes (en haut au milieu), puis la fin de sa partie ═══ */
.spec-who { position: absolute; z-index: 3; top: calc(14px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); max-width: calc(100% - 420px); display: inline-flex; align-items: center; gap: 10px; box-sizing: border-box; padding: 8px 18px 9px 12px; border: 4px solid var(--ink); border-radius: 14px; background: linear-gradient(#3A2E86, var(--nuit)); color: #fff; box-shadow: 4px 4px 0 var(--ink); pointer-events: none; white-space: nowrap; }
.spec-who svg { flex: none; width: 30px; height: 30px; }
.spec-who .sw-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; font: 700 18px/1.1 var(--fb); }
.spec-who .sw-t b { font: italic 800 22px/1 var(--fc); color: var(--or); text-transform: uppercase; letter-spacing: 0.5px; }
.spec-who small { flex: none; font: 700 14px/1 var(--fc); letter-spacing: 1px; text-transform: uppercase; color: rgba(255, 255, 255, 0.78); }
.spec-who small:empty { display: none; }
.spec-who small::before { content: '· '; }
.spec-fin { position: absolute; z-index: 4; top: calc(18px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); box-sizing: border-box; display: grid; justify-items: center; gap: 8px; padding: 14px 26px 16px; border: 5px solid var(--ink); border-radius: 18px; background: radial-gradient(ellipse 70% 60% at 50% 0%, rgba(255, 210, 63, 0.3), transparent 70%), linear-gradient(#3A2E86, var(--nuit2)); color: #fff; box-shadow: 6px 6px 0 var(--ink); text-align: center; animation: bnIn 0.3s cubic-bezier(0.2, 0.9, 0.3, 1); }
.spec-fin small { font: 700 14px/1 var(--fc); letter-spacing: 1.5px; text-transform: uppercase; color: rgba(255, 255, 255, 0.8); }
.spec-fin small:empty { display: none; }
.spec-fin b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: italic 800 40px/1 var(--fc); text-transform: uppercase; color: var(--or); text-shadow: var(--out), 3px 3px 0 var(--ink); padding: 0 4px 3px 0; }
.spec-fin .hub-go-s { min-height: 44px; font: italic 800 20px/1 var(--fc); }

/* ═══ « Tes amis en ligne » dans la fenêtre du groupe ═══ */
.party-amis { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 4px; }
.party-amis:empty { display: none; }
.pa-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pa-head b { font: italic 800 20px/1 var(--fc); text-transform: uppercase; letter-spacing: 0.5px; }
.pa-head .ba-lien { color: var(--ink); font-size: 14px; }
.pa-note { margin: 0; font: 600 14px/1.3 var(--fb); color: var(--muted); }
.pa-list { max-height: 260px; overflow-y: auto; padding: 2px 6px 6px 2px; }
.pa-list .ba-row { grid-template-columns: 48px minmax(0, 1fr) auto; }

/* ═══ le profil d'un autre joueur : « Ajouter en ami », « Demande envoyée », « Ami ✓ »… ═══ */
#cpModal .pf-ami { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: calc(var(--u) * 0.6); }
#cpModal .pf-ami:empty { display: none; }
#cpModal .pf-ami .hub-go-s, #cpModal .pf-ami .hub-btn { min-height: 40px; padding: 0 14px; font: italic 800 15px/1 var(--fc); }
.pf-ami-t { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border: 2.5px solid var(--ink); border-radius: 10px; background: rgba(255, 255, 255, 0.14); color: #fff; font: italic 800 15px/1 var(--fc); text-transform: uppercase; letter-spacing: 0.5px; }
.pf-ami-t.ok { background: #3DDC84; color: var(--ink); }
.pf-ami-t.bl { background: #FFE1DD; color: #A31810; }
.pf-ami-menu { display: inline-flex; flex-wrap: wrap; gap: 6px; }

/* ═══════════════ au téléphone, couché (667 × 300 au pire) ═══════════════ */
@media (max-height: 520px) {
  .bd-amis-m, .bd-notifs, #partyModal, .spec-who, .spec-fin { --u: 4px; }
  .hub-amis-n { top: -7px; right: -7px; min-width: 20px; height: 20px; font-size: 12px; line-height: 15px; border-width: 2px; }
  .hl-fmt button { min-height: 44px; padding: 0 10px; font-size: 15px; }
  .hl-st.hl-joue { gap: 3px; padding: 4px 6px 5px; }
  .hl-regarder { min-height: 34px; padding: 0 10px; font-size: 14px; }
  /* (au doigt, tout le bandeau orange répond à « Regarder » : une cible de 44 px et plus) */
  .hl-st.hl-joue[data-act] { min-height: 64px; cursor: pointer; }
  .bd-amis { width: min(420px, 64vw); min-width: min(340px, 100vw); gap: 6px; border-left-width: 4px; border-radius: 16px 0 0 16px; padding: max(6px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) 16px; }
  .ba-hi { width: 40px; height: 40px; border-radius: 12px; }
  .ba-hi svg { width: 28px; height: 28px; }
  .ba-ht h2 { font-size: 26px; }
  .ba-ht small { font-size: 12px; }
  .ba-tabs button { min-height: 40px; font-size: 15px; }
  .ba-body { gap: 6px; }
  .ba-row { min-height: 48px; gap: 8px; padding: 4px 4px 4px 6px; grid-template-columns: 42px minmax(0, 1fr) auto auto; border-radius: 12px; }
  .ba-por { width: 42px; height: 42px; }
  .ba-por .ba-b { inset: 4px; width: 34px; height: 34px; }
  .ba-por .ba-c { width: 44px; height: 44px; }
  .ba-nom { font-size: 16px; }
  .ba-at { font-size: 12px; }
  .ba-etat { font-size: 12px; }
  .ba-act .hub-go-s, .ba-act .hub-btn { min-height: 44px; padding: 0 10px; font-size: 14px; }
  .ba-act .hub-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .ba-more { width: 44px; height: 44px; }
  .ba-add { padding: 8px 10px; }
  .ba-at-in input, .ba-addr .hub-go-s { height: 44px; min-height: 44px; }
  .ba-invite { padding: 12px; gap: 8px; }
  .ba-ii { width: 48px; height: 48px; } .ba-ii svg { width: 36px; height: 36px; }
  .ba-invite h3 { font-size: 21px; }
  .ba-invite p { font-size: 13px; }
  .bd-notifs { top: calc(env(safe-area-inset-top, 0px) + 56px); right: auto; left: 50%; transform: translateX(-50%); width: min(460px, calc(100vw - 32px)); gap: 6px; }
  .bn-card { min-height: 0; max-height: 60px; gap: 8px; padding: 4px 6px 8px 8px; border-width: 3px; border-radius: 12px; box-shadow: 3px 3px 0 var(--ink); grid-template-columns: 38px minmax(0, 1fr) auto auto; }
  .bn-card .ba-por { width: 38px; height: 38px; }
  .bn-card .ba-por .ba-b { inset: 3px; width: 32px; height: 32px; }
  .bn-card .ba-por .ba-c { width: 40px; height: 40px; }
  .bn-card .ba-lv { display: none; }
  .bn-l1 { font-size: 13px; } .bn-l1 b { font-size: 15px; }
  .bn-l2 { font-size: 12px; letter-spacing: 0.5px; }
  .bn-l3 { display: none; }
  .bn-go { min-height: 44px; padding: 0 10px; font-size: 15px; }
  .bn-x { width: 44px; }
  .ba-mb { min-height: 44px; }
  #cpModal .pf-ami .hub-go-s, #cpModal .pf-ami .hub-btn { min-height: 44px; }
  .bn-oeil { width: 38px; height: 38px; border-width: 2px; } .bn-oeil svg { width: 26px; height: 26px; }
  .spec-who { top: calc(8px + env(safe-area-inset-top)); max-width: calc(100% - 210px); gap: 6px; padding: 4px 10px 5px 8px; border-width: 3px; border-radius: 10px; box-shadow: 3px 3px 0 var(--ink); }
  .spec-who svg { width: 22px; height: 22px; }
  .spec-who .sw-lg { display: none; }
  .spec-who .sw-t b { font-size: 17px; }
  .spec-who small { font-size: 12px; letter-spacing: 0.5px; }
  .spec-fin { top: calc(10px + env(safe-area-inset-top)); gap: 4px; padding: 8px 16px 10px; border-width: 3px; border-radius: 14px; box-shadow: 4px 4px 0 var(--ink); }
  .spec-fin b { font-size: 28px; }
  .spec-fin small { font-size: 12px; }
  .party-amis { gap: 4px; margin: 2px 0; }
  .pa-head b { font-size: 16px; }
  .pa-head .ba-lien { font-size: 13px; }
  .pa-list { max-height: 112px; gap: 6px; }
  /* (la fenêtre du groupe avec des amis à inviter, au doigt, couché : à gauche le texte et le groupe, à droite « Tes amis
     en ligne », qui défile dans la hauteur de la colonne de gauche ; le lien, en dessous, sur toute la largeur : il reste
     à l'écran) */
  #partyModal .party-box:has(.pa-list) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-content: start; column-gap: 16px; width: min(900px, 100%); }
  #partyModal .party-box:has(.pa-list) > * { grid-column: 1 / -1; }
  #partyModal .party-box:has(.pa-list) > .party-help, #partyModal .party-box:has(.pa-list) > .party-list { grid-column: 1; }
  #partyModal .party-box:has(.pa-list) > .party-amis { grid-column: 2; grid-row: 2 / span 2; contain: size; min-height: 0; margin: 0 0 8px; overflow-y: auto; }
  #partyModal .party-box:has(.pa-list) .pa-list { max-height: none; overflow: visible; }
  /* (la room à 3, au doigt : trois cartes plus grandes que celles d’un salon nombreux — les pseudos et « Changer de balle »
     tiennent) */
  .bd-hub .hub-lobby[data-layout="many"] .hl-players:not(.many) { --s: 74px; }
  .bd-hub .hub-lobby[data-layout="many"] .hl-players:not(.many) .hl-pick { max-width: calc(100% - 8px); white-space: normal; line-height: 1.05; font-size: 12px; padding: 3px 6px 4px; }
}
/* (un grand écran de PC : le panneau, les cartes et le spectateur grandissent avec l’entrée — mesurés au 1 366) */
@media (min-width: 1700px) and (min-height: 950px) { .bd-amis, .bd-notifs, .spec-who, .spec-fin { zoom: 1.3; } }
@media (max-height: 340px) {
  .ba-ht small { display: none; }
  .bd-amis { padding-top: max(4px, env(safe-area-inset-top)); padding-bottom: max(4px, env(safe-area-inset-bottom)); }
  /* (la fenêtre du groupe à deux colonnes : « Copier le lien » entier à l'écran, même à 300 px de haut) */
  #partyModal .party-box:has(.pa-list) > .party-help { margin-bottom: 4px; font-size: 12px; line-height: 1.28; }
  #partyModal .party-box:has(.pa-list) > .party-list { gap: 6px; margin-bottom: 6px; }
}
/* (au plus bas — 667 × 300 : la carte d'un membre parti jouer n'a pas la place de son mode ET de « Regarder » ; avant, le
   bandeau débordait de la carte et passait sous « Jouer » à 2, la carte dépassait de sa liste à 3 : « Regarder » seul, le
   bandeau entier reste la cible) */
@media (max-height: 320px) {
  .hl-st.hl-joue > span { display: none; }
  .hl-st.hl-joue[data-act] { min-height: 40px; padding: 2px 6px; }
  .hl-regarder { min-height: 32px; }
}
