/* RELOAD23 — страница друзей в стиле платформы. */

.page-friends {
  background: #0b100c;
}

.friends-page {
  min-height: 60vh;
  background: #0b100c;
  color: #b8bcbf;
}

.friends-container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Hero */
.friends-hero {
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(124, 194, 66, 0.1);
  background:
    radial-gradient(ellipse at 12% -30%, rgba(124, 194, 66, 0.12), transparent 55%),
    #0b100c;
}

.friends-hero__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-top: 40px;
  padding-bottom: 28px;
}

.friends-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #8b929a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.friends-eyebrow svg {
  width: 15px;
  height: 15px;
  color: #7cc242;
}

.friends-hero h1 {
  margin: 8px 0 0;
  color: #fff;
  font-size: 38px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
}

.friends-sub {
  margin: 8px 0 0;
  color: #8b929a;
  font-size: 14px;
}

.friends-refresh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  background: #141d18;
  box-shadow: inset 0 0 0 1px rgba(124, 194, 66, 0.14);
  color: #dcdedf;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 150ms ease;
}

.friends-refresh:hover {
  background: #1e3327;
}

.friends-refresh svg {
  width: 16px;
  height: 16px;
}

/* Stats */
.friends-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.friends-stat {
  min-width: 0;
  padding: 12px 16px;
  border-radius: 6px;
  background: #141d18;
  box-shadow: inset 0 0 0 1px rgba(124, 194, 66, 0.1);
}

.friends-stat__label {
  margin: 0;
  overflow: hidden;
  color: #7d858e;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.friends-stat__value {
  margin: 4px 0 0;
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.friends-stat__value--friends { color: #7cc242; }
.friends-stat__value--incoming { color: #f0c45b; }
.friends-stat__value--outgoing { color: #9aa2ab; }
.friends-stat__value--online { color: #7cc242; }

/* Body */
.friends-body {
  padding: 20px 0 48px;
}

.friends-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  align-items: start;
  gap: 20px;
}

.friends-main {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.friends-side {
  display: grid;
  gap: 16px;
  min-width: 0;
  position: sticky;
  top: 90px;
}

/* Guest */
.friends-guest {
  display: flex;
  max-width: 760px;
  align-items: flex-start;
  gap: 20px;
  margin: 0 auto;
  padding: 28px;
  border: 1px solid rgba(124, 194, 66, 0.12);
  border-radius: 8px;
  background:
    radial-gradient(ellipse at 0 0, rgba(124, 194, 66, 0.12), transparent 55%),
    #0d1410;
}

.friends-guest[hidden] {
  display: none;
}

.friends-guest__icon {
  display: flex;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(124, 194, 66, 0.3);
  border-radius: 6px;
  background: rgba(124, 194, 66, 0.1);
  color: #7cc242;
}

.friends-guest__icon svg {
  width: 24px;
  height: 24px;
}

.friends-guest__eyebrow {
  margin: 0;
  color: #7cc242;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.friends-guest h2 {
  margin: 6px 0 0;
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.friends-guest p {
  margin: 8px 0 0;
  color: #8b929a;
  font-size: 13px;
  line-height: 1.6;
}

.friends-guest .friends-btn {
  margin-top: 18px;
}

/* Panels */
.friends-panel {
  overflow: hidden;
  border: 1px solid rgba(124, 194, 66, 0.12);
  border-radius: 8px;
  background: #0d1410;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.18);
}

.friends-panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(124, 194, 66, 0.1);
  background: #101812;
}

.friends-panel__eyebrow {
  margin: 0 0 3px;
  color: #7cc242;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.friends-panel h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
}

.friends-count {
  display: inline-flex;
  min-width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(124, 194, 66, 0.1);
  color: #8b929a;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.friends-search {
  display: flex;
  width: 230px;
  max-width: 100%;
  height: 36px;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border-radius: 6px;
  background: #131c17;
  box-shadow: inset 0 0 0 1px rgba(124, 194, 66, 0.14);
}

.friends-search:focus-within {
  box-shadow: inset 0 0 0 1px rgba(124, 194, 66, 0.6);
}

.friends-search svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  color: #67707b;
}

.friends-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  background: transparent;
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  outline: 0;
}

.friends-search input::placeholder {
  color: #5d6670;
}

/* Friend rows — overrides account.css */
.page-friends .friend-list {
  display: block;
}

.page-friends .friend-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 14px 18px;
  border: 0;
  border-bottom: 1px solid rgba(124, 194, 66, 0.09);
  border-radius: 0;
  background: transparent;
  transition: background-color 120ms ease;
}

.page-friends .friend-row:last-child {
  border-bottom: 0;
}

.page-friends .friend-row:hover {
  background: #112016;
}

.page-friends .friend-row[hidden] {
  display: none;
}

.page-friends .friend-row__avatar {
  position: relative;
  display: flex;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  overflow: visible;
  border: 1px solid rgba(124, 194, 66, 0.14);
  border-radius: 6px;
  background:
    radial-gradient(circle at 30% 20%, hsla(var(--av-h, 110), 70%, 64%, 0.85), transparent 62%),
    linear-gradient(145deg, hsl(var(--av-h, 110), 45%, 38%), hsl(var(--av-h, 110), 50%, 18%));
  color: #eaffea;
  font-family: var(--font-brand, "Barlow Condensed", sans-serif);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.page-friends .friend-row__avatar img {
  width: 100%;
  height: 100%;
  border-radius: 5px;
  object-fit: cover;
}

.page-friends .online-dot {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 11px;
  height: 11px;
  border: 2px solid #0d1410;
  border-radius: 50%;
  background: #67707b;
}

.page-friends .online-dot.is-online {
  background: #7cc242;
  box-shadow: 0 0 8px rgba(124, 194, 66, 0.55);
}

.page-friends .friend-row__body {
  flex: 1;
  min-width: 0;
}

.page-friends .friend-row__name {
  display: block;
  overflow: hidden;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-friends .friend-row__meta {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: #8b929a;
  font-size: 11px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-friends .friend-row__meta .is-online {
  color: #7cc242;
}

.page-friends .friend-row__actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.page-friends .friend-row__actions .btn {
  display: inline-flex;
  height: 32px;
  min-height: 0;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid rgba(124, 194, 66, 0.16);
  border-radius: 5px;
  background: #18241e;
  color: #dcdedf;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.page-friends .friend-row__actions .btn:hover {
  border-color: rgba(124, 194, 66, 0.28);
  background: #203028;
  color: #fff;
}

.page-friends .friend-row__actions .btn-green {
  border-color: #3d9c4a;
  background: #3d9c4a;
  color: #fff;
}

.page-friends .friend-row__actions .btn-green:hover {
  border-color: #46b356;
  background: #46b356;
  color: #fff;
}

.page-friends .friend-row__actions .btn[data-confirm="1"] {
  border-color: rgba(222, 54, 24, 0.5) !important;
  background: rgba(222, 54, 24, 0.16) !important;
  color: #de8877 !important;
}

.page-friends .friend-row__actions .badge {
  display: inline-flex;
  height: 26px;
  align-items: center;
  padding: 0 9px;
  border: 1px solid rgba(240, 196, 91, 0.25);
  border-radius: 999px;
  background: rgba(240, 196, 91, 0.08);
  color: #f0c45b;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

/* Empty states */
.page-friends .friend-empty {
  display: flex;
  min-height: 92px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 18px;
  border-top: 1px solid rgba(124, 194, 66, 0.08);
  color: #67707b;
  font-size: 12px;
  text-align: center;
}

.page-friends .friend-empty[hidden] {
  display: none;
}

.page-friends .friend-empty svg {
  width: 22px;
  height: 22px;
  color: rgba(124, 194, 66, 0.45);
}

/* Sidebar cards */
.friends-card {
  overflow: hidden;
  padding: 18px;
  border: 1px solid rgba(124, 194, 66, 0.12);
  border-radius: 8px;
  background: #0d1410;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.18);
}

.friends-card__head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
}

.friends-card__head svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: #7cc242;
}

.friends-card__head h2 {
  margin: 0;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.friends-card--code .friends-card__head svg {
  color: #7cc242;
}

.friends-note {
  margin: 0 0 12px;
  color: #8b929a;
  font-size: 12px;
  line-height: 1.55;
}

.friends-card .friends-note:last-child {
  margin-bottom: 0;
}

.my-code {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(124, 194, 66, 0.22);
  border-radius: 6px;
  background: rgba(124, 194, 66, 0.08);
}

.my-code__label {
  display: block;
  margin-bottom: 5px;
  color: #8b929a;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.my-code__value {
  display: block;
  overflow-wrap: anywhere;
  color: #7cc242;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1.4;
}

.friends-btn {
  display: inline-flex;
  height: 38px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
  border: 1px solid rgba(124, 194, 66, 0.16);
  border-radius: 6px;
  background: #18241e;
  color: #dcdedf;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.friends-btn:hover {
  border-color: rgba(124, 194, 66, 0.28);
  background: #203028;
  color: #fff;
}

.friends-btn--primary {
  border-color: #3d9c4a;
  background: #3d9c4a;
  color: #fff;
}

.friends-btn--primary:hover {
  border-color: #46b356;
  background: #46b356;
  color: #fff;
}

.friends-btn--block {
  width: 100%;
  margin-top: 11px;
}

.friends-field {
  display: block;
  margin-bottom: 6px;
  color: #8b929a;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.friend-add-form {
  display: block;
  margin: 0;
}

.friends-add-row {
  display: flex;
  gap: 8px;
}

.friends-input {
  min-width: 0;
  height: 38px;
  flex: 1;
  padding: 0 11px;
  border: 0;
  border-radius: 6px;
  background: #131c17;
  box-shadow: inset 0 0 0 1px rgba(124, 194, 66, 0.14);
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  outline: 0;
  text-transform: uppercase;
}

.friends-input::placeholder {
  color: #5d6670;
  text-transform: none;
}

.friends-input:focus {
  box-shadow: inset 0 0 0 1px rgba(124, 194, 66, 0.6);
}

.page-friends .friend-add-status {
  min-height: 0;
  margin: 8px 0 0;
  font-size: 11px;
  line-height: 1.45;
}

.page-friends .friend-add-status:empty {
  display: none;
}

.page-friends .friend-add-status.is-ok {
  color: #7cc242;
}

.page-friends .friend-add-status.is-error {
  color: #de8877;
}

.friends-card--note {
  background:
    radial-gradient(ellipse at 100% 0, rgba(124, 194, 66, 0.08), transparent 60%),
    #0d1410;
}

.friends-card--note .friends-card__head svg {
  color: #7cc242;
}

.friends-noscript {
  margin: 20px 0 0;
  padding: 14px 16px;
  border: 1px solid rgba(222, 107, 85, 0.3);
  border-radius: 6px;
  background: rgba(222, 54, 24, 0.08);
  color: #de8877;
  font-size: 12px;
}

.page-friends .friends-page :focus-visible,
.page-friends .friend-row__actions .btn:focus-visible,
.page-friends .friends-btn:focus-visible,
.page-friends .friends-input:focus-visible {
  outline: 2px solid #7cc242;
  outline-offset: 2px;
}

/* Responsive */
@media (max-width: 1024px) {
  .friends-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .friends-side {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .friends-card--note {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .friends-container {
    padding: 0 16px;
  }
  .friends-hero__inner {
    align-items: flex-start;
    padding-top: 32px;
    padding-bottom: 22px;
  }
  .friends-hero h1 {
    font-size: 30px;
  }
  .friends-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .friends-side {
    grid-template-columns: minmax(0, 1fr);
  }
  .friends-card--note {
    grid-column: auto;
  }
  .friends-panel__head {
    align-items: flex-start;
  }
  .friends-search {
    width: 100%;
  }
  .page-friends .friend-row {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 13px 14px;
  }
  .page-friends .friend-row__body {
    flex: 1 1 calc(100% - 58px);
  }
  .page-friends .friend-row__actions {
    width: 100%;
    padding-left: 56px;
    justify-content: flex-start;
  }
  .friends-guest {
    flex-direction: column;
    padding: 22px;
  }
}

@media (max-width: 420px) {
  .friends-stats {
    gap: 8px;
  }
  .friends-stat {
    padding: 10px 12px;
  }
  .friends-stat__label {
    font-size: 9px;
    letter-spacing: 0.1em;
  }
  .friends-stat__value {
    font-size: 20px;
  }
  .friends-add-row {
    flex-direction: column;
  }
  .friends-add-row .friends-btn {
    width: 100%;
  }
}
