body.profile_page {
  background: radial-gradient(circle at top, #173155 0, var(--ui_color_bg) 48%);
  min-height: 100vh;
}

.profile_header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 20px;
}

.profile_avatar_upload,
.profile_avatar_upload_label {
  display: block;
}

.profile_avatar_upload_label {
  width: 54px;
  height: 54px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--ui_color_surface_soft);
  cursor: pointer;
}

img.profile_avatar {
  background: var(--ui_color_surface_soft);
  color: transparent;
}

.profile_card_main {
  position: relative;
}

.profile_card_editable .profile_header {
  padding-right: 46px;
}

.profile_avatar_upload_label:hover .profile_avatar {
  filter: brightness(0.8);
}

.profile_avatar_upload_input {
  display: none;
}

.profile_header h1 {
  margin-bottom: 0 !important;
  font-size: 25px;
  margin-top: -5px;
}

.profile_ea_id {
  color: var(--ui_color_text_muted);
  font-size: 14px;
  display: flex;
  align-items: center;
}

.profile_online_status {
  display: inline-flex;
  align-items: center;
  color: var(--ui_color_text_muted);
  font-size: 12px;
  margin-top: 1px;
}

.profile_online_status::before {
  margin: 0 6px;
  content: "·";
}

.profile_online_status.is_online {
  color: var(--ui_color_success);
}

.profile_achievements {
  display: flex;
  grid-column: 2;
  gap: 8px;
  white-space: nowrap;
  align-items: center;
}

.profile_achievement_image {
  display: block;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--ui_color_border);
  padding: 3px;
}

.profile_achievement {
  position: relative;
  flex: 0 0 42px;
  border-radius: 10px;
  outline: none;
}

.profile_achievement:focus-visible {
  box-shadow: 0 0 0 2px var(--ui_color_primary);
}

.profile_achievements_more {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  border-bottom: 1px dashed currentColor;
  color: var(--ui_color_text_muted);
  font-size: 11px;
  text-decoration: none;
  margin-left: 7px;
  transition: var(--ui_transition_fast);
  opacity: 0.6;
}

.profile_achievements_more:hover,
.profile_achievements_more:focus-visible {
  color: var(--ui_color_text);
  opacity: 1;
}

.profile_achievement_popup {
  position: absolute;
  z-index: 20;
  top: calc(100% + 10px);
  left: 0;
  display: none;
  grid-template-columns: 64px minmax(180px, 260px);
  align-items: center;
  gap: 12px;
  width: max-content;
  max-width: min(360px, calc(100vw - 40px));
  padding: 12px;
  border: 1px solid var(--ui_color_border);
  border-radius: var(--ui_radius_md);
  background: var(--ui_color_surface_raised);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
  white-space: normal;
}

.profile_achievement:hover .profile_achievement_popup,
.profile_achievement:focus .profile_achievement_popup {
  display: grid;
}

.profile_achievement_popup > img {
  display: block;
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid #c2ae8c;
  padding: 3px;
}

.profile_achievement_popup > div {
  display: grid;
  gap: 4px;
}

.profile_achievement_popup strong {
  font-size: 14px;
}

.profile_achievement_popup span {
  color: var(--ui_color_text_muted);
  font-size: 12px;
  line-height: 1.4;
}

.profile_achievement_list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

#profile_achievements_section {
  scroll-margin-top: 20px;
}

.profile_achievement_card {
  display: grid;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--ui_radius_md);
  background: var(--ui_color_surface_soft);
}

.profile_achievement_card.has-image {
  grid-template-columns: 64px minmax(0, 1fr);
}

.profile_achievement_card > img {
  display: block;
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
}

.profile_achievement_card > div {
  display: grid;
  gap: 4px;
}

.profile_achievement_card span {
  color: var(--ui_color_text_muted);
  font-size: 13px;
}

.profile_activity {
  grid-column: 2;
  margin-top: -8px;
  color: var(--ui_color_text_muted);
  font-size: 12px;
}

.profile_activity span {
  color: var(--ui_color_text);
  font-size: 13px;
  font-weight: 600;
}

.profile_card h1 {
  margin-bottom: 10px;
}

.profile_actions {
  position: absolute;
  top: 15px;
  right: 25px;
}

.profile_actions .ui_button {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  border: 0;
  color: var(--ui_color_text_muted);
}

.profile_actions .ui_button:hover {
  color: var(--ui_color_text);
}

.profile_friend_row > div,
.profile_friend_row form {
  display: flex;
  gap: 8px;
}

.profile_friends_card {
  position: relative;
}

.profile_friends_card > h2 {
  padding-right: 115px;
}

.profile_friends_count {
  min-width: 22px;
  min-height: 20px;
  margin-left: 4px;
  padding: 2px 7px;
  font-size: 12px;
}

.profile_friends_action {
  position: absolute;
  top: 12px;
  right: 25px;
  margin: 0;
}

.profile_friends_tabs {
  margin-bottom: 12px;
}

.profile_friend_list {
  display: grid;
  gap: 10px;
}

.profile_friend_row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 10px 12px;
  border-radius: var(--ui_radius_sm);
  background: var(--ui_color_surface_soft);
}

.profile_friend_row > a,
.profile_friend {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ui_color_text);
  font-weight: 600;
  text-decoration: none;
  font-size: 14px;
}

.profile_friend_search_result {
  justify-content: flex-start;
  width: 100%;
  text-align: left;
}

.profile_friend_search_result strong {
  margin-bottom: 2px;
}

.profile_friend_search_result span:last-child {
  display: grid;
}

.profile_friend_search_result small {
  color: var(--ui_color_text_muted);
  font-weight: 400;
}

.profile_friends_title {
  margin: 22px 0 5px;
  font-size: 14px;
}

.profile_friend_grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.profile_friend_wrap {
  position: relative;
  width: fit-content;
  justify-self: start;
}

.profile_friend {
  width: fit-content;
  justify-self: start;
  padding: 5px 15px 5px 10px;
  font-size: 14px;
  border-radius: var(--ui_radius_sm);
  background: var(--ui_color_surface_soft);
  transition: background var(--ui_transition_fast);
}

.profile_friend_wrap:hover .profile_friend,
.profile_friend_wrap:focus-within .profile_friend {
  background: var(--ui_color_surface_hover);
}

.profile_friend_remove_area {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: auto;
  display: flex;
  align-items: center;
  padding: 0 4px 0 10px;
  background: var(--ui_color_surface_hover);
  border-radius: 0 var(--ui_radius_sm) var(--ui_radius_sm) 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--ui_transition_fast);
}

.profile_friend_remove {
  width: 26px;
  height: 26px;
  min-width: 26px;
  min-height: 26px;
  color: var(--ui_color_text_muted);
  transition: color var(--ui_transition_fast), background var(--ui_transition_fast);
}

.profile_friend_remove .ui_button_icon {
  width: 9px;
  height: 9px;
}

.profile_friend_wrap.is_removable:hover .profile_friend_remove_area,
.profile_friend_wrap.is_removable:focus-within .profile_friend_remove_area {
  opacity: 1;
  pointer-events: auto;
}

.profile_friend_remove:hover {
  border-color: var(--ui_color_border);
  background: var(--ui_color_surface_raised);
  color: var(--ui_color_text);
}

.profile_edit_icon {
  display: block;
  width: 11px;
  height: 11px;
  background: currentColor;
  -webkit-mask: url("../assets/icons/edit.svg") center / contain no-repeat;
  mask: url("../assets/icons/edit.svg") center / contain no-repeat;
}

.profile_statistics {
  display: grid;
  grid-template-columns: repeat(5, minmax(90px, 1fr));
  gap: 15px;
}

.profile_statistics_tabs {
  margin-bottom: 15px;
}

.profile_statistics div {
  display: grid;
  gap: 4px;
  padding: 12px 15px;
  border-radius: var(--ui_radius_sm);
  background: var(--ui_color_surface_soft);
}

.profile_statistics dt {
  color: var(--ui_color_text_muted);
  font-size: 12px;
}

.profile_statistics dd {
  font-size: 20px;
  font-weight: 600;
}

@media (max-width: 899px) {
  .profile_friends_action {
    right: 15px;
  }

  .profile_friend_row {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .profile_friend_row > a {
    min-width: 0;
  }

  .profile_friend_row > div {
    width: 100%;
  }

  .profile_friend_row > div form {
    flex: 1 1 0;
  }

  .profile_friend_row > div .ui_button {
    width: 100%;
  }

  .profile_actions {
    top: 10px;
    right: 10px;
  }

  .profile_achievement_list {
    grid-template-columns: 1fr;
  }

  .profile_card_editable .profile_header {
    padding-right: 46px;
  }

  .profile_statistics {
    grid-template-columns: repeat(2, minmax(90px, 1fr));
  }

  .profile_achievement_card {
    padding: 10px;
  }

  .profile_achievement_card.has-image {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .profile_achievement_card > img {
    width: 54px;
    height: 54px;
  }

  .profile_statistics {
    gap: 5px;
  }

  .profile_statistics div {
    padding: 10px 10px 10px 15px;
  }

}

@media (max-width: 369px) {
  .profile_avatar_upload_label,
  .profile_header .ui_avatar_large {
    width: 44px;
    height: 44px;
  }

  .ui_avatar_small {
    width: 26px;
    height: 26px;
  }

  .profile_friend {
    font-size: 12px;
  }

  .profile_ea_id {
    font-size: 12px;
  }

  .profile_header h1 {
    margin-top: -1px;
    font-size: 20px;
  }

  .profile_activity,
  .profile_achievements {
    grid-column: 1 / -1;
  }
}
.profile_competition_list {
  display: grid;
  gap: 10px;
}
