/* =========================================================
   MWINDA PICTURES - ACCOUNT + PROFILE
   Style noir/or adapté au logo Mwinda Pictures.
========================================================= */

/* ===================================================== */
/* RESET */
/* ===================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ===================================================== */
/* BASE */
/* ===================================================== */

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  background: #050505;
  color: #ffffff;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
select {
  font-family: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

/* ===================================================== */
/* VARIABLES */
/* ===================================================== */

:root {
  --mw-bg: #050505;
  --mw-card: rgba(18, 18, 18, 0.94);
  --mw-gold: #d4af37;
  --mw-gold-hover: #f1d675;
  --mw-text: #ffffff;
  --mw-muted: #b8b8b8;
  --mw-border: rgba(212, 175, 55, 0.28);
  --mw-radius: 22px;
}

/* ===================================================== */
/* PAGE */
/* ===================================================== */

.account-page,
.profile-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    linear-gradient(rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.94)),
    radial-gradient(circle at top, rgba(212, 175, 55, 0.28), #050505 58%);
}

/* ===================================================== */
/* CARD */
/* ===================================================== */

.account-card,
.profile-card {
  width: 100%;
  max-width: 450px;
  background: var(--mw-card);
  border: 1px solid var(--mw-border);
  border-radius: var(--mw-radius);
  padding: 34px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.62);
}

/* ===================================================== */
/* LOGO */
/* ===================================================== */

.account-logo,
.profile-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  margin-bottom: 16px;
  text-decoration: none;
}

.account-logo img,
.profile-logo img {
  max-width: 210px;
  max-height: 90px;
  object-fit: contain;
}

.account-logo span,
.profile-logo span {
  display: none;
  color: var(--mw-gold);
  font-size: 24px;
  font-weight: 900;
}

/* ===================================================== */
/* TEXT */
/* ===================================================== */

.account-card h1,
.profile-card h1 {
  text-align: center;
  font-size: 28px;
  margin-bottom: 8px;
}

.account-subtitle,
.profile-subtitle {
  text-align: center;
  color: var(--mw-muted);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 26px;
}

/* ===================================================== */
/* AVATAR */
/* ===================================================== */

.avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 24px;
}

.avatar-section img {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--mw-border);
  background: #222222;
  margin-bottom: 14px;
}

/* ===================================================== */
/* FORM */
/* ===================================================== */

.form-group {
  margin-bottom: 17px;
}

.form-group label {
  display: block;
  color: var(--mw-muted);
  font-size: 14px;
  margin-bottom: 7px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--mw-border);
  outline: none;
  background: #0f0f0f;
  color: var(--mw-text);
  font-size: 15px;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--mw-gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12);
}

.password-box {
  display: flex;
  gap: 8px;
}

.password-box input {
  flex: 1;
}

.password-box button {
  border: 1px solid var(--mw-border);
  background: #1d1d1d;
  color: white;
  border-radius: 10px;
  padding: 0 12px;
  font-weight: 700;
}

.password-box button:hover {
  color: var(--mw-gold-hover);
  border-color: var(--mw-gold);
}

/* ===================================================== */
/* BUTTON */
/* ===================================================== */

.primary-button {
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--mw-gold), #8f6815);
  color: #050505;
  font-size: 16px;
  font-weight: 900;
  margin-top: 8px;
}

.primary-button:hover {
  background: linear-gradient(135deg, var(--mw-gold-hover), var(--mw-gold));
}

/* ===================================================== */
/* FOOTER LINKS */
/* ===================================================== */

.account-footer,
.profile-footer {
  margin-top: 20px;
  text-align: center;
  color: var(--mw-muted);
  font-size: 14px;
}

.account-footer a,
.profile-footer a {
  color: var(--mw-gold-hover);
  font-weight: 800;
  text-decoration: none;
}

.account-footer a:hover,
.profile-footer a:hover {
  text-decoration: underline;
}

/* ===================================================== */
/* RESPONSIVE LAPTOP */
/* ===================================================== */

@media (max-width: 1200px) {

}

/* ===================================================== */
/* RESPONSIVE TABLETTE */
/* ===================================================== */

@media (max-width: 1000px) {

}

/* ===================================================== */
/* RESPONSIVE TELEPHONE */
/* ===================================================== */

@media (max-width: 760px) {

  .account-card,
  .profile-card {
    padding: 26px;
  }

  .account-card h1,
  .profile-card h1 {
    font-size: 24px;
  }

}

/* ===================================================== */
/* RESPONSIVE PETIT TELEPHONE */
/* ===================================================== */

@media (max-width: 480px) {

  .account-page,
  .profile-page {
    padding: 16px;
  }

  .account-card,
  .profile-card {
    padding: 22px;
  }

  .password-box {
    flex-direction: column;
  }

  .password-box button {
    min-height: 44px;
  }

}


/* =====================================================
   MWINDA LOGO FIX
===================================================== */

.account-logo img,
.profile-logo img {
  display: block;
  max-width: 230px;
  max-height: 110px;
  object-fit: contain;
}

/* =====================================================
   MWINDA MULTI PROFILE + ANIMATED BACKGROUND
   Ajout ciblé sans modifier les autres pages.
===================================================== */

.profile-page {
  position: relative;
  overflow: hidden;
  background: #050505;
}

.profile-page::before {
  content: "";
  position: fixed;
  inset: -8vh -8vw;
  z-index: -2;
  background:
    linear-gradient(rgba(0, 0, 0, 0.66), rgba(0, 0, 0, 0.94)),
    radial-gradient(circle at 50% 12%, rgba(212, 175, 55, 0.22), transparent 34%),
    url("../images/profile-bg.jpg"),
    linear-gradient(135deg, #18140a 0%, #050505 52%, #000 100%);
  background-size: cover;
  background-position: center;
  transform: scale(1.03);
  animation: mwProfileBgBreath 16s ease-in-out infinite alternate;
  filter: saturate(1.05);
}

.profile-page::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at center, transparent 0 30%, rgba(0,0,0,.42) 72%, rgba(0,0,0,.85) 100%),
    linear-gradient(180deg, rgba(0,0,0,.12), rgba(0,0,0,.72));
  pointer-events: none;
}

.profile-card {
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(18px) saturate(120%);
}

.profile-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,.06), transparent 38%, rgba(212,175,55,.05));
  pointer-events: none;
}

.profile-view {
  position: relative;
  z-index: 1;
}

.profile-view[aria-hidden="true"] {
  display: none;
}

.profile-picker-view h1,
.profile-form-view h1 {
  text-align: center;
}

.profiles-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.profile-tile,
.add-profile-tile {
  min-height: 152px;
  border: 1px solid rgba(212,175,55,.22);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 12px;
  background: rgba(255,255,255,.055);
  color: #fff;
  transition: transform .22s ease, border-color .22s ease, background .22s ease, box-shadow .22s ease;
}

.profile-tile:hover,
.add-profile-tile:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: rgba(212,175,55,.86);
  background: rgba(212,175,55,.11);
  box-shadow: 0 18px 44px rgba(0,0,0,.35);
}

.profile-tile img,
.add-profile-icon {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(212,175,55,.44);
  background: rgba(255,255,255,.08);
}

.profile-tile strong,
.add-profile-tile strong {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}

.profile-tile span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(255,255,255,.62);
  font-size: 12px;
  font-weight: 800;
}

.add-profile-icon {
  display: grid;
  place-items: center;
  padding: 22px;
}

.add-profile-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.profile-limit {
  margin-top: 18px;
  text-align: center;
  color: rgba(255,255,255,.58);
  font-size: 13px;
}

.secondary-profile-button {
  width: 100%;
  min-height: 46px;
  margin-top: 12px;
  border-radius: 10px;
  border: 1px solid rgba(212,175,55,.28);
  background: rgba(255,255,255,.07);
  color: #fff;
  font-weight: 850;
}

.secondary-profile-button:hover {
  border-color: var(--mw-gold);
  color: var(--mw-gold-hover);
}

@keyframes mwProfileBgBreath {
  0% {
    transform: scale(1.03) translate3d(-1.1vw, -0.8vh, 0);
  }

  50% {
    transform: scale(1.085) translate3d(1.1vw, 0.6vh, 0);
  }

  100% {
    transform: scale(1.045) translate3d(0.4vw, -0.5vh, 0);
  }
}

@media (max-width: 760px) {
  .profiles-grid {
    grid-template-columns: 1fr;
  }

  .profile-tile,
  .add-profile-tile {
    min-height: 132px;
  }
}

/* =====================================================
   MWINDA PROFILE MOBILE COMPACT + SETTINGS
===================================================== */
.profile-settings {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 5;
}

.profile-settings-button {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(212,175,55,.34);
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.08);
  box-shadow: 0 12px 30px rgba(0,0,0,.28);
}

.profile-settings-button img {
  width: 21px;
  height: 21px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.profile-settings-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 190px;
  display: none;
  padding: 8px;
  border: 1px solid rgba(212,175,55,.30);
  border-radius: 16px;
  background: rgba(8,10,14,.96);
  box-shadow: 0 22px 70px rgba(0,0,0,.52);
  backdrop-filter: blur(16px);
}

.profile-settings-menu.show {
  display: grid;
  gap: 6px;
}

.profile-settings-menu button {
  min-height: 40px;
  border: 0;
  border-radius: 12px;
  padding: 0 12px;
  text-align: left;
  color: #fff;
  background: rgba(255,255,255,.07);
  font-weight: 850;
}

.profile-settings-menu button:hover {
  background: rgba(212,175,55,.18);
  color: var(--mw-gold-hover);
}

.profile-card {
  max-height: calc(100vh - 28px);
  overflow-y: auto;
}

@media (max-width: 760px) {
  .profile-page,
  .account-page {
    align-items: center;
    padding: 10px;
  }

  .profile-card,
  .account-card {
    width: min(100%, 390px);
    max-height: calc(100vh - 20px);
    padding: 18px 16px !important;
    border-radius: 18px;
  }

  .profile-logo,
  .account-logo {
    min-height: 54px;
    margin-bottom: 8px;
  }

  .profile-logo img,
  .account-logo img {
    max-width: 150px;
    max-height: 58px;
  }

  .profile-card h1,
  .account-card h1 {
    font-size: 21px !important;
    line-height: 1.05;
  }

  .profile-subtitle,
  .account-subtitle {
    margin-bottom: 14px;
    font-size: 12px;
    line-height: 1.35;
  }

  .profiles-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 9px !important;
    margin-top: 14px !important;
  }

  .profile-tile,
  .add-profile-tile {
    min-height: 94px !important;
    gap: 6px !important;
    padding: 10px 7px !important;
    border-radius: 14px !important;
  }

  .profile-tile img,
  .add-profile-icon {
    width: 50px !important;
    height: 50px !important;
  }

  .add-profile-icon {
    padding: 13px !important;
  }

  .profile-tile strong,
  .add-profile-tile strong {
    font-size: 12px !important;
    line-height: 1.05;
  }

  .profile-tile span,
  .profile-limit {
    font-size: 10px !important;
  }

  .profile-limit {
    margin-top: 10px !important;
  }

  .avatar-section {
    margin-bottom: 14px;
  }

  .avatar-section img {
    width: 86px !important;
    height: 86px !important;
    margin-bottom: 8px;
  }

  .avatar-button {
    padding: 8px 11px;
    font-size: 12px;
  }

  .form-group {
    margin-bottom: 10px;
  }

  .form-group label {
    font-size: 12px;
    margin-bottom: 5px;
  }

  .form-group input,
  .form-group select {
    min-height: 42px;
    padding: 10px 12px;
    font-size: 13px;
    border-radius: 9px;
  }

  .primary-button,
  .secondary-profile-button {
    min-height: 42px;
    padding: 10px 14px;
    font-size: 13px;
    border-radius: 9px;
  }

  .profile-footer,
  .account-footer {
    margin-top: 12px;
    font-size: 12px;
  }

  .profile-settings {
    top: 12px;
    right: 12px;
  }

  .profile-settings-button {
    width: 36px;
    height: 36px;
  }

  .profile-settings-button img {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 380px) {
  .profile-card,
  .account-card {
    padding: 14px 12px !important;
  }

  .profile-tile,
  .add-profile-tile {
    min-height: 84px !important;
  }

  .profile-tile img,
  .add-profile-icon {
    width: 44px !important;
    height: 44px !important;
  }
}


/* =====================================================
   MWINDA MOBILE PROFILE FINAL PATCH
   Fix création profil mobile + fond moins "bouge-bouge".
===================================================== */
html {
  -webkit-text-size-adjust: 100%;
}

.profile-page {
  overscroll-behavior: none;
}

.profile-page::before {
  animation-duration: 34s !important;
  transform: scale(1.035) !important;
}

@media (prefers-reduced-motion: reduce), (max-width: 760px) {
  .profile-page::before {
    animation: none !important;
    transform: scale(1.025) !important;
  }

  .profile-tile,
  .add-profile-tile {
    transition: border-color .18s ease, background .18s ease !important;
  }

  .profile-tile:hover,
  .add-profile-tile:hover {
    transform: none !important;
  }
}

.form-group input,
.form-group select {
  font-size: 16px !important;
}

@media (max-width: 760px) {
  .profile-page {
    position: fixed;
    inset: 0;
    min-height: 100svh;
    height: 100svh;
    padding: 10px;
  }

  .profile-card {
    max-height: calc(100svh - 20px);
    overflow-y: auto;
    transform: none !important;
  }

  .form-group input,
  .form-group select {
    font-size: 16px !important;
    min-height: 42px;
  }
}

/* =====================================================
   MWINDA PROFILE EXPERIENCE PATCH - CLEAN / BLUR / CLICK FIX
   Clic limite aux avatars, suppression du flash de chargement,
   design glass/futuriste sans changer Firebase.
===================================================== */

.profile-page.is-loading .profile-card {
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(.985);
}

.profile-page.is-ready .profile-card {
  opacity: 1;
  animation: mwProfileCardIn .38s cubic-bezier(.18,.88,.24,1) both;
}

.profile-loading {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  gap: 14px;
  background:
    radial-gradient(circle at 50% 38%, rgba(212,175,55,.16), transparent 30%),
    rgba(0,0,0,.82);
  color: rgba(255,255,255,.78);
  font-weight: 900;
  letter-spacing: .02em;
  backdrop-filter: blur(18px);
  transition: opacity .28s ease, visibility .28s ease;
}

.profile-page.is-ready .profile-loading {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.profile-loading-orb {
  width: 58px;
  height: 58px;
  border-radius: 999px;
  border: 1px solid rgba(212,175,55,.35);
  background:
    radial-gradient(circle at 35% 25%, rgba(255,255,255,.9), transparent 16%),
    radial-gradient(circle at center, rgba(212,175,55,.35), rgba(255,255,255,.06));
  box-shadow: 0 0 42px rgba(212,175,55,.28);
  animation: mwProfileOrb 1.1s ease-in-out infinite alternate;
}

.profile-page {
  background:
    radial-gradient(circle at 50% 18%, rgba(212,175,55,.10), transparent 26%),
    radial-gradient(circle at 12% 15%, rgba(255,255,255,.07), transparent 24%),
    linear-gradient(135deg, #02040a 0%, #05070d 46%, #000 100%);
}

.profile-page::before {
  background:
    radial-gradient(circle at 18% 18%, rgba(212,175,55,.18), transparent 30%),
    radial-gradient(circle at 82% 12%, rgba(255,255,255,.08), transparent 26%),
    radial-gradient(circle at 50% 90%, rgba(40,118,180,.10), transparent 32%),
    linear-gradient(135deg, #02040a 0%, #060912 54%, #000 100%) !important;
  filter: saturate(1.18) contrast(1.04);
}

.profile-card {
  max-width: min(1120px, calc(100vw - 36px)) !important;
  width: 100%;
  min-height: min(720px, calc(100svh - 36px));
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-color: rgba(255,255,255,.10) !important;
  background: rgba(4, 7, 13, .52) !important;
  box-shadow: 0 40px 130px rgba(0,0,0,.62), inset 0 1px 0 rgba(255,255,255,.07) !important;
  backdrop-filter: blur(28px) saturate(145%) !important;
}

.profile-logo {
  position: absolute;
  left: 26px;
  top: 22px;
  min-height: auto !important;
  margin: 0 !important;
  opacity: .92;
}

.profile-logo img {
  max-width: 150px !important;
  max-height: 54px !important;
}

.profile-settings {
  top: 22px !important;
  right: 26px !important;
}

.profile-settings-button {
  background: rgba(255,255,255,.08) !important;
  border-color: rgba(255,255,255,.14) !important;
  backdrop-filter: blur(18px) saturate(140%);
  transition: transform .22s cubic-bezier(.18,.88,.24,1), background .22s ease, border-color .22s ease;
}

.profile-settings-button:hover {
  transform: translateY(-2px) scale(1.06) rotate(10deg);
  border-color: rgba(212,175,55,.75) !important;
  background: rgba(212,175,55,.16) !important;
}

.profile-settings-menu {
  background: rgba(5, 8, 14, .76) !important;
  border-color: rgba(255,255,255,.12) !important;
  box-shadow: 0 28px 90px rgba(0,0,0,.62) !important;
  backdrop-filter: blur(26px) saturate(150%) !important;
}

.profile-picker-view h1,
.profile-form-view h1 {
  font-size: clamp(28px, 4.4vw, 56px) !important;
  letter-spacing: -.045em;
  text-shadow: 0 20px 60px rgba(0,0,0,.5);
}

.profile-subtitle,
.profile-limit {
  color: rgba(255,255,255,.62) !important;
}

.profiles-grid {
  width: min(900px, 100%);
  margin: 32px auto 0 !important;
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr)) !important;
  gap: clamp(16px, 3vw, 30px) !important;
  align-items: start;
}

.profile-tile,
.add-profile-tile {
  min-height: auto !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  cursor: default !important;
  pointer-events: none;
}

.profile-tile:hover,
.add-profile-tile:hover {
  transform: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

.profile-avatar-button,
.add-profile-button {
  position: relative;
  width: clamp(112px, 13vw, 168px);
  height: clamp(112px, 13vw, 168px);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 50%;
  padding: 0;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgba(255,255,255,.08);
  color: white;
  pointer-events: auto;
  box-shadow: 0 22px 65px rgba(0,0,0,.38), inset 0 1px 0 rgba(255,255,255,.10);
  transform: translateZ(0);
  transition: transform .28s cubic-bezier(.18,.88,.24,1), border-color .22s ease, box-shadow .22s ease, filter .22s ease;
}

.profile-avatar-button img,
.profile-avatar-fallback,
.add-profile-orb {
  width: 100% !important;
  height: 100% !important;
  border: 0 !important;
  border-radius: 50% !important;
  object-fit: cover;
  background: rgba(255,255,255,.07);
}

.profile-avatar-fallback,
.add-profile-orb {
  place-items: center;
  font-size: clamp(30px, 4vw, 54px);
  font-weight: 950;
  color: #fff;
  background:
    radial-gradient(circle at 38% 24%, rgba(255,255,255,.50), transparent 18%),
    linear-gradient(135deg, rgba(212,175,55,.72), rgba(24,34,52,.92));
}

.add-profile-orb {
  display: grid;
  padding: 34%;
  background:
    radial-gradient(circle at 50% 28%, rgba(255,255,255,.18), transparent 22%),
    rgba(255,255,255,.10);
}

.add-profile-orb img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
  filter: brightness(0) invert(1) drop-shadow(0 10px 28px rgba(255,255,255,.18));
}

.profile-avatar-glow {
  position: absolute;
  inset: -18%;
  z-index: 2;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent, rgba(212,175,55,.42), transparent, rgba(255,255,255,.22), transparent);
  opacity: 0;
  filter: blur(10px);
  transition: opacity .22s ease;
  pointer-events: none;
}

.profile-avatar-button::after,
.add-profile-button::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,.20), transparent 32%, rgba(255,255,255,.10));
  opacity: .78;
  pointer-events: none;
}

.profile-avatar-button:hover,
.add-profile-button:hover {
  transform: translateY(-8px) scale(1.055);
  border-color: rgba(212,175,55,.88);
  box-shadow: 0 30px 95px rgba(0,0,0,.56), 0 0 0 8px rgba(212,175,55,.08);
  filter: saturate(1.08);
}

.profile-avatar-button:hover .profile-avatar-glow {
  opacity: 1;
  animation: mwProfileSpin 1.8s linear infinite;
}

.profile-avatar-button:active,
.add-profile-button:active,
.profile-tile.is-selecting .profile-avatar-button {
  transform: translateY(-2px) scale(.96);
}

.profile-tile strong,
.add-profile-tile strong {
  color: rgba(255,255,255,.94) !important;
  font-size: clamp(15px, 1.8vw, 22px) !important;
  font-weight: 950 !important;
  letter-spacing: -.02em;
  pointer-events: none;
}

.profile-tile span,
.add-profile-tile span:not(.add-profile-orb) {
  color: rgba(255,255,255,.55) !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  pointer-events: none;
}

.profile-form-view {
  width: min(440px, 100%);
  margin: auto;
}

.profile-form-view .avatar-section img {
  box-shadow: 0 20px 60px rgba(0,0,0,.38);
}

@keyframes mwProfileCardIn {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes mwProfileOrb {
  from { transform: translateY(0) scale(.92); opacity: .72; }
  to { transform: translateY(-8px) scale(1.06); opacity: 1; }
}

@keyframes mwProfileSpin {
  to { transform: rotate(360deg); }
}

@media (max-width: 900px) {
  .profile-card {
    min-height: calc(100svh - 20px);
    max-width: calc(100vw - 20px) !important;
    padding: 68px 18px 24px !important;
  }

  .profiles-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr)) !important;
    width: min(520px, 100%);
  }

  .profile-logo {
    left: 16px;
    top: 14px;
  }

  .profile-settings {
    right: 16px !important;
    top: 14px !important;
  }
}

@media (max-width: 520px) {
  .profiles-grid {
    gap: 18px 12px !important;
  }

  .profile-avatar-button,
  .add-profile-button {
    width: 108px;
    height: 108px;
    margin-bottom: 10px;
  }

  .profile-picker-view h1,
  .profile-form-view h1 {
    font-size: 30px !important;
  }
}


/* =====================================================
   MWINDA PROFILE LOGO CLICK FIX + HTML CLEAN PATCH
   Le logo profil est decoratif : il ne redirige plus vers home.
===================================================== */

.profile-logo {
  cursor: default !important;
  pointer-events: none !important;
  user-select: none;
}

.profile-logo img {
  pointer-events: none !important;
}

.profile-card {
  isolation: isolate;
}

.profile-view {
  width: 100%;
}

.profile-picker-view,
.profile-form-view {
  padding-top: 36px;
}

.profile-form-view form {
  display: grid;
  gap: 0;
}

@media (max-width: 900px) {
  .profile-picker-view,
  .profile-form-view {
    padding-top: 18px;
  }
}

@media (max-width: 520px) {
  .profile-logo img {
    max-width: 118px !important;
  }

  .profile-picker-view,
  .profile-form-view {
    padding-top: 14px;
  }
}

/* =====================================================
   MWINDA PROFILE EDIT + AVATAR PRESETS - FIRESTORE SAFE
===================================================== */
.profile-edit-button {
  pointer-events: auto;
  min-height: 30px;
  margin-top: 8px;
  border: 1px solid rgba(212,175,55,.30);
  border-radius: 999px;
  padding: 0 13px;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.82);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .02em;
  transition: transform .22s cubic-bezier(.18,.88,.24,1), background .22s ease, border-color .22s ease, color .22s ease;
}

.profile-edit-button:hover {
  transform: translateY(-2px) scale(1.04);
  border-color: rgba(212,175,55,.90);
  background: rgba(212,175,55,.16);
  color: #fff;
}

.avatar-divider {
  width: 100%;
  margin: 8px 0 12px;
  color: rgba(255,255,255,.58);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.avatar-presets-grid {
  width: min(100%, 420px);
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px;
  margin: 0 auto 14px;
}

.avatar-preset-button {
  position: relative;
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 999px;
  padding: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10), 0 12px 30px rgba(0,0,0,.28);
  transition: transform .22s cubic-bezier(.18,.88,.24,1), border-color .22s ease, box-shadow .22s ease;
}

.avatar-preset-button img,
.avatar-preset-fallback {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.avatar-preset-fallback {
  place-items: center;
  color: #fff;
  font-weight: 950;
  background: linear-gradient(135deg, rgba(212,175,55,.72), rgba(24,34,52,.92));
}

.avatar-preset-button:hover,
.avatar-preset-button.is-active {
  transform: translateY(-4px) scale(1.06);
  border-color: rgba(212,175,55,.95);
  box-shadow: 0 18px 48px rgba(0,0,0,.42), 0 0 0 4px rgba(212,175,55,.10);
}

.avatar-preset-button.is-active::after {
  content: "✓";
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #d4af37;
  color: #050505;
  font-size: 12px;
  font-weight: 950;
}

.avatar-url-box {
  width: min(100%, 420px);
  margin: 0 auto 6px;
  text-align: left;
}

.avatar-url-box label {
  display: block;
  margin-bottom: 6px;
  color: rgba(255,255,255,.68);
  font-size: 12px;
  font-weight: 900;
}

.avatar-url-box input {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(212,175,55,.24);
  border-radius: 999px;
  padding: 0 14px;
  outline: none;
  background: rgba(255,255,255,.08);
  color: #fff;
  font-size: 14px;
}

.avatar-url-box input:focus {
  border-color: rgba(212,175,55,.86);
  box-shadow: 0 0 0 3px rgba(212,175,55,.10);
}

.avatar-url-box small {
  display: block;
  margin-top: 7px;
  color: rgba(255,255,255,.46);
  font-size: 11px;
  line-height: 1.35;
}

@media (max-width: 760px) {
  .avatar-presets-grid {
    grid-template-columns: repeat(3, 48px);
    justify-content: center;
    gap: 10px;
  }

  .profile-edit-button {
    min-height: 28px;
    font-size: 10px;
    margin-top: 6px;
  }

  .avatar-url-box input {
    font-size: 16px;
  }
}


/* =====================================================
   MWINDA AVATAR LIBRARY - CATEGORIES + ILLIMITED DATA
   Les avatars viennent de assets/js/avatar-data.js.
===================================================== */
.avatar-presets-grid,
.avatar-divider {
  display: none !important;
}

button.avatar-library-open {
  min-height: 42px;
  margin: 0 auto 14px;
  border: 1px solid rgba(212,175,55,.42);
  border-radius: 999px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(212,175,55,.14);
  color: #fff;
  font-size: 13px;
  font-weight: 950;
  transition: transform .22s cubic-bezier(.18,.88,.24,1), background .22s ease, border-color .22s ease;
}

button.avatar-library-open:hover {
  transform: translateY(-3px) scale(1.035);
  background: rgba(212,175,55,.24);
  border-color: rgba(212,175,55,.88);
}

body.avatar-library-is-open {
  overflow: hidden;
}

.avatar-library-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: none;
  place-items: center;
  padding: 22px;
}

.avatar-library-modal.show {
  display: grid;
}

.avatar-library-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 24%, rgba(212,175,55,.18), transparent 34%),
    rgba(0,0,0,.76);
  backdrop-filter: blur(18px);
}

.avatar-library-window {
  position: relative;
  z-index: 2;
  width: min(1080px, calc(100vw - 28px));
  max-height: min(820px, calc(100svh - 28px));
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 28px;
  background: rgba(5,8,14,.86);
  box-shadow: 0 38px 130px rgba(0,0,0,.72), inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter: blur(28px) saturate(150%);
  animation: mwAvatarLibraryIn .28s cubic-bezier(.18,.88,.24,1) both;
}

.avatar-library-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 4;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  background: rgba(255,255,255,.10);
  color: #fff;
  font-size: 28px;
  line-height: 1;
}

.avatar-library-close:hover {
  background: rgba(212,175,55,.20);
}

.avatar-library-head {
  padding: 26px 26px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.avatar-library-head span {
  display: block;
  color: var(--mw-gold, #d4af37);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.avatar-library-head h2 {
  margin: 6px 56px 8px 0;
  font-size: clamp(25px, 3.2vw, 42px);
  line-height: .98;
  letter-spacing: -.04em;
}

.avatar-library-head p {
  max-width: 760px;
  margin: 0 0 16px;
  color: rgba(255,255,255,.64);
  font-size: 13px;
  line-height: 1.45;
}

.avatar-library-head input {
  width: min(560px, 100%);
  min-height: 46px;
  border: 1px solid rgba(212,175,55,.26);
  border-radius: 999px;
  padding: 0 16px;
  outline: none;
  background: rgba(255,255,255,.08);
  color: #fff;
  font-size: 15px;
}

.avatar-library-head input:focus {
  border-color: rgba(212,175,55,.86);
  box-shadow: 0 0 0 3px rgba(212,175,55,.12);
}

.avatar-category-tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 16px 26px 8px;
  scrollbar-width: none;
}

.avatar-category-tabs::-webkit-scrollbar {
  display: none;
}

.avatar-category-tab {
  flex: 0 0 auto;
  min-height: 36px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  padding: 0 14px;
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.76);
  font-size: 12px;
  font-weight: 950;
}

.avatar-category-tab:hover,
.avatar-category-tab.is-active {
  border-color: rgba(212,175,55,.86);
  background: rgba(212,175,55,.18);
  color: #fff;
}

.avatar-library-grid {
  max-height: 490px;
  overflow-y: auto;
  padding: 18px 26px 28px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 18px;
}

.avatar-library-item {
  border: 0;
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 10px 8px 12px;
  border-radius: 22px;
  background: transparent;
  color: #fff;
  transition: transform .24s cubic-bezier(.18,.88,.24,1), background .22s ease, box-shadow .22s ease;
}

.avatar-library-item:hover,
.avatar-library-item.is-active {
  transform: translateY(-6px) scale(1.035);
  background: rgba(255,255,255,.07);
  box-shadow: 0 24px 70px rgba(0,0,0,.35);
}

.avatar-library-photo {
  position: relative;
  width: clamp(82px, 9vw, 118px);
  height: clamp(82px, 9vw, 118px);
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 999px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.11), 0 18px 48px rgba(0,0,0,.32);
}

.avatar-library-photo img,
.avatar-library-fallback {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.avatar-library-fallback {
  place-items: center;
  color: #fff;
  font-size: 28px;
  font-weight: 950;
  background: linear-gradient(135deg, rgba(212,175,55,.74), rgba(28,38,58,.96));
}

.avatar-library-item.is-active .avatar-library-photo::after {
  content: "✓";
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #d4af37;
  color: #050505;
  font-size: 13px;
  font-weight: 950;
}

.avatar-library-item strong {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 950;
}

.avatar-library-item small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(255,255,255,.52);
  font-size: 11px;
  font-weight: 850;
}

.avatar-library-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 24px;
  border: 1px dashed rgba(212,175,55,.32);
  border-radius: 18px;
  color: rgba(255,255,255,.66);
  text-align: center;
}

@keyframes mwAvatarLibraryIn {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 760px) {
  .avatar-library-modal {
    padding: 10px;
  }

  .avatar-library-window {
    width: 100%;
    max-height: calc(100svh - 20px);
    border-radius: 22px;
  }

  .avatar-library-head,
  .avatar-category-tabs,
  .avatar-library-grid {
    padding-left: 16px;
    padding-right: 16px;
  }

  .avatar-library-grid {
    max-height: 52svh;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }

  .avatar-library-photo {
    width: 78px;
    height: 78px;
  }

  .avatar-library-item strong {
    font-size: 11px;
  }

  .avatar-library-item small {
    display: none;
  }
}


/* =====================================================
   MWINDA AVATAR LIBRARY GLITCH FIX
   Evite que la classe d'ouverture du body prenne le style du bouton.
===================================================== */
body.avatar-library-is-open {
  overflow: hidden !important;
}

.avatar-library-modal {
  width: 100vw !important;
  height: 100svh !important;
}

.avatar-library-window {
  display: flex !important;
  flex-direction: column !important;
  max-width: calc(100vw - 44px) !important;
}

.avatar-library-grid {
  flex: 1 1 auto !important;
  min-height: 0 !important;
}

@media (max-width: 760px) {
  .avatar-library-window {
    max-width: calc(100vw - 20px) !important;
  }
}

/* =====================================================
   MWINDA PROFILE FINAL RESPONSIVE SAFETY PATCH
===================================================== */
@media (max-width: 760px) {
  .profile-page {
    min-height: 100svh !important;
    padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom)) !important;
    overflow-y: auto !important;
  }

  .profile-card {
    width: min(100%, 430px) !important;
    max-height: calc(100svh - 20px) !important;
    overflow-y: auto !important;
    padding: 18px 16px !important;
    border-radius: 18px !important;
  }

  .profile-logo {
    min-height: 56px !important;
    margin-bottom: 8px !important;
  }

  .profile-logo img {
    max-width: 150px !important;
    max-height: 58px !important;
  }

  .profile-card h1 {
    font-size: 22px !important;
    line-height: 1.1 !important;
  }

  .profile-subtitle {
    margin-bottom: 14px !important;
    font-size: 12.5px !important;
  }

  .profiles-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    margin-top: 16px !important;
  }

  .profile-tile,
  .add-profile-tile {
    min-height: 122px !important;
    padding: 12px 8px !important;
    border-radius: 16px !important;
  }

  .profile-tile img,
  .add-profile-icon {
    width: 68px !important;
    height: 68px !important;
  }

  .profile-tile strong,
  .add-profile-tile strong {
    font-size: 13px !important;
  }

  .profile-settings {
    top: 12px !important;
    right: 12px !important;
  }

  .profile-settings-button {
    width: 38px !important;
    height: 38px !important;
  }

  .form-group input,
  .form-group select {
    min-height: 42px !important;
    padding: 10px 12px !important;
    font-size: 13px !important;
  }
}

@media (max-width: 420px) {
  .profile-card {
    padding: 16px 12px !important;
  }

  .profiles-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  .profile-tile,
  .add-profile-tile {
    min-height: 112px !important;
  }

  .profile-tile img,
  .add-profile-icon {
    width: 58px !important;
    height: 58px !important;
  }
}

@media (max-width: 340px) {
  .profiles-grid {
    grid-template-columns: 1fr !important;
  }
}
/* =====================================================
   PROFILE IDLE UNLOCK MODE
===================================================== */

body.is-profile-unlock .profile-add-button,
body.is-profile-unlock [data-add-profile],
body.is-profile-unlock #addProfileButton,
body.is-profile-unlock .profile-settings,
body.is-profile-unlock #profileSettingsButton {
  display: none !important;
}
/* =====================================================
   MWINDA PROFILE — RELEASE BACKGROUND ONLY
   Does not change card or profile-grid responsiveness.
===================================================== */

.profile-page {
  isolation: isolate;
}

/* Disable only the previous static profile background images. */
.profile-page::before,
.profile-page::after {
  content: none !important;
  display: none !important;
}

/* Full-screen container behind the profile interface. */
.profile-release-background {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: #02050a;
}

/* Two layers used for the transition. */
.profile-release-layer {
  position: absolute;
  inset: -3%;

  opacity: 0;

  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;

  transform: scale(1.04);

  filter:
    saturate(1.05)
    contrast(1.04)
    brightness(0.68);

  transition:
    opacity 1.6s ease,
    transform 10s ease;

  will-change: opacity, transform;
}

/* Currently visible banner. */
.profile-release-layer.is-visible {
  opacity: 1;
  transform: scale(1.08);
}

/* Dark cinematic protection over the banners. */
.profile-release-background::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;

  background:
    linear-gradient(
      90deg,
      rgba(2, 5, 10, 0.78) 0%,
      rgba(2, 5, 10, 0.42) 48%,
      rgba(2, 5, 10, 0.78) 100%
    ),
    linear-gradient(
      180deg,
      rgba(2, 5, 10, 0.20) 0%,
      rgba(2, 5, 10, 0.52) 65%,
      rgba(2, 5, 10, 0.92) 100%
    );
}

/* Soft vignette around the screen. */
.profile-release-background::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;

  background:
    radial-gradient(
      circle at center,
      transparent 10%,
      rgba(0, 0, 0, 0.16) 50%,
      rgba(0, 0, 0, 0.80) 100%
    );
}


