/* Click · Editor de portada del perfil · aislado */
.profile-v396-shell{
  --profile-cover-position-y:50%;
}
.profile-v396-cover{
  background-position:
    center,
    center var(--profile-cover-position-y,50%),
    center!important;
}
.profile-v396-shell:before{
  background-position:
    center,
    center var(--profile-cover-position-y,50%)!important;
}
.profile-v396-cover-edit{
  border:0;
  cursor:pointer;
  font-family:inherit;
}
body.profile-cover-modal-open{
  overflow:hidden!important;
}

.profile-cover-modal{
  position:fixed;
  inset:0;
  z-index:10050;
  display:none;
  align-items:center;
  justify-content:center;
  padding:24px;
}
.profile-cover-modal.is-open{
  display:flex;
}
.profile-cover-modal-backdrop{
  position:absolute;
  inset:0;
  background:rgba(11,8,40,.76);
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
}
.profile-cover-dialog{
  position:relative;
  z-index:1;
  width:min(1080px,calc(100vw - 36px));
  max-height:calc(100vh - 42px);
  overflow:auto;
  border-radius:30px;
  border:1px solid rgba(255,255,255,.2);
  background:linear-gradient(155deg,#2e2765 0%,#251b57 58%,#191440 100%);
  color:#fff;
  box-shadow:0 34px 100px rgba(5,4,28,.52);
}
.profile-cover-dialog-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:20px;
  padding:24px 26px 18px;
  border-bottom:1px solid rgba(255,255,255,.1);
}
.profile-cover-kicker{
  display:block;
  margin-bottom:6px;
  color:#bda6ff;
  font-size:11px;
  font-weight:900;
  letter-spacing:.08em;
}
.profile-cover-dialog-head h2{
  margin:0 0 6px;
  color:#fff;
  font-size:26px;
}
.profile-cover-dialog-head p{
  margin:0;
  max-width:680px;
  color:#cbc5df;
  font-size:13px;
  line-height:1.5;
}
.profile-cover-close{
  flex:0 0 auto;
  width:42px;
  height:42px;
  border:1px solid rgba(255,255,255,.14);
  border-radius:50%;
  background:rgba(255,255,255,.1);
  color:#fff;
  font-size:25px;
  cursor:pointer;
}
.profile-cover-workspace{
  display:grid;
  grid-template-columns:minmax(0,1.45fr) minmax(300px,.8fr);
  gap:22px;
  padding:22px 26px 24px;
}
.profile-cover-preview-wrap{
  min-width:0;
}
.profile-cover-preview{
  position:relative;
  width:100%;
  aspect-ratio:16/6;
  min-height:300px;
  border-radius:22px;
  overflow:hidden;
  cursor:ns-resize;
  user-select:none;
  touch-action:none;
  border:1px solid rgba(255,255,255,.18);
  background-image:
    linear-gradient(90deg,rgba(12,18,65,.3),rgba(20,11,54,.08)),
    var(--cover-editor-image),
    linear-gradient(135deg,#33468f,#7445a7 58%,#191d4e);
  background-size:cover,cover,cover;
  background-position:
    center,
    center var(--cover-editor-position-y,50%),
    center;
  background-repeat:no-repeat;
  box-shadow:0 18px 44px rgba(4,4,25,.25);
}
.profile-cover-preview.no-image{
  cursor:default;
}
.profile-cover-preview.is-dragging{
  cursor:grabbing;
  outline:3px solid rgba(143,95,255,.42);
}
.profile-cover-drag-hint{
  position:absolute;
  left:50%;
  bottom:14px;
  transform:translateX(-50%);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  white-space:nowrap;
  padding:8px 13px;
  border-radius:999px;
  background:rgba(12,10,39,.68);
  color:#fff;
  font-size:11px;
  font-weight:800;
  pointer-events:none;
  backdrop-filter:blur(8px);
}
.profile-cover-preview-wrap>small{
  display:block;
  margin-top:8px;
  color:#aaa4c7;
  font-size:10px;
}
.profile-cover-form{
  display:grid;
  gap:15px;
  align-content:start;
}
.profile-cover-file{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:50px;
  border-radius:15px;
  border:1px solid rgba(255,255,255,.16);
  background:rgba(255,255,255,.09);
  color:#fff;
  font-weight:800;
  cursor:pointer;
  overflow:hidden;
}
.profile-cover-file:hover{
  background:rgba(255,255,255,.13);
}
.profile-cover-file input{
  position:absolute;
  inset:0;
  opacity:0;
  cursor:pointer;
}
.profile-cover-position-box{
  padding:16px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.06);
}
.profile-cover-position-title{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:center;
  margin-bottom:13px;
}
.profile-cover-position-title strong{
  display:block;
  margin-bottom:3px;
  color:#fff;
  font-size:14px;
}
.profile-cover-position-title span{
  display:block;
  color:#aaa4c7;
  font-size:10px;
}
.profile-cover-position-title>b{
  min-width:50px;
  padding:6px 8px;
  border-radius:10px;
  background:rgba(143,95,255,.2);
  color:#d7c6ff;
  text-align:center;
  font-size:12px;
}
.profile-cover-position-box input[type=range]{
  width:100%;
  accent-color:#955cff;
  cursor:pointer;
}
.profile-cover-position-presets{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:8px;
  margin-top:12px;
}
.profile-cover-position-presets button{
  min-height:38px;
  border:1px solid rgba(255,255,255,.13);
  border-radius:11px;
  background:rgba(255,255,255,.07);
  color:#d8d3e8;
  font-weight:700;
  cursor:pointer;
}
.profile-cover-position-presets button:hover{
  background:rgba(143,95,255,.2);
  color:#fff;
}
.profile-cover-actions{
  display:grid;
  grid-template-columns:1fr auto;
  gap:9px;
}
.profile-cover-save,
.profile-cover-cancel{
  min-height:48px;
  border-radius:14px;
  padding:0 17px;
  font-weight:900;
  cursor:pointer;
}
.profile-cover-save{
  border:0;
  background:linear-gradient(135deg,#7649ff,#b54eff);
  color:#fff;
  box-shadow:0 12px 26px rgba(123,68,255,.25);
}
.profile-cover-cancel{
  border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.07);
  color:#ddd8eb;
}
.profile-cover-note{
  margin:0;
  color:#918ba9;
  font-size:10px;
  line-height:1.5;
}
.profile-cover-remove{
  padding:0 26px 24px;
}
.profile-cover-remove button{
  border:0;
  background:transparent;
  color:#ffadbf;
  text-decoration:underline;
  cursor:pointer;
  font-size:11px;
}

@media(max-width:820px){
  .profile-cover-modal{
    padding:10px;
    align-items:flex-end;
  }
  .profile-cover-dialog{
    width:100%;
    max-height:94vh;
    border-radius:26px 26px 0 0;
  }
  .profile-cover-dialog-head{
    padding:18px 18px 14px;
  }
  .profile-cover-dialog-head h2{
    font-size:22px;
  }
  .profile-cover-dialog-head p{
    font-size:11px;
  }
  .profile-cover-workspace{
    grid-template-columns:1fr;
    gap:14px;
    padding:15px 16px 18px;
  }
  .profile-cover-preview{
    min-height:190px;
    aspect-ratio:16/7;
    border-radius:17px;
  }
  .profile-cover-drag-hint{
    bottom:10px;
    font-size:9px;
    padding:7px 10px;
  }
  .profile-cover-actions{
    grid-template-columns:1fr 1fr;
  }
  .profile-cover-remove{
    padding:0 16px 20px;
  }
}
@media(max-width:480px){
  .profile-cover-modal{
    padding:0;
  }
  .profile-cover-dialog{
    max-height:100vh;
    height:100vh;
    border-radius:0;
  }
  .profile-cover-dialog-head{
    padding-top:max(18px,env(safe-area-inset-top));
  }
  .profile-cover-preview{
    min-height:170px;
  }
  .profile-cover-position-box{
    padding:13px;
  }
}

/* ===== LIVE PREVIEW V2 ===== */
.profile-cover-preview{
  background:linear-gradient(135deg,#33468f,#7445a7 58%,#191d4e)!important;
}
.profile-cover-preview>img[data-cover-preview-image]{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  object-position:center var(--cover-editor-position-y,50%);
  display:block;
  user-select:none;
  pointer-events:none;
}
.profile-cover-preview>img[data-cover-preview-image][hidden]{display:none!important}
.profile-cover-preview-placeholder{
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  align-content:center;
  gap:7px;
  padding:24px;
  text-align:center;
  color:#ddd7f2;
  background:linear-gradient(135deg,rgba(73,62,145,.52),rgba(37,27,87,.62));
}
.profile-cover-preview-placeholder[hidden]{display:none!important}
.profile-cover-preview-placeholder span{font-size:42px}
.profile-cover-preview-placeholder b{font-size:15px;color:#fff}
.profile-cover-preview-placeholder small{font-size:11px;color:#bcb5d7}
.profile-cover-preview.no-image .profile-cover-drag-hint{display:none}
.profile-cover-preview:not(.no-image):hover .profile-cover-drag-hint{opacity:1}
.profile-cover-drag-hint{transition:opacity .18s ease}

/* ===== PREVIEW CON CONVERSIÓN EN SERVIDOR ===== */
.profile-cover-file-status{
  min-height:16px;
  margin-top:-8px;
  color:#a9a2c5;
  font-size:10px;
  line-height:1.4;
}
.profile-cover-file-status.loading{color:#d1c0ff}
.profile-cover-file-status.ok{color:#8fe0b3}
.profile-cover-file-status.error{color:#ffb0c1}

/* ===== Loader kawaii para portada ===== */
.profile-cover-loading{
  position:absolute;
  inset:0;
  z-index:12;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:9px;
  padding:22px;
  background:linear-gradient(180deg,rgba(31,22,78,.84),rgba(20,15,57,.92));
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
  opacity:0;
  transform:scale(1.01);
  transition:opacity .22s ease,transform .22s ease;
  pointer-events:auto;
}
.profile-cover-loading[hidden]{display:none!important}
.profile-cover-loading.is-visible{opacity:1;transform:scale(1)}
.profile-cover-loading strong{color:#fff;font-size:15px;text-align:center}
.profile-cover-loading>span{color:#cbc2eb;font-size:11px;text-align:center}
.profile-cover-loading>small{color:#b9addd;font-size:10px}
.profile-cover-loading>small b{color:#fff;font-size:11px}
.profile-cover-loading-track{
  width:min(310px,82%);
  height:9px;
  border-radius:999px;
  overflow:hidden;
  background:rgba(255,255,255,.11);
  border:1px solid rgba(255,255,255,.08);
  box-shadow:inset 0 1px 3px rgba(0,0,0,.22);
}
.profile-cover-loading-track i{
  display:block;
  width:0;
  height:100%;
  border-radius:999px;
  background:linear-gradient(90deg,#7650ff 0%,#a75cff 42%,#ff72bb 100%);
  box-shadow:0 0 18px rgba(166,91,255,.55);
  transition:width .22s ease;
  position:relative;
  overflow:hidden;
}
.profile-cover-loading-track i:after{
  content:"";
  position:absolute;
  inset:0;
  width:42%;
  transform:translateX(-130%);
  background:linear-gradient(90deg,transparent,rgba(255,255,255,.72),transparent);
  animation:profileCoverShimmer 1.05s linear infinite;
}
@keyframes profileCoverShimmer{to{transform:translateX(360%)}}

.profile-cover-anime-face{
  position:relative;
  width:74px;
  height:74px;
  border-radius:50%;
  background:linear-gradient(180deg,#fff8fc,#ffeef8);
  border:4px solid rgba(255,255,255,.92);
  box-shadow:0 12px 28px rgba(9,5,34,.32),0 0 0 5px rgba(154,94,255,.14);
  animation:profileCoverFloat 1.55s ease-in-out infinite;
  overflow:hidden;
}
@keyframes profileCoverFloat{0%,100%{transform:translateY(0) rotate(-1deg)}50%{transform:translateY(-6px) rotate(1deg)}}
.profile-cover-anime-hair{
  position:absolute;
  top:-10px;
  width:54px;
  height:35px;
  background:linear-gradient(135deg,#6d4bff,#2b1c78);
  border-radius:50% 50% 45% 45%;
  z-index:3;
}
.profile-cover-anime-hair.hair-one{left:-5px;transform:rotate(18deg)}
.profile-cover-anime-hair.hair-two{right:-6px;transform:rotate(-18deg)}
.profile-cover-anime-eye{
  position:absolute;
  top:31px;
  width:9px;
  height:12px;
  border-radius:50%;
  background:#342453;
  z-index:2;
  animation:profileCoverBlink 2.6s infinite;
}
.profile-cover-anime-eye.eye-left{left:19px}.profile-cover-anime-eye.eye-right{right:19px}
@keyframes profileCoverBlink{0%,44%,48%,100%{transform:scaleY(1)}46%{transform:scaleY(.08)}}
.profile-cover-anime-mouth{
  position:absolute;
  left:50%;
  top:49px;
  width:17px;
  height:8px;
  transform:translateX(-50%);
  border-bottom:3px solid #d05d91;
  border-radius:0 0 18px 18px;
}
.profile-cover-anime-cheek{
  position:absolute;
  top:45px;
  width:11px;
  height:6px;
  border-radius:999px;
  background:rgba(255,117,166,.32);
}
.profile-cover-anime-cheek.cheek-left{left:9px}.profile-cover-anime-cheek.cheek-right{right:9px}
.profile-cover-loading.is-done .profile-cover-anime-face{animation:profileCoverDone .55s ease both}
@keyframes profileCoverDone{50%{transform:scale(1.12) rotate(4deg)}100%{transform:scale(1) rotate(0)}}
.profile-cover-loading.is-done .profile-cover-loading-track i{background:linear-gradient(90deg,#45c787,#7ce3b0)}
.profile-cover-loading.is-error .profile-cover-loading-track i{background:linear-gradient(90deg,#ff6d91,#ff9aaf)}
.profile-cover-loading.is-error .profile-cover-anime-face{animation:profileCoverShake .35s ease 2}
@keyframes profileCoverShake{0%,100%{transform:translateX(0)}33%{transform:translateX(-5px)}66%{transform:translateX(5px)}}

@media(max-width:820px){
  .profile-cover-anime-face{width:64px;height:64px}
  .profile-cover-anime-eye{top:27px}
  .profile-cover-anime-eye.eye-left{left:16px}.profile-cover-anime-eye.eye-right{right:16px}
  .profile-cover-anime-mouth{top:43px}
  .profile-cover-anime-cheek{top:39px}
  .profile-cover-loading strong{font-size:14px}
  .profile-cover-loading-track{width:min(260px,86%)}
}
