/* Controlled cosmetic placement. Each asset has one explicit host. */
.game-home .avatar-medallion.npv3-home-avatar {
  position: relative !important;
  overflow: visible !important;
  isolation: isolate !important;
}
.game-home .avatar-medallion.npv3-home-avatar::before,
.game-home .avatar-medallion.npv3-home-avatar::after { content: none !important; display: none !important; }
.game-home .avatar-medallion.npv3-home-avatar > img:not(.npv3-home-frame) {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  border-radius: 50% !important;
  object-fit: cover !important;
}
.npv3-home-frame {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  z-index: 3 !important;
  width: 132% !important;
  height: 132% !important;
  max-width: none !important;
  object-fit: contain !important;
  transform: translate(-50%,-50%) !important;
  pointer-events: none !important;
}
.game-home .account-parchment .profile-name.npv3-home-name-style {
  position: relative !important;
  z-index: 4 !important;
  display: inline-grid !important;
  min-width: 128px !important;
  min-height: 30px !important;
  padding: .42rem 1rem !important;
  place-items: center !important;
  color: #f4dbad !important;
  text-shadow: 0 2px 4px #000 !important;
  line-height: 1.05 !important;
}

.profile-identity.npv3-profile-skin {
  position: relative !important;
  isolation: isolate !important;
  min-height: 280px !important;
  padding: 1.4rem 1rem !important;
  border-radius: 8px !important;
  background-image: linear-gradient(180deg,#09060462,#090604b8),var(--npv3-profile-bg) !important;
  background-size: cover !important;
  background-position: center !important;
  box-shadow: inset 0 0 55px #0008,0 12px 30px #0006 !important;
}
.profile-identity.npv3-profile-skin > * { position: relative !important; z-index: 1 !important; }
.profile-identity.npv3-profile-skin h1,
.profile-identity.npv3-profile-skin small,
.profile-identity.npv3-profile-skin span { color: #f0d9ad !important; text-shadow: 0 2px 4px #000 !important; }
.npv3-profile-avatar { position: relative !important; overflow: visible !important; isolation: isolate !important; }
.npv3-profile-avatar > img:not(.npv3-profile-frame) { border-radius: 50% !important; object-fit: cover !important; }
.npv3-profile-frame {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  z-index: 4 !important;
  width: 142% !important;
  height: 142% !important;
  max-width: none !important;
  object-fit: contain !important;
  transform: translate(-50%,-50%) !important;
  pointer-events: none !important;
}
.profile-identity h1.npv3-name-style {
  display: inline-grid !important;
  min-width: 160px !important;
  min-height: 38px !important;
  padding: .55rem 1.2rem !important;
  place-items: center !important;
  background-image: var(--npv3-name-art) !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 100% 100% !important;
  color: #f5ddb1 !important;
  text-shadow: 0 2px 4px #000 !important;
}

.leaderboard .leader-avatar.npv3-leader-avatar {
  position: relative !important;
  overflow: visible !important;
  isolation: isolate !important;
  border-radius: 50% !important;
}
.leaderboard .leader-avatar.npv3-leader-avatar > img:not(.npv3-leader-frame) {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  border-radius: 50% !important;
  object-fit: cover !important;
}
.npv3-leader-frame {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  z-index: 3 !important;
  width: 145% !important;
  height: 145% !important;
  max-width: none !important;
  object-fit: contain !important;
  transform: translate(-50%,-50%) !important;
  pointer-events: none !important;
}

/* === НАДСТРОЙКА: cosmetics-fix.mjs === */

/* Фон профиля — на весь экран профиля. Затемнение лёгкое: только чтобы
   читался текст, без той грязи, что была раньше. */
/* Только сетка: .profile-view-page лежит под пергаментным листом темы,
   картинки на ней не видно. */
.profile-chronicle-grid.npv3-profile-skin {
  position: relative !important;
  isolation: isolate !important;
  padding: .9rem !important;
  border-radius: 10px !important;
  background-image: linear-gradient(180deg, #11090633, #11090688), var(--npv3-profile-bg) !important;
  background-size: cover !important;
  background-position: center !important;
  box-shadow: inset 0 0 0 1px #b9894e55 !important;
}

/* Карточка с аватаром внутри — без своей заливки: иначе поверх фона выходит
   второй тёмный прямоугольник, как на прошлом снимке. */
.profile-chronicle-grid.npv3-profile-skin .profile-identity {
  background-color: #0000 !important;
  background-image: none !important;
  box-shadow: inset 0 0 0 1px #b9894e44 !important;
}

/* Текст карточки на фоне: светлый, с тенью. Пергаментные плитки статистики
   не трогаем — там свой тёмный текст по светлому. */
.profile-chronicle-grid.npv3-profile-skin .profile-identity :is(h1, h2, small, span, p) {
  color: #f0d9ad !important;
  text-shadow: 0 2px 4px #000 !important;
}

/* Строка участника: рамка аватара шире самого аватара, поэтому текст
   отодвигаем — иначе она накрывает ник и уровень. */
.player-list > .player-row.np-global-player-card > .player-avatar + div,
.player-list > .player-row.np-global-player-card > div:not(.player-avatar) {
  padding-left: .55rem !important;
}

/* Плашка имени в строке участника. Узел там блочный во всю строку (замерено
   1111px под ник в 60px), поэтому сжимаем по тексту — иначе баннер идёт
   полосой поперёк всей строки. */
/* Плашка в строке участника рисуется на своём узле (.np-plate ниже). */
.player-list > .player-row .np-name-accent::before {
  content: none !important;
}

/* Шапка лобби: аватар с рамкой. */
.lobby-player .lobby-avatar.npv3-lobby-avatar {
  position: relative !important;
  overflow: visible !important;
  isolation: isolate !important;
}

.npv3-lobby-avatar-image {
  position: absolute !important;
  z-index: 1 !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  border-radius: 50% !important;
  object-fit: cover !important;
}

.npv3-lobby-frame {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  z-index: 2 !important;
  width: 138% !important;
  height: 138% !important;
  max-width: none !important;
  object-fit: contain !important;
  transform: translate(-50%, -50%) !important;
  pointer-events: none !important;
}

/*
 * Плашки имени.
 *
 * Арт рисует псевдоэлемент — он не влияет на раскладку. Но коробка под ним
 * должна быть по размеру имени, а не во всю строку: .profile-name на главной
 * растянут на всю карточку (275px под ник в 45px), и от баннера оставался
 * кусочек посреди пустоты. Поэтому inline-block и отступы в em — коробка
 * выходит примерно 3:1, как сам арт, и он ложится на неё целиком.
 */
/* У чужих узлов оставляем только цвет. Сжать их правилами не выходит:
   у тем селекторы вида html[data-home-theme] body #root … тяжелее любого
   моего. Геометрия ушла на свой узел .npv3-plate ниже. */
.game-home .account-parchment .profile-name.npv3-home-name-style,
.lobby-player > .npv3-lobby-name-style,
.leaderboard .leader-name.npv3-leader-name-style {
  background-image: none !important;
  color: #f4dbad !important;
  text-shadow: 0 2px 4px #000 !important;
}

/*
 * Читаемые цвета на плашке главной.
 *
 * Холст «классики» тёмный, а текст бандла — rgb(26,13,6): контраст 1.4 при
 * норме 4.5. Ниже палитра под тёмную подложку и под светлую; какая из них
 * сработает, решает замер яркости в скрипте.
 */
.game-home .account-parchment[data-npv3-ground="dark"] :is(h1,h2,h3,h4,p,span,strong,b,i,em,small,div,li,td) {
  color: #f0dcb2 !important;
  text-shadow: 0 1px 2px #000, 0 0 8px #000a !important;
}

/* Подписи под цифрами — приглушённые, сами цифры — самые яркие. */
.game-home .account-parchment[data-npv3-ground="dark"] :is(small, .profile-type, .profile-player-id) {
  color: #d8bd8e !important;
}

.game-home .account-parchment[data-npv3-ground="dark"] :is(strong, b, .profile-rank) {
  color: #ffe9bd !important;
}

.game-home .account-parchment[data-npv3-ground="light"] :is(h1,h2,h3,h4,p,span,strong,b,i,em,small,div,li,td) {
  color: #2a1a0c !important;
  text-shadow: 0 1px 1px #ffffffb0 !important;
}

/* Свой узел под плашку: строчный, сам по себе сжимается по тексту, и о нём
   не знает ни одно правило сайта. */
.npv3-plate {
  position: relative !important;
  z-index: 1 !important;
  display: inline-block !important;
  width: auto !important;
  max-width: 100% !important;
  padding: .1em 1.05em !important;
  vertical-align: middle !important;
}

.npv3-plate::before {
  position: absolute !important;
  z-index: -1 !important;
  top: 50% !important;
  right: -.3em !important;
  left: -.3em !important;
  height: 2.3em !important;
  content: "" !important;
  transform: translateY(-50%) !important;
  background-image: var(--npv3-plate-art) !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 100% 100% !important;
  pointer-events: none !important;
}

/* Без арта узел не должен добавлять отступов: у лидеров плашки нет. */
.npv3-plate:not([style*="npv3-plate-art"]) {
  padding: 0 !important;
}

/* Старые псевдоэлементы на чужих узлах сняты: арт рисует .npv3-plate. */
.game-home .account-parchment .profile-name.npv3-home-name-style::before,
.lobby-player > .npv3-lobby-name-style::before {
  content: none !important;
}

/*
 * У лидеров ник и строка «ID · уровень» лежат в одном узле .leader-name, и
 * никакой баннер туда не встаёт: он накрывает обе строки. Замерено стендом —
 * вторая строка начинается через 6px от верха. Поэтому в таблице оформление
 * имени показываем цветом, а не картинкой.
 */
.leaderboard .leader-name.npv3-leader-name-style {
  color: var(--npv3-leader-name-accent, #f4dbad) !important;
  text-shadow: 0 1px 3px #000 !important;
}

.leaderboard .leader-name.npv3-leader-name-style small {
  color: #cdb890 !important;
  text-shadow: none !important;
}
