/* My account: same tokens as the home page (rework.css). The sky stays, lower and calmer. */

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.petit { color: var(--texte-doux); font-size: 0.93rem; }

.grille-compte { grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); align-items: start; }
.colonne { display: grid; gap: 22px; min-width: 0; }
.membre { grid-column: 1 / -1; }
.titre-plaque { font-size: 1.3rem; font-weight: 800; margin-bottom: 16px; }
.entete-plaque { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.entete-plaque .titre-plaque { margin: 0; }
.intro { color: var(--texte-doux); margin: -4px 0 14px; }
.sous-titre { font-family: var(--corps); font-size: 1rem; font-weight: 700; color: var(--horizon); margin: 4px 0 8px; }
.sous-titre + .demandes { margin-bottom: 14px; }

/* --- Member card -------------------------------------------------------------------------- */
/* The banner is a plain backdrop. Only the photo climbs onto it (negative margin on the photo
   alone); the name, the friend code and the button all sit below it. */

.membre { overflow: hidden; padding: 0; }
.membre-ciel {
  height: 132px;
  background:
    radial-gradient(40% 150% at 84% 120%, rgba(255, 194, 138, 0.9), rgba(255, 140, 110, 0.35) 45%, transparent 70%),
    linear-gradient(180deg, #2a1650 0%, #6b2566 55%, #c94667 100%);
}
.membre-corps {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; column-gap: 22px; row-gap: 14px;
  padding: 0 clamp(18px, 3vw, 30px) clamp(18px, 3vw, 26px);
}
.membre-photo {
  width: 128px; height: 128px; border-radius: 50%; object-fit: cover;
  margin-top: -64px;
  border: 5px solid #1d1238; background: var(--nuit-2);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}
.membre-texte { padding-top: 16px; min-width: 0; }
.membre-texte h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); font-weight: 800; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.presence { display: flex; align-items: center; gap: 8px; margin-top: 6px; color: var(--texte-doux); }
.presence-point { flex: none; width: 10px; height: 10px; border-radius: 50%; background: #6d6390; }
.presence--enligne .presence-point { background: var(--horizon); box-shadow: 0 0 0 5px rgba(255, 176, 112, 0.18); }
.presence--enjeu .presence-point { background: var(--vivant); box-shadow: 0 0 0 5px rgba(98, 227, 164, 0.16); }
.presence--enligne, .presence--enjeu { color: var(--texte); }
.puces { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.puces li { padding: 4px 12px; border-radius: 999px; font-size: 0.9rem; background: var(--carte); border: 1px solid var(--carte-bord); color: var(--texte-doux); }

.membre-actions { padding-top: 16px; display: grid; justify-items: end; gap: 10px; }
.code-ami { display: grid; justify-items: end; gap: 6px; }
.code-bouton {
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer; min-height: 44px;
  font: inherit; color: var(--texte); background: rgba(12, 10, 29, 0.5);
  border: 1px solid var(--carte-bord); border-radius: 14px; padding: 8px 14px;
  transition: border-color 160ms ease;
}
.code-bouton:hover { border-color: rgba(255, 176, 112, 0.5); }
.code-bouton strong { font-family: var(--titre); font-size: 1.02rem; letter-spacing: 0.03em; font-variant-numeric: tabular-nums; }

/* --- Activity ------------------------------------------------------------------------------- */

.maintenant {
  display: flex; align-items: center; gap: 14px; padding: 14px;
  border-radius: var(--r-carte); background: var(--carte); border: 1px solid var(--carte-bord);
  margin-bottom: 12px;
}
.maintenant img, .maintenant .vide-ico { flex: none; width: 64px; height: 64px; border-radius: 16px; object-fit: cover; background: var(--nuit-2); }
.maintenant .vide-ico { display: grid; place-items: center; color: var(--horizon); }
.maintenant > div { min-width: 0; }
.maintenant small { display: block; color: var(--texte-doux); font-size: 0.9rem; }
.maintenant strong { display: block; font-family: var(--titre); font-size: 1.05rem; line-height: 1.25; margin: 2px 0; }
.maintenant span { color: var(--texte-doux); font-size: 0.95rem; }

.compteurs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; }
.compteurs > div { padding: 14px 16px; border-radius: 16px; background: var(--carte); border: 1px solid var(--carte-bord); min-width: 0; }
.compteurs dt { color: var(--texte-doux); font-size: 0.92rem; }
.compteurs dd { margin: 2px 0 0; font-family: var(--titre); font-weight: 700; font-size: 1.5rem; }
.compteurs .vert { color: var(--vivant); }

/* --- History -------------------------------------------------------------------------------- */

.historique { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }

/* --- Cloud saves ---------------------------------------------------------------------------- */

.quota-texte { color: var(--texte-doux); font-variant-numeric: tabular-nums; }
.quota { height: 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); overflow: hidden; margin-bottom: 14px; }
.quota i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--bleu-logo), var(--vivant)); }
.vide-bloc { padding: 16px; border-radius: 16px; border: 1px dashed rgba(255, 214, 236, 0.18); color: var(--texte-doux); }
.note { margin-top: 12px; font-size: 0.92rem; color: #a99dc4; }

/* --- Connect -------------------------------------------------------------------------------- */

.branchements { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.branchements li { display: grid; gap: 4px; padding: 14px 16px; border-radius: 16px; background: var(--carte); border: 1px solid var(--carte-bord); min-width: 0; }
.branchements strong { font-family: var(--titre); font-size: 0.95rem; }
.branchements span { color: var(--texte-doux); font-size: 0.93rem; }

/* --- Friends -------------------------------------------------------------------------------- */

.compte-amis { font-family: var(--corps); font-weight: 700; font-size: 0.95rem; color: var(--texte-doux); margin-left: 4px; }

.ajout { padding: 14px; border-radius: 18px; background: rgba(79, 176, 255, 0.07); border: 1px solid rgba(79, 176, 255, 0.22); margin-bottom: 14px; }
.ajout label { display: block; font-weight: 700; margin-bottom: 8px; }
.ajout-ligne { display: flex; gap: 8px; }
.ajout input {
  flex: 1; min-width: 0; min-height: 44px; padding: 0 14px; border-radius: 12px;
  background: rgba(12, 10, 29, 0.55); border: 1px solid var(--carte-bord); color: var(--texte);
  font: inherit; font-family: var(--titre); font-size: 0.95rem; letter-spacing: 0.04em;
}
.ajout input:focus { outline: none; border-color: var(--bleu-logo); }
.ajout .bouton { min-height: 44px; flex: none; }
.ajout-etat { min-height: 1.3em; margin-top: 6px; font-size: 0.92rem; color: var(--vivant); }
.ajout-etat.erreur { color: #ff8a9b; }

.outils-amis { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
/* Authorized applications */
.applis-autorisees { list-style: none; display: grid; gap: 14px; margin: 14px 0 0; padding: 0; }
.appli-autorisee { border: 1px solid var(--plaque-bord, rgba(255,255,255,.1)); border-radius: 18px; background: rgba(255, 255, 255, 0.03); overflow: visible; }
.appli-tete { display: flex; align-items: center; gap: 14px; padding: 16px 18px; background: rgba(255, 255, 255, 0.04); border-radius: 18px 18px 0 0; }
.appli-logo { display: grid; place-items: center; flex: none; border-radius: 50%; overflow: hidden; background: linear-gradient(135deg, #ff4d5e, #ff9a5a); color: #fff; font-weight: 800; font-size: 1.2rem; }
.appli-logo img { width: 100%; height: 100%; object-fit: cover; }
.appli-id { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.appli-id strong { font-size: 1.05rem; overflow-wrap: anywhere; }
.appli-id .petit { flex-basis: 100%; }
.puce-officielle { padding: 2px 9px; border-radius: 999px; background: rgba(88, 140, 255, 0.18); color: #9ab8ff; font-size: 0.75rem; font-weight: 700; }
.appli-coin { position: relative; }
.appli-plus { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 10px; background: rgba(255, 255, 255, 0.06); color: var(--texte); cursor: pointer; }
.appli-plus:hover, .appli-plus[aria-expanded="true"] { background: rgba(255, 255, 255, 0.12); }
.appli-menu { display: none; position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 240px; padding: 6px; border-radius: 12px; background: #1d1438; border: 1px solid rgba(255, 255, 255, 0.12); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45); }
.appli-menu.ouvert { display: grid; }
.appli-menu button { text-align: start; padding: 10px 12px; border: 0; border-radius: 8px; background: none; color: var(--texte); font: inherit; font-weight: 600; cursor: pointer; }
.appli-menu button:hover, .appli-menu button:focus-visible { background: rgba(255, 255, 255, 0.08); outline: none; }
.appli-menu button.danger { color: #ff8a9b; }
.appli-corps { padding: 4px 18px 16px; }
.appli-bloc { padding: 14px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
.appli-bloc h3 { font-size: 0.95rem; margin: 0 0 8px; }
.appli-bloc p { margin: 0 0 8px; line-height: 1.55; overflow-wrap: anywhere; }
.appli-createur { display: flex; align-items: center; gap: 8px; margin: 6px 0 8px; }
.appli-createur img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.appli-liens { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.appli-liens .lien { display: inline-flex; align-items: center; gap: 4px; }
.appli-permissions { list-style: none; display: grid; gap: 8px; margin: 0; padding: 0; }
.appli-permissions li { display: flex; align-items: center; gap: 10px; }
.appli-permissions svg { flex: none; color: #43c46d; }
.appli-pied { display: flex; justify-content: flex-end; padding-top: 14px; }
.appli-pied .petit { margin: 0; flex: 1; }
.applis-bloquees { margin-top: 14px; }
.applis-bloquees summary { cursor: pointer; font-weight: 700; }
.applis-bloquees ul { list-style: none; display: grid; gap: 8px; margin: 10px 0 0; padding: 0; }
.appli-bloquee { display: flex; align-items: center; gap: 12px; }
.appli-bloquee strong { flex: 1; }

.recherche {
  flex: 1 1 200px; display: flex; align-items: center; gap: 8px;
  padding: 0 14px; border-radius: 999px; background: rgba(12, 10, 29, 0.5); border: 1px solid var(--carte-bord);
  color: var(--texte-doux);
}
.recherche:focus-within { border-color: var(--bleu-logo); }
.recherche input { flex: 1; min-width: 0; min-height: 42px; background: none; border: 0; outline: 0; color: var(--texte); font: inherit; }
.recherche input::placeholder { color: #9d92b8; }
.filtres { display: flex; gap: 6px; }
.filtres button {
  font: inherit; font-weight: 700; font-size: 0.93rem; cursor: pointer;
  min-height: 40px; padding: 0 14px; border-radius: 999px;
  color: var(--texte-doux); background: transparent; border: 1px solid var(--carte-bord);
}
.filtres button[aria-selected="true"] { color: var(--nuit); background: var(--horizon); border-color: var(--horizon); }

.amis { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; min-height: 120px; }
.amis .ami, .demandes .demande { animation: apparait 0.3s ease both; }
.amis .ami:nth-child(2) { animation-delay: 20ms; } .amis .ami:nth-child(3) { animation-delay: 40ms; }
.amis .ami:nth-child(4) { animation-delay: 60ms; } .amis .ami:nth-child(5) { animation-delay: 80ms; }
.amis .ami:nth-child(n+6) { animation-delay: 100ms; }
@keyframes apparait { from { opacity: 0; transform: translateY(6px); } }
.ami { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px; border-radius: 16px; }
.ami:hover { background: rgba(255, 255, 255, 0.04); }
.ami-ouvrir {
  display: grid; grid-template-columns: 46px minmax(0, 1fr); align-items: center; gap: 12px;
  padding: 8px; text-align: left; font: inherit; color: inherit; background: none; border: 0; cursor: pointer; border-radius: 16px;
}
.ami-photo { position: relative; width: 46px; height: 46px; }
.ami-photo img, .initiale { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; background: #2a1d4f; }
.initiale { display: grid; place-items: center; font-family: var(--titre); font-weight: 700; color: var(--texte-doux); }
.ami-photo::after {
  content: ""; position: absolute; right: -1px; bottom: -1px; width: 14px; height: 14px; border-radius: 50%;
  border: 3px solid #1b1238; background: #6d6390;
}
.ami--enligne .ami-photo::after { background: var(--horizon); }
.ami--enjeu .ami-photo::after { background: var(--vivant); }
.ami-nom { font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.ami-etat { color: var(--texte-doux); font-size: 0.9rem; }
.ami--enjeu .ami-etat { color: var(--vivant); }
.ami--enligne .ami-etat { color: var(--horizon); }
.etoile { width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer; background: none; border: 0; border-radius: 50%; color: #6d6390; }
.etoile:hover { background: rgba(255, 255, 255, 0.06); }
.etoile[aria-pressed="true"] { color: #ffd166; }
.vide { color: var(--texte-doux); padding: 16px 8px; }

.pages { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.pages button {
  font: inherit; font-weight: 700; min-width: 40px; min-height: 40px; padding: 0 10px; cursor: pointer;
  border-radius: 12px; color: var(--texte-doux); background: transparent; border: 1px solid var(--carte-bord);
}
.pages button[aria-current="page"] { color: var(--nuit); background: var(--texte); border-color: var(--texte); }
.pages button:disabled { opacity: 0.4; cursor: default; }

/* --- Friend requests ------------------------------------------------------------------------ */

.demandes { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.demande {
  display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 16px; background: var(--carte); border: 1px solid var(--carte-bord);
}
.demande img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; background: #2a1d4f; }
.demande-nom { font-weight: 700; overflow-wrap: anywhere; }
.demande-code { color: var(--texte-doux); font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.demande-actions { display: flex; gap: 6px; }
.demande-actions .bouton { min-height: 38px; padding: 0 14px; font-size: 0.85rem; }
.demandes .vide-bloc { padding: 14px; }
.plus { margin-top: 10px; font: inherit; font-weight: 700; color: var(--horizon); background: none; border: 0; cursor: pointer; padding: 8px 4px; }

/* --- Identity (with security), like the live site: plain rows split by a hairline -------- */

.entete-icone { color: var(--bleu-logo); }
.lignes { margin: 0; }
.lignes > div {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 64px; padding: 10px 2px; border-bottom: 1px solid var(--carte-bord);
}
.lignes > div:last-child { border-bottom: 0; }
.lignes dt { color: var(--texte-doux); flex: none; }
.lignes dd { margin: 0; display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; min-width: 0; text-align: right; }
.lignes strong { font-weight: 700; overflow-wrap: anywhere; }
.mono { font-family: ui-monospace, "Cascadia Mono", "Consolas", monospace; font-size: 1.02rem; letter-spacing: 0.02em; }
.pilule {
  display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border-radius: 999px;
  font: inherit; font-size: 0.85rem; font-weight: 700; color: var(--bleu-logo); text-decoration: none; cursor: pointer;
  background: rgba(79, 176, 255, 0.08); border: 1px solid rgba(79, 176, 255, 0.35);
  transition: background-color 0.2s, transform 0.12s;
}
.pilule:hover { background: rgba(79, 176, 255, 0.16); }
.pilule:active { transform: scale(0.95); }
.pilule.est-copie, .code-bouton.est-copie { color: var(--vivant); border-color: rgba(98, 227, 164, 0.5); animation: copie 0.45s cubic-bezier(0.25, 1, 0.5, 1); }
@keyframes copie { 40% { transform: scale(1.08); } }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 0.8rem; font-weight: 700; color: var(--vivant);
  background: rgba(98, 227, 164, 0.08); border: 1px solid rgba(98, 227, 164, 0.35);
}
.badge::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 1.6px solid currentColor;
  background: radial-gradient(circle, currentColor 0 2px, transparent 2.5px); }
.badge--attente { color: var(--horizon); background: rgba(255, 176, 112, 0.08); border-color: rgba(255, 176, 112, 0.35); }

/* The country picker: a button with the flag, opening a searchable list. */
.pays { position: relative; }
.pays-bouton {
  display: inline-flex; align-items: center; gap: 12px; min-height: 48px; min-width: 240px; padding: 0 14px;
  font: inherit; font-weight: 700; color: var(--texte); cursor: pointer; border-radius: 14px;
  background: rgba(12, 10, 29, 0.55); border: 1px solid var(--carte-bord);
  transition: border-color 0.2s;
}
.pays-bouton:hover, .pays.est-ouvert .pays-bouton { border-color: rgba(79, 176, 255, 0.55); }
.pays-bouton img, .pays-option img, .puce-pays img { object-fit: contain; flex: none; }
.pays-bouton span:not(.pays-chevron) { flex: 1; text-align: center; }
.pays-chevron { display: grid; transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1); color: var(--texte-doux); }
.pays.est-ouvert .pays-chevron { transform: rotate(180deg); }
.pays-panneau {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 280px;
  padding: 8px; border-radius: 16px; background: #1d1339; border: 1px solid var(--plaque-bord);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  transform-origin: top right; animation: deroule 0.22s cubic-bezier(0.25, 1, 0.5, 1);
}
@keyframes deroule { from { opacity: 0; transform: translateY(-6px) scale(0.97); } }
.pays-filtre {
  width: 100%; min-height: 40px; padding: 0 12px; margin-bottom: 6px; border-radius: 10px;
  font: inherit; color: var(--texte); background: rgba(12, 10, 29, 0.6); border: 1px solid var(--carte-bord);
}
.pays-filtre:focus { outline: none; border-color: var(--bleu-logo); }
.pays-liste { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow-y: auto; text-align: left; }
.pays-option { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; cursor: pointer; font-weight: 400; }
.pays-option:hover, .pays-option:focus { background: rgba(255, 255, 255, 0.07); outline: none; }
.pays-option[aria-selected="true"] { background: rgba(79, 176, 255, 0.14); font-weight: 700; }
.puce-pays { display: inline-flex; align-items: center; gap: 8px; }

.sous-titre--securite { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--carte-bord); }
.actions-compte { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.actions-compte .bouton, .actions-compte button.bouton { padding: 8px 14px; font-size: 0.82rem; white-space: normal; text-align: center; line-height: 1.25; min-height: 48px; }
.zone-danger { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.bouton--sortie { background: transparent; color: #ff8a9b; border: 1px solid rgba(255, 53, 83, 0.4); font-family: var(--titre); }
.bouton--sortie:hover { background: rgba(255, 53, 83, 0.12); }
.bouton--danger { background: #c3203c; color: #fff; border: 0; font-family: var(--titre); }
.bouton--danger:hover { background: #db2a48; }
button.bouton { font-size: 0.92rem; }

/* --- Dialogs -------------------------------------------------------------------------------- */

.dialogue {
  width: min(540px, calc(100% - 32px)); max-height: 90vh; overflow-y: auto; padding: 0; border: 1px solid var(--plaque-bord); border-radius: 26px;
  background: #1a1133; color: var(--texte);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}
.dialogue::backdrop { background: rgba(7, 6, 26, 0.7); backdrop-filter: blur(4px); }
.dialogue[open] { animation: fenetre 0.32s cubic-bezier(0.25, 1, 0.5, 1); }
.dialogue[open]::backdrop { animation: voile 0.32s ease; }
.dialogue.sort { animation: fenetre-sort 0.18s ease forwards; }
.dialogue.sort::backdrop { animation: voile 0.18s ease reverse forwards; }
@keyframes fenetre { from { opacity: 0; transform: translateY(18px) scale(0.96); } }
@keyframes fenetre-sort { to { opacity: 0; transform: translateY(10px) scale(0.97); } }
@keyframes voile { from { opacity: 0; } }
.dialogue-corps { display: grid; gap: 16px; padding: 26px; }
.dialogue h2 { font-size: 1.35rem; font-weight: 800; }
.dialogue p { color: var(--texte-doux); }
.champ { display: grid; gap: 6px; font-weight: 700; }
.champ input {
  min-height: 46px; padding: 0 14px; border-radius: 12px; font: inherit; font-weight: 400;
  color: var(--texte); background: rgba(12, 10, 29, 0.6); border: 1px solid var(--carte-bord);
}
.champ input:focus { outline: none; border-color: var(--bleu-logo); }
.champ small { font-weight: 400; color: #a99dc4; }
.ligne-boutons { display: flex; flex-wrap: wrap; gap: 10px; }
.ligne-boutons.fin { justify-content: flex-end; }
.ligne-boutons label.bouton { cursor: pointer; }
/* --- Profil editor (proven base) ----------------------------------------------------------- */
.dialogue--profil { width: min(760px, calc(100% - 32px)); max-height: 90vh; overflow-y: auto; }
.editeur-haut { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 20px; align-items: start; }
.editeur-apercu { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.profil-apercu {
  justify-self: center; width: 128px; height: 128px; border-radius: 50%; padding: 6px; background: #3a2a6a;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); border: 3px solid rgba(255, 255, 255, 0.12);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.profil-apercu img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.apercu-label { font-size: 0.82rem; color: var(--texte-doux); font-weight: 600; }
.editeur-champs { display: grid; gap: 14px; min-width: 0; }
.editeur-champs .champ small { font-size: 0.8rem; color: var(--texte-doux); font-weight: 400; }

.couleurs { border: 0; margin: 0; padding: 0; }
.couleurs legend { font-weight: 700; font-size: 0.9rem; margin-bottom: 8px; padding: 0; color: var(--texte); }
.couleurs div { display: flex; flex-wrap: wrap; gap: 8px; }
.couleurs button {
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer; border: 2px solid transparent;
  transition: transform 0.15s ease;
}
.couleurs button:hover { transform: scale(1.15); }
.couleurs button[aria-pressed="true"] { border-color: #fff; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4); transform: scale(1.1); }

/* --- Avatar gallery: layered compositor (Personnage / Fond / Cadre) ------------------------ */
.avatar-choix { border: 0; margin: 10px 0 0; padding: 16px 0 0; border-top: 1px solid var(--carte-bord); display: grid; gap: 12px; }
.avatar-choix legend { font-weight: 700; font-size: 0.98rem; margin-bottom: 2px; padding: 0; color: var(--texte); }
.ip-indice { color: var(--texte-doux); font-weight: 400; font-size: 0.84rem; }
.ip-barre { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.avatar-onglets { display: flex; gap: 6px; flex-wrap: wrap; }
.avatar-onglets button {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; font: inherit; font-size: 0.84rem; font-weight: 700;
  border-radius: 999px; color: var(--texte-doux); background: rgba(255, 255, 255, 0.05); border: 1px solid var(--carte-bord);
  cursor: pointer; transition: all 0.15s ease;
}
.avatar-onglets button:hover { color: var(--texte); border-color: rgba(255, 255, 255, 0.25); }
.avatar-onglets button[aria-selected="true"] { color: var(--texte); background: rgba(79, 176, 255, 0.18); border-color: var(--bleu-logo); }
.avatar-onglets button.est-rempli { border-color: rgba(98, 227, 164, 0.6); color: var(--vivant); }
.onglet-point { display: none; width: 6px; height: 6px; border-radius: 50%; background: var(--vivant); }
.avatar-onglets button.est-rempli .onglet-point { display: inline-block; }
.ip-barre-droite { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ip-clear-btn {
  display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; font: inherit; font-size: 0.8rem; font-weight: 700;
  border-radius: 999px; border: 1px solid rgba(255, 53, 83, 0.4); background: rgba(255, 53, 83, 0.1); color: #ff8a9b;
  cursor: pointer; transition: background-color 0.15s;
}
.ip-clear-btn:hover { background: rgba(255, 53, 83, 0.22); }
.ip-clear-btn[hidden] { display: none !important; }
.ip-select {
  min-height: 38px; border-radius: 12px; font: inherit; font-size: 0.84rem; font-weight: 500;
  color: var(--texte); background: rgba(12, 10, 29, 0.65); border: 1px solid var(--carte-bord); padding: 0 12px; max-width: 250px;
}

/* AVATAR GRID - STRICT 60px TILES, FULLY READABLE & NEVER SQUASHED */
.avatar-grille {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); gap: 8px;
  max-height: 300px; min-height: 180px; overflow-y: auto; padding: 8px; border-radius: 16px;
  border: 1px solid var(--carte-bord); background: rgba(12, 10, 29, 0.45); box-sizing: border-box;
}
.avatar-grille button {
  position: relative; width: 100%; height: 60px; min-height: 60px; max-height: 60px; aspect-ratio: 1 / 1;
  padding: 4px; border-radius: 12px; cursor: pointer; background: rgba(255, 255, 255, 0.05);
  border: 2px solid transparent; display: flex !important; align-items: center; justify-content: center;
  box-sizing: border-box; flex: none; transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}
.avatar-grille button:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.1); }
.avatar-grille button.est-choisi { border-color: var(--horizon); background: rgba(79, 176, 255, 0.22); box-shadow: 0 0 0 2px var(--horizon); }
.avatar-grille button.fond-sombre { background: #2a1d4f; }
.avatar-grille button.avatar-opt--t { background: repeating-conic-gradient(#20202c 0% 25%, #191922 0% 50%) 50% / 14px 14px; }
.avatar-grille button img { width: 100%; height: 100%; object-fit: contain; border-radius: 8px; display: block; pointer-events: none; }
.ami-fiche { display: flex; align-items: center; gap: 16px; }
.ami-fiche img { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; background: #2a1d4f; }
.code-texte { font-family: var(--titre); font-size: 0.95rem; color: var(--texte) !important; margin-top: 4px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translate(-50%, 20px);
  padding: 12px 18px; border-radius: 14px; background: var(--texte); color: var(--nuit); font-weight: 700;
  opacity: 0; pointer-events: none; transition: opacity 200ms ease, transform 200ms ease;
}
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

.pied--court { grid-template-columns: 1fr; padding-top: 10px; }

@media (max-width: 960px) {
  .grille-compte { grid-template-columns: minmax(0, 1fr); }
  .membre-corps { grid-template-columns: auto minmax(0, 1fr); }
  .membre-actions { grid-column: 1 / -1; padding-top: 0; justify-items: start; grid-auto-flow: column; align-items: end; justify-content: start; }
  .code-ami { justify-items: start; }
}
@media (max-width: 560px) {
  .actions-compte { grid-template-columns: 1fr; }
  .membre-corps { grid-template-columns: minmax(0, 1fr); }
  .membre-texte { padding-top: 0; }
  .membre-photo { width: 104px; height: 104px; margin-top: -52px; }
  .membre-actions { grid-auto-flow: row; }
  .branchements { grid-template-columns: 1fr; }
  .ajout-ligne { flex-direction: column; }
  .demande { grid-template-columns: 46px minmax(0, 1fr); }
  .demande-actions { grid-column: 1 / -1; }
  .moi-mini span { display: none; }
  .moi-mini { padding: 4px; }
  .lignes > div { flex-direction: column; align-items: flex-start; gap: 6px; }
  .lignes dd { text-align: left; justify-content: flex-start; }
  .pays-bouton { min-width: 0; width: 100%; }
  .pays-panneau { left: 0; right: auto; width: min(280px, 80vw); }
}
@media (prefers-reduced-motion: reduce) {
  .toast { transition: none; }
  .dialogue[open], .dialogue.sort, .pays-panneau, .amis .ami, .demandes .demande, .pilule.est-copie, .code-bouton.est-copie { animation: none; }
}

/* --- Game rows (history, friend history, all games): the whole row is a button ----------- */

.historique li { display: block; padding: 0; }
.historique li.vide { padding: 16px 8px; }
.ligne-jeu {
  width: 100%; display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 8px; border-radius: 16px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.ligne-jeu img { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; background: var(--nuit-2); }
.ligne-milieu { display: grid; min-width: 0; }
.ligne-jeu .nom { font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.ligne-jeu .quand { color: var(--texte-doux); font-size: 0.9rem; }
.ligne-jeu .temps { font-family: var(--titre); font-weight: 700; color: var(--horizon); white-space: nowrap; }
.bouton--large { width: 100%; margin-top: 12px; }
.maintenant { cursor: pointer; transition: border-color 0.3s; }
.maintenant:hover { border-color: rgba(255, 176, 112, 0.4); }

/* --- Bigger dialogs ------------------------------------------------------------------------ */

.dialogue--large { width: min(720px, calc(100% - 32px)); }
.dialogue--jeu { width: min(1080px, calc(100% - 32px)); }
.dialogue--large, .dialogue--jeu { max-height: min(88vh, 900px); overflow: auto; }
.fermer-x {
  position: absolute; top: 14px; right: 14px; z-index: 2; width: 40px; height: 40px; border-radius: 12px; cursor: pointer;
  display: grid; place-items: center; color: var(--texte); border: 1px solid var(--plaque-bord);
  background: rgba(12, 10, 29, 0.55); backdrop-filter: blur(8px);
  transition: background-color 0.2s, transform 0.2s;
}
.fermer-x:hover { background: rgba(12, 10, 29, 0.8); transform: rotate(90deg); }
.fermer-x--plat { position: static; }
.dialogue h2 .compte-amis { font-size: 0.95rem; }

.tri { display: flex; gap: 6px; flex-wrap: wrap; }
.tri button {
  font: inherit; font-weight: 700; font-size: 0.9rem; cursor: pointer; min-height: 36px; padding: 0 14px; border-radius: 999px;
  color: var(--texte-doux); background: transparent; border: 1px solid var(--carte-bord);
}
.tri button[aria-pressed="true"] { color: var(--nuit); background: var(--horizon); border-color: var(--horizon); }
.historique--tout { max-height: 52vh; overflow-y: auto; padding-right: 4px; }

/* --- Friend sheet -------------------------------------------------------------------------- */

.fiche { position: relative; padding: 0 26px 24px; }
.fiche-ciel {
  height: 118px; margin: 0 -26px;
  background:
    radial-gradient(40% 150% at 84% 120%, rgba(255, 194, 138, 0.85), rgba(255, 140, 110, 0.3) 45%, transparent 70%),
    linear-gradient(180deg, #2a1650 0%, #6b2566 55%, #c94667 100%);
}
.fiche-tete { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: start; }
.fiche-photo {
  width: 104px; height: 104px; margin-top: -52px; border-radius: 50%; object-fit: cover;
  border: 5px solid #1a1133; background: #2a1d4f; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}
.fiche-titre { padding-top: 12px; min-width: 0; }
.fiche-titre h2 { font-size: 1.6rem; overflow-wrap: anywhere; }
.fiche-tete .code-bouton { margin-top: 14px; }
.fiche-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 20px 0; }
.fiche-stats > div { padding: 12px 14px; border-radius: 14px; background: var(--carte); border: 1px solid var(--carte-bord); min-width: 0; }
.fiche-stats dt { color: var(--texte-doux); font-size: 0.85rem; }
.fiche-stats dd { margin: 2px 0 0; font-weight: 700; overflow-wrap: anywhere; }
.historique--fiche { max-height: 300px; overflow-y: auto; margin-bottom: 18px; }
.fiche-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding-top: 16px; border-top: 1px solid var(--carte-bord); }
.fiche-actions .espace { flex: 1; }

/* --- Game sheet ---------------------------------------------------------------------------- */

.jeu-tete { position: relative; display: flex; align-items: center; gap: 18px; padding: 26px 26px 22px; overflow: hidden; border-bottom: 1px solid var(--plaque-bord); }
.jeu-fond {
  position: absolute; inset: 0; z-index: 0; background-size: cover; background-position: center;
  filter: blur(18px) saturate(1.2); opacity: 0.35; transform: scale(1.15);
}
.jeu-tete::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(26, 17, 51, 0.9), rgba(26, 17, 51, 0.55)); z-index: 0; }
.jeu-icone, .jeu-titre { position: relative; z-index: 1; }
.jeu-icone { width: 96px; height: 96px; border-radius: 20px; object-fit: cover; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45); }
.jeu-titre h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
.jeu-corps { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr); gap: 20px; padding: 22px 26px 26px; }
.jeu-scene { aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden; background: var(--nuit-2); }
.jeu-scene img { width: 100%; height: 100%; object-fit: cover; animation: apparait 0.35s ease; }
.jeu-vignettes { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 6px; }
.jeu-vignettes button { flex: none; width: 112px; aspect-ratio: 16 / 9; padding: 0; border-radius: 10px; overflow: hidden; cursor: pointer; border: 2px solid transparent; background: var(--nuit-2); opacity: 0.65; transition: opacity 0.2s, border-color 0.2s; }
.jeu-vignettes button:hover { opacity: 1; }
.jeu-vignettes button[aria-pressed="true"] { opacity: 1; border-color: var(--horizon); }
.jeu-vignettes img { width: 100%; height: 100%; object-fit: cover; }
.jeu-accroche { font-family: var(--titre); font-weight: 500; font-size: 1.05rem; margin: 14px 0 8px; }
.jeu-desc { color: var(--texte-doux); white-space: pre-line; max-width: 65ch; }
.jeu-cote { display: grid; gap: 14px; align-content: start; }
.jeu-achat { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 50px; padding: 8px 16px; text-decoration: none; }
.jeu-achat span { text-align: center; line-height: 1.2; }
.jeu-achat[hidden] { display: none; }
.jeu-bloc { padding: 18px; border-radius: 18px; background: var(--carte); border: 1px solid var(--carte-bord); }
.jeu-bloc h3 { font-size: 0.95rem; color: var(--horizon); margin-bottom: 10px; }
.jeu-progres { display: flex; align-items: center; gap: 12px; padding: 8px 0; color: var(--bleu-logo); }
.jeu-progres div { display: grid; color: var(--texte); }
.jeu-progres strong { font-size: 1.1rem; }
.jeu-progres span { color: var(--texte-doux); font-size: 0.88rem; }
.lignes--serrees > div { min-height: 48px; padding: 8px 0; }

@media (max-width: 820px) {
  .jeu-corps { grid-template-columns: 1fr; }
  .fiche-stats { grid-template-columns: 1fr 1fr; }
  .fiche-tete { grid-template-columns: auto minmax(0, 1fr); }
  .fiche-tete .code-bouton { grid-column: 1 / -1; margin-top: 0; justify-self: start; }
}
@media (max-width: 480px) {
  .jeu-tete { padding: 20px 60px 18px 18px; }
  .jeu-icone { width: 64px; height: 64px; border-radius: 14px; }
  .jeu-corps { padding: 16px; }
  .fiche { padding: 0 18px 20px; }
  .fiche-ciel { margin: 0 -18px; }
}

/* Cloud saves */
.sauvegardes { list-style: none; margin: 0 0 4px; padding: 0; display: grid; gap: 8px; }
.sauvegarde {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--carte);
  border: 1px solid var(--carte-bord);
  flex-wrap: wrap;
}
.sauvegarde img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--nuit-2);
  flex-shrink: 0;
}
.sauvegarde .ligne-milieu {
  flex: 1 1 180px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sauvegarde .nom {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sauvegarde .quand {
  color: var(--texte-doux);
  font-size: 0.85rem;
  white-space: normal;
  line-height: 1.3;
}
.sauvegarde .ligne-boutons {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-left: auto;
}
.sauvegarde .ligne-boutons .bouton {
  font-size: 0.78rem;
  min-height: 36px;
  padding: 0 12px;
  flex: none;
}
.actions-compte--admin { grid-template-columns: 1fr; margin-top: 8px; }
.actions-compte--admin[hidden] { display: none; }
@media (max-width: 560px) {
  .sauvegarde .ligne-boutons {
    width: 100%;
    margin-left: 0;
    margin-top: 4px;
  }
}

/* Status lines stay on ONE line: a long game title or a play-report detail is cut with an
   ellipsis (full text in the tooltip) instead of wrapping. */
.presence { min-width: 0; max-width: 100%; }
#presence-texte, #fm-etat { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ami-etat, .ami-detail { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ami-detail { font-size: 0.8rem; color: var(--texte-doux); opacity: 0.85; }

/* Profile badges: a compact row of icons, each one naming itself in a tooltip (hover, focus
   or tap), like Discord. */
.badges-profil { list-style: none; margin: 12px 0 0; padding: 4px 6px; display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px; border-radius: 12px; background: rgba(12, 10, 29, 0.45); border: 1px solid var(--carte-bord); }
.badges-profil[hidden] { display: none; }
.badge-profil { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; cursor: default; transition: background-color .15s ease, transform .15s ease; }
.badge-profil img { object-fit: contain; display: block; }
.badge-profil:hover, .badge-profil:focus-visible { background: rgba(255, 255, 255, 0.08); transform: translateY(-1px); }
.badge-profil:focus-visible { outline: 2px solid var(--bleu-logo); outline-offset: 1px; }
.fiche-titre .badges-profil { margin-top: 8px; }

.bulle-badge { position: fixed; z-index: 60; display: flex; align-items: center; gap: 10px; max-width: min(300px, calc(100vw - 16px)); padding: 9px 13px 9px 10px; border-radius: 12px; background: #17122e; border: 1px solid rgba(255, 214, 236, 0.14); box-shadow: 0 10px 30px rgba(0, 0, 0, .45); color: var(--texte); pointer-events: none; opacity: 0; transform: translateY(4px); transition: opacity .12s ease, transform .12s ease; }
.bulle-badge.visible { opacity: 1; transform: none; }
.bulle-badge::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 10px; height: 10px; background: #17122e; border-right: 1px solid rgba(255, 214, 236, 0.14); border-bottom: 1px solid rgba(255, 214, 236, 0.14); transform: translateX(-50%) rotate(45deg); }
.bulle-badge.dessous::after { bottom: auto; top: -6px; transform: translateX(-50%) rotate(225deg); }
.bulle-badge-icone { flex: none; width: 30px; height: 30px; display: grid; place-items: center; }
.bulle-badge-icone img { width: 28px; height: 28px; object-fit: contain; }
.bulle-badge-texte { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.bulle-badge-texte strong { font-size: .95rem; }
.bulle-badge-texte span { font-size: .85rem; color: var(--texte-doux); }
@media (prefers-reduced-motion: reduce) { .badge-profil, .bulle-badge { transition: none; } .badge-profil:hover { transform: none; } }
/* Inside an open dialog the tooltip is one of its children: undo the dialog's scroll rule. */
dialog.dialogue > .bulle-badge { max-height: none; overflow: visible; }

/* Group actions next to the "Received" / "Sent" titles. */
.demandes-tete { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.demandes-tete { margin: 18px 0 10px; }
.demandes-tete:first-of-type { margin-top: 4px; }
.demandes-tete .sous-titre { margin: 0; }
.demandes-tete + .demandes { margin-bottom: 14px; }
.demandes-groupe { display: flex; gap: 8px; flex-wrap: wrap; }
.demandes-groupe[hidden] { display: none; }
.demandes-groupe .petit-bouton { min-height: 34px; padding: 0 12px; font-size: 0.82rem; }
