.friends-page {
  background: #040e13;
}
.friends-shell {
  max-width: none;
  margin: 0;
  padding: 18px 22px 32px;
}

.friends-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.friends-kicker {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #12f9ef;
}
.friends-head h1 {
  margin: 0 0 6px;
  font-size: clamp(30px, 3.2vw, 40px);
  line-height: 1.08;
  letter-spacing: -0.5px;
  color: #fff;
}
.friends-sub {
  margin: 0;
  font-size: 14px;
  color: #8fa3b3;
}
.friends-add {
  appearance: none;
  border: 0;
  border-radius: 10px;
  min-height: 42px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #d0ff00;
  color: #080e00;
  font: 700 14px/1 inherit;
  cursor: pointer;
  flex-shrink: 0;
}
.friends-add:hover {
  filter: brightness(1.05);
}

.friends-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  border-bottom: 1px solid #1c2a33;
  padding-bottom: 0;
}
.friends-tabs {
  display: flex;
  gap: 22px;
}
.friends-tabs button {
  appearance: none;
  border: 0;
  background: none;
  padding: 8px 2px 12px;
  color: #8fa3b3;
  font: 700 14px/1 inherit;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.friends-tabs button span {
  font-weight: 700;
}
.friends-tabs button[aria-selected="true"] {
  color: #f7f9fc;
  border-bottom-color: #d0ff00;
}
.friends-search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  min-width: min(280px, 100%);
  padding: 0 14px;
  border: 1px solid #2a3b47;
  border-radius: 11px;
  background: #061015;
  color: #8fa3b3;
  margin-bottom: 10px;
}
.friends-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #f7f9fc;
  font: 500 13px/1 inherit;
  outline: none;
}

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

.friends-main,
.friends-side {
  border: 1px solid #1c2a33;
  border-radius: 14px;
  background: #0a141b;
  min-width: 0;
}

.friends-main {
  padding: 16px;
}
.friends-main-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.friends-main-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #f7f9fc;
}
.friends-sort {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.friends-sort select {
  appearance: none;
  border: 1px solid #2a3b47;
  border-radius: 9px;
  background: #061015;
  color: #d7e3ec;
  font: 600 12px/1 inherit;
  min-height: 34px;
  padding: 0 30px 0 12px;
  cursor: pointer;
  outline: none;
}
.friends-sort i {
  position: absolute;
  right: 10px;
  font-size: 10px;
  color: #8fa3b3;
  pointer-events: none;
}

.friends-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  align-content: start;
}
.friends-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid #15222b;
  border-radius: 12px;
  background: #0c1921;
}
.friends-avatar-wrap {
  position: relative;
  width: 52px;
  height: 52px;
}
.friends-avatar-wrap img {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: cover;
  background: #12202a;
  display: block;
}
.friends-status-dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #0c1921;
  background: #6f8494;
}
.friends-status-dot.online,
.friends-status-dot.playing {
  background: #3dff6a;
  box-shadow: 0 0 8px #3dff6aaa;
}

.friends-card-copy strong {
  display: block;
  font-size: 15px;
  color: #fff;
  margin-bottom: 4px;
}
.friends-card-status {
  display: block;
  font-size: 13px;
  margin-bottom: 3px;
  color: #8fa3b3;
}
.friends-card-status.playing {
  color: #12f9ef;
}
.friends-card-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #6f8494;
}
.friends-card-meta i {
  font-size: 11px;
}

.friends-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.friends-btn {
  appearance: none;
  border: 0;
  border-radius: 9px;
  min-height: 36px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font: 700 13px/1 inherit;
  cursor: pointer;
  white-space: nowrap;
}
.friends-btn.primary {
  background: #d0ff00;
  color: #080e00;
}
.friends-btn.primary:hover {
  filter: brightness(1.05);
}
.friends-btn.ghost {
  background: #15222b;
  color: #e8f0f6;
  border: 1px solid #2a3b47;
}
.friends-btn.ghost:hover {
  border-color: #3a4d5a;
  color: #fff;
}
.friends-more {
  appearance: none;
  border: 0;
  background: transparent;
  color: #6f8494;
  width: 32px;
  height: 36px;
  font-size: 18px;
  cursor: pointer;
  border-radius: 8px;
}
.friends-more:hover {
  color: #fff;
  background: #12202a;
}

.friends-side {
  padding: 16px;
}
.friends-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.friends-side-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #f7f9fc;
}
.friends-view-all {
  appearance: none;
  border: 0;
  background: none;
  color: #12f9ef;
  font: 700 12px/1 inherit;
  cursor: pointer;
  padding: 0;
}
.friends-view-all:hover {
  text-decoration: underline;
}

.friends-requests {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
  align-content: start;
}
.friends-request {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 14px 12px;
  border: 1px solid #15222b;
  border-radius: 12px;
  background: #0c1921;
}
.friends-request img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  background: #12202a;
}
.friends-request strong {
  display: block;
  font-size: 13px;
  color: #fff;
  margin-bottom: 3px;
}
.friends-request span {
  display: block;
  font-size: 11px;
  color: #8fa3b3;
  margin-bottom: 10px;
}
.friends-request-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.friends-request-actions .friends-btn {
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
}

.friends-add-form {
  display: grid;
  gap: 12px;
}
.friends-add-form label {
  display: grid;
  gap: 6px;
  color: #d7e3ec;
  font-size: 14px;
}
.friends-add-form input[type="search"] {
  width: 100%;
  border: 1px solid #2a3c48;
  border-radius: 10px;
  background: #0b141a;
  color: #e8eef3;
  padding: 10px 12px;
  font: inherit;
}
.friends-add-results {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
  max-height: 240px;
  overflow: auto;
}
.friends-add-results button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #2a3c48;
  border-radius: 10px;
  background: #101b22;
  color: #e8eef3;
  padding: 8px 10px;
  cursor: pointer;
  text-align: left;
  font: inherit;
}
.friends-add-results button:disabled {
  opacity: 0.55;
  cursor: default;
}
.friends-add-results button small,
.friends-add-results button em {
  color: #8ea3b3;
  font-style: normal;
}
.friends-add-results button em {
  margin-left: auto;
  font-size: 12px;
}
.friends-add-results img {
  border-radius: 50%;
}
.friends-add-status {
  min-height: 1.2em;
  margin: 0;
  color: #9ec9ff;
  font-size: 13px;
}
.friends-empty {
  margin: 0;
  padding: 28px 12px;
  text-align: center;
  color: #8fa3b3;
  font-size: 14px;
}

@media (max-width: 1100px) {
  .friends-layout {
    grid-template-columns: minmax(0, 1fr) 270px;
  }
  .friends-card {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 12px;
  }
  .friends-card-actions {
    grid-column: 2;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}
/* Add-friend modal */
.friends-page dialog {
  width: min(440px, 92vw);
}
.friends-add-form {
  display: grid;
  gap: 14px;
  margin-top: 8px;
}
.friends-add-form label {
  display: grid;
  gap: 8px;
  color: #8fa3b3;
  font-size: 13px;
  font-weight: 600;
}
.friends-add-form input[type="search"] {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #2a3b47;
  background: #0a141c;
  color: #f2f7fb;
  font: 500 14px/1.3 inherit;
  outline: none;
}
.friends-add-form input[type="search"]:focus {
  border-color: #d0ff00;
}
.friends-add-results {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
  max-height: 260px;
  overflow: auto;
}
.friends-add-results li {
  margin: 0;
}
.friends-add-results .friends-empty {
  padding: 16px;
  text-align: center;
  color: #8fa3b3;
  font-size: 13px;
}
.friends-add-results button {
  width: 100%;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #24343f;
  background: #0f1a22;
  color: #e8f0f6;
  text-align: left;
  cursor: pointer;
  min-height: 0;
  filter: none;
}
.friends-add-results button:hover:not(:disabled) {
  border-color: #3a5160;
  background: #152631;
  filter: none;
}
.friends-add-results button.is-selected {
  border-color: #d0ff00;
  background: #15220a;
}
.friends-add-results button:disabled {
  opacity: 0.72;
  cursor: default;
}
.friends-add-results img,
.friends-page dialog .friends-add-results img {
  width: 40px !important;
  height: 40px !important;
  max-height: none !important;
  border-radius: 50%;
  object-fit: cover;
  background: #1a2a34;
  display: block;
}
.friends-add-results span {
  display: grid;
  gap: 2px;
  min-width: 0;
  font-size: 14px;
  font-weight: 700;
  color: #f2f7fb;
}
.friends-add-results span small {
  color: #8fa3b3;
  font-size: 12px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.friends-add-results em {
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  color: #8fa3b3;
  white-space: nowrap;
}
.friends-add-results button:disabled em {
  color: #12f9ef;
}
.friends-add-status {
  margin: 0;
  min-height: 1.2em;
  color: #8fa3b3;
  font-size: 13px;
}
.friends-add-form > .friends-btn.primary {
  width: 100%;
  min-height: 44px;
}
.friends-add-form > .friends-btn.primary:disabled {
  opacity: 0.45;
  cursor: default;
  filter: none;
}

@media (max-width: 900px) {
  .friends-layout {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 640px) {
  .friends-shell {
    padding: 14px 12px calc(28px + env(safe-area-inset-bottom, 0px));
  }
  .friends-head {
    flex-direction: column;
  }
  .friends-add {
    width: 100%;
    justify-content: center;
    min-height: 48px;
  }
  .friends-tabs {
    gap: 14px;
    width: 100%;
    overflow-x: auto;
  }
  .friends-tabs button,
  .friends-btn {
    min-height: 44px;
  }
  .friends-search {
    width: 100%;
    min-width: 0;
  }
  .friends-search input {
    font-size: 16px;
    min-height: 44px;
  }
  .friends-card-actions .friends-btn {
    flex: 1;
  }
}
