/**
 * InterFilm — QUI REGARDE ? + Gérer les profils (noir / orange)
 */

/* ─── Masquer la barre mobile quand lecteur / gate / modale profil ─── */
body.player-open .mobile-bottom-bar,
body.profile-gate-open .mobile-bottom-bar,
body.profile-manager-open .mobile-bottom-bar {
  display: none !important;
}

body.player-open .mobile-nav-sheet {
  display: none !important;
}

/* ─── Profile gate ─── */
#profileGate {
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(247, 127, 0, 0.12) 0%, transparent 55%),
    #050505 !important;
  padding: 2rem 1.25rem 2.5rem;
  gap: 0;
  align-items: center !important;
  width: 100%;
  box-sizing: border-box;
}

.pg-title {
  font-family: 'Bebas Neue', var(--ff-head);
  font-size: clamp(2.5rem, 9vw, 3.75rem);
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: clamp(2rem, 6vw, 3.25rem);
  display: flex;
  align-items: center;
  gap: 0.35em;
  line-height: 1;
}

.pg-title-w {
  color: #fff;
}

.pg-title-o {
  color: #f77f00;
  text-shadow: 0 0 28px rgba(247, 127, 0, 0.35);
}

.pg-profiles-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  justify-content: center;
  gap: clamp(2rem, 7vw, 3.5rem);
  align-items: flex-start;
  max-width: 1100px;
  width: 100%;
  padding: 0 0.5rem;
  box-sizing: border-box;
}

#pgVipProfiles {
  display: contents;
}

.pg-card {
  opacity: 0.72;
  gap: 12px;
}

.pg-card--discord {
  opacity: 1 !important;
}

.pg-card--discord .pg-avatar-box {
  border-color: rgba(88, 101, 242, 0.55);
  box-shadow: 0 12px 36px rgba(88, 101, 242, 0.28);
}

.pg-card-sub {
  font-family: var(--ff-body);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.45);
  text-transform: none;
  margin-top: -4px;
}

.pg-gate-guest {
  opacity: 0.55;
}

.pg-card:hover {
  opacity: 1;
  transform: scale(1.06);
}

.pg-card:hover .pg-avatar-box {
  border-color: rgba(247, 127, 0, 0.55);
  box-shadow: 0 12px 40px rgba(247, 127, 0, 0.2);
}

.pg-avatar-box {
  width: clamp(108px, 28vw, 140px);
  height: clamp(108px, 28vw, 140px);
  border: 3px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.pg-name {
  font-family: 'Bebas Neue', var(--ff-head);
  font-size: 0.9375rem;
  letter-spacing: 0.08em;
}

.pg-manage-btn {
  margin-top: clamp(2rem, 5vw, 3.5rem);
  margin-left: auto;
  margin-right: auto;
  align-self: center;
  display: block;
  background: rgba(247, 127, 0, 0.08);
  border: 1px solid rgba(247, 127, 0, 0.35);
  color: #f77f00;
  padding: 12px 28px;
  font-family: 'Bebas Neue', var(--ff-head);
  font-size: 0.9375rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  border-radius: 10px;
  transition: 0.22s ease;
}

/* Masqué avant l’animation (évite le flash visible) */
#profileGate.profile-gate--pending .pg-title,
#profileGate.profile-gate--pending .pg-profiles-row .pg-card,
#profileGate.profile-gate--pending .pg-manage-btn {
  opacity: 0 !important;
  pointer-events: none;
}

.pg-manage-btn:hover {
  color: #fff;
  background: linear-gradient(135deg, #f77f00, #ff9500);
  border-color: transparent;
  box-shadow: 0 8px 28px rgba(247, 127, 0, 0.35);
}

/* ─── Entrée « Qui regarde ? » (≥ 3 s par mouvement) ─── */
#profileGate.profile-gate--animate .pg-title {
  opacity: 0;
  transform: translateY(40px);
  animation: pgGateTitleUp 3s cubic-bezier(0.22, 1, 0.36, 1) 0.2s forwards;
}

#profileGate.profile-gate--animate .pg-card.pg-gate-from-side-left {
  opacity: 0;
  transform: translateX(-56px) scale(0.96);
  animation: pgGateFromLeft 3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

#profileGate.profile-gate--animate #pgMainCard {
  animation-delay: 0.55s;
}

#profileGate.profile-gate--animate .pg-card.pg-gate-from-side-right {
  opacity: 0;
  transform: translateX(56px) scale(0.96);
  animation: pgGateFromRight 3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

#profileGate.profile-gate--animate .pg-gate-guest {
  animation-delay: 1.15s;
}

#profileGate.profile-gate--animate #pgVipProfiles .pg-card.pg-gate-from-side-left {
  opacity: 0;
  transform: translateX(-48px) scale(0.96);
  animation: pgGateFromLeft 3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

#profileGate.profile-gate--animate #pgVipProfiles .pg-card.pg-gate-from-side-right {
  opacity: 0;
  transform: translateX(48px) scale(0.96);
  animation: pgGateFromRight 3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

#profileGate.profile-gate--animate #pgVipProfiles .pg-card:nth-child(1) { animation-delay: 0.7s; }
#profileGate.profile-gate--animate #pgVipProfiles .pg-card:nth-child(2) { animation-delay: 0.95s; }
#profileGate.profile-gate--animate #pgVipProfiles .pg-card:nth-child(3) { animation-delay: 1.2s; }
#profileGate.profile-gate--animate #pgVipProfiles .pg-card:nth-child(4) { animation-delay: 1.45s; }
#profileGate.profile-gate--animate #pgVipProfiles .pg-card:nth-child(5) { animation-delay: 1.7s; }

#profileGate.profile-gate--animate .pg-manage-btn.pg-gate-from-bottom {
  opacity: 0;
  transform: translateY(28px);
  animation: pgGateManageUp 3s cubic-bezier(0.22, 1, 0.36, 1) 1.85s forwards;
}

#profileGate.profile-gate--animate .pg-card {
  pointer-events: auto;
  cursor: pointer;
  animation-fill-mode: forwards;
}

@keyframes pgGateTitleUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pgGateFromLeft {
  to {
    opacity: 0.72;
    transform: translateX(0) scale(1);
  }
}

@keyframes pgGateFromRight {
  to {
    opacity: 0.72;
    transform: translateX(0) scale(1);
  }
}

#profileGate.profile-gate--animate .pg-card:hover,
#profileGate.profile-gate--animate .pg-gate-guest:hover {
  opacity: 1;
}

@keyframes pgGateManageUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Modale gérer les profils — montée depuis le bas */
.pm-modal.pm-modal--enter {
  display: flex;
}

.pm-modal.pm-modal--enter .pm-dialog {
  opacity: 0;
  transform: translateY(72px) scale(0.94);
  animation: pgGateManageUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@media (prefers-reduced-motion: reduce) {
  #profileGate.profile-gate--pending .pg-title,
  #profileGate.profile-gate--pending .pg-profiles-row .pg-card,
  #profileGate.profile-gate--pending .pg-manage-btn {
    opacity: 1 !important;
  }

  #profileGate.profile-gate--animate .pg-title,
  #profileGate.profile-gate--animate .pg-card,
  #profileGate.profile-gate--animate .pg-manage-btn,
  .pm-modal.pm-modal--enter .pm-dialog {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ─── Modale gérer les profils ─── */
.pm-modal {
  position: fixed;
  inset: 0;
  z-index: 100000020;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
}

.pm-dialog {
  width: 100%;
  max-width: 520px;
  max-height: min(90vh, 720px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: linear-gradient(165deg, #101010 0%, #060606 100%);
  border: 1px solid rgba(247, 127, 0, 0.22);
  border-radius: 20px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.pm-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 20px 22px;
  border-bottom: 1px solid rgba(247, 127, 0, 0.12);
  background: rgba(247, 127, 0, 0.04);
}

.pm-head-title {
  font-family: 'Bebas Neue', var(--ff-head);
  font-size: 1.375rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  margin: 0;
}

.pm-head-title span {
  color: #f77f00;
}

.pm-close {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
}

.pm-close:hover {
  color: #fff;
  border-color: rgba(247, 127, 0, 0.4);
  background: rgba(247, 127, 0, 0.12);
}

.pm-body {
  padding: 22px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.pm-intro {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.65;
  text-align: center;
  margin-bottom: 1.5rem;
}

.pm-intro strong {
  color: #f77f00;
  font-weight: 700;
}

.pm-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 1.5rem;
}

.pm-profile-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  transition: border-color 0.2s, background 0.2s;
}

.pm-profile-row:hover {
  background: rgba(247, 127, 0, 0.05);
  border-color: rgba(247, 127, 0, 0.22);
}

.pm-avatar-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(247, 127, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  overflow: hidden;
  transition: 0.2s;
}

.pm-avatar-btn:hover {
  border-color: rgba(247, 127, 0, 0.55);
  box-shadow: 0 0 20px rgba(247, 127, 0, 0.2);
}

.pm-avatar-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.pm-profile-meta {
  flex: 1;
  min-width: 0;
}

.pm-profile-name {
  font-family: 'Bebas Neue', var(--ff-head);
  font-size: 1.0625rem;
  letter-spacing: 0.04em;
  color: #fff;
  margin-bottom: 2px;
}

.pm-profile-tag {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f77f00;
}

.pm-profile-input {
  display: none;
  width: 100%;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(247, 127, 0, 0.35);
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.875rem;
  outline: none;
}

.pm-row-actions {
  display: flex;
  gap: 6px;
}

.pm-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.2s;
}

.pm-icon-btn:hover {
  color: #fff;
  border-color: rgba(247, 127, 0, 0.4);
  background: rgba(247, 127, 0, 0.12);
}

.pm-icon-btn--danger:hover {
  color: #ff8a8a;
  border-color: rgba(255, 100, 100, 0.35);
  background: rgba(255, 80, 80, 0.1);
}

.pm-add-block {
  background: rgba(0, 0, 0, 0.35);
  border: 1px dashed rgba(247, 127, 0, 0.28);
  border-radius: 16px;
  padding: 1.75rem 1.25rem;
  text-align: center;
}

.pm-add-avatar {
  width: 72px;
  height: 72px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: rgba(247, 127, 0, 0.06);
  border: 2px solid rgba(247, 127, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: 0.2s;
}

.pm-add-avatar:hover {
  transform: translateY(-2px);
  border-color: rgba(247, 127, 0, 0.5);
  box-shadow: 0 8px 24px rgba(247, 127, 0, 0.2);
}

.pm-add-avatar img,
.pm-add-avatar svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.pm-add-title {
  font-family: 'Bebas Neue', var(--ff-head);
  font-size: 1.0625rem;
  letter-spacing: 0.06em;
  color: #fff;
  margin-bottom: 0.875rem;
}

.pm-input {
  width: 100%;
  max-width: 320px;
  margin: 0 auto 1rem;
  display: block;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 13px 16px;
  border-radius: 10px;
  font-size: 0.875rem;
  text-align: center;
  outline: none;
  transition: 0.2s;
}

.pm-input:focus {
  border-color: rgba(247, 127, 0, 0.45);
  background: rgba(0, 0, 0, 0.75);
}

.pm-btn-primary {
  background: linear-gradient(135deg, #f77f00, #ff9500);
  color: #fff;
  border: none;
  padding: 12px 28px;
  border-radius: 10px;
  font-family: 'Bebas Neue', var(--ff-head);
  font-size: 0.9375rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: 0.2s;
  box-shadow: 0 8px 24px rgba(247, 127, 0, 0.35);
}

.pm-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(247, 127, 0, 0.45);
}

.pm-limit-msg {
  text-align: center;
  padding: 1rem;
  border-radius: 12px;
  background: rgba(247, 127, 0, 0.06);
  border: 1px solid rgba(247, 127, 0, 0.18);
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.875rem;
}

/* Avatar picker modal */
.am-modal {
  position: fixed;
  inset: 0;
  z-index: 100000030;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(20px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.am-dialog {
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  background: #0a0a0a;
  border: 1px solid rgba(247, 127, 0, 0.2);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.am-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(247, 127, 0, 0.12);
  font-family: 'Bebas Neue', var(--ff-head);
  font-size: 1.125rem;
  letter-spacing: 0.08em;
  color: #fff;
}

.am-head span {
  color: #f77f00;
}

.am-body {
  padding: 18px;
  overflow-y: auto;
}

.am-category {
  font-family: 'Bebas Neue', var(--ff-head);
  color: #f77f00;
  margin-bottom: 10px;
  font-size: 1rem;
  letter-spacing: 0.06em;
}

.am-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 10px;
  margin-bottom: 1.25rem;
}

.am-grid img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  cursor: pointer;
  object-fit: cover;
  border: 2px solid transparent;
  background: #111;
  transition: 0.18s;
}

.am-grid img:hover {
  border-color: #f77f00;
  transform: scale(1.05);
}

/* Navigation mobile — labels blancs Bebas */
.mobile-tab-btn span {
  font-family: 'Bebas Neue', var(--ff-head);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.82);
}

.mobile-tab-btn:not(.active) {
  color: rgba(255, 255, 255, 0.55);
}

.mobile-tab-btn.active span {
  color: #f77f00;
}
