/* =====================================================================
   Social : amis, Watch Party, réglages
   ===================================================================== */

/* ---- Page Amis ---- */
.social-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr);
  gap: clamp(20px, calc(2.4vw / var(--ui)), 32px);
  padding: 0 var(--gutter);
  align-items: start;
}
.code-box { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; }
.code-box__code {
  font-size: clamp(1.8rem, calc(3vw / var(--ui)), 2.4rem);
  font-weight: 700;
  font-stretch: 85%;
  letter-spacing: .06em;
  font-variant-numeric: tabular-nums;
}
.friend-list { display: grid; gap: 4px; }
.friend {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: 18px;
  transition: background var(--t-fast);
}
.friend:hover { background: var(--fill); }
.friend__who { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 14px; min-width: 0; border-radius: 14px; }
.is-kb .friend__who--link:focus { outline: 3px solid var(--focus); outline-offset: 6px; }
@media (hover: hover) { .friend__who--link:hover .friend__name { text-decoration: underline; } }
.friend__name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.friend__status { color: var(--label-2); font-size: var(--fs-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.friend__status--live { color: var(--live); }
.friend__status--on { color: var(--ok); }
.friend__actions { display: flex; gap: 8px; }
.friend__media { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.friend__poster { width: 34px; height: 51px; border-radius: 5px; object-fit: cover; background: var(--fill); }
.mode-note { display: flex; gap: 12px; align-items: flex-start; color: var(--label-2); font-size: var(--fs-body); line-height: 1.5; }
.mode-note .dot { margin-top: 7px; }

/* ---- Panneau Watch Party (dans le lecteur) ---- */
.party-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 7;
  width: min(400px, 100%);
  display: flex;
  flex-direction: column;
  background: var(--material-thick);
  -webkit-backdrop-filter: blur(44px) saturate(1.8);
  backdrop-filter: blur(44px) saturate(1.8);
  border-left: 1px solid var(--separator);
  animation: party-in var(--t-med) var(--ease);
}
@keyframes party-in { from { opacity: 0; transform: translateX(30px); } }
.party-panel__head { display: flex; align-items: center; gap: 12px; padding: max(22px, env(safe-area-inset-top)) 20px 14px; }
.party-panel__title { flex: 1; font-size: var(--fs-title3); font-weight: 600; display: flex; align-items: center; gap: 10px; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 4px rgba(255, 107, 139, .22); }
.party-panel__body { flex: 1; overflow-y: auto; padding: 0 20px 16px; display: grid; align-content: start; gap: 18px; }
.party-section__title { font-size: var(--fs-caption); font-weight: 600; color: var(--label-3); margin-bottom: 8px; }
.party-link { display: flex; gap: 8px; }
.party-link .input { height: 42px; font-size: var(--fs-caption); }
.member { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 8px 4px; }
.member__name { font-weight: 600; display: flex; align-items: center; gap: 6px; min-width: 0; }
.member__name .ico { width: 15px; height: 15px; color: var(--warn); }
.member__state { color: var(--label-3); font-size: var(--fs-caption); }
.member__sync { font-size: var(--fs-caption); color: var(--label-3); font-variant-numeric: tabular-nums; }
.party-waiting { display: flex; align-items: center; gap: 10px; padding: 8px 4px; color: var(--live); font-weight: 600; }
.party-offset { display: flex; align-items: center; gap: 8px; }
.invite-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 6px 4px; }

.chat { display: grid; gap: 10px; }
.chat__msg { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; }
.chat__bubble { padding: 8px 12px; border-radius: 14px; background: var(--fill); line-height: 1.4; word-break: break-word; }
.chat__who { font-size: var(--fs-caption); font-weight: 600; color: var(--label-2); margin-bottom: 2px; }
.chat__sys { color: var(--label-3); font-size: var(--fs-caption); text-align: center; }
.party-panel__foot { padding: 12px 20px max(16px, env(safe-area-inset-bottom)); border-top: 1px solid var(--separator); display: grid; gap: 10px; }
.reaction-bar { display: flex; justify-content: space-between; }
.reaction-btn { width: 44px; height: 44px; border-radius: 50%; font-size: 1.4rem; display: grid; place-items: center; transition: transform var(--t-fast) var(--ease), background var(--t-fast); }
@media (hover: hover) { .reaction-btn:hover { background: var(--fill); transform: scale(1.12); } }
.is-kb .reaction-btn:focus { outline: none; background: var(--focus); transform: scale(1.15); }
.chat-form { display: flex; gap: 8px; }
.chat-form .input { height: 44px; }

/* ---- Profil (le tien ou celui d'un ami) ---- */
.profile-page__head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 24px; padding: 0 var(--gutter); }
.profile-page__id { display: grid; gap: 10px; min-width: 0; }
.profile-page__name { font-size: var(--fs-display); line-height: 1; overflow-wrap: anywhere; }
.profile-page__stats { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--label-2); }
.profile-page__stat strong { color: var(--label); font-variant-numeric: tabular-nums; }
.profile-page__presence { font-weight: 600; color: var(--label-3); }
.profile-page__presence--on { color: var(--ok); }
.profile-page__presence--live { color: var(--live); }
.profile-page__visibility { color: var(--label-3); font-size: var(--fs-caption); }
.profile-page__actions { justify-content: flex-end; }
.profile-page__body { display: grid; }
.profile-page__section { display: grid; gap: 14px; margin-top: clamp(26px, calc(3.2vw / var(--ui)), 46px); }
.profile-page__section > .row__title { padding: 0 var(--gutter); }
.profile-page__section-head { display: flex; align-items: baseline; gap: 16px; padding: 0 var(--gutter); }
.profile-page__more { color: var(--label-2); font-size: var(--fs-caption); font-weight: 600; }
.profile-page__more:hover { color: var(--label); }
.profile-page .row__head .btn { margin-left: auto; }
.profile-page__friends { display: flex; gap: 22px; overflow-x: auto; padding: 6px var(--gutter) 10px; scrollbar-width: none; }
.profile-page__friend { flex: none; display: grid; justify-items: center; gap: 8px; width: 88px; text-align: center; font-size: var(--fs-caption); color: var(--label-2); }
.profile-page__friend .avatar { transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast); }
.is-kb .profile-page__friend:focus { outline: none; color: var(--label); }
.is-kb .profile-page__friend:focus .avatar { box-shadow: 0 0 0 3px var(--focus); transform: scale(1.08); }
@media (max-width: 760px) {
  .profile-page__head { grid-template-columns: auto minmax(0, 1fr); gap: 16px; }
  .profile-page__head .avatar--xl { --size: 64px; }
  .profile-page__actions { grid-column: 1 / -1; justify-content: flex-start; }
}

/* ---- Avis des membres (fiche d'un titre) ---- */
.comments { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 14px; }
.comment { display: grid; align-content: start; gap: 10px; padding: 16px 18px; border-radius: 20px; background: var(--fill); }
.comment--mine { background: var(--material); box-shadow: inset 0 0 0 1px var(--separator); }
.comment__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.comment__author { display: inline-flex; align-items: center; gap: 10px; padding-right: 6px; border-radius: var(--r-pill); font-weight: 700; }
.comment__author .badge { font-weight: 600; }
.is-kb .comment__author:focus { outline: 3px solid var(--focus); outline-offset: 3px; }
.comment__label { color: var(--label-2); font-size: var(--fs-caption); font-weight: 600; }
.comment .review-card__text { -webkit-line-clamp: 8; }
.comment__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--label-3); font-size: var(--fs-caption); }

/* ---- Salon de Watch Party (page derrière le lecteur) ---- */
.lobby { min-height: calc(100vh / var(--ui)); display: flex; align-items: flex-end; padding: calc(var(--nav-h) + 40px) var(--gutter) clamp(40px, calc(8vh / var(--ui)), 96px); position: relative; isolation: isolate; }
.lobby__main { display: grid; justify-items: start; gap: 18px; max-width: 680px; }
.lobby__members { display: flex; flex-wrap: wrap; gap: 10px; }
.lobby__member { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: var(--r-pill); background: var(--fill); font-weight: 500; }

/* ---- Réglages ---- */
.settings { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(28px, calc(3vw / var(--ui)), 44px); padding: 0 var(--gutter); max-width: 1400px; }
.settings__nav { margin: 0; padding: 0 0 4px; flex-wrap: wrap; overflow: visible; max-width: 100%; }
/* Téléphone : les onglets sur une ligne, qui défile */
@media (max-width: 600px) {
  .settings__nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); }
  .settings__nav::-webkit-scrollbar { display: none; }
}
.settings__section { display: grid; gap: 16px; scroll-margin-top: calc(var(--nav-h) + 20px); }
.settings__heading { font-size: var(--fs-title2); font-weight: 700; letter-spacing: -.02em; }
/* Deux colonnes de panneaux sur un grand écran */
.settings__panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 540px), 1fr)); align-items: start; gap: clamp(18px, calc(2vw / var(--ui)), 26px); }
.settings__col { display: grid; align-content: start; gap: clamp(18px, calc(2vw / var(--ui)), 26px); min-width: 0; } /* plusieurs panneaux dans une colonne */
.addon-list { display: grid; gap: 6px; }
.addon {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--fill);
}
.addon__logo { width: 40px; height: 40px; border-radius: 10px; object-fit: contain; background: var(--fill-2); }
.addon__logo--letter { display: grid; place-items: center; font-weight: 700; color: var(--label-2); }
.addon__name { font-weight: 600; }
.addon__meta { color: var(--label-3); font-size: var(--fs-caption); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.addon__actions { display: flex; gap: 6px; }
.addon__meta--wrap { white-space: normal; }
.addon-personal { display: grid; gap: 8px; margin-top: 8px; }
.addon-status { display: grid; gap: 14px; padding: 16px 18px; border-radius: 16px; background: var(--fill); }
.caps { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--separator); }
.caps__summary { cursor: pointer; font-weight: 600; }
.caps__summary::marker { color: var(--label-3); }
.is-kb .caps__summary:focus { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: 6px; }
.caps-row { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: baseline; gap: 12px; }
.caps-row__label { color: var(--label-3); font-size: var(--fs-caption); font-weight: 600; }
.caps-row__list { display: flex; flex-wrap: wrap; gap: 6px; }
.cap { padding: 3px 10px; border-radius: var(--r-pill); font-size: var(--fs-caption); background: var(--fill); }
.cap--ok { color: var(--label); }
.cap--no { color: var(--label-3); background: transparent; box-shadow: inset 0 0 0 1px var(--separator); }
/* Sources partagées : clés distribuées aux profils */
.sharing__keys { display: grid; gap: 6px; }
.sharing__key { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--fill); }
.sharing__key--revoked { opacity: .55; }
.addon-steps { margin: 0; padding-left: 1.4em; display: grid; gap: 4px; color: var(--label-2); font-size: var(--fs-caption); line-height: 1.5; }

@media (max-width: 900px) {
  .social-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .party-panel { width: 100%; }
  .addon { grid-template-columns: minmax(0, 1fr); }
  .addon__logo { display: none; }
}

/* Fond du salon : visuel du média en cours, assombri */
.lobby__bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.lobby__bg img { width: 100%; height: 100%; max-width: none; object-fit: cover; opacity: 0; transition: opacity 900ms var(--ease); }
.lobby__bg img.is-loaded { opacity: .6; }
.lobby__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(0deg, #000 6%, rgba(0, 0, 0, .35) 58%, rgba(0, 0, 0, .65) 100%),
    linear-gradient(90deg, rgba(0, 0, 0, .75), rgba(0, 0, 0, 0) 70%);
}
.lobby__title { font-size: var(--fs-display); }
.lobby__status { display: flex; align-items: center; gap: 10px; color: var(--label-2); font-size: var(--fs-callout); }

/* ---- Ton année RODOJO ---- */
.year__body { display: grid; gap: clamp(26px, calc(3.2vw / var(--ui)), 46px); margin-top: 8px; }
.year__section { display: grid; gap: 14px; }
.year__section > .row__title { padding: 0 var(--gutter); }
.year__tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 14px; padding: 0 var(--gutter); }
.year__tile { display: grid; gap: 6px; padding: 18px 20px; border-radius: var(--r-panel); background: var(--material); }
.year__tile--hero { grid-column: span 2; }
@media (max-width: 620px) { .year__tile--hero { grid-column: 1 / -1; } }
.year__value { font-size: clamp(2rem, calc(4vw / var(--ui)), 3.2rem); line-height: 1; font-variant-numeric: tabular-nums; }
.year__tile--hero .year__value { font-size: clamp(2.6rem, calc(6vw / var(--ui)), 4.6rem); }
.year__hint { padding: 0 var(--gutter); margin-top: -8px; color: var(--label-2); }
.year__people { padding-top: 6px; max-width: 760px; }
.year__label { color: var(--label-2); }
/* Une seule série : une teinte neutre, le mois le plus actif en clair ; barres posées sur la ligne de base */
.year__months { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 2px; padding: 0 var(--gutter); max-width: 980px; }
.year__month { display: grid; gap: 6px; justify-items: center; }
.year__bar-zone { width: 100%; height: clamp(90px, calc(14vw / var(--ui)), 160px); display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid var(--separator); }
.year__bar { width: min(28px, 70%); height: var(--v); background: var(--label-3); border-radius: 4px 4px 0 0; }
.year__month.is-top .year__bar { background: var(--label); }
.year__month-label { font-size: var(--fs-caption); color: var(--label-3); }
.year__month.is-top .year__month-label { color: var(--label); font-weight: 600; }
.year__genres { display: grid; gap: 10px; padding: 0 var(--gutter); max-width: 760px; }
.year__genre { display: grid; grid-template-columns: minmax(84px, 160px) minmax(0, 1fr) 4.5em; align-items: center; gap: 12px; }
.year__genre-track { height: 10px; }
.year__bar--h { width: var(--v); height: 100%; border-radius: 0 4px 4px 0; }
.year__genre:first-child .year__bar--h { background: var(--label); }
.year__genre-share { color: var(--label-2); font-variant-numeric: tabular-nums; text-align: right; }

/* ---------------------------------------------------------------------
   Notifications (#/notifications) : nouveautés, puis ce que tu suis
   --------------------------------------------------------------------- */
.notifs__group-title { padding: 0 var(--gutter); font-size: var(--fs-title3); font-weight: 600; letter-spacing: -.01em; }
.notifs__items { display: grid; gap: 8px; padding: 14px var(--gutter) 0; max-width: calc(880px + 2 * var(--gutter)); }
.notif {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 10px 36px 10px 10px;
  border-radius: var(--r-panel);
  background: var(--fill);
  color: var(--label);
  transition: background var(--t-fast), transform var(--t-fast) var(--ease);
}
@media (hover: hover) { a.notif:hover { background: var(--fill-2); } }
.is-kb .notif:focus { outline: none; background: var(--focus); color: var(--on-focus); transform: scale(1.02); }
.is-kb .notif:focus .notif__body,
.is-kb .notif:focus .notif__when { color: inherit; opacity: .7; }
.notif__media { width: 52px; height: 78px; border-radius: 8px; object-fit: cover; background: var(--fill-2); }
.notif__media--icon { display: grid; place-items: center; height: 52px; border-radius: 50%; color: var(--label-2); }
.notif__text { display: grid; gap: 3px; min-width: 0; }
.notif__title { font-size: var(--fs-callout); font-weight: 600; overflow-wrap: anywhere; }
.notif__body { color: var(--label-2); font-size: var(--fs-body); overflow-wrap: anywhere; }
.notif__when { color: var(--label-3); font-size: var(--fs-caption); }
/* Pas encore vue à l'ouverture de la page */
.notif.is-new::after { content: ""; position: absolute; top: 50%; right: 16px; width: 9px; height: 9px; margin-top: -4.5px; border-radius: 50%; background: var(--live); }

.notifs__follows { padding-bottom: 8px; }
.follow-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px var(--gutter) 0; }
.follow-chip { display: inline-flex; align-items: center; gap: 2px; padding: 4px 4px 4px 4px; border-radius: var(--r-pill); background: var(--fill); }
.follow-chip__link { display: inline-flex; align-items: center; gap: 10px; padding: 2px 10px 2px 2px; border-radius: var(--r-pill); font-weight: 600; }
.follow-chip__img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--fill-2); }
.follow-chip__remove { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: var(--label-2); }
.follow-chip__remove .ico { width: 16px; height: 16px; }
@media (hover: hover) { .follow-chip__remove:hover { background: var(--fill-2); color: var(--label); } }
.notifs__settings { display: inline-block; margin: 18px var(--gutter) 0; color: var(--label-2); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.panel .notifs__settings { margin: 6px 0 0; }
