.bb-player-avatar {
  position: relative;
  display: inline-block;
  width: 100%;
  height: 100%;
  line-height: 0;
  overflow: visible;
}

.bb-player-avatar > img:first-child {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bb-player-avatar__training {
  position: absolute;
  left: auto;
  right: -14px;
  top: 0;
  bottom: 0;
  z-index: 3;
  display: grid;
  grid-template-rows: repeat(4, minmax(0, 1fr));
  gap: 1px;
  width: 11px;
  height: 100%;
  padding: 1px;
  border: 1px solid rgba(17, 138, 178, .28);
  border-radius: 7px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 2px 6px rgba(7, 59, 76, .18);
}

.bb-player-avatar__training img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}

.bb-player-avatar__training img.is-filled {
  opacity: 1;
}

.bb-player-avatar__training img.is-empty {
  opacity: .18;
  filter: grayscale(1);
}

.bb-player-avatar__loyalty {
  position: absolute;
  right: -4px;
  bottom: -4px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .92);
  border-radius: 50%;
  background: #24150e;
  box-shadow: 0 3px 9px rgba(34, 20, 13, .38), 0 0 0 1px rgba(255, 116, 24, .16);
  line-height: 1;
}

.bb-player-avatar__loyalty img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.bb-player-avatar--profile .bb-player-avatar__training,
.bb-player-avatar--cabinet .bb-player-avatar__training {
  right: -22px;
  width: 18px;
}

.bb-player-avatar--profile {
  width: 100%;
  height: 100%;
}

.bb-player-avatar--profile > img:first-child {
  border-radius: 10px;
}

.bb-player-avatar--cabinet {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
}

.bb-player-avatar--profile .bb-player-avatar__loyalty {
  right: 4px;
  bottom: 4px;
  width: 34px;
  height: 34px;
}

.bb-player-avatar--cabinet .bb-player-avatar__loyalty {
  width: 24px;
  height: 24px;
}

.live-events__players .bb-player-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
}

/* Карточки игр, тренировок и турниров всегда используют компактные аватарки. */
.game__list-user-photo .bb-player-avatar {
  width: 33px;
  height: 33px;
  min-width: 33px;
  min-height: 33px;
  max-width: 33px;
  max-height: 33px;
  flex: 0 0 33px;
}

.game__list-user-photo .bb-player-avatar > img:first-child {
  width: 33px;
  height: 33px;
  max-width: 33px;
  max-height: 33px;
}

/* Hide training-level bars on results pages to avoid overlapping player names */
.game__block1 .game__list-user-photo .bb-player-avatar__training {
  display: none !important;
}

/* Pair block styling for PAIRS_BY_PAIRS results */
.game__pair-block {
  list-style: none;
  position: relative;
  border: 1px solid #ef8c3b;
  border-radius: 12px;
  padding: 8px 46px 8px 10px;
  margin-bottom: 12px;
  background: transparent;
}

.game__pair-block .game__list-user {
  position: relative;
  margin-bottom: 2px;
}

.game__pair-block .game__list-user:last-child {
  margin-bottom: 0;
}

.game__pair-medal {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  font-size: 24px;
  line-height: 1;
}

.game__pair-grid-title {
  border-radius: 10px;
  margin: 18px 0 10px;
  padding: 8px 12px;
  background: linear-gradient(90deg, #ffd66b 0%, #ffbf3f 55%, #f5a623 100%);
  color: #5a3100;
}

@media (max-width: 767px) {
  .game__pair-block {
    padding: 7px 42px 7px 8px;
    margin-bottom: 10px;
  }

  .game__pair-medal {
    right: 10px;
    font-size: 22px;
  }
}
