/* Профиль — liquid glass (изолированные классы, не ломают остальной сайт) */
.pg-wrap { max-width: 520px; margin: 0 auto 40px; padding: 0 12px 24px; }
.pg-hero {
  position: relative;
  height: 340px;
  border-radius: 0 0 28px 28px;
  overflow: visible;
  background: #1a1a1a;
}
.pg-hero-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  filter: brightness(.72);
}
.pg-hero-bg::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.15) 0%, rgba(0,0,0,.55) 55%, rgba(10,10,12,.92) 100%);
}
.pg-hero-top {
  position: absolute; top: 12px; left: 12px; right: 12px;
  display: flex; justify-content: space-between; z-index: 2;
}
.pg-icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(20,20,24,.35);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; cursor: pointer; font-size: 16px;
}
.pg-icon-btn:hover { background: rgba(255,255,255,.16); }
.pg-hero-main {
  position: absolute; left: 0; right: 0; bottom: 18px;
  text-align: center; z-index: 2; padding: 0 16px;
}
.pg-avatar {
  display: block;
  width: 96px; height: 96px; border-radius: 50%;
  object-fit: cover; border: 3px solid rgba(255,255,255,.35);
  box-shadow: 0 8px 32px rgba(0,0,0,.45);
  background: #222;
  margin: 0 auto;
}
.pg-name {
  margin: 12px auto 2px;
  font-size: 26px; font-weight: 700; color: #fff;
  letter-spacing: -.02em;
  text-align: center;
  display: block;
}
.pg-name-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0 2px;
}
.pg-name-row .pg-name-text {
  font-size: 26px; font-weight: 700; color: #fff;
  letter-spacing: -.02em;
  line-height: 1.2;
}
/* CSS ника (inline style на .user-nick) не должен перебиваться родителем */
.pg-name-row .pg-name-text .user-nick {
  font-size: inherit;
  font-weight: inherit;
  /* color / text-shadow / gradient — только из inline style пользователя */
}
.pg-name-row .pg-name-text .user-prefix {
  font-size: 12px;
  vertical-align: middle;
  margin-right: 4px;
}
.xf-name-history-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  padding: 0; margin: 0;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 6px;
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.9);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
  vertical-align: middle;
}
.xf-name-history-btn:hover {
  background: rgba(255,255,255,.22);
}
.pg-uh-popup {
  position: fixed !important;
  z-index: 10050 !important;
  min-width: 260px;
  max-width: min(340px, calc(100vw - 24px));
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(24,24,28,.96) !important;
  border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 16px 48px rgba(0,0,0,.55);
  text-align: left;
  transform: none !important;
  left: 50%;
  top: 50%;
}

.pg-sub { color: rgba(255,255,255,.65); font-size: 13px; }
.pg-rank { color: rgba(255,255,255,.85); font-size: 12px; margin-top: 4px; }
.pg-actions {
  display: flex; justify-content: center; gap: 14px; margin-top: 16px;
}
.pg-action {
  width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(28,28,32,.45);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  color: #fff; display: flex; align-items: center; justify-content: center;
  text-decoration: none; font-size: 18px; box-shadow: 0 4px 20px rgba(0,0,0,.25);
}
.pg-action:hover { background: rgba(255,255,255,.14); color: #fff; }
.pg-status {
  margin: 14px auto 0; max-width: 320px;
  padding: 8px 14px; border-radius: 20px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: rgba(255,255,255,.85); font-size: 12.5px;
  display: inline-flex; align-items: center; gap: 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pg-glass {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(30,30,34,.55);
  border: 1px solid rgba(255,255,255,.10);
  backdrop-filter: blur(24px) saturate(1.3);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  box-shadow: 0 10px 40px rgba(0,0,0,.28);
  color: rgba(255,255,255,.88);
}
.pg-glass-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.08);
  font-size: 14px; gap: 12px;
}
.pg-glass-row:last-child { border-bottom: none; }
.pg-glass-label { color: rgba(255,255,255,.45); font-size: 12px; display: block; margin-bottom: 2px; }
.pg-tabs {
  display: flex; gap: 4px; margin: 18px 0 12px;
  padding: 4px; border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.pg-tab {
  flex: 1 0 auto; min-width: 72px; text-align: center;
  padding: 10px 12px; border-radius: 999px; border: none;
  background: transparent; color: rgba(255,255,255,.55);
  font-size: 13px; font-weight: 600; cursor: pointer;
  white-space: nowrap;
}
.pg-tab.active {
  background: rgba(255,255,255,.92); color: #111;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
}
.pg-panel { display: none; }
.pg-panel.active { display: block; }
.pg-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
}
.pg-grid a {
  display: block; aspect-ratio: 1; border-radius: 10px; overflow: hidden;
  background: #1c1c20; position: relative; text-decoration: none;
}
.pg-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pg-grid .pg-ph {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.35); font-size: 22px; background: linear-gradient(145deg,#222,#151518);
}
.pg-list { display: flex; flex-direction: column; gap: 8px; }
.pg-list a {
  display: flex; gap: 12px; align-items: center;
  padding: 12px 14px; border-radius: 14px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  text-decoration: none; color: inherit;
}
.pg-list a:hover { background: rgba(255,255,255,.09); }
.pg-list-thumb {
  width: 48px; height: 48px; border-radius: 12px; object-fit: cover; background: #222; flex-shrink: 0;
}
.pg-list-meta { min-width: 0; }
.pg-list-meta b { display: block; font-size: 14px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-list-meta span { font-size: 12px; color: rgba(255,255,255,.5); }
.pg-empty {
  text-align: center; padding: 36px 16px; color: rgba(255,255,255,.45); font-size: 14px;
  border-radius: 16px; background: rgba(255,255,255,.04); border: 1px dashed rgba(255,255,255,.1);
}
.pg-badge-live {
  position: absolute; left: 6px; bottom: 6px;
  background: #e11; color: #fff; font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 4px;
}
.pg-type-pill {
  position: absolute; right: 6px; top: 6px;
  background: rgba(0,0,0,.55); color: #fff; font-size: 10px;
  padding: 2px 6px; border-radius: 4px; backdrop-filter: blur(8px);
}
.pg-uh-popup {
  position: absolute; left: 50%; transform: translateX(-50%);
  top: calc(100% + 8px); z-index: 50; min-width: 260px; max-width: 90vw;
  padding: 12px 14px; border-radius: 14px;
  background: rgba(24,24,28,.92);
  border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 16px 48px rgba(0,0,0,.5);
  text-align: left;
}
@media (min-width: 768px) {
  .pg-wrap { max-width: 640px; }
  .pg-hero { height: 380px; border-radius: 24px; margin-top: 12px; }
}
/* Светлая тема сайта */
html.light-mode .pg-glass,
html.light-mode .pg-list a {
  background: rgba(255,255,255,.65);
  color: #111;
  border-color: rgba(0,0,0,.08);
}
html.light-mode .pg-list-meta b { color: #111; }
html.light-mode .pg-list-meta span,
html.light-mode .pg-glass-label { color: rgba(0,0,0,.45); }
html.light-mode .pg-tab { color: rgba(0,0,0,.45); }
html.light-mode .pg-tabs { background: rgba(0,0,0,.05); }

/* === Mobile: префиксы + ник + галочка влезают === */
@media (max-width: 560px) {
  .pg-name-row {
    gap: 4px 6px;
    padding: 0 8px;
    max-width: 100%;
  }
  .pg-name-row .pg-name-text {
    font-size: 18px;
    max-width: 100%;
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px;
  }
  .pg-name-row .pg-name-text .user-prefix,
  .pg-name-row .user-prefix {
    font-size: 10px !important;
    padding: 1px 5px !important;
    margin-right: 2px !important;
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
  }
  .pg-name-row .pg-name-text .user-nick {
    font-size: 18px;
    max-width: 70vw;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .pg-name-row .verify-badge {
    width: 16px !important;
    height: 16px !important;
    flex-shrink: 0;
    margin-left: 2px !important;
  }
  .pg-name-row .verify-badge svg {
    width: 12px !important;
    height: 12px !important;
  }
  .pg-name-row .user-prefixes {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 3px;
    max-width: 100%;
    justify-content: center;
  }
}

/* === Mobile v2: жёсткая укладка ника / префиксов / галочки === */
@media (max-width: 640px) {
  .pg-hero-main { padding: 0 10px; box-sizing: border-box; }
  .pg-name-row {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 6px !important;
    width: 100%;
    max-width: 100%;
    padding: 0 4px;
    box-sizing: border-box;
  }
  .pg-name-cluster {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px 6px !important;
    max-width: 100%;
    width: 100%;
  }
  .pg-name-row .pg-name-text {
    display: inline !important;
    font-size: 17px !important;
    line-height: 1.25 !important;
    max-width: 100%;
    word-break: break-word;
  }
  .pg-name-row .user-prefix,
  .pg-name-row .pg-name-text .user-prefix,
  .user-prefix {
    font-size: 9px !important;
    line-height: 1.2 !important;
    padding: 1px 4px !important;
    margin: 0 2px 2px 0 !important;
    max-width: 38vw !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    vertical-align: middle !important;
    display: inline-block !important;
  }
  .pg-name-row .user-prefixes {
    display: inline !important;
  }
  .pg-name-row .user-nick {
    font-size: 17px !important;
    word-break: break-word;
  }
  .pg-name-row .verify-badge {
    display: inline-flex !important;
    width: 15px !important;
    height: 15px !important;
    flex: 0 0 auto !important;
    margin: 0 !important;
    vertical-align: middle !important;
  }
  .pg-name-row .verify-badge svg {
    width: 11px !important;
    height: 11px !important;
  }
  .xf-name-history-btn {
    width: 24px !important;
    height: 24px !important;
    font-size: 12px !important;
  }
}

/* Edit / назад — кликабельны, не перекрываются */
.pg-hero-top {
  z-index: 20 !important;
  pointer-events: none; /* клики только на кнопки */
}
.pg-hero-top .pg-icon-btn {
  pointer-events: auto !important;
  position: relative;
  z-index: 21 !important;
  min-width: 40px;
  width: auto !important;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none !important;
  color: #fff !important;
}
.pg-hero-bg {
  pointer-events: none;
}


/* === FIX: аватар строго внутри hero === */
.pg-wrap {
  max-width: 520px !important;
  margin: 16px auto 40px !important;
  padding: 0 12px 24px !important;
  position: relative !important;
  clear: both !important;
  z-index: 1 !important;
}
.pg-hero {
  position: relative !important;
  height: 300px !important;
  min-height: 300px !important;
  border-radius: 20px !important;
  overflow: hidden !important; /* ничего не вылезает */
  margin-top: 0 !important;
  isolation: isolate;
}
.pg-hero-bg {
  position: absolute !important;
  inset: 0 !important;
  z-index: 0 !important;
  border-radius: inherit !important;
}
.pg-hero-top {
  position: absolute !important;
  top: 12px !important;
  left: 12px !important;
  right: 12px !important;
  z-index: 5 !important;
}
.pg-hero-main {
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  top: auto !important;
  text-align: center !important;
  z-index: 2 !important;
  padding: 12px 16px 16px !important;
  margin: 0 !important;
  transform: none !important;
  /* flex снизу вверх — аватар не уезжает за верх */
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-end !important;
  max-height: 100% !important;
  box-sizing: border-box !important;
}
.pg-avatar,
img.pg-avatar {
  display: block !important;
  width: 88px !important;
  height: 88px !important;
  margin: 0 auto 8px !important;
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  float: none !important;
  transform: none !important;
  flex-shrink: 0 !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  z-index: 2 !important;
}
/* обёртка от vibe-avatars — не ломает */
.pg-hero-main > .vibe-avatar-wrap {
  width: 88px !important;
  height: 88px !important;
  margin: 0 auto 8px !important;
  flex-shrink: 0 !important;
  display: inline-flex !important;
}
.pg-name-row {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  margin: 4px 0 2px !important;
  flex-shrink: 0 !important;
}
.pg-actions { margin-top: 10px !important; flex-shrink: 0 !important; }
.pg-tabs, .pg-panel, .pg-body {
  position: relative !important;
  margin-top: 12px !important;
}
.vibe-ach-box {
  margin: 12px auto !important;
  max-width: 420px !important;
}
@media (max-width: 600px) {
  .pg-hero { height: 280px !important; min-height: 280px !important; }
  .pg-avatar, img.pg-avatar { width: 76px !important; height: 76px !important; }
}

