.site_header {
  display: flex;
  padding-top: 10px;
  padding-bottom: 10px;
}

.site_header__brand {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
}

.site_header__brand img {
  display: block;
  width: 125px;
  height: auto;
}

.site_header__nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 28px;
}

.site_header__nav_link {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 6px 12px;
  border-radius: var(--ui_radius_sm);
  color: var(--ui_color_text_muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--ui_transition_fast);
  color var(--ui_transition_fast);
}

.site_header__nav_link:hover {
  background: var(--ui_color_surface_soft);
  color: var(--ui_color_text);
}

.site_header__nav_link.is-active {
  color: var(--ui_color_text);
}

.site_header__nav_icon {
  display: none;
  flex: 0 0 auto;
  background: currentColor;
}

.site_header__nav_label_mobile {
  display: none;
}

.site_header__nav_icon_home {
  -webkit-mask: url("../assets/icons/home.svg") center / contain no-repeat;
  mask: url("../assets/icons/home.svg") center / contain no-repeat;
}

.site_header__nav_icon_tournaments {
  -webkit-mask: url("../assets/icons/trophy.svg") center / contain no-repeat;
  mask: url("../assets/icons/trophy.svg") center / contain no-repeat;
}

.site_header__nav_icon_careers {
  -webkit-mask: url("../assets/icons/career.svg") center / contain no-repeat;
  mask: url("../assets/icons/career.svg") center / contain no-repeat;
}

.ui_header_account {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  color: var(--ui_color_text_muted);
  font-size: 13px;
}

.ui_header_notifications {
  position: relative;
  z-index: 21;
}

.header_notifications_wrap {
  position: static;
}

.header_notifications_panel {
  position: absolute;
  z-index: 20;
  top: calc(100% + 20px);
  right: -25px;
  width: min(460px, calc(100vw - 30px));
  max-height: min(520px, calc(100vh - 90px));
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--ui_color_border);
  box-shadow: var(--ui_shadow_md);
}

.header_notifications_backdrop {
  position: fixed;
  z-index: 18;
  inset: 0;
  padding: 0;
  border: 0;
  background: rgba(3, 8, 15, .72);
  cursor: default;
}

.header_notifications_head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 18px 18px 8px;
}

.header_notifications_head h2 {
  margin: 0;
  font-size: 18px;
}

.header_notifications_close {
  display: none;
}

.header_notifications_tabs {
  padding: 0 18px;
}

.header_notifications_tabs .ui_tab {
  font-size: 12px;
}

.header_notifications_list {
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 8px;
  max-height: 400px;
  padding: 0 10px 10px 10px;
  overflow-y: auto;
  scrollbar-width: none;
}

.header_notifications_list::-webkit-scrollbar {
  display: none;
}

.header_notification_card {
  overflow: hidden;
}

.header_notification_delete {
  position: absolute;
  z-index: 2;
  top: 0;
  right: 0;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 0;
  background: transparent;
  color: var(--ui_color_text_muted);
  cursor: pointer;
  transition: color var(--ui_transition_fast);
}

.header_notification_delete .ui_button_icon {
  width: 9px;
  height: 9px;
  opacity: .45;
  transition: opacity var(--ui_transition_fast);
}

.header_notification_delete:hover {
  background: transparent;
  color: var(--ui_color_text_muted);
}

.header_notification_delete:hover .ui_button_icon {
  opacity: .8;
}

.header_notification_card:not(.is_unread) .header_notification_content > span:first-child {
  padding-right: 23px;
}

.header_notification {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  padding: 13px;
  color: var(--ui_color_text);
  text-decoration: none;
  transition: background var(--ui_transition_fast);
}

.header_notification_avatar {
  position: relative;
  display: block;
  width: 44px;
  height: 44px;
}

.header_notification_avatar > .ui_avatar {
  width: 44px;
  height: 44px;
  font-size: 14px;
}

.header_notification_action_icon {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 18px;
  height: 18px;
  border: 2px solid var(--ui_color_surface_soft);
  border-radius: 50%;
  background-color: var(--ui_color_primary);
}

.header_notification_action_icon::before {
  position: absolute;
  inset: 3px;
  background: #fff;
  content: "";
}

.header_notification_action_friend_request::before,
.header_notification_action_friend_accepted::before {
  -webkit-mask: url("../assets/icons/friend-action.svg") center / contain no-repeat;
  mask: url("../assets/icons/friend-action.svg") center / contain no-repeat;
}

.header_notification_action_friend_declined::before,
.header_notification_action_friend_withdrawn::before {
  -webkit-mask: url("../assets/icons/friend-action.svg") center / contain no-repeat;
  mask: url("../assets/icons/friend-action.svg") center / contain no-repeat;
}

.header_notification_action_friend_declined,
.header_notification_action_friend_withdrawn,
.header_notification_action_friend_removed {
  background-color: var(--ui_color_danger);
}

.header_notification_action_friend_removed::before {
  -webkit-mask: url("../assets/icons/friend-action.svg") center / contain no-repeat;
  mask: url("../assets/icons/friend-action.svg") center / contain no-repeat;
}

.header_notification_action_tournament::before {
  -webkit-mask: url("../assets/icons/trophy.svg") center / contain no-repeat;
  mask: url("../assets/icons/trophy.svg") center / contain no-repeat;
}

.header_notification_action_career::before,
.header_notification_action_career_moderator_added::before,
.header_notification_action_career_moderator_removed::before {
  -webkit-mask: url("../assets/icons/career.svg") center / contain no-repeat;
  mask: url("../assets/icons/career.svg") center / contain no-repeat;
}

.header_notification_action_career_moderator_removed {
  background-color: var(--ui_color_danger);
}

.header_notification_action_career_season_updated::before {
  -webkit-mask: url("../assets/icons/settings.svg") center / contain no-repeat;
  mask: url("../assets/icons/settings.svg") center / contain no-repeat;
}

.header_notification_content {
  display: grid;
  gap: 4px;
}

.header_notification_content > span:first-child {
  display: grid;
  gap: 2px;
}

.header_notification_card.is_unread {
  border-color: color-mix(in srgb, var(--ui_color_success) 38%, var(--ui_color_border));
}

.header_notification_card.is_unread::after {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ui_color_success);
  content: "";
}

.header_notification strong {
  font-size: 13px;
}

.header_notification_title,
.header_notification_actor {
  color: var(--ui_color_text);
}

.header_notification_title {
  font-weight: 700;
}

.header_notification_actor {
  font-weight: 650;
}

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

.header_notification time {
  color: var(--ui_color_text_muted);
  font-size: 11px;
}

.header_notification_actions,
.header_notification_actions form {
  display: flex;
  gap: 8px;
}

.header_notification_actions {
  padding: 0 13px 13px 73px;
}

.header_notification_actions .ui_button_secondary {
  border-color: color-mix(in srgb, var(--ui_color_text_muted) 55%, transparent);
  background: var(--ui_color_surface_raised);
}

.header_notification_actions .ui_button_secondary:hover {
  background: var(--ui_color_surface_hover);
}

.header_notifications_list > .ui_note {
  padding: 10px 5px;
}

.ui_header_notifications_count {
  position: absolute;
  top: 1px;
  right: -2px;
  border: 2px solid var(--ui_color_surface);
}

.ui_header_icon {
  display: inline-block;
  flex: 0 0 auto;
  background-color: currentColor;
}

.ui_header_icon_bell {
  width: 19px;
  height: 19px;
  -webkit-mask: url("../../tournaments/assets/icons/bell.svg") center / contain no-repeat;
  mask: url("../../tournaments/assets/icons/bell.svg") center / contain no-repeat;
}

.ui_header_profile_toggle {
  gap: 9px;
  min-height: 40px;
  padding: 3px 10px 3px 4px;
  border-radius: 20px;
  background: var(--ui_color_surface_raised);
}

.ui_header_ea_id {
  max-width: 180px;
  overflow: hidden;
  color: var(--ui_color_text);
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ui_header_icon_arrow {
  width: 10px;
  height: 10px;
  margin-left: 3px;
  -webkit-mask: url("../../tournaments/assets/icons/arrow-down.svg") center / contain no-repeat;
  mask: url("../../tournaments/assets/icons/arrow-down.svg") center / contain no-repeat;
  transition: transform var(--ui_transition_fast);
}

.header_profile_open .ui_header_icon_arrow {
  transform: rotate(180deg);
}

.ui_header_login {
  margin-left: auto;
}

@media (max-width: 899px) {
  body {
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }

  .site_header {
    flex-wrap: nowrap;
  }

  .header_notifications_panel {
    position: fixed;
    z-index: 22;
    inset: 10px;
    display: flex;
    flex-direction: column;
    width: auto;
    height: auto;
    max-height: none;
    border-radius: var(--ui_radius_md);
  }

  .header_notifications_panel[hidden] {
    display: none;
  }

  .header_notifications_head {
    flex: 0 0 auto;
    padding: 10px 10px 8px 18px;
  }

  .header_notifications_close {
    position: static;
    display: inline-flex;
    flex: 0 0 auto;
  }

  .header_notifications_tabs {
    flex: 0 0 auto;
  }

  .header_notifications_list {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overscroll-behavior: contain;
  }

  .ui_header_ea_id {
    display: none;
  }

  .ui_header_profile_toggle {
    gap: 5px;
    padding-right: 9px;
  }

  .site_header__nav {
    position: fixed;
    z-index: 20;
    right: 10px;
    bottom: 10px;
    left: 10px;
    justify-content: space-around;
    margin-left: 0;
    padding: 5px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(31, 42, 55, .72), rgba(13, 19, 27, .62));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 14px 40px rgba(0, 0, 0, .42);
    -webkit-backdrop-filter: blur(20px) saturate(145%);
    backdrop-filter: blur(20px) saturate(145%);
  }

  .site_header__nav_link {
    position: relative;
    flex: 1 1 0;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    min-height: 44px;
    padding: 3px 4px 2px;
    color: var(--ui_color_text_muted);
    font-size: 10px;
    line-height: 1;
    text-align: center;
  }

  .site_header__nav_link.is-active {
    background: var(--ui_primary_gradient);
    color: var(--ui_color_primary);
    box-shadow: inset 0 0 0 1px rgba(20, 174, 102, .12);
  }

  .site_header__nav_link.is-active::before {
    position: absolute;
    top: -8px;
    width: 28px;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--ui_color_primary);
    box-shadow: 0 0 12px var(--ui_color_primary);
    content: "";
  }

  .site_header__nav_icon {
    display: block;
    width: 19px;
    height: 19px;
  }

  .site_header__nav_label_desktop {
    display: none;
  }

  .site_header__nav_label_mobile {
    display: inline;
  }
}
