/* Profil, amis, classements : même univers néon que les jeux, en plus soigné. */
.overlay .box.profile {
  width: 600px;
  padding: 0 0 22px;
  gap: 0;
  text-align: left;
  scrollbar-width: thin;
  scrollbar-color: #9d6bff66 transparent;
}
.profile > * { margin-left: 26px; margin-right: 26px; }

/* En-tête : avatar lumineux sur bandeau dégradé */
.profile > .av.big {
  width: 84px; height: 84px; font-size: 38px;
  margin: 0 auto -42px; position: relative; z-index: 1; order: 0;
  border: 3px solid var(--t4, #1d1540);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 70%, #fff), 0 0 28px color-mix(in srgb, var(--c) 60%, transparent);
}
.profile::before {
  content: ''; display: block; height: 96px; margin: 0 0 0; flex: none;
  background:
    radial-gradient(circle at 18% 120%, #3ee6b055, transparent 55%),
    radial-gradient(circle at 85% -20%, #ffc75f44, transparent 50%),
    linear-gradient(120deg, var(--tb, #4b33c9), var(--tl, #9d6bff) 55%, #ff6b81);
  border-radius: 22px 22px 0 0; opacity: .85;
}
.profile > h3 {
  margin-top: 50px; text-align: center; font-size: 26px; font-weight: 800; letter-spacing: .5px;
  background: linear-gradient(90deg, #fff, #c4fff3); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.profile > .dim { text-align: center; margin-top: -4px; margin-bottom: 12px; }

/* Onglets en pilules */
.profile > .profile-tabs {
  position: sticky; top: 0; z-index: 3; margin-top: 4px; margin-bottom: 14px; padding: 5px;
  background: #140e30e6; backdrop-filter: blur(8px); border: 1px solid #9d6bff40; border-radius: 16px;
}
.profile > .profile-tabs .btn {
  background: transparent; border: 0; box-shadow: none; color: #b9b2d8; border-radius: 12px; font-weight: 700;
}
.profile > .profile-tabs .btn:hover { background: #ffffff12; filter: none; color: #fff; }
.profile > .profile-tabs .btn[aria-pressed="true"] {
  background: linear-gradient(180deg, var(--ta, #7a5cff), var(--tb, #4b33c9)); color: #fff; box-shadow: 0 3px 12px color-mix(in srgb, var(--ta, #6a4cff) 40%, transparent);
}

/* Cartes de contenu */
.profile-panel { animation: socialIn .22s ease both; }
@keyframes socialIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.profile-panel > h4, .profile-section > h4 {
  font-size: 13px; text-transform: uppercase; letter-spacing: 1.4px; color: #ffe29a; font-weight: 800;
}
.profile-panel > h4 { margin-top: 6px; }
.profile-section { border-top: 0; padding-top: 0; }
.profile-player-bio { background: linear-gradient(180deg, #ffffff12, #ffffff08); border: 1px solid #ffffff12; color: #d9d3f3; font-style: italic; }
.profile-summary-item { border: 1px solid #3ee6b033; background: #3ee6b012; font-weight: 700; }

/* Statistiques : lignes alternées, valeurs dorées */
.stats { gap: 5px; }
.stat { background: #ffffff0a; border: 1px solid #ffffff0d; transition: background .15s, transform .15s; }
.stat:hover { background: #ffffff14; transform: translateX(2px); }
.stat b { color: #ffd66b; text-shadow: 0 0 12px #ffc75f44; }

/* Aperçu : tuiles, cartes de jeu, tableau victoires/défaites */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 6px; }
.kpi { background: #ffffff0a; border: 1px solid #ffffff12; border-radius: 12px; padding: 10px 6px; text-align: center; }
.kpi b { display: block; font-size: 22px; color: #ffd66b; }
.kpi span { font-size: 11px; color: #b9b2d9; text-transform: uppercase; letter-spacing: .8px; }
.kpi.win b { color: #3ee6b0; }
.kpi.loss b { color: #ff7a8a; }
.game-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.game-card { background: #ffffff0a; border: 1px solid #ffffff12; border-radius: 12px; padding: 10px 12px; display: grid; gap: 6px; }
.game-card-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.game-card-name { font-weight: 700; font-size: 13px; }
.game-card-lvl { background: #9d6bff33; border: 1px solid #9d6bff66; border-radius: 999px; padding: 1px 8px; font-size: 12px; color: #e6d9ff; }
.game-card small { color: #b9b2d9; font-size: 11px; }
.xpbar { height: 6px; background: #ffffff14; border-radius: 99px; overflow: hidden; }
.xpbar i { display: block; height: 100%; background: linear-gradient(90deg, #3ee6b0, #9d6bff); border-radius: 99px; }
.wl-table { display: grid; gap: 4px; }
.wl-row { display: grid; grid-template-columns: 1fr 52px 52px 52px 52px; gap: 6px; padding: 7px 10px; background: #ffffff0a; border-radius: 10px; font-size: 13px; align-items: center; }
.wl-row span:not(:first-child) { text-align: center; font-variant-numeric: tabular-nums; }
.wl-row span:nth-child(2) { color: #3ee6b0; font-weight: 700; }
.wl-row span:nth-child(3) { color: #ff7a8a; font-weight: 700; }
.wl-head, .wl-head span { background: transparent; color: #ffe29a !important; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; font-weight: 800; }
.rank-scope { margin-bottom: 8px; }
.stat-hero { background: linear-gradient(135deg, #9d6bff33, #3ee6b01f); border: 1px solid #9d6bff55; border-radius: 16px; padding: 14px; display: grid; gap: 8px; margin: 4px 0 10px; }
.stat-hero-top { display: flex; align-items: center; gap: 12px; }
.stat-hero-lvl { width: 56px; height: 56px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 26px; font-weight: 900; color: #3a2800; background: linear-gradient(180deg, #ffe29a, #e0a82e); box-shadow: 0 0 18px #ffd66b55; }
.stat-hero-txt { display: grid; gap: 2px; min-width: 0; }
.stat-hero-txt b { font-size: 17px; }
.stat-hero-txt span { font-size: 12px; color: #cfc8ee; }
.stat-hero .xpbar { height: 10px; }
.game-card-rec { color: #ffe29a !important; font-weight: 700; font-size: 13px !important; }
.rank-chips { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: thin; }
.rank-chip { flex: none; background: #ffffff0d; border: 1px solid #ffffff1f; color: #e6e0ff; border-radius: 999px; padding: 7px 12px; font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap; }
.rank-chip.on { background: linear-gradient(135deg, #9d6bff, #6b4bff); border-color: #c8b0ff; color: #fff; font-weight: 700; }
.rank-me { display: grid; gap: 3px; background: #3ee6b01a; border: 1px solid #3ee6b055; border-radius: 14px; padding: 10px 14px; margin-bottom: 10px; }
.rank-me b { font-size: 20px; color: #3ee6b0; }
.rank-me span { font-size: 12px; color: #cfc8ee; }
.rank-me small { color: #ffd66b; font-size: 12px; font-weight: 700; }
.profile-rank.top1 .rank-place, .profile-rank.top2 .rank-place, .profile-rank.top3 .rank-place { background: none; font-size: 22px; }
.report-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 6px 0; }
#menu h1.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; font-size: 1px; filter: none; }

/* Pied de page du menu */
.legal-foot { margin: 34px auto 0; padding-top: 14px; max-width: 520px; border-top: 1px solid #ffffff14; font-size: 12px; color: #9a93c0; }
.legal-foot p { margin: 4px 0; }
.legal-link { background: none; border: 0; padding: 0; font: inherit; color: #b9a8ff; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.legal-link:hover { color: #3ee6b0; }
.legal-box { max-width: min(560px, 92vw); max-height: 86vh; }
.legal-body { overflow-y: auto; text-align: left; padding-right: 6px; }
.legal-body h4 { margin: 12px 0 2px; color: #ffe29a; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; }
.legal-body p { margin: 0; font-size: 14px; line-height: 1.5; color: #d9d3f3; }
@media (max-width: 520px) { .kpis { grid-template-columns: repeat(2, 1fr); } .game-cards { grid-template-columns: 1fr; } }

/* Formulaires */
.profile .inp { background: #0b0820; border: 1px solid #9d6bff40; border-radius: 12px; }
.profile .inp:focus { outline: 0; border-color: #3ee6b0; box-shadow: 0 0 0 3px #3ee6b02e; }
.profile-label { color: #c9c2e8; }
.profile-add { padding: 6px; border-radius: 14px; background: #ffffff0a; border: 1px solid #ffffff12; }
.profile-add .inp { border: 0; background: transparent; }
.profile-add .inp:focus { box-shadow: none; }
.profile-add .btn { flex: none; }
.profile-status { color: #9ff3dc; }
.profile-status:empty { display: none; }

/* Filtres des amis */
.friend-filters { gap: 6px; margin: 6px 0 4px; }
.friend-filters .btn {
  border-radius: 999px; padding: 6px 12px; font-size: 12px; font-weight: 700; box-shadow: none;
  background: #ffffff0e; border: 1px solid #ffffff18; color: #cfc8ee;
}
.friend-filters .btn:hover { background: #ffffff1c; filter: none; }
.friend-filters .btn[aria-pressed="true"] { background: #3ee6b022; border-color: #3ee6b088; color: #c4fff3; }

/* Lignes d'amis */
.profile-friends { gap: 7px; }
.profile-friend, .profile-rank {
  padding: 9px 12px; border: 1px solid #ffffff10; border-radius: 14px;
  background: linear-gradient(180deg, #ffffff10, #ffffff08); transition: background .15s, border-color .15s;
}
.profile-friend:hover, .profile-rank:hover { background: #ffffff16; border-color: #9d6bff55; }
.profile-friend .av { position: relative; overflow: visible; }
.profile-friend[data-presence] .av::after {
  content: ''; position: absolute; right: -2px; bottom: -2px; width: 11px; height: 11px; border-radius: 50%;
  border: 2px solid #1d1540; background: #6f6a8c;
}
.profile-friend[data-presence="on"] .av::after { background: #3ee6b0; box-shadow: 0 0 8px #3ee6b0; }
.profile-name-link { font-weight: 700; color: #f1eeff; text-decoration: none; }
.profile-name-link:hover { text-decoration: none; color: #3ee6b0; }
.profile-friend .btn.small { padding: 6px 14px; }
.profile-friend .auth-link { margin-top: 0; padding: 6px 10px; border-radius: 10px; }
.profile-friend .auth-link.danger:hover { background: #ff6b8120; text-decoration: none; }
.profile-friend .btn.small + .auth-link { margin-left: 0; }

/* Pastilles de présence */
.presence { border: 1px solid transparent; letter-spacing: .3px; margin-left: auto; }
.presence.is-on { border-color: #3ee6b055; }
.presence + .auth-link { margin-left: 0; }

/* Classement : podium */
.profile-ranking { counter-reset: rank; }
.profile-rank .rank-place {
  min-width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 10px;
  background: #ffffff12; color: #cfc8ee; font-size: 14px;
}
.profile-rank:nth-child(1) { border-color: #ffd66b66; background: linear-gradient(90deg, #ffd66b1f, #ffffff08); }
.profile-rank:nth-child(1) .rank-place { background: linear-gradient(180deg, #ffe29a, #e0a82e); color: #3a2800; }
.profile-rank:nth-child(2) .rank-place { background: linear-gradient(180deg, #f1f1fa, #a9a9c4); color: #24243a; }
.profile-rank:nth-child(3) .rank-place { background: linear-gradient(180deg, #ffb27a, #c0702e); color: #3a1c00; }
.profile-rank .rank-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-rank .rank-score { color: #ffd66b; font-variant-numeric: tabular-nums; font-size: 16px; }
.profile-rank.is-me { border-color: #3ee6b088; }
.profile-select { appearance: none; background: #0b0820; }

/* Pied de fenêtre */
.profile > .row { margin-top: 18px; justify-content: center; }
.profile > .auth-link.danger { align-self: center; margin-top: 12px; opacity: .8; }
.btn.logout { background: linear-gradient(180deg, #ff6b81, #e0405a); box-shadow: 0 4px 0 #8f2338, 0 8px 18px #ff6b8140; }
.btn.logout:active { box-shadow: 0 1px 0 #8f2338; }

/* Pastille de compte à l'accueil */
#menu .acct {
  top: 16px; right: 20px; gap: 12px; padding: 6px 14px 6px 6px; border-radius: 40px;
  background: linear-gradient(135deg, #ffffff18, #ffffff08); border: 1px solid #ffffff2e;
  box-shadow: 0 6px 22px #00000055, inset 0 1px 0 #ffffff22; transition: transform .15s, border-color .15s, box-shadow .15s;
}
#menu .acct:hover { transform: translateY(-1px); border-color: #3ee6b0aa; box-shadow: 0 8px 26px #3ee6b02e, 0 6px 22px #00000055; background: linear-gradient(135deg, #ffffff22, #ffffff0c); }
#menu .acct .av { width: 38px; height: 38px; font-size: 18px; box-shadow: 0 0 0 2px #ffffff30, 0 0 16px color-mix(in srgb, var(--c) 60%, transparent); }
#menu .acct .txt { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
#menu .acct .nm { font-size: 15px; font-weight: 800; letter-spacing: .3px; }
#menu .acct .who { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; color: #b9b2d6; margin: 0; letter-spacing: .2px; text-transform: none; }
#menu .acct .who::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #8b84a8; }
#menu .acct .who.on { color: #9ff3dc; }
#menu .acct .who.on::before { background: #3ee6b0; box-shadow: 0 0 8px #3ee6b0; }
#acct .badge { top: -5px; right: -3px; }

/* Thèmes de l'interface */
html[data-theme="ocean"] { --t0:#04101c; --t1:#081d33; --t2:#0f3a5e; --t3:#14507f; --t4:#0b2a4a; --ta:#2f9bff; --tb:#1769c9; --td:#0c3f80; --tl:#5ec8ff; }
html[data-theme="foret"] { --t0:#04140d; --t1:#0a2418; --t2:#135a3a; --t3:#1b7a4f; --t4:#0e3a28; --ta:#2fc47a; --tb:#178f55; --td:#0b5a35; --tl:#3ee6b0; }
html[data-theme="rubis"] { --t0:#180509; --t1:#2b0b14; --t2:#5c1527; --t3:#861e38; --t4:#471020; --ta:#ff5470; --tb:#cc2a49; --td:#7d1226; --tl:#ff8fa0; }
html[data-theme="ambre"] { --t0:#170d03; --t1:#2b1807; --t2:#5e3a0e; --t3:#85561a; --t4:#46290a; --ta:#ffa726; --tb:#d9780f; --td:#8a4706; --tl:#ffc75f; }
html[data-theme="rose"] { --t0:#170615; --t1:#2a0c27; --t2:#5c1a55; --t3:#84267a; --t4:#451040; --ta:#ff5cc8; --tb:#cc2a9d; --td:#7d1260; --tl:#ff9fe0; }
html[data-theme="minuit"] { --t0:#07090d; --t1:#11151d; --t2:#232b3b; --t3:#323c52; --t4:#1a2030; --ta:#7a8aa8; --tb:#52617f; --td:#2c3750; --tl:#aab6cf; }
html[data-theme="aurore"] { --t0:#071a1a; --t1:#0b2b2e; --t2:#1a5a66; --t3:#247a88; --t4:#0f3d46; --ta:#19c3c9; --tb:#0e8f9a; --td:#07595f; --tl:#6ff0f0; }

/* Choix d'avatar et de thème */
.avatar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }
.avatar-opt {
  display: grid; place-items: center; height: 54px; border-radius: 16px; border: 1px solid #ffffff22; background: #ffffff0a; cursor: pointer;
  transition: transform .12s, border-color .12s, background .12s;
}
.avatar-opt .av { width: 38px; height: 38px; font-size: 17px; pointer-events: none; }
.avatar-opt:hover { transform: translateY(-2px); background: #ffffff1a; }
.avatar-opt.on { border-color: var(--tl, #9d6bff); background: color-mix(in srgb, var(--tl, #9d6bff) 22%, transparent); box-shadow: 0 0 14px color-mix(in srgb, var(--tl, #9d6bff) 45%, transparent); }
.theme-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.theme-opt {
  display: grid; justify-items: center; gap: 6px; width: 74px; padding: 8px 4px; border-radius: 14px;
  border: 1px solid #ffffff22; background: #ffffff0d; color: #ece8ff; font: 700 11px 'Segoe UI', sans-serif; cursor: pointer; transition: transform .12s, border-color .12s;
}
.theme-opt:hover { transform: translateY(-2px); }
.theme-opt i { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--a), var(--b)); box-shadow: 0 0 12px color-mix(in srgb, var(--a) 55%, transparent); }
.theme-opt.on { border-color: var(--tl, #9d6bff); background: color-mix(in srgb, var(--tl, #9d6bff) 20%, transparent); }
.av.has-art { color: #fff; background: linear-gradient(145deg, var(--a), var(--b)); box-shadow: 0 0 14px color-mix(in srgb, var(--a) 55%, transparent), inset 0 1px 0 #ffffff55; }
.av.art-neon { color: var(--a); background: radial-gradient(circle at 50% 25%, #2b2060, #120d26 75%); box-shadow: inset 0 0 0 1.5px var(--a), 0 0 14px color-mix(in srgb, var(--a) 50%, transparent); }
.av.has-art svg { width: 62%; height: 62%; fill: none; stroke: currentColor; stroke-width: 3.6; stroke-linecap: round; stroke-linejoin: round; }
.av.art-solid svg { filter: drop-shadow(0 1px 1px #0005); }
.av.art-neon svg { filter: drop-shadow(0 0 3px var(--a)); }

/* Accueil */
.category-nav { background: linear-gradient(180deg, #17102ff2, #0f0a20f2); border-color: #ffffff22; box-shadow: 0 12px 32px #0006, inset 0 1px 0 #ffffff14; }
.category-nav-label { color: #9ff3dc; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; }
.game-category-title { font-size: 18px; letter-spacing: .5px; padding-left: 12px; border-left: 3px solid #3ee6b0; line-height: 1.1; }
.gcard { transition: transform .18s, box-shadow .18s, border-color .18s; }
.gcard:hover { transform: translateY(-4px); box-shadow: 0 16px 34px #0007, 0 0 0 1px color-mix(in srgb, var(--c) 50%, transparent); }

/* Pastille de demandes sur le pseudo */
#acct .badge { box-shadow: 0 0 0 2px #120d26, 0 0 12px #ff6b8199; animation: badgePulse 2s ease-in-out infinite; }
@keyframes badgePulse { 50% { transform: scale(1.12); } }

/* Fiche d'un joueur */
.profile-detail { width: 500px; }

/* Bouton « + Ami » dans les salons et le chat */
.friend-add { border-radius: 999px; padding: 5px 12px; font-size: 12px; box-shadow: none; }
.friend-add:disabled { opacity: .85; background: #3ee6b01f; border: 1px solid #3ee6b055; color: #c4fff3; }
.chat-section .friend-line { padding: 5px 8px; border-radius: 10px; background: #ffffff0a; margin-bottom: 4px; font-size: 13px; }

@media (max-width: 700px) {
  .profile { width: 100%; }
  .profile > * { margin-left: 16px; margin-right: 16px; }
  .profile > .av.big { width: 72px; height: 72px; font-size: 32px; margin-bottom: -36px; }
  .profile::before { height: 80px; }
  .profile > h3 { margin-top: 42px; font-size: 22px; }
  .profile > .profile-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .profile > .profile-tabs .btn { font-size: 11px; padding: 8px 2px; }
  .profile-friend { flex-wrap: wrap; }
  .profile-friend .profile-name-link { flex: 1 1 90px; }
  .profile-add { flex-wrap: nowrap; }
  .profile-add .inp { width: auto; flex: 1; }
}

.seo-links { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.seo-links a { color: #b9a8ff; }
