/* XCHAT_PROFILE_IMAGE_UI
   Изолированный интерфейс картинки пользователя. */

#xps-root .xps-profile-image {
  margin: 10px 0;
  border: 1px solid #4f678a;
  background: rgba(0,0,0,.22);
}

#xps-root .xps-profile-image summary {
  min-height: 54px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  list-style: none;
  color: #fff;
}

#xps-root .xps-profile-image summary::-webkit-details-marker {
  display: none;
}

#xps-root .xps-profile-thumb {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #6984aa;
  background: #050612;
  color: #9bbcff;
}

#xps-root .xps-profile-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

#xps-root .xps-profile-thumb img[hidden] {
  display: none !important;
}

#xps-root .xps-profile-thumb span {
  padding: 3px;
  font-size: 9px;
  line-height: 1.15;
  text-align: center;
}

#xps-root .xps-profile-copy {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

#xps-root .xps-profile-copy b {
  color: #ffff86;
}

#xps-root .xps-profile-copy small {
  color: #bcd8ea;
  font-size: 10px;
}

#xps-root .xps-profile-arrow {
  color: #ffdf8a;
  font-size: 16px;
  transition: transform .15s ease;
}

#xps-root .xps-profile-image[open] .xps-profile-arrow {
  transform: rotate(180deg);
}

#xps-root .xps-profile-body {
  padding: 8px;
  border-top: 1px solid rgba(255,255,255,.16);
}

#xps-root .xps-profile-body p {
  margin: 0 0 7px;
  color: #cfe8ff;
  font-size: 11px;
  line-height: 1.4;
}

#xps-root .xps-profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

#xps-root .xps-profile-upload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 4px 9px;
  border: 1px solid #ffdf8a;
  background: #7b0000;
  color: #fff !important;
  font: bold 12px Verdana,Arial,sans-serif;
  text-align: center !important;
  cursor: pointer;
}

#xps-root .xps-profile-upload:hover,
#xps-root .xps-profile-actions button:hover {
  background: #a31b1b;
  color: #ffffaa;
}

#xps-root .xps-profile-upload input {
  display: none !important;
}

#xps-root .xps-profile-status {
  min-height: 16px;
  margin-top: 6px;
  color: #ffdf8a;
  font-size: 11px;
}

#xps-root .xps-profile-status.error {
  color: #ffb5b5;
}

#xchatInfoPopup .xip-profile-layout {
  display: block;
}

#xchatInfoPopup .xip-profile-layout.has-avatar {
  display: grid;
  grid-template-columns: 120px minmax(0,1fr);
  gap: 10px;
  align-items: start;
}

#xchatInfoPopup .xip-avatar {
  width: 120px;
  height: 120px;
  overflow: hidden;
  border: 1px solid #5878dc;
  background: #02020d;
  box-shadow: 0 0 0 1px #000;
}

#xchatInfoPopup .xip-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#xchatInfoPopup .xip-profile-data {
  min-width: 0;
}

#xchatInfoPopup .xip-colored-nick {
  font-weight: bold;
  white-space: nowrap;
}

#xchatInfoPopup .xip-vip-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 22px;
  height: 11px;
  margin-left: 3px;
  padding: 0 2px;
  border: 1px solid #8b6f00;
  background: #171200;
  color: #ffdf00;
  font: bold 8px/9px Verdana, Arial, sans-serif;
  vertical-align: middle;
  text-shadow: 0 0 2px #6b5200;
}

@media (max-width: 520px) {
  #xps-root .xps-profile-actions {
    align-items: stretch;
  }

  #xps-root .xps-profile-upload,
  #xps-root .xps-profile-actions button {
    min-height: 32px;
  }
}

@media (max-width: 480px) {
  #xchatInfoPopup .xip-window {
    width: calc(100vw - 16px);
    max-width: 360px;
  }

  #xchatInfoPopup .xip-profile-layout.has-avatar {
    display: block;
  }

  #xchatInfoPopup .xip-avatar {
    margin: 0 auto 9px;
  }
}


/* xchat-info-nick-aura-v1
 *
 * Цвет ауры приходит из info-popup.js:
 * обычный ник -> один оттенок;
 * nickColors -> начало / середина / конец палитры.
 */

#xchatInfoPopup {
  --xip-aura-1: #67ea91;
  --xip-aura-2: #67ea91;
  --xip-aura-3: #67ea91;

  --xip-aura-1-soft: rgba(103, 234, 145, .55);
  --xip-aura-2-soft: rgba(103, 234, 145, .48);
  --xip-aura-3-soft: rgba(103, 234, 145, .52);

  --xip-aura-frame: rgba(103, 234, 145, .17);
  --xip-aura-border: rgba(103, 234, 145, .34);
}


/*
 * Главный эффект живёт именно за фотографией.
 * Два псевдо-слоя дают глубину без жёсткого "неона".
 */
#xchatInfoPopup .xip-avatar {
  position: relative;
  isolation: isolate;
  overflow: visible;
}

#xchatInfoPopup .xip-avatar::before,
#xchatInfoPopup .xip-avatar::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: -1;
}


/* широкая мягкая цветная аура */
#xchatInfoPopup .xip-avatar::before {
  inset: -28px;

  border-radius: 30%;

  background:
    radial-gradient(
      circle at 22% 42%,
      var(--xip-aura-1-soft) 0,
      transparent 57%
    ),
    radial-gradient(
      circle at 78% 38%,
      var(--xip-aura-3-soft) 0,
      transparent 57%
    ),
    radial-gradient(
      circle at 50% 78%,
      var(--xip-aura-2-soft) 0,
      transparent 62%
    );

  filter: blur(18px);
  opacity: .95;

  transform: scale(.97);
}


/* ближний glow непосредственно у фотографии */
#xchatInfoPopup .xip-avatar::after {
  inset: -11px;

  border-radius: 18px;

  background:
    radial-gradient(
      ellipse at center,
      var(--xip-aura-2-soft) 0,
      transparent 69%
    );

  filter: blur(9px);
  opacity: .95;
}


#xchatInfoPopup .xip-avatar img {
  position: relative;
  z-index: 1;

  box-shadow:
    0 0 0 1px var(--xip-aura-border),
    0 0 20px var(--xip-aura-2-soft),
    0 12px 24px rgba(0, 0, 0, .38);
}


/*
 * Карточка лишь слегка подхватывает цвет пользователя.
 * Основной визуальный акцент остаётся у фотографии.
 */
#xchatInfoPopup .xip-window {
  box-shadow:
    0 22px 70px rgba(0, 0, 0, .58),
    0 0 32px var(--xip-aura-frame);
}


/*
 * У градиентного ника добавляем очень тонкий цветной кант.
 * Он использует все три выбранных оттенка.
 */
#xchatInfoPopup.xip-has-gradient-aura .xip-avatar img {
  border-color: transparent;

  background:
    linear-gradient(
      #111827,
      #111827
    ) padding-box,
    linear-gradient(
      135deg,
      var(--xip-aura-1),
      var(--xip-aura-2),
      var(--xip-aura-3)
    ) border-box;
}


@media (prefers-reduced-motion: reduce) {
  #xchatInfoPopup .xip-avatar::before,
  #xchatInfoPopup .xip-avatar::after {
    transform: none;
  }
}
