

.online_friends_list {
  .list_item {
    overflow: hidden;

    &:hover {
      background: var(--surface-background);
    }

    &:active {
      background: white;
    }
  }

  .avatar {
    float: left;
    margin-right: 10px;
  }

  .username, .rank {
    font-family: 'Acme';
    font-size: 18px;
  }

  .username {
    margin-top: 5px;
    font-size: 18px;
  }

  .rank {
    position: absolute;
    top: 10px;
    right: 10px;
    color: grey;
  }

  .time {
    color: grey;
    margin-top: 5px;
    font-family: system-ui, sans-serif;
    font-size: 14px;
  }
}

#network {
  padding: 20px;
}

#friends_heading {
  scroll-margin-top: 62px;
}

.friendships_panel {
  margin-bottom: 28px;
  padding: 20px;
  border: 1px solid #d8e0e8;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(25, 48, 68, 0.05);

  .friendship_form_header {
    margin-bottom: 16px;

    .page_subtitle {
      margin: 0 0 4px;
      color: #263746;
      font-size: 22px;
    }

    p {
      margin: 0;
      color: #647181;
      font-size: 14px;
      line-height: 1.4;
    }
  }

  .friendship_form {
    margin: 0;
  }

  .friendship_form_label {
    display: block;
    margin-bottom: 7px;
    color: #34475a;
    font: 15px 'Acme';
  }

  .friendship_form_controls {
    display: flex;
    align-items: stretch;
    gap: 8px;

    input[type='text'], input[type='email'] {
      box-sizing: border-box;
      min-width: 0;
      width: 100%;
      padding: 9px 11px;
      border: 1px solid #bdcad5;
      border-radius: 7px;
      background: #fff;
      color: #263746;
      font-size: 16px;

      &:focus-visible {
        border-color: #1686bb;
        outline: 2px solid #b8e4fa;
        outline-offset: 1px;
      }
    }

    .btn_link {
      flex: none;
      padding: 8px 13px;
      border: 1px solid #1686bb;
      border-radius: 7px;
      background: var(--btn-primary);
      color: #08354d;
      font-size: 16px;
      white-space: nowrap;

      &:hover, &:focus-visible {
        border-color: #0874aa;
        background: #18a7e8;
      }

      &:focus-visible {
        outline: 2px solid #176b96;
        outline-offset: 2px;
      }
    }
  }
}

@media (max-width: 640px) {
  #network {
    padding: 14px;
  }

  .friendships_panel {
    padding: 17px 16px;
  }
}

@media (max-width: 460px) {
  .friendships_panel .friendship_form_controls {
    flex-direction: column;

    .btn_link {
      width: 100%;
    }
  }
}

#requested_list {
  margin-bottom: 10px;
}

.friend_list_item {
  font-family: 'Acme';

  .title {
    display: block;
    margin-top: 7px;
    font-size: 18px;
  }

  .avatar {
    float: left;
    margin-right: 10px;
  }

  .username {
    margin-top: 3px;
    color: #333;
    display: inline-block;
    font-family: 'Acme';
    font-size: 18px;
  }

  .friend_username {
    font-size: 22px;
    margin-top: 10px;
  }

  .status {
    margin-top: 5px;
  }

  .pending_rank, .friend_rank {
    margin-top: 3px;
    color: #666;
    font-size: 16px;
  }

  .friend_rank {
    position: absolute;
    top: 10px;
    right: 10px;
  }

  .links {
    margin-top: 5px;

    a {
      margin-right: 5px;

      &:hover {
        color: dodgerblue;
      }
    }
  }

  .buttons {
    position: absolute;
    bottom: 10px;
    right: 10px;
  }
}

#network {
  .list_items {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
  }

  .friend_list_item.message_item {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    height: auto;
    min-height: 90px;
    padding: 14px;
    border: 1px solid #d8e0e8;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(25, 48, 68, 0.04);

    &:hover {
      border-color: #bdcad5;
      background: #f8fbfd;
    }

    .username {
      max-width: 100%;
      overflow-wrap: anywhere;
      color: #263746;
    }

    .friend_avatar {
      position: relative;
      flex: none;
      width: 56px;
      height: 56px;

      .avatar {
        float: none;
        margin: 0;
        border-radius: 10px;
      }
    }

    .friend_details {
      flex: 1;
      min-width: 0;
    }

    .friend_username {
      display: block;
      margin: 0 0 6px;
      font-size: 22px;
      line-height: 1.2;
    }

    .friend_rank {
      position: static;
      display: flex;
      align-items: center;
      gap: 6px;
      margin: 0;
      color: #647181;
      font: 13px/1.3 system-ui, sans-serif;
    }

    .rank_value {
      padding: 2px 6px;
      border: 1px solid #d8e0e8;
      border-radius: 5px;
      background: #f1f5f8;
      color: #34475a;
      font-weight: 600;
    }

    .links {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin: 0;

      a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
        min-height: 36px;
        box-sizing: border-box;
        margin: 0;
        padding: 7px 10px;
        border: 1px solid #d8e0e8;
        border-radius: 7px;
        background: #f7f9fc;
        color: #34475a;
        font-size: 15px;
        text-decoration: none;

        &:hover {
          border-color: #1686bb;
          background: #e8f7fd;
          color: #08354d;
        }

        &:focus-visible {
          outline: 2px solid #1686bb;
          outline-offset: 2px;
        }

        &.friend_play {
          border-color: #9ddcf8;
          background: #e8f7fd;
          color: #176b96;

          &:hover {
            border-color: #1686bb;
            background: #d8effa;
          }
        }
      }
    }
  }
}

@media (max-width: 760px) {
  #network .friend_list_item.message_item .links {
    flex-basis: 100%;

    a {
      flex: 1;
    }
  }
}
