body[data-view="community"] #view-community {
  width: 100%;
  padding: 16px;
  gap: 32px;
}

body[data-view="community"] .community-card,
body[data-view="community"] .friends-card {
  width: 100% !important;
  margin: 0 !important;
}

body[data-view="community"] .community-card .leaderboard-head {
  margin-bottom: 8px !important;
}

body[data-view="community"] .community-card .leaderboard-head h2 {
  font: 600 22px/29px "Montserrat", sans-serif !important;
}

body[data-view="community"] .community-switch {
  display: flex !important;
  width: 100%;
  height: 40px;
  justify-content: space-between;
  align-items: flex-end;
  margin: 0 !important;
  padding: 0 0 2px !important;
  gap: 0 !important;
  border: 0 !important;
  border-bottom: 2px solid #1e2225 !important;
  border-radius: 0 !important;
  background: transparent !important;
}

body[data-view="community"] .community-tab {
  width: 50% !important;
  height: 38px;
  flex: 1 1 50%;
  padding: 0 !important;
  color: #f8f9fa !important;
  font: 400 14px/20px "Open Sans", sans-serif !important;
}

body[data-view="community"] .community-tab.active {
  color: #f5b041 !important;
  background: transparent !important;
  font-weight: 600 !important;
}

body[data-view="community"] .community-tab::after {
  height: 3px !important;
  bottom: -2px !important;
  border-radius: 2px 2px 0 0;
  background: linear-gradient(180deg, #ffbb00 0%, #c57e00 100%) !important;
}

body[data-view="community"] .friend-search {
  width: 100%;
  grid-template-columns: 1fr 44px !important;
  gap: 8px !important;
  margin: 8px 0 32px !important;
}

body[data-view="community"] .friend-search input {
  min-width: 0;
  height: 44px !important;
  border: 1px solid #2c3033 !important;
  border-radius: 10px !important;
  color: #f8f9fa !important;
  background: #080a0b !important;
  font: 400 14px/20px "Open Sans", sans-serif !important;
}

body[data-view="community"] .friend-search .gold-button {
  width: 44px !important;
  min-width: 44px !important;
  height: 44px !important;
  padding: 0 !important;
  border-radius: 10px !important;
  color: transparent !important;
  background: linear-gradient(180deg, #ffbb00 0%, #c57e00 100%) !important;
}

body[data-view="community"] .friend-search .gold-button::before {
  width: 20px !important;
  height: 20px !important;
}

body[data-view="community"] .friend-search .gold-button::after {
  top: 27px !important;
  left: 27px !important;
}

body[data-view="community"] .friend-results:empty {
  display: none !important;
}

body[data-view="community"] .friend-columns {
  width: 100%;
  gap: 32px !important;
}

body[data-view="community"] .friend-columns > section > strong {
  margin: 0 0 16px !important;
  color: #f8f9fa;
  font: 600 18px/24px "Montserrat", sans-serif !important;
}

body[data-view="community"] .friend-list {
  width: 100%;
  gap: 8px !important;
}

body[data-view="community"] .friend-card {
  display: flex !important;
  width: 100%;
  min-height: 44px !important;
  align-items: center;
  gap: 8px;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
}

body[data-view="community"] .community-friend-avatar {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  overflow: hidden;
  place-items: center;
  border-radius: 50%;
  color: #575d62;
  background: #1e2225;
  font: 600 15px/20px "Open Sans", sans-serif;
}

body[data-view="community"] .community-friend-avatar::after {
  content: attr(data-initial);
}

body[data-view="community"] .community-friend-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body[data-view="community"] .community-friend-avatar:has(img)::after {
  display: none;
}

body[data-view="community"] .friend-copy {
  display: grid;
  min-width: 0;
  flex: 1;
}

body[data-view="community"] .friend-copy strong {
  overflow: hidden;
  color: #d4d9de !important;
  font: 400 14px/20px "Open Sans", sans-serif !important;
  overflow-wrap: anywhere;
}

body[data-view="community"] .friend-copy > span {
  display: none;
}

body[data-view="community"] .friend-card.is-incoming {
  grid-template-columns: 1fr 44px 44px;
  gap: 8px;
}

body[data-view="community"] .friend-card.is-incoming .friend-copy {
  margin-right: auto;
}

body[data-view="community"] .friend-card.is-incoming > button {
  position: relative;
  width: 44px !important;
  min-width: 44px !important;
  height: 44px !important;
  padding: 0 !important;
  flex: 0 0 44px;
  border-radius: 10px !important;
  color: transparent !important;
  font-size: 0 !important;
}

body[data-view="community"] .friend-card.is-incoming > .gold-button::before {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: 17px;
  height: 9px;
  box-sizing: border-box;
  margin: 0;
  border-bottom: 2px solid #080a0b;
  border-left: 2px solid #080a0b;
  content: "";
  transform: translate(-50%, -65%) rotate(-45deg);
}

body[data-view="community"] .friend-card.is-incoming > .gold-button {
  background: linear-gradient(180deg, #ffbb00 0%, #c57e00 100%) !important;
}

body[data-view="community"] .friend-card.is-incoming > .glass-button {
  border: 1px solid #f5b041 !important;
  background: transparent !important;
}

body[data-view="community"] .friend-card.is-incoming > .glass-button::before,
body[data-view="community"] .friend-card.is-incoming > .glass-button::after {
  top: 50%;
  left: 50%;
  position: absolute;
  width: 12px;
  height: 2px;
  background: #f5b041;
  content: "";
}

body[data-view="community"] .friend-card.is-incoming > .glass-button::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

body[data-view="community"] .friend-card.is-incoming > .glass-button::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

body[data-view="community"] .friend-card.is-demo-fixture:not(.is-incoming) > button {
  display: none !important;
}

/* COMMUNITY SEARCH EMPTY — Figma fix */

html body[data-view="community"] #view-community {
  display: flex !important;
  box-sizing: border-box !important;
  width: 360px !important;
  min-height: 697px !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 16px !important;
  margin: 0 -16px !important;
  padding: 16px !important;
  overflow: visible !important;
}

/* Верх: Сообщество + табы */
html body[data-view="community"] .community-card {
  display: flex !important;
  width: 328px !important;
  height: 77px !important;
  flex-direction: column !important;
  gap: 8px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

html body[data-view="community"] .community-card .leaderboard-head {
  display: block !important;
  width: 328px !important;
  height: 29px !important;
  margin: 0 !important;
  padding: 0 !important;
}

html body[data-view="community"] .community-card .leaderboard-head h2 {
  width: 328px !important;
  height: 29px !important;
  margin: 0 !important;
  color: #f8f9fa !important;
  font: 600 22px/130% "Montserrat", "Open Sans", sans-serif !important;
  text-align: center !important;
}

html body[data-view="community"] .community-card .leaderboard-head span {
  display: none !important;
}

html body[data-view="community"] .community-switch {
  display: flex !important;
  box-sizing: border-box !important;
  width: 328px !important;
  height: 40px !important;
  align-items: flex-end !important;
  justify-content: space-between !important;
  gap: 0 !important;
  margin: 0 !important;
  padding: 0 0 2px !important;
  border: 0 !important;
  border-bottom: 2px solid #1e2225 !important;
  border-radius: 0 !important;
  background: transparent !important;
}

html body[data-view="community"] .community-tab {
  position: relative !important;
  display: flex !important;
  width: 164px !important;
  height: 31px !important;
  min-height: 31px !important;
  align-items: flex-start !important;
  justify-content: center !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  color: #f8f9fa !important;
  background: transparent !important;
  font: 400 14px/145% "Open Sans", sans-serif !important;
}

html body[data-view="community"] .community-tab.active {
  color: #f5b041 !important;
  font-weight: 600 !important;
}

html body[data-view="community"] .community-tab::after {
  position: absolute !important;
  right: 0 !important;
  bottom: -2px !important;
  left: 0 !important;
  display: block !important;
  width: 164px !important;
  height: 3px !important;
  border-radius: 2px 2px 0 0 !important;
  background: transparent !important;
  content: "" !important;
  opacity: 1 !important;
}

html body[data-view="community"] .community-tab.active::after {
  background: linear-gradient(180deg, #ffbb00 0%, #c57e00 100%) !important;
}

/* Блок друзей */
html body[data-view="community"] .friends-card {
  display: flex !important;
  width: 328px !important;
  flex-direction: column !important;
  gap: 16px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

html body[data-view="community"] .friends-card .leaderboard-head {
  display: none !important;
}

/* Поиск */
html body[data-view="community"] .friend-search {
  display: grid !important;
  box-sizing: border-box !important;
  width: 328px !important;
  height: 44px !important;
  grid-template-columns: 276px 44px !important;
  gap: 8px !important;
  margin: 0 !important;
  padding: 0 !important;
}

html body[data-view="community"] .friend-search input {
  box-sizing: border-box !important;
  width: 276px !important;
  height: 44px !important;
  min-height: 44px !important;
  margin: 0 !important;
  padding: 0 12px !important;
  border: 1px solid #2c3033 !important;
  border-radius: 10px !important;
  color: #f8f9fa !important;
  background: #080a0b !important;
  font: 400 14px/145% "Open Sans", sans-serif !important;
  text-align: left !important;
}

html body[data-view="community"] .friend-search input::placeholder {
  color: #939ba2 !important;
}

html body[data-view="community"] .friend-search input:focus {
  border-color: #f5b041 !important;
}

html body[data-view="community"] .friend-search .gold-button {
  position: relative !important;
  display: grid !important;
  box-sizing: border-box !important;
  width: 44px !important;
  min-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  place-items: center !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 10px !important;
  color: transparent !important;
  background: linear-gradient(180deg, #ffbb00 0%, #c57e00 100%) !important;
  font-size: 0 !important;
}

html body[data-view="community"] .friend-search .gold-button {
  position: relative !important;
  display: grid !important;
  box-sizing: border-box !important;
  width: 44px !important;
  min-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  place-items: center !important;
  margin: 0 !important;
  padding: 0 !important;

  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 10px !important;
  color: transparent !important;
  background:
          url("/assets/icons/search-normal.svg") center / 23px 24px no-repeat,
          linear-gradient(180deg, #ffbb00 0%, #c57e00 100%) !important;

  font-size: 0 !important;
  box-shadow: none !important;
}

html body[data-view="community"] .friend-search .gold-button::before,
html body[data-view="community"] .friend-search .gold-button::after {
  display: none !important;
  content: none !important;
}

/* Результаты поиска */
html body[data-view="community"] .friend-results {
  display: flex !important;
  width: 328px !important;
  flex-direction: column !important;
  gap: 8px !important;
  margin: 0 !important;
  padding: 0 !important;
}

html body[data-view="community"] .friend-results:empty {
  display: none !important;
}

/* Если пользователь уже ищет — скрываем обычные заявки/друзей */
html body[data-view="community"] .friends-card.is-search-mode .friend-columns {
  display: none !important;
}

/* fallback для браузеров с :has */
html body[data-view="community"] .friends-card:has(.friend-results:not(:empty)) .friend-columns {
  display: none !important;
}

/* Empty state как в Figma */
html body[data-view="community"] .friend-empty-state {
  position: relative !important;
  display: flex !important;
  box-sizing: border-box !important;
  width: 328px !important;
  min-height: 440px !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 16px !important;
  margin: 0 !important;
  padding: 0 !important;
  text-align: center !important;
}

html body[data-view="community"] .friend-empty-state::before,
html body[data-view="community"] .friend-empty-state::after {
  position: absolute !important;
  z-index: 0 !important;
  width: 132px !important;
  height: 132px !important;
  border-radius: 50% !important;
  content: "" !important;
  filter: blur(32.5px) !important;
  pointer-events: none !important;
}

html body[data-view="community"] .friend-empty-state::before {
  top: 130px !important;
  left: 72px !important;
  background: rgba(245, 176, 65, 0.4) !important;
}

html body[data-view="community"] .friend-empty-state::after {
  top: 157px !important;
  left: 111px !important;
  background: rgba(65, 143, 245, 0.4) !important;
}

html body[data-view="community"] .friend-empty-state > * {
  position: relative !important;
  z-index: 1 !important;
}

html body[data-view="community"] .friend-empty-state p {
  width: 328px !important;
  height: 40px !important;
  margin: 0 !important;
  color: #939ba2 !important;
  font: 400 14px/145% "Open Sans", sans-serif !important;
  text-align: center !important;
}

html body[data-view="community"] .friend-empty-state img {
  width: 240px !important;
  height: 240px !important;
  margin: 0 !important;
  object-fit: contain !important;
}

html body[data-view="community"] .friend-empty-state strong {
  width: 328px !important;
  margin: 0 !important;
  color: #f8f9fa !important;
  font: 600 14px/145% "Open Sans", sans-serif !important;
  text-align: center !important;
}

html body[data-view="community"] .friend-empty-state .gold-button {
  display: flex !important;
  width: 304px !important;
  height: 44px !important;
  min-height: 44px !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 0 24px !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 10px !important;
  color: #080a0b !important;
  background: linear-gradient(180deg, #ffbb00 0%, #c57e00 100%) !important;
  font: 600 14px/145% "Open Sans", sans-serif !important;
}

/* Обычные заявки/друзья, когда поиск не активен */
html body[data-view="community"] .friend-columns {
  width: 328px !important;
  margin: 16px 0 0 !important;
}

/* FIX: в "Рейтинге" не должен показываться блок друзей */

html body[data-view="community"] .community-panel:not(.active) {
  display: none !important;
}

html body[data-view="community"] .friends-card.community-panel:not(.active),
html body[data-view="community"] .leaderboard-card.community-panel:not(.active) {
  display: none !important;
}

html body[data-view="community"] .friends-card.community-panel.active {
  display: flex !important;
}

html body[data-view="community"] .leaderboard-card.community-panel.active {
  display: block !important;
}