/* ---- Social : avatars de compte, page profil, amis, recadrage ---- */
.savatar {
  flex: none; display: inline-grid; place-items: center; overflow: hidden; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #b4720a); color: #141414; font-weight: 700;
  width: 40px; height: 40px; font-size: 17px; box-shadow: 0 0 0 2px var(--bg-2);
}
.savatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.savatar.sm { width: 28px; height: 28px; font-size: 12px; }
.savatar.lg { width: 72px; height: 72px; font-size: 28px; }
.savatar.xl { width: 132px; height: 132px; font-size: 54px; box-shadow: 0 0 0 5px var(--bg); }

.nav-item .count.alert, .count.alert {
  background: var(--danger); color: #fff; font-weight: 700; border-radius: 10px; padding: 0 7px; min-width: 18px; text-align: center; line-height: 18px; font-size: 11px;
}
.panel h2 .count.alert { vertical-align: 2px; margin-left: 4px; }
.tag.ok { background: rgba(70,167,88,.15); color: var(--ok); }

/* Connexion / inscription */
.auth-alt { text-align: center; color: var(--text-3); margin: 18px 0 0; font-size: 13px; }
.auth-alt a { color: var(--accent); font-weight: 600; }

/* Page profil */
.prof { margin: -24px -24px 18px; }
.prof-banner { position: relative; height: clamp(150px, 24vw, 300px); background: var(--bg-3); overflow: hidden; }
.prof-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.prof-banner.empty { background: radial-gradient(ellipse at 20% 0%, rgba(229,160,13,.35), transparent 60%), linear-gradient(120deg, #2a2416, var(--bg-3) 70%); }
.prof-banner::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 55%, rgba(21,24,27,.85)); pointer-events: none; }
.prof-edit { position: absolute; z-index: 1; display: flex; gap: 6px; }
.prof-edit.on-banner { right: 18px; top: 16px; }
.prof-edit .btn { background: rgba(21,24,27,.7); backdrop-filter: blur(6px); border-color: rgba(255,255,255,.12); }
.prof-head { display: flex; align-items: flex-end; gap: 22px; padding: 0 32px; margin-top: -66px; position: relative; flex-wrap: wrap; }
.prof-av { position: relative; }
.prof-av-edit {
  position: absolute; right: 4px; bottom: 4px; width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--bg);
  background: var(--accent); color: #141414; display: grid; place-items: center; cursor: pointer; transition: transform .15s;
}
.prof-av-edit:hover { transform: scale(1.1); }
.prof-av-edit .ic { width: 16px; height: 16px; }
.prof-id { flex: 1; min-width: 200px; padding-bottom: 8px; }
.prof-id h1 { font-size: 30px; }
.prof-sub { display: flex; gap: 14px; color: var(--text-3); margin-top: 4px; flex-wrap: wrap; }
.prof-sub a:hover { color: var(--accent); }
.prof-actions { display: flex; gap: 8px; padding-bottom: 12px; flex-wrap: wrap; }
.prof-locked { display: flex; gap: 16px; align-items: center; }
.prof-locked > .ic { width: 34px; height: 34px; color: var(--text-3); flex: none; }
.prof-locked .desc { margin: 4px 0 0; }

.prof-live {
  display: flex; gap: 16px; align-items: center; background: var(--bg-2); border: 1px solid rgba(229,160,13,.35);
  border-radius: 12px; padding: 12px; margin-bottom: 18px; max-width: 620px; transition: border-color .2s;
}
.prof-live:hover { border-color: var(--accent); }
.prof-live img { width: 160px; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; flex: none; }
.prof-live > div { min-width: 0; flex: 1; }
.prof-live b { display: block; font-size: 15px; }
.prof-live .small { color: var(--text-2); }
.prof-live .bar { height: 3px; background: var(--bg-4); border-radius: 2px; margin-top: 10px; overflow: hidden; }
.prof-live .bar i { display: block; height: 100%; background: var(--accent); }
.prof-live-tag, .friend-now { display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); margin-bottom: 4px; }
.prof-live-tag i, .friend-now i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(229,160,13,.6); animation: live-pulse 1.6s infinite; flex: none; }
@keyframes live-pulse { 70% { box-shadow: 0 0 0 7px rgba(229,160,13,0); } 100% { box-shadow: 0 0 0 0 rgba(229,160,13,0); } }

.prof-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 30px; }
.prof-stat { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.prof-stat b { font-size: 24px; color: var(--text); font-variant-numeric: tabular-nums; }
.prof-stat span { color: var(--text-3); font-size: 12px; }
.prof-stat.genres { grid-column: span 2; }
.prof-stat.genres div { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.prof-stat.genres .tag { text-transform: none; letter-spacing: 0; font-size: 12px; color: var(--text); }

.prof-recent { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 4px 18px; }
.prof-row { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 8px; transition: background .15s; min-width: 0; }
.prof-row:hover { background: var(--bg-2); }
.prof-row .thumb { width: 96px; aspect-ratio: 16/9; border-radius: 6px; overflow: hidden; background: var(--bg-3); flex: none; }
.prof-row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.prof-row .info { flex: 1; min-width: 0; }
.prof-row .info b, .prof-row .info .small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prof-row .info .small { color: var(--text-3); }
.prof-row .when { color: var(--text-3); font-size: 12px; white-space: nowrap; }

/* Page Amis */
.friend-results .list-row .name { font-weight: 600; }
.friend-results:not(:empty) { margin-top: 10px; }
.list-row a.name:hover, .list-row .name a:hover { color: var(--accent); }
.friend-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.friend-card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 0 12px 16px; overflow: hidden;
  transition: transform .2s, border-color .2s;
}
.friend-card:hover { transform: translateY(-3px); border-color: rgba(229,160,13,.4); }
.friend-banner { align-self: stretch; height: 64px; margin: 0 -12px -36px; background: linear-gradient(120deg, #2a2416, var(--bg-3)); }
.friend-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.friend-card .savatar { box-shadow: 0 0 0 4px var(--bg-2); }
.friend-card b { margin-top: 4px; }
.friend-card .small { color: var(--text-3); }
.friend-now { margin: 0; max-width: 100%; text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 600; }
.friend-now span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Fiche : « Vu par » */
.friends-strip { display: flex; align-items: center; gap: 10px; margin-top: 16px; color: var(--text-2); font-size: 13px; }
.friends-strip .faces { display: flex; }
.friends-strip .faces a + a { margin-left: -8px; }
.friends-strip .faces .savatar { box-shadow: 0 0 0 2px var(--bg); transition: transform .15s; }
.friends-strip .faces a:hover .savatar { transform: translateY(-2px); }
.friends-strip span a { color: var(--text); font-weight: 600; }
.friends-strip span a:hover { color: var(--accent); }

/* Watch party : avatar + séparateur amis / autres */
.party-user > .savatar { flex: none; }
.party-user > .savatar + span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.party-sep { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; padding-top: 8px; border-top: 1px solid var(--line); margin-top: 4px; }

/* Recadrage */
.crop-stage { position: relative; overflow: hidden; background: #0c0e10; border-radius: 10px; touch-action: none; cursor: grab; user-select: none; margin: 0 auto; }
.crop-stage.dragging { cursor: grabbing; }
.crop-stage.crop-avatar { width: min(340px, 100%); aspect-ratio: 1; }
.crop-stage.crop-banner { width: 100%; aspect-ratio: 3; }
.crop-stage > img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; pointer-events: none; }
.crop-stage.gif { cursor: default; }
.crop-stage.gif > img { position: static; width: 100%; height: 100%; object-fit: cover; }
.crop-stage.crop-avatar .crop-mask { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 999px rgba(0,0,0,.55); pointer-events: none; outline: 2px solid rgba(255,255,255,.6); outline-offset: -2px; }
.crop-tools { display: flex; align-items: center; gap: 10px; margin: 16px auto 0; max-width: 340px; color: var(--text-3); }
.crop-zoom { flex: 1; accent-color: var(--accent); }
.crop-hint { text-align: center; color: var(--text-3); font-size: 12px; margin: 10px 0 0; }

@media (max-width: 900px) { .prof { margin: -16px -16px 16px; } }
@media (max-width: 700px) {
  .prof-head { padding: 0 16px; margin-top: -50px; gap: 14px; }
  .savatar.xl { width: 96px; height: 96px; font-size: 40px; }
  .prof-id h1 { font-size: 24px; }
  .prof-stat.genres { grid-column: auto; }
  .prof-recent { grid-template-columns: 1fr; }
  .prof-live img { width: 110px; }
}
